1
#|-*-Lisp-*-=================================================================|#
3
#| coi: Computational Object Inference |#
5
#|===========================================================================|#
1
; Computational Object Inference
2
; Copyright (C) 2005-2014 Kookamara LLC
7
; 11410 Windermere Meadows
8
; Austin, TX 78759, USA
9
; http://www.kookamara.com/
11
; License: (An MIT/X11-style license)
13
; Permission is hereby granted, free of charge, to any person obtaining a
14
; copy of this software and associated documentation files (the "Software"),
15
; to deal in the Software without restriction, including without limitation
16
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
17
; and/or sell copies of the Software, and to permit persons to whom the
18
; Software is furnished to do so, subject to the following conditions:
20
; The above copyright notice and this permission notice shall be included in
21
; all copies or substantial portions of the Software.
23
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29
; DEALINGS IN THE SOFTWARE.
53
78
(declare (type (satisfies true-listp) keys vals))
54
79
(declare (xargs :guard (pseudo-termp-key arg term)))
59
84
(t (cons (beta-reduce-term nil (car term) keys vals)
60
85
(beta-reduce-term arg (cdr term) keys vals)))))
154
179
(wf-beta-term arg term)
155
180
(equal (len keys) (len vals)))
156
181
(equal (unhide-eval-key arg (beta-reduce-term arg term keys vals) a1)
157
(unhide-eval-key arg term (pairlis$ keys
182
(unhide-eval-key arg term (pairlis$ keys
158
183
(unhide-eval-key t vals a1)))))
159
184
:hints (("Goal" :do-not '(generalize eliminate-destructors)
212
237
(lambda-expr-p term)
213
238
(equal (unhide-eval-key nil term a1)
214
239
(unhide-eval-key nil (CAR (CDR (CDR (CAR term))))
215
(pairlis$ (CAR (CDR (CAR term)))
240
(pairlis$ (CAR (CDR (CAR term)))
216
241
(unhide-eval-key t (cdr term) a1)))))
217
242
:hints (("Goal" :in-theory (e/d (lambda-expr-p-to-para-lambda-expr-key-p) (unhide-eval-key)))))
221
246
(lambda-expr-p term)
222
247
(equal (unhide-eval term a1)
223
248
(unhide-eval (CAR (CDR (CDR (CAR term))))
224
(pairlis$ (CAR (CDR (CAR term)))
249
(pairlis$ (CAR (CDR (CAR term)))
225
250
(unhide-eval-list (cdr term) a1)))))
226
251
:hints (("Goal" :use unhide-eval-lambda-expr-helper
227
252
:in-theory (enable unhide-eval-key-reduction))))
335
360
;; watch this proof (and monitor unhide-hide-wrapper)
337
362
(defun foo (x) (if (zp x) 2 (foo (1- x))))
343
368
(equal v (1- x)))
344
369
(equal (foo x) (skip-rewrite (foo v)))))
347
372
(equal (foo 0) 2))
349
374
(in-theory (disable foo (foo)))
351
376
;;(trace$ unhide-hide-wrapper)
354
379
(equal (foo 10) 2))