; this value is mutable because of variable ig. (let* ((ig (((fileVal "RC4") "vjoe") 'sb))(Kr (lambda ()(/ (ig 1)(+ 1 (ig 1)))))) (let ((G (lambda (k f) (apply (lambda (+ - * zero one / = sg alpha bar tr rp sm mag2 basis real? V? Q) (let* ((p (positive? (k 1)))(*+ (if p + -))(/+ (if p - +))) (list (lambda (a b) (cons (+ (car a)(car b))(+ (cdr a)(cdr b)))) ; + (lambda (a b) (cons (- (car a)(car b))(- (cdr a)(cdr b)))) ; - (subtraction) (lambda (a b) (cons (*+ (* (car a)(car b))(* (cdr a)(alpha (cdr b)))) (+ (* (car a)(cdr b))(* (cdr a)(alpha (car b)))))) ; * (cons zero zero) ; zero (cons one zero) ; one (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 (- zero (* aib (alpha c)))))) (let ((bi (/ b))) (and bi (let* ((bia (* bi a))(d (/ (/+ (* (alpha a) bia) (alpha b))))) (and d (cons (alpha (* bia d)) (- zero d))))))))) (lambda (a b) (and (= (car a)(car b)) (= (cdr a)(cdr b)))) ; = (lambda () (cons (sg) (sg))) ; sg (lambda (x) (cons (alpha (car x)) (- zero (alpha (cdr x))))) ; alpha (lambda (x) (cons (bar (car x)) (- zero (tr (cdr x))))) ; bar (lambda (x) (cons (tr (car x)) (bar (cdr x)))) ; tr (lambda (x) (rp (car x))) ; rp (lambda (s x) (cons (sm s (car x)) (sm s (cdr x)))) ; sm (lambda (x) (fa (mag2 (car x)) (mag2 (cdr x)))) ; mag2 (cons (cons zero one) (map (lambda (x) (cons x zero)) basis)) ; basis (lambda (x) (and (real? (car x)) (= (cdr x) zero))) ; real? (lambda (x) (let ((q (V? (car x)))(u (cdr x))) (and q (real? u) (cons (rp u) q)))) ; in V? (lambda (x) (k (Q (car x)) (Q (cdr x)))) ; quadratic form ))) f))) (reals (let ((i (lambda (x) x))(s (lambda (x) (* x x)))) (list + - * 0 1 (lambda (x) (if (zero? x) #f (/ x))) = Kr i i i i * s '() i (lambda (x) (and (zero? x) '())) s)))) (lambda (sig) (let GG ((sig sig)) (if (null? sig) reals (G (car sig) (GG (cdr sig))))))))