The superscript "(d)" stands for "difficult". Exercises similar to those marked with "(d)" might appear in candidacy exams, but not in the standard exams of CSE 428.
The superscript "(s)" stands for "solution provided". You can find the solution of these exercises here.
if e then e1 else e2where e, e1, and e2 are boolean expression, and the if-then-else has the usual (non-strict) semantics. Assume that we want to write, in this language, an expression like e1 && e2 in C, namely a non-strict conjunction with the following semantics:
r |- e1 eval false ---------------------------- r |- (e1 && e2) eval false r |- e1 eval true r |- e2 eval v ------------------------------------------ r |- (e1 && e2) eval v
r |- e1 eval v1 r |- e2 eval v2 ----------------------------------------- if v1 = true or v2 = true r |- (e1 nor e2) eval false r |- e1 eval v1 r |- e2 eval v2 ----------------------------------------- if v1 = v2 = false r |- (e1 nor e2) eval true
x < 0 nor (x = 0 nor 1/x > 0)where x is an identifier of type integer. Say what are the results (true, false, or error) of the above expression, depending on the possible values of x.
let x = 0 in let y = x in let x = y + 1 in x + y end + x end end