File: memoize-invoke-log.txt

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 (545 lines) | stat: -rw-r--r-- 15,123 bytes parent folder | download
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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
(UNSET-WATERFALL-PARALLELISM)
(ASSIGN SCRIPT-MODE T)
 T
(SET-LD-PROMPT T STATE)
 T
ACL2 !>>(SET-INHIBITED-SUMMARY-TYPES '(TIME STEPS))
 (TIME STEPS)
ACL2 !>>(SET-INHIBIT-OUTPUT-LST '(PROOF-TREE))
 (PROOF-TREE)
ACL2 !>>(F-PUT-GLOBAL 'TRACE-CO
                      (@ STANDARD-CO)
                      STATE)
<state>
ACL2 !>>(DEFN F1 (X) (LIST (CAR (CONS X X))))

Since F1 is non-recursive, its admission is trivial.  We observe that
the type of F1 is described by the theorem 
(AND (CONSP (F1 X)) (TRUE-LISTP (F1 X))).  We used primitive type reasoning.

Computing the guard conjecture for F1....

The guard conjecture for F1 is trivial to prove, given primitive type
reasoning.  F1 is compliant with Common Lisp.

Summary
Form:  ( DEFUN F1 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
 F1
ACL2 !>>(DEFN G1 (X) (LIST X))

Since G1 is non-recursive, its admission is trivial.  We observe that
the type of G1 is described by the theorem 
(AND (CONSP (G1 X)) (TRUE-LISTP (G1 X))).  We used primitive type reasoning.

Computing the guard conjecture for G1....

The guard conjecture for G1 is trivial to prove.  G1 is compliant with
Common Lisp.

Summary
Form:  ( DEFUN G1 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
 G1
ACL2 !>>(MEMOIZE 'F1 :INVOKE 'G1)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'F1
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'G1)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))


ACL2 Error in ( TABLE MEMOIZE-TABLE ...):  Illegal attempt to set memoize-
table:  The following event must be admitted (possibly with differing
name or macro) before memoizing function F1 with :INVOKE value G1.
See :DOC memoize.

(DEFTHM |F1-is-G1| (EQUAL (F1 X) (G1 X)) :RULE-CLASSES NIL)


Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL

ACL2 Error [Failure] in ( TABLE MEMOIZE-TABLE ...):  See :DOC failure.

******** FAILED ********

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL

ACL2 Error [Failure] in ( PROGN (TABLE MEMOIZE-TABLE ...) ...):  See
:DOC failure.

******** FAILED ********
ACL2 !>>(DEFTHM |F1-is-G1| (EQUAL (F1 X) (G1 X))
                :RULE-CLASSES NIL)
Goal'

Q.E.D.

Summary
Form:  ( DEFTHM |F1-is-G1| ...)
Rules: ((:DEFINITION F1)
        (:DEFINITION G1)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE CAR-CONS))
 |F1-is-G1|
ACL2 !>>(MEMOIZE 'F1 :INVOKE 'G1)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'F1
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'G1)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))

Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL
MEMOIZE-TABLE


ACL2 !>>>(VALUE-TRIPLE (DEREF-MACRO-NAME 'F1
                                         (MACRO-ALIASES (W STATE))))
F1

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL
 F1
ACL2 !>>(TRACE$ G1)
 ((G1))
ACL2 !>>(F1 3)
1> (G1 3)
<1 (G1 (3))
(3)
ACL2 !>>(DEFUN FIB (N)
               (DECLARE (XARGS :GUARD (NATP N)))
               (IF (ZP N)
                   0
                   (IF (EQL N 1)
                       1 (+ (FIB (- N 1)) (FIB (- N 2))))))

For the admission of FIB we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT N).  The non-trivial part of the measure conjecture is

Goal
(IMPLIES (AND (NOT (ZP N)) (NOT (EQL N 1)))
         (O< (ACL2-COUNT (+ -2 N))
             (ACL2-COUNT N))).
Goal'

Splitter note (see :DOC splitter) for Goal' (2 subgoals).
  if-intro: ((:DEFINITION ACL2-COUNT)
             (:DEFINITION INTEGER-ABS)
             (:DEFINITION O<))

Subgoal 2
Subgoal 1

Q.E.D.

That completes the proof of the measure theorem for FIB.  Thus, we
admit this function under the principle of definition.  We observe
that the type of FIB is described by the theorem 
(AND (INTEGERP (FIB N)) (<= 0 (FIB N))).  We used primitive type reasoning.

Computing the guard conjecture for FIB....

The non-trivial part of the guard conjecture for FIB, given the :compound-
recognizer rules NATP-COMPOUND-RECOGNIZER and ZP-COMPOUND-RECOGNIZER,
the :executable-counterpart of EQLABLEP, primitive type reasoning and
the :type-prescription rule FIB, is

Goal
(IMPLIES (AND (NATP N)
              (NOT (ZP N))
              (NOT (EQL N 1)))
         (NATP (+ -2 N))).
Goal'
Goal''

Q.E.D.

That completes the proof of the guard theorem for FIB.  FIB is compliant
with Common Lisp.

Summary
Form:  ( DEFUN FIB ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-COMPOUND-RECOGNIZER)
        (:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
        (:DEFINITION ACL2-COUNT)
        (:DEFINITION EQL)
        (:DEFINITION INTEGER-ABS)
        (:DEFINITION NATP)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:EXECUTABLE-COUNTERPART EQLABLEP)
        (:EXECUTABLE-COUNTERPART TAU-SYSTEM)
        (:EXECUTABLE-COUNTERPART UNARY--)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)
        (:TYPE-PRESCRIPTION FIB))
Splitter rules (see :DOC splitter):
  if-intro: ((:DEFINITION ACL2-COUNT)
             (:DEFINITION INTEGER-ABS)
             (:DEFINITION O<))
 FIB
ACL2 !>>(WITH-OUTPUT :OFF SUMMARY
                     (PROGN (COMP 'FIB) (VALUE-TRIPLE T)))


ACL2 !>>>(COMP 'FIB)


ACL2 !>>>(VALUE-TRIPLE T)
 T
ACL2 !>>(DEFUN FIB2 (N)
               (DECLARE (XARGS :GUARD (NATP N)))
               (IF (= N 40) 102334155 (FIB N)))

Since FIB2 is non-recursive, its admission is trivial.  We observe
that the type of FIB2 is described by the theorem 
(AND (INTEGERP (FIB2 N)) (<= 0 (FIB2 N))).  We used the :type-prescription
rule FIB.

Computing the guard conjecture for FIB2....

The guard conjecture for FIB2 is trivial to prove, given the :compound-
recognizer rule NATP-COMPOUND-RECOGNIZER.  FIB2 is compliant with Common
Lisp.

Summary
Form:  ( DEFUN FIB2 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-COMPOUND-RECOGNIZER)
        (:TYPE-PRESCRIPTION FIB))
 FIB2
ACL2 !>>(MEMOIZE 'FIB :INVOKE 'FIB2)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'FIB
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'FIB2)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))


ACL2 Error in ( TABLE MEMOIZE-TABLE ...):  Illegal attempt to set memoize-
table:  The following event must be admitted (possibly with differing
name or macro) before memoizing function FIB with :INVOKE value FIB2.
See :DOC memoize.

(DEFTHM |FIB-is-FIB2| (EQUAL (FIB N) (FIB2 N)) :RULE-CLASSES NIL)


Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL

ACL2 Error [Failure] in ( TABLE MEMOIZE-TABLE ...):  See :DOC failure.

******** FAILED ********

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL

ACL2 Error [Failure] in ( PROGN (TABLE MEMOIZE-TABLE ...) ...):  See
:DOC failure.

******** FAILED ********
ACL2 !>>(DEFTHM |FIB-is-FIB2| (EQUAL (FIB N) (FIB2 N))
                :RULE-CLASSES NIL)

Q.E.D.

Summary
Form:  ( DEFTHM |FIB-is-FIB2| ...)
Rules: ((:DEFINITION FIB2)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:EXECUTABLE-COUNTERPART FIB))
 |FIB-is-FIB2|
ACL2 !>>(MEMOIZE 'FIB :INVOKE 'FIB2)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'FIB
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'FIB2)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))

Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL
MEMOIZE-TABLE


ACL2 !>>>(VALUE-TRIPLE (DEREF-MACRO-NAME 'FIB
                                         (MACRO-ALIASES (W STATE))))
FIB

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL
 FIB
ACL2 !>>(FIB 40)
102334155
ACL2 !>>(FIB 41)
165580141
ACL2 !>>(DEFUN F2 (X)
               (DECLARE (XARGS :GUARD (CONSP X)))
               (CAR X))

Since F2 is non-recursive, its admission is trivial.  We could deduce
no constraints on the type of F2.

Computing the guard conjecture for F2....

The guard conjecture for F2 is trivial to prove.  F2 is compliant with
Common Lisp.

Summary
Form:  ( DEFUN F2 ...)
Rules: NIL
 F2
ACL2 !>>(F2 3)


ACL2 Error in TOP-LEVEL:  The guard for the function call (F2 X), which
is (CONSP X), is violated by the arguments in the call (F2 3).
See :DOC set-guard-checking for information about suppressing this
check with (set-guard-checking :none), as recommended for new users.
To debug see :DOC print-gv, see :DOC trace, and see :DOC wet.

ACL2 !>>(DEFUN G2 (X)
               (DECLARE (XARGS :GUARD (LISTP X)))
               (CAR X))

Since G2 is non-recursive, its admission is trivial.  We could deduce
no constraints on the type of G2.

Computing the guard conjecture for G2....

The guard conjecture for G2 is trivial to prove.  G2 is compliant with
Common Lisp.

Summary
Form:  ( DEFUN G2 ...)
Rules: NIL
 G2
ACL2 !>>(DEFTHM |F-is-G| (EQUAL (F2 X) (G2 X))
                :RULE-CLASSES NIL)

Q.E.D.

Summary
Form:  ( DEFTHM |F-is-G| ...)
Rules: ((:DEFINITION F2) (:DEFINITION G2))
 |F-is-G|
ACL2 !>>(MEMOIZE 'F2 :INVOKE 'G2)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'F2
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'G2)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))


ACL2 Error in ( TABLE MEMOIZE-TABLE ...):  Illegal attempt to set memoize-
table:  The following event must be admitted (possibly with differing
name or macro) before memoizing function F2 with :INVOKE value G2.
See :DOC memoize.

(VERIFY-GUARD-IMPLICATION F2 G2)


Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL

ACL2 Error [Failure] in ( TABLE MEMOIZE-TABLE ...):  See :DOC failure.

******** FAILED ********

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL

ACL2 Error [Failure] in ( PROGN (TABLE MEMOIZE-TABLE ...) ...):  See
:DOC failure.

******** FAILED ********
ACL2 !>>(VERIFY-GUARD-IMPLICATION F2 G2)

Q.E.D.

Summary
Form:  ( DEFTHM |F2-guard-implies-G2-guard| ...)
Rules: NIL

Summary
Form:  ( MAKE-EVENT (LET ...))
Rules: NIL
 |F2-guard-implies-G2-guard|
ACL2 !>>(MEMOIZE 'F2 :INVOKE 'G2)


ACL2 !>>>(TABLE
              MEMOIZE-TABLE
              (DEREF-MACRO-NAME 'F2
                                (MACRO-ALIASES WORLD))
              (LIST* (CONS :CONDITION-FN NIL)
                     (CONS :INLINE NIL)
                     (CONS :COMMUTATIVE NIL)
                     (CONS :FORGET NIL)
                     (CONS :MEMO-TABLE-INIT-SIZE (OR NIL *MHT-DEFAULT-SIZE*))
                     (CONS :AOKP 'NIL)
                     (CONS :STATS NIL)
                     (CONS :TOTAL NIL)
                     (CONS :INVOKE 'G2)
                     (AND (NOT (EQ ':DEFAULT :DEFAULT))
                          (LIST (CONS :IDEAL-OKP ':DEFAULT)))))

Summary
Form:  ( TABLE MEMOIZE-TABLE ...)
Rules: NIL
MEMOIZE-TABLE


ACL2 !>>>(VALUE-TRIPLE (DEREF-MACRO-NAME 'F2
                                         (MACRO-ALIASES (W STATE))))
F2

Summary
Form:  ( PROGN (TABLE MEMOIZE-TABLE ...) ...)
Rules: NIL
 F2
ACL2 !>>(TRACE$ G2)
 ((G2))
ACL2 !>>(F2 3)


ACL2 Error in TOP-LEVEL:  The guard for the function call (F2 X), which
is (CONSP X), is violated by the arguments in the call (F2 3).
See :DOC set-guard-checking for information about suppressing this
check with (set-guard-checking :none), as recommended for new users.
To debug see :DOC print-gv, see :DOC trace, and see :DOC wet.

ACL2 !>>(F2 '(A B C))
1> (G2 (A B C))
<1 (G2 A)
A
ACL2 !>>(DEFN F3 (X Y)
              (DECLARE (TYPE RATIONAL X Y))
              (+ X Y))

Since F3 is non-recursive, its admission is trivial.  We observe that
the type of F3 is described by the theorem (ACL2-NUMBERP (F3 X Y)).
We used primitive type reasoning.

Computing the guard conjecture for F3....

The guard conjecture for F3 is trivial to prove.  F3 is compliant with
Common Lisp.

Summary
Form:  ( DEFUN F3 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
 F3
ACL2 !>>(DEFN G3 (X Y)
              (DECLARE (TYPE RATIONAL X Y))
              (+ 1 -1 X Y))

Since G3 is non-recursive, its admission is trivial.  We observe that
the type of G3 is described by the theorem (ACL2-NUMBERP (G3 X Y)).
We used primitive type reasoning.

Computing the guard conjecture for G3....

The guard conjecture for G3 is trivial to prove, given primitive type
reasoning.  G3 is compliant with Common Lisp.

Summary
Form:  ( DEFUN G3 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
 G3
ACL2 !>>(DEFTHM |F3-is-G3| (EQUAL (F3 X Y) (G3 X Y))
                :RULE-CLASSES NIL)

Q.E.D.

Summary
Form:  ( DEFTHM |F3-is-G3| ...)
Rules: ((:DEFINITION F3)
        (:DEFINITION G3)
        (:EXECUTABLE-COUNTERPART TAU-SYSTEM))
 |F3-is-G3|
ACL2 !>>(WITH-OUTPUT :OFF
                     :ALL (MEMOIZE 'F3
                                   :INVOKE 'G3
                                   :COMMUTATIVE T))
 T
ACL2 !>>(TRACE$ G3)
 ((G3))
ACL2 !>>(F3 3 4)
1> (G3 3 4)
<1 (G3 7)
7
ACL2 !>>Bye.