Download Proof Search Debugging Tools in ACL2
Transcript
(rev (rev (rev a))) ; lhs of triple-rev (rev a) ; rewritten lhs (rev a) ; rhs of triple-rev = = Q.E.D. Note that this hypothetical user invents double-rev and then thinks about how to make ACL2 use it automatically. An alternative would be for ACL2 to require the user to provide a detailed proof. The basic philosophy behind the ACL2 system is that it should be as automatic as possible, guided by rules derived from definitions and theorems that have already been certified by the system. This is empowering for several reasons. The user is not responsible for soundness: rules in the data base are vetted by the system using already vetted rules. The user is relieved of much tedious detail: terms and patterns in the goal conjecture trigger the application of vetted rules and the system does this quickly and accurately. In essence, the ACL2 user strives to develop a general and powerful collection of rules for manipulating the concepts in a given class of problems. This gives the system the flexibility often to tolerate minor changes in previously checked work. For example, if ACL2 can prove some property of function f and then the definition of f is undone and modified in some slight way so that the property still holds, ACL2 is often able to discover the proof “again.” (We put the word in quotes because the two proofs are different because the two fs are different.) Because models of hardware and software are often modified to reflect changing designs, this ability to “replay” proofs automatically is important. Returning to the triple-rev example, a problem with the ACL2 approach is revealed when we realize that double-rev is not a theorem! One can read the prover’s output to discover that (rev (rev x)) is not x if x is a list structure that terminates with a non-nil value. The formula imagined by our hypothetical user is not valid; for example, if x is 7, (rev (rev x)) is nil, not 7. An accurate formalization of double-rev is (defthm double-rev (implies (true-listp x) (equal (rev (rev x)) x))). While this particular mistake could be avoided in a strongly typed system, it illustrates a very common class of mistakes: missing hypotheses. Having discovered this correction to double-rev we ought to rethink its intended use in the bigger proof we are constructing. But people are sloppy. Working top down to prove some main theorem (e.g., triple-rev) we invent or remember “lemmas” (e.g., the faulty version