; http://cap-lore.com/MathPhys/Algebras/Clifford/CliffProg4.html (list (lambda (f) (apply (lambda (sg / tr bar alpha zer one + - * rls basis) (list (lambda () (cons (sg) (sg))) ; sg (lambda (x) (let* ((a (car x))(b (cdr x))(ai (/ a))) ; / Inverse (if ai (let* ((aib (* ai b))(c (/ (+ a (* b (alpha aib)))))) (and c (cons c (- (* aib (alpha c)))))) (let ((bi (/ b))) ; (write (list 'Boo bi)) (newline) (and bi (let* ((bia (* bi a))(d (/ (- (+ (* (alpha a) bia) (alpha b))))) (c (alpha (- (* bia d))))) (and d (cons c d)))))))) (lambda (x) (cons (tr (car x)) (bar (cdr x)))) ; tr (lambda (x) (cons (bar (car x)) (- (tr (cdr x))))) ; bar (lambda (x) (cons (alpha (car x)) (- (alpha (cdr x))))) ; alpha (cons zer zer) ; zer (cons one zer) ; one (lambda (a b) (cons (+ (car a)(car b))(+ (cdr a)(cdr b)))) ; + (lambda (a) (cons (-(car a))(-(cdr a)))) ; - (negation) (lambda (a b) (cons (+ (* (car a)(car b))(-(* (cdr a)(alpha (cdr b))))) ; * (+ (* (car a)(cdr b))(* (cdr a)(alpha (car b)))))) (lambda (x)(cons (rls x) zer)) ; rls (cons (cons zer one) (map (lambda (x) (cons x zer)) basis)) ; basis )) f)) (let ((i (lambda (x) x))) (list (lambda (x)(and (not (zero? x)) (/ x))) i i i 0 1 + - * i '()))) ; test (ylppa (fileVal "Clifford2") (lambda (G reals) (map (lambda (rn) (ylppa (G (G (G (G (cons rn reals))))) (lambda (sg / tr bar alpha zer one + ng * rls basis) (let ((= equal?)) (let lp ((n 100)) (or (zero? n) (and (let ((a (sg))(b (sg))(c (sg))) (and (= (+ a b)(+ b a)) (= (+ a (+ b c)) (+ (+ a b) c)) (= (* a (* b c)) (* (* a b) c)) (equal? zer (* a zer)) (= (* a one) a) (= (* (+ a b) c) (+ (* a c) (* b c))) (= (* (tr a)(tr b))(tr (* b a))) (= (+ (tr a)(tr b))(tr (+ a b))) (= (* (alpha a)(alpha b))(alpha (* a b))) (= (+ (alpha a)(alpha b))(alpha (+ a b))) (= (* (bar a)(bar b))(bar (* b a))) (= (+ (bar a)(bar b))(bar (+ a b))) (let ((bi (/ b))) (if bi (and (= a (* b (* bi a))) (= (* b bi) one) (= (* bi b) one)) (begin (write (list 'ZD b)) (newline) #t))))) (lp (- n 1))))))))) (list ((fileVal "rr") "fli2") (let ((U (((fileVal "RC4") "Fool6") 'U))) (lambda () (let ((x (U))) (if (< x 0.3) -1 (if (< x 0.7) 0 1)))))))))