





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Operational Semantics
Grammar: SA A id = E E T+E | T T P * T | P P id | n | (E) Program: X = 2 + 3 Compilation: Push X Push 2 Push 3 Add top 2 Assign top to second Postorder: postfix X 2 3 + = (Rec Des) Parsing: ast =
2 3 X value Program semantics: =
2 3 X
1
2 → n + m
1 → n E 2 → m
1
2
1 → v 1
2 → v 2 v 1 :: v 2
2 ) → v'
2 → v A, x↦ v ⊢ E 1 → v' no hypothesis means “in all cases”
A ⊢ (fun x = e 1 ) e 2 → v' A ⊢ e 2 → v A, x↦ v ⊢ e 1 → v' A ⊢ x → v A ⊢ + e 1 e 2 → n + m A ⊢ e 1 → n A ⊢ e 2 → m A ⊢ n → n SInt SAdd SFun SVar x↦ v ∈ A