Plt1314 1

(C) Ralf Lämmel, Andrei Varanovich, University of Koblenz Landau

Logistics

Assignment

Option 1

Start from the following code from the lecture:

https://github.com/rlaemmel/pltcourse/blob/master/src/lecture-logs/unikold1314/introduction.pro

Refactor the interpreter (the semantics) so that it uses values for the expression evaluation results like this:

value(ival(I)) :- integer(I).
value(bval(B)) :- boolean(B).
boolean(true).
boolean(false).

… as opposed to this (what's currently used in the code):

value(V) :- const(V).

Option 2

Start from the following code from the lecture:

https://github.com/rlaemmel/pltcourse/blob/master/src/lecture-logs/unikold1314/fl.pro

Refactor the interpreter (the semantics) so that it uses one argument position for the "Defs" and the "Env" combined so that there is only a single combined environment.

For illustration, consider the following snippets.

Before refactoring:

% Semantics of constants
eval(_, _, const(C), C).

After refactoring:

% Semantics of constants
eval(_, const(C), C).