| | |
Summary: RHEINISCH-
WESTF
ALISCHE
TECHNISCHE
HOCHSCHULE
AACHEN
LEHR- UND FORSCHUNGSGEBIET INFORMATIK II
RWTH Aachen D-52056 Aachen GERMANY
http://www-i2.informatik.rwth-aachen.de/lufgi2.html
Prof. Dr. J urgen Giesl
Darius Dlugosz
Exercises Functional Programming { Sheet 1
Solutions will be collected until Thursday, May 3, 2001.
Exercise 1 (2 points)
Consider a language of expressions for representing integers dened by the following syntax rules:
(i) zero is an expression
(ii) if e; e 1 and e 2 are expressions, then so are succ(e), pred(e) and add(e 1 ; e 2 )
An evaluator reduces expressions in this language by applying the following rules repeatedly until
no longer possible:
succ(pred(e)) = e
|