FORMAL KINEMATICS ANALYSIS OF TWO LINK PLANAR ROBOT By Binyameen 2010-NUST-MS-CS&E-23 A thesis submitted in partial fulfillment of the requirements for the degree of Masters of Science in Computational Science and Engineering Research Centre for Modeling and Simulation, National University of Sciences and Technology (NUST), Islamabad, Pakistan. (August 2014) i
54
Embed
FORMAL KINEMATICS ANALYSIS OF TWO LINK PLANAR ROBOTsave.seecs.nust.edu.pk/Downloads/thesis_binyameen.pdf · FORMAL KINEMATICS ANALYSIS OF TWO LINK PLANAR ROBOT By Binyameen ... displacement,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
FORMAL KINEMATICS ANALYSIS OF TWO
LINK PLANAR ROBOT
By
Binyameen
2010-NUST-MS-CS&E-23
A thesis submitted in partial fulfillment of the requirements for the degree of Masters of
Science in Computational Science and Engineering
Research Centre for Modeling and Simulation,
National University of Sciences and Technology (NUST),
Kinematic analysis [19] is the study of motion of a machine or mechanism with respect to a
fixed reference coordinate system without considering the forces or moments that cause the
motion. The objective of any analysis of kinematics is to make refined intellectual models
that serve to explain the motion of real-world objects. It mainly allows us to determine
parameters like the position, displacement, rotation, speed, velocity and acceleration of
a given mechanical structure and is thus used to design the geometrical dimensions and
operational range of a mechanical structure according to the given specifications. Kine-
matics describes the analytical relationship between the joint positions and the end-effector
position and orientation while differential kinematics describes the analytical relationship
between the joint motion and the end-effector motion in terms of velocities. The main
idea behind kinematic analysis is to first identify the links (rigid bodies) and joints (allow
rotation or sliding) of the given mechanical structure and then construct a corresponding
kinematic (skeleton) diagram, which is a geometrical structure depicting the connectivity
of links and joints. Finally, the kinematic diagrams are analyzed, using the principles of
geometry, to determine the motion of any point of interest in the kinematic diagram [8].
Robot kinematics deals with aspects of redundancy, collision avoidance and singularity
avoidance.We have been created with bones, muscles and senses. Muscles are helpful in
controlling ourselves and senses are used for measurements: touch, vision, etc. Similarly
robots are made up of links and joints in numerous arrangements. Unintelligent robots can
merely control and compute the joints directly, such as rotate any joint for 200 pulses. These
1
joints are called coordinates. In order to achieve a task in an application, we have to handle
the position and orientation in different coordinate systems such as work piece to tool. The
embryonic robot is unfamiliar with the connections between joint coordinates and other
coordinate systems. It is very problematic to be used in applications. That distinguishes
a toy robot from an industrial robot. For a robot to move to specific position at certain
orientation conveniently, the relationships between the joint coordinate system and some
other systems, such as base or tool systems, must be known. Kinematic analysis allows
us to extract useful information about the workspace, dexterity and precision of a given
robotic design [32]. Thus, kinematic analysis is always performed during the conception
phase of a robot to ascertain that the designed robot is appropriate to serve the given
purpose [28]. For example, kinematic analysis has been used to judge the slope climbing
capability of a biped robot [25] and the repairing the human aortic aneurysm capability of
a minimal invasive surgical robot [9].
1.2 Techniques used for Kinematic Analysis
1.2.1 Numerical Methods or Simulation
Given the safety-critical nature of many robotic applications, traditional techniques, like
numerical methods or simulations, are not encouraged to be used for kinematic analysis
[30]. Numerical methods can only provide estimated solutions to problems over a definite
interval such as distance or time. The inaccuracy involved in the solution depends on the
problem solving technique. Numerical methods are used with larger systems containing
many connections. Numerical methods are employed when assessing empirical information
such as experimental data. Such information will contain some amount of error irrespective
of exactness and regulations conducted while doing the experiment. In such a situation it
is just wastage of time to use exact analytical methods because the solution can never be
more accurate than the input data. One of the main disadvantage of numerical method is
2
its pathological behavior. i.e. using this method we have to face difficulties with precision,
singularities and stability. Moreover simulation generates a way of evaluating solutions but
does not generate solutions themselves. Simulation is not precise. It does not yields an
answer but merely provides a set of the system’s response to different operating conditions.
In many cases, this lack of precision is difficult to measure. Simulation cannot naturally
be used to find an optimal solution. There are methods which long to optimize the result,
but simulation is not inherently an optimization tool.
1.2.2 Computer based Softwares for Kinematic Analysis
Computer algebra systems, like Maple and Mathematica, offer complete packages (e.g. [31])
for kinematic analysis of mechanical systems. Despite being very efficient for computing
mathematical solutions symbolically, these methods cannot be considered 100% reliable
due to the involvement of unverified huge symbolic manipulation algorithms in their core.
While formally correct, symbolic integrals may not be suitable for numerically computing
the area under the curve[8]. Also, for expressions that do not consist of elementary functions
(e.g., Bessel functions) computer algebra systems may have less success[6]. It is generally
perceived that failures in computer algebra systems are commonly due to memory excess:
for numerous problems in computer algebra, some of the best available algorithms agonize
with intermediary expression surge where the consequence is of tolerable size, but the
intermediary calculation meets serious memory limitations. As an alternative, interval
analysis has been used to find the safe kinematics for a minimum invasive surgical robot
[15]. However sometimes, due to computational pessimism, the resulting interval becomes
too large to provide any useful information. Moreover, interval analysis is not suitable
to exhaustively check the initial hypothesis of the model properly and thus cannot be
completely relied upon as well. Inaccuracies in kinematic analysis could lead to disastrous
consequences, including a robot’s breakdown [17], and thus investigating more reliable and
sound kinematic analysis techniques is a dire need.
3
1.2.3 Problem Description
In the past couple of decades, formal methods have emerged as a successful verification
technique for both software and hardware systems. The laborious exercise of creating a
mathematical model for the specified system and evaluating this model using mathematical
logics usually enhances the probabilities for catching artful but precarious design errors
that are mostly disregarded by conventional techniques like paper-and-pencil based proofs
or numerical methods[13]. However, due to the continuous nature of the analysis and
the immersion of analytical geometry, automatic state-based formal methods, e.g. model
checking, cannot be used to ascertain absolute correctness. On the other hand, leveraging
upon the high expressiveness of higher-order logic, theorem proving can provide the ability
to formally reason about the correctness of kinematic analysis. But to the best of our
knowledge, the underlying principles of kinematic analysis have not been formalized in
higher-order-logic so far and thus formal reasoning about the correctness of kinematic
analysis is not a straightforward task.
1.2.4 Proposed Solution
As a first step towards using a higher-order-logic theorem prover for formally verifying the
correctness of kinematic analysis, we present the formal reasoning support for a two-link
planar manipulator [28], i.e., a simple yet the most commonly used mechanical structure
in robotics. In particular, we present the formalization of forward and inverse kinematic
analysis equations of a two-link planar manipulator by extending the recently developed
analytical geometry theories available in HOL-Light [11]. The main advantage of these
outcomes is that they significantly reduce the user intercession for formal reasoning about
kinematic analysis of several robots, mainly because any robot with multiple links and
joints can be expressed in terms of a two-link planar manipulator. In order to demonstrate
the practical effectiveness and utilization of the reported formalization, we utilize it to
conduct the formal kinematic analysis of a biped robot [16, 14], i.e., a two-legged mobile
4
robot, in this thesis.
1.3 Related Work
The usage of formal methods in ascertaining the correctness of continuous and physical
systems is increasingly being advocated these days [2]. In this context, formal verification
of mechanical systems, particularly the ones used in automotive and robotic applications,
have gained particular interest due to their safety-critical applications [10]. For example,
formal verification of the movements of a Samsung Home-service Robot (SHR) is presented
by analyzing its discrete control software using the Esterel model checker [7]. Similarly, an
abstracted integer-valued behavior of the mobile outdoor robot RAVON is formally modeled
in the synchronous language Quartz and is formally verified using the Averest model checker
[23]. Moreover, in order to alleviate the problems associated with unintended acceleration
due to faulty accelerator pedals, the electrical and mechanical components of Toyota’s
electronic throttle controller (ETC) have been formally modeled and verified based on the
principles of timed automata and real-time logic [24]. Likewise, an abstraction approach for
generating a discretized state-space of mechanical systems is reported in [27]. In all these
model checking based verification efforts, the continuous dynamics of mechanical systems
had to be discretized in order to be able to construct a corresponding automata-based
model [26]. Such abstractions clearly compromise the accuracy of the analysis. These
limitations can be overcome by using higher-order-logic theorem proving in the context of
verifying mechanical systems. For example, the Isabelle theorem prover has been used to
formally verify a collision-avoidance algorithm for service robots [29]. Real number and
set theories have been utilized to formalize the contour of the robot as a convex polygon
while obstacles are modeled as connected sets of points. This way, it has been formally
verified that the moving robot is able to stop, upon detecting an obstacle, within the safety
zone. The results have been verified without using any abstractions, which clearly indicates
the usefulness of theorem proving in the context of verifying mechanical systems. With
5
the same motivation, we plan to utilize higher-order-logic theorem proving for kinematic
analysis in this thesis, which, to the best of our knowledge, is a novelty.
The foremost requirement for conducting kinematic analysis in a higher-order-logic the-
orem prover is the ability to formally reason about geometry theory principles in a theorem
prover. This capability is provided by a number of theorem provers. For example, a formal
proof environment for Euclid’s elements is presented in [1]. Some other recent develop-
ments include the axiomatic formalization of Euclidian plane geometry along with some
interactive and automated reasoning support for geometrical properties in the Coq theo-
rem prover[22], the formalization of the Cartesian-plane based geometry theory along with
the proof that it can model the synthetic plane geometries in the Isabelle/HOL theorem
prover [21], and the HOL-Light geometry theory formalized, based on n-dimensional real
vector (realn), in the Euclidean space [11]. In this thesis, we have chosen the HOL-Light
theorem prover for developing the foundations of kinematic analysis. The main reasons
behind this choice include the availability of all the topological and analytic foundations
for vectors, which is expected to play a vital role in extending the reported formalization
for analyzing other continuous aspects of mechanical systems, and our past familiarity with
the HOL-Light.
1.4 Organization of the Thesis
The rest of the thesis is organized as follows: Some related work about formal verification
of mechanical systems and formalization of geometry theory is presented in Chapter 3. In
Chapter 3, we also provide a brief introduction about kinematic analysis of a two-link planar
manipulator. The formalization of these foundations of kinematic analysis is provided in
Chapter 4. We utilize this formalization to conduct the formal kinematic analysis of a
biped robot in Chapter 5. Finally, Chapter 6 concludes the thesis.
6
Chapter 2
Preliminaries
In this chapter, we describe a concise overview of the HOL-light theorem prover and or-
ganize an impression of Harrison’s formalization of geometry, vector and complex analysis.
The purpose is to familiarize the basic theories along with some symbolic representations
that are going to be used in the other part of the thesis.
2.1 Theorem Proving
One of the most advanced research area in automated reasoning is theorem proving or
automatic deduction. It is concerned about the formation of mathematical theorems using
a computer software package. Based upon the descriptive requirement, these mathematical
theorems can be prepared on the basis of different types of logic, e.g. first-order logic or
propositional logic or higher-order logic. For example, the advantage of using higher-order
logic instead of first order logic appears in terms of the accessibility of extra quantifiers and
extremely expressive nature of higher-order logic. Mathematically model the given system
in an appropriate logic is the key idea behind the theorem proving based formal analysis
and then the related properties are proved using computer based formal reasoning. The
analysis becomes much easier if we use higher-order logic theorem proving for modeling
the system behaviors because any system that can be expressed mathematically, can be
formal verified using higher-order logic. The theorem provers usually based upon some
renowned axioms and primitive inference rules. The verification based on theorem proving
guarantees the accuracy because all new theorems are formed from these fundamental
axioms and primitive inference rules.
7
A theorem prover or proof assistant is a tool which enables the formal sketch of a given
system in the form of mathematical expressions. There are two kinds of provers, i.e., inter-
active and automatic. Significant user-computer interaction is required in using interactive
theorem prover, while automatic theorem prover can accomplish different proof tasks by
its own. There are a large number of theorem provers but only few of them have large user
communal and are in constant improvement. Some frequently used automated provers are
Gandalf, LeanTAP, METEOR, SATURATE, SETHEO and Otter and MetiTarski. Some
commonly used interactive higher-order logic based theorem provers include includes HOL,
HOL Light, ACL2, Coq, Isabelle, ProofPower, and MIZAR.
This thesis uses the HOL Light theorem prover to demeanour all the robotics kinemat-
ics analysis. The main motives behind this selection comprise the richness of Harrison’s
geometry analysis related theories, which are central to our work, and the capability to
use Harrison’s vector theory to formalize the angles and thus the end effector position.
Moreover, some earlier work related to formal analysis of complex analysis inspired this
thesis to be done in HOL theorem prover. functions.
2.2 HOL Light Theorem Prover
HOL Light is a computer software package to support users proves thought-provoking
mathematical theorems entirely formally in higher order logic. It establishes a very rig-
orous model of precision, but offers a number of pre-proved mathematical theorems and
automated tools (e.g. about arithmetic, real analysis and basic set theory) to prevent the
user effort. It is also completely programmable, so users can outspread it with new in-
ference rules and theorems without conceding its reliability. HOL is available in different
versions, going back to Mike Gordons work in the early 80s. HOL Light uses much easier
logical fundamentals and has little relic code, producing the system a straightforward and
simple feel as compared to other HOL systems. Notwithstanding its easiness, it deals with
theorem proving power as compared to, and in some areas better than, different versions
8
of HOL, and is widely used for some substantial industrial-scale verification applications.
HOL Light is one of the theorem provers of HOL family. The primarily version of
HOL is HOL88 trailed by following versions i-e, HOL90 and HOL98 and HOL4. It is a
cooperative theorem prover which is based on the LCF methodology which is alike to the
deduction system in which even every infinitesimal point need to be stated in detail. It
supports in writing the given system and its properties in form of mathematical properties
in metalanguage ML [20] to automate the inferences. Based on the Church[5] method ,the
HOL family provides a version of λ-calculus. HOL Light contains ten primitive rules of
inference. For the formal verification of both hardware and software, HOL Light is more
acceptable and commonly used.
HOL Light is a comparatively new edition of the HOL theorem prover. In this version
a re-engineered and simplified version of the axiomatization of the logic is given. HOL
Light is relatively small and clean as compared with other versions of HOL, and creates
acceptable demands on the running machine.
Based on polymorphic simple type theory, theorems are proved in a system of classi-
cal higher order logic in HOL Light. All proof progresses by the application of low-level
inference rules in order to maintain a high level of reliability. Several advantageous math-
ematical theories e.g. vector analysis, already exist.
2.3 Terms
Terms are identical to strings, used purely as symbolic terms. Terms are not only denoted
as collections of characters, but with the help of more affluent tree-structured depiction,
they are similar to an ’abstract syntax tree’. HOL’s logic is constructed on λcalculus in
which terms are assembled beginning from constants and variables by means of abstraction
and application. All mathematical and logical avowals are denoted in this identical way.
Constants and variables are most likely acquainted to the reader from an informal
knowledge of mathematics. Constants and variables are manipulated as the building-blocks
9
of terms. Any name can be assigned to variables, e.g. y, x, delta, angle. Constants, e.g. ⊥
(false),> (true) and [ ] (the empty list) are meant to be acronyms for other terms. Constants
dont include a couple of primitive ones, e.g. equality itself. Before using in the terms, its
definition is required.
Application is an application of a function to an operation used constantly in mathe-
matics, known as an argument. f(t) is the conventional syntax to apply a function f to an
argument t. Since HOL follows λ-calculus principles so it permits the parentheses to be
excluded, except they are desirable as t may be a composite term by itself.
Abstraction is, in a precise sense, a reverse operation to application. Given a variable y
and a term t, which may or may not have y, we can make the so-called lambda-abstraction
λy. t. It is read as ‘the function of y that uses t as its argument’. Abstractions are
not frequently perceived in informal mathematics, but they comprise at minimum two
merits. Firstly, variable dependencies and binding are made explicitly; in opposite to in
informal mathematics it is often written f(y) in conditions where the actual meaning is λy.
f(y). Secondly they permit the user to compose indistinctive function-valued expressions
deprived of specifying them (Usually we see y → t[y] used for this idea), and as we are
using higher order logic, it’s necessary to put functions on an equal basis with first-order
objects in this pattern.
2.4 Types
An important feature of HOL is that every term has a definite type. The type shows what
kind of mathematical object the term denotes (a set, a number, a function, etc) .If HOL is
capable to allocate a type to a term, but it is not determined exclusively, a common type
will be allocated automatically: But type annotations to subterms of compound terms can
be assigned. The importance of types is that they can sort out such ’nonsensical’ terms
from the begining, and monitor certain native constraints without unusual user assistance.
HOL, being based upon λcalculus, follows simple type theory quite closely. Every term
10
has a distinctive type which is either one of the elementary types or the result of applying a
type constructor to other types. The only elementary type in HOL is primarily the type of
booleans bool and the only type operator is the function space constructor. HOL prolongs
Church’s system by letting also ‘type variables’ which give a system of polymorphism.
Constants with polymorphic type are basic, and can have many types subsequent from
fixing the names of the type variables.
For knowledge, types are written in a concrete syntax with some type constructors like
written in x. Just as with constant and variable terms, type variables and type constants are
not separated syntactically: HOL’s parser accepts that everything whose name resembles
to a constant is a constant, and every other identifier is a variable. However, it’s customary
to use names beginning with an uppercase letter for type variables, e.g. X and Value.
2.5 Inference Rules
Inference rules are routes for developing new theorems and they are denoted as ML func-
tions. All other rules are based upon these inference rules and axioms. The rules are REFL
(Reflexivity: equality is reflexive), TRANS (Transitivity: equality is transitive), MK CON
(Make conversion: equal functions applied to equal arguments give equal results), ABS (Ab-
straction: if, without using any special properties of x, two expressions involving x are equal,
then the functions that take x to those values are equal), BETA (Beta-conversion: com-
bination and abstraction are converse operations), ASSUME (Assumption introduction:
from any p we can deduce p), EQ MP (Equality-mapping: connects equality with deduc-
tion), DEDUCT ANTISYM RULE (Deduction-antisymmetric-rule: also connects equality
and deduction), INST (Instantiation: variables are to be interpreted as schematic) and
INST TYPE (Instantiation-type: same, but for substitution of type variables rather than
term variable.
11
2.6 Theorems
In conventional formal logic, with the help of a precise set of syntactic rules to some
primary axioms, a formula is verified. In HOL Light, a similar concept is used in a more
computational arrangement. An exclusive type thm (’theorem’) is utilized for formulas that
have been, actually have been, not merely can be proved. A theorem is a formal statement
of the type of an axiom or it is supported from other formalized theorems by an inference
rule. A theorem is formed with a finite set of boolean terms Ω known as assumptions and
a boolean term S known as the conclusion. Any additonal theorem can be formed only
on the basis of already proved theorems. I this way, it will also satisfy the inference rules
mentioned above.
2.7 Theories
A HOL Light theory contains of a set of types, operators, definitions, constants, theorems
and axioms. It comprises a lot of theorems that have previously been proved from the
definitions and axioms. The HOL Light theories can be loaded to use the existing definitions
and theorems in those theories. The readiness of HOL Light theories permits the user to
use and outspread the present results without replicating the struggles that have already
been put in assembling such theories. HOL Light theories can have other existing theories
as well. For example, one of the Multivariate theory in HOL Light is geom which also
include real theory available in Multivariate also. We utilized the HOL Light theories of
Geometry, Vectors, Complex numbers, Real numbers and transcendental functions in this
thesis. One of the major inspirations of choosing the HOL Light theorem prover for our
work was to get advantage from these integrated mathematical theories.
12
2.8 Proofs in HOL Light
In HOL Light, two types of interactive proof methods are available: backward and forward.
Backward proof method is based on the model of a tactic; which is an ML function that
breakdowns goals into uncomplicated subgoals. In this method, the handler initiates with
the required theorem or the desired goal that is further breakdowns to easy subgoals using
the tactics which is a ML-function that breakdowns a goal into subgoals. A forward proof
method is the reverse of the backward or a goal directed proof method. In a forward proof,
the user initiates from the basis built-in inference rules and attempts to prove the require
goals on top of these inference rules and existing theorems. The forward proof method
is tough approach as compared to backward proof method due to its requirement all the
low level details of the proof. There are also many automatic proof assistants and proof
procedures existing in HOL Light which aids the user in leading the proof to the end.
In interactive theorem verification techniques user interacts with the proof editor of HOL
Light and till the last step of the proof, directs the necessary tactics to the prover. In HOL
Light, only a few proof steps are automatically solved by the prover whereas many others
have need of significant user interaction.
2.9 HOL Light Notations
The Table 2.1 presents the mathematical understanding of some HOL Light symbols and
functions used in this thesis. These symbolizations will be commonly seen in the formal-
ization mentioned in the coming chapters. The reason to mention these symbols here is to
get the person who reads handsomely equipped with the terms to come in this thesis.
13
Table 2.1: HOL Symbols and Functions
HOL-Light Symbol Standard Symbol Meaning∨ or Logical or∧ and Logical and∼ not Logical negation
<==> = Equality==> −→ Implication!x.t ∀x.t for all x : t?x.t ∃x.t for some x : tnum 0, 1, 2, . . . Positive Integers data typereal All Real numbers Real data typeabs x |x| Absolute functionsuc n (n+ 1) Successor of natural numberln x loge(x) Natural logarithm function
max x y max(x, y) Maximum of x and ymin x y min(x, y) Minimum of x and yinv x 1/x Inverse of xFACT n n! Factorial of nm ∗ ∗ n mn num m raised to num exponent ninv x x−1 Multiplicative inverse of a real xλx.t λx.t Function that maps x to t(x)
lim(λn.f(n)) limn→∞
f(n) Limit of a real sequence f
x|P (x) λx.P (x) Set of all x that satisfy the condition P(a, b) a x b A mathematical pair of two elements
2.10 Harrison’s Formalization of Multivariate Calcu-
lus Theories in HOL-Light
This section contains a concise overview to the already available multivariate vectors and
geometry theories in the HOL Light theorem prover so that the person who reads gets
familiar with some working awareness of the notations and definitions used in this thesis.
Moreover the purpose is to sort this thesis self-reliant and thus enable its interpretation for
a broader audience, containing both formal methods and robotics industrial communities.
14
2.10.1 Formalization of Vectors Theory
In HOL-Light, a vector having n-dimensional is denoted as Rn column matrix of real
numbers. All of the vector manipulations are then treated as matrix operations. Using this
reprsentation, vectors can be denoted by the data-type R2 for a proof in plane geometry,
i.e, a column matrix containing two elements [11]. In the formalization of vectors, the
first real number indicates the first (horizontal) component and the second real number
symbolizes the second (vertical) component of the corresponding point of which the location
is described by the vector. Some of the important definitions related to vectors are given
as follows:
Definition 1: Vectors Addition
` x + y = lambda i. x$i + y$i
Addition and similar pointwise operations are defined according to the above pattern. Note
that we overload the usual arithmetic symbols like +, but that the underlying constant on
the left is actually vector add (:realˆN→ realˆN→ realˆN), whereas the + on the right is
the usual addition of real numbers[11]. The notation x$i represents the $ith$ component
of a vector x.
Definition 2: Vector Scalar Multiplication
` c % x = lambda i. c * x $i
Any scalar number c can be multiplied with vector such that each component of the vec-
tor is separately multiplied by the scalar. Here on the left % operator is used which is used
to multiply a scalar number to with the vector but on the right is the usual multiplication
of two real numbers.
Definition 3: Vector Corresponding to small Natural Numbers
` vec n = lambda i. & n
15
The above mentioned definition in an inoculation from natural numbers, advantageous
to indicate the null vector by vec 0.
Definition 4: Dot Product of Vectors
` (x:real^ N) dot (y:real^ N) =
sum(1..dimindex(UNIV:N→bool)) (λ i. x$i * y$i)
One of the interesting definitions is the scalar (dot) or inner product. We showed here
it with the suitable type explanations. In informal mathematics, a very close definition to
it is written as x · y = Σ i=1n xiyi. The difference between two definitions is that in our
formal definition N is a type, we have to change it to a number by using dimindex to its
universe set.
In the definition mentioned above, norm is utilised representing the normalization of a
vector. The magnitude of vector is usually described using it. In HOL-Light [11], norm
has been formalised as follows:
Definition 5: Vector Norm
` norm x = sqrt (x dot x)
where sqrt in the HOL-Light is used to represent square root function for real numbers.
The corresponding distance function is utilised in our formalization to model robotic
arm. In HOL-Light dist (distance function) is formalized as follows:
Definition 6: Distance Function
` dist (x,y) = norm (x - y)
The function dist accepts two numbers of type real N and give the distance between them
using the norm function defined above.
Definition 7: Orthogonality
` orthogonal x y ⇔ (x dot y = & 0)
16
This definition states that the two vectors will be perpendicular to each other if and
only if their dot product is zero. It is obvious from our basic knowledge that cosθ becomes
zero when the angle θ is 90o. This is very much helpful in order to show the orthogonality
of cartesian coordinate system reference axis.
2.10.2 Formalization of Geometry Theory
Geometry is particularly rich in WLOG principles, perhaps reflecting the fundamental im-
portance in geometry of property-preserving transformations. The modern view of geome-
try has been heavily influenced by Kleins Erlanger Programm, which emphasizes the role
of transformations and invariance under classes of transformations, while modern physical
theories usually regard conservation laws as manifestations of invariance properties: the
conservation of angular momentum arises from invariance under rotations, while conser-
vation of energy arises from invariance under shifts in time, and so on. One of the most
important ways in which such invariances are used in proofs is to make a convenient choice
of coordinate system. In our formulation of Robotics Kinematics in HOL Light, geometric
concepts are all defined in analytic terms using vectors, which in turn are expressed with
respect to a standard coordinate basis [12]. For example, the angle formed by three points
is defined in terms of the angle between two vectors:
Definition 1: Angle
` angle (a,b,c) = vector angle (a - b) (c - b)
which is defined in terms of norms and dot products using the inverse cosine function acs
(degenerating to π/2 if either vector is zero):
Definition 2: Vector Angle
` vector angle x y =
if x = vec 0 then pi / &2
else acs ((x dot y) / (norm x) * (norm y))
17
where norms are defined in terms of dot products as described above. In some situations
assume that we need the sum of angles of a triangle which we know that from basic geometry,