3
;; This book is a little add-on to Ivy. I imagine there will
4
;; times when we wish to simply check a proof object, without
5
;; using Ivy's preprocessing. For example, if a prover
6
;; can build proof objects, but it is inconvenient to use
7
;; Ivy's preprocessing.
9
;; Function (bcheck proof) below checks if its input is a proof
10
;; object, fixes the substitutions (just like refute-n-check),
11
;; and checks it. Ths soundness theorems says that if the
12
;; input steps are true, then all the steps are true.
14
;; Bcheck is similar to the checker of our 1994 Nqthm project.
15
;; (But we didn't have any soundness proofs back then.)
17
(include-book "derive")
19
;; Here is the checker function. Compare it to refute-n-check
23
(declare (xargs :guard t))
24
(if (not (wfproof prf))
26
(let ((fixed-prf (fix-substs-in-prf
28
(free-vars (extract-all-steps prf)))))
29
(check-proof nil fixed-prf))))
31
;; Question to us: why weren't the following two lemmas needed
32
;; for soundness of refute-n-check?
34
(defthm extract-all-fixed
35
(equal (extract-all-steps (fix-substs-in-prf prf vars))
36
(extract-all-steps prf)))
38
(defthm extract-input-fixed
39
(equal (extract-input-steps (fix-substs-in-prf prf vars))
40
(extract-input-steps prf)))
42
;; Luckily, we can use theorem check-proof-xsound which we
43
;; used for soundness of refute-n-check.
48
(xeval (universal-closure (extract-input-steps prf)) (domain i) i))
49
(xeval (universal-closure (extract-all-steps prf)) (domain i) i))
52
:use ((:instance check-proof-xsound
53
(prf (fix-substs-in-prf
55
(free-vars (extract-all-steps prf))
58
;; Now state it in terms of the official evaluation function feval.
61
(implies (and (bcheck prf)
62
(feval (universal-closure (extract-input-steps prf)) i))
63
(feval (universal-closure (extract-all-steps prf)) i))
65
:in-theory (enable xeval-feval)