diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2021-08-27 01:04:05 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2021-08-27 01:04:05 +0900 |
commit | afbbb947921dd93024a616086d5f75b581d70437 (patch) | |
tree | 48a2ac31d8bbaf65ae149ad5f2e0ec503a820f30 /units.lisp | |
parent | dd309809e2c4f88c53002b42eddb93837ae05cda (diff) |
units: Add units.lisp
Diffstat (limited to 'units.lisp')
-rw-r--r-- | units.lisp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/units.lisp b/units.lisp new file mode 100644 index 0000000..4b353e1 --- /dev/null +++ b/units.lisp @@ -0,0 +1,39 @@ +(defun m (x) + x) + +(defun s (x) + x) + +(defthm m+m + (equal (+ (m x) (m y)) + (m (+ x y)))) + +(defthm s+s + (equal (+ (s x) (s y)) + (s (+ x y)))) + +(defun m/s (x) + x) + +(defthm m/s+m/s + (equal (+ (m/s x) (m/s y)) + (m/s (+ x y)))) + +(defthm m/s*s + (equal (* (m/s x) (s y)) + (m (* x y)))) + +(defthm m*/s + (equal (* (m x) (/ (s y))) + (m/s (* x (/ y))))) + +(defthm m*/m/s + (equal (* (m x) (/ (m/s y))) + (m (* x (/ y))))) + +(in-theory (disable m s m/s)) + +(defthm test + (equal (/ (m x) (/ (m y) (s z))) + (m (/ x (/ y z)))) + :rule-classes nil) |