/
mechanical-components.clif
160 lines (137 loc) · 5.47 KB
/
mechanical-components.clif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*******************************************************************************
* Copyright (c) University of Toronto and others. All rights reserved.
* The content of this file is licensed under the Creative Commons Attribution-
* ShareAlike 4.0 Unported license. The legal text of this license can be
* found at http://creativecommons.org/licenses/by-sa/4.0/legalcode.
*
* Contributors:
* Michael Gruninger - initial implementation
*******************************************************************************/
(cl-text mechanical-components
(cl-imports component-assemblies)
(cl-imports simple-geometry)
(cl-comment 'KIF to CLIF translation of http://ksl-web.stanford.edu/knowledge-sharing/ontologies/html/mechanical-components/mechanical-components.lisp.html')
(cl-comment 'This theory provides a minimal vocabulary for describing three-dimensional objects with mass. It is built on the abstract notion of components that we get from the component-assemblies theory, and the elementary geometric primitives from the simple-geometry theory. In this theory, we say that a MECHANICAL-COMPONENT is a component that has a REFERENCE-POINT, a REFERENCE-FRAME, and a MASS. Information about the spatial extent and relative position of the object can be specified using the reference frame and point. The MASS of a mechanical-component is a physical quantity specified as the value of a unary function. The INERTIA-TENSOR for the component is given with a binary relation from the component and its reference point to an inertia quantity.')
(cl-comment 'ISSUES: Copyright (c) 1994 Greg Olsen and Thomas R. Gruber')
(cl-comment '
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Physical Components
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
')
(cl-comment '
(define-class MECHANICAL-COMPONENT (?p)
Mechanical-component is a specialization of COMPONENT from the component-assemblies theory. Mechanical components are three-dimensional objects with an associated reference point and reference frame. They also have a slot called MASS whose value is a scalar-quantity of dimension mass-dimension.
:def (and (component ?p)
(3D-point (REFERENCE-POINT ?p))
(3D-frame (REFERENCE-FRAME ?p))
(scalar-quantity (MASS ?p))
(3D-dyad (inertia-tensor ?p (reference-point ?p)))))
')
(forall (?p)
(if (MECHANICAL-COMPONENT ?p)
(and (component ?p)
(3D-point (REFERENCE-POINT ?p))
(3D-frame (REFERENCE-FRAME ?p))
(scalar-quantity (MASS ?p))
(3D-dyad (inertia-tensor ?p (reference-point ?p))))))
(cl-comment '
(define-class MECHANICAL-CONNECTION (?c)
The physical-connection class is a specialization of the connection class from the component-components theory.
:def (connection ?c))
')
(forall (?p)
(if (MECHANICAL-CONNECTION ?c)
(connection ?c)))
(cl-comment '
(define-function REFERENCE-POINT (?comp) :-> ?point
The reference point of a mechanical-component.
:def (and (mechanical-component ?comp)
(3D-point ?point)))
')
(cl-comment 'define-function')
(forall (?comp ?point)
(if
(and (= (REFERENCE-POINT ?comp) ?point)
(mechanical-component ?comp))
(3D-point ?point)))
(cl-comment '
(define-function REFERENCE-FRAME (?comp) :-> ?frame
The reference frame of a mechanical-component.
:def (and (mechanical-component ?comp)
(3D-frame ?frame)))
')
(forall (?comp ?frame)
(if
(and (= (REFERENCE-FRAME ?comp) ?frame)
(mechanical-component ?comp))
(3D-frame ?frame)))
(cl-comment '
(define-function MASS (?comp) :-> ?m
The mass of a mechanical-component, which is a scalar
quantity of physical-dimension mass-dimension.
;; This is an attribute
:def (and (mechanical-component ?comp)
(scalar-quantity ?m)
(quantity.dimension ?m mass-dimension)))
')
(forall (?comp ?m)
(if (and (= (MASS ?comp) ?m)
(mechanical-component ?comp)
(scalar-quantity ?m))
(quantity.dimension ?m mass-dimension)
)
)
(cl-comment '
(define-function INERTIA-TENSOR (?comp ?pt) :-> ?i
The inertia tensor of mechanical-component. Relative to a given point.
:def (and (mechanical-component ?comp)
(3D-point ?pt)
(3D-dyad ?i)
(quantity.dimension
?i
(* mass-dimension
(* length-dimension
length-dimension)))))
')
(forall (?comp ?pt ?i)
(if (and (= (INERTIA-TENSOR ?comp ?pt) ?i)
(mechanical-component ?comp)
(3D-point ?pt)
(3D-dyad ?i))
(quantity.dimension ?i (* mass-dimension (* length-dimension length-dimension)))
)
)
(cl-comment '
(define-function APPLIED-FORCE (?comp1 ?comp2) :-> ?f
The resultant applied force of comp1 on comp2. A 3D vector.
:def (and (mechanical-component ?comp1)
(mechanical-component ?comp2)
(3D-vector-quantity ?f)
(quantity.dimension ?f force-dimension)))
')
(forall (?comp1 ?comp2 ?f)
(if (and (= (APPLIED-FORCE ?comp1 ?comp2) ?f)
(mechanical-component ?comp1)
(mechanical-component ?comp2)
(3D-vector-quantity ?f))
(quantity.dimension ?f force-dimension)
)
)
(cl-comment '
(define-function APPLIED-TORQUE (?comp1 ?comp2) :-> ?t
The resultant applied torque of comp1 on comp2. A 3D vector.
:def (and (mechanical-component ?comp1)
(mechanical-component ?comp2)
(3D-vector-quantity ?t)
(quantity.dimension ?t (* force-dimension
length-dimension))))
')
(forall (?comp1 ?comp2 ?t)
(if (and (= (APPLIED-TORQUE ?comp1 ?comp2) ?t)
(mechanical-component ?comp1)
(mechanical-component ?comp2)
(3D-vector-quantity ?t))
(quantity.dimension ?t (* force-dimension length-dimension))
)
)
)