CS 334: HW 3

Instructions

This homework has two types of problems:

  • Self Check: You are strongly encouraged to think about and work through these questions, but you will not submit answers to them.

  • Problems: You will turn in answers to these questions.

Reading

  • (Required) Read Mitchell, skim 4.4--4.5, 5, skim 6.1.

  • (As necessary) ML documentation and tutorials. These two may be particularly useful:

  • (Optional) J. Backus, Can programming be liberated from the von Neuman style?, Comm. ACM 21, 8 (1978) 613-641. You can find this on the cs334 web site.

Self Check

ML Types

Mitchell, Problem 6.1

Problems

1. Lazy Evaluation and Parallelism (20 pts)

Mitchell, Problem 4.11

The function g should be defined as follows (there is a typo in the book):

fun g(x, y) = if x = 0
then 1
else if x + y = 0
    then 2
    else 3;

2. Algol 60 Procedure Types (5 pts)

Mitchell, Problem 5.1

3. Translation into Lambda Calculus (10 pts)

Mitchell, Problem 4.6

Submitting Your Work

Submit your answers to the GradeScope assignment named, for example, "HW 0". It should:

  • be clearly written or typed,
  • include your name and HW number at the top,
  • list any students with whom you discussed the problems, and
  • be a single PDF file, with one problem per page.

You will be asked to resubmit homework not satisfying these requirements. Please select the pages for each question when you submit.