This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: So, CC[<do C E>] = CC[ <; C <while E C>>] 4. Problem 4 (30 Points) Consider the denotational semantics specification of Tiny. Suppose we were to make a single change to the specification of the '+' operator (slide 20 lecture ppt 26). Consider changing the LAST occurrence of s2 to s1, on the next-to-last line. Explain in plain English how the semantics of the Tiny language change due to this change in the specification. Illustrate your argument by constructing a sample Tiny program that illustrates the different semantics. Solution: program x: assign i := 1 + read; output(read); end x. 5. Problem 5 (30 Points) Why is type checking difficult in the denotational description of Tiny? Solution: Because there is no variable declaration in Tiny. 6. Problem 6 (40 Points) Write the denotational description of the 'case' statement in C for Tiny. Solution: C_CC[<c_c n C>] = lambda(v,s). v eq \undef -> (v,s) | v ne n -> (v,s) | (\undef , s => CC[C])...
View Full Document
- Fall '08
- Tiny, denotational semantics specification