{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework5 - 3 Problem 3(15 Points We say that there are no...

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

View Full Document Right Arrow Icon
COP 5555 Programming Language Principles Homework 5 Assigned: Jun. 15, 2011 Deadline: 11:59pm Jun. 22, 2011 *Note: Please submit your solution to the e-learning system by the deadline. No late submission is allowed. 1. Problem 1 (15 Points) If there are two different normal forms of the same program, how can they be transformed to each other? Does a normal form always exist? If yes explain why. If not, give a counter- example. 2. Problem 2 (15 Points) What does `left referencing' mean? Name one programming language which is left-referencing and one which is right-referencing.
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3. Problem 3 (15 Points) We say that there are no assignments in RPAL. Then what is `x = 1' in the following RPAL program? let x = 1 in x + 1 4. Problem 4 (15 Points) Are tuples in RPAL evaluated left-to-right or right-to-left? Write a short RPAL program (one line) in which this direction is important for the result. Write down the result under the two different scenarios. 5. Problem 5 (40 Points) Using the CSE machine, evaluate the following RPAL program. Show the output of the program (if any), and the environment structure. let rec f n = n eq 1 -> 1 | n + f (n-2) in f 5...
View Full Document

{[ snackBarMessage ]}