


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A practice test for the Programming Languages course in Fall 2014. It contains instructions, short-answer questions, and programming exercises related to topics such as map, foldr, Church booleans, and dynamic semantics of lambda calculus. The test is closed books, notes, papers, and collaboration. 4 pages long and students have 2 hours to complete it.
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Instructions:
This test is 4 pages in length.
You have 2 hours to complete and turn in this test.
Short-answer questions include a guideline for how many sentences to write. Respond in complete English sentences.
This test is closed books, notes, papers, friends, neighbors, etc.
Use the backs of pages in this test packet for scratch work. If you write more than a final answer in the area next to a question, circle your final answer.
Write and sign the following: “I pledge my Honor that I have not cheated, and will not cheat, on this test.”
Signed: ______________________________________________
What is a programming language? [1-2 sentences]
fun map F L =
b) Now implement foldr in terms of map (without using side effects), or if it can’t be done, briefly explain why not.
fun foldr F v L =
Define the first-order abstract syntax of diML, with all the extensions we’ve formalized in class, like aggregate data types, references, exceptions, etc. (You should also be able to define the higher-order abstract syntax and static and dynamic semantics of the fully extended version of diML. Given enough time, you should also be able to prove its soundness. )