(C) Ralf Lämmel, Andrei Varanovich, University of Koblenz Landau
Logistics
- Course site
- Date published: 13 Nov 2013
- Deadline SVN: 19 Nov 2013 (End of Day)
- Other logistics as previously
Assignment
Option 1
Start from the following code from the lecture:
https://github.com/rlaemmel/pltcourse/blob/master/src/lecture-logs/unikold1314/while.pro
Improve well-typedness/-formedness to also ensure that variables are never accessed in expressions, if they were not previously initialized.
For instance, the following statement should be rejected:
write x;
Option 2
Start from the following code from the lecture:
https://github.com/rlaemmel/pltcourse/blob/master/src/lecture-logs/unikold1314/fl.pro
Add a well-formedness predicate so that FL programs are checked as follows. i) All function applications refer to function names that are actually defined. ii) In the body of a function definition, all variable references refer to parameters of the enclosing function definition.
For instance, the following function definition should be rejected because i) is violated:
(
[
(
f,
[x],
apply(
g,
[const(42)]
)
)
],
apply(f, [const(88)])
)
The following function definition should be rejected because ii) is violated:
(
[
(
f,
[x],
var(y)
)
],
apply(f, [const(88)])
)