File: waterfall-steps.lisp

package info (click to toggle)
acl2 8.5dfsg-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 991,452 kB
  • sloc: lisp: 15,567,759; javascript: 22,820; cpp: 13,929; ansic: 12,092; perl: 7,150; java: 4,405; xml: 3,884; makefile: 3,507; sh: 3,187; ruby: 2,633; ml: 763; python: 746; yacc: 723; awk: 295; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (375 lines) | stat: -rw-r--r-- 14,577 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
; Milawa - A Reflective Theorem Prover
; Copyright (C) 2005-2009 Kookamara LLC
;
; Contact:
;
;   Kookamara LLC
;   11410 Windermere Meadows
;   Austin, TX 78759, USA
;   http://www.kookamara.com/
;
; License: (An MIT/X11-style license)
;
;   Permission is hereby granted, free of charge, to any person obtaining a
;   copy of this software and associated documentation files (the "Software"),
;   to deal in the Software without restriction, including without limitation
;   the rights to use, copy, modify, merge, publish, distribute, sublicense,
;   and/or sell copies of the Software, and to permit persons to whom the
;   Software is furnished to do so, subject to the following conditions:
;
;   The above copyright notice and this permission notice shall be included in
;   all copies or substantial portions of the Software.
;
;   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;   DEALINGS IN THE SOFTWARE.
;
; Original author: Jared Davis <jared@kookamara.com>

(in-package "MILAWA")
(include-book "skeletonp")
(include-book "split-all") ;; BOZO yuck for cons-listp-of-list-list-fix ??
(%interactive)

(%autoprove true-list-listp-of-remove-supersets1
            (%autoinduct remove-supersets1 x acc)
            (%restrict default remove-supersets1 (equal todo 'x)))

(%autoprove true-list-listp-of-remove-supersets
            (%enable default remove-supersets))

(%autoprove true-list-listp-of-remove-duplicates-list
            (%cdr-induction x))

(%autoprove true-list-listp-of-third-of-clause.clean-clauses
            (%enable default clause.clean-clauses))

(%autoprove true-list-listp-of-third-of-clause.fast-clean-clauses
            (%enable default clause.fast-clean-clauses)
            (%disable default
                      clause.fast-clean-clauses-removal
                      clause.fast-clean-part1-removal))

(%autoprove true-list-listp-of-revappend
            (%autoinduct revappend x acc)
            (%restrict default revappend (equal x 'x))
            (%disable default forcing-revappend-removal))

(%autoprove true-list-listp-of-clause.aux-split
            (%autoinduct clause.aux-split)
            (%restrict default clause.aux-split (equal todo 'todo)))

(%autoprove true-list-listp-of-clause.aux-limsplit
            (%autoinduct clause.aux-limsplit todo done splitlimit)
            (%restrict default clause.aux-limsplit (equal todo 'todo)))

(%autoprove true-list-listp-of-clause.simple-limsplit
            (%enable default clause.simple-limsplit))

(%autoprove true-list-listp-of-clause.simple-split
            (%enable default clause.simple-split))

(%autoprove true-list-listp-of-cdr-of-clause.split
            (%forcingp nil)
            (%enable default clause.split))

(%autoprove logic.formula-listp-of-remove-duplicates-free)

(%autoprove logic.formula-list-atblp-of-remove-duplicates-free)

(%autoprove subsetp-of-remove-duplicates-one-indirect)

;; this is now included as part of split-all to avoid overwriting files.
;; (%autoprove cons-listp-of-list-list-fix
;;             (%cdr-induction x))

(%autoprove true-list-listp-of-list-list-fix
            (%cdr-induction x))

(%autoprove logic.term-list-listp-of-list-list-fix
            (%cdr-induction x))

(%autoprove list-list-fix-when-true-list-listp
            (%cdr-induction x))

(%autoprove logic.term-list-list-atblp-of-list-list-fix
            (%cdr-induction x))


(%autoadmit rw.flag-waterstepp)

(%autoadmit rw.waterstepp)

(%autoadmit rw.waterstep-listp)

(%autoprove definition-of-rw.waterstepp
            (%restrict default rw.flag-waterstepp (equal x 'x))
            (%enable default rw.waterstepp rw.waterstep-listp))

(%autoprove definition-of-rw.waterstep-listp
            (%restrict default rw.flag-waterstepp (equal x 'x))
            (%enable default rw.waterstepp rw.waterstep-listp))

(%autoprove rw.waterstep-listp-when-not-consp
            (%restrict default definition-of-rw.waterstep-listp (equal x 'x)))

(%autoprove rw.waterstep-listp-of-cons
            (%restrict default definition-of-rw.waterstep-listp (equal x '(cons a x))))

(%autoadmit rw.raw-waterstep-induction)

(%autoprove lemma-for-booleanp-of-rw.waterstepp
            (%autoinduct rw.raw-waterstep-induction flag x)
            (%restrict default definition-of-rw.waterstepp (equal x 'x)))

(%autoprove booleanp-of-rw.waterstepp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstepp)
                             (flag 'clause))))

(%autoprove booleanp-of-rw.waterstep-listp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstepp)
                             (flag 'list))))

(%deflist rw.waterstep-listp (x)
          (rw.waterstepp x))


(%autoadmit rw.waterstep)
(%autoadmit rw.waterstep->method)
(%autoadmit rw.waterstep->clause)
(%autoadmit rw.waterstep->extras)
(%autoadmit rw.waterstep->substeps)

(encapsulate
 ()
 (local (%enable default
                 rw.waterstep
                 rw.waterstep->method
                 rw.waterstep->clause
                 rw.waterstep->extras
                 rw.waterstep->substeps))
 (%autoprove rw.waterstep->method-of-rw.waterstep)
 (%autoprove rw.waterstep->clause-of-rw.waterstep)
 (%autoprove rw.waterstep->extras-of-rw.waterstep)
 (%autoprove rw.waterstep->substeps-of-rw.waterstep)
 (%autoprove rank-of-rw.waterstep->substeps)

 (%autoprove rw.waterstepp-of-rw.waterstep
             (%restrict default definition-of-rw.waterstepp
                        (and (logic.functionp x)
                             (equal (logic.function-name x) 'cons))))

 (%autoprove symbolp-of-rw.waterstep->method
             (%restrict default definition-of-rw.waterstepp (equal x 'x)))

 (%autoprove logic.term-listp-of-rw.waterstep->clause
             (%restrict default definition-of-rw.waterstepp (equal x 'x)))

 (%autoprove consp-of-rw.waterstep->clause
             (%restrict default definition-of-rw.waterstepp (equal x 'x)))

 (%autoprove true-listp-of-rw.waterstep->clause
             (%restrict default definition-of-rw.waterstepp (equal x 'x)))

 (%autoprove rw.waterstep-listp-of-rw.waterstep->substeps
             (%restrict default definition-of-rw.waterstepp (equal x 'x))))



(%defprojection :list (rw.waterstep-list->clauses x)
                :element (rw.waterstep->clause x)
                :nil-preservingp t)

(%autoprove cons-listp-of-rw.waterstep-list->clauses
            (%cdr-induction x))

(%autoprove true-list-listp-of-rw.waterstep-list->clauses
            (%cdr-induction x))

(%autoprove logic.term-list-listp-of-rw.waterstep-list->clauses
            (%cdr-induction x))


(%autoadmit rw.waterstep-induction)

(%autoadmit rw.flag-waterstep-atblp)
(%autoadmit rw.waterstep-atblp)
(%autoadmit rw.waterstep-list-atblp)

(%autoprove definition-of-rw.waterstep-atblp
            (%restrict default rw.flag-waterstep-atblp (equal x 'x))
            (%enable default rw.waterstep-atblp rw.waterstep-list-atblp))

(%autoprove definition-of-rw.waterstep-list-atblp
            (%restrict default rw.flag-waterstep-atblp (equal x 'x))
            (%enable default rw.waterstep-atblp rw.waterstep-list-atblp))

(%autoprove rw.flag-waterstep-atblp-of-clause
            (%enable default rw.waterstep-atblp))

(%autoprove rw.flag-waterstep-list-atblp-of-clause
            (%enable default rw.waterstep-list-atblp))

(%autoprove rw.waterstep-list-atblp-when-not-consp
            (%restrict default definition-of-rw.waterstep-list-atblp (equal x 'x)))

(%autoprove rw.waterstep-list-atblp-of-cons
            (%restrict default definition-of-rw.waterstep-list-atblp (equal x '(cons a x))))

(%autoprove rw.waterstep-atblp-of-nil
            (%restrict default definition-of-rw.waterstep-atblp (equal x ''nil)))

(%autoprove lemma-for-booleanp-of-rw.waterstep-atblp
            (%autoinduct rw.waterstep-induction flag x)
            (%restrict default definition-of-rw.waterstep-atblp (equal x 'x)))

(%autoprove booleanp-of-rw.waterstep-atblp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstep-atblp)
                             (flag 'clause))))

(%autoprove booleanp-of-rw.waterstep-list-atblp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstep-atblp)
                             (flag 'list))))


(%deflist rw.waterstep-list-atblp (x atbl)
          (rw.waterstep-atblp x atbl))

(%autoprove logic.term-list-atblp-of-rw.waterstep->clause
            (%restrict default definition-of-rw.waterstep-atblp (equal x 'x)))

(%autoprove rw.waterstep-list-atblp-of-rw.waterstep->substeps
            (%restrict default definition-of-rw.waterstep-atblp (equal x 'x)))

(%autoprove rw.waterstep-atblp-of-rw.waterstep
            (%restrict default definition-of-rw.waterstep-atblp
                       (equal x '(rw.waterstep method clause extras substeps))))


(%autoadmit rw.stop-waterstep-okp)
(%autoprove booleanp-of-rw.stop-waterstep-okp
            (%enable default rw.stop-waterstep-okp))

(%autoadmit rw.urewrite-waterstep-okp)
(%autoprove booleanp-of-rw.urewrite-waterstep-okp
            (%enable default rw.urewrite-waterstep-okp))

(%autoadmit rw.crewrite-waterstep-okp)
(%autoprove booleanp-of-rw.crewrite-waterstep-okp
            (%enable default rw.crewrite-waterstep-okp))

(%autoadmit rw.split-waterstep-okp)
(%autoprove booleanp-of-rw.split-waterstep-okp
            (%enable default rw.split-waterstep-okp))


(%autoadmit rw.flag-waterstep-okp)
(%autoadmit rw.waterstep-okp)
(%autoadmit rw.waterstep-list-okp)
(%autoprove definition-of-rw.waterstep-okp
            (%restrict default rw.flag-waterstep-okp (equal x 'x))
            (%enable default rw.waterstep-okp rw.waterstep-list-okp))
(%autoprove definition-of-rw.waterstep-list-okp
            (%restrict default rw.flag-waterstep-okp (equal x 'x))
            (%enable default rw.waterstep-okp rw.waterstep-list-okp))

(%autoprove rw.waterstep-list-okp-when-not-consp
            (%restrict default definition-of-rw.waterstep-list-okp (equal x 'x)))
(%autoprove rw.waterstep-list-okp-of-cons
            (%restrict default definition-of-rw.waterstep-list-okp (equal x '(cons a x))))

(%autoprove rw.waterstep-okp-of-nil
            (%restrict default definition-of-rw.waterstep-okp (equal x ''nil)))

(%autoprove lemma-for-booleanp-of-rw.waterstep-okp
            (%autoinduct rw.waterstep-induction flag x)
            (%restrict default definition-of-rw.waterstep-okp (equal x 'x)))

(%autoprove booleanp-of-rw.waterstep-okp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstep-okp)
                             (flag 'clause))))

(%autoprove booleanp-of-rw.waterstep-list-okp
            (%use (%instance (%thm lemma-for-booleanp-of-rw.waterstep-okp)
                             (flag 'list))))

(%deflist rw.waterstep-list-okp (x world)
          (rw.waterstep-okp x world))



(%autoadmit rw.flag-waterfall-subgoals)
(%autoadmit rw.waterfall-subgoals)
(%autoadmit rw.waterfall-list-subgoals)

(%autoprove definition-of-rw.waterfall-subgoals
            (%enable default rw.waterfall-subgoals rw.waterfall-list-subgoals)
            (%restrict default rw.flag-waterfall-subgoals (equal x 'x)))

(%autoprove definition-of-rw.waterfall-list-subgoals
            (%enable default rw.waterfall-subgoals rw.waterfall-list-subgoals)
            (%restrict default rw.flag-waterfall-subgoals (equal x 'x)))

(%autoprove rw.flag-waterfall-subgoals-of-clause
            (%enable default rw.waterfall-subgoals))

(%autoprove rw.flag-waterfall-list-subgoals-of-clause
            (%enable default rw.waterfall-list-subgoals))

(%autoprove rw.waterfall-list-subgoals-when-not-consp
            (%restrict default definition-of-rw.waterfall-list-subgoals (equal x 'x)))

(%autoprove rw.waterfall-list-subgoals-of-cons
            (%restrict default definition-of-rw.waterfall-list-subgoals (equal x '(cons a x))))

(%autoprove lemma-for-logic.term-list-listp-of-rw.waterfall-subgoals
            (%autoinduct rw.flag-waterfall-subgoals flag x)
            (%restrict default definition-of-rw.waterfall-subgoals (equal x 'x)))

(%autoprove logic.term-list-listp-of-rw.waterfall-subgoals
            (%use (%instance (%thm lemma-for-logic.term-list-listp-of-rw.waterfall-subgoals)
                             (flag 'clause))))

(%autoprove logic.term-list-listp-of-rw.waterfall-list-subgoals
            (%use (%instance (%thm lemma-for-logic.term-list-listp-of-rw.waterfall-subgoals)
                             (flag 'list))))

(%autoprove lemma-for-cons-listp-of-rw.waterfall-subgoals
            (%autoinduct rw.flag-waterfall-subgoals flag x)
            (%restrict default definition-of-rw.waterfall-subgoals (equal x 'x)))

(%autoprove cons-listp-of-rw.waterfall-subgoals
            (%use (%instance (%thm lemma-for-cons-listp-of-rw.waterfall-subgoals)
                             (flag 'clause))))

(%autoprove cons-listp-of-rw.waterfall-list-subgoals
            (%use (%instance (%thm lemma-for-cons-listp-of-rw.waterfall-subgoals)
                             (flag 'list))))

(%autoprove lemma-for-true-list-listp-of-rw.waterfall-subgoals
            (%autoinduct rw.flag-waterfall-subgoals flag x)
            (%restrict default definition-of-rw.waterfall-subgoals (equal x 'x)))

(%autoprove true-list-listp-of-rw.waterfall-subgoals
            (%use (%instance (%thm lemma-for-true-list-listp-of-rw.waterfall-subgoals)
                             (flag 'clause))))

(%autoprove true-list-listp-rw.waterfall-list-subgoals
            (%use (%instance (%thm lemma-for-true-list-listp-of-rw.waterfall-subgoals)
                             (flag 'list))))

(%autoprove lemma-for-true-listp-of-rw.waterfall-subgoals
            (%autoinduct rw.flag-waterfall-subgoals flag x)
            (%restrict default definition-of-rw.waterfall-subgoals (equal x 'x)))

(%autoprove true-listp-of-rw.waterfall-subgoals
            (%use (%instance (%thm lemma-for-true-listp-of-rw.waterfall-subgoals)
                             (flag 'clause))))

(%autoprove true-listp-rw.waterfall-list-subgoals
            (%use (%instance (%thm lemma-for-true-listp-of-rw.waterfall-subgoals)
                             (flag 'list))))