Question: e ( e x p ) :: = n | e | e 1 o + e 2 e 1 e 1 ' e 1

e(exp)::=n|e|e1o+e2
e1e1'e1o+e2e1'o+e2,e2e2'no+e2no+e2',misthesumofn1andn2n1o+n2m
ee'ee,misthenegationofnnm
Figure I: Syntax and operational semantics of is a meta-variable
for integers)
Question 4
Let L4 be the language whose syntax and semantics are defined in Figure I.
Write a reduction sequence of (4o+9)o+(5) to a value in L4.
Question 5
Language L5 is the language with adding conditional branches "ifo e1 then e2 else e3"
to L4, i.e., the syntax of L5 is given as follows:
e(exp)::=n|e|e1o+e2|if0e1 then e2 else e3
Conditional branch "ifo e1 then e2 else e3" evaluates to e2 if e1 evaluates to 0 and
evaluates to e3 otherwise. For example,
ifo (ifo0 then 1 else 2) then 3 else 4 ifo 1 then 3 else 44.
Define the small-step operational semantics (rules) of conditional branches.
Question 6
Define the big-step operational semantics of L5.
 e(exp)::=n|e|e1o+e2 e1e1'e1o+e2e1'o+e2,e2e2'no+e2no+e2',misthesumofn1andn2n1o+n2m ee'ee,misthenegationofnnm Figure I: Syntax and operational semantics of is

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 Databases Questions!