This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: the program. Also, format the program by writing it on several lines with the appropriate indentation. let (x =((a * b)-c)) in ((e & f) -> (g -> x ** (x**2)|y) | (f(x) where (( f(y) = (y*2)) and (x=(2 + (x ** 2)))))) 3.Problem 3 (25 Points) Write, test, and debug an RPAL program that computes the "tuple reverse" function: Rev(4,'hello',(3,4),true) = (true,(3,4),'hello',4). Please write them on several lines with the appropriate indentation. 4. Problem 4 Explain the behavior of the following RPAL program, and the type of each identifier which appeared: Let Prod N = P 1 N where rec P Cum N = N eq 1 -> Cum | P (Cum*N) in Print (Prod 5 4 3 2 1) Make an honest agempt at fiGurinG it out BEFORE askinG the RPAL interpreter....
View Full Document
- Fall '08
- Top-down parsing, Parsing expression grammar, RPAL