3
(local (defun %%sub1-induction (n)
5
n (%%sub1-induction (1- n)))))
7
(local (defun %%and-tree-fn (args len)
8
(declare (xargs :mode :program))
11
(let* ((len2 (floor len 2)))
13
(%%and-tree-fn (take len2 args) len2)
14
(%%and-tree-fn (nthcdr len2 args)
17
(local (defmacro %%and-tree (&rest args)
18
(%%and-tree-fn args (length args))))
20
(local (include-book "bvecp-raw"))
22
(local (include-book "rtl/rel4/lib/top"
25
(local (include-book "rtl/rel4/lib/simplify-model-helpers"
28
(include-book "model-raw")
30
(include-book "model")
32
(local (table user-defined-functions-table
35
(local (disable-forcing))
37
(local (deftheory theory-0 (theory 'minimal-theory)))
39
(local (defmacro %%p0-equalities nil
40
'(%%and-tree (equal (out1$ n $path)
41
(foo$raw::out1$ n $path))
42
(equal (out2$ n $path)
43
(foo$raw::out2$ n $path)))))
45
(local (defun %%p0-aux (n $path)
46
(declare (xargs :normalize nil))
49
(local (defun-sk %%p0 (n)
50
(forall ($path) (%%p0-aux n $path))))
52
(local (defthm %%p0-implies-%%p0-aux
53
(implies (%%p0 n) (%%p0-aux n $path))))
57
(local (defthm %%p0-property-lemma
58
(implies (%%p0-aux n $path)
61
:instructions ((:dv 1)
64
(:generalize ((%%p0-equalities) eqs))
67
(implies (%%p0 n) (%%p0-equalities))
68
:instructions ((:use %%p0-property-lemma)
69
(:generalize ((%%p0-equalities) eqs))
73
(deftheory %%p0-implies-f-is-%f-theory
74
(union-theories (set-difference-theories (current-theory :here)
75
(current-theory '%%p0))
76
(theory 'minimal-theory))))
81
(local (in-theory (disable %%p0-property)))
82
(local (defthm out2$-is-out2$-base
84
(equal (out2$ n $path)
85
(foo$raw::out2$ n $path)))
86
:hints (("Goal" :expand ((out2$ n $path)
87
(foo$raw::out2$ n $path))))))
88
(local (defthm out1$-is-out1$-base
90
(equal (out1$ n $path)
91
(foo$raw::out1$ n $path)))
92
:hints (("Goal" :expand ((out1$ n $path)
93
(foo$raw::out1$ n $path))))))
94
(defthm %%p0-base (implies (zp n) (%%p0 n))
95
:instructions (:promote :x-dumb (:s :normalize nil)))))
100
(local (in-theory (disable %%p0 %%p0-base)))
101
(local (deflabel %%induction-start))
102
(local (defthm out2$-is-out2$-induction_step
103
(implies (and (not (zp n)) (%%p0 (1- n)))
104
(equal (out2$ n $path)
105
(foo$raw::out2$ n $path)))
106
:instructions (:promote (:dv 1)
109
:top (:s :normalize nil
110
:backchain-limit 1000
113
(local (defthm out1$-is-out1$-induction_step
114
(implies (and (not (zp n)) (%%p0 (1- n)))
115
(equal (out1$ n $path)
116
(foo$raw::out1$ n $path)))
117
:instructions (:promote (:dv 1)
120
:top (:s :normalize nil
121
:backchain-limit 1000
124
(defthm %%p0-induction_step
125
(implies (and (not (zp n)) (%%p0 (1- n)))
127
:instructions (:promote :x-dumb (:s :normalize nil)))))
133
(("Goal" :induct (%%sub1-induction n)
134
:do-not '(preprocess)
135
:in-theory (union-theories '(%%p0-base %%p0-induction_step
136
(:induction %%sub1-induction))
137
(theory 'minimal-theory))))))
143
(local (in-theory (union-theories '(%%p0-holds)
144
(theory '%%p0-implies-f-is-%f-theory))))
146
(defthm out2$-is-out2$
147
(equal (out2$ n $path)
148
(foo$raw::out2$ n $path))
149
:hints (("Goal" :do-not '(preprocess))))
151
(defthm out1$-is-out1$
152
(equal (out1$ n $path)
153
(foo$raw::out1$ n $path))
154
:hints (("Goal" :do-not '(preprocess))))
158
(deftheory %-removal-theory
159
(union-theories '(out1$-is-out1$ out2$-is-out2$)
160
(theory 'minimal-theory)))