Exercise 1.1 | |
q | a |
10 | 10 |
(+ 5 3 4) | 12 |
(- 9 1) | 8 |
(/ 6 2) | 3 |
(+ (* 2 4) (- 4 6)) | (+ 8 -2) =6 |
(define a 3) | a=3 |
(define b (+ a 1)) | b=4 |
(+ a b (* a b)) | (+ 3 4 (* 3 4) =(+ 3 4 (12)) =(19) |
(= a b) | False |
(if (and (> b a) (< b (* a b))) b a) | (if (and (> 4 3) (< 4 ( * 3 4))) b a) =(if (and (true) (< 4 (12)) b a) =(if (and (true) (true)) b a) =(if (true) b a) =b =4 |
(cond ((= a 4) 6) ((= b 4) (+ 6 7 a)) (else 25)) | (cond ((false) 6) ((true) (+ 6 7 3)) (else 25)) = 16 |
(+ 2 (if (> b a) b a)) | (+ 2 (if (> 4 3) 4 3)) = (+ 2 (if (true) 4 3)) = (+ 2 4) = 6 |
(* (cond ((> a b ) a) ((< a b) b) (else -1)) (+ a 1)) | (* (cond ((> 3 4) 3) ((< 3 4) 4) (else -1)) (+ 3 1)) =(* (cond ((false) 3) ((true) 4) (else -1)) (4)) =4*4 =16 |