Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exam Questions: Formalizing Ackermann's Function in ACL2 (COSC 5010, Spring 2004) - Prof. , Exams of Computer Science

An examination question from a spring 2004 cosc 5010 course, where students are required to define and prove properties of ackermann's function using acl2. The question includes instructions for submitting solutions and examples of hints provided.

Typology: Exams

Pre 2010

Uploaded on 08/19/2009

koofers-user-g2x
koofers-user-g2x 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COSC 5010. Formalizing the JVM in ACL2. Spring 2004
Examination
Due Thursday 1 April 2004
Answer these questions individually. You may only use the book, the
homework, the class notes, the class website, and the ACL2 documen-
tation. You may ask for help only from the instructor.
Email your solutions to me at cowles@uwyo.edu.
The subject line should identify the problem set, i.e. Exam Question 2.
The body of the message should be a Lisp readable file in simple ascii
text format.
The first few lines of the body should contain your name.
Exam Question 2. The Meyer and Ritchie version (1967) of Ackermann’s
function may be defined recursively on the nonnegative integers by
ack-mr(x,y) <== if y=0 then 1
else if x=0 and y=1 then 2
else if x=0 and y>1 then y+2
else ack-mr( x-1, ack-mr(x,y-1) ).
1. Define ack-mr in ACL2.
2. Prove each of the following in ACL2, for all nonegative integers x
and y.
(a) ack-mr(x,0) = 1.
(b) ack-mr(x,1) = 2.
(c) ack-mr(x,2) = 4.
(d) ack-mr(0,y) = if y=0 then 1
else if y=1 then 2
else 2+y.
(e) ack-mr(1,y) = if y=0 then 1
else 2*y.
(f) ack-mr(2,y) = exp(2,y).
(g) ack-mr(3,y) = iter-exp(2,y), where
iter-exp(x,y) = if y=0 then 1
else exp(x,iter-exp(x,y-1))
Hint: Read about a different version of Ackermann’s function in these
files on the class website.
proof-lesson3.lisp,proof-lesson4.lisp,proof-lesson5.lisp

Partial preview of the text

Download Exam Questions: Formalizing Ackermann's Function in ACL2 (COSC 5010, Spring 2004) - Prof. and more Exams Computer Science in PDF only on Docsity!

COSC 5010. Formalizing the JVM in ACL2. Spring 2004 Examination Due Thursday 1 April 2004

  • Answer these questions individually. You may only use the book, the homework, the class notes, the class website, and the ACL2 documen- tation. You may ask for help only from the instructor.
  • Email your solutions to me at cowles@uwyo.edu.
  • The subject line should identify the problem set, i.e. Exam Question 2.
  • The body of the message should be a Lisp readable file in simple ascii text format.
  • The first few lines of the body should contain your name.

Exam Question 2. The Meyer and Ritchie version (1967) of Ackermann’s function may be defined recursively on the nonnegative integers by

ack-mr(x,y) <== if y=0 then 1 else if x=0 and y=1 then 2 else if x=0 and y>1 then y+ else ack-mr( x-1, ack-mr(x,y-1) ).

  1. Define ack-mr in ACL2.
  2. Prove each of the following in ACL2, for all nonegative integers x and y. (a) ack-mr(x,0) = 1. (b) ack-mr(x,1) = 2. (c) ack-mr(x,2) = 4. (d) ack-mr(0,y) = if y=0 then 1 else if y=1 then 2 else 2+y. (e) ack-mr(1,y) = if y=0 then 1 else 2*y. (f) ack-mr(2,y) = exp(2,y). (g) ack-mr(3,y) = iter-exp(2,y), where iter-exp(x,y) = if y=0 then 1 else exp(x,iter-exp(x,y-1)) Hint: Read about a different version of Ackermann’s function in these files on the class website. proof-lesson3.lisp, proof-lesson4.lisp, proof-lesson5.lisp