I know this is complicated, but I\'ve struggled a lot with these lambda reductio
ID: 3696136 • Letter: I
Question
I know this is complicated, but I've struggled a lot with these lambda reductions and abstract syntax. I have no idea where to begin on this:
Recalling the abstract syntax, AS
P::=main(argc, argv) {C}
C::=C1,C2|if B{C}|while(B){C}|I=E|diverge
E::=I|N|E1+E2
B::= E1==E2|!B
And the semantic algebra SA:
Truth Values:
Domain:
Operations: true, false: Bool; not: Bool->Bool
Natural Numbers
Domain:
Operations:
zero, one, …:Nat
Equals: Nat x Nat
Plus: Nat x Nat -> Nat
Identifiers
Domain:
Store
Domain:
Operations: …
And the Valuation Function V:
add a less than relational operator to this syntax using the semantic algebra
Add the changes necessary to support the less than operator ‘<’ Be specific where you are making the changes
Add an if…then…else statement to the abstract syntax.
Update the semantic algebra to support your if…then…else statement.
Update the valuation function to support your if…then…else statement
Using the previous additions, give the denotational meaning of the expression
In an environment where the store contains the bindings
Explanation / Answer
P::=main(argc, argv) {C}
C::=C1,C2|if B{C}|while(B){C}|I=E|diverge
E::=I|N|E1+E2
B::= E1==E2|!B
And the semantic algebra SA:
Truth Values:
Domain:
Operations: true, false: Bool; not: Bool->Bool
Natural Numbers
Domain:
Operations:
zero, one, …:Nat
Equals: Nat x Nat
Plus: Nat x Nat -> Nat
Identifiers
Domain:
Store
Domain:
Operations: …