Programming Languages, Fall 2014 HW9 - Simple Extensions to Simply-Typed Lambda-Calculus Due electronically on Blackboard on Tuesday November 18 at 2pm. Refs for unions: [1] http://www.tutorialspoint.com/cprogramming/c_unions.htm [2] http://en.wikipedia.org/wiki/Union_type 1. 11.4.1 in TAPL (ascription as derived form). 2. 11.5.2 in TAPL (eager let). 3. 11.8.2 in TAPL (record matching). 4. 11.9.1 in TAPL (case for if) 5. Create an example of variant type term, show its typing derivation tree, and show its (one-step) evaluation sequence until it reaches a value. Name the congruence and computation rules used in each step. 6. Write the big-step evaluation rules for both record and variant types. 7. Write call-by-name single-step evaluation rules for record. 8. Our treatment of variant type is quite different from Haskell's algebraic datastructures (e.g. Ast). Briefly describe the difference, and which one is more convenient to the programmer? 9. Write a short C program involving unions. You should demonstrate: 1) sizeof 2) corrupted values. 10.Write a short Haskell function next_weekday which takes a weekday and return the next weekday. Use algebraic data type to simulate variant type. Debriefing (required!): -------------------------- 1. Approximately how many hours did you spend on this assignment? 2. Would you rate it as easy, moderate, or difficult? 3. Did you work on it mostly alone, or mostly with other people? 4. How deeply do you feel you understand the material it covers (0%–100%)? 5. Any other comments? This section is intended to help us calibrate the homework assignments. Your answers to this section will *not* affect your grade; however, skipping it will certainly do.