Skip to content

Commit 9172566

Browse files
committed
Tweaked code by removing an obsolete case, and added discussion of linear to :doc force. Added a way to set gag-mode to nil for regressions.
Quoting a comment added to (defxdoc note-8-4 ...): ; Cleaned up source function tilde-@-assumnotes-phrase-lst-gag-mode by removing ; an obsolete case having to do with forcing guards. We noticed this case as ; we added to :doc force to explain forcing by linearization (thanks to Mihir ; Mehta for a query leading to that :doc improvement). Since the code change is relevant to output, this time I ran an "everything" regression with both INHIBIT='(set-inhibit-output-lst (list (quote proof-tree)))' and, to set gag-mode to nil, ACL2_CUSTOMIZATION=`pwd`/acl2-customization-files/set-gag-mode-nil.lisp -- and to support that, I added acl2-customization-files/set-gag-mode-nil.lisp to the git repository. I also ran :mini-proveall as a quick check that I didn't break normal output (hard to imagine, with my tiny change).
1 parent a32f77a commit 9172566

File tree

11 files changed

+98
-16
lines changed

11 files changed

+98
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!acl2(set-gag-mode nil)

books/centaur/esim/tutorial/cert.acl2

+8
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@
3737
(include-book "centaur/esim/portcullis" :dir :system)
3838
(include-book "centaur/aig/portcullis" :dir :system)
3939
; cert-flags: ? t :ttags :all
40+
41+
; Matt K. mod: If proof output is enabled and gag-mode is off, then turn on
42+
; gag-mode (might as well use the default of :goals) to avoid printing huge
43+
; object. This happened 5/11/2020 when attempting to certify boothmul.lisp.
44+
(if (and (not (member-eq 'prove (f-get-global 'inhibit-output-lst state)))
45+
(null (gag-mode)))
46+
(set-gag-mode :goals)
47+
state)

books/demos/mini-proveall-input.lsp

+2
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
; Here is a quick test that we sometimes run. To see what it generates,
66
; evaluate (trans1 '(mini-proveall)).
77

8+
(set-gag-mode :goals)
9+
810
(mini-proveall)

books/demos/mini-proveall-log.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ACL2 !>>(SET-INHIBITED-SUMMARY-TYPES '(TIME STEPS))
77
(TIME STEPS)
88
ACL2 !>>(SET-INHIBIT-OUTPUT-LST '(PROOF-TREE))
99
(PROOF-TREE)
10+
ACL2 !>>(SET-GAG-MODE :GOALS)
11+
<state>
1012
ACL2 !>>(MINI-PROVEALL)
1113
ACL2 !>>>:LOGIC
1214

books/projects/paco/books/proveall-input.lsp

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
(include-book "../paco")
44
(in-package "PACO")
55

6+
(acl2::set-gag-mode :goals)
7+
68
(acl2::table acl2::theory-invariant-table nil nil :clear)
79

810
(ACL2::SET-MATCH-FREE-ERROR NIL)

books/projects/paco/books/proveall-log.txt

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Rules: NIL
1515
"../paco.lisp"
1616
ACL2 !>>(IN-PACKAGE "PACO")
1717
"PACO"
18+
PACO !>>(ACL2::SET-GAG-MODE :GOALS)
19+
<state>
1820
PACO !>>(ACL2::TABLE ACL2::THEORY-INVARIANT-TABLE
1921
NIL NIL :CLEAR)
2022

books/system/doc/acl2-doc.lisp

+39
Original file line numberDiff line numberDiff line change
@@ -32116,6 +32116,40 @@ current fast alists."
3211632116
this happen? The type system ``punted'' the forced hypothesis to the
3211732117
rewriter, which established it.</p>
3211832118

32119+
<p>The discussion above may give the impression that a forcing round only
32120+
takes place because of a failure to relieve a forced hypothesis. A notable
32121+
exception, however, is due to @(see linear-arithmetic). Consider the
32122+
following example:</p>
32123+
32124+
@({
32125+
(implies (not (equal 0 x))
32126+
(or (< 0 x) (< x 0)))
32127+
})
32128+
32129+
<p>This is not a theorem; in particular, it fails when @('x') is @('nil').
32130+
What is missing is the hypothesis, @('(acl2-numberp x)'). If you try to prove
32131+
the displayed formula above and you look at the proof using @(':')@(tsee pso),
32132+
you'll see the following.</p>
32133+
32134+
@({
32135+
But forced simplification reduces this to T, using the :executable-
32136+
counterpart of FORCE and linear arithmetic.
32137+
})
32138+
32139+
<p>Thus, no specific rule created this forcing round (see also @(see
32140+
forcing-round)). Rather, ACL2 was able to prove the goal using linear
32141+
arithmetic, but it needed to force the assumption that @('x') is a number.
32142+
This is clear when we look at output for the forcing round:</p>
32143+
32144+
@({
32145+
[1]Goal, below, will focus on
32146+
(ACL2-NUMBERP X),
32147+
which was forced in
32148+
Goal'
32149+
by the linearization of
32150+
(EQUAL 0 X).
32151+
})
32152+
3211932153
<p>Finally, we should mention that the rewriter is never willing to force when
3212032154
there is an @(tsee if) term present in the goal being simplified. Since
3212132155
@(tsee and) terms and @(tsee or) terms are merely abbreviations for @(tsee if)
@@ -86156,6 +86190,11 @@ it."
8615686190
; led to this improvement. Also avoided a raw Lisp error for EQUIV when the
8615786191
; alleged equivalence relation is supplied as an atom that is not a symbol.
8615886192

86193+
; Cleaned up source function tilde-@-assumnotes-phrase-lst-gag-mode by removing
86194+
; an obsolete case having to do with forcing guards. We noticed this case as
86195+
; we added to :doc force to explain forcing by linearization (thanks to Mihir
86196+
; Mehta for a query leading to that :doc improvement).
86197+
8615986198
:parents (release-notes)
8616086199
:short "ACL2 Version 8.4 (xxx, 20xx) Notes"
8616186200
:long "<p>NOTE! New users can ignore these release notes, because the @(see

doc.lisp

+29
Original file line numberDiff line numberDiff line change
@@ -35606,6 +35606,35 @@ Subtopics
3560635606
``punted'' the forced hypothesis to the rewriter, which established
3560735607
it.
3560835608

35609+
The discussion above may give the impression that a forcing round
35610+
only takes place because of a failure to relieve a forced
35611+
hypothesis. A notable exception, however, is due to
35612+
[linear-arithmetic]. Consider the following example:
35613+
35614+
(implies (not (equal 0 x))
35615+
(or (< 0 x) (< x 0)))
35616+
35617+
This is not a theorem; in particular, it fails when x is nil. What
35618+
is missing is the hypothesis, (acl2-numberp x). If you try to
35619+
prove the displayed formula above and you look at the proof using
35620+
:[pso], you'll see the following.
35621+
35622+
But forced simplification reduces this to T, using the :executable-
35623+
counterpart of FORCE and linear arithmetic.
35624+
35625+
Thus, no specific rule created this forcing round (see also
35626+
[forcing-round]). Rather, ACL2 was able to prove the goal using
35627+
linear arithmetic, but it needed to force the assumption that x is
35628+
a number. This is clear when we look at output for the forcing
35629+
round:
35630+
35631+
[1]Goal, below, will focus on
35632+
(ACL2-NUMBERP X),
35633+
which was forced in
35634+
Goal'
35635+
by the linearization of
35636+
(EQUAL 0 X).
35637+
3560935638
Finally, we should mention that the rewriter is never willing to
3561035639
force when there is an [if] term present in the goal being
3561135640
simplified. Since [and] terms and [or] terms are merely

doc/acl2-code-size.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Source files (not including doc.lisp):
22
------------------------------------
33
CODE LINES:
4-
143024 lines, 6366699 characters
4+
143021 lines, 6366396 characters
55
COMMENT LINES:
66
80139 lines, 4827139 characters
77
BLANK LINES:
88
33611 lines, 33611 characters
99
TOTAL:
10-
256774 lines, 11227449 characters
10+
256771 lines, 11227146 characters
1111
------------------------------------
1212
Documentation (file books/system/doc/acl2-doc.lisp):
13-
130174 lines, 5750050 characters
13+
130213 lines, 5751468 characters
1414
------------------------------------

doc/home-page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<center>
153153
<b><a href="mailto:[email protected]">Matt Kaufmann</a> and <a href="mailto:[email protected]">J Strother Moore</a></b><br>
154154
<a href="http://www.utexas.edu">University of Texas at Austin</a><br>
155-
May 8, 2020
155+
May 11, 2020
156156
</center>
157157

158158
<p>

prove.lisp

+9-12
Original file line numberDiff line numberDiff line change
@@ -8951,24 +8951,21 @@
89518951
(let* ((cl-id-phrase
89528952
(tilde-@-clause-id-phrase
89538953
(access assumnote (car lst) :cl-id)))
8954+
(rune (access assumnote (car lst) :rune))
89548955
(x
8955-
(cond ((and (consp (access assumnote (car lst) :rune))
8956-
(null (base-symbol (access assumnote (car lst)
8957-
:rune))))
8956+
(cond ((and (consp rune)
8957+
(null (base-symbol rune)))
89588958
(list " ~@0 by primitive type reasoning"
89598959
(cons #\0 cl-id-phrase)))
8960-
((eq (access assumnote (car lst) :rune) 'equal)
8960+
((eq rune 'equal)
89618961
(list " ~@0 by linearization"
89628962
(cons #\0 cl-id-phrase)))
8963-
((symbolp (access assumnote (car lst) :rune))
8964-
(list " ~@0 by assuming the guard for ~x1"
8965-
(cons #\0 cl-id-phrase)
8966-
(cons #\1 (access assumnote (car lst) :rune))))
89678963
(t
8968-
(list " ~@0 by applying ~x1"
8969-
(cons #\0 cl-id-phrase)
8970-
(cons #\1 (access assumnote (car lst)
8971-
:rune)))))))
8964+
(assert$ ; Check that we no longer assume a guard.
8965+
(not (symbolp rune))
8966+
(list " ~@0 by applying ~x1"
8967+
(cons #\0 cl-id-phrase)
8968+
(cons #\1 rune)))))))
89728969
(add-to-set-equal x acc))))))
89738970

89748971
(defun tilde-*-assumnotes-column-phrase-gag-mode (assumnotes)

0 commit comments

Comments
 (0)