## Session using `fpreduce`

?- expression N Exp, reduce Exp Normal.
Normal = truth,
Exp = mem @ in 3 @ (map @ fib @ (cons @ in 3 @ (cons @ in 4 @ empty))),
N = 1.
;
Normal = cons @ in 2 @ (cons @ in 3 @ empty),
Exp = map @ fib @ (cons @ in 3 @ (cons @ in 4 @ empty)),
N = 2.
;
Normal = cons @ in 3 @ (cons @ in 4 @ empty),
Exp = cons @ in 3 @ (cons @ in 4 @ empty),
N = 3.
;
Normal = lam [x:exp] cons @ in 1 @ x,
Exp =
(fixpt [app:exp] lam [l:exp] lam [k:exp]
if (nullp @ l) k (cons @ (car @ l) @ (app @ (cdr @ l) @ k)))
@ (cons @ in 1 @ empty),
N = 4.
;
Normal = lam [x:exp] in 2,
Exp = lam [x:exp] if x (in 2) (in 2),
N = 5.
;
Normal = lam [x:exp] lam [x1:exp] in 0,
Exp = lam [x:exp] lam [y:exp] times @ y @ (times @ in 0 @ x),
N = 6.
;
no more solutions
?-

Lectures /
Modules /
Homeworks /
Syllabus