-
Notifications
You must be signed in to change notification settings - Fork 35
/
density.clif
executable file
·68 lines (54 loc) · 1.64 KB
/
density.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
/*******************************************************************************
* 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 http://colore.oor.net/density/density.clif
(cl-imports http://colore.oor.net/mass/amount.clif)
(cl-imports http://colore.oor.net/size/spatial_volume.clif)
(forall (v m)
(iff (density (dmv v m))
(and (amount m)
(spatial_volume v)
(lesser zero_volume v))))
(forall (v d)
(if (and (density d)
(spatial_volume v))
(exists (m)
(= (dmv v m) d))))
(forall (m d)
(if (and (amount m)
(density d))
(exists (v)
(= (dmv v m) d))))
(forall (x y z)
(if (= (dmv x y) (dmv z y))
(= x z)))
(forall (x y z)
(if (= (dmv x y) (dmv x z))
(= y z)))
(forall (a m v)
(if (and (amount m)
(spatial_volume v)
(field a))
(= (dmv v (mult_mass a m)) (mult_density a (dmv v m)))))
(forall (a m v)
(if (and (amount m)
(spatial_volume v)
(field a))
(= (dmv (mult_volume a v) m) (mult_density a (dmv v m)))))
(forall (m1 m2 v)
(if (and (amount m1)
(amount m2)
(spatial_volume v))
(= (dmv v (add_mass m1 m2)) (add_density (dmv v m1) (dmv v m2)))))
(forall (m v1 v2)
(if (and (mass m)
(spatial_volume v1)
(spatial_volume v2))
(= (dmv (add_volume v1 v2) m) (add_density (dmv v1 m) (dmv v2 m)))))
)