(defun prec (x) (cond ((null x) (quote nil)) ((car x) (cond ((null (cdr x)) (quote nil)) ((quote t) (cons (quote nil) (cdr x))))) ((quote t) (cons (quote t) (prec (cdr x)))))) (defun plus (a b) (plus3 a b (quote nil))) (defun plus3 (a b c) (cond ((and (null a) (null b)) (and c (quote (t)))) ((null a) ((lambda (s) (cons (car s) (plus3 (quote nil) (cdr b) (cdr s)))) (full-add (quote nil) (car b) c))) ((null b) ((lambda (s) (cons (car s) (plus3 (cdr a) (quote nil) (cdr s)))) (full-add (car a) (quote nil) c))) ((quote t) ((lambda (s) (cons (car s) (plus3 (cdr a) (cdr b) (cdr s)))) (full-add (car a) (car b) c))))) (defun full-add (a b c) (cond (c (cons (cond (a b) ((quote t) (not b))) (cond (a (quote t)) (b (quote t)) ((quote t) (quote nil))))) ((quote t) (cons (cond (a (not b)) ((quote t) b)) (and a b))))) (defun fib (n) (cond ((null n) n) ((quote t) ((lambda (n1) (cond ((null n1) n) ((quote t) (plus (fib n1) (fib (prec n1)))))) (prec n))))) (fib (quote(nil nil t nil t))) ;20 ;; Expected: (T NIL T T NIL T T NIL NIL T NIL T T) ;; This takes about 66s here.