Question: i n Types :: = nat | l i s t t ( 1 ) | a r r ( 1 ; 2 ) ein

in Types ::= nat |listt(1)|arr(1;2)
ein Exprs ::=x|z|s(e)|rec{e0;x.y.e1}(e)|nill{}|cons(e1;e2)|lrec{e0; h.t.y.e1}(e)|
lam{}(x.e)|ap(e1;e2)
The statics and dynamics of this system extend that of eager System T, with the following typing rules for the new constructors:
?bar(|--nill{}:listt()),|--e1:,|--e2:listt()|--cons(e1;e2):listt()
|--e0:,,h:,t:listt(),y:|--e1:,|--e:listt()|--lrec{e0;h.t.y.e1}(e):
The dynamics for lists mirrors that for natural numbers:
nill{} is a value,
cons(e1;e2) is a value if both e1 and e2 are,
evaluation of the arguments of cons is left-to-right, and
evaluation of lrec{e0;h.t.y.e1}(e) proceeds by first evaluating e until it is a value -- either nill {} or cons (e2;e3)-- and then
either producing e0 or [e2h][e3t][Irec{e0;h.t.y.e1}e3y]e1 respectively.
You are also to define a big-step dynamics for this system using the judgment ev that corresponds to the combination of elongmapsto**v and
v val.
In all, the judgment constructors you need to declare in your .sig file are of, val, step, steps, and eval.
For this system, you are to define predicates (using Define in the . thm file) is_nat, is_list, plus, times, cat, len, and rev (reverse).
For example, here are definitions for is_nat and plus:
example, here is the theorem for plus:
Also for this system, you are to prove
Unicity of typing
Determinacy of step
Preservation
Progress
Equivalence of ev and elongmapsto**v and v val.
along with all of the required lemmas.
To turn in your Homework assignment, zip together your three files hw3.sig, hw3. mod, and hw3. thm into a file hw3.zip, and upload this
one file on the Homework 3 link on Canvas by the deadline.
i n Types :: = nat | l i s t t ( 1 ) | a r r ( 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!