Background review of basic ACL2 knowledge
Here are some questions to review basic features of ACL2.
——————————Consider the expression below and answer the following questions about it, without running ACL2! We're looking for informal answers largely in agreement with ours, not perfect answers. If you want to see the questions together with our answers, see lp-background-review-1-answers.
(defun abc (x) (declare (xargs :mode :program :guard (true-listp x))) (cond ((endp x) nil) (t (cons (cons '? (car x)) (abc (cdr x))))))——————————
1: Informally, what happens if you type that expression at the top-level of the ACL2 read-eval-print loop?
——————————2: More formally, how does the utterance above affect the ACL2 logic?
——————————3: A little bit of Lisp knowledge will tell you that all terms are either
variables, constants (usually quoted), or calls of functions, where calls are
of the form
4: Let
5: Given the value of
6: Given the value of
7: Given the value of
8: Recall we defined
9: What is the difference between
10: What is the value of
11: How would you explain what
12: What is the value of
13: What is the value of
14: How do you get ACL2 to print the value of
15: How can you upgrade
16: What is the axiom added to ACL2 when
17: Is
18: What would you type to get ACL2 to try to prove it?
——————————19: How would you describe the behavior of the
(defun def (x) (if (endp x) nil (append (def (cdr x)) (list (car x)))))——————————
20: Define
21: How would you describe the behavior of
(defun sq* (x) (if (endp x) nil (cons (sq (car x)) (sq* (cdr x)))))——————————
22: What would you type to make ACL2 prove the following conjecture?
(equal (sq* (def x)) (def (sq* x)))——————————
23: Prove
(defun ghi (i max) (declare (xargs :measure (nfix (- (+ 1 (nfix max)) (nfix i))))) (let ((i (nfix i)) (max (nfix max))) (cond ((> i max) nil) (t (cons i (ghi (+ 1 i) max))))))——————————
For our answers see lp-background-review-1-answers. If your answers don't basically agree with ours, you're probably not yet ready to read this material on loop$. We recommend that you read the topic, recursion-and-induction.
If your answers largely agree with ours, go back to the lp-section-1.
(Return to the