Homework #5
Assigned: March 7
Due: March 17, 4:30pm
 (10 points) [EOPL2] Exercise 2.5 on p. 47.
 (15 points) [EOPL2] Exercise 2.7 on p. 52. Your lexicaladdress function
must be defined as:
(define lexicaladdress
(lambda (expr)
(unparseexpression (parseexpression expr))))
 (24 points) [EOPL2] Exercise 2.24 on p. 64.
 (25 points) [EOPL2] Exercise 2.25 on pp. 6465. John Robinson's development
of the concept of unification was one of the most seminal contributions
to automatic theorem proving and logic programming. PROLOG, the most widely used
logic programming language, binds values to variables through unification.
However, most implementations of PROLOG, including
SWIPROLOG, do not perform the occurscheck
and, therefore, their unification algorithm is optimistic and incorrect. For
what reasons might they decide not to perform the occurscheck?
 (3+6=9 points) [CPL] Programming Exercise 8.4.4 (ML) or 8.4.5 (Haskell).
Note on submitting: Submit two files
substproc.scm and substasr.scm which each
contain the definitions of the 5 functions in the substitution interface:
(emptysubst),
(extendsubst),
(applysubst),
(unitsubst), and
(composesubsts).
Also include substinterm and substinterms in each file, even though it is client code and must work in either representation.
