FinalS06 - Design of Programming Languages - Spring 2006...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Design of Programming Languages - Spring 2006 Final Exam May 17, 2006 Do any 10. 1. (10 pts) Operational Semantics and Type Judgments in Impcore . (5 pts) Give the Operational Semantics judgment for IF. Identify clearly all the necessary environments and actions. (5 pts) Give the Type judgment for IF. Identify clearly all the necessary environments and actions. 2. (10 pts) Higher Order Functions - either μ Scheme or ML. Define a higher-order InsertionSort : it is a function that accepts a comparison function and returns a func- tion that accepts a list of items compatible with the comparsion function and returns the list sorted in increasing order. Hint: you will also need to define a local function that will insert an item into an already sorted list. 3. (10 pts) ML, Types and Combinators. You must include enough detail so one can understand the process you went through. (3 pts) Derive the type of the function defined by fun F g = g (F g). (2 pts) Derive the type of the function val g = fn f => fn x => if x = 0 then 1 else x*f(x + 1) (2 pts) compute F g 0 (2 pts) and F g 1 . (1 pt) Explicitly, what is the fixed point of g as a function N → N ? 4. (10 pts) Polymorphic μ Scheme. Note: this requires full type annotations - plain μ Scheme functions will not receive any credit. (5 pts) Define a function member? that takes an object and a list of objects of the same type and returns #t or #f depending on whether the object is an element of the list....
View Full Document

This note was uploaded on 02/13/2012 for the course CS 91.531 taught by Professor Giam during the Fall '09 term at UMass Lowell.

Page1 / 4

FinalS06 - Design of Programming Languages - Spring 2006...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online