quiz4-example-fall11 - b. (8 pts) Write a predictive,...

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

View Full Document Right Arrow Icon
CMSC330 Fall 2011 Example Quiz #4 Name Discussion Time (circle one): 10am 11am 12pm 1pm 2pm 3pm Do not start this exam until you are told to do so! Instructions You have 25 minutes for this quiz. This is a closed book exam. No notes or other aids are allowed. Answer essay questions concisely using 2-3 sentences. Longer answers are not necessary and a penalty may be applied. For partial credit, show all of your work and clearly indicate your answers. Write neatly. Credit cannot be given for illegible answers. 1. (14 pts) Parsing Consider the following grammar: S aA | A A bS | ca a. (6 pts) Compute First sets for S and A
Background image of page 1

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

View Full DocumentRight 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: b. (8 pts) Write a predictive, recursive descent parser for the grammar 2. (16 pts) Lambda calculus Circle all free (unbound) variables in the following &-expression a. (2 pts) ( & a. a ( & b. b a ) a b ) a Evaluate the following &-expressions as much as possible. Show each beta-reduction b. (3 pts) ( & x. & y.y x) a ( & z.z) b c. (3 pts) ( & y. & x x y) x a b d. (8 pts) Using encodings, show 3*1 =>* 3. Show each beta-reduction. =>* indicates 0 or more steps of beta-reduction 3*1 => M * N = & x.(M (N x)) 1 = & f. & y.f y 2 = & f. & y.f (f y) 3 = & f. & y.f (f (f y)) 4 = & f. & y.f (f (f (f y)))...
View Full Document

This note was uploaded on 01/13/2012 for the course CMSC 330 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 2

quiz4-example-fall11 - b. (8 pts) Write a predictive,...

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