;; WARNING: You must load this file into scmlog, not scheme! ; Q4. ; (mem A L R) if R is a suffix of L that starts with A. ; E.g., (mem 3 (0 1 2 3 4 5) (3 4 5)) (fact (mem _x (_x . _y) (_x . _y))) (fact (mem _x (_ . _r) _s) (mem _x _r _s)) ; (num N) if N is an integer in the range 0..6. (fact (num _n) (mem _n (0 1 2 3 4 5 6) _)) ; (succ A B) if A+1 = B and 0 <= A < 6. (fact (succ _a _b) (mem _a (0 1 2 3 4 5 6) (_a _b . _))) ; (add A B C) if A+B = C and 0<= A, B, C < 7 (fact (add 0 _b _b)) (fact (add _a _b _c) (succ _a1 _a) (succ _c1 _c) (add _a1 _b _c1)) ; (mul A B C) if A*B = C and 0<= A, B, C < 7 (fact (mul 1 _b _b)) (fact (mul _a1 _b _c) (succ _a _a1) (mul _a _b _c1) (add _c1 _b _c)) ; (eval E V) if the value of E as a Scheme expression is V. E may ; consist only of integers, expressions (+ E1 E2) and (* E1 E2). ; *** YOUR CODE HERE *** ; Q5. ; Write your answer as a comment below: ; *** YOUR CODE HERE ***