(NOTE-LIB "app-c-d-e" T)
Loading ./flatau/app-c-d-e.lib
Finished loading ./flatau/app-c-d-e.lib
Loading ./flatau/app-c-d-e.o
Loading ./flatau/0app-c-d-e.o
Finished loading ./flatau/0app-c-d-e.o
Loading ./flatau/1app-c-d-e.o
Finished loading ./flatau/1app-c-d-e.o
Finished loading ./flatau/app-c-d-e.o
(#./flatau/app-c-d-e.lib #./flatau/app-c-d-e)
(PROVE-LEMMA AXIOM-53
(REWRITE)
(IMPLIES (SUBRP FN)
(EQUAL (FORMALS FN) F)))
WARNING: the previously added lemma, SUBRP-FORMALS, could be applied whenever
the newly proposed AXIOM-53 could!
This formula simplifies, applying the lemma SUBRP-FORMALS, and expanding the
definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AXIOM-53
(DISABLE PROPER-P-STATEP-RESTRUCTURING)
[ 0.0 0.0 0.0 ]
PROPER-P-STATEP-RESTRUCTURING-OFF
(DEFN CHANGE-ELEMENTS
(LIST)
(IF (LISTP LIST)
(IF (TRUEP (CAR LIST))
(CONS (FALSE)
(CHANGE-ELEMENTS (CDR LIST)))
(CONS (TRUE)
(CHANGE-ELEMENTS (CDR LIST))))
(IF (TRUEP LIST) (FALSE) (TRUE))))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT LIST) decreases according to the well-founded relation LESSP in each
recursive call. Hence, CHANGE-ELEMENTS is accepted under the principle of
definition. Note that:
(OR (FALSEP (CHANGE-ELEMENTS LIST))
(TRUEP (CHANGE-ELEMENTS LIST))
(LISTP (CHANGE-ELEMENTS LIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
CHANGE-ELEMENTS
(DISABLE DEPOSIT)
[ 0.0 0.0 0.0 ]
DEPOSIT-OFF
(DISABLE FETCH)
[ 0.0 0.0 0.0 ]
FETCH-OFF
(DISABLE ADD-ADDR)
[ 0.0 0.0 0.0 ]
ADD-ADDR-OFF
(DISABLE SUB-ADDR)
[ 0.0 0.0 0.0 ]
SUB-ADDR-OFF
(DISABLE OFFSET)
[ 0.0 0.0 0.0 ]
OFFSET-OFF
(DISABLE AREA-NAME)
[ 0.0 0.0 0.0 ]
AREA-NAME-OFF
(DISABLE ERRORP)
[ 0.0 0.0 0.0 ]
ERRORP-OFF
(DISABLE P-CURRENT-PROGRAM)
[ 0.0 0.0 0.0 ]
P-CURRENT-PROGRAM-OFF
(PROVE-LEMMA MY-GET-PUT
(REWRITE)
(IMPLIES (AND (NUMBERP K) (NUMBERP N))
(EQUAL (GET K (PUT VAL N LST))
(IF (EQUAL K N) VAL (GET K LST))))
((ENABLE GET-CONS GET PUT GET-ANYTHING-NIL)))
This conjecture simplifies, trivially, to the following two new formulas:
Case 2. (IMPLIES (AND (NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N)))
(EQUAL (GET K (PUT VAL N LST))
(GET K LST))).
Name the above subgoal *1.
Case 1. (IMPLIES (AND (NUMBERP K)
(NUMBERP N)
(EQUAL K N))
(EQUAL (GET K (PUT VAL N LST)) VAL)).
This again simplifies, obviously, to:
(IMPLIES (NUMBERP N)
(EQUAL (GET N (PUT VAL N LST)) VAL)),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(IMPLIES (AND (NUMBERP K) (NUMBERP N))
(EQUAL (GET K (PUT VAL N LST))
(IF (EQUAL K N) VAL (GET K LST)))),
named *1. Let us appeal to the induction principle. There are three
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP K) (p K VAL N LST))
(IMPLIES (AND (NOT (ZEROP K))
(p (SUB1 K) VAL (SUB1 N) (CDR LST)))
(p K VAL N LST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for N and LST. The above induction
scheme leads to the following two new formulas:
Case 2. (IMPLIES (AND (ZEROP K)
(NUMBERP K)
(NUMBERP N))
(EQUAL (GET K (PUT VAL N LST))
(IF (EQUAL K N) VAL (GET K LST)))).
This simplifies, rewriting with the lemma GET-ZEROP, and unfolding the
functions ZEROP, NUMBERP, and PUT, to the following six new goals:
Case 2.6.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(NOT (EQUAL 0 N))
(NOT (EQUAL N 0)))
(EQUAL (CAR (CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
(CAR LST))).
This again simplifies, rewriting with the lemma CAR-CONS, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(NOT (EQUAL 0 N))
(EQUAL N 0)
(LISTP LST))
(EQUAL (CAR (CONS VAL (CDR LST)))
(CAR LST))),
which again simplifies, clearly, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(NOT (EQUAL 0 N))
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (CAR (LIST VAL)) (CAR LST))).
This again simplifies, trivially, to:
T.
Case 2.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(EQUAL 0 N)
(NOT (EQUAL N 0)))
(EQUAL (CAR (CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
VAL)).
This again simplifies, obviously, to:
T.
Case 2.2.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(EQUAL 0 N)
(EQUAL N 0)
(LISTP LST))
(EQUAL (CAR (CONS VAL (CDR LST)))
VAL)).
However this again simplifies, applying CAR-CONS, and unfolding NUMBERP
and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP N)
(EQUAL 0 N)
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (CAR (LIST VAL)) VAL)).
This again simplifies, applying CAR-CONS, and opening up the definitions
of NUMBERP and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(IF (EQUAL (SUB1 K) (SUB1 N))
VAL
(GET (SUB1 K) (CDR LST))))
(NUMBERP K)
(NUMBERP N))
(EQUAL (GET K (PUT VAL N LST))
(IF (EQUAL K N) VAL (GET K LST)))).
This simplifies, opening up ZEROP, PUT, and GET, to the following 12 new
conjectures:
Case 1.12.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(NOT (EQUAL N 0)))
(EQUAL (GET K
(CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
(GET (SUB1 K) (CDR LST)))).
However this again simplifies, applying GET-CONS, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(EQUAL N 0)
(LISTP LST))
(EQUAL (GET K (CONS VAL (CDR LST)))
(GET (SUB1 K) (CDR LST)))).
This again simplifies, appealing to the lemmas EQUAL-SUB1-0 and GET-CONS,
and opening up the definitions of SUB1, EQUAL, PUT, and NUMBERP, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (GET K (LIST VAL))
(GET (SUB1 K) (CDR LST)))),
which again simplifies, applying the lemmas EQUAL-SUB1-0, CDR-NLISTP,
GET-ANYTHING-NIL, and GET-CONS, and expanding the definitions of SUB1,
LISTP, EQUAL, PUT, and NUMBERP, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(NOT (EQUAL N 0)))
(EQUAL (GET K
(CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
VAL)),
which again simplifies, clearly, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(EQUAL N 0)
(LISTP LST))
(EQUAL (GET K (CONS VAL (CDR LST)))
VAL)).
This again simplifies, trivially, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL K 0))
(NOT (EQUAL (SUB1 K) (SUB1 N)))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
(GET (SUB1 K) (CDR LST)))
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (GET K (LIST VAL)) VAL)).
This again simplifies, trivially, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(NOT (EQUAL N 0)))
(EQUAL (GET K
(CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
(GET (SUB1 K) (CDR LST)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(EQUAL N 0)
(LISTP LST))
(EQUAL (GET K (CONS VAL (CDR LST)))
(GET (SUB1 K) (CDR LST)))),
which again simplifies, rewriting with EQUAL-SUB1-0, GET-ZEROP, CDR-CONS,
CAR-NLISTP, and GET-ADD1-OPENER, and opening up the definitions of SUB1,
EQUAL, PUT, ZEROP, and NUMBERP, to the following two new conjectures:
Case 1.5.2.
(IMPLIES (AND (EQUAL K 1)
(NOT (LISTP (CDR LST)))
(EQUAL (CAR (LIST VAL)) VAL)
(LISTP LST))
(EQUAL 0 (GET (SUB1 K) (CDR LST)))).
This again simplifies, applying CAR-CONS, CAR-NLISTP, and GET-ZEROP, and
expanding the definitions of SUB1, ZEROP, and EQUAL, to:
T.
Case 1.5.1.
(IMPLIES (AND (EQUAL K 1)
(LISTP (CDR LST))
(EQUAL (CAR (CONS VAL (CDDR LST)))
VAL)
(LISTP LST))
(EQUAL (CADR LST)
(GET (SUB1 K) (CDR LST)))).
This again simplifies, appealing to the lemmas CAR-CONS and GET-ZEROP,
and opening up the definitions of SUB1 and ZEROP, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(NOT (EQUAL K N))
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (GET K (LIST VAL))
(GET (SUB1 K) (CDR LST)))),
which again simplifies, applying EQUAL-SUB1-0, CDR-NLISTP, CAR-CONS,
GET-ZEROP, CDR-CONS, and GET-ADD1-OPENER, and expanding the functions SUB1,
LISTP, EQUAL, PUT, ZEROP, NUMBERP, and GET, to the new goal:
(IMPLIES (AND (EQUAL K 1) (NOT (LISTP LST)))
(EQUAL 0 (GET (SUB1 K) (CDR LST)))),
which again simplifies, applying CDR-NLISTP, and expanding SUB1, GET, and
EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(NOT (EQUAL N 0)))
(EQUAL (GET K
(CONS (CAR LST)
(PUT VAL (SUB1 N) (CDR LST))))
VAL)).
However this again simplifies, rewriting with GET-CONS, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(EQUAL N 0)
(LISTP LST))
(EQUAL (GET K (CONS VAL (CDR LST)))
VAL)).
This again simplifies, obviously, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL K 0))
(EQUAL (SUB1 K) (SUB1 N))
(EQUAL (GET (SUB1 K)
(PUT VAL (SUB1 N) (CDR LST)))
VAL)
(NUMBERP K)
(NUMBERP N)
(EQUAL K N)
(EQUAL N 0)
(NOT (LISTP LST)))
(EQUAL (GET K (LIST VAL)) VAL)).
This again simplifies, trivially, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
MY-GET-PUT
(DISABLE MY-GET-PUT)
[ 0.0 0.0 0.0 ]
MY-GET-PUT-OFF
(PROVE-LEMMA LISTP-CDR-P-FRAME
(REWRITE)
(LISTP (CDR (P-FRAME BINDINGS RET-PC)))
((ENABLE P-FRAME)))
This formula can be simplified, using the abbreviations CDR-CONS and P-FRAME,
to:
(LISTP (LIST RET-PC)),
which simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-CDR-P-FRAME
(PROVE-LEMMA EQUAL-CDDR-P-FRAME-NIL
(REWRITE)
(EQUAL (CDDR (P-FRAME BINDINGS RET-PC))
NIL)
((ENABLE P-FRAME)))
This conjecture can be simplified, using the abbreviations CDR-CONS and
P-FRAME, to the conjecture:
(EQUAL NIL NIL).
This simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-CDDR-P-FRAME-NIL
(DEFN S-L-EVAL-EQUIV-HYPS
(FLAG S C)
(AND (S-GOOD-STATEP S C)
(GOOD-POSP FLAG
(S-POS S)
(S-BODY (S-PROG S)))
(EQUAL (S-ERR-FLAG (S-EVAL FLAG S C))
'RUN)))
Observe that:
(OR (FALSEP (S-L-EVAL-EQUIV-HYPS FLAG S C))
(TRUEP (S-L-EVAL-EQUIV-HYPS FLAG S C)))
is a theorem.
[ 0.0 0.0 0.0 ]
S-L-EVAL-EQUIV-HYPS
(DEFN S-L-EVAL-FLAG-RUN-HYPS
(FLAG S C)
(AND (S-GOOD-STATEP S C)
(S-ALL-TEMPS-SETP FLAG
(IF (EQUAL FLAG 'LIST)
(S-EXPR-LIST S)
(S-EXPR S))
(TEMP-ALIST-TO-SET (S-TEMPS S)))
(S-ALL-PROGS-TEMPS-SETP (S-PROGS S))
(IF (EQUAL FLAG 'LIST)
(NOT (MEMBER F
(L-EVAL FLAG
(S-EXPAND-TEMPS FLAG (S-EXPR-LIST S))
(S-PARAMS S)
C)))
(L-EVAL FLAG
(S-EXPAND-TEMPS FLAG (S-EXPR S))
(S-PARAMS S)
C))
(S-CHECK-TEMPS-SETP (S-TEMPS S))))
Note that:
(OR (FALSEP (S-L-EVAL-FLAG-RUN-HYPS FLAG S C))
(TRUEP (S-L-EVAL-FLAG-RUN-HYPS FLAG S C)))
is a theorem.
[ 0.0 0.0 0.0 ]
S-L-EVAL-FLAG-RUN-HYPS
(DEFN LR-UNDEFINED-TAG NIL 0)
From the definition we can conclude that (NUMBERP (LR-UNDEFINED-TAG)) is
a theorem.
[ 0.0 0.0 0.0 ]
LR-UNDEFINED-TAG
(DEFN LR-INIT-TAG NIL 1)
From the definition we can conclude that (NUMBERP (LR-INIT-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-INIT-TAG
(DEFN LR-FALSE-TAG NIL 2)
From the definition we can conclude that (NUMBERP (LR-FALSE-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-FALSE-TAG
(DEFN LR-TRUE-TAG NIL 3)
From the definition we can conclude that (NUMBERP (LR-TRUE-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-TRUE-TAG
(DEFN LR-ADD1-TAG NIL 4)
From the definition we can conclude that (NUMBERP (LR-ADD1-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-ADD1-TAG
(DEFN LR-CONS-TAG NIL 5)
From the definition we can conclude that (NUMBERP (LR-CONS-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-CONS-TAG
(DEFN LR-PACK-TAG NIL 6)
From the definition we can conclude that (NUMBERP (LR-PACK-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-PACK-TAG
(DEFN LR-MINUS-TAG NIL 7)
From the definition we can conclude that (NUMBERP (LR-MINUS-TAG)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-MINUS-TAG
(DEFN LR-HEAP-NAME NIL 'HEAP)
From the definition we can conclude that (LITATOM (LR-HEAP-NAME)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-HEAP-NAME
(DEFN LR-NODE-SIZE NIL 4)
From the definition we can conclude that (NUMBERP (LR-NODE-SIZE)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-NODE-SIZE
(DEFN LR-UNDEF-ADDR NIL
(TAG 'ADDR '(HEAP . 0)))
Observe that (LISTP (LR-UNDEF-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-UNDEF-ADDR
(DEFN LR-F-ADDR NIL
(ADD-ADDR (LR-UNDEF-ADDR)
(LR-NODE-SIZE)))
From the definition we can conclude that (LISTP (LR-F-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-F-ADDR
(DEFN LR-T-ADDR NIL
(ADD-ADDR (LR-F-ADDR) (LR-NODE-SIZE)))
From the definition we can conclude that (LISTP (LR-T-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-T-ADDR
(DEFN LR-0-ADDR NIL
(ADD-ADDR (LR-T-ADDR) (LR-NODE-SIZE)))
From the definition we can conclude that (LISTP (LR-0-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-0-ADDR
(DEFN LR-FP-ADDR NIL
(TAG 'ADDR '(FREE-PTR . 0)))
Observe that (LISTP (LR-FP-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-FP-ADDR
(DEFN LR-ANSWER-ADDR NIL
(TAG 'ADDR '(ANSWER . 0)))
Observe that (LISTP (LR-ANSWER-ADDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-ANSWER-ADDR
(DEFN LR-FETCH-FP
(DATA-SEG)
(FETCH (LR-FP-ADDR) DATA-SEG))
[ 0.0 0.0 0.0 ]
LR-FETCH-FP
(DEFN LR-MINIMUM-HEAP-SIZE NIL
(OFFSET (ADD-ADDR (LR-0-ADDR)
(LR-NODE-SIZE))))
[ 0.0 0.0 0.0 ]
LR-MINIMUM-HEAP-SIZE
(DEFN LR-NEW-NODE
(TAG REF-COUNT VALUE1 VALUE2)
(LIST TAG REF-COUNT VALUE1 VALUE2))
Note that (LISTP (LR-NEW-NODE TAG REF-COUNT VALUE1 VALUE2)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-NEW-NODE
(DEFN LR-REF-COUNT-OFFSET NIL 1)
From the definition we can conclude that (NUMBERP (LR-REF-COUNT-OFFSET))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-REF-COUNT-OFFSET
(DEFN LR-CAR-OFFSET NIL 2)
From the definition we can conclude that (NUMBERP (LR-CAR-OFFSET)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-CAR-OFFSET
(DEFN LR-CDR-OFFSET NIL 3)
From the definition we can conclude that (NUMBERP (LR-CDR-OFFSET)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-CDR-OFFSET
(DEFN LR-UNPACK-OFFSET NIL 2)
From the definition we can conclude that (NUMBERP (LR-UNPACK-OFFSET)) is
a theorem.
[ 0.0 0.0 0.0 ]
LR-UNPACK-OFFSET
(DEFN LR-UNBOX-NAT-OFFSET NIL 2)
From the definition we can conclude that (NUMBERP (LR-UNBOX-NAT-OFFSET))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-UNBOX-NAT-OFFSET
(DEFN LR-NEGATIVE-GUTS-OFFSET NIL 2)
From the definition we can conclude that:
(NUMBERP (LR-NEGATIVE-GUTS-OFFSET))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-NEGATIVE-GUTS-OFFSET
(DEFN LR-BOUNDARY-OFFSETP
(OFFSET)
(EQUAL (REMAINDER OFFSET (LR-NODE-SIZE))
0))
From the definition we can conclude that:
(OR (FALSEP (LR-BOUNDARY-OFFSETP OFFSET))
(TRUEP (LR-BOUNDARY-OFFSETP OFFSET)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-BOUNDARY-OFFSETP
(DEFN LR-BOUNDARY-NODEP
(NODE)
(LR-BOUNDARY-OFFSETP (OFFSET NODE)))
From the definition we can conclude that:
(OR (FALSEP (LR-BOUNDARY-NODEP NODE))
(TRUEP (LR-BOUNDARY-NODEP NODE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-BOUNDARY-NODEP
(DEFN LR-NODEP
(ADDR DATA-SEG)
(AND (EQUAL (TYPE ADDR) 'ADDR)
(EQUAL (CDDR ADDR) NIL)
(LISTP ADDR)
(ADPP (UNTAG ADDR) DATA-SEG)
(LR-BOUNDARY-NODEP ADDR)
(EQUAL (AREA-NAME ADDR)
(LR-HEAP-NAME))))
Note that:
(OR (FALSEP (LR-NODEP ADDR DATA-SEG))
(TRUEP (LR-NODEP ADDR DATA-SEG)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-NODEP
(DEFN LR-GOOD-POINTERP
(ADDR DATA-SEG)
(AND (LR-NODEP ADDR DATA-SEG)
(EQUAL (TYPE (FETCH (ADD-ADDR ADDR (LR-REF-COUNT-OFFSET))
DATA-SEG))
'NAT)))
Observe that:
(OR (FALSEP (LR-GOOD-POINTERP ADDR DATA-SEG))
(TRUEP (LR-GOOD-POINTERP ADDR DATA-SEG)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-GOOD-POINTERP
(DEFN LR-EXPR
(P)
(CUR-EXPR (OFFSET (P-PC P))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))
[ 0.0 0.0 0.0 ]
LR-EXPR
(DISABLE LR-EXPR)
[ 0.0 0.0 0.0 ]
LR-EXPR-OFF
(DEFN LR-EXPR-LIST
(P)
(RESTN (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
[ 0.0 0.0 0.0 ]
LR-EXPR-LIST
(DISABLE LR-EXPR-LIST)
[ 0.0 0.0 0.0 ]
LR-EXPR-LIST-OFF
(DEFN MARK-INSTR
(INSTRUCTION-LIST N)
(IF (ZEROP N)
(CONS (LIST 'PC-> (CAR INSTRUCTION-LIST))
(CDR INSTRUCTION-LIST))
(CONS (CAR INSTRUCTION-LIST)
(MARK-INSTR (CDR INSTRUCTION-LIST)
(SUB1 N)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
inform us that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each recursive call. Hence, MARK-INSTR is accepted under
the principle of definition. Observe that:
(LISTP (MARK-INSTR INSTRUCTION-LIST N))
is a theorem.
[ 0.0 0.0 0.0 ]
MARK-INSTR
(DEFN FIX-PROGRAM-SEGMENT
(PROGRAMS PC)
(IF (LISTP PROGRAMS)
(LET ((PROG (CAR PROGRAMS)))
(IF (EQUAL (CAR PROG) (AREA-NAME PC))
(CONS (APPEND (LIST (CAR PROG)
(CADR PROG)
(CADDR PROG))
(MARK-INSTR (PROGRAM-BODY PROG)
(OFFSET PC)))
(FIX-PROGRAM-SEGMENT (CDR PROGRAMS)
PC))
(CONS (CAR PROG)
(FIX-PROGRAM-SEGMENT (CDR PROGRAMS)
PC))))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PROGRAMS) decreases according to the well-founded relation LESSP in
each recursive call. Hence, FIX-PROGRAM-SEGMENT is accepted under the
definitional principle. Observe that:
(OR (LITATOM (FIX-PROGRAM-SEGMENT PROGRAMS PC))
(LISTP (FIX-PROGRAM-SEGMENT PROGRAMS PC)))
is a theorem.
[ 0.0 0.0 0.0 ]
FIX-PROGRAM-SEGMENT
(DEFN FIX-DATA-SEGMENT
(DATA-SEGMENT)
(PUT-VALUE (APPEND (FIRSTN (OFFSET (LR-FETCH-FP DATA-SEGMENT))
(VALUE (LR-HEAP-NAME) DATA-SEGMENT))
(DIFFERENCE (LENGTH (VALUE (LR-HEAP-NAME) DATA-SEGMENT))
(OFFSET (LR-FETCH-FP DATA-SEGMENT))))
(LR-HEAP-NAME)
DATA-SEGMENT))
Observe that:
(OR (LISTP (FIX-DATA-SEGMENT DATA-SEGMENT))
(EQUAL (FIX-DATA-SEGMENT DATA-SEGMENT)
DATA-SEGMENT))
is a theorem.
[ 0.0 0.0 0.0 ]
FIX-DATA-SEGMENT
(DEFN FIND-NON-PROPER-INSTR
(LST NAME P)
(IF (LISTP LST)
(IF (AND (LEGAL-LABELP (CAR LST))
(PROPER-P-INSTRUCTIONP (UNLABEL (CAR LST))
NAME P))
(FIND-NON-PROPER-INSTR (CDR LST)
NAME P)
(CAR LST))
NIL))
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT LST) decreases according to the well-founded relation LESSP in
each recursive call. Hence, FIND-NON-PROPER-INSTR is accepted under the
principle of definition.
[ 0.0 0.0 0.0 ]
FIND-NON-PROPER-INSTR
(DEFN FIND-NON-PROPER-PROGRAMS
(PROGS P)
(IF (LISTP PROGS)
(IF (PROPER-P-PROGRAMP (CAR PROGS) P)
(CONS (NAME (CAR PROGS))
(FIND-NON-PROPER-PROGRAMS (CDR PROGS)
P))
(CONS (LIST 'NOT
(NAME (CAR PROGS))
(FIND-NON-PROPER-INSTR (PROGRAM-BODY (CAR PROGS))
(NAME (CAR PROGS))
P))
(FIND-NON-PROPER-PROGRAMS (CDR PROGS)
P)))
NIL))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT PROGS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, FIND-NON-PROPER-PROGRAMS is accepted under the
definitional principle. From the definition we can conclude that:
(OR (LITATOM (FIND-NON-PROPER-PROGRAMS PROGS P))
(LISTP (FIND-NON-PROPER-PROGRAMS PROGS P)))
is a theorem.
[ 0.0 0.0 0.0 ]
FIND-NON-PROPER-PROGRAMS
(DEFN PPS
(STATE)
(LIST 'P-STATE
(P-PC STATE)
(P-CTRL-STK STATE)
(P-TEMP-STK STATE)
(LET ((P (P-CURRENT-PROGRAM STATE)))
(APPEND (LIST (NAME P)
(FORMAL-VARS P)
(TEMP-VAR-DCLS P))
(MARK-INSTR (PROGRAM-BODY P)
(OFFSET (P-PC STATE)))))
(FIX-DATA-SEGMENT (P-DATA-SEGMENT STATE))
(P-PSW STATE)))
Observe that (LISTP (PPS STATE)) is a theorem.
[ 0.0 0.0 0.0 ]
PPS
(DEFN LR-NODIFY-TAG
(TAG)
(COND ((EQUAL (UNTAG TAG) (LR-FALSE-TAG))
'FALSE)
((EQUAL (UNTAG TAG) (LR-TRUE-TAG))
'TRUE)
((EQUAL (UNTAG TAG) (LR-ADD1-TAG))
'ADD1)
((EQUAL (UNTAG TAG) (LR-CONS-TAG))
'CONS)
((EQUAL (UNTAG TAG) (LR-PACK-TAG))
'PACK)
(T 'UNKNOWN)))
From the definition we can conclude that (LITATOM (LR-NODIFY-TAG TAG)) is
a theorem.
[ 0.0 0.0 0.0 ]
LR-NODIFY-TAG
(DEFN LR-NODIFY
(NUMBER NODES FINAL)
(IF (LISTP NODES)
(CONS (LIST 'NODE
NUMBER
(LR-NODIFY-TAG (CAR NODES))
(CADDR NODES)
(CADDDR NODES))
(LR-NODIFY (PLUS NUMBER (LR-NODE-SIZE))
(CDDDDR NODES)
FINAL))
FINAL))
Linear arithmetic and the lemmas CDR-LESSEQP and CDR-LESSP inform us that
the measure (COUNT NODES) decreases according to the well-founded relation
LESSP in each recursive call. Hence, LR-NODIFY is accepted under the
principle of definition. From the definition we can conclude that:
(OR (LISTP (LR-NODIFY NUMBER NODES FINAL))
(EQUAL (LR-NODIFY NUMBER NODES FINAL)
FINAL))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-NODIFY
(DEFN LR-FIX-DATA-SEGMENT
(DATA-SEG)
(PUT-VALUE (LR-NODIFY 0
(FIRSTN (OFFSET (LR-FETCH-FP DATA-SEG))
(VALUE (LR-HEAP-NAME) DATA-SEG))
(DIFFERENCE (LENGTH (VALUE (LR-HEAP-NAME) DATA-SEG))
(OFFSET (LR-FETCH-FP DATA-SEG))))
(LR-HEAP-NAME)
DATA-SEG))
Observe that:
(OR (LISTP (LR-FIX-DATA-SEGMENT DATA-SEG))
(EQUAL (LR-FIX-DATA-SEGMENT DATA-SEG)
DATA-SEG))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-FIX-DATA-SEGMENT
(DEFN LRPS
(STATE)
(P-STATE (P-PC STATE)
(P-CTRL-STK STATE)
(P-TEMP-STK STATE)
(P-PROG-SEGMENT STATE)
(LR-FIX-DATA-SEGMENT (P-DATA-SEGMENT STATE))
(P-MAX-CTRL-STK-SIZE STATE)
(P-MAX-TEMP-STK-SIZE STATE)
(P-WORD-SIZE STATE)
(P-PSW STATE)))
Observe that (P-STATEP (LRPS STATE)) is a theorem.
[ 0.0 0.0 0.0 ]
LRPS
(DEFN LR-ABS
(ADDR DATA-SEG N)
(IF (ZEROP N)
NIL
(LET ((TAG (UNTAG (FETCH ADDR DATA-SEG))))
(COND ((EQUAL TAG (LR-FALSE-TAG)) F)
((EQUAL TAG (LR-TRUE-TAG)) T)
((EQUAL TAG (LR-ADD1-TAG))
(UNTAG (FETCH (ADD-ADDR ADDR (LR-UNBOX-NAT-OFFSET))
DATA-SEG)))
((EQUAL TAG (LR-CONS-TAG))
(CONS (LR-ABS (FETCH (ADD-ADDR ADDR (LR-CAR-OFFSET))
DATA-SEG)
DATA-SEG
(SUB1 N))
(LR-ABS (FETCH (ADD-ADDR ADDR (LR-CDR-OFFSET))
DATA-SEG)
DATA-SEG
(SUB1 N))))
((EQUAL TAG (LR-PACK-TAG))
(PACK (LR-ABS (FETCH (ADD-ADDR ADDR (LR-UNPACK-OFFSET))
DATA-SEG)
DATA-SEG
(SUB1 N))))
(T (MINUS (UNTAG (FETCH (ADD-ADDR ADDR
(LR-NEGATIVE-GUTS-OFFSET))
DATA-SEG))))))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definitions of
LR-CONS-TAG, LR-ADD1-TAG, LR-TRUE-TAG, LR-FALSE-TAG, ZEROP, and LR-PACK-TAG
can be used to show that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each recursive call. Hence, LR-ABS is accepted
under the principle of definition.
[ 0.0 0.0 0.0 ]
LR-ABS
(DEFN TOP-STK
(P-OR-P-STATE)
(LET ((TEMP-STK (IF (P-STATEP P-OR-P-STATE)
(P-TEMP-STK P-OR-P-STATE)
(P-TEMP-STK P-OR-P-STATE)))
(DATA-SEGMENT (IF (P-STATEP P-OR-P-STATE)
(P-DATA-SEGMENT P-OR-P-STATE)
(P-DATA-SEGMENT P-OR-P-STATE))))
(LR-ABS (TOP TEMP-STK)
DATA-SEGMENT 1000)))
[ 0.0 0.0 0.0 ]
TOP-STK
(DEFN LR-MAKE-PROGRAM
(NAME FORMALS TEMPS BODY)
(CONS NAME
(CONS FORMALS (CONS TEMPS BODY))))
From the definition we can conclude that:
(LISTP (LR-MAKE-PROGRAM NAME FORMALS TEMPS BODY))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-PROGRAM
(DEFN ASCII-0 NIL 48)
From the definition we can conclude that (NUMBERP (ASCII-0)) is a theorem.
[ 0.0 0.0 0.0 ]
ASCII-0
(DEFN ASCII-1 NIL 49)
From the definition we can conclude that (NUMBERP (ASCII-1)) is a theorem.
[ 0.0 0.0 0.0 ]
ASCII-1
(DEFN ASCII-9 NIL 57)
From the definition we can conclude that (NUMBERP (ASCII-9)) is a theorem.
[ 0.0 0.0 0.0 ]
ASCII-9
(DEFN ASCII-DASH NIL 45)
From the definition we can conclude that (NUMBERP (ASCII-DASH)) is a
theorem.
[ 0.0 0.0 0.0 ]
ASCII-DASH
(DEFN LIST-ASCII-0 NIL
(LIST (ASCII-0)))
Observe that (LISTP (LIST-ASCII-0)) is a theorem.
[ 0.0 0.0 0.0 ]
LIST-ASCII-0
(DEFN LIST-ASCII-1 NIL
(LIST (ASCII-1)))
Observe that (LISTP (LIST-ASCII-1)) is a theorem.
[ 0.0 0.0 0.0 ]
LIST-ASCII-1
(DEFN INCREMENT-NUMLIST
(NUMLIST)
(IF (LISTP NUMLIST)
(IF (EQUAL (CAR NUMLIST) (ASCII-9))
(CONS (ASCII-0)
(INCREMENT-NUMLIST (CDR NUMLIST)))
(CONS (ADD1 (CAR NUMLIST))
(CDR NUMLIST)))
(LIST-ASCII-1)))
Linear arithmetic and the lemma CDR-LESSP can be used to show that the
measure (COUNT NUMLIST) decreases according to the well-founded relation LESSP
in each recursive call. Hence, INCREMENT-NUMLIST is accepted under the
definitional principle. Note that (LISTP (INCREMENT-NUMLIST NUMLIST)) is a
theorem.
[ 0.0 0.0 0.0 ]
INCREMENT-NUMLIST
(DEFN MAKE-SYMBOL
(INITIAL DIGIT-LIST)
(PACK (APPEND (APPEND INITIAL DIGIT-LIST)
0)))
Note that (LITATOM (MAKE-SYMBOL INITIAL DIGIT-LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
MAKE-SYMBOL
(DISABLE MAKE-SYMBOL)
[ 0.0 0.0 0.0 ]
MAKE-SYMBOL-OFF
(DEFN COUNT-CODELIST1
(NUMLIST)
(IF (LISTP NUMLIST)
(PLUS (CAR NUMLIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUMLIST))))
0))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT NUMLIST) decreases according to the well-founded relation LESSP in each
recursive call. Hence, COUNT-CODELIST1 is accepted under the principle of
definition. Note that (NUMBERP (COUNT-CODELIST1 NUMLIST)) is a theorem.
[ 0.0 0.0 0.0 ]
COUNT-CODELIST1
(DEFN SUBSEQP
(LIST1 LIST2)
(AND (NOT (LESSP (LENGTH LIST2) (LENGTH LIST1)))
(EQUAL (FIRSTN (LENGTH LIST1) LIST2)
LIST1)))
Observe that:
(OR (FALSEP (SUBSEQP LIST1 LIST2))
(TRUEP (SUBSEQP LIST1 LIST2)))
is a theorem.
[ 0.0 0.0 0.0 ]
SUBSEQP
(DISABLE SUBSEQP)
[ 0.0 0.0 0.0 ]
SUBSEQP-OFF
(DEFN COUNT-CODELIST
(INITIAL ASCII-LIST)
(IF (SUBSEQP INITIAL ASCII-LIST)
(COUNT-CODELIST1 (RESTN (LENGTH INITIAL) ASCII-LIST))
0))
Note that (NUMBERP (COUNT-CODELIST INITIAL ASCII-LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
COUNT-CODELIST
(DISABLE COUNT-CODELIST)
[ 0.0 0.0 0.0 ]
COUNT-CODELIST-OFF
(DEFN MAX-COUNT-CODELIST
(INITIAL LIST)
(IF (LISTP LIST)
(MAX (COUNT-CODELIST INITIAL
(UNPACK (CAR LIST)))
(MAX-COUNT-CODELIST INITIAL
(CDR LIST)))
0))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT LIST) decreases according to the well-founded relation LESSP in each
recursive call. Hence, MAX-COUNT-CODELIST is accepted under the principle of
definition. From the definition we can conclude that:
(NUMBERP (MAX-COUNT-CODELIST INITIAL LIST))
is a theorem.
[ 0.0 0.0 0.0 ]
MAX-COUNT-CODELIST
(PROVE-LEMMA INCREMENT-NUM-LIST-COUNT-CODE-LIST1
(REWRITE)
(LESSP (COUNT-CODELIST1 NUM-LIST)
(COUNT-CODELIST1 (INCREMENT-NUMLIST NUM-LIST)))
((DISABLE PLUS-ADD1-ARG1)))
WARNING: Note that the proposed lemma INCREMENT-NUM-LIST-COUNT-CODE-LIST1 is
to be stored as zero type prescription rules, zero compound recognizer rules,
one linear rule, and zero replacement rules.
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP NUM-LIST)
(EQUAL (CAR NUM-LIST) (ASCII-9))
(p (CDR NUM-LIST)))
(p NUM-LIST))
(IMPLIES (AND (LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) (ASCII-9))))
(p NUM-LIST))
(IMPLIES (NOT (LISTP NUM-LIST))
(p NUM-LIST))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT NUM-LIST) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme produces the
following three new conjectures:
Case 3. (IMPLIES
(AND (LISTP NUM-LIST)
(EQUAL (CAR NUM-LIST) (ASCII-9))
(LESSP (COUNT-CODELIST1 (CDR NUM-LIST))
(COUNT-CODELIST1 (INCREMENT-NUMLIST (CDR NUM-LIST)))))
(LESSP (COUNT-CODELIST1 NUM-LIST)
(COUNT-CODELIST1 (INCREMENT-NUMLIST NUM-LIST)))).
This simplifies, applying CDR-CONS and CAR-CONS, and opening up the
functions ASCII-9, COUNT-CODELIST1, INCREMENT-NUMLIST, EQUAL, and ASCII-0,
to:
(IMPLIES
(AND (LISTP NUM-LIST)
(EQUAL (CAR NUM-LIST) 57)
(LESSP (COUNT-CODELIST1 (CDR NUM-LIST))
(COUNT-CODELIST1 (INCREMENT-NUMLIST (CDR NUM-LIST)))))
(LESSP
(PLUS 57
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))
(PLUS 48
(TIMES 10
(COUNT-CODELIST1 (INCREMENT-NUMLIST (CDR NUM-LIST))))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) (ASCII-9))))
(LESSP (COUNT-CODELIST1 NUM-LIST)
(COUNT-CODELIST1 (INCREMENT-NUMLIST NUM-LIST)))),
which simplifies, applying COMMUTATIVITY-OF-PLUS, SUB1-ADD1, CDR-CONS,
CAR-CONS, EQUAL-PLUS-0, and EQUAL-TIMES-0, and unfolding the definitions of
ASCII-9, COUNT-CODELIST1, INCREMENT-NUMLIST, PLUS, NUMBERP, EQUAL, and LESSP,
to the following three new conjectures:
Case 2.3.
(IMPLIES
(AND (LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) 57))
(NOT (EQUAL (CAR NUM-LIST) 0))
(NUMBERP (CAR NUM-LIST)))
(LESSP (SUB1 (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))))
(PLUS (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
(CAR NUM-LIST)))).
However this again simplifies, using linear arithmetic, to the formula:
(IMPLIES
(AND (EQUAL (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))
0)
(LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) 57))
(NOT (EQUAL (CAR NUM-LIST) 0))
(NUMBERP (CAR NUM-LIST)))
(LESSP (SUB1 (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))))
(PLUS (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
(CAR NUM-LIST)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES
(AND (LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) 57))
(NOT (EQUAL (COUNT-CODELIST1 (CDR NUM-LIST))
0))
(NUMBERP (CAR NUM-LIST)))
(LESSP (SUB1 (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))))
(PLUS (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
(CAR NUM-LIST)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))
0)
(LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) 57))
(NOT (EQUAL (COUNT-CODELIST1 (CDR NUM-LIST))
0))
(NUMBERP (CAR NUM-LIST)))
(LESSP (SUB1 (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))))
(PLUS (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
(CAR NUM-LIST)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES
(AND (LISTP NUM-LIST)
(NOT (EQUAL (CAR NUM-LIST) 57))
(NOT (NUMBERP (CAR NUM-LIST)))
(NOT (EQUAL (COUNT-CODELIST1 (CDR NUM-LIST))
0)))
(LESSP (SUB1 (PLUS (CAR NUM-LIST)
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))))
(PLUS (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
0))),
which again simplifies, rewriting with PLUS-ZERO-ARG2, and opening up the
definitions of PLUS and ZEROP, to the new conjecture:
(IMPLIES (AND (LISTP NUM-LIST)
(NOT (NUMBERP (CAR NUM-LIST)))
(NOT (EQUAL (COUNT-CODELIST1 (CDR NUM-LIST))
0)))
(LESSP (SUB1 (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST)))
0)
(LISTP NUM-LIST)
(NOT (NUMBERP (CAR NUM-LIST)))
(NOT (EQUAL (COUNT-CODELIST1 (CDR NUM-LIST))
0)))
(LESSP (SUB1 (TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))
(TIMES 10
(COUNT-CODELIST1 (CDR NUM-LIST))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NOT (LISTP NUM-LIST))
(LESSP (COUNT-CODELIST1 NUM-LIST)
(COUNT-CODELIST1 (INCREMENT-NUMLIST NUM-LIST)))),
which simplifies, opening up COUNT-CODELIST1, INCREMENT-NUMLIST,
LIST-ASCII-1, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
INCREMENT-NUM-LIST-COUNT-CODE-LIST1
(PROVE-LEMMA SUBSEQP-APPEND
(REWRITE)
(SUBSEQP (PLIST X)
(APPEND X ANYTHING))
((ENABLE SUBSEQP)))
This conjecture can be simplified, using the abbreviations NOT, LENGTH-PLIST,
LENGTH-APPEND, and SUBSEQP, to two new conjectures:
Case 2. (NOT (LESSP (PLUS (LENGTH X) (LENGTH ANYTHING))
(LENGTH X))),
which simplifies, using linear arithmetic, to:
T.
Case 1. (EQUAL (FIRSTN (LENGTH X)
(APPEND X ANYTHING))
(PLIST X)),
which simplifies, applying DIFFERENCE-X-X, FIRSTN-0, APPEND-NIL,
FIRSTN-WITH-LARGE-INDEX, and FIRSTN-APPEND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SUBSEQP-APPEND
(PROVE-LEMMA COUNT-CODELIST-MAKE-SYMBOL
(REWRITE)
(IMPLIES (EQUAL X
(MAKE-SYMBOL INITIAL NUM-LIST))
(EQUAL (COUNT-CODELIST (PLIST INITIAL)
(UNPACK X))
(COUNT-CODELIST1 NUM-LIST)))
((ENABLE COUNT-CODELIST MAKE-SYMBOL)))
WARNING: Note that COUNT-CODELIST-MAKE-SYMBOL contains the free variable
NUM-LIST which will be chosen by instantiating the hypothesis:
(EQUAL X
(MAKE-SYMBOL INITIAL NUM-LIST)).
This formula can be simplified, using the abbreviations IMPLIES,
ASSOCIATIVITY-OF-APPEND, and MAKE-SYMBOL, to:
(IMPLIES (EQUAL X
(PACK (APPEND INITIAL (APPEND NUM-LIST 0))))
(EQUAL (COUNT-CODELIST (PLIST INITIAL)
(UNPACK X))
(COUNT-CODELIST1 NUM-LIST))),
which simplifies, rewriting with UNPACK-PACK, APPEND-LASTCDR-ARG1,
RESTN-WITH-LARGE-INDEX, RESTN-APPEND, RESTN-0, DIFFERENCE-X-X, LENGTH-PLIST,
and SUBSEQP-APPEND, and expanding the functions LESSP, EQUAL, and
COUNT-CODELIST, to:
(EQUAL (COUNT-CODELIST1 (APPEND NUM-LIST 0))
(COUNT-CODELIST1 NUM-LIST)),
which we will name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP NUM-LIST)
(p (CDR NUM-LIST)))
(p NUM-LIST))
(IMPLIES (NOT (LISTP NUM-LIST))
(p NUM-LIST))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT NUM-LIST) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme produces the
following two new goals:
Case 2. (IMPLIES (AND (LISTP NUM-LIST)
(EQUAL (COUNT-CODELIST1 (APPEND (CDR NUM-LIST) 0))
(COUNT-CODELIST1 (CDR NUM-LIST))))
(EQUAL (COUNT-CODELIST1 (APPEND NUM-LIST 0))
(COUNT-CODELIST1 NUM-LIST))).
This simplifies, applying CDR-CONS and CAR-CONS, and opening up the
definitions of APPEND and COUNT-CODELIST1, to:
T.
Case 1. (IMPLIES (NOT (LISTP NUM-LIST))
(EQUAL (COUNT-CODELIST1 (APPEND NUM-LIST 0))
(COUNT-CODELIST1 NUM-LIST))),
which simplifies, rewriting with APPEND-LEFT-ID, and expanding the
definitions of COUNT-CODELIST1 and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
COUNT-CODELIST-MAKE-SYMBOL
(PROVE-LEMMA MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST
(REWRITE)
(IMPLIES (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST))))
((EXPAND (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST))))
WARNING: When the linear lemma MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST is
stored under (MAX-COUNT-CODELIST (PLIST INITIAL) ATOM-LIST) it contains the
free variable NUM-LIST which will be chosen by instantiating the hypothesis:
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST).
WARNING: When the linear lemma MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST is
stored under (COUNT-CODELIST1 NUM-LIST) it contains the free variables
ATOM-LIST and INITIAL which will be chosen by instantiating the hypothesis:
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST).
WARNING: Note that the proposed lemma MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST
is to be stored as zero type prescription rules, zero compound recognizer
rules, two linear rules, and zero replacement rules.
This simplifies, unfolding the functions MAX-COUNT-CODELIST and MAX, to the
following three new formulas:
Case 3. (IMPLIES (AND (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(NOT (LISTP ATOM-LIST)))
(NOT (LESSP 0
(COUNT-CODELIST1 NUM-LIST)))).
But this again simplifies, appealing to the lemma MEMBER-NON-LIST, to:
T.
Case 2. (IMPLIES (AND (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(LISTP ATOM-LIST)
(LESSP (COUNT-CODELIST (PLIST INITIAL)
(UNPACK (CAR ATOM-LIST)))
(MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))).
Applying the lemma APPEND-PLIST-LASTCDR, replace INITIAL by (APPEND X Z) to
eliminate (PLIST INITIAL) and (LASTCDR INITIAL). We use PLISTP-LASTCDR,
LENGTH-LASTCDR, PLISTP-PLIST, and LENGTH-PLIST to restrict the new variables.
We thus obtain:
(IMPLIES (AND (EQUAL (LENGTH X)
(LENGTH (APPEND X Z)))
(PLISTP X)
(EQUAL (LENGTH Z) 0)
(EQUAL (PLISTP Z)
(PLISTP (APPEND X Z)))
(MEMBER (MAKE-SYMBOL (APPEND X Z) NUM-LIST)
ATOM-LIST)
(LISTP ATOM-LIST)
(LESSP (COUNT-CODELIST X
(UNPACK (CAR ATOM-LIST)))
(MAX-COUNT-CODELIST X
(CDR ATOM-LIST))))
(NOT (LESSP (MAX-COUNT-CODELIST X (CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))),
which further simplifies, applying the lemmas PLUS-ZERO-ARG2, LENGTH-APPEND,
EQUAL-LENGTH-0, PLISTP-NLISTP, and PLISTP-APPEND, and expanding the
definition of ZEROP, to:
(IMPLIES (AND (PLISTP X)
(NOT (LISTP Z))
(MEMBER (MAKE-SYMBOL (APPEND X Z) NUM-LIST)
ATOM-LIST)
(LISTP ATOM-LIST)
(LESSP (COUNT-CODELIST X
(UNPACK (CAR ATOM-LIST)))
(MAX-COUNT-CODELIST X
(CDR ATOM-LIST))))
(NOT (LESSP (MAX-COUNT-CODELIST X (CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))).
Appealing to the lemmas CAR-CDR-ELIM and UNPACK-ELIM, we now replace
ATOM-LIST by (CONS V W) to eliminate (CAR ATOM-LIST) and (CDR ATOM-LIST) and
V by (PACK D) to eliminate (UNPACK V). The result is two new formulas:
Case 2.2.
(IMPLIES (AND (NOT (LITATOM V))
(PLISTP X)
(NOT (LISTP Z))
(MEMBER (MAKE-SYMBOL (APPEND X Z) NUM-LIST)
(CONS V W))
(LESSP (COUNT-CODELIST X (UNPACK V))
(MAX-COUNT-CODELIST X W)))
(NOT (LESSP (MAX-COUNT-CODELIST X W)
(COUNT-CODELIST1 NUM-LIST)))),
which further simplifies, applying the lemmas CDR-CONS, CAR-CONS, and
UNPACK-NLITATOM, and opening up the definition of MEMBER, to the
conjecture:
(IMPLIES (AND (NOT (LITATOM V))
(PLISTP X)
(NOT (LISTP Z))
(MEMBER (MAKE-SYMBOL (APPEND X Z) NUM-LIST)
W)
(LESSP (COUNT-CODELIST X 0)
(MAX-COUNT-CODELIST X W)))
(NOT (LESSP (MAX-COUNT-CODELIST X W)
(COUNT-CODELIST1 NUM-LIST)))),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST)))),
which we named *1 above. We will appeal to induction. Two inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP ATOM-LIST)
(p INITIAL ATOM-LIST NUM-LIST))
(IMPLIES (AND (NOT (NLISTP ATOM-LIST))
(EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST)))
(p INITIAL ATOM-LIST NUM-LIST))
(IMPLIES (AND (NOT (NLISTP ATOM-LIST))
(NOT (EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST)))
(p INITIAL (CDR ATOM-LIST) NUM-LIST))
(p INITIAL ATOM-LIST NUM-LIST))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT ATOM-LIST) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces four new goals:
Case 4. (IMPLIES (AND (NLISTP ATOM-LIST)
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST)))),
which simplifies, applying MEMBER-NON-LIST, and opening up NLISTP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP ATOM-LIST))
(EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST))
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST)))).
This simplifies, applying COUNT-CODELIST-MAKE-SYMBOL, and unfolding the
functions NLISTP, MEMBER, MAX-COUNT-CODELIST, and MAX, to two new
conjectures:
Case 3.2.
(IMPLIES (AND (LISTP ATOM-LIST)
(EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST))
(NOT (LESSP (COUNT-CODELIST1 NUM-LIST)
(MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST)))))
(NOT (LESSP (COUNT-CODELIST1 NUM-LIST)
(COUNT-CODELIST1 NUM-LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP ATOM-LIST)
(EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST))
(LESSP (COUNT-CODELIST1 NUM-LIST)
(MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP ATOM-LIST))
(NOT (EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST)))
(NOT (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
(CDR ATOM-LIST)))
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST)))),
which simplifies, unfolding the definitions of NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP ATOM-LIST))
(NOT (EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST)))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST)
(COUNT-CODELIST1 NUM-LIST)))),
which simplifies, opening up NLISTP, MEMBER, MAX-COUNT-CODELIST, and MAX, to:
(IMPLIES (AND (LISTP ATOM-LIST)
(NOT (EQUAL (MAKE-SYMBOL INITIAL NUM-LIST)
(CAR ATOM-LIST)))
(NOT (LESSP (MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))
(MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
(CDR ATOM-LIST))
(NOT (LESSP (COUNT-CODELIST (PLIST INITIAL)
(UNPACK (CAR ATOM-LIST)))
(MAX-COUNT-CODELIST (PLIST INITIAL)
(CDR ATOM-LIST)))))
(NOT (LESSP (COUNT-CODELIST (PLIST INITIAL)
(UNPACK (CAR ATOM-LIST)))
(COUNT-CODELIST1 NUM-LIST)))).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST
(DEFN GENSYM
(INITIAL NUM-LIST ATOM-LIST)
(IF (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(GENSYM INITIAL
(INCREMENT-NUMLIST NUM-LIST)
ATOM-LIST)
(CONS (MAKE-SYMBOL INITIAL NUM-LIST)
(INCREMENT-NUMLIST NUM-LIST)))
((LESSP (DIFFERENCE (ADD1 (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST)))))
Linear arithmetic, the lemmas INCREMENT-NUM-LIST-COUNT-CODE-LIST1,
DIFFERENCE-SUB1-ARG2, DIFFERENCE-LEQ-ARG1, SUB1-ADD1, and
MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST, and the definitions of EQUAL,
DIFFERENCE, and LESSP establish that the measure:
(DIFFERENCE (ADD1 (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST))
decreases according to the well-founded relation LESSP in each recursive call.
Hence, GENSYM is accepted under the definitional principle. Note that:
(LISTP (GENSYM INITIAL NUM-LIST ATOM-LIST))
is a theorem.
[ 0.0 0.1 0.0 ]
GENSYM
(PROVE-LEMMA GENSYM-IS-NEW
(REWRITE)
(NOT (MEMBER (CAR (GENSYM INITIAL NUM-LIST ATOM-LIST))
ATOM-LIST)))
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(p INITIAL
(INCREMENT-NUMLIST NUM-LIST)
ATOM-LIST))
(p INITIAL NUM-LIST ATOM-LIST))
(IMPLIES (NOT (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(p INITIAL NUM-LIST ATOM-LIST))).
Linear arithmetic, the lemmas INCREMENT-NUM-LIST-COUNT-CODE-LIST1,
DIFFERENCE-SUB1-ARG2, DIFFERENCE-LEQ-ARG1, SUB1-ADD1, and
MEMBER-MAKE-SYMBOL-MAX-COUNT-CODE-LIST, and the definitions of EQUAL,
DIFFERENCE, and LESSP establish that the measure:
(DIFFERENCE (ADD1 (MAX-COUNT-CODELIST (PLIST INITIAL)
ATOM-LIST))
(COUNT-CODELIST1 NUM-LIST))
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces the following two new
goals:
Case 2. (IMPLIES (AND (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST)
(NOT (MEMBER (CAR (GENSYM INITIAL
(INCREMENT-NUMLIST NUM-LIST)
ATOM-LIST))
ATOM-LIST)))
(NOT (MEMBER (CAR (GENSYM INITIAL NUM-LIST ATOM-LIST))
ATOM-LIST))).
This simplifies, expanding GENSYM, to:
T.
Case 1. (IMPLIES (NOT (MEMBER (MAKE-SYMBOL INITIAL NUM-LIST)
ATOM-LIST))
(NOT (MEMBER (CAR (GENSYM INITIAL NUM-LIST ATOM-LIST))
ATOM-LIST))).
This simplifies, rewriting with CAR-CONS, and unfolding the definition of
GENSYM, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
GENSYM-IS-NEW
(DEFN LR-MAKE-TEMP-NAME-ALIST-1
(INITIAL NUM-LIST TEMP-LIST FORMALS)
(IF (LISTP TEMP-LIST)
(LET ((GENSYM (GENSYM INITIAL NUM-LIST FORMALS)))
(CONS (CONS (CAR TEMP-LIST) (CAR GENSYM))
(LR-MAKE-TEMP-NAME-ALIST-1 INITIAL
(CDR GENSYM)
(CDR TEMP-LIST)
FORMALS)))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT TEMP-LIST) decreases according to the well-founded relation LESSP in
each recursive call. Hence, LR-MAKE-TEMP-NAME-ALIST-1 is accepted under the
principle of definition. Note that:
(OR (LITATOM (LR-MAKE-TEMP-NAME-ALIST-1 INITIAL NUM-LIST TEMP-LIST
FORMALS))
(LISTP (LR-MAKE-TEMP-NAME-ALIST-1 INITIAL NUM-LIST TEMP-LIST
FORMALS)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-TEMP-NAME-ALIST-1
(DEFN LR-MAKE-TEMP-NAME-ALIST
(TEMP-LIST FORMALS)
(LR-MAKE-TEMP-NAME-ALIST-1 (UNPACK 'T*)
(LIST-ASCII-0)
TEMP-LIST FORMALS))
Note that:
(OR (LITATOM (LR-MAKE-TEMP-NAME-ALIST TEMP-LIST FORMALS))
(LISTP (LR-MAKE-TEMP-NAME-ALIST TEMP-LIST FORMALS)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-TEMP-NAME-ALIST
(DEFN LR-NEW-CONS
(CAR CDR)
(LR-NEW-NODE (TAG 'NAT (LR-CONS-TAG))
(TAG 'NAT 1)
CAR CDR))
Note that (LISTP (LR-NEW-CONS CAR CDR)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-NEW-CONS
(DEFN DEPOSIT-A-LIST
(LIST ADDR DATA-SEG)
(IF (LISTP LIST)
(DEPOSIT (CAR LIST)
ADDR
(DEPOSIT-A-LIST (CDR LIST)
(ADD1-ADDR ADDR)
DATA-SEG))
DATA-SEG))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT LIST) decreases according to the well-founded relation LESSP in each
recursive call. Hence, DEPOSIT-A-LIST is accepted under the principle of
definition. Note that:
(OR (LISTP (DEPOSIT-A-LIST LIST ADDR DATA-SEG))
(EQUAL (DEPOSIT-A-LIST LIST ADDR DATA-SEG)
DATA-SEG))
is a theorem.
[ 0.0 0.0 0.0 ]
DEPOSIT-A-LIST
(DEFN LR-INIT-HEAP-CONTENTS
(ADDR SIZE)
(IF (ZEROP SIZE)
(LIST (TAG 'NAT (LR-INIT-TAG)))
(APPEND (LR-NEW-NODE (TAG 'NAT (LR-INIT-TAG))
(ADD-ADDR ADDR (LR-NODE-SIZE))
(TAG 'NAT 0)
(TAG 'NAT 0))
(LR-INIT-HEAP-CONTENTS (ADD-ADDR ADDR (LR-NODE-SIZE))
(SUB1 SIZE)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
can be used to show that the measure (COUNT SIZE) decreases according to the
well-founded relation LESSP in each recursive call. Hence,
LR-INIT-HEAP-CONTENTS is accepted under the principle of definition. Note
that (LISTP (LR-INIT-HEAP-CONTENTS ADDR SIZE)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-INIT-HEAP-CONTENTS
(DEFN LR-ADD-TO-DATA-SEG
(DATA-SEG NEW-NODE)
(IF (NOT (LESSP (SUB1 (LENGTH (VALUE (LR-HEAP-NAME) DATA-SEG)))
(PLUS (OFFSET (FETCH (LR-FP-ADDR) DATA-SEG))
(LENGTH NEW-NODE))))
(DEPOSIT (FETCH (ADD-ADDR (FETCH (LR-FP-ADDR) DATA-SEG)
(LR-REF-COUNT-OFFSET))
DATA-SEG)
(LR-FP-ADDR)
(DEPOSIT-A-LIST NEW-NODE
(FETCH (LR-FP-ADDR) DATA-SEG)
DATA-SEG))
DATA-SEG))
Note that:
(OR (LISTP (LR-ADD-TO-DATA-SEG DATA-SEG NEW-NODE))
(EQUAL (LR-ADD-TO-DATA-SEG DATA-SEG NEW-NODE)
DATA-SEG))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-ADD-TO-DATA-SEG
(DEFN LR-INIT-DATA-SEG
(HEAP-SIZE)
(DEPOSIT-A-LIST
(LIST (TAG 'NAT (LR-FALSE-TAG))
(TAG 'NAT 1)
(LR-UNDEF-ADDR)
(LR-UNDEF-ADDR))
(LR-F-ADDR)
(DEPOSIT-A-LIST
(LIST (TAG 'NAT (LR-UNDEFINED-TAG))
(TAG 'NAT 1)
(LR-UNDEF-ADDR)
(LR-UNDEF-ADDR))
(LR-UNDEF-ADDR)
(LIST (LIST (AREA-NAME (LR-FP-ADDR))
(ADD-ADDR (LR-F-ADDR) (LR-NODE-SIZE)))
(LIST (AREA-NAME (LR-ANSWER-ADDR))
(TAG 'NAT 0))
(CONS (LR-HEAP-NAME)
(LR-INIT-HEAP-CONTENTS (TAG 'ADDR (CONS (LR-HEAP-NAME) 0))
HEAP-SIZE))))))
Note that (LISTP (LR-INIT-DATA-SEG HEAP-SIZE)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-INIT-DATA-SEG
(DEFN COUNT-LIST
(FLAG OBJECT)
(COND ((EQUAL FLAG 'LIST)
(IF (LISTP OBJECT)
(PLUS (COUNT-LIST T (CAR OBJECT))
(COUNT-LIST 'LIST (CDR OBJECT)))
1))
((LISTP OBJECT)
(ADD1 (ADD1 (PLUS (COUNT-LIST T (CAR OBJECT))
(COUNT-LIST T (CDR OBJECT))))))
((NUMBERP OBJECT)
(ADD1 (COUNT OBJECT)))
(T 1)))
Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP establish that
the measure (COUNT OBJECT) decreases according to the well-founded relation
LESSP in each recursive call. Hence, COUNT-LIST is accepted under the
principle of definition. From the definition we can conclude that:
(NUMBERP (COUNT-LIST FLAG OBJECT))
is a theorem.
[ 0.0 0.0 0.0 ]
COUNT-LIST
(PROVE-LEMMA NOT-EQUAL-0-COUNT-LIST
(REWRITE)
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0)))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL FLAG 'LIST)
(LISTP OBJECT)
(p 'LIST (CDR OBJECT))
(p T (CAR OBJECT)))
(p FLAG OBJECT))
(IMPLIES (AND (EQUAL FLAG 'LIST)
(NOT (LISTP OBJECT)))
(p FLAG OBJECT))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP OBJECT)
(p T (CDR OBJECT))
(p T (CAR OBJECT)))
(p FLAG OBJECT))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP OBJECT))
(NUMBERP OBJECT))
(p FLAG OBJECT))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP OBJECT))
(NOT (NUMBERP OBJECT)))
(p FLAG OBJECT))).
Linear arithmetic and the lemmas CDR-LESSP and CAR-LESSP can be used to
establish that the measure (COUNT OBJECT) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for FLAG. The above induction scheme
generates the following five new formulas:
Case 5. (IMPLIES (AND (EQUAL FLAG 'LIST)
(LISTP OBJECT)
(NOT (EQUAL (COUNT-LIST 'LIST (CDR OBJECT))
0))
(NOT (EQUAL (COUNT-LIST T (CAR OBJECT))
0)))
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0))).
This simplifies, applying EQUAL-PLUS-0, and expanding the functions EQUAL
and COUNT-LIST, to:
T.
Case 4. (IMPLIES (AND (EQUAL FLAG 'LIST)
(NOT (LISTP OBJECT)))
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0))),
which simplifies, opening up the functions EQUAL and COUNT-LIST, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP OBJECT)
(NOT (EQUAL (COUNT-LIST T (CDR OBJECT)) 0))
(NOT (EQUAL (COUNT-LIST T (CAR OBJECT))
0)))
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0))),
which simplifies, expanding COUNT-LIST, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP OBJECT))
(NUMBERP OBJECT))
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0))),
which simplifies, applying COUNT-NUMBERP, and unfolding the definition of
COUNT-LIST, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP OBJECT))
(NOT (NUMBERP OBJECT)))
(NOT (EQUAL (COUNT-LIST FLAG OBJECT) 0))).
This simplifies, opening up the functions COUNT-LIST and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-EQUAL-0-COUNT-LIST
(PROVE-LEMMA LESSP-COUNT-LIST-CDR-COUNT-LIST-WHOLE
(REWRITE)
(IMPLIES (LISTP OBJECT)
(LESSP (COUNT-LIST 'LIST (CDR OBJECT))
(COUNT-LIST 'LIST OBJECT))))
WARNING: Note that the proposed lemma LESSP-COUNT-LIST-CDR-COUNT-LIST-WHOLE
is to be stored as zero type prescription rules, zero compound recognizer
rules, one linear rule, and zero replacement rules.
.
Appealing to the lemma CAR-CDR-ELIM, we now replace OBJECT by (CONS Z X) to
eliminate (CDR OBJECT) and (CAR OBJECT). We must thus prove:
(LESSP (COUNT-LIST 'LIST X)
(COUNT-LIST 'LIST (CONS Z X))).
This simplifies, applying CDR-CONS, CAR-CONS, CORRECTNESS-OF-CANCEL-LESSP-PLUS,
and NOT-EQUAL-0-COUNT-LIST, and expanding the functions EQUAL, COUNT-LIST, FIX,
ZEROP, and NOT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-COUNT-LIST-CDR-COUNT-LIST-WHOLE
(PROVE-LEMMA LESSP-COUNT-NOT-LIST-CAR-COUNT-LIST-WHOLE
(REWRITE)
(IMPLIES (LISTP OBJECT)
(LESSP (COUNT-LIST T (CAR OBJECT))
(COUNT-LIST 'LIST OBJECT))))
WARNING: Note that the proposed lemma:
LESSP-COUNT-NOT-LIST-CAR-COUNT-LIST-WHOLE
is to be stored as zero type prescription rules, zero compound recognizer
rules, one linear rule, and zero replacement rules.
.
Appealing to the lemma CAR-CDR-ELIM, we now replace OBJECT by (CONS X Z) to
eliminate (CAR OBJECT) and (CDR OBJECT). We must thus prove:
(LESSP (COUNT-LIST T X)
(COUNT-LIST 'LIST (CONS X Z))).
This simplifies, applying CDR-CONS, CAR-CONS, CORRECTNESS-OF-CANCEL-LESSP-PLUS,
and NOT-EQUAL-0-COUNT-LIST, and expanding the functions EQUAL, COUNT-LIST, FIX,
ZEROP, and NOT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-COUNT-NOT-LIST-CAR-COUNT-LIST-WHOLE
(DEFN LR-COMPILE-QUOTE
(FLAG OBJECT HEAP TABLE)
(COND
((EQUAL FLAG 'LIST)
(IF (LISTP OBJECT)
(LET ((CAR-PAIR (LR-COMPILE-QUOTE T
(CAR OBJECT)
HEAP TABLE)))
(LR-COMPILE-QUOTE 'LIST
(CDR OBJECT)
(CAR CAR-PAIR)
(CDR CAR-PAIR)))
(CONS HEAP TABLE)))
((DEFINEDP OBJECT TABLE)
(CONS HEAP TABLE))
((LISTP OBJECT)
(LET
((PAIR (LR-COMPILE-QUOTE 'LIST
(LIST (CAR OBJECT) (CDR OBJECT))
HEAP TABLE)))
(CONS
(LR-ADD-TO-DATA-SEG (CAR PAIR)
(LR-NEW-CONS (CDR (ASSOC (CAR OBJECT) (CDR PAIR)))
(CDR (ASSOC (CDR OBJECT) (CDR PAIR)))))
(CONS (CONS OBJECT
(FETCH (LR-FP-ADDR) (CAR PAIR)))
(CDR PAIR)))))
((NUMBERP OBJECT)
(CONS (LR-ADD-TO-DATA-SEG HEAP
(LR-NEW-NODE (TAG 'NAT (LR-ADD1-TAG))
(TAG 'NAT 1)
(TAG 'NAT OBJECT)
(LR-UNDEF-ADDR)))
(CONS (CONS OBJECT
(FETCH (LR-FP-ADDR) HEAP))
TABLE)))
((TRUEP OBJECT)
(CONS (LR-ADD-TO-DATA-SEG HEAP
(LR-NEW-NODE (TAG 'NAT (LR-TRUE-TAG))
(TAG 'NAT 1)
(LR-UNDEF-ADDR)
(LR-UNDEF-ADDR)))
(CONS (CONS OBJECT
(FETCH (LR-FP-ADDR) HEAP))
TABLE)))
(T (CONS HEAP
(CONS (CONS OBJECT (LR-UNDEF-ADDR))
TABLE))))
((LESSP (COUNT-LIST FLAG OBJECT))))
Linear arithmetic, the lemmas LESSP-COUNT-LIST-CDR-COUNT-LIST-WHOLE,
LESSP-COUNT-NOT-LIST-CAR-COUNT-LIST-WHOLE, NOT-EQUAL-0-COUNT-LIST, SUB1-ADD1,
PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, CAR-CONS, CDR-CONS, and EQUAL-PLUS-0, and the
definitions of LESSP, NUMBERP, ZEROP, COUNT-LIST, and EQUAL can be used to
show that the measure (COUNT-LIST FLAG OBJECT) decreases according to the
well-founded relation LESSP in each recursive call. Hence, LR-COMPILE-QUOTE
is accepted under the definitional principle. Observe that:
(LISTP (LR-COMPILE-QUOTE FLAG OBJECT HEAP TABLE))
is a theorem.
[ 0.3 0.0 0.0 ]
LR-COMPILE-QUOTE
(DEFN LR-DATA-SEG-TABLE-BODY
(FLAG EXPR DATA-SEG TABLE)
(COND ((EQUAL FLAG 'LIST)
(IF (LISTP EXPR)
(LET ((DST1 (LR-DATA-SEG-TABLE-BODY T
(CAR EXPR)
DATA-SEG TABLE)))
(LR-DATA-SEG-TABLE-BODY 'LIST
(CDR EXPR)
(CAR DST1)
(CDR DST1)))
(CONS DATA-SEG TABLE)))
((LISTP EXPR)
(COND ((OR (EQUAL (CAR EXPR) (S-TEMP-FETCH))
(EQUAL (CAR EXPR) (S-TEMP-EVAL))
(EQUAL (CAR EXPR) (S-TEMP-TEST)))
(LR-DATA-SEG-TABLE-BODY T
(CADR EXPR)
DATA-SEG TABLE))
((EQUAL (CAR EXPR) 'QUOTE)
(LR-COMPILE-QUOTE T
(CADR EXPR)
DATA-SEG TABLE))
(T (LR-DATA-SEG-TABLE-BODY 'LIST
(CDR EXPR)
DATA-SEG TABLE))))
(T (CONS DATA-SEG TABLE))))
Linear arithmetic and the lemmas CDR-LESSP, CAR-LESSP, and CAR-LESSEQP
inform us that the measure (COUNT EXPR) decreases according to the
well-founded relation LESSP in each recursive call. Hence,
LR-DATA-SEG-TABLE-BODY is accepted under the definitional principle. From the
definition we can conclude that:
(LISTP (LR-DATA-SEG-TABLE-BODY FLAG EXPR DATA-SEG TABLE))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-DATA-SEG-TABLE-BODY
(DEFN LR-DATA-SEG-TABLE-LIST
(PROGS DATA-SEG TABLE)
(IF (LISTP PROGS)
(LR-DATA-SEG-TABLE-LIST (CDR PROGS)
(CAR (LR-DATA-SEG-TABLE-BODY T
(S-BODY (CAR PROGS))
DATA-SEG TABLE))
(CDR (LR-DATA-SEG-TABLE-BODY T
(S-BODY (CAR PROGS))
DATA-SEG TABLE)))
(CONS DATA-SEG TABLE)))
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT PROGS) decreases according to the well-founded relation LESSP
in each recursive call. Hence, LR-DATA-SEG-TABLE-LIST is accepted under the
principle of definition. Note that:
(LISTP (LR-DATA-SEG-TABLE-LIST PROGS DATA-SEG TABLE))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-DATA-SEG-TABLE-LIST
(DEFN LR-INIT-DATA-SEG-TABLE
(PARAMS DATA-SEG TABLE)
(IF (LISTP PARAMS)
(LET ((DS-TAB (LR-COMPILE-QUOTE T
(CDAR PARAMS)
DATA-SEG TABLE)))
(LR-INIT-DATA-SEG-TABLE (CDR PARAMS)
(CAR DS-TAB)
(CDR DS-TAB)))
(CONS DATA-SEG TABLE)))
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT PARAMS) decreases according to the well-founded relation LESSP
in each recursive call. Hence, LR-INIT-DATA-SEG-TABLE is accepted under the
principle of definition. Note that:
(LISTP (LR-INIT-DATA-SEG-TABLE PARAMS DATA-SEG TABLE))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-INIT-DATA-SEG-TABLE
(DEFN LR-DATA-SEG-TABLE
(PROGS PARAMS HEAP-SIZE)
(LET ((INIT-DS-TABLE1 (LR-COMPILE-QUOTE 'LIST
(LIST T 0)
(LR-INIT-DATA-SEG HEAP-SIZE)
(LIST (CONS F (LR-F-ADDR))))))
(LET ((INIT-DS-TABLE2 (LR-INIT-DATA-SEG-TABLE PARAMS
(CAR INIT-DS-TABLE1)
(CDR INIT-DS-TABLE1))))
(LR-DATA-SEG-TABLE-LIST PROGS
(CAR INIT-DS-TABLE2)
(CDR INIT-DS-TABLE2)))))
Observe that (LISTP (LR-DATA-SEG-TABLE PROGS PARAMS HEAP-SIZE)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-DATA-SEG-TABLE
(DEFN PAIR-FORMALS-WITH-ADDRESSES
(FORMALS TABLE)
(IF (LISTP FORMALS)
(CONS (CONS (CAAR FORMALS)
(CDR (ASSOC (CDAR FORMALS) TABLE)))
(PAIR-FORMALS-WITH-ADDRESSES (CDR FORMALS)
TABLE))
NIL))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT FORMALS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, PAIR-FORMALS-WITH-ADDRESSES is accepted under the
definitional principle. Observe that:
(OR (LITATOM (PAIR-FORMALS-WITH-ADDRESSES FORMALS TABLE))
(LISTP (PAIR-FORMALS-WITH-ADDRESSES FORMALS TABLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
PAIR-FORMALS-WITH-ADDRESSES
(DEFN LR-MAKE-INITIAL-TEMPS
(TEMP-VARS)
(IF (LISTP TEMP-VARS)
(CONS (CONS (CAR TEMP-VARS) (LR-UNDEF-ADDR))
(LR-MAKE-INITIAL-TEMPS (CDR TEMP-VARS)))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT TEMP-VARS) decreases according to the well-founded relation LESSP in
each recursive call. Hence, LR-MAKE-INITIAL-TEMPS is accepted under the
definitional principle. Note that:
(OR (LITATOM (LR-MAKE-INITIAL-TEMPS TEMP-VARS))
(LISTP (LR-MAKE-INITIAL-TEMPS TEMP-VARS)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-INITIAL-TEMPS
(DEFN LR-INITIAL-CSTK
(PARAMS TEMP-ALIST TABLE PC)
(LIST (P-FRAME (APPEND (PAIR-FORMALS-WITH-ADDRESSES PARAMS TABLE)
(LR-MAKE-INITIAL-TEMPS (STRIP-CDRS TEMP-ALIST)))
PC)))
Observe that (LISTP (LR-INITIAL-CSTK PARAMS TEMP-ALIST TABLE PC)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-INITIAL-CSTK
(DEFN LR-COMPILE-BODY
(FLAG BODY TEMP-ALIST CONST-TABLE)
(IF (EQUAL FLAG 'LIST)
(IF (LISTP BODY)
(CONS (LR-COMPILE-BODY T
(CAR BODY)
TEMP-ALIST CONST-TABLE)
(LR-COMPILE-BODY 'LIST
(CDR BODY)
TEMP-ALIST CONST-TABLE))
NIL)
(IF (LISTP BODY)
(COND ((OR (EQUAL (CAR BODY) (S-TEMP-FETCH))
(EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST)))
(LIST (CAR BODY)
(LR-COMPILE-BODY T
(CADR BODY)
TEMP-ALIST CONST-TABLE)
(VALUE (CADR BODY) TEMP-ALIST)))
((EQUAL (CAR BODY) 'QUOTE)
(LIST 'QUOTE
(VALUE (CADR BODY) CONST-TABLE)))
(T (CONS (CAR BODY)
(LR-COMPILE-BODY 'LIST
(CDR BODY)
TEMP-ALIST CONST-TABLE))))
BODY)))
Linear arithmetic and the lemmas CDR-LESSP, CAR-LESSP, and CAR-LESSEQP
inform us that the measure (COUNT BODY) decreases according to the
well-founded relation LESSP in each recursive call. Hence, LR-COMPILE-BODY is
accepted under the principle of definition. Note that:
(OR (OR (LITATOM (LR-COMPILE-BODY FLAG BODY TEMP-ALIST CONST-TABLE))
(LISTP (LR-COMPILE-BODY FLAG BODY TEMP-ALIST CONST-TABLE)))
(EQUAL (LR-COMPILE-BODY FLAG BODY TEMP-ALIST CONST-TABLE)
BODY))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-COMPILE-BODY
(DEFN LR-MAKE-TEMP-VAR-DCLS
(TEMP-ALIST)
(IF (LISTP TEMP-ALIST)
(CONS (LIST (CDAR TEMP-ALIST)
(LR-UNDEF-ADDR))
(LR-MAKE-TEMP-VAR-DCLS (CDR TEMP-ALIST)))
NIL))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT TEMP-ALIST) decreases according to the well-founded relation LESSP in
each recursive call. Hence, LR-MAKE-TEMP-VAR-DCLS is accepted under the
principle of definition. Note that:
(OR (LITATOM (LR-MAKE-TEMP-VAR-DCLS TEMP-ALIST))
(LISTP (LR-MAKE-TEMP-VAR-DCLS TEMP-ALIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-TEMP-VAR-DCLS
(DEFN LR-COMPILE-PROGRAMS
(PROGRAMS CONST-TABLE)
(IF (LISTP PROGRAMS)
(LET ((PROG (CAR PROGRAMS)))
(LET ((TEMP-ALIST (LR-MAKE-TEMP-NAME-ALIST (S-TEMP-LIST PROG)
(S-FORMALS PROG))))
(CONS (LR-MAKE-PROGRAM (CAR PROG)
(S-FORMALS PROG)
(LR-MAKE-TEMP-VAR-DCLS TEMP-ALIST)
(LR-COMPILE-BODY T
(S-BODY PROG)
TEMP-ALIST
CONST-TABLE))
(LR-COMPILE-PROGRAMS (CDR PROGRAMS)
CONST-TABLE))))
NIL))
Linear arithmetic and the lemma CDR-LESSP can be used to show that the
measure (COUNT PROGRAMS) decreases according to the well-founded relation
LESSP in each recursive call. Hence, LR-COMPILE-PROGRAMS is accepted under
the principle of definition. Note that:
(OR (LITATOM (LR-COMPILE-PROGRAMS PROGRAMS CONST-TABLE))
(LISTP (LR-COMPILE-PROGRAMS PROGRAMS CONST-TABLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-COMPILE-PROGRAMS
(DEFN LR-P-C-SIZE
(FLAG EXPR)
(COND ((EQUAL FLAG 'LIST)
(IF (LISTP EXPR)
(PLUS (LR-P-C-SIZE T (CAR EXPR))
(LR-P-C-SIZE 'LIST (CDR EXPR)))
0))
((LISTP EXPR)
(COND ((EQUAL (CAR EXPR) 'IF)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE T (CADDR EXPR))
(LR-P-C-SIZE T (CADDDR EXPR))
4))
((EQUAL (CAR EXPR) (S-TEMP-FETCH)) 1)
((EQUAL (CAR EXPR) (S-TEMP-EVAL))
(PLUS (LR-P-C-SIZE T (CADR EXPR)) 1))
((EQUAL (CAR EXPR) (S-TEMP-TEST))
(PLUS (LR-P-C-SIZE T (CADR EXPR)) 7))
((EQUAL (CAR EXPR) 'QUOTE) 1)
(T (PLUS (LR-P-C-SIZE 'LIST (CDR EXPR))
1))))
(T 1)))
Linear arithmetic and the lemmas CDR-LESSP, CAR-LESSP, CAR-LESSEQP, and
CDR-LESSEQP establish that the measure (COUNT EXPR) decreases according to the
well-founded relation LESSP in each recursive call. Hence, LR-P-C-SIZE is
accepted under the definitional principle. Observe that:
(NUMBERP (LR-P-C-SIZE FLAG EXPR))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE
(DEFN LR-P-C-SIZE-LIST
(N EXPR-LIST)
(IF (ZEROP N)
0
(IF (LESSP N (LENGTH EXPR-LIST))
(PLUS (LR-P-C-SIZE T (GET N EXPR-LIST))
(LR-P-C-SIZE-LIST (SUB1 N) EXPR-LIST))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH EXPR-LIST))
EXPR-LIST))))
Linear arithmetic, the lemmas COUNT-NUMBERP and EQUAL-LENGTH-0, and the
definitions of ZEROP, SUB1, LESSP, and EQUAL establish that the measure
(COUNT N) decreases according to the well-founded relation LESSP in each
recursive call. Hence, LR-P-C-SIZE-LIST is accepted under the definitional
principle. Note that (NUMBERP (LR-P-C-SIZE-LIST N EXPR-LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE-LIST
(DEFN LR-P-PC-1
(EXPR POS)
(COND ((NOT (LISTP POS)) 0)
((NOT (LISTP EXPR)) 0)
((ZEROP (CAR POS)) 0)
((EQUAL (CAR EXPR) 'IF)
(COND ((ZEROP (CAR POS)) 0)
((EQUAL (CAR POS) 1)
(LR-P-PC-1 (CADR EXPR) (CDR POS)))
((EQUAL (CAR POS) 2)
(PLUS 3
(LR-P-C-SIZE T (CADR EXPR))
(LR-P-PC-1 (CADDR EXPR) (CDR POS))))
(T (PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE T (CADDR EXPR))
(LR-P-PC-1 (CADDDR EXPR) (CDR POS))
4))))
((EQUAL (CAR EXPR) (S-TEMP-FETCH)) 0)
((EQUAL (CAR EXPR) (S-TEMP-EVAL))
(LR-P-PC-1 (CADR EXPR) (CDR POS)))
((EQUAL (CAR EXPR) (S-TEMP-TEST))
(PLUS (LR-P-PC-1 (CADR EXPR) (CDR POS))
4))
((EQUAL (CAR EXPR) 'QUOTE) 0)
(T (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
EXPR)
(LR-P-PC-1 (GET (CAR POS) EXPR)
(CDR POS))))))
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT POS) decreases according to the well-founded relation LESSP in
each recursive call. Hence, LR-P-PC-1 is accepted under the principle of
definition. Observe that (NUMBERP (LR-P-PC-1 EXPR POS)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-P-PC-1
(DEFN LR-P-PC
(L)
(TAG 'PC
(CONS (AREA-NAME (P-PC L))
(LR-P-PC-1 (PROGRAM-BODY (P-CURRENT-PROGRAM L))
(OFFSET (P-PC L))))))
From the definition we can conclude that (LISTP (LR-P-PC L)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-P-PC
(DISABLE LR-P-PC)
[ 0.0 0.0 0.0 ]
LR-P-PC-OFF
(DEFN S->LR1
(S L TABLE)
(P-STATE (TAG 'PC
(CONS (S-PNAME S) (S-POS S)))
(P-CTRL-STK L)
(P-TEMP-STK L)
(LR-COMPILE-PROGRAMS (S-PROGS S)
TABLE)
(P-DATA-SEGMENT L)
(P-MAX-CTRL-STK-SIZE L)
(P-MAX-TEMP-STK-SIZE L)
(P-WORD-SIZE L)
(S-ERR-FLAG S)))
From the definition we can conclude that (P-STATEP (S->LR1 S L TABLE)) is
a theorem.
[ 0.0 0.0 0.0 ]
S->LR1
(DISABLE S->LR1)
[ 0.0 0.0 0.0 ]
S->LR1-OFF
(DEFN S->LR
(S FHEAP-SIZE MAX-CTRL MAX-TEMP WORD-SIZE)
(LET
((TEMP-ALIST (LR-MAKE-TEMP-NAME-ALIST (STRIP-CARS (S-TEMPS S))
(STRIP-CARS (S-PARAMS S))))
(DATASEG-TABLE (LR-DATA-SEG-TABLE (S-PROGS S)
(S-PARAMS S)
FHEAP-SIZE)))
(LET ((RETURN-PC (TAG 'PC
(CONS (S-PNAME S)
(LR-P-PC-1 (LR-COMPILE-BODY T
(S-BODY (S-PROG S))
TEMP-ALIST
(CDR DATASEG-TABLE))
(S-POS S))))))
(S->LR1 S
(P-STATE NIL
(LR-INITIAL-CSTK (S-PARAMS S)
TEMP-ALIST
(CDR DATASEG-TABLE)
RETURN-PC)
NIL NIL
(CAR DATASEG-TABLE)
MAX-CTRL MAX-TEMP WORD-SIZE NIL)
(CDR DATASEG-TABLE)))))
From the definition we can conclude that:
(P-STATEP (S->LR S FHEAP-SIZE MAX-CTRL MAX-TEMP WORD-SIZE))
is a theorem.
[ 0.0 0.0 0.0 ]
S->LR
(DISABLE S->LR)
[ 0.0 0.0 0.0 ]
S->LR-OFF
(DEFN LR-PARAMS
(FRAME P)
(FIRSTN (LENGTH (FORMAL-VARS (P-CURRENT-PROGRAM P)))
(BINDINGS FRAME)))
From the definition we can conclude that:
(OR (LITATOM (LR-PARAMS FRAME P))
(LISTP (LR-PARAMS FRAME P)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PARAMS
(DISABLE LR-PARAMS)
[ 0.0 0.0 0.0 ]
LR-PARAMS-OFF
(DEFN LR-TEMPS
(FRAME P)
(RESTN (LENGTH (FORMAL-VARS (P-CURRENT-PROGRAM P)))
(BINDINGS FRAME)))
[ 0.0 0.0 0.0 ]
LR-TEMPS
(DISABLE LR-TEMPS)
[ 0.0 0.0 0.0 ]
LR-TEMPS-OFF
(DEFN LR-SET-EXPR
(S1 S2 POS)
(P-STATE (TAG 'PC
(CONS (AREA-NAME (P-PC S2)) POS))
(P-CTRL-STK S1)
(P-TEMP-STK S1)
(P-PROG-SEGMENT S2)
(P-DATA-SEGMENT S1)
(P-MAX-CTRL-STK-SIZE S1)
(P-MAX-TEMP-STK-SIZE S1)
(P-WORD-SIZE S1)
(P-PSW S1)))
From the definition we can conclude that:
(P-STATEP (LR-SET-EXPR S1 S2 POS))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-SET-EXPR
(DEFN LR-SET-ERROR
(S FLAG)
(P-STATE (P-PC S)
(P-CTRL-STK S)
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
FLAG))
Observe that (P-STATEP (LR-SET-ERROR S FLAG)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-SET-ERROR
(DEFN LR-SET-POS
(S POS)
(P-STATE (TAG 'PC
(CONS (AREA-NAME (P-PC S)) POS))
(P-CTRL-STK S)
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
(P-PSW S)))
Note that (P-STATEP (LR-SET-POS S POS)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-SET-POS
(DEFN LR-SET-TSTK
(S TEMP-STK)
(P-STATE (P-PC S)
(P-CTRL-STK S)
TEMP-STK
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
(P-PSW S)))
Observe that (P-STATEP (LR-SET-TSTK S TEMP-STK)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-SET-TSTK
(DEFN LR-POP-TSTK
(S)
(IF (EQUAL (P-PSW S) 'RUN)
(IF (LISTP (P-TEMP-STK S))
(LR-SET-TSTK S (POP (P-TEMP-STK S)))
(LR-SET-ERROR S 'LR-POP-TSTK-EMPTY-STACK))
S))
Note that (OR (P-STATEP (LR-POP-TSTK S)) (EQUAL (LR-POP-TSTK S) S)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-POP-TSTK
(DEFN LR-PUSH-TSTK
(S VALUE)
(IF (EQUAL (P-PSW S) 'RUN)
(IF (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))
(LR-SET-TSTK S
(PUSH VALUE (P-TEMP-STK S)))
(LR-SET-ERROR S 'LR-PUSH-TSTK-FULL-STACK))
S))
Observe that:
(OR (P-STATEP (LR-PUSH-TSTK S VALUE))
(EQUAL (LR-PUSH-TSTK S VALUE) S))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PUSH-TSTK
(DISABLE LR-PUSH-TSTK)
[ 0.0 0.0 0.0 ]
LR-PUSH-TSTK-OFF
(DEFN LR-IF-OK
(L)
(IF (NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(PLUS 1 (LENGTH (P-TEMP-STK L)))))
L
(LR-SET-ERROR L 'IF-TEMP-STK-OVERFLOW)))
Note that (OR (P-STATEP (LR-IF-OK L)) (EQUAL (LR-IF-OK L) L)) is a
theorem.
[ 0.0 0.0 0.0 ]
LR-IF-OK
(DISABLE LR-IF-OK)
[ 0.0 0.0 0.0 ]
LR-IF-OK-OFF
(DEFN LR-SET-TEMP
(S VALUE VAR-NAME)
(IF (EQUAL (P-PSW S) 'RUN)
(P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE VALUE VAR-NAME
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
(P-PSW S))
S))
From the definition we can conclude that:
(OR (P-STATEP (LR-SET-TEMP S VALUE VAR-NAME))
(EQUAL (LR-SET-TEMP S VALUE VAR-NAME)
S))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-SET-TEMP
(DISABLE LR-SET-TEMP)
[ 0.0 0.0 0.0 ]
LR-SET-TEMP-OFF
(DEFN LR-EVAL-TEMP-SETP
(S)
(NOT (EQUAL (LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))
(LR-UNDEF-ADDR))))
Note that:
(OR (FALSEP (LR-EVAL-TEMP-SETP S))
(TRUEP (LR-EVAL-TEMP-SETP S)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-EVAL-TEMP-SETP
(DISABLE LR-EVAL-TEMP-SETP)
[ 0.0 0.0 0.0 ]
LR-EVAL-TEMP-SETP-OFF
(DEFN LR-DO-TEMP-FETCH
(S)
(IF (LR-EVAL-TEMP-SETP S)
(LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S)))
(LR-SET-ERROR S 'TEMP-FETCH-NOT-SET)))
Observe that:
(OR (P-STATEP (LR-DO-TEMP-FETCH S))
(EQUAL (LR-DO-TEMP-FETCH S) S))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-DO-TEMP-FETCH
(DISABLE LR-DO-TEMP-FETCH)
[ 0.0 0.0 0.0 ]
LR-DO-TEMP-FETCH-OFF
(DEFN LR-POP-CSTK
(S)
(IF (EQUAL (P-PSW S) 'RUN)
(P-STATE (P-PC S)
(POP (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
(P-PSW S))
S))
Observe that (OR (P-STATEP (LR-POP-CSTK S)) (EQUAL (LR-POP-CSTK S) S)) is
a theorem.
[ 0.0 0.0 0.0 ]
LR-POP-CSTK
(DISABLE LR-POP-CSTK)
[ 0.0 0.0 0.0 ]
LR-POP-CSTK-OFF
(DEFN LR-TYPE-CONTENTS-P
(OBJECT TAG CONTENTS)
(AND (EQUAL (TYPE OBJECT) TAG)
(EQUAL (UNTAG OBJECT) CONTENTS)))
From the definition we can conclude that:
(OR (FALSEP (LR-TYPE-CONTENTS-P OBJECT TAG CONTENTS))
(TRUEP (LR-TYPE-CONTENTS-P OBJECT TAG CONTENTS)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-TYPE-CONTENTS-P
(DEFN P-RECOGNIZER-CODE
(NAME TAG)
(LIST NAME 'NIL
'NIL
'(FETCH)
(LIST 'PUSH-CONSTANT (TAG 'NAT TAG))
'(EQ)
'(TEST-BOOL-AND-JUMP F FALSE)
(LIST 'PUSH-CONSTANT (LR-T-ADDR))
'(RET)
(LIST 'DL
'FALSE
'NIL
(LIST 'PUSH-CONSTANT (LR-F-ADDR)))
'(RET)))
Observe that (LISTP (P-RECOGNIZER-CODE NAME TAG)) is a theorem.
[ 0.0 0.0 0.0 ]
P-RECOGNIZER-CODE
(DEFN P-RECOGNIZER-CLOCK
(P-STATE TAG)
7)
WARNING: P-STATE and TAG are in the arglist but not in the body of the
definition of P-RECOGNIZER-CLOCK.
Note that (NUMBERP (P-RECOGNIZER-CLOCK P-STATE TAG)) is a theorem.
[ 0.0 0.0 0.0 ]
P-RECOGNIZER-CLOCK
(DEFN P-ACCESSOR-CODE
(NAME TAG DEFAULT OFFSET)
(LIST NAME
'(X)
'NIL
'(PUSH-LOCAL X)
'(FETCH)
(LIST 'PUSH-CONSTANT (TAG 'NAT TAG))
'(EQ)
'(TEST-BOOL-AND-JUMP T ARG1)
(LIST 'PUSH-CONSTANT DEFAULT)
'(RET)
'(DL ARG1 NIL (PUSH-LOCAL X))
(LIST 'PUSH-CONSTANT
(TAG 'NAT OFFSET))
'(ADD-ADDR)
'(FETCH)
'(RET)))
From the definition we can conclude that:
(LISTP (P-ACCESSOR-CODE NAME TAG DEFAULT OFFSET))
is a theorem.
[ 0.0 0.0 0.0 ]
P-ACCESSOR-CODE
(DEFN P-ACCESSOR-CLOCK
(P TAG)
(IF (EQUAL (FETCH (TOP (P-TEMP-STK P))
(P-DATA-SEGMENT P))
(TAG 'NAT TAG))
11 8))
From the definition we can conclude that:
(NUMBERP (P-ACCESSOR-CLOCK P TAG))
is a theorem.
[ 0.0 0.0 0.0 ]
P-ACCESSOR-CLOCK
(DEFN P-CAR-CODE NIL
(P-ACCESSOR-CODE 'CAR
(LR-CONS-TAG)
(LR-0-ADDR)
(LR-CAR-OFFSET)))
From the definition we can conclude that (LISTP (P-CAR-CODE)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-CAR-CODE
(DEFN P-CAR-CLOCK
(P)
(P-ACCESSOR-CLOCK P (LR-CONS-TAG)))
From the definition we can conclude that (NUMBERP (P-CAR-CLOCK P)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-CAR-CLOCK
(DISABLE P-CAR-CLOCK)
[ 0.0 0.0 0.0 ]
P-CAR-CLOCK-OFF
(DEFN P-CDR-CODE NIL
(P-ACCESSOR-CODE 'CDR
(LR-CONS-TAG)
(LR-0-ADDR)
(LR-CDR-OFFSET)))
From the definition we can conclude that (LISTP (P-CDR-CODE)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-CDR-CODE
(DEFN P-CDR-CLOCK
(P)
(P-ACCESSOR-CLOCK P (LR-CONS-TAG)))
From the definition we can conclude that (NUMBERP (P-CDR-CLOCK P)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-CDR-CLOCK
(DISABLE P-CDR-CLOCK)
[ 0.0 0.0 0.0 ]
P-CDR-CLOCK-OFF
(DEFN P-CONS-CODE NIL
(LIST 'CONS
'NIL
'((TEMP (NAT 0)))
'(PUSH-GLOBAL FREE-PTR)
(LIST 'PUSH-CONSTANT
(TAG 'NAT (LR-CDR-OFFSET)))
'(ADD-ADDR)
'(DEPOSIT)
'(PUSH-GLOBAL FREE-PTR)
(LIST 'PUSH-CONSTANT
(TAG 'NAT (LR-CAR-OFFSET)))
'(ADD-ADDR)
'(DEPOSIT)
'(PUSH-GLOBAL FREE-PTR)
'(PUSH-GLOBAL FREE-PTR)
(LIST 'PUSH-CONSTANT
(TAG 'NAT (LR-REF-COUNT-OFFSET)))
'(ADD-ADDR)
'(SET-LOCAL TEMP)
'(FETCH)
'(PUSH-CONSTANT (NAT 1))
'(PUSH-LOCAL TEMP)
'(DEPOSIT)
(LIST 'PUSH-CONSTANT
(TAG 'NAT (LR-CONS-TAG)))
'(PUSH-GLOBAL FREE-PTR)
'(DEPOSIT)
'(POP-GLOBAL FREE-PTR)
'(RET)))
Note that (LISTP (P-CONS-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-CONS-CODE
(DEFN P-CONS-CLOCK (P) 23)
WARNING: P is in the arglist but not in the body of the definition of
P-CONS-CLOCK.
Observe that (NUMBERP (P-CONS-CLOCK P)) is a theorem.
[ 0.0 0.0 0.0 ]
P-CONS-CLOCK
(DISABLE P-CONS-CLOCK)
[ 0.0 0.0 0.0 ]
P-CONS-CLOCK-OFF
(DEFN P-FALSE-CODE NIL
(LIST 'FALSE
'NIL
'NIL
(LIST 'PUSH-CONSTANT (LR-F-ADDR))
'(RET)))
Observe that (LISTP (P-FALSE-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-FALSE-CODE
(DEFN P-FALSE-CLOCK (P) 3)
WARNING: P is in the arglist but not in the body of the definition of
P-FALSE-CLOCK.
Observe that (NUMBERP (P-FALSE-CLOCK P)) is a theorem.
[ 0.0 0.0 0.0 ]
P-FALSE-CLOCK
(DISABLE P-FALSE-CLOCK)
[ 0.0 0.0 0.0 ]
P-FALSE-CLOCK-OFF
(DEFN P-FALSEP-CODE NIL
(LIST 'FALSEP
'NIL
'NIL
(LIST 'PUSH-CONSTANT (LR-F-ADDR))
'(EQ)
'(TEST-BOOL-AND-JUMP T TRUE)
(LIST 'PUSH-CONSTANT (LR-F-ADDR))
'(RET)
(LIST 'DL
'TRUE
'NIL
(LIST 'PUSH-CONSTANT (LR-T-ADDR)))
'(RET)))
Note that (LISTP (P-FALSEP-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-FALSEP-CODE
(DEFN P-FALSEP-CLOCK (P) 6)
WARNING: P is in the arglist but not in the body of the definition of
P-FALSEP-CLOCK.
Observe that (NUMBERP (P-FALSEP-CLOCK P)) is a theorem.
[ 0.0 0.0 0.0 ]
P-FALSEP-CLOCK
(DISABLE P-FALSEP-CLOCK)
[ 0.0 0.0 0.0 ]
P-FALSEP-CLOCK-OFF
(DEFN P-LISTP-CODE NIL
(P-RECOGNIZER-CODE 'LISTP
(LR-CONS-TAG)))
Observe that (LISTP (P-LISTP-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-LISTP-CODE
(DEFN P-LISTP-CLOCK
(P)
(P-RECOGNIZER-CLOCK P (LR-CONS-TAG)))
From the definition we can conclude that (NUMBERP (P-LISTP-CLOCK P)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-LISTP-CLOCK
(DISABLE P-LISTP-CLOCK)
[ 0.0 0.0 0.0 ]
P-LISTP-CLOCK-OFF
(DEFN P-NLISTP-CODE NIL
(LIST 'NLISTP
'NIL
'NIL
'(FETCH)
(LIST 'PUSH-CONSTANT
(TAG 'NAT (LR-CONS-TAG)))
'(EQ)
'(TEST-BOOL-AND-JUMP F TRUE)
(LIST 'PUSH-CONSTANT (LR-F-ADDR))
'(RET)
(LIST 'DL
'TRUE
'NIL
(LIST 'PUSH-CONSTANT (LR-T-ADDR)))
'(RET)))
Note that (LISTP (P-NLISTP-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-NLISTP-CODE
(DEFN P-NLISTP-CLOCK (P) 7)
WARNING: P is in the arglist but not in the body of the definition of
P-NLISTP-CLOCK.
Observe that (NUMBERP (P-NLISTP-CLOCK P)) is a theorem.
[ 0.0 0.0 0.0 ]
P-NLISTP-CLOCK
(DISABLE P-NLISTP-CLOCK)
[ 0.0 0.0 0.0 ]
P-NLISTP-CLOCK-OFF
(DEFN P-TRUE-CODE NIL
(LIST 'TRUE
'NIL
'NIL
(LIST 'PUSH-CONSTANT (LR-T-ADDR))
'(RET)))
Observe that (LISTP (P-TRUE-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-TRUE-CODE
(DEFN P-TRUE-CLOCK (P) 3)
WARNING: P is in the arglist but not in the body of the definition of
P-TRUE-CLOCK.
Observe that (NUMBERP (P-TRUE-CLOCK P)) is a theorem.
[ 0.0 0.0 0.0 ]
P-TRUE-CLOCK
(DISABLE P-TRUE-CLOCK)
[ 0.0 0.0 0.0 ]
P-TRUE-CLOCK-OFF
(DEFN P-TRUEP-CODE NIL
(P-RECOGNIZER-CODE 'TRUEP
(LR-TRUE-TAG)))
Observe that (LISTP (P-TRUEP-CODE)) is a theorem.
[ 0.0 0.0 0.0 ]
P-TRUEP-CODE
(DEFN P-TRUEP-CLOCK
(P)
(P-RECOGNIZER-CLOCK P (LR-FALSE-TAG)))
From the definition we can conclude that (NUMBERP (P-TRUEP-CLOCK P)) is a
theorem.
[ 0.0 0.0 0.0 ]
P-TRUEP-CLOCK
(DISABLE P-TRUEP-CLOCK)
[ 0.0 0.0 0.0 ]
P-TRUEP-CLOCK-OFF
(DEFN P-RUNTIME-SUPPORT-PROGRAMS NIL
(LIST (P-CAR-CODE)
(P-CDR-CODE)
(P-CONS-CODE)
(P-FALSE-CODE)
(P-FALSEP-CODE)
(P-LISTP-CODE)
(P-NLISTP-CODE)
(P-TRUE-CODE)
(P-TRUEP-CODE)))
From the definition we can conclude that:
(LISTP (P-RUNTIME-SUPPORT-PROGRAMS))
is a theorem.
[ 0.0 0.0 0.0 ]
P-RUNTIME-SUPPORT-PROGRAMS
(DISABLE P-RUNTIME-SUPPORT-PROGRAMS)
[ 0.0 0.0 0.0 ]
P-RUNTIME-SUPPORT-PROGRAMS-OFF
(DEFN LR-CONVERT-DIGIT-TO-ASCII
(DIGIT)
(PLUS (ASCII-0) DIGIT))
From the definition we can conclude that:
(NUMBERP (LR-CONVERT-DIGIT-TO-ASCII DIGIT))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-CONVERT-DIGIT-TO-ASCII
(DEFN LR-CONVERT-NUM-TO-ASCII
(NUMBER LIST)
(IF
(LESSP NUMBER 10)
(CONS (LR-CONVERT-DIGIT-TO-ASCII NUMBER)
LIST)
(LR-CONVERT-NUM-TO-ASCII
(QUOTIENT NUMBER 10)
(CONS (LR-CONVERT-DIGIT-TO-ASCII (REMAINDER NUMBER 10))
LIST)))
((LESSP (FIX NUMBER))))
Linear arithmetic, the lemma LESSP-QUOTIENT, and the definitions of FIX,
LESSP, EQUAL, and NUMBERP establish that the measure (FIX NUMBER) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
LR-CONVERT-NUM-TO-ASCII is accepted under the principle of definition. Note
that (LISTP (LR-CONVERT-NUM-TO-ASCII NUMBER LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-CONVERT-NUM-TO-ASCII
(DEFN LR-MAKE-LABEL
(N)
(PACK (CONS (CAR (UNPACK 'L))
(CONS (ASCII-DASH)
(APPEND (LR-CONVERT-NUM-TO-ASCII N NIL)
0)))))
Note that (LITATOM (LR-MAKE-LABEL N)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-MAKE-LABEL
(DISABLE LR-MAKE-LABEL)
[ 0.0 0.0 0.0 ]
LR-MAKE-LABEL-OFF
(DEFN LABEL-INSTRS
(INSTRS N)
(IF (LISTP INSTRS)
(CONS (DL (LR-MAKE-LABEL N)
NIL
(CAR INSTRS))
(LABEL-INSTRS (CDR INSTRS) (ADD1 N)))
NIL))
Linear arithmetic and the lemma CDR-LESSP can be used to establish that
the measure (COUNT INSTRS) decreases according to the well-founded relation
LESSP in each recursive call. Hence, LABEL-INSTRS is accepted under the
principle of definition. Note that:
(OR (LITATOM (LABEL-INSTRS INSTRS N))
(LISTP (LABEL-INSTRS INSTRS N)))
is a theorem.
[ 0.0 0.0 0.0 ]
LABEL-INSTRS
(DEFN COMP-TEMP-TEST
(EXPR INSTRS N)
(APPEND (LIST (LIST 'PUSH-LOCAL (CADDR EXPR))
(LIST 'PUSH-CONSTANT (LR-UNDEF-ADDR))
'(EQ)
(LIST 'TEST-BOOL-AND-JUMP
'F
(LR-MAKE-LABEL (PLUS N 6 (LENGTH INSTRS)))))
(APPEND INSTRS
(LIST (LIST 'SET-LOCAL (CADDR EXPR))
(LIST 'JUMP
(LR-MAKE-LABEL (PLUS N 7 (LENGTH INSTRS))))
(LIST 'PUSH-LOCAL (CADDR EXPR))))))
Observe that (LISTP (COMP-TEMP-TEST EXPR INSTRS N)) is a theorem.
[ 0.0 0.0 0.0 ]
COMP-TEMP-TEST
(DEFN COMP-IF
(TEST-INSTRS THEN-INSTRS ELSE-INSTRS N)
(APPEND TEST-INSTRS
(APPEND (LIST (LIST 'PUSH-CONSTANT (LR-F-ADDR))
'(EQ)
(LIST 'TEST-BOOL-AND-JUMP
'T
(LR-MAKE-LABEL (PLUS N 4
(LENGTH TEST-INSTRS)
(LENGTH THEN-INSTRS)))))
(APPEND THEN-INSTRS
(CONS (LIST 'JUMP
(LR-MAKE-LABEL (PLUS N 4
(LENGTH TEST-INSTRS)
(LENGTH THEN-INSTRS)
(LENGTH ELSE-INSTRS))))
ELSE-INSTRS)))))
From the definition we can conclude that:
(LISTP (COMP-IF TEST-INSTRS THEN-INSTRS ELSE-INSTRS N))
is a theorem.
[ 0.0 0.0 0.0 ]
COMP-IF
(DEFN COMP-BODY-1
(FLAG EXPR N)
(COND ((EQUAL FLAG 'LIST)
(IF (LISTP EXPR)
(APPEND (COMP-BODY-1 T (CAR EXPR) N)
(COMP-BODY-1 'LIST
(CDR EXPR)
(PLUS N (LR-P-C-SIZE T (CAR EXPR)))))
NIL))
((LISTP EXPR)
(COND ((EQUAL (CAR EXPR) 'IF)
(COMP-IF (COMP-BODY-1 T (CADR EXPR) N)
(COMP-BODY-1 T
(CADDR EXPR)
(PLUS N 3
(LR-P-C-SIZE T (CADR EXPR))))
(COMP-BODY-1 T
(CADDDR EXPR)
(PLUS N 4
(LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE T (CADDR EXPR))))
N))
((EQUAL (CAR EXPR) (S-TEMP-FETCH))
(LIST (LIST 'PUSH-LOCAL (CADDR EXPR))))
((EQUAL (CAR EXPR) (S-TEMP-EVAL))
(APPEND (COMP-BODY-1 T (CADR EXPR) N)
(LIST (LIST 'SET-LOCAL (CADDR EXPR)))))
((EQUAL (CAR EXPR) (S-TEMP-TEST))
(COMP-TEMP-TEST EXPR
(COMP-BODY-1 T (CADR EXPR) (PLUS N 4))
N))
((EQUAL (CAR EXPR) 'QUOTE)
(LIST (LIST 'PUSH-CONSTANT (CADR EXPR))))
(T (APPEND (COMP-BODY-1 'LIST (CDR EXPR) N)
(IF (DEFINEDP (CAR EXPR)
(P-RUNTIME-SUPPORT-PROGRAMS))
(LIST (LIST 'CALL (CAR EXPR)))
(LIST (LIST 'CALL
(USER-FNAME (CAR EXPR)))))))))
(T (LIST (LIST 'PUSH-LOCAL EXPR)))))
Linear arithmetic and the lemmas CDR-LESSP, CAR-LESSP, CAR-LESSEQP, and
CDR-LESSEQP can be used to show that the measure (COUNT EXPR) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
COMP-BODY-1 is accepted under the definitional principle. From the definition
we can conclude that:
(OR (LITATOM (COMP-BODY-1 FLAG EXPR N))
(LISTP (COMP-BODY-1 FLAG EXPR N)))
is a theorem.
[ 0.0 0.0 0.0 ]
COMP-BODY-1
(DISABLE COMP-BODY-1)
[ 0.0 0.0 0.0 ]
COMP-BODY-1-OFF
(DEFN COMP-BODY
(BODY)
(LABEL-INSTRS (APPEND (COMP-BODY-1 T BODY 0)
'((RET)))
0))
From the definition we can conclude that:
(OR (LITATOM (COMP-BODY BODY))
(LISTP (COMP-BODY BODY)))
is a theorem.
[ 0.0 0.0 0.0 ]
COMP-BODY
(DISABLE COMP-BODY)
[ 0.0 0.0 0.0 ]
COMP-BODY-OFF
(DEFN COMP-PROGRAMS-1
(PROGRAMS)
(IF (LISTP PROGRAMS)
(CONS (LR-MAKE-PROGRAM (NAME (CAR PROGRAMS))
(FORMAL-VARS (CAR PROGRAMS))
(TEMP-VAR-DCLS (CAR PROGRAMS))
(COMP-BODY (PROGRAM-BODY (CAR PROGRAMS))))
(COMP-PROGRAMS-1 (CDR PROGRAMS)))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PROGRAMS) decreases according to the well-founded relation LESSP in
each recursive call. Hence, COMP-PROGRAMS-1 is accepted under the principle
of definition. Note that:
(OR (LITATOM (COMP-PROGRAMS-1 PROGRAMS))
(LISTP (COMP-PROGRAMS-1 PROGRAMS)))
is a theorem.
[ 0.0 0.0 0.0 ]
COMP-PROGRAMS-1
(DEFN COMP-PROGRAMS
(PROGRAMS)
(CONS
(LR-MAKE-PROGRAM
(NAME (CAR PROGRAMS))
(FORMAL-VARS (CAR PROGRAMS))
(TEMP-VAR-DCLS (CAR PROGRAMS))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
(LIST (LIST 'SET-GLOBAL
(AREA-NAME (LR-ANSWER-ADDR)))
'(RET)))
0))
(APPEND (COMP-PROGRAMS-1 (CDR PROGRAMS))
(P-RUNTIME-SUPPORT-PROGRAMS))))
From the definition we can conclude that (LISTP (COMP-PROGRAMS PROGRAMS))
is a theorem.
[ 0.0 0.0 0.0 ]
COMP-PROGRAMS
(DISABLE COMP-PROGRAMS)
[ 0.0 0.0 0.0 ]
COMP-PROGRAMS-OFF
(DEFN LR-PROPER-EXPRP
(FLAG EXPR PNAMES FORMALS TEMPS TABLE)
(COND ((EQUAL FLAG 'LIST)
(IF (LISTP EXPR)
(AND (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL EXPR NIL)))
((LITATOM EXPR) (MEMBER EXPR FORMALS))
((NLISTP EXPR) F)
((NOT (PLISTP EXPR)) F)
((EQUAL (CAR EXPR) (S-TEMP-FETCH))
(AND (MEMBER (CADDR EXPR) TEMPS)
(EQUAL (LENGTH EXPR) 3)))
((OR (EQUAL (CAR EXPR) (S-TEMP-EVAL))
(EQUAL (CAR EXPR) (S-TEMP-TEST)))
(AND (MEMBER (CADDR EXPR) TEMPS)
(EQUAL (LENGTH EXPR) 3)
(LR-PROPER-EXPRP T
(CADR EXPR)
PNAMES FORMALS TEMPS TABLE)))
((EQUAL (CAR EXPR) 'QUOTE)
(AND (EQUAL (TYPE (CADR EXPR)) 'ADDR)
(MEMBER (CADR EXPR)
(STRIP-CDRS TABLE))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))))
((SUBRP (CAR EXPR))
(AND (EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(OR (EQUAL (CAR EXPR) 'IF)
(DEFINEDP (CAR EXPR)
(P-RUNTIME-SUPPORT-PROGRAMS)))
(NOT (MEMBER (CAR EXPR) PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE)))
((BODY (CAR EXPR))
(AND (EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(MEMBER (CAR EXPR) PNAMES)
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE)))
(T F)))
Linear arithmetic, the lemmas CDR-LESSP, CAR-LESSP, CAR-LESSEQP, and
CDR-LESSEQP, and the definitions of OR, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH,
PLISTP, and NLISTP can be used to prove that the measure (COUNT EXPR)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, LR-PROPER-EXPRP is accepted under the principle of definition. From
the definition we can conclude that:
(OR (FALSEP (LR-PROPER-EXPRP FLAG EXPR PNAMES FORMALS TEMPS TABLE))
(TRUEP (LR-PROPER-EXPRP FLAG EXPR PNAMES FORMALS TEMPS TABLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PROPER-EXPRP
(DEFN ALL-UNDEF-ADDRS
(LIST)
(IF (LISTP LIST)
(AND (EQUAL (CAR LIST) (LR-UNDEF-ADDR))
(ALL-UNDEF-ADDRS (CDR LIST)))
T))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT LIST) decreases according to the well-founded relation LESSP in each
recursive call. Hence, ALL-UNDEF-ADDRS is accepted under the definitional
principle. Note that:
(OR (FALSEP (ALL-UNDEF-ADDRS LIST))
(TRUEP (ALL-UNDEF-ADDRS LIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
ALL-UNDEF-ADDRS
(DEFN LR-PROGRAMS-PROPERP-1
(PROGRAMS PROGRAM-NAMES TABLE)
(IF (LISTP PROGRAMS)
(AND (ALL-LITATOMS (FORMAL-VARS (CAR PROGRAMS)))
(ALL-LITATOMS (STRIP-CARS (TEMP-VAR-DCLS (CAR PROGRAMS))))
(ALL-UNDEF-ADDRS (STRIP-CADRS (TEMP-VAR-DCLS (CAR PROGRAMS))))
(LR-PROPER-EXPRP T
(PROGRAM-BODY (CAR PROGRAMS))
PROGRAM-NAMES
(FORMAL-VARS (CAR PROGRAMS))
(STRIP-CARS (TEMP-VAR-DCLS (CAR PROGRAMS)))
TABLE)
(LR-PROGRAMS-PROPERP-1 (CDR PROGRAMS)
PROGRAM-NAMES TABLE))
T))
Linear arithmetic and the lemma CDR-LESSP can be used to establish that
the measure (COUNT PROGRAMS) decreases according to the well-founded relation
LESSP in each recursive call. Hence, LR-PROGRAMS-PROPERP-1 is accepted under
the principle of definition. Observe that:
(OR (FALSEP (LR-PROGRAMS-PROPERP-1 PROGRAMS PROGRAM-NAMES TABLE))
(TRUEP (LR-PROGRAMS-PROPERP-1 PROGRAMS PROGRAM-NAMES TABLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-1
(DISABLE LR-PROGRAMS-PROPERP-1)
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-1-OFF
(DEFN LR-PROGRAMS-PROPERP
(L TABLE)
(AND (DEFINEDP (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (CDR (STRIP-CARS (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)))
Note that:
(OR (FALSEP (LR-PROGRAMS-PROPERP L TABLE))
(TRUEP (LR-PROGRAMS-PROPERP L TABLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP
(DISABLE LR-PROGRAMS-PROPERP)
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-OFF
(PROVE-LEMMA LR-P-C-SIZE-FLAG-NOT-LIST-NOT-0
(REWRITE)
(IMPLIES (NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))))
Give the conjecture the name *1.
Let us appeal to the induction principle. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL FLAG 'LIST)
(LISTP EXPR)
(p 'LIST (CDR EXPR))
(p T (CAR EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (EQUAL FLAG 'LIST)
(NOT (LISTP EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(EQUAL (CAR EXPR) 'IF)
(p T (CADDDR EXPR))
(p T (CADDR EXPR))
(p T (CADR EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(EQUAL (CAR EXPR) (S-TEMP-EVAL))
(p T (CADR EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(EQUAL (CAR EXPR) (S-TEMP-TEST))
(p T (CADR EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(EQUAL (CAR EXPR) 'QUOTE))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(p 'LIST (CDR EXPR)))
(p FLAG EXPR))
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP EXPR)))
(p FLAG EXPR))).
Linear arithmetic and the lemmas CDR-LESSP, CAR-LESSP, CAR-LESSEQP, and
CDR-LESSEQP can be used to show that the measure (COUNT EXPR) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for FLAG. The above
induction scheme generates the following eight new conjectures:
Case 8. (IMPLIES (AND (LISTP EXPR)
(EQUAL (CAR EXPR) 'IF)
(NOT (EQUAL (LR-P-C-SIZE T (CADDDR EXPR))
0))
(NOT (EQUAL (LR-P-C-SIZE T (CADDR EXPR))
0))
(NOT (EQUAL (LR-P-C-SIZE T (CADR EXPR)) 0))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, appealing to the lemmas PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2,
and expanding the functions LR-P-C-SIZE, EQUAL, NUMBERP, and ZEROP, to:
T.
Case 7. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(EQUAL (CAR EXPR) (S-TEMP-FETCH))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, expanding the definitions of S-TEMP-FETCH, LR-P-C-SIZE, and
EQUAL, to:
T.
Case 6. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(EQUAL (CAR EXPR) (S-TEMP-EVAL))
(NOT (EQUAL (LR-P-C-SIZE T (CADR EXPR)) 0))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, applying the lemmas PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and
opening up S-TEMP-FETCH, CAR, S-TEMP-EVAL, LR-P-C-SIZE, EQUAL, NUMBERP, and
ZEROP, to:
T.
Case 5. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(EQUAL (CAR EXPR) (S-TEMP-TEST))
(NOT (EQUAL (LR-P-C-SIZE T (CADR EXPR)) 0))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, appealing to the lemmas PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2,
and unfolding the functions S-TEMP-FETCH, CAR, S-TEMP-EVAL, S-TEMP-TEST,
LR-P-C-SIZE, EQUAL, NUMBERP, and ZEROP, to:
T.
Case 4. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(EQUAL (CAR EXPR) 'QUOTE)
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, opening up the definitions of EQUAL, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, and LR-P-C-SIZE, to:
T.
Case 3. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(EQUAL 'LIST 'LIST)
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, applying the lemmas PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and
expanding the definitions of S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, EQUAL,
LR-P-C-SIZE, NUMBERP, and ZEROP, to:
T.
Case 2. (IMPLIES (AND (LISTP EXPR)
(NOT (EQUAL (CAR EXPR) 'IF))
(NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL (LR-P-C-SIZE 'LIST (CDR EXPR))
0))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))).
This simplifies, applying PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and expanding
the definitions of S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, LR-P-C-SIZE,
NUMBERP, and ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP EXPR))
(NOT (EQUAL FLAG 'LIST)))
(NOT (EQUAL (LR-P-C-SIZE FLAG EXPR) 0))),
which simplifies, expanding the functions LR-P-C-SIZE and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LR-P-C-SIZE-FLAG-NOT-LIST-NOT-0
(PROVE-LEMMA DIFFERENCE-DECREASES
(REWRITE)
(IMPLIES (AND (NOT (LESSP X Y))
(NOT (ZEROP Y)))
(EQUAL (LESSP (DIFFERENCE X Y) X) T)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (LESSP X Y))
(NOT (EQUAL Y 0))
(NUMBERP Y))
(EQUAL (LESSP (DIFFERENCE X Y) X) T)).
This simplifies, obviously, to:
(IMPLIES (AND (NOT (LESSP X Y))
(NOT (EQUAL Y 0))
(NUMBERP Y))
(LESSP (DIFFERENCE X Y) X)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-DECREASES
(DEFN LR->P
(P)
(P-STATE (LR-P-PC P)
(P-CTRL-STK P)
(P-TEMP-STK P)
(COMP-PROGRAMS (P-PROG-SEGMENT P))
(P-DATA-SEGMENT P)
(P-MAX-CTRL-STK-SIZE P)
(P-MAX-TEMP-STK-SIZE P)
(P-WORD-SIZE P)
(P-PSW P)))
Observe that (P-STATEP (LR->P P)) is a theorem.
[ 0.0 0.0 0.0 ]
LR->P
(DISABLE LR->P)
[ 0.0 0.0 0.0 ]
LR->P-OFF
(DEFN P-SET-PC
(P PC)
(P-STATE PC
(P-CTRL-STK P)
(P-TEMP-STK P)
(P-PROG-SEGMENT P)
(P-DATA-SEGMENT P)
(P-MAX-CTRL-STK-SIZE P)
(P-MAX-TEMP-STK-SIZE P)
(P-WORD-SIZE P)
(P-PSW P)))
Observe that (P-STATEP (P-SET-PC P PC)) is a theorem.
[ 0.0 0.0 0.0 ]
P-SET-PC
(DEFN P-RUN-SUBR
(SUBR P)
(CASE SUBR
(CAR (P P (P-CAR-CLOCK P)))
(CDR (P P (P-CDR-CLOCK P)))
(CONS (P P (P-CONS-CLOCK P)))
(FALSE (P P (P-FALSE-CLOCK P)))
(FALSEP (P P (P-FALSEP-CLOCK P)))
(LISTP (P P (P-LISTP-CLOCK P)))
(NLISTP (P P (P-NLISTP-CLOCK P)))
(TRUE (P P (P-TRUE-CLOCK P)))
(TRUEP (P P (P-TRUEP-CLOCK P)))
(OTHERWISE (P-HALT P 'BAD-SUBR))))
From the definition we can conclude that:
(OR (P-STATEP (P-RUN-SUBR SUBR P))
(EQUAL (P-RUN-SUBR SUBR P) P))
is a theorem.
[ 0.0 0.0 0.0 ]
P-RUN-SUBR
(DISABLE P-RUN-SUBR)
[ 0.0 0.0 0.0 ]
P-RUN-SUBR-OFF
(DEFN LR-RETURN-PC
(L)
(ADD-ADDR (LR-P-PC L)
(LR-P-C-SIZE 'LIST
(CDR (LR-EXPR L)))))
Note that (LISTP (LR-RETURN-PC L)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-RETURN-PC
(DISABLE LR-RETURN-PC)
[ 0.0 0.0 0.0 ]
LR-RETURN-PC-OFF
(DEFN LR-APPLY-SUBR
(L NEW-L)
(LET ((RES (P-RUN-SUBR (CAR (LR-EXPR L))
(P-SET-PC (LR->P NEW-L)
(LR-RETURN-PC L)))))
(P-STATE (P-PC NEW-L)
(P-CTRL-STK RES)
(P-TEMP-STK RES)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT RES)
(P-MAX-CTRL-STK-SIZE RES)
(P-MAX-TEMP-STK-SIZE RES)
(P-WORD-SIZE RES)
(P-PSW RES))))
Observe that (P-STATEP (LR-APPLY-SUBR L NEW-L)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-APPLY-SUBR
(DISABLE LR-APPLY-SUBR)
[ 0.0 0.0 0.0 ]
LR-APPLY-SUBR-OFF
(DEFN LR-FUNCALL
(L NEW-L)
(LET ((PROG (DEFINITION (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(NEWEST-L (P-SET-PC (LR->P NEW-L)
(LR-RETURN-PC L))))
(IF (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
NEWEST-L)
(P-STATE (TAG 'PC
(CONS (USER-FNAME (CAR (LR-EXPR L)))
NIL))
(PUSH (MAKE-P-CALL-FRAME (FORMAL-VARS PROG)
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS PROG)
(ADD1-ADDR (P-PC NEWEST-L)))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS PROG))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN)
(P-HALT NEW-L
(X-Y-ERROR-MSG 'P 'CALL)))))
Note that (P-STATEP (LR-FUNCALL L NEW-L)) is a theorem.
[ 0.0 0.0 0.0 ]
LR-FUNCALL
(DISABLE LR-FUNCALL)
[ 0.0 0.0 0.0 ]
LR-FUNCALL-OFF
(PROVE-LEMMA P-ACCESSORS-LR-SET-EXPR
(REWRITE)
(AND (EQUAL (P-PC (LR-SET-EXPR S1 S2 POS))
(TAG 'PC
(CONS (AREA-NAME (P-PC S2)) POS)))
(EQUAL (P-CTRL-STK (LR-SET-EXPR S1 S2 POS))
(P-CTRL-STK S1))
(EQUAL (P-TEMP-STK (LR-SET-EXPR S1 S2 POS))
(P-TEMP-STK S1))
(EQUAL (P-PROG-SEGMENT (LR-SET-EXPR S1 S2 POS))
(P-PROG-SEGMENT S2))
(EQUAL (P-DATA-SEGMENT (LR-SET-EXPR S1 S2 POS))
(P-DATA-SEGMENT S1))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-EXPR S1 S2 POS))
(P-MAX-CTRL-STK-SIZE S1))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-EXPR S1 S2 POS))
(P-MAX-TEMP-STK-SIZE S1))
(EQUAL (P-WORD-SIZE (LR-SET-EXPR S1 S2 POS))
(P-WORD-SIZE S1))
(EQUAL (P-PSW (LR-SET-EXPR S1 S2 POS))
(P-PSW S1))))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-SET-EXPR is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
nine new formulas:
Case 9. (EQUAL (P-PC (LR-SET-EXPR S1 S2 POS))
(TAG 'PC
(CONS (AREA-NAME (P-PC S2)) POS))).
This simplifies, appealing to the lemma P-PC-P-STATE, and unfolding the
definition of LR-SET-EXPR, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-SET-EXPR S1 S2 POS))
(P-CTRL-STK S1)).
This simplifies, applying P-CTRL-STK-P-STATE, and expanding the function
LR-SET-EXPR, to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-SET-EXPR S1 S2 POS))
(P-TEMP-STK S1)),
which simplifies, applying P-TEMP-STK-P-STATE, and unfolding the function
LR-SET-EXPR, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-SET-EXPR S1 S2 POS))
(P-PROG-SEGMENT S2)).
This simplifies, rewriting with the lemma P-PROG-SEGMENT-P-STATE, and
opening up the definition of LR-SET-EXPR, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-SET-EXPR S1 S2 POS))
(P-DATA-SEGMENT S1)).
This simplifies, rewriting with P-DATA-SEGMENT-P-STATE, and opening up
LR-SET-EXPR, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-EXPR S1 S2 POS))
(P-MAX-CTRL-STK-SIZE S1)),
which simplifies, applying P-MAX-CTRL-STK-SIZE-P-STATE, and expanding the
function LR-SET-EXPR, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-EXPR S1 S2 POS))
(P-MAX-TEMP-STK-SIZE S1)).
This simplifies, rewriting with the lemma P-MAX-TEMP-STK-SIZE-P-STATE, and
unfolding LR-SET-EXPR, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-SET-EXPR S1 S2 POS))
(P-WORD-SIZE S1)).
This simplifies, rewriting with the lemma P-WORD-SIZE-P-STATE, and expanding
the definition of LR-SET-EXPR, to:
T.
Case 1. (EQUAL (P-PSW (LR-SET-EXPR S1 S2 POS))
(P-PSW S1)).
This simplifies, applying P-PSW-P-STATE, and opening up the definition of
LR-SET-EXPR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-SET-EXPR
(DISABLE LR-SET-EXPR)
[ 0.0 0.0 0.0 ]
LR-SET-EXPR-OFF
(PROVE-LEMMA P-ACCESSORS-LR-SET-TSTK
(REWRITE)
(AND (EQUAL (P-PC (LR-SET-TSTK S TS))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-SET-TSTK S TS))
(P-CTRL-STK S))
(EQUAL (P-TEMP-STK (LR-SET-TSTK S TS))
TS)
(EQUAL (P-PROG-SEGMENT (LR-SET-TSTK S TS))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-SET-TSTK S TS))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TSTK S TS))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TSTK S TS))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-SET-TSTK S TS))
(P-WORD-SIZE S))
(EQUAL (P-PSW (LR-SET-TSTK S TS))
(P-PSW S))))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-SET-TSTK is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
conjectures:
Case 9. (EQUAL (P-PC (LR-SET-TSTK S TS))
(P-PC S)),
which simplifies, appealing to the lemma P-PC-P-STATE, and unfolding the
function LR-SET-TSTK, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-SET-TSTK S TS))
(P-CTRL-STK S)),
which simplifies, applying P-CTRL-STK-P-STATE, and opening up LR-SET-TSTK,
to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-SET-TSTK S TS))
TS).
This simplifies, rewriting with the lemma P-TEMP-STK-P-STATE, and opening up
the function LR-SET-TSTK, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-SET-TSTK S TS))
(P-PROG-SEGMENT S)).
This simplifies, rewriting with P-PROG-SEGMENT-P-STATE, and unfolding the
function LR-SET-TSTK, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-SET-TSTK S TS))
(P-DATA-SEGMENT S)),
which simplifies, appealing to the lemma P-DATA-SEGMENT-P-STATE, and
unfolding the definition of LR-SET-TSTK, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TSTK S TS))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and opening up
LR-SET-TSTK, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TSTK S TS))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, and unfolding the
function LR-SET-TSTK, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-SET-TSTK S TS))
(P-WORD-SIZE S)),
which simplifies, rewriting with P-WORD-SIZE-P-STATE, and expanding the
function LR-SET-TSTK, to:
T.
Case 1. (EQUAL (P-PSW (LR-SET-TSTK S TS))
(P-PSW S)).
This simplifies, appealing to the lemma P-PSW-P-STATE, and opening up the
definition of LR-SET-TSTK, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-SET-TSTK
(DISABLE LR-SET-TSTK)
[ 0.0 0.0 0.0 ]
LR-SET-TSTK-OFF
(PROVE-LEMMA P-ACCESSORS-LR-SET-ERROR
(REWRITE)
(AND (EQUAL (P-PC (LR-SET-ERROR S FLAG))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-SET-ERROR S FLAG))
(P-CTRL-STK S))
(EQUAL (P-TEMP-STK (LR-SET-ERROR S FLAG))
(P-TEMP-STK S))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR S FLAG))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR S FLAG))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR S FLAG))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR S FLAG))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR S FLAG))
(P-WORD-SIZE S))
(EQUAL (P-PSW (LR-SET-ERROR S FLAG))
FLAG)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-SET-ERROR is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
conjectures:
Case 9. (EQUAL (P-PC (LR-SET-ERROR S FLAG))
(P-PC S)),
which simplifies, appealing to the lemma P-PC-P-STATE, and unfolding the
function LR-SET-ERROR, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-SET-ERROR S FLAG))
(P-CTRL-STK S)),
which simplifies, applying P-CTRL-STK-P-STATE, and opening up LR-SET-ERROR,
to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-SET-ERROR S FLAG))
(P-TEMP-STK S)).
This simplifies, rewriting with the lemma P-TEMP-STK-P-STATE, and opening up
the function LR-SET-ERROR, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-SET-ERROR S FLAG))
(P-PROG-SEGMENT S)).
This simplifies, rewriting with P-PROG-SEGMENT-P-STATE, and unfolding the
function LR-SET-ERROR, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-SET-ERROR S FLAG))
(P-DATA-SEGMENT S)),
which simplifies, appealing to the lemma P-DATA-SEGMENT-P-STATE, and
unfolding the definition of LR-SET-ERROR, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR S FLAG))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and opening up
LR-SET-ERROR, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR S FLAG))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, and unfolding the
function LR-SET-ERROR, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-SET-ERROR S FLAG))
(P-WORD-SIZE S)),
which simplifies, rewriting with P-WORD-SIZE-P-STATE, and expanding the
function LR-SET-ERROR, to:
T.
Case 1. (EQUAL (P-PSW (LR-SET-ERROR S FLAG))
FLAG).
This simplifies, appealing to the lemma P-PSW-P-STATE, and opening up the
definition of LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-SET-ERROR
(DISABLE LR-SET-ERROR)
[ 0.0 0.0 0.0 ]
LR-SET-ERROR-OFF
(PROVE-LEMMA P-ACCESSORS-LR-SET-POS
(REWRITE)
(AND (EQUAL (P-PC (LR-SET-POS S POS))
(TAG 'PC
(CONS (AREA-NAME (P-PC S)) POS)))
(EQUAL (P-CTRL-STK (LR-SET-POS S POS))
(P-CTRL-STK S))
(EQUAL (P-TEMP-STK (LR-SET-POS S POS))
(P-TEMP-STK S))
(EQUAL (P-PROG-SEGMENT (LR-SET-POS S POS))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-SET-POS S POS))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-POS S POS))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-POS S POS))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-SET-POS S POS))
(P-WORD-SIZE S))
(EQUAL (P-PSW (LR-SET-POS S POS))
(P-PSW S))))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-SET-POS is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
goals:
Case 9. (EQUAL (P-PC (LR-SET-POS S POS))
(TAG 'PC
(CONS (AREA-NAME (P-PC S)) POS))),
which simplifies, rewriting with the lemma P-PC-P-STATE, and opening up the
definition of LR-SET-POS, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-SET-POS S POS))
(P-CTRL-STK S)),
which simplifies, rewriting with P-CTRL-STK-P-STATE, and opening up the
function LR-SET-POS, to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-SET-POS S POS))
(P-TEMP-STK S)).
This simplifies, applying P-TEMP-STK-P-STATE, and opening up the definition
of LR-SET-POS, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-SET-POS S POS))
(P-PROG-SEGMENT S)),
which simplifies, applying P-PROG-SEGMENT-P-STATE, and opening up the
function LR-SET-POS, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-SET-POS S POS))
(P-DATA-SEGMENT S)).
This simplifies, applying P-DATA-SEGMENT-P-STATE, and expanding the
definition of LR-SET-POS, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-POS S POS))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and opening up
the function LR-SET-POS, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-POS S POS))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, and expanding
LR-SET-POS, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-SET-POS S POS))
(P-WORD-SIZE S)),
which simplifies, rewriting with the lemma P-WORD-SIZE-P-STATE, and
expanding the definition of LR-SET-POS, to:
T.
Case 1. (EQUAL (P-PSW (LR-SET-POS S POS))
(P-PSW S)),
which simplifies, appealing to the lemma P-PSW-P-STATE, and opening up the
definition of LR-SET-POS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-SET-POS
(DISABLE LR-SET-POS)
[ 0.0 0.0 0.0 ]
LR-SET-POS-OFF
(PROVE-LEMMA P-ACCESSORS-LR-POP-TSTK
(REWRITE)
(AND (EQUAL (P-PC (LR-POP-TSTK S))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-POP-TSTK S))
(P-CTRL-STK S))
(EQUAL (P-PROG-SEGMENT (LR-POP-TSTK S))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-POP-TSTK S))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-POP-TSTK S))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-POP-TSTK S))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-POP-TSTK S))
(P-WORD-SIZE S))))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-POP-TSTK is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and seven replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
seven new goals:
Case 7. (EQUAL (P-PC (LR-POP-TSTK S))
(P-PC S)).
This simplifies, unfolding the functions POP and LR-POP-TSTK, to the
following two new conjectures:
Case 7.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-PC (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-PC S))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 7.1.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL (P-PC (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-PC S))).
But this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6. (EQUAL (P-CTRL-STK (LR-POP-TSTK S))
(P-CTRL-STK S)).
This simplifies, unfolding the functions POP and LR-POP-TSTK, to the
following two new formulas:
Case 6.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-CTRL-STK (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-CTRL-STK S))).
However this again simplifies, appealing to the lemma
P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 6.1.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL (P-CTRL-STK (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-CTRL-STK S))),
which again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5. (EQUAL (P-PROG-SEGMENT (LR-POP-TSTK S))
(P-PROG-SEGMENT S)),
which simplifies, expanding POP and LR-POP-TSTK, to two new goals:
Case 5.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-PROG-SEGMENT (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-PROG-SEGMENT S))),
which again simplifies, applying P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 5.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-PROG-SEGMENT S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4. (EQUAL (P-DATA-SEGMENT (LR-POP-TSTK S))
(P-DATA-SEGMENT S)).
This simplifies, unfolding POP and LR-POP-TSTK, to the following two new
conjectures:
Case 4.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-DATA-SEGMENT (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-DATA-SEGMENT S))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 4.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-DATA-SEGMENT S))).
This again simplifies, rewriting with the lemma P-ACCESSORS-LR-SET-ERROR,
to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-POP-TSTK S))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, opening up POP and LR-POP-TSTK, to two new conjectures:
Case 3.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-MAX-CTRL-STK-SIZE S))),
which again simplifies, applying P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 3.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-MAX-CTRL-STK-SIZE S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-POP-TSTK S))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, unfolding the functions POP and LR-POP-TSTK, to the
following two new conjectures:
Case 2.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-MAX-TEMP-STK-SIZE S))).
This again simplifies, applying the lemma P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 2.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-MAX-TEMP-STK-SIZE S))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-POP-TSTK S))
(P-WORD-SIZE S)).
This simplifies, expanding the functions POP and LR-POP-TSTK, to the
following two new goals:
Case 1.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LISTP (P-TEMP-STK S)))
(EQUAL (P-WORD-SIZE (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(P-WORD-SIZE S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 1.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LISTP (P-TEMP-STK S))))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-WORD-SIZE S))).
However this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-POP-TSTK
(PROVE-LEMMA P-TEMP-STK-LR-POP-TSTK
(REWRITE)
(EQUAL (P-TEMP-STK (LR-POP-TSTK S))
(IF (AND (LISTP (P-TEMP-STK S))
(EQUAL (P-PSW S) 'RUN))
(POP (P-TEMP-STK S))
(P-TEMP-STK S))))
This formula can be simplified, using the abbreviation POP, to the new formula:
(EQUAL (P-TEMP-STK (LR-POP-TSTK S))
(IF (AND (LISTP (P-TEMP-STK S))
(EQUAL (P-PSW S) 'RUN))
(CDR (P-TEMP-STK S))
(P-TEMP-STK S))),
which simplifies, unfolding the definitions of POP, LR-POP-TSTK, and AND, to
two new formulas:
Case 2. (IMPLIES (AND (LISTP (P-TEMP-STK S))
(EQUAL (P-PSW S) 'RUN))
(EQUAL (P-TEMP-STK (LR-SET-TSTK S (CDR (P-TEMP-STK S))))
(CDR (P-TEMP-STK S)))),
which again simplifies, applying P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP (P-TEMP-STK S)))
(EQUAL (P-PSW S) 'RUN))
(EQUAL (P-TEMP-STK (LR-SET-ERROR S
'LR-POP-TSTK-EMPTY-STACK))
(P-TEMP-STK S))).
However this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-TEMP-STK-LR-POP-TSTK
(DISABLE LR-POP-TSTK)
[ 0.0 0.0 0.0 ]
LR-POP-TSTK-OFF
(PROVE-LEMMA AREA-NAME-TAG
(REWRITE)
(EQUAL (AREA-NAME (TAG TAG ADP))
(ADP-NAME ADP))
((ENABLE AREA-NAME TAG UNTAG)))
This conjecture can be simplified, using the abbreviations CAR-CONS, CDR-CONS,
UNTAG, ADP-NAME, TAG, and AREA-NAME, to:
(EQUAL (CAR ADP) (CAR ADP)).
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AREA-NAME-TAG
(PROVE-LEMMA OFFSET-TAG
(REWRITE)
(EQUAL (OFFSET (TAG TAG ADP))
(ADP-OFFSET ADP))
((ENABLE OFFSET TAG UNTAG)))
This conjecture can be simplified, using the abbreviations CAR-CONS, CDR-CONS,
UNTAG, ADP-OFFSET, TAG, and OFFSET, to:
(EQUAL (CDR ADP) (CDR ADP)).
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
OFFSET-TAG
(PROVE-LEMMA P-CURRENT-PROGRAM-LR-SET-EXPR
(REWRITE)
(EQUAL (P-CURRENT-PROGRAM (LR-SET-EXPR S1 S2 POS))
(P-CURRENT-PROGRAM S2))
((ENABLE P-CURRENT-PROGRAM)))
This conjecture simplifies, appealing to the lemmas AREA-NAME-TAG, CAR-CONS,
and P-ACCESSORS-LR-SET-EXPR, and expanding the functions DEFINITION, ADP-NAME,
and P-CURRENT-PROGRAM, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-CURRENT-PROGRAM-LR-SET-EXPR
(PROVE-LEMMA P-CURRENT-PROGRAM-LR-SET-POS
(REWRITE)
(EQUAL (P-CURRENT-PROGRAM (LR-SET-POS S POS))
(P-CURRENT-PROGRAM S))
((ENABLE P-CURRENT-PROGRAM)))
This simplifies, rewriting with AREA-NAME-TAG, CAR-CONS, and
P-ACCESSORS-LR-SET-POS, and unfolding DEFINITION, ADP-NAME, and
P-CURRENT-PROGRAM, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-CURRENT-PROGRAM-LR-SET-POS
(PROVE-LEMMA LR-EXPR-LR-SET-EXPR
(REWRITE)
(EQUAL (LR-EXPR (LR-SET-EXPR S1 S2
(DV (OFFSET (P-PC S2)) N)))
(GET N (LR-EXPR S2)))
((ENABLE LR-EXPR P-CURRENT-PROGRAM DV)))
This formula can be simplified, using the abbreviation DV, to:
(EQUAL (LR-EXPR (LR-SET-EXPR S1 S2
(APPEND (OFFSET (P-PC S2)) (LIST N))))
(GET N (LR-EXPR S2))),
which simplifies, rewriting with CUR-EXPR-APPEND,
P-CURRENT-PROGRAM-LR-SET-EXPR, OFFSET-TAG, CDR-CONS, and
P-ACCESSORS-LR-SET-EXPR, and expanding the functions P-CURRENT-PROGRAM,
DEFINITION, ADP-OFFSET, and LR-EXPR, to:
(EQUAL (CUR-EXPR (LIST N)
(CUR-EXPR (OFFSET (P-PC S2))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC S2))
(P-PROG-SEGMENT S2)))))
(GET N
(CUR-EXPR (OFFSET (P-PC S2))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC S2))
(P-PROG-SEGMENT S2)))))),
which again simplifies, applying CAR-CONS and CDR-CONS, and expanding the
functions CUR-EXPR and LISTP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-EXPR-LR-SET-EXPR
(PROVE-LEMMA LR-EXPR-LR-SET-POS-T
(REWRITE)
(EQUAL (LR-EXPR (LR-SET-POS S
(DV (OFFSET (P-PC S)) N)))
(GET N (LR-EXPR S)))
((ENABLE LR-EXPR DV)))
This conjecture can be simplified, using the abbreviation DV, to:
(EQUAL (LR-EXPR (LR-SET-POS S
(APPEND (OFFSET (P-PC S)) (LIST N))))
(GET N (LR-EXPR S))).
This simplifies, applying CUR-EXPR-APPEND, P-CURRENT-PROGRAM-LR-SET-POS,
OFFSET-TAG, CDR-CONS, and P-ACCESSORS-LR-SET-POS, and expanding ADP-OFFSET and
LR-EXPR, to:
(EQUAL (CUR-EXPR (LIST N)
(CUR-EXPR (OFFSET (P-PC S))
(PROGRAM-BODY (P-CURRENT-PROGRAM S))))
(GET N
(CUR-EXPR (OFFSET (P-PC S))
(PROGRAM-BODY (P-CURRENT-PROGRAM S))))).
But this again simplifies, applying the lemmas CAR-CONS and CDR-CONS, and
opening up CUR-EXPR and LISTP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-EXPR-LR-SET-POS-T
(PROVE-LEMMA LR-EXPR-FLAG-LIST-CAR
(REWRITE)
(IMPLIES (LISTP (OFFSET (P-PC P)))
(EQUAL (CAR (LR-EXPR-LIST P))
(LR-EXPR P)))
((ENABLE LR-EXPR LR-EXPR-LIST CAR-RESTN-GET)
(USE (CUR-EXPR-APPEND (POS1 (BUTLAST (OFFSET (P-PC P))))
(POS2 (LAST (OFFSET (P-PC P))))
(BODY (PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(EXPAND (CUR-EXPR (LAST (OFFSET (P-PC P)))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))
(CUR-EXPR (CDR (LAST (OFFSET (P-PC P))))
(GET (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))
(DISABLE CUR-EXPR CUR-EXPR-APPEND)))
This simplifies, applying APPEND-BUTLAST-LASTCDR, LISTP-LAST-LISTP,
NOT-LISTP-CDR-LAST, and CAR-RESTN-GET, and opening up the functions CUR-EXPR,
LR-EXPR-LIST, and LR-EXPR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-EXPR-FLAG-LIST-CAR
(PROVE-LEMMA NUMBER-CONS-LR-EXPR-T-LIST
(REWRITE)
(IMPLIES (AND (LISTP (LR-EXPR-LIST P))
(LISTP (OFFSET (P-PC P))))
(LESSP (NUMBER-CONS (LR-EXPR P))
(NUMBER-CONS (LR-EXPR-LIST P))))
((ENABLE LR-EXPR LR-EXPR-LIST)))
WARNING: Note that the proposed lemma NUMBER-CONS-LR-EXPR-T-LIST is to be
stored as zero type prescription rules, zero compound recognizer rules, two
linear rules, and zero replacement rules.
This conjecture simplifies, applying LISTP-RESTN, and opening up the
definitions of LR-EXPR-LIST and LR-EXPR, to:
(IMPLIES
(AND (LESSP (CAR (LAST (OFFSET (P-PC P))))
(LENGTH (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(LISTP (OFFSET (P-PC P))))
(LESSP
(NUMBER-CONS (CUR-EXPR (OFFSET (P-PC P))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))
(NUMBER-CONS
(RESTN (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))).
However this again simplifies, using linear arithmetic and applying
NUMBER-CONS-CUR-EXPR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBER-CONS-LR-EXPR-T-LIST
(PROVE-LEMMA LR-EXPR-LR-SET-EXPR-NX
(REWRITE)
(IMPLIES (AND (LISTP (OFFSET (P-PC P)))
(LISTP (LR-EXPR-LIST P)))
(EQUAL (LR-EXPR-LIST (LR-SET-EXPR P1 P
(NX (OFFSET (P-PC P)))))
(CDR (LR-EXPR-LIST P))))
((ENABLE LR-EXPR-LIST RESTN-CDR)))
This simplifies, rewriting with LISTP-RESTN, SUB1-ADD1,
P-CURRENT-PROGRAM-LR-SET-EXPR, BUTLAST-NX, CAR-CONS, LAST-NX, OFFSET-TAG,
CDR-CONS, and P-ACCESSORS-LR-SET-EXPR, and expanding the functions
LR-EXPR-LIST, RESTN, and ADP-OFFSET, to three new goals:
Case 3. (IMPLIES
(AND (LISTP (OFFSET (P-PC P)))
(LESSP (CAR (LAST (OFFSET (P-PC P))))
(LENGTH (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(NOT (LISTP (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))
(EQUAL
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))
(CDR (RESTN (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))),
which again simplifies, applying LENGTH-NLISTP, and unfolding the functions
EQUAL and LESSP, to:
T.
Case 2. (IMPLIES
(AND (LISTP (OFFSET (P-PC P)))
(LESSP (CAR (LAST (OFFSET (P-PC P))))
(LENGTH (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(LISTP (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))
(NUMBERP (CAR (LAST (OFFSET (P-PC P))))))
(EQUAL
(RESTN (CAR (LAST (OFFSET (P-PC P))))
(CDR (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(CDR (RESTN (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))).
However this again simplifies, applying RESTN-CDR, to:
T.
Case 1. (IMPLIES
(AND (LISTP (OFFSET (P-PC P)))
(LESSP (CAR (LAST (OFFSET (P-PC P))))
(LENGTH (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(LISTP (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))
(NOT (NUMBERP (CAR (LAST (OFFSET (P-PC P)))))))
(EQUAL
(RESTN 0
(CDR (CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P)))))
(CDR (RESTN (CAR (LAST (OFFSET (P-PC P))))
(CUR-EXPR (BUTLAST (OFFSET (P-PC P)))
(PROGRAM-BODY (P-CURRENT-PROGRAM P))))))).
However this again simplifies, rewriting with EQUAL-LENGTH-0, RESTN-0,
RESTN-CDR, and RESTN-WITH-NON-NUMBER-INDEX, and opening up the definitions
of LESSP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LR-EXPR-LR-SET-EXPR-NX
(PROVE-LEMMA LR-EXPR-LIST-LR-SET-POS-DV-1
(REWRITE)
(IMPLIES (LISTP (LR-EXPR P))
(EQUAL (LR-EXPR-LIST (LR-SET-POS P
(DV (OFFSET (P-PC P)) 1)))
(CDR (LR-EXPR P))))
((ENABLE LR-EXPR LR-EXPR-LIST)))
This formula simplifies, rewriting with RESTN-ADD1-OPENER, RESTN-0,
CUR-EXPR-PLIST, P-CURRENT-PROGRAM-LR-SET-POS, BUTLAST-DV, LAST-DV, OFFSET-TAG,
CDR-CONS, and P-ACCESSORS-LR-SET-POS, and opening up the definitions of
LR-EXPR, CAR, CONS, ADP-OFFSET, and LR-EXPR-LIST, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-EXPR-LIST-LR-SET-POS-DV-1
(DEFN LR-EVAL
(FLAG L C)
(COND ((NOT (EQUAL (P-PSW L) 'RUN)) L)
((EQUAL FLAG 'LIST)
(IF (NLISTP (OFFSET (P-PC L)))
(LR-SET-ERROR L 'BAD-LIST-POSITION)
(IF (LISTP (LR-EXPR-LIST L))
(LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C)
L)))
((ZEROP C)
(LR-SET-ERROR L 'OUT-OF-TIME))
((LITATOM (LR-EXPR L))
(LR-PUSH-TSTK L
(LOCAL-VAR-VALUE (LR-EXPR L)
(P-CTRL-STK L))))
((NLISTP (LR-EXPR L))
(LR-SET-ERROR L 'BAD-EXPRESSION))
((EQUAL (CAR (LR-EXPR L)) 'IF)
(LET ((TEST (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(IF (EQUAL (P-PSW TEST) 'RUN)
(IF (NOT (EQUAL (TOP (P-TEMP-STK TEST))
(LR-F-ADDR)))
(LR-EVAL T
(LR-SET-EXPR (LR-POP-TSTK TEST)
L
(DV (OFFSET (P-PC L)) 2))
C)
(LR-EVAL T
(LR-SET-EXPR (LR-POP-TSTK TEST)
L
(DV (OFFSET (P-PC L)) 3))
C))
TEST)))
((EQUAL (CAR (LR-EXPR L))
(S-TEMP-EVAL))
(LET ((L1 (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(LR-SET-TEMP L1
(TOP (P-TEMP-STK L1))
(CADDR (LR-EXPR L)))))
((EQUAL (CAR (LR-EXPR L))
(S-TEMP-TEST))
(LET ((L1 (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(IF (NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(PLUS 2 (LENGTH (P-TEMP-STK L)))))
(IF (LR-EVAL-TEMP-SETP L)
(LR-DO-TEMP-FETCH L)
(LR-SET-TEMP L1
(TOP (P-TEMP-STK L1))
(CADDR (LR-EXPR L))))
(LR-SET-ERROR L
'LR-TEMP-SETP-TEMP-STACK-OVERFLOW))))
((EQUAL (CAR (LR-EXPR L))
(S-TEMP-FETCH))
(LR-DO-TEMP-FETCH L))
((EQUAL (CAR (LR-EXPR L)) 'QUOTE)
(LR-PUSH-TSTK L (CADR (LR-EXPR L))))
((NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
((SUBRP (CAR (LR-EXPR L)))
(LR-APPLY-SUBR L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
((LITATOM (CAR (LR-EXPR L)))
(LET ((FS (LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(LR-SET-EXPR (LR-POP-CSTK (LR-EVAL T FS (SUB1 C)))
L
(OFFSET (P-PC L)))))
(T (LR-SET-ERROR L 'BAD-INSTRUCTION)))
((ORD-LESSP (CONS (ADD1 C)
(IF (EQUAL FLAG 'LIST)
(NUMBER-CONS (LR-EXPR-LIST L))
(NUMBER-CONS (LR-EXPR L)))))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1,
LR-EXPR-LR-SET-EXPR-NX, LR-EXPR-FLAG-LIST-CAR, NUMBER-CONS-LR-EXPR-T-LIST,
LR-EXPR-LR-SET-POS-T, GET-ADD1-OPENER, GET-ZEROP,
NUMBER-CONS-CADR-CADDR-CADDDR, LR-EXPR-LR-SET-EXPR, EQUAL-SUB1-0,
PLUS-ADD1-ARG1, LR-EXPR-LIST-LR-SET-POS-DV-1, and ADD1-SUB1, and the
definitions of ORDINALP, LESSP, ORD-LESSP, EQUAL, NLISTP, NUMBER-CONS, ZEROP,
LR-F-ADDR, TOP, S-TEMP-EVAL, PLUS, S-TEMP-TEST, CAR, S-TEMP-FETCH, and UNPACK
can be used to establish that the measure:
(CONS (ADD1 C)
(IF (EQUAL FLAG 'LIST)
(NUMBER-CONS (LR-EXPR-LIST L))
(NUMBER-CONS (LR-EXPR L))))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, LR-EVAL is accepted under the principle of definition. Note
that (OR (P-STATEP (LR-EVAL FLAG L C)) (EQUAL (LR-EVAL FLAG L C) L)) is a
theorem.
[ 0.0 0.5 0.0 ]
LR-EVAL
(DEFN LR-PROPER-P-AREASP
(DATA-SEG)
(IF (NLISTP DATA-SEG)
(EQUAL DATA-SEG NIL)
(LET ((AREA (CAR DATA-SEG)))
(AND (LITATOM (CAR AREA))
(LISTP (CDR AREA))
(NOT (DEFINEDP (CAR AREA) (CDR DATA-SEG)))
(LR-PROPER-P-AREASP (CDR DATA-SEG))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT DATA-SEG) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
LR-PROPER-P-AREASP is accepted under the definitional principle. From the
definition we can conclude that:
(OR (FALSEP (LR-PROPER-P-AREASP DATA-SEG))
(TRUEP (LR-PROPER-P-AREASP DATA-SEG)))
is a theorem.
[ 0.0 0.0 0.0 ]
LR-PROPER-P-AREASP
(PROVE-LEMMA P-ACCESSORS-LR-FUNCALL
(REWRITE)
(AND (EQUAL (P-PROG-SEGMENT (LR-FUNCALL L NEW-L))
(P-PROG-SEGMENT NEW-L))
(EQUAL (P-DATA-SEGMENT (LR-FUNCALL L NEW-L))
(P-DATA-SEGMENT NEW-L))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-FUNCALL L NEW-L))
(P-MAX-CTRL-STK-SIZE NEW-L))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-FUNCALL L NEW-L))
(P-MAX-TEMP-STK-SIZE NEW-L))
(EQUAL (P-WORD-SIZE (LR-FUNCALL L NEW-L))
(P-WORD-SIZE NEW-L)))
((ENABLE LR-FUNCALL)
(DISABLE-THEORY ADDITION)
(DISABLE MAKE-P-CALL-FRAME P-CALL-OKP LR-P-C-SIZE
LR-P-C-SIZE-LIST)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-FUNCALL is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and five replacement rules.
This conjecture can be simplified, using the abbreviation AND, to five new
conjectures:
Case 5. (EQUAL (P-PROG-SEGMENT (LR-FUNCALL L NEW-L))
(P-PROG-SEGMENT NEW-L)),
which simplifies, applying P-PC-P-STATE, and unfolding the definitions of
P-HALT, X-Y-ERROR-MSG, PUSH, ADD1-ADDR, DEFINITION, P-SET-PC, and LR-FUNCALL,
to the following two new goals:
Case 5.2.
(IMPLIES
(NOT (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L)))))
(EQUAL (P-PROG-SEGMENT (P-STATE (P-PC NEW-L)
(P-CTRL-STK NEW-L)
(P-TEMP-STK NEW-L)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'ILLEGAL-CALL-INSTRUCTION))
(P-PROG-SEGMENT NEW-L))).
But this again simplifies, rewriting with the lemma P-PROG-SEGMENT-P-STATE,
to:
T.
Case 5.1.
(IMPLIES
(P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L))))
(EQUAL
(P-PROG-SEGMENT
(P-STATE
(TAG 'PC
(LIST (USER-FNAME (CAR (LR-EXPR L)))))
(CONS
(MAKE-P-CALL-FRAME
(FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(ADD-ADDR (LR-RETURN-PC L) 1))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L))))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN))
(P-PROG-SEGMENT NEW-L))),
which again simplifies, applying P-PROG-SEGMENT-P-STATE, to:
T.
Case 4. (EQUAL (P-DATA-SEGMENT (LR-FUNCALL L NEW-L))
(P-DATA-SEGMENT NEW-L)).
This simplifies, applying the lemma P-PC-P-STATE, and expanding P-HALT,
X-Y-ERROR-MSG, PUSH, ADD1-ADDR, DEFINITION, P-SET-PC, and LR-FUNCALL, to the
following two new conjectures:
Case 4.2.
(IMPLIES
(NOT (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L)))))
(EQUAL (P-DATA-SEGMENT (P-STATE (P-PC NEW-L)
(P-CTRL-STK NEW-L)
(P-TEMP-STK NEW-L)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'ILLEGAL-CALL-INSTRUCTION))
(P-DATA-SEGMENT NEW-L))).
However this again simplifies, rewriting with the lemma
P-DATA-SEGMENT-P-STATE, to:
T.
Case 4.1.
(IMPLIES
(P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L))))
(EQUAL
(P-DATA-SEGMENT
(P-STATE
(TAG 'PC
(LIST (USER-FNAME (CAR (LR-EXPR L)))))
(CONS
(MAKE-P-CALL-FRAME
(FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(ADD-ADDR (LR-RETURN-PC L) 1))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L))))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN))
(P-DATA-SEGMENT NEW-L))),
which again simplifies, rewriting with P-DATA-SEGMENT-P-STATE, to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-FUNCALL L NEW-L))
(P-MAX-CTRL-STK-SIZE NEW-L)).
This simplifies, applying the lemma P-PC-P-STATE, and opening up P-HALT,
X-Y-ERROR-MSG, PUSH, ADD1-ADDR, DEFINITION, P-SET-PC, and LR-FUNCALL, to the
following two new conjectures:
Case 3.2.
(IMPLIES
(NOT (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L)))))
(EQUAL (P-MAX-CTRL-STK-SIZE (P-STATE (P-PC NEW-L)
(P-CTRL-STK NEW-L)
(P-TEMP-STK NEW-L)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'ILLEGAL-CALL-INSTRUCTION))
(P-MAX-CTRL-STK-SIZE NEW-L))).
However this again simplifies, applying the lemma
P-MAX-CTRL-STK-SIZE-P-STATE, to:
T.
Case 3.1.
(IMPLIES
(P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L))))
(EQUAL
(P-MAX-CTRL-STK-SIZE
(P-STATE
(TAG 'PC
(LIST (USER-FNAME (CAR (LR-EXPR L)))))
(CONS
(MAKE-P-CALL-FRAME
(FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(ADD-ADDR (LR-RETURN-PC L) 1))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L))))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN))
(P-MAX-CTRL-STK-SIZE NEW-L))),
which again simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-FUNCALL L NEW-L))
(P-MAX-TEMP-STK-SIZE NEW-L)).
This simplifies, applying P-PC-P-STATE, and opening up the functions P-HALT,
X-Y-ERROR-MSG, PUSH, ADD1-ADDR, DEFINITION, P-SET-PC, and LR-FUNCALL, to two
new conjectures:
Case 2.2.
(IMPLIES
(NOT (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L)))))
(EQUAL (P-MAX-TEMP-STK-SIZE (P-STATE (P-PC NEW-L)
(P-CTRL-STK NEW-L)
(P-TEMP-STK NEW-L)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'ILLEGAL-CALL-INSTRUCTION))
(P-MAX-TEMP-STK-SIZE NEW-L))),
which again simplifies, rewriting with P-MAX-TEMP-STK-SIZE-P-STATE, to:
T.
Case 2.1.
(IMPLIES
(P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L))))
(EQUAL
(P-MAX-TEMP-STK-SIZE
(P-STATE
(TAG 'PC
(LIST (USER-FNAME (CAR (LR-EXPR L)))))
(CONS
(MAKE-P-CALL-FRAME
(FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(ADD-ADDR (LR-RETURN-PC L) 1))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L))))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN))
(P-MAX-TEMP-STK-SIZE NEW-L))).
However this again simplifies, applying the lemma
P-MAX-TEMP-STK-SIZE-P-STATE, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-FUNCALL L NEW-L))
(P-WORD-SIZE NEW-L)),
which simplifies, rewriting with the lemma P-PC-P-STATE, and unfolding the
definitions of P-HALT, X-Y-ERROR-MSG, PUSH, ADD1-ADDR, DEFINITION, P-SET-PC,
and LR-FUNCALL, to two new formulas:
Case 1.2.
(IMPLIES
(NOT (P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L)))))
(EQUAL (P-WORD-SIZE (P-STATE (P-PC NEW-L)
(P-CTRL-STK NEW-L)
(P-TEMP-STK NEW-L)
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'ILLEGAL-CALL-INSTRUCTION))
(P-WORD-SIZE NEW-L))),
which again simplifies, appealing to the lemma P-WORD-SIZE-P-STATE, to:
T.
Case 1.1.
(IMPLIES
(P-CALL-OKP (LIST 'CALL
(USER-FNAME (CAR (LR-EXPR L))))
(P-STATE (LR-RETURN-PC L)
(P-CTRL-STK (LR->P NEW-L))
(P-TEMP-STK (LR->P NEW-L))
(P-PROG-SEGMENT (LR->P NEW-L))
(P-DATA-SEGMENT (LR->P NEW-L))
(P-MAX-CTRL-STK-SIZE (LR->P NEW-L))
(P-MAX-TEMP-STK-SIZE (LR->P NEW-L))
(P-WORD-SIZE (LR->P NEW-L))
(P-PSW (LR->P NEW-L))))
(EQUAL
(P-WORD-SIZE
(P-STATE
(TAG 'PC
(LIST (USER-FNAME (CAR (LR-EXPR L)))))
(CONS
(MAKE-P-CALL-FRAME
(FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(P-TEMP-STK NEW-L)
(TEMP-VAR-DCLS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L)))
(ADD-ADDR (LR-RETURN-PC L) 1))
(P-CTRL-STK NEW-L))
(POPN (LENGTH (FORMAL-VARS (ASSOC (USER-FNAME (CAR (LR-EXPR L)))
(P-PROG-SEGMENT L))))
(P-TEMP-STK NEW-L))
(P-PROG-SEGMENT NEW-L)
(P-DATA-SEGMENT NEW-L)
(P-MAX-CTRL-STK-SIZE NEW-L)
(P-MAX-TEMP-STK-SIZE NEW-L)
(P-WORD-SIZE NEW-L)
'RUN))
(P-WORD-SIZE NEW-L))),
which again simplifies, applying P-WORD-SIZE-P-STATE, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
P-ACCESSORS-LR-FUNCALL
(PROVE-LEMMA P-ACCESSORS-LR-PUSH-TSTK
(REWRITE)
(AND (EQUAL (P-PC (LR-PUSH-TSTK S V))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-PUSH-TSTK S V))
(P-CTRL-STK S))
(EQUAL (P-PROG-SEGMENT (LR-PUSH-TSTK S V))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-PUSH-TSTK S V))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-PUSH-TSTK S V))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-PUSH-TSTK S V))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-PUSH-TSTK S V))
(P-WORD-SIZE S)))
((ENABLE LR-PUSH-TSTK)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-PUSH-TSTK is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and seven replacement rules.
This conjecture can be simplified, using the abbreviation AND, to seven new
goals:
Case 7. (EQUAL (P-PC (LR-PUSH-TSTK S V))
(P-PC S)),
which simplifies, opening up the definitions of PUSH and LR-PUSH-TSTK, to
two new conjectures:
Case 7.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-PC (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-PC S))),
which again simplifies, applying the lemma P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 7.1.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL (P-PC (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-PC S))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6. (EQUAL (P-CTRL-STK (LR-PUSH-TSTK S V))
(P-CTRL-STK S)).
This simplifies, opening up the definitions of PUSH and LR-PUSH-TSTK, to the
following two new formulas:
Case 6.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-CTRL-STK (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-CTRL-STK S))).
But this again simplifies, applying the lemma P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 6.1.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL (P-CTRL-STK (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-CTRL-STK S))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5. (EQUAL (P-PROG-SEGMENT (LR-PUSH-TSTK S V))
(P-PROG-SEGMENT S)).
This simplifies, expanding the definitions of PUSH and LR-PUSH-TSTK, to the
following two new formulas:
Case 5.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-PROG-SEGMENT (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-PROG-SEGMENT S))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 5.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-PROG-SEGMENT S))).
But this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4. (EQUAL (P-DATA-SEGMENT (LR-PUSH-TSTK S V))
(P-DATA-SEGMENT S)).
This simplifies, opening up the definitions of PUSH and LR-PUSH-TSTK, to the
following two new goals:
Case 4.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-DATA-SEGMENT (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-DATA-SEGMENT S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 4.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-DATA-SEGMENT S))).
However this again simplifies, rewriting with the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-PUSH-TSTK S V))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, opening up PUSH and LR-PUSH-TSTK, to two new goals:
Case 3.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-MAX-CTRL-STK-SIZE S))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 3.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-MAX-CTRL-STK-SIZE S))).
However this again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR,
to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-PUSH-TSTK S V))
(P-MAX-TEMP-STK-SIZE S)),
which simplifies, unfolding PUSH and LR-PUSH-TSTK, to two new formulas:
Case 2.2.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-MAX-TEMP-STK-SIZE S))),
which again simplifies, rewriting with the lemma P-ACCESSORS-LR-SET-TSTK,
to:
T.
Case 2.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-MAX-TEMP-STK-SIZE S))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-PUSH-TSTK S V))
(P-WORD-SIZE S)).
This simplifies, opening up the functions PUSH and LR-PUSH-TSTK, to the
following two new formulas:
Case 1.2.
(IMPLIES (AND (EQUAL (P-PSW S) 'RUN)
(LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S)))
(EQUAL (P-WORD-SIZE (LR-SET-TSTK S
(CONS V (P-TEMP-STK S))))
(P-WORD-SIZE S))).
But this again simplifies, applying P-ACCESSORS-LR-SET-TSTK, to:
T.
Case 1.1.
(IMPLIES
(AND (EQUAL (P-PSW S) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK S))
(P-MAX-TEMP-STK-SIZE S))))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR S
'LR-PUSH-TSTK-FULL-STACK))
(P-WORD-SIZE S))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-PUSH-TSTK
(PROVE-LEMMA P-ACCESSORS-LR-IF-OK
(REWRITE)
(AND (EQUAL (P-PC (LR-IF-OK L)) (P-PC L))
(EQUAL (P-CTRL-STK (LR-IF-OK L))
(P-CTRL-STK L))
(EQUAL (P-TEMP-STK (LR-IF-OK L))
(P-TEMP-STK L))
(EQUAL (P-PROG-SEGMENT (LR-IF-OK L))
(P-PROG-SEGMENT L))
(EQUAL (P-DATA-SEGMENT (LR-IF-OK L))
(P-DATA-SEGMENT L))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-IF-OK L))
(P-MAX-CTRL-STK-SIZE L))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-IF-OK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-WORD-SIZE (LR-IF-OK L))
(P-WORD-SIZE L)))
((ENABLE LR-IF-OK)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-IF-OK is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and eight replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
eight new formulas:
Case 8. (EQUAL (P-PC (LR-IF-OK L)) (P-PC L)).
This simplifies, rewriting with SUB1-ADD1 and PLUS-ADD1-ARG1, and unfolding
the functions LESSP, PLUS, EQUAL, and LR-IF-OK, to three new conjectures:
Case 8.3.
(IMPLIES (EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-PC (LR-SET-ERROR L 'IF-TEMP-STK-OVERFLOW))
(P-PC L))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 8.2.
(IMPLIES (NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PC (LR-SET-ERROR L 'IF-TEMP-STK-OVERFLOW))
(P-PC L))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 8.1.
(IMPLIES (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-PC (LR-SET-ERROR L 'IF-TEMP-STK-OVERFLOW))
(P-PC L))).
But this again simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR,
to:
T.
Case 7. (EQUAL (P-CTRL-STK (LR-IF-OK L))
(P-CTRL-STK L)),
which simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and opening up the
functions LESSP, PLUS, EQUAL, and LR-IF-OK, to the following three new goals:
Case 7.3.
(IMPLIES (EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-CTRL-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-CTRL-STK L))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 7.2.
(IMPLIES (NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-CTRL-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-CTRL-STK L))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 7.1.
(IMPLIES (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-CTRL-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-CTRL-STK L))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6. (EQUAL (P-TEMP-STK (LR-IF-OK L))
(P-TEMP-STK L)).
This simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and unfolding the
functions LESSP, PLUS, EQUAL, and LR-IF-OK, to three new conjectures:
Case 6.3.
(IMPLIES (EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-TEMP-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-TEMP-STK L))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6.2.
(IMPLIES (NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-TEMP-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-TEMP-STK L))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6.1.
(IMPLIES (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-TEMP-STK (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-TEMP-STK L))).
But this again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5. (EQUAL (P-PROG-SEGMENT (LR-IF-OK L))
(P-PROG-SEGMENT L)),
which simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and expanding the
definitions of LESSP, PLUS, EQUAL, and LR-IF-OK, to the following three new
formulas:
Case 5.3.
(IMPLIES
(EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-PROG-SEGMENT L))).
However this again simplifies, rewriting with the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5.2.
(IMPLIES
(NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-PROG-SEGMENT L))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5.1.
(IMPLIES
(LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-PROG-SEGMENT L))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4. (EQUAL (P-DATA-SEGMENT (LR-IF-OK L))
(P-DATA-SEGMENT L)).
This simplifies, applying the lemmas SUB1-ADD1 and PLUS-ADD1-ARG1, and
opening up the functions LESSP, PLUS, EQUAL, and LR-IF-OK, to the following
three new formulas:
Case 4.3.
(IMPLIES
(EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-DATA-SEGMENT L))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4.2.
(IMPLIES
(NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-DATA-SEGMENT L))).
This again simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4.1.
(IMPLIES
(LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-DATA-SEGMENT L))),
which again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-IF-OK L))
(P-MAX-CTRL-STK-SIZE L)),
which simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and unfolding LESSP,
PLUS, EQUAL, and LR-IF-OK, to the following three new formulas:
Case 3.3.
(IMPLIES
(EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-CTRL-STK-SIZE L))).
But this again simplifies, rewriting with the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 3.2.
(IMPLIES
(NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-CTRL-STK-SIZE L))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 3.1.
(IMPLIES
(LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-CTRL-STK-SIZE L))).
This again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-IF-OK L))
(P-MAX-TEMP-STK-SIZE L)).
This simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and unfolding the
definitions of LESSP, PLUS, EQUAL, and LR-IF-OK, to three new conjectures:
Case 2.3.
(IMPLIES
(EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-TEMP-STK-SIZE L))),
which again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, and
opening up the definition of EQUAL, to:
T.
Case 2.2.
(IMPLIES
(NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-TEMP-STK-SIZE L))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 2.1.
(IMPLIES
(LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-MAX-TEMP-STK-SIZE L))).
However this again simplifies, rewriting with the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-IF-OK L))
(P-WORD-SIZE L)),
which simplifies, applying SUB1-ADD1 and PLUS-ADD1-ARG1, and unfolding LESSP,
PLUS, EQUAL, and LR-IF-OK, to the following three new conjectures:
Case 1.3.
(IMPLIES (EQUAL (P-MAX-TEMP-STK-SIZE L) 0)
(EQUAL (P-WORD-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-WORD-SIZE L))).
However this again simplifies, appealing to the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1.2.
(IMPLIES (NOT (NUMBERP (P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-WORD-SIZE L))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1.1.
(IMPLIES (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L)))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR L
'IF-TEMP-STK-OVERFLOW))
(P-WORD-SIZE L))).
However this again simplifies, appealing to the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.4 0.0 ]
P-ACCESSORS-LR-IF-OK
(PROVE-LEMMA P-ACCESSORS-LR-SET-TEMP
(REWRITE)
(AND (EQUAL (P-PC (LR-SET-TEMP S V N))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-SET-TEMP S V N))
(IF (EQUAL (P-PSW S) 'RUN)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-CTRL-STK S)))
(EQUAL (P-TEMP-STK (LR-SET-TEMP S V N))
(P-TEMP-STK S))
(EQUAL (P-PROG-SEGMENT (LR-SET-TEMP S V N))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-SET-TEMP S V N))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TEMP S V N))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TEMP S V N))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-SET-TEMP S V N))
(P-WORD-SIZE S))
(EQUAL (P-PSW (LR-SET-TEMP S V N))
(P-PSW S)))
((ENABLE LR-SET-TEMP)
(DISABLE SET-LOCAL-VAR-VALUE)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-SET-TEMP is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
formulas:
Case 9. (EQUAL (P-PC (LR-SET-TEMP S V N))
(P-PC S)),
which simplifies, expanding the function LR-SET-TEMP, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PC (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PC S))).
But this again simplifies, rewriting with P-PC-P-STATE, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-SET-TEMP S V N))
(IF (EQUAL (P-PSW S) 'RUN)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-CTRL-STK S))).
This simplifies, unfolding the function LR-SET-TEMP, to:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL (P-CTRL-STK (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S)))),
which again simplifies, appealing to the lemma P-CTRL-STK-P-STATE, to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-SET-TEMP S V N))
(P-TEMP-STK S)),
which simplifies, unfolding LR-SET-TEMP, to the formula:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL (P-TEMP-STK (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-TEMP-STK S))).
However this again simplifies, applying P-TEMP-STK-P-STATE, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-SET-TEMP S V N))
(P-PROG-SEGMENT S)).
This simplifies, unfolding the function LR-SET-TEMP, to:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PROG-SEGMENT (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PROG-SEGMENT S))),
which again simplifies, rewriting with the lemma P-PROG-SEGMENT-P-STATE, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-SET-TEMP S V N))
(P-DATA-SEGMENT S)),
which simplifies, unfolding the function LR-SET-TEMP, to:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL (P-DATA-SEGMENT (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-DATA-SEGMENT S))).
But this again simplifies, applying P-DATA-SEGMENT-P-STATE, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-TEMP S V N))
(P-MAX-CTRL-STK-SIZE S)).
This simplifies, opening up LR-SET-TEMP, to the new conjecture:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL
(P-MAX-CTRL-STK-SIZE (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-MAX-CTRL-STK-SIZE S))),
which again simplifies, applying the lemma P-MAX-CTRL-STK-SIZE-P-STATE, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-TEMP S V N))
(P-MAX-TEMP-STK-SIZE S)),
which simplifies, opening up LR-SET-TEMP, to:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL
(P-MAX-TEMP-STK-SIZE (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-MAX-TEMP-STK-SIZE S))).
However this again simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-SET-TEMP S V N))
(P-WORD-SIZE S)).
This simplifies, unfolding the definition of LR-SET-TEMP, to:
(IMPLIES
(EQUAL (P-PSW S) 'RUN)
(EQUAL (P-WORD-SIZE (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-WORD-SIZE S))),
which again simplifies, applying the lemma P-WORD-SIZE-P-STATE, to:
T.
Case 1. (EQUAL (P-PSW (LR-SET-TEMP S V N))
(P-PSW S)),
which simplifies, unfolding the definition of LR-SET-TEMP, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PSW (P-STATE (P-PC S)
(SET-LOCAL-VAR-VALUE V N
(P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PSW S))).
This again simplifies, applying P-PSW-P-STATE, and opening up the definition
of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-SET-TEMP
(PROVE-LEMMA P-ACCESSORS-LR-DO-TEMP-FETCH
(REWRITE)
(AND (EQUAL (P-PC (LR-DO-TEMP-FETCH S))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-DO-TEMP-FETCH S))
(P-CTRL-STK S))
(EQUAL (P-PROG-SEGMENT (LR-DO-TEMP-FETCH S))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-DO-TEMP-FETCH S))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-DO-TEMP-FETCH S))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-DO-TEMP-FETCH S))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-DO-TEMP-FETCH S))
(P-WORD-SIZE S)))
((ENABLE LR-DO-TEMP-FETCH)
(DISABLE LOCAL-VAR-VALUE)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-DO-TEMP-FETCH is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and seven replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
seven new goals:
Case 7. (EQUAL (P-PC (LR-DO-TEMP-FETCH S))
(P-PC S)).
This simplifies, unfolding the function LR-DO-TEMP-FETCH, to the following
two new conjectures:
Case 7.2.
(IMPLIES (NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-PC (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-PC S))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 7.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL (P-PC (LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-PC S))).
But this again simplifies, applying P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Case 6. (EQUAL (P-CTRL-STK (LR-DO-TEMP-FETCH S))
(P-CTRL-STK S)).
This simplifies, unfolding the function LR-DO-TEMP-FETCH, to the following
two new formulas:
Case 6.2.
(IMPLIES (NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-CTRL-STK (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-CTRL-STK S))).
However this again simplifies, appealing to the lemma
P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 6.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-CTRL-STK (LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-CTRL-STK S))),
which again simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Case 5. (EQUAL (P-PROG-SEGMENT (LR-DO-TEMP-FETCH S))
(P-PROG-SEGMENT S)),
which simplifies, expanding LR-DO-TEMP-FETCH, to two new goals:
Case 5.2.
(IMPLIES
(NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-PROG-SEGMENT (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-PROG-SEGMENT S))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-PROG-SEGMENT (LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-PROG-SEGMENT S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Case 4. (EQUAL (P-DATA-SEGMENT (LR-DO-TEMP-FETCH S))
(P-DATA-SEGMENT S)).
This simplifies, unfolding LR-DO-TEMP-FETCH, to the following two new
conjectures:
Case 4.2.
(IMPLIES
(NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-DATA-SEGMENT (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-DATA-SEGMENT S))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-DATA-SEGMENT (LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-DATA-SEGMENT S))).
This again simplifies, rewriting with the lemma P-ACCESSORS-LR-PUSH-TSTK,
to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-DO-TEMP-FETCH S))
(P-MAX-CTRL-STK-SIZE S)),
which simplifies, opening up LR-DO-TEMP-FETCH, to two new conjectures:
Case 3.2.
(IMPLIES
(NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-MAX-CTRL-STK-SIZE S))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 3.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-MAX-CTRL-STK-SIZE
(LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-MAX-CTRL-STK-SIZE S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-DO-TEMP-FETCH S))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, unfolding the function LR-DO-TEMP-FETCH, to the following
two new conjectures:
Case 2.2.
(IMPLIES
(NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-MAX-TEMP-STK-SIZE S))).
This again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 2.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-MAX-TEMP-STK-SIZE
(LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-MAX-TEMP-STK-SIZE S))),
which again simplifies, applying P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-DO-TEMP-FETCH S))
(P-WORD-SIZE S)).
This simplifies, expanding the function LR-DO-TEMP-FETCH, to the following
two new goals:
Case 1.2.
(IMPLIES (NOT (LR-EVAL-TEMP-SETP S))
(EQUAL (P-WORD-SIZE (LR-SET-ERROR S 'TEMP-FETCH-NOT-SET))
(P-WORD-SIZE S))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1.1.
(IMPLIES
(LR-EVAL-TEMP-SETP S)
(EQUAL
(P-WORD-SIZE (LR-PUSH-TSTK S
(LOCAL-VAR-VALUE (CADDR (LR-EXPR S))
(P-CTRL-STK S))))
(P-WORD-SIZE S))).
However this again simplifies, applying P-ACCESSORS-LR-PUSH-TSTK, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-DO-TEMP-FETCH
(PROVE-LEMMA P-ACCESSORS-LR-POP-CSTK
(REWRITE)
(AND (EQUAL (P-PC (LR-POP-CSTK S))
(P-PC S))
(EQUAL (P-CTRL-STK (LR-POP-CSTK S))
(IF (EQUAL (P-PSW S) 'RUN)
(POP (P-CTRL-STK S))
(P-CTRL-STK S)))
(EQUAL (P-TEMP-STK (LR-POP-CSTK S))
(P-TEMP-STK S))
(EQUAL (P-PROG-SEGMENT (LR-POP-CSTK S))
(P-PROG-SEGMENT S))
(EQUAL (P-DATA-SEGMENT (LR-POP-CSTK S))
(P-DATA-SEGMENT S))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-POP-CSTK S))
(P-MAX-CTRL-STK-SIZE S))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-POP-CSTK S))
(P-MAX-TEMP-STK-SIZE S))
(EQUAL (P-WORD-SIZE (LR-POP-CSTK S))
(P-WORD-SIZE S))
(EQUAL (P-PSW (LR-POP-CSTK S))
(P-PSW S)))
((ENABLE LR-POP-CSTK)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-POP-CSTK is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviations AND and POP, to
nine new formulas:
Case 9. (EQUAL (P-PC (LR-POP-CSTK S))
(P-PC S)),
which simplifies, expanding the definitions of POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PC (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PC S))).
However this again simplifies, rewriting with the lemma P-PC-P-STATE, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR-POP-CSTK S))
(IF (EQUAL (P-PSW S) 'RUN)
(CDR (P-CTRL-STK S))
(P-CTRL-STK S))),
which simplifies, opening up POP and LR-POP-CSTK, to the formula:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-CTRL-STK (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(CDR (P-CTRL-STK S)))).
This again simplifies, applying P-CTRL-STK-P-STATE, to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR-POP-CSTK S))
(P-TEMP-STK S)).
This simplifies, unfolding POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-TEMP-STK (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-TEMP-STK S))),
which again simplifies, rewriting with the lemma P-TEMP-STK-P-STATE, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR-POP-CSTK S))
(P-PROG-SEGMENT S)),
which simplifies, expanding the functions POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PROG-SEGMENT (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PROG-SEGMENT S))).
However this again simplifies, rewriting with the lemma
P-PROG-SEGMENT-P-STATE, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR-POP-CSTK S))
(P-DATA-SEGMENT S)),
which simplifies, opening up the definitions of POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-DATA-SEGMENT (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-DATA-SEGMENT S))).
However this again simplifies, applying P-DATA-SEGMENT-P-STATE, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-POP-CSTK S))
(P-MAX-CTRL-STK-SIZE S)).
This simplifies, expanding the functions POP and LR-POP-CSTK, to the new
goal:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-MAX-CTRL-STK-SIZE (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-MAX-CTRL-STK-SIZE S))),
which again simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-POP-CSTK S))
(P-MAX-TEMP-STK-SIZE S)).
This simplifies, unfolding the definitions of POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-MAX-TEMP-STK-SIZE (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-MAX-TEMP-STK-SIZE S))),
which again simplifies, applying the lemma P-MAX-TEMP-STK-SIZE-P-STATE, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR-POP-CSTK S))
(P-WORD-SIZE S)),
which simplifies, unfolding POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-WORD-SIZE (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-WORD-SIZE S))).
However this again simplifies, rewriting with P-WORD-SIZE-P-STATE, to:
T.
Case 1. (EQUAL (P-PSW (LR-POP-CSTK S))
(P-PSW S)).
This simplifies, unfolding POP and LR-POP-CSTK, to:
(IMPLIES (EQUAL (P-PSW S) 'RUN)
(EQUAL (P-PSW (P-STATE (P-PC S)
(CDR (P-CTRL-STK S))
(P-TEMP-STK S)
(P-PROG-SEGMENT S)
(P-DATA-SEGMENT S)
(P-MAX-CTRL-STK-SIZE S)
(P-MAX-TEMP-STK-SIZE S)
(P-WORD-SIZE S)
'RUN))
(P-PSW S))),
which again simplifies, rewriting with P-PSW-P-STATE, and expanding EQUAL,
to:
T.
Q.E.D.
[ 0.0 0.0 0.1 ]
P-ACCESSORS-LR-POP-CSTK
(PROVE-LEMMA LR-EVAL-IF-P-PSW-1
(REWRITE)
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(EQUAL (P-PSW (LR-EVAL FLAG L C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (ZEROP C))
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
((ENABLE LR-POP-TSTK LR-IF-OK)
(EXPAND (LR-EVAL FLAG L C))))
WARNING: Note that LR-EVAL-IF-P-PSW-1 contains the free variable FLAG which
will be chosen by instantiating the hypothesis (NOT (EQUAL FLAG (QUOTE LIST))).
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(EQUAL (P-PSW (LR-EVAL FLAG L C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)),
which simplifies, applying the lemmas SUB1-ADD1 and PLUS-ADD1-ARG1, and
expanding the definitions of LR-EVAL, EQUAL, LESSP, PLUS, LR-IF-OK, TOP, and
LR-F-ADDR, to six new conjectures:
Case 6. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(LESSP
(SUB1
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(LENGTH (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4)))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 3))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and opening
up the function EQUAL, to:
T.
Case 5. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(NOT
(NUMBERP
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4)))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 3))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)).
However this again simplifies, appealing to the lemma
P-ACCESSORS-LR-SET-ERROR, and unfolding EQUAL, to:
T.
Case 4. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
0)
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4)))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 3))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)),
which again simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
unfolding the function EQUAL, to:
T.
Case 3. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(LESSP
(SUB1
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(LENGTH (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(NOT
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4))))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 2))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)),
which again simplifies, rewriting with the lemma P-ACCESSORS-LR-SET-ERROR,
and opening up the definition of EQUAL, to:
T.
Case 2. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(NOT
(NUMBERP
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))))
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(NOT
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4))))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 2))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and opening
up the definition of EQUAL, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
0)
(EQUAL
(P-PSW (LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
'RUN)
(NOT
(EQUAL
(CAR
(P-TEMP-STK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW)))
'(ADDR (HEAP . 4))))
(EQUAL
(P-PSW
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-SET-ERROR (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)
'IF-TEMP-STK-OVERFLOW))
L
(DV (OFFSET (P-PC L)) 2))
C))
'RUN)
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL C 0))
(NUMBERP C)
(LISTP (LR-EXPR L)))
(EQUAL (P-PSW (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)).
This again simplifies, rewriting with the lemma P-ACCESSORS-LR-SET-ERROR,
and unfolding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.9 0.0 ]
LR-EVAL-IF-P-PSW-1
(DISABLE LR-EVAL-IF-P-PSW-1)
[ 0.0 0.0 0.0 ]
LR-EVAL-IF-P-PSW-1-OFF
(PROVE-LEMMA ADP-OFFSET-UNTAG-ADD-ADDR
(REWRITE)
(EQUAL (ADP-OFFSET (UNTAG (ADD-ADDR ADDR N)))
(PLUS (OFFSET ADDR) N))
((ENABLE OFFSET UNTAG ADD-ADDR TAG)))
WARNING: Note that the rewrite rule ADP-OFFSET-UNTAG-ADD-ADDR will be stored
so as to apply only to terms with the nonrecursive function symbol ADP-OFFSET.
This formula can be simplified, using the abbreviations OFFSET, UNTAG, and
ADP-OFFSET, to:
(EQUAL (CDADR (ADD-ADDR ADDR N))
(PLUS (CDADR ADDR) N)),
which simplifies, rewriting with the lemmas COMMUTATIVITY-OF-PLUS, CDR-CONS,
and CAR-CONS, and expanding the functions TAG, ADD-ADP, ADP-NAME, ADP-OFFSET,
UNTAG, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADP-OFFSET-UNTAG-ADD-ADDR
(PROVE-LEMMA ADP-OFFSET-UNTAG-SUB-ADDR
(REWRITE)
(EQUAL (ADP-OFFSET (UNTAG (SUB-ADDR ADDR N)))
(DIFFERENCE (OFFSET ADDR) N))
((ENABLE OFFSET UNTAG SUB-ADDR TAG)))
WARNING: Note that the rewrite rule ADP-OFFSET-UNTAG-SUB-ADDR will be stored
so as to apply only to terms with the nonrecursive function symbol ADP-OFFSET.
This formula can be simplified, using the abbreviations OFFSET, UNTAG, and
ADP-OFFSET, to:
(EQUAL (CDADR (SUB-ADDR ADDR N))
(DIFFERENCE (CDADR ADDR) N)),
which simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS, and
expanding the functions TAG, SUB-ADP, ADP-NAME, ADP-OFFSET, UNTAG, and
SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADP-OFFSET-UNTAG-SUB-ADDR
(PROVE-LEMMA ADP-NAME-UNTAG-SUB-ADDR
(REWRITE)
(EQUAL (ADP-NAME (UNTAG (SUB-ADDR ADDR N)))
(ADP-NAME (UNTAG ADDR)))
((ENABLE ADP-NAME UNTAG SUB-ADDR TAG)))
WARNING: Note that the rewrite rule ADP-NAME-UNTAG-SUB-ADDR will be stored so
as to apply only to terms with the nonrecursive function symbol ADP-NAME.
This conjecture can be simplified, using the abbreviations UNTAG and ADP-NAME,
to:
(EQUAL (CAADR (SUB-ADDR ADDR N))
(CAADR ADDR)).
This simplifies, applying CDR-CONS and CAR-CONS, and unfolding the functions
TAG, SUB-ADP, ADP-NAME, ADP-OFFSET, UNTAG, and SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADP-NAME-UNTAG-SUB-ADDR
(PROVE-LEMMA ADP-OFFSET-CONS
(REWRITE)
(EQUAL (ADP-OFFSET (CONS AREA-NAME OFFSET))
OFFSET))
WARNING: Note that the rewrite rule ADP-OFFSET-CONS will be stored so as to
apply only to terms with the nonrecursive function symbol ADP-OFFSET.
This conjecture can be simplified, using the abbreviations CDR-CONS and
ADP-OFFSET, to:
(EQUAL OFFSET OFFSET).
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADP-OFFSET-CONS
(PROVE-LEMMA P-ACCESSORS-LR->P
(REWRITE)
(AND (EQUAL (P-PC (LR->P L)) (LR-P-PC L))
(EQUAL (P-CTRL-STK (LR->P L))
(P-CTRL-STK L))
(EQUAL (P-TEMP-STK (LR->P L))
(P-TEMP-STK L))
(EQUAL (P-PROG-SEGMENT (LR->P L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(EQUAL (P-DATA-SEGMENT (LR->P L))
(P-DATA-SEGMENT L))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR->P L))
(P-MAX-CTRL-STK-SIZE L))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR->P L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-WORD-SIZE (LR->P L))
(P-WORD-SIZE L))
(EQUAL (P-PSW (LR->P L)) (P-PSW L)))
((ENABLE LR->P)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR->P is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
nine new formulas:
Case 9. (EQUAL (P-PC (LR->P L)) (LR-P-PC L)).
This simplifies, applying P-PC-P-STATE, and unfolding the definition of
LR->P, to:
T.
Case 8. (EQUAL (P-CTRL-STK (LR->P L))
(P-CTRL-STK L)),
which simplifies, applying P-CTRL-STK-P-STATE, and unfolding the function
LR->P, to:
T.
Case 7. (EQUAL (P-TEMP-STK (LR->P L))
(P-TEMP-STK L)).
This simplifies, rewriting with P-TEMP-STK-P-STATE, and expanding the
definition of LR->P, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (LR->P L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))),
which simplifies, rewriting with the lemma P-PROG-SEGMENT-P-STATE, and
expanding the function LR->P, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (LR->P L))
(P-DATA-SEGMENT L)),
which simplifies, applying P-DATA-SEGMENT-P-STATE, and expanding LR->P, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (LR->P L))
(P-MAX-CTRL-STK-SIZE L)).
This simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and expanding
the function LR->P, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (LR->P L))
(P-MAX-TEMP-STK-SIZE L)),
which simplifies, appealing to the lemma P-MAX-TEMP-STK-SIZE-P-STATE, and
opening up LR->P, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (LR->P L))
(P-WORD-SIZE L)),
which simplifies, rewriting with P-WORD-SIZE-P-STATE, and expanding LR->P,
to:
T.
Case 1. (EQUAL (P-PSW (LR->P L)) (P-PSW L)).
This simplifies, applying P-PSW-P-STATE, and expanding the function LR->P,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR->P
(PROVE-LEMMA TYPE-LR-P-PC
(REWRITE)
(EQUAL (TYPE (LR-P-PC L)) 'PC)
((ENABLE LR-P-PC)
(DISABLE LR-P-PC-1)))
This formula simplifies, rewriting with TYPE-TAG, and expanding the functions
LR-P-PC and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TYPE-LR-P-PC
(PROVE-LEMMA CDDR-NIL-LR-P-PC
(REWRITE)
(EQUAL (CDDR (LR-P-PC L)) NIL)
((ENABLE LR-P-PC)
(DISABLE LR-P-PC-1)))
This conjecture simplifies, appealing to the lemma CDDR-TAG, and expanding the
functions LR-P-PC and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDDR-NIL-LR-P-PC
(PROVE-LEMMA LISTP-UNTAG-LR-P-PC
(REWRITE)
(LISTP (UNTAG (LR-P-PC L)))
((ENABLE LR-P-PC)
(DISABLE LR-P-PC-1)))
This formula simplifies, applying UNTAG-TAG, and unfolding the definition of
LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-UNTAG-LR-P-PC
(PROVE-LEMMA NUMBERP-CDR-LR-P-PC
(REWRITE)
(NUMBERP (CDR (UNTAG (LR-P-PC L))))
((ENABLE LR-P-PC)
(DISABLE LR-P-PC-1)))
This conjecture simplifies, rewriting with UNTAG-TAG and CDR-CONS, and
expanding the function LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-CDR-LR-P-PC
(PROVE-LEMMA CAR-UNTAG-LR-P-PC
(REWRITE)
(EQUAL (CAR (UNTAG (LR-P-PC P)))
(CAR (UNTAG (P-PC P))))
((ENABLE AREA-NAME LR-P-PC)
(DISABLE LR-P-PC-1)))
This simplifies, rewriting with UNTAG-TAG and CAR-CONS, and expanding
AREA-NAME, ADP-NAME, and LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-UNTAG-LR-P-PC
(PROVE-LEMMA AREA-NAME-LR-P-PC
(REWRITE)
(EQUAL (AREA-NAME (LR-P-PC P))
(AREA-NAME (P-PC P)))
((ENABLE LR-P-PC)
(DISABLE LR-P-PC-1)))
This conjecture simplifies, appealing to the lemmas CAR-CONS and AREA-NAME-TAG,
and expanding the functions LR-P-PC and ADP-NAME, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AREA-NAME-LR-P-PC
(PROVE-LEMMA DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG
(REWRITE)
(EQUAL (DEFINEDP X
(COMP-PROGRAMS-1 PROGRAMS))
(DEFINEDP X PROGRAMS))
((ENABLE NAME)))
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LISTP PROGRAMS)
(p X (CDR PROGRAMS)))
(p X PROGRAMS))
(IMPLIES (NOT (LISTP PROGRAMS))
(p X PROGRAMS))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PROGRAMS) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme produces the
following two new goals:
Case 2. (IMPLIES (AND (LISTP PROGRAMS)
(EQUAL (DEFINEDP X
(COMP-PROGRAMS-1 (CDR PROGRAMS)))
(DEFINEDP X (CDR PROGRAMS))))
(EQUAL (DEFINEDP X
(COMP-PROGRAMS-1 PROGRAMS))
(DEFINEDP X PROGRAMS))).
This simplifies, applying CDR-CONS and CAR-CONS, and unfolding the
definitions of COMP-PROGRAMS-1, NAME, LR-MAKE-PROGRAM, and DEFINEDP, to:
T.
Case 1. (IMPLIES (NOT (LISTP PROGRAMS))
(EQUAL (DEFINEDP X
(COMP-PROGRAMS-1 PROGRAMS))
(DEFINEDP X PROGRAMS))),
which simplifies, unfolding the definitions of COMP-PROGRAMS-1, LISTP,
DEFINEDP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG
(PROVE-LEMMA DEFINEDP-APPEND
(REWRITE)
(EQUAL (DEFINEDP X (APPEND L1 L2))
(OR (DEFINEDP X L1) (DEFINEDP X L2))))
This simplifies, opening up the function OR, to two new conjectures:
Case 2. (IMPLIES (NOT (DEFINEDP X L1))
(EQUAL (DEFINEDP X (APPEND L1 L2))
(DEFINEDP X L2))),
which we will name *1.
Case 1. (IMPLIES (DEFINEDP X L1)
(EQUAL (DEFINEDP X (APPEND L1 L2))
T)).
This again simplifies, trivially, to the new formula:
(IMPLIES (DEFINEDP X L1)
(DEFINEDP X (APPEND L1 L2))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(EQUAL (DEFINEDP X (APPEND L1 L2))
(OR (DEFINEDP X L1) (DEFINEDP X L2))).
We named this *1. We will try to prove it by induction. There are three
plausible inductions. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP L1) (p X (CDR L1) L2))
(p X L1 L2))
(IMPLIES (NOT (LISTP L1))
(p X L1 L2))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT L1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme generates two new
conjectures:
Case 2. (IMPLIES (AND (LISTP L1)
(EQUAL (DEFINEDP X (APPEND (CDR L1) L2))
(OR (DEFINEDP X (CDR L1))
(DEFINEDP X L2))))
(EQUAL (DEFINEDP X (APPEND L1 L2))
(OR (DEFINEDP X L1)
(DEFINEDP X L2)))),
which simplifies, applying CDR-CONS and CAR-CONS, and unfolding OR, APPEND,
DEFINEDP, and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP L1))
(EQUAL (DEFINEDP X (APPEND L1 L2))
(OR (DEFINEDP X L1)
(DEFINEDP X L2)))).
This simplifies, applying APPEND-LEFT-ID, and opening up the functions
DEFINEDP and OR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DEFINEDP-APPEND
(PROVE-LEMMA DEFINEDP-COMP-PROGRAMS-DEFINEDP-ORIG
(REWRITE)
(IMPLIES (DEFINEDP X PROGRAMS)
(DEFINEDP X (COMP-PROGRAMS PROGRAMS)))
((ENABLE COMP-PROGRAMS NAME)
(DISABLE *1*P-RUNTIME-SUPPORT-PROGRAMS)))
This conjecture simplifies, appealing to the lemmas CDR-CONS, CAR-CONS,
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG, and DEFINEDP-APPEND, and expanding the
functions LR-MAKE-PROGRAM, CONS, AREA-NAME, LR-ANSWER-ADDR, NAME,
COMP-PROGRAMS, and DEFINEDP, to the new formula:
(IMPLIES (AND (DEFINEDP X PROGRAMS)
(NOT (EQUAL X (CAAR PROGRAMS)))
(NOT (DEFINEDP X (CDR PROGRAMS))))
(DEFINEDP X
(P-RUNTIME-SUPPORT-PROGRAMS))),
which again simplifies, unfolding the definition of DEFINEDP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DEFINEDP-COMP-PROGRAMS-DEFINEDP-ORIG
(PROVE-LEMMA P-ACCESSORS-P-HALT
(REWRITE)
(AND (EQUAL (P-PC (P-HALT P PSW)) (P-PC P))
(EQUAL (P-CTRL-STK (P-HALT P PSW))
(P-CTRL-STK P))
(EQUAL (P-TEMP-STK (P-HALT P PSW))
(P-TEMP-STK P))
(EQUAL (P-PROG-SEGMENT (P-HALT P PSW))
(P-PROG-SEGMENT P))
(EQUAL (P-DATA-SEGMENT (P-HALT P PSW))
(P-DATA-SEGMENT P))
(EQUAL (P-MAX-CTRL-STK-SIZE (P-HALT P PSW))
(P-MAX-CTRL-STK-SIZE P))
(EQUAL (P-MAX-TEMP-STK-SIZE (P-HALT P PSW))
(P-MAX-TEMP-STK-SIZE P))
(EQUAL (P-WORD-SIZE (P-HALT P PSW))
(P-WORD-SIZE P))
(EQUAL (P-PSW (P-HALT P PSW)) PSW)))
WARNING: Note that the proposed lemma P-ACCESSORS-P-HALT is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
conjectures:
Case 9. (EQUAL (P-PC (P-HALT P PSW))
(P-PC P)),
which simplifies, appealing to the lemma P-PC-P-STATE, and unfolding the
function P-HALT, to:
T.
Case 8. (EQUAL (P-CTRL-STK (P-HALT P PSW))
(P-CTRL-STK P)),
which simplifies, applying P-CTRL-STK-P-STATE, and opening up P-HALT, to:
T.
Case 7. (EQUAL (P-TEMP-STK (P-HALT P PSW))
(P-TEMP-STK P)).
This simplifies, rewriting with the lemma P-TEMP-STK-P-STATE, and opening up
the function P-HALT, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (P-HALT P PSW))
(P-PROG-SEGMENT P)).
This simplifies, rewriting with P-PROG-SEGMENT-P-STATE, and unfolding the
function P-HALT, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (P-HALT P PSW))
(P-DATA-SEGMENT P)),
which simplifies, appealing to the lemma P-DATA-SEGMENT-P-STATE, and
unfolding the definition of P-HALT, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (P-HALT P PSW))
(P-MAX-CTRL-STK-SIZE P)),
which simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and opening up
P-HALT, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (P-HALT P PSW))
(P-MAX-TEMP-STK-SIZE P)).
This simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, and unfolding the
function P-HALT, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (P-HALT P PSW))
(P-WORD-SIZE P)),
which simplifies, rewriting with P-WORD-SIZE-P-STATE, and expanding the
function P-HALT, to:
T.
Case 1. (EQUAL (P-PSW (P-HALT P PSW)) PSW).
This simplifies, appealing to the lemma P-PSW-P-STATE, and opening up the
definition of P-HALT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-P-HALT
(DISABLE P-HALT)
[ 0.0 0.0 0.0 ]
P-HALT-OFF
(PROVE-LEMMA P-ACCESSORS-P-SET-PC
(REWRITE)
(AND (EQUAL (P-PC (P-SET-PC P PC)) PC)
(EQUAL (P-CTRL-STK (P-SET-PC P PC))
(P-CTRL-STK P))
(EQUAL (P-TEMP-STK (P-SET-PC P PC))
(P-TEMP-STK P))
(EQUAL (P-PROG-SEGMENT (P-SET-PC P PC))
(P-PROG-SEGMENT P))
(EQUAL (P-DATA-SEGMENT (P-SET-PC P PC))
(P-DATA-SEGMENT P))
(EQUAL (P-MAX-CTRL-STK-SIZE (P-SET-PC P PC))
(P-MAX-CTRL-STK-SIZE P))
(EQUAL (P-MAX-TEMP-STK-SIZE (P-SET-PC P PC))
(P-MAX-TEMP-STK-SIZE P))
(EQUAL (P-WORD-SIZE (P-SET-PC P PC))
(P-WORD-SIZE P))
(EQUAL (P-PSW (P-SET-PC P PC))
(P-PSW P))))
WARNING: Note that the proposed lemma P-ACCESSORS-P-SET-PC is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and nine replacement rules.
This conjecture can be simplified, using the abbreviation AND, to nine new
conjectures:
Case 9. (EQUAL (P-PC (P-SET-PC P PC)) PC),
which simplifies, appealing to the lemma P-PC-P-STATE, and unfolding the
function P-SET-PC, to:
T.
Case 8. (EQUAL (P-CTRL-STK (P-SET-PC P PC))
(P-CTRL-STK P)),
which simplifies, applying P-CTRL-STK-P-STATE, and opening up P-SET-PC, to:
T.
Case 7. (EQUAL (P-TEMP-STK (P-SET-PC P PC))
(P-TEMP-STK P)).
This simplifies, rewriting with the lemma P-TEMP-STK-P-STATE, and opening up
the function P-SET-PC, to:
T.
Case 6. (EQUAL (P-PROG-SEGMENT (P-SET-PC P PC))
(P-PROG-SEGMENT P)).
This simplifies, rewriting with P-PROG-SEGMENT-P-STATE, and unfolding the
function P-SET-PC, to:
T.
Case 5. (EQUAL (P-DATA-SEGMENT (P-SET-PC P PC))
(P-DATA-SEGMENT P)),
which simplifies, appealing to the lemma P-DATA-SEGMENT-P-STATE, and
unfolding the definition of P-SET-PC, to:
T.
Case 4. (EQUAL (P-MAX-CTRL-STK-SIZE (P-SET-PC P PC))
(P-MAX-CTRL-STK-SIZE P)),
which simplifies, rewriting with P-MAX-CTRL-STK-SIZE-P-STATE, and opening up
P-SET-PC, to:
T.
Case 3. (EQUAL (P-MAX-TEMP-STK-SIZE (P-SET-PC P PC))
(P-MAX-TEMP-STK-SIZE P)).
This simplifies, applying P-MAX-TEMP-STK-SIZE-P-STATE, and unfolding the
function P-SET-PC, to:
T.
Case 2. (EQUAL (P-WORD-SIZE (P-SET-PC P PC))
(P-WORD-SIZE P)),
which simplifies, rewriting with P-WORD-SIZE-P-STATE, and expanding the
function P-SET-PC, to:
T.
Case 1. (EQUAL (P-PSW (P-SET-PC P PC))
(P-PSW P)).
This simplifies, appealing to the lemma P-PSW-P-STATE, and opening up the
definition of P-SET-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-P-SET-PC
(DISABLE P-SET-PC)
[ 0.0 0.0 0.0 ]
P-SET-PC-OFF
(PROVE-LEMMA P-PSW-NOT-RUN NIL
(IMPLIES (NOT (EQUAL (P-PSW P-STATE) 'RUN))
(EQUAL (P P-STATE CLOCK) P-STATE))
((ENABLE P)))
.
Appealing to the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
we now replace P-STATE by (P-STATE V1 Z1 X1 C D W V Z X) to eliminate
(P-PSW P-STATE), (P-WORD-SIZE P-STATE), (P-MAX-TEMP-STK-SIZE P-STATE),
(P-MAX-CTRL-STK-SIZE P-STATE)
(P-DATA-SEGMENT P-STATE), (P-PROG-SEGMENT P-STATE), (P-TEMP-STK P-STATE),
(P-CTRL-STK P-STATE), and (P-PC P-STATE). This generates two new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P-STATE))
(NOT (EQUAL (P-PSW P-STATE) 'RUN)))
(EQUAL (P P-STATE CLOCK) P-STATE)),
which simplifies, applying P-PSW-NP-STATEP, and unfolding the function EQUAL,
to the new formula:
(IMPLIES (NOT (P-STATEP P-STATE))
(EQUAL (P P-STATE CLOCK) P-STATE)),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(IMPLIES (NOT (EQUAL (P-PSW P-STATE) 'RUN))
(EQUAL (P P-STATE CLOCK) P-STATE)).
We named this *1. We will try to prove it by induction. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP CLOCK)
(p P-STATE CLOCK))
(IMPLIES (AND (NOT (ZEROP CLOCK))
(p (P-STEP P-STATE) (SUB1 CLOCK)))
(p P-STATE CLOCK))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT CLOCK) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for P-STATE. The above induction scheme generates
three new conjectures:
Case 3. (IMPLIES (AND (ZEROP CLOCK)
(NOT (EQUAL (P-PSW P-STATE) 'RUN)))
(EQUAL (P P-STATE CLOCK) P-STATE)),
which simplifies, expanding ZEROP, EQUAL, and P, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP CLOCK))
(EQUAL (P-PSW (P-STEP P-STATE)) 'RUN)
(NOT (EQUAL (P-PSW P-STATE) 'RUN)))
(EQUAL (P P-STATE CLOCK) P-STATE)),
which simplifies, opening up the definitions of ZEROP and P-STEP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP CLOCK))
(EQUAL (P (P-STEP P-STATE) (SUB1 CLOCK))
(P-STEP P-STATE))
(NOT (EQUAL (P-PSW P-STATE) 'RUN)))
(EQUAL (P P-STATE CLOCK) P-STATE)),
which simplifies, unfolding the functions ZEROP, P-STEP, and P, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
P-PSW-NOT-RUN
(PROVE-LEMMA P-PSW-P-HALT-X-Y-ERROR-MSG
(REWRITE)
(EQUAL (P (P-HALT P-STATE (X-Y-ERROR-MSG X Y))
N)
(P-HALT P-STATE (X-Y-ERROR-MSG X Y)))
((ENABLE P P-HALT)
(DISABLE *1*X-Y-ERROR-MSG)
(USE (P-PSW-NOT-RUN (P-STATE (P-HALT P-STATE (X-Y-ERROR-MSG X Y)))
(CLOCK N)))))
This conjecture can be simplified, using the abbreviation P-ACCESSORS-P-HALT,
to:
(IMPLIES (IMPLIES (NOT (EQUAL (X-Y-ERROR-MSG X Y) 'RUN))
(EQUAL (P (P-HALT P-STATE (X-Y-ERROR-MSG X Y))
N)
(P-HALT P-STATE (X-Y-ERROR-MSG X Y))))
(EQUAL (P (P-HALT P-STATE (X-Y-ERROR-MSG X Y))
N)
(P-HALT P-STATE
(X-Y-ERROR-MSG X Y)))).
This simplifies, applying NOT-EQUAL-X-Y-ERROR-MSG-RUN and P-PC-P-STATE, and
unfolding the functions UNPACK, NOT, P-HALT, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
P-PSW-P-HALT-X-Y-ERROR-MSG
(DISABLE P-PSW-P-HALT-X-Y-ERROR-MSG)
[ 0.0 0.0 0.0 ]
P-PSW-P-HALT-X-Y-ERROR-MSG-OFF
(PROVE-LEMMA P-ACCESSORS-P-RUN-SUBR
(REWRITE)
(AND (EQUAL (P-PROG-SEGMENT (P-RUN-SUBR SUBR P))
(P-PROG-SEGMENT P))
(EQUAL (P-MAX-CTRL-STK-SIZE (P-RUN-SUBR SUBR P))
(P-MAX-CTRL-STK-SIZE P))
(EQUAL (P-MAX-TEMP-STK-SIZE (P-RUN-SUBR SUBR P))
(P-MAX-TEMP-STK-SIZE P))
(EQUAL (P-WORD-SIZE (P-RUN-SUBR SUBR P))
(P-WORD-SIZE P)))
((DISABLE P-INS-OKP *1*X-Y-ERROR-MSG)
(ENABLE P-RUN-SUBR P-STEP1-OPENER P-PSW-P-HALT-X-Y-ERROR-MSG)))
WARNING: Note that the proposed lemma P-ACCESSORS-P-RUN-SUBR is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and four replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
four new conjectures:
Case 4. (EQUAL (P-PROG-SEGMENT (P-RUN-SUBR SUBR P))
(P-PROG-SEGMENT P)).
This simplifies, unfolding the function P-RUN-SUBR, to the following ten new
conjectures:
Case 4.10.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(EQUAL SUBR 'CDR))
(EQUAL (P-PROG-SEGMENT (P P (P-CDR-CLOCK P)))
(P-PROG-SEGMENT P))).
However this again simplifies, applying the lemma P-PRESERVES-P-RESOURCES,
and unfolding the function EQUAL, to:
T.
Case 4.9.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(EQUAL SUBR 'FALSE))
(EQUAL (P-PROG-SEGMENT (P P (P-FALSE-CLOCK P)))
(P-PROG-SEGMENT P))),
which again simplifies, applying P-PRESERVES-P-RESOURCES, and expanding
the definition of EQUAL, to:
T.
Case 4.8.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(EQUAL SUBR 'LISTP))
(EQUAL (P-PROG-SEGMENT (P P (P-LISTP-CLOCK P)))
(P-PROG-SEGMENT P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, and unfolding
EQUAL, to:
T.
Case 4.7.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(EQUAL SUBR 'TRUE))
(EQUAL (P-PROG-SEGMENT (P P (P-TRUE-CLOCK P)))
(P-PROG-SEGMENT P))).
However this again simplifies, rewriting with the lemma
P-PRESERVES-P-RESOURCES, and expanding EQUAL, to:
T.
Case 4.6.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(NOT (EQUAL SUBR 'TRUEP)))
(EQUAL (P-PROG-SEGMENT (P-HALT P 'BAD-SUBR))
(P-PROG-SEGMENT P))),
which again simplifies, appealing to the lemma P-ACCESSORS-P-HALT, to:
T.
Case 4.5.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(EQUAL SUBR 'TRUEP))
(EQUAL (P-PROG-SEGMENT (P P (P-TRUEP-CLOCK P)))
(P-PROG-SEGMENT P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
expanding the function EQUAL, to:
T.
Case 4.4.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(EQUAL SUBR 'NLISTP))
(EQUAL (P-PROG-SEGMENT (P P (P-NLISTP-CLOCK P)))
(P-PROG-SEGMENT P))).
This again simplifies, applying P-PRESERVES-P-RESOURCES, and unfolding
EQUAL, to:
T.
Case 4.3.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(EQUAL SUBR 'FALSEP))
(EQUAL (P-PROG-SEGMENT (P P (P-FALSEP-CLOCK P)))
(P-PROG-SEGMENT P))).
But this again simplifies, rewriting with the lemma
P-PRESERVES-P-RESOURCES, and opening up the function EQUAL, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(EQUAL SUBR 'CONS))
(EQUAL (P-PROG-SEGMENT (P P (P-CONS-CLOCK P)))
(P-PROG-SEGMENT P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
opening up the definition of EQUAL, to:
T.
Case 4.1.
(IMPLIES (EQUAL SUBR 'CAR)
(EQUAL (P-PROG-SEGMENT (P P (P-CAR-CLOCK P)))
(P-PROG-SEGMENT P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (P-RUN-SUBR SUBR P))
(P-MAX-CTRL-STK-SIZE P)).
This simplifies, unfolding the function P-RUN-SUBR, to the following ten new
formulas:
Case 3.10.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(EQUAL SUBR 'CDR))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-CDR-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
However this again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
unfolding EQUAL, to:
T.
Case 3.9.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(EQUAL SUBR 'FALSE))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-FALSE-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, and opening
up the function EQUAL, to:
T.
Case 3.8.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(EQUAL SUBR 'LISTP))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-LISTP-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
This again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and opening
up EQUAL, to:
T.
Case 3.7.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(EQUAL SUBR 'TRUE))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-TRUE-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
However this again simplifies, applying P-PRESERVES-P-RESOURCES, and
expanding the function EQUAL, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(NOT (EQUAL SUBR 'TRUEP)))
(EQUAL (P-MAX-CTRL-STK-SIZE (P-HALT P 'BAD-SUBR))
(P-MAX-CTRL-STK-SIZE P))).
This again simplifies, rewriting with the lemma P-ACCESSORS-P-HALT, to:
T.
Case 3.5.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(EQUAL SUBR 'TRUEP))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-TRUEP-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))),
which again simplifies, applying the lemma P-PRESERVES-P-RESOURCES, and
opening up the definition of EQUAL, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(EQUAL SUBR 'NLISTP))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-NLISTP-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))),
which again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES,
and unfolding the function EQUAL, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(EQUAL SUBR 'FALSEP))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-FALSEP-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
expanding the function EQUAL, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(EQUAL SUBR 'CONS))
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-CONS-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
However this again simplifies, applying P-PRESERVES-P-RESOURCES, and
expanding EQUAL, to:
T.
Case 3.1.
(IMPLIES (EQUAL SUBR 'CAR)
(EQUAL (P-MAX-CTRL-STK-SIZE (P P (P-CAR-CLOCK P)))
(P-MAX-CTRL-STK-SIZE P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (P-RUN-SUBR SUBR P))
(P-MAX-TEMP-STK-SIZE P)).
This simplifies, opening up the definition of P-RUN-SUBR, to the following
ten new goals:
Case 2.10.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(EQUAL SUBR 'CDR))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-CDR-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))).
This again simplifies, applying the lemma P-PRESERVES-P-RESOURCES, and
unfolding the function EQUAL, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(EQUAL SUBR 'FALSE))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-FALSE-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))),
which again simplifies, rewriting with the lemma P-PRESERVES-P-RESOURCES,
and opening up EQUAL, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(EQUAL SUBR 'LISTP))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-LISTP-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
expanding the definition of EQUAL, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(EQUAL SUBR 'TRUE))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-TRUE-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))).
But this again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
unfolding EQUAL, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(NOT (EQUAL SUBR 'TRUEP)))
(EQUAL (P-MAX-TEMP-STK-SIZE (P-HALT P 'BAD-SUBR))
(P-MAX-TEMP-STK-SIZE P))).
This again simplifies, rewriting with the lemma P-ACCESSORS-P-HALT, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(EQUAL SUBR 'TRUEP))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-TRUEP-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))),
which again simplifies, applying P-PRESERVES-P-RESOURCES, and unfolding
EQUAL, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(EQUAL SUBR 'NLISTP))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-NLISTP-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))).
This again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES, and
unfolding the definition of EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(EQUAL SUBR 'FALSEP))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-FALSEP-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))),
which again simplifies, applying P-PRESERVES-P-RESOURCES, and opening up
the function EQUAL, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(EQUAL SUBR 'CONS))
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-CONS-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, and opening
up EQUAL, to:
T.
Case 2.1.
(IMPLIES (EQUAL SUBR 'CAR)
(EQUAL (P-MAX-TEMP-STK-SIZE (P P (P-CAR-CLOCK P)))
(P-MAX-TEMP-STK-SIZE P))).
However this again simplifies, rewriting with P-PRESERVES-P-RESOURCES, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (P-RUN-SUBR SUBR P))
(P-WORD-SIZE P)).
This simplifies, unfolding the function P-RUN-SUBR, to the following ten new
formulas:
Case 1.10.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(EQUAL SUBR 'CDR))
(EQUAL (P-WORD-SIZE (P P (P-CDR-CLOCK P)))
(P-WORD-SIZE P))).
This again simplifies, rewriting with the lemma P-PRESERVES-P-RESOURCES,
and expanding the definition of EQUAL, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(EQUAL SUBR 'FALSE))
(EQUAL (P-WORD-SIZE (P P (P-FALSE-CLOCK P)))
(P-WORD-SIZE P))),
which again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES,
and expanding the function EQUAL, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(EQUAL SUBR 'LISTP))
(EQUAL (P-WORD-SIZE (P P (P-LISTP-CLOCK P)))
(P-WORD-SIZE P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
expanding EQUAL, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(EQUAL SUBR 'TRUE))
(EQUAL (P-WORD-SIZE (P P (P-TRUE-CLOCK P)))
(P-WORD-SIZE P))).
But this again simplifies, applying P-PRESERVES-P-RESOURCES, and unfolding
EQUAL, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(NOT (EQUAL SUBR 'TRUEP)))
(EQUAL (P-WORD-SIZE (P-HALT P 'BAD-SUBR))
(P-WORD-SIZE P))).
This again simplifies, rewriting with P-ACCESSORS-P-HALT, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(NOT (EQUAL SUBR 'NLISTP))
(NOT (EQUAL SUBR 'TRUE))
(EQUAL SUBR 'TRUEP))
(EQUAL (P-WORD-SIZE (P P (P-TRUEP-CLOCK P)))
(P-WORD-SIZE P))).
But this again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES,
and expanding the definition of EQUAL, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(NOT (EQUAL SUBR 'FALSEP))
(NOT (EQUAL SUBR 'LISTP))
(EQUAL SUBR 'NLISTP))
(EQUAL (P-WORD-SIZE (P P (P-NLISTP-CLOCK P)))
(P-WORD-SIZE P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, and
expanding the function EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(NOT (EQUAL SUBR 'CONS))
(NOT (EQUAL SUBR 'FALSE))
(EQUAL SUBR 'FALSEP))
(EQUAL (P-WORD-SIZE (P P (P-FALSEP-CLOCK P)))
(P-WORD-SIZE P))).
This again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES, and
expanding the definition of EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL SUBR 'CAR))
(NOT (EQUAL SUBR 'CDR))
(EQUAL SUBR 'CONS))
(EQUAL (P-WORD-SIZE (P P (P-CONS-CLOCK P)))
(P-WORD-SIZE P))),
which again simplifies, appealing to the lemma P-PRESERVES-P-RESOURCES,
and opening up EQUAL, to:
T.
Case 1.1.
(IMPLIES (EQUAL SUBR 'CAR)
(EQUAL (P-WORD-SIZE (P P (P-CAR-CLOCK P)))
(P-WORD-SIZE P))),
which again simplifies, rewriting with P-PRESERVES-P-RESOURCES, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
P-ACCESSORS-P-RUN-SUBR
(PROVE-LEMMA P-ACCESSORS-LR-APPLY-SUBR
(REWRITE)
(AND (EQUAL (P-PC (LR-APPLY-SUBR L1 L2))
(P-PC L2))
(EQUAL (P-PROG-SEGMENT (LR-APPLY-SUBR L1 L2))
(P-PROG-SEGMENT L2))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-APPLY-SUBR L1 L2))
(P-MAX-CTRL-STK-SIZE L2))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-APPLY-SUBR L1 L2))
(P-MAX-TEMP-STK-SIZE L2))
(EQUAL (P-WORD-SIZE (LR-APPLY-SUBR L1 L2))
(P-WORD-SIZE L2)))
((ENABLE LR-APPLY-SUBR P-INVARIANT1)
(DISABLE P-INS-STEP LR-P-C-SIZE LR-P-C-SIZE-LIST
*1*X-Y-ERROR-MSG P-INS-OKP)))
WARNING: Note that the proposed lemma P-ACCESSORS-LR-APPLY-SUBR is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and five replacement rules.
This conjecture can be simplified, using the abbreviation AND, to five new
conjectures:
Case 5. (EQUAL (P-PC (LR-APPLY-SUBR L1 L2))
(P-PC L2)),
which simplifies, applying P-ACCESSORS-P-RUN-SUBR, P-ACCESSORS-P-SET-PC,
P-ACCESSORS-LR->P, and P-PC-P-STATE, and unfolding the definition of
LR-APPLY-SUBR, to:
T.
Case 4. (EQUAL (P-PROG-SEGMENT (LR-APPLY-SUBR L1 L2))
(P-PROG-SEGMENT L2)).
This simplifies, appealing to the lemmas P-ACCESSORS-P-RUN-SUBR,
P-ACCESSORS-P-SET-PC, P-ACCESSORS-LR->P, and P-PROG-SEGMENT-P-STATE, and
opening up the function LR-APPLY-SUBR, to:
T.
Case 3. (EQUAL (P-MAX-CTRL-STK-SIZE (LR-APPLY-SUBR L1 L2))
(P-MAX-CTRL-STK-SIZE L2)).
This simplifies, applying the lemmas P-ACCESSORS-P-RUN-SUBR,
P-ACCESSORS-P-SET-PC, P-ACCESSORS-LR->P, and P-MAX-CTRL-STK-SIZE-P-STATE,
and unfolding the function LR-APPLY-SUBR, to:
T.
Case 2. (EQUAL (P-MAX-TEMP-STK-SIZE (LR-APPLY-SUBR L1 L2))
(P-MAX-TEMP-STK-SIZE L2)).
This simplifies, applying P-ACCESSORS-P-RUN-SUBR, P-ACCESSORS-P-SET-PC,
P-ACCESSORS-LR->P, and P-MAX-TEMP-STK-SIZE-P-STATE, and unfolding the
definition of LR-APPLY-SUBR, to:
T.
Case 1. (EQUAL (P-WORD-SIZE (LR-APPLY-SUBR L1 L2))
(P-WORD-SIZE L2)),
which simplifies, rewriting with P-ACCESSORS-P-RUN-SUBR,
P-ACCESSORS-P-SET-PC, P-ACCESSORS-LR->P, and P-WORD-SIZE-P-STATE, and
expanding the function LR-APPLY-SUBR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-ACCESSORS-LR-APPLY-SUBR
(PROVE-LEMMA P-PROG-SEGMENT-LR-EVAL
(REWRITE)
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))
((INDUCT (LR-EVAL FLAG L C))
(EXPAND (LR-EVAL FLAG L C)
(LR-EVAL 'LIST L C)
(LR-EVAL FLAG L 0))
(DISABLE LR-EVAL)))
This conjecture can be simplified, using the abbreviations ZEROP, NLISTP, NOT,
OR, AND, P-ACCESSORS-LR-FUNCALL, S-TEMP-FETCH, PLUS-ADD1-ARG1, S-TEMP-TEST,
S-TEMP-EVAL, P-ACCESSORS-LR-SET-POS, LR-NODE-SIZE, LR-UNDEF-ADDR, LR-F-ADDR,
P-ACCESSORS-LR-IF-OK, TOP, and P-ACCESSORS-LR-SET-EXPR, to 20 new conjectures:
Case 20.(IMPLIES (NOT (EQUAL (P-PSW L) 'RUN))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, expanding the function LR-EVAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(NOT (LISTP (OFFSET (P-PC L)))))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
opening up the functions LR-EVAL and EQUAL, to:
T.
Case 18.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C))
(P-PROG-SEGMENT L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T L C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, expanding the definitions of LR-EVAL and EQUAL, to:
T.
Case 17.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(NOT (LISTP (LR-EXPR-LIST L))))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, opening up the functions LR-EVAL and EQUAL, to:
T.
Case 16.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(ZEROP C))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and unfolding the
functions ZEROP, LR-EVAL, and EQUAL, to:
T.
Case 15.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(LITATOM (LR-EXPR L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, and expanding
the definitions of LR-EVAL, EQUAL, VALUE, DEFINITION, TOP, and
LOCAL-VAR-VALUE, to:
T.
Case 14.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(NOT (LISTP (LR-EXPR L))))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
expanding LR-EVAL and EQUAL, to:
T.
Case 13.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(NOT
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
(EQUAL
(P-PROG-SEGMENT
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 2))
C))
(P-PROG-SEGMENT L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-IF-OK, and opening up
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 12.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(EQUAL
(P-PROG-SEGMENT
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 3))
C))
(P-PROG-SEGMENT L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, applying P-ACCESSORS-LR-IF-OK, and unfolding the functions
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 11.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(NOT
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and expanding the
definitions of LR-EVAL and EQUAL, to:
T.
Case 10.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, rewriting with P-ACCESSORS-LR-SET-TEMP, and unfolding EQUAL,
LR-EVAL, S-TEMP-EVAL, and TOP, to:
T.
Case 9. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(LR-EVAL-TEMP-SETP L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, rewriting with the lemmas SUB1-ADD1, EQUAL-SUB1-0,
PLUS-ADD1-ARG1, and P-ACCESSORS-LR-DO-TEMP-FETCH, and expanding the
definitions of EQUAL, PLUS, LESSP, LR-EVAL, S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(NOT (LR-EVAL-TEMP-SETP L))
(EQUAL (P-PROG-SEGMENT (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-TEMP, and expanding EQUAL, PLUS, LESSP, LR-EVAL,
S-TEMP-EVAL, S-TEMP-TEST, and TOP, to:
T.
Case 7. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-ERROR, and expanding the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, SUB1, and NUMBERP, to:
T.
Case 6. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, applying P-ACCESSORS-LR-DO-TEMP-FETCH, and opening up the
definitions of EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH,
to:
T.
Case 5. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and expanding
EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(EQUAL (P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, expanding LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and
S-TEMP-FETCH, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(SUBRP (CAR (LR-EXPR L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, applying P-ACCESSORS-LR-APPLY-SUBR, and opening up LR-EVAL,
EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(LITATOM (CAR (LR-EXPR L)))
(EQUAL
(P-PROG-SEGMENT
(LR-EVAL T
(LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(SUB1 C)))
(P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))).
This simplifies, rewriting with P-ACCESSORS-LR-SET-EXPR, and unfolding
UNPACK, LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(NOT (LITATOM (CAR (LR-EXPR L))))
(EQUAL (P-PROG-SEGMENT (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-PROG-SEGMENT L)))
(EQUAL (P-PROG-SEGMENT (LR-EVAL FLAG L C))
(P-PROG-SEGMENT L))),
which simplifies, rewriting with NOT-LITATOM-SUBRP and
P-ACCESSORS-LR-SET-ERROR, and expanding LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 1.1 0.1 ]
P-PROG-SEGMENT-LR-EVAL
(PROVE-LEMMA P-MAX-CTRL-STK-SIZE-LR-EVAL
(REWRITE)
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))
((INDUCT (LR-EVAL FLAG L C))
(EXPAND (LR-EVAL FLAG L C)
(LR-EVAL 'LIST L C)
(LR-EVAL FLAG L 0))
(DISABLE LR-EVAL)))
This conjecture can be simplified, using the abbreviations ZEROP, NLISTP, NOT,
OR, AND, P-ACCESSORS-LR-FUNCALL, S-TEMP-FETCH, PLUS-ADD1-ARG1, S-TEMP-TEST,
S-TEMP-EVAL, P-ACCESSORS-LR-SET-POS, P-ACCESSORS-LR-POP-TSTK, LR-NODE-SIZE,
LR-UNDEF-ADDR, LR-F-ADDR, P-ACCESSORS-LR-IF-OK, TOP, and
P-ACCESSORS-LR-SET-EXPR, to 20 new conjectures:
Case 20.(IMPLIES (NOT (EQUAL (P-PSW L) 'RUN))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, expanding the function LR-EVAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(NOT (LISTP (OFFSET (P-PC L)))))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
opening up the functions LR-EVAL and EQUAL, to:
T.
Case 18.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C))
(P-MAX-CTRL-STK-SIZE (LR-EVAL T L C)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL T L C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, expanding the definitions of LR-EVAL and EQUAL, to:
T.
Case 17.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(NOT (LISTP (LR-EXPR-LIST L))))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, opening up the functions LR-EVAL and EQUAL, to:
T.
Case 16.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(ZEROP C))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and unfolding the
functions ZEROP, LR-EVAL, and EQUAL, to:
T.
Case 15.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(LITATOM (LR-EXPR L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, and expanding
the definitions of LR-EVAL, EQUAL, VALUE, DEFINITION, TOP, and
LOCAL-VAR-VALUE, to:
T.
Case 14.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(NOT (LISTP (LR-EXPR L))))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
expanding LR-EVAL and EQUAL, to:
T.
Case 13.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(NOT
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
(EQUAL
(P-MAX-CTRL-STK-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 2))
C))
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-IF-OK, and opening up
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 12.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(EQUAL
(P-MAX-CTRL-STK-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 3))
C))
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, applying P-ACCESSORS-LR-IF-OK, and unfolding the functions
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 11.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(NOT
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and expanding the
definitions of LR-EVAL and EQUAL, to:
T.
Case 10.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-SET-TEMP, and unfolding EQUAL,
LR-EVAL, S-TEMP-EVAL, and TOP, to:
T.
Case 9. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(LR-EVAL-TEMP-SETP L))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, rewriting with the lemmas SUB1-ADD1, EQUAL-SUB1-0,
PLUS-ADD1-ARG1, and P-ACCESSORS-LR-DO-TEMP-FETCH, and expanding the
definitions of EQUAL, PLUS, LESSP, LR-EVAL, S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(NOT (LR-EVAL-TEMP-SETP L))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-TEMP, and expanding EQUAL, PLUS, LESSP, LR-EVAL,
S-TEMP-EVAL, S-TEMP-TEST, and TOP, to:
T.
Case 7. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-ERROR, and expanding the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, SUB1, and NUMBERP, to:
T.
Case 6. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-DO-TEMP-FETCH, and opening up the
definitions of EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH,
to:
T.
Case 5. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and expanding
EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, expanding LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and
S-TEMP-FETCH, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(SUBRP (CAR (LR-EXPR L)))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-APPLY-SUBR, and opening up LR-EVAL,
EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(LITATOM (CAR (LR-EXPR L)))
(EQUAL
(P-MAX-CTRL-STK-SIZE
(LR-EVAL T
(LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(SUB1 C)))
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-POP-CSTK and
P-ACCESSORS-LR-SET-EXPR, and unfolding UNPACK, LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(NOT (LITATOM (CAR (LR-EXPR L))))
(EQUAL
(P-MAX-CTRL-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-CTRL-STK-SIZE L)))
(EQUAL (P-MAX-CTRL-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-CTRL-STK-SIZE L))),
which simplifies, rewriting with NOT-LITATOM-SUBRP and
P-ACCESSORS-LR-SET-ERROR, and expanding LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 1.2 0.1 ]
P-MAX-CTRL-STK-SIZE-LR-EVAL
(PROVE-LEMMA P-MAX-TEMP-STK-SIZE-LR-EVAL
(REWRITE)
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))
((INDUCT (LR-EVAL FLAG L C))
(EXPAND (LR-EVAL FLAG L C)
(LR-EVAL 'LIST L C)
(LR-EVAL FLAG L 0))
(DISABLE LR-EVAL)))
This conjecture can be simplified, using the abbreviations ZEROP, NLISTP, NOT,
OR, AND, P-ACCESSORS-LR-FUNCALL, S-TEMP-FETCH, PLUS-ADD1-ARG1, S-TEMP-TEST,
S-TEMP-EVAL, P-ACCESSORS-LR-SET-POS, P-ACCESSORS-LR-POP-TSTK, LR-NODE-SIZE,
LR-UNDEF-ADDR, LR-F-ADDR, P-ACCESSORS-LR-IF-OK, TOP, and
P-ACCESSORS-LR-SET-EXPR, to 20 new conjectures:
Case 20.(IMPLIES (NOT (EQUAL (P-PSW L) 'RUN))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, expanding the function LR-EVAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(NOT (LISTP (OFFSET (P-PC L)))))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
opening up the functions LR-EVAL and EQUAL, to:
T.
Case 18.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C))
(P-MAX-TEMP-STK-SIZE (LR-EVAL T L C)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL T L C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, expanding the definitions of LR-EVAL and EQUAL, to:
T.
Case 17.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(NOT (LISTP (LR-EXPR-LIST L))))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, opening up the functions LR-EVAL and EQUAL, to:
T.
Case 16.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(ZEROP C))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and unfolding the
functions ZEROP, LR-EVAL, and EQUAL, to:
T.
Case 15.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(LITATOM (LR-EXPR L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, and expanding
the definitions of LR-EVAL, EQUAL, VALUE, DEFINITION, TOP, and
LOCAL-VAR-VALUE, to:
T.
Case 14.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(NOT (LISTP (LR-EXPR L))))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
expanding LR-EVAL and EQUAL, to:
T.
Case 13.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(NOT
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
(EQUAL
(P-MAX-TEMP-STK-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 2))
C))
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-IF-OK, and opening up
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 12.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(EQUAL
(P-MAX-TEMP-STK-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 3))
C))
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, applying P-ACCESSORS-LR-IF-OK, and unfolding the functions
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 11.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(NOT
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and expanding the
definitions of LR-EVAL and EQUAL, to:
T.
Case 10.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-SET-TEMP, and unfolding EQUAL,
LR-EVAL, S-TEMP-EVAL, and TOP, to:
T.
Case 9. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(LR-EVAL-TEMP-SETP L))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, rewriting with the lemmas SUB1-ADD1, EQUAL-SUB1-0,
PLUS-ADD1-ARG1, and P-ACCESSORS-LR-DO-TEMP-FETCH, and expanding the
definitions of EQUAL, PLUS, LESSP, LR-EVAL, S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(NOT (LR-EVAL-TEMP-SETP L))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-TEMP, and expanding EQUAL, PLUS, LESSP, LR-EVAL,
S-TEMP-EVAL, S-TEMP-TEST, and TOP, to:
T.
Case 7. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-ERROR, and expanding the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, SUB1, and NUMBERP, to:
T.
Case 6. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-DO-TEMP-FETCH, and opening up the
definitions of EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH,
to:
T.
Case 5. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and expanding
EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, expanding LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and
S-TEMP-FETCH, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(SUBRP (CAR (LR-EXPR L)))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-APPLY-SUBR, and opening up LR-EVAL,
EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(LITATOM (CAR (LR-EXPR L)))
(EQUAL
(P-MAX-TEMP-STK-SIZE
(LR-EVAL T
(LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(SUB1 C)))
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-POP-CSTK and
P-ACCESSORS-LR-SET-EXPR, and unfolding UNPACK, LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(NOT (LITATOM (CAR (LR-EXPR L))))
(EQUAL
(P-MAX-TEMP-STK-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-MAX-TEMP-STK-SIZE (LR-EVAL FLAG L C))
(P-MAX-TEMP-STK-SIZE L))),
which simplifies, rewriting with NOT-LITATOM-SUBRP and
P-ACCESSORS-LR-SET-ERROR, and expanding LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 0.9 0.1 ]
P-MAX-TEMP-STK-SIZE-LR-EVAL
(PROVE-LEMMA P-WORD-SIZE-LR-EVAL
(REWRITE)
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))
((INDUCT (LR-EVAL FLAG L C))
(EXPAND (LR-EVAL FLAG L C)
(LR-EVAL 'LIST L C)
(LR-EVAL FLAG L 0))
(DISABLE LR-EVAL)))
This conjecture can be simplified, using the abbreviations ZEROP, NLISTP, NOT,
OR, AND, P-ACCESSORS-LR-FUNCALL, S-TEMP-FETCH, PLUS-ADD1-ARG1, S-TEMP-TEST,
S-TEMP-EVAL, P-ACCESSORS-LR-SET-POS, P-ACCESSORS-LR-POP-TSTK, LR-NODE-SIZE,
LR-UNDEF-ADDR, LR-F-ADDR, P-ACCESSORS-LR-IF-OK, TOP, and
P-ACCESSORS-LR-SET-EXPR, to 20 new conjectures:
Case 20.(IMPLIES (NOT (EQUAL (P-PSW L) 'RUN))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, expanding the function LR-EVAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(NOT (LISTP (OFFSET (P-PC L)))))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
opening up the functions LR-EVAL and EQUAL, to:
T.
Case 18.(IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L))
(EQUAL (P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C))
(P-WORD-SIZE (LR-EVAL T L C)))
(EQUAL (P-WORD-SIZE (LR-EVAL T L C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, expanding the definitions of LR-EVAL and EQUAL, to:
T.
Case 17.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(NOT (LISTP (LR-EXPR-LIST L))))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, opening up the functions LR-EVAL and EQUAL, to:
T.
Case 16.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(ZEROP C))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and unfolding the
functions ZEROP, LR-EVAL, and EQUAL, to:
T.
Case 15.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(LITATOM (LR-EXPR L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, and expanding
the definitions of LR-EVAL, EQUAL, VALUE, DEFINITION, TOP, and
LOCAL-VAR-VALUE, to:
T.
Case 14.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(NOT (LISTP (LR-EXPR L))))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
expanding LR-EVAL and EQUAL, to:
T.
Case 13.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(NOT
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
(EQUAL
(P-WORD-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 2))
C))
(P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL (P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-IF-OK, and opening up
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 12.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(EQUAL
(P-WORD-SIZE
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 3))
C))
(P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL (P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, applying P-ACCESSORS-LR-IF-OK, and unfolding the functions
TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 11.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(NOT
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN))
(EQUAL (P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and expanding the
definitions of LR-EVAL and EQUAL, to:
T.
Case 10.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL (P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-SET-TEMP, and unfolding EQUAL,
LR-EVAL, S-TEMP-EVAL, and TOP, to:
T.
Case 9. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(LR-EVAL-TEMP-SETP L))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, rewriting with the lemmas SUB1-ADD1, EQUAL-SUB1-0,
PLUS-ADD1-ARG1, and P-ACCESSORS-LR-DO-TEMP-FETCH, and expanding the
definitions of EQUAL, PLUS, LESSP, LR-EVAL, S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(NOT (LR-EVAL-TEMP-SETP L))
(EQUAL (P-WORD-SIZE (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-TEMP, and expanding EQUAL, PLUS, LESSP, LR-EVAL,
S-TEMP-EVAL, S-TEMP-TEST, and TOP, to:
T.
Case 7. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-ERROR, and expanding the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, SUB1, and NUMBERP, to:
T.
Case 6. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-DO-TEMP-FETCH, and opening up the
definitions of EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH,
to:
T.
Case 5. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and expanding
EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(EQUAL (P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, expanding LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and
S-TEMP-FETCH, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(SUBRP (CAR (LR-EXPR L)))
(EQUAL (P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, applying P-ACCESSORS-LR-APPLY-SUBR, and opening up LR-EVAL,
EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(LITATOM (CAR (LR-EXPR L)))
(EQUAL
(P-WORD-SIZE
(LR-EVAL T
(LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(SUB1 C)))
(P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(EQUAL (P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))).
This simplifies, rewriting with P-ACCESSORS-LR-POP-CSTK and
P-ACCESSORS-LR-SET-EXPR, and unfolding UNPACK, LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(NOT (LITATOM (CAR (LR-EXPR L))))
(EQUAL (P-WORD-SIZE (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(P-WORD-SIZE L)))
(EQUAL (P-WORD-SIZE (LR-EVAL FLAG L C))
(P-WORD-SIZE L))),
which simplifies, rewriting with NOT-LITATOM-SUBRP and
P-ACCESSORS-LR-SET-ERROR, and expanding LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 1.2 0.1 ]
P-WORD-SIZE-LR-EVAL
(PROVE-LEMMA AREA-NAME-P-PC-LR-EVAL
(REWRITE)
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))
((INDUCT (LR-EVAL FLAG L C))
(EXPAND (LR-EVAL FLAG L C)
(LR-EVAL 'LIST L C)
(LR-EVAL FLAG L 0))
(DISABLE LR-EVAL)))
This conjecture can be simplified, using the abbreviations ZEROP, NLISTP, NOT,
OR, AND, S-TEMP-FETCH, PLUS-ADD1-ARG1, S-TEMP-TEST, S-TEMP-EVAL,
P-ACCESSORS-LR-SET-POS, LR-NODE-SIZE, LR-UNDEF-ADDR, LR-F-ADDR,
P-ACCESSORS-LR-IF-OK, TOP, CAR-CONS, ADP-NAME, AREA-NAME-TAG, and
P-ACCESSORS-LR-SET-EXPR, to 20 new goals:
Case 20.(IMPLIES (NOT (EQUAL (P-PSW L) 'RUN))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, opening up the definition of LR-EVAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(NOT (LISTP (OFFSET (P-PC L)))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and opening up
LR-EVAL and EQUAL, to:
T.
Case 18.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L))
(EQUAL (AREA-NAME (P-PC (LR-EVAL 'LIST
(LR-SET-EXPR (LR-EVAL T L C)
L
(NX (OFFSET (P-PC L))))
C)))
(AREA-NAME (P-PC L)))
(EQUAL (AREA-NAME (P-PC (LR-EVAL T L C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, opening up LR-EVAL and EQUAL, to:
T.
Case 17.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(EQUAL FLAG 'LIST)
(LISTP (OFFSET (P-PC L)))
(NOT (LISTP (LR-EXPR-LIST L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, expanding LR-EVAL and EQUAL, to:
T.
Case 16.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(ZEROP C))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
expanding ZEROP, LR-EVAL, and EQUAL, to:
T.
Case 15.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(LITATOM (LR-EXPR L)))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and unfolding the
definitions of LR-EVAL, EQUAL, VALUE, DEFINITION, TOP, and LOCAL-VAR-VALUE,
to:
T.
Case 14.(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(NOT (LISTP (LR-EXPR L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, applying P-ACCESSORS-LR-SET-ERROR, and opening up the
functions LR-EVAL and EQUAL, to:
T.
Case 13.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(NOT
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
(EQUAL
(AREA-NAME
(P-PC
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 2))
C)))
(AREA-NAME (P-PC L)))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, applying the lemma P-ACCESSORS-LR-IF-OK, and expanding the
functions TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 12.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN)
(EQUAL
(CAR (P-TEMP-STK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(EQUAL
(AREA-NAME
(P-PC
(LR-EVAL T
(LR-SET-EXPR
(LR-POP-TSTK
(LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
L
(DV (OFFSET (P-PC L)) 3))
C)))
(AREA-NAME (P-PC L)))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and expanding the
functions TAG, ADD-ADDR, LR-EVAL, EQUAL, TOP, and LR-F-ADDR, to:
T.
Case 11.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'IF)
(NOT
(EQUAL
(P-PSW (LR-IF-OK (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
'RUN))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, rewriting with P-ACCESSORS-LR-IF-OK, and opening up
LR-EVAL and EQUAL, to:
T.
Case 10.(IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, appealing to the lemma P-ACCESSORS-LR-SET-TEMP, and
expanding EQUAL, LR-EVAL, S-TEMP-EVAL, and TOP, to:
T.
Case 9. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(LR-EVAL-TEMP-SETP L))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, rewriting with SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-DO-TEMP-FETCH, and unfolding the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(NOT (LR-EVAL-TEMP-SETP L))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL T
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, rewriting with SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1,
and P-ACCESSORS-LR-SET-TEMP, and opening up the definitions of EQUAL, PLUS,
LESSP, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and TOP, to:
T.
Case 7. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(ADD1 (ADD1 (PLUS 0 (LENGTH (P-TEMP-STK L)))))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, applying SUB1-ADD1, EQUAL-SUB1-0, PLUS-ADD1-ARG1, and
P-ACCESSORS-LR-SET-ERROR, and opening up the functions EQUAL, PLUS, LESSP,
LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, SUB1, and NUMBERP, to:
T.
Case 6. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, applying P-ACCESSORS-LR-DO-TEMP-FETCH, and opening up the
functions EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 5. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, applying the lemma P-ACCESSORS-LR-PUSH-TSTK, and expanding
EQUAL, LR-EVAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(NOT (EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, expanding the definitions of LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(SUBRP (CAR (LR-EXPR L)))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, applying P-ACCESSORS-LR-APPLY-SUBR, and unfolding the
definitions of LR-EVAL, EQUAL, S-TEMP-EVAL, S-TEMP-TEST, and S-TEMP-FETCH,
to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(LITATOM (CAR (LR-EXPR L)))
(EQUAL
(AREA-NAME
(P-PC
(LR-EVAL T
(LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
(SUB1 C))))
(AREA-NAME
(P-PC (LR-FUNCALL L
(LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))),
which simplifies, rewriting with P-ACCESSORS-LR-SET-EXPR, CAR-CONS, and
AREA-NAME-TAG, and expanding UNPACK, LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, S-TEMP-FETCH, and ADP-NAME, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW L) 'RUN)
(NOT (EQUAL FLAG 'LIST))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LITATOM (LR-EXPR L)))
(LISTP (LR-EXPR L))
(NOT (EQUAL (CAR (LR-EXPR L)) 'IF))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (P-PSW (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C))
'RUN)
(NOT (SUBRP (CAR (LR-EXPR L))))
(NOT (LITATOM (CAR (LR-EXPR L))))
(EQUAL
(AREA-NAME (P-PC (LR-EVAL 'LIST
(LR-SET-POS L
(DV (OFFSET (P-PC L)) 1))
C)))
(AREA-NAME (P-PC L))))
(EQUAL (AREA-NAME (P-PC (LR-EVAL FLAG L C)))
(AREA-NAME (P-PC L)))).
This simplifies, appealing to the lemmas NOT-LITATOM-SUBRP and
P-ACCESSORS-LR-SET-ERROR, and opening up LR-EVAL, EQUAL, S-TEMP-EVAL,
S-TEMP-TEST, and S-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 1.2 0.1 ]
AREA-NAME-P-PC-LR-EVAL
(PROVE-LEMMA LR-PROGRAMS-PROPERP-LR-EVAL
(REWRITE)
(EQUAL (LR-PROGRAMS-PROPERP (LR-EVAL FLAG L C)
TABLE)
(LR-PROGRAMS-PROPERP L TABLE))
((ENABLE LR-PROGRAMS-PROPERP)))
This conjecture simplifies, applying P-PROG-SEGMENT-LR-EVAL and
AREA-NAME-P-PC-LR-EVAL, and unfolding the function LR-PROGRAMS-PROPERP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-LR-EVAL
(PROVE-LEMMA DEFINEDP-DEPOSIT
(REWRITE)
(EQUAL (DEFINEDP TAG
(DEPOSIT ANYTHING ADDR DATA-SEG))
(DEFINEDP TAG DATA-SEG))
((ENABLE DEPOSIT)))
This formula can be simplified, using the abbreviation DEPOSIT, to:
(EQUAL (DEFINEDP TAG
(DEPOSIT-ADP ANYTHING
(UNTAG ADDR)
DATA-SEG))
(DEFINEDP TAG DATA-SEG)),
which simplifies, appealing to the lemma DEFINEDP-PUT-ASSOC, and unfolding
PUT-VALUE, VALUE, DEFINITION, ADP-NAME, ADP-OFFSET, and DEPOSIT-ADP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DEFINEDP-DEPOSIT
(PROVE-LEMMA DEPOSIT-A-LIST-CONS-OPENER
(REWRITE)
(EQUAL (DEPOSIT-A-LIST (CONS X LIST)
ADDR DATA-SEG)
(DEPOSIT X ADDR
(DEPOSIT-A-LIST LIST
(ADD1-ADDR ADDR)
DATA-SEG))))
This conjecture can be simplified, using the abbreviation ADD1-ADDR, to:
(EQUAL (DEPOSIT-A-LIST (CONS X LIST)
ADDR DATA-SEG)
(DEPOSIT X ADDR
(DEPOSIT-A-LIST LIST
(ADD-ADDR ADDR 1)
DATA-SEG))).
This simplifies, applying CDR-CONS and CAR-CONS, and expanding ADD1-ADDR and
DEPOSIT-A-LIST, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DEPOSIT-A-LIST-CONS-OPENER
(PROVE-LEMMA DEPOSIT-A-LIST-NIL
(REWRITE)
(EQUAL (DEPOSIT-A-LIST NIL ADDR DATA-SEG)
DATA-SEG))
This formula simplifies, unfolding the definitions of LISTP and DEPOSIT-A-LIST,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DEPOSIT-A-LIST-NIL
(DISABLE DEPOSIT-A-LIST)
[ 0.0 0.0 0.0 ]
DEPOSIT-A-LIST-OFF
(PROVE-LEMMA ASSOC-PUT-ASSOC-3
(REWRITE)
(EQUAL (ASSOC NAME1
(PUT-ASSOC VAL NAME2 ALIST))
(IF (EQUAL NAME1 NAME2)
(IF (DEFINEDP NAME1 ALIST)
(CONS NAME1 VAL)
F)
(ASSOC NAME1 ALIST)))
((DO-NOT-INDUCT T)
(ENABLE DEFINEDP-ASSOC-FACT-1)))
WARNING: the newly proposed lemma, ASSOC-PUT-ASSOC-3, could be applied
whenever the previously added lemma ASSOC-PUT-ASSOC-2 could.
WARNING: the newly proposed lemma, ASSOC-PUT-ASSOC-3, could be applied
whenever the previously added lemma ASSOC-PUT-ASSOC-1 could.
This simplifies, clearly, to the following three new conjectures:
Case 3. (IMPLIES (NOT (EQUAL NAME1 NAME2))
(EQUAL (ASSOC NAME1
(PUT-ASSOC VAL NAME2 ALIST))
(ASSOC NAME1 ALIST))).
This again simplifies, rewriting with ASSOC-PUT-ASSOC-1, to:
T.
Case 2. (IMPLIES (AND (EQUAL NAME1 NAME2)
(DEFINEDP NAME1 ALIST))
(EQUAL (ASSOC NAME1
(PUT-ASSOC VAL NAME2 ALIST))
(CONS NAME1 VAL))).
However this again simplifies, applying ASSOC-PUT-ASSOC-2, to:
T.
Case 1. (IMPLIES (AND (EQUAL NAME1 NAME2)
(NOT (DEFINEDP NAME1 ALIST)))
(EQUAL (ASSOC NAME1
(PUT-ASSOC VAL NAME2 ALIST))
F)).
This again simplifies, applying NOT-DEFINEDP-PUT-ASSOC and
DEFINEDP-ASSOC-FACT-1, and unfolding the function EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ASSOC-PUT-ASSOC-3
(DISABLE ASSOC-PUT-ASSOC-3)
[ 0.0 0.0 0.0 ]
ASSOC-PUT-ASSOC-3-OFF
(PROVE-LEMMA ADPP-LESSP-OFFSET-DEPOSIT
(REWRITE)
(IMPLIES (AND (LESSP OFFSET
(LENGTH (CDR (ASSOC NAME DATA-SEG))))
(DEFINEDP NAME DATA-SEG))
(LESSP OFFSET
(LENGTH (CDR (ASSOC NAME
(DEPOSIT ANYTHING
ANYWHERE
DATA-SEG))))))
((ENABLE DEPOSIT ASSOC-PUT-ASSOC-3 MY-LENGTH-PUT)))
WARNING: When the linear lemma ADPP-LESSP-OFFSET-DEPOSIT is stored under:
(LENGTH (CDR (ASSOC NAME
(DEPOSIT ANYTHING ANYWHERE DATA-SEG))))
it contains the free variable OFFSET which will be chosen by instantiating the
hypothesis (LESSP OFFSET (LENGTH (CDR (ASSOC NAME DATA-SEG)))).
WARNING: Note that the proposed lemma ADPP-LESSP-OFFSET-DEPOSIT is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
This formula can be simplified, using the abbreviations AND, IMPLIES, and
DEPOSIT, to:
(IMPLIES (AND (LESSP OFFSET
(LENGTH (CDR (ASSOC NAME DATA-SEG))))
(DEFINEDP NAME DATA-SEG))
(LESSP OFFSET
(LENGTH (CDR (ASSOC NAME
(DEPOSIT-ADP ANYTHING
(UNTAG ANYWHERE)
DATA-SEG)))))),
which simplifies, applying ASSOC-PUT-ASSOC-3, and opening up the definitions
of PUT-VALUE, VALUE, DEFINITION, ADP-NAME, ADP-OFFSET, and DEPOSIT-ADP, to:
(IMPLIES
(AND (LESSP OFFSET
(LENGTH (CDR (ASSOC NAME DATA-SEG))))
(DEFINEDP NAME DATA-SEG)
(EQUAL NAME (CAR (UNTAG ANYWHERE))))
(LESSP OFFSET
(LENGTH (CDR (CONS NAME
(PUT ANYTHING
(CDR (UNTAG ANYWHERE))
(CDR (ASSOC (CAR (UNTAG ANYWHERE))
DATA-SEG)))))))),
which again simplifies, applying CDR-CONS and MY-LENGTH-PUT, to:
(IMPLIES (AND (LESSP OFFSET
(LENGTH (CDR (ASSOC (CAR (UNTAG ANYWHERE))
DATA-SEG))))
(DEFINEDP (CAR (UNTAG ANYWHERE))
DATA-SEG)
(NOT (LESSP (CDR (UNTAG ANYWHERE))
(LENGTH (CDR (ASSOC (CAR (UNTAG ANYWHERE))
DATA-SEG))))))
(LESSP OFFSET
(ADD1 (CDR (UNTAG ANYWHERE))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-LESSP-OFFSET-DEPOSIT
(PROVE-LEMMA ADPP-DEPOSIT-ANYTHING-AT-ALL
(REWRITE)
(IMPLIES (ADPP ADP DATA-SEG)
(ADPP ADP
(DEPOSIT ANYTHING ADDR2 DATA-SEG))))
WARNING: Note that the rewrite rule ADPP-DEPOSIT-ANYTHING-AT-ALL will be
stored so as to apply only to terms with the nonrecursive function symbol ADPP.
This formula can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-NAME, ADP-OFFSET, ADPP, and IMPLIES, to:
(IMPLIES (AND (LISTP ADP)
(NUMBERP (CDR ADP))
(DEFINEDP (CAR ADP) DATA-SEG)
(LESSP (CDR ADP)
(LENGTH (CDR (ASSOC (CAR ADP) DATA-SEG)))))
(ADPP ADP
(DEPOSIT ANYTHING ADDR2 DATA-SEG))),
which simplifies, appealing to the lemma DEFINEDP-DEPOSIT, and unfolding VALUE,
DEFINITION, ADP-NAME, ADP-OFFSET, and ADPP, to:
(IMPLIES (AND (LISTP ADP)
(NUMBERP (CDR ADP))
(DEFINEDP (CAR ADP) DATA-SEG)
(LESSP (CDR ADP)
(LENGTH (CDR (ASSOC (CAR ADP) DATA-SEG)))))
(LESSP (CDR ADP)
(LENGTH (CDR (ASSOC (CAR ADP)
(DEPOSIT ANYTHING ADDR2
DATA-SEG)))))).
This again simplifies, using linear arithmetic and applying
ADPP-LESSP-OFFSET-DEPOSIT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-DEPOSIT-ANYTHING-AT-ALL
(DISABLE ADPP-LESSP-OFFSET-DEPOSIT)
[ 0.0 0.0 0.0 ]
ADPP-LESSP-OFFSET-DEPOSIT-OFF
(DISABLE ADPP-DEPOSIT-ANYTHING-AT-ALL)
[ 0.0 0.0 0.0 ]
ADPP-DEPOSIT-ANYTHING-AT-ALL-OFF
(PROVE-LEMMA ADPP-UNTAG-DEFINEDP-AREA-NAME
(REWRITE)
(IMPLIES (ADPP (UNTAG ADDR) DATA-SEG)
(DEFINEDP (AREA-NAME ADDR) DATA-SEG))
((ENABLE AREA-NAME)))
This formula can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-OFFSET, ADPP, IMPLIES, ADP-NAME, and AREA-NAME, to:
T,
which simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-DEFINEDP-AREA-NAME
(DISABLE ADPP-UNTAG-DEFINEDP-AREA-NAME)
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-DEFINEDP-AREA-NAME-OFF
(PROVE-LEMMA ADPP-CONS-PACK-DEFINEDP-AREA-NAME
(REWRITE)
(IMPLIES (ADPP (CONS (PACK XXX) OFFSET)
DATA-SEG)
(DEFINEDP (PACK XXX) DATA-SEG))
((ENABLE AREA-NAME)))
WARNING: Note that ADPP-CONS-PACK-DEFINEDP-AREA-NAME contains the free
variable OFFSET which will be chosen by instantiating the hypothesis:
(ADPP (CONS (PACK XXX) OFFSET)
DATA-SEG).
This conjecture can be simplified, using the abbreviations DEFINITION, VALUE,
CAR-CONS, ADP-NAME, CDR-CONS, ADP-OFFSET, ADPP, and IMPLIES, to:
T.
This simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-CONS-PACK-DEFINEDP-AREA-NAME
(PROVE-LEMMA ADPP-UNTAG-NUMBERP-OFFSET
(REWRITE)
(IMPLIES (ADPP (UNTAG ADDR) DATA-SEG)
(NUMBERP (OFFSET ADDR)))
((ENABLE OFFSET)))
WARNING: Note that ADPP-UNTAG-NUMBERP-OFFSET contains the free variable
DATA-SEG which will be chosen by instantiating the hypothesis:
(ADPP (UNTAG ADDR) DATA-SEG).
This conjecture can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-NAME, ADPP, IMPLIES, ADP-OFFSET, and OFFSET, to the conjecture:
T.
This simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-NUMBERP-OFFSET
(DISABLE ADPP-UNTAG-NUMBERP-OFFSET)
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-NUMBERP-OFFSET-OFF
(PROVE-LEMMA ADPP-UNTAG-LISTP
(REWRITE)
(IMPLIES (ADPP (UNTAG ADDR) DATA-SEG)
(LISTP (UNTAG ADDR)))
((ENABLE OFFSET)))
WARNING: Note that ADPP-UNTAG-LISTP contains the free variable DATA-SEG which
will be chosen by instantiating the hypothesis (ADPP (UNTAG ADDR) DATA-SEG).
This conjecture can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-NAME, ADP-OFFSET, ADPP, and IMPLIES, to the conjecture:
T.
This simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-LISTP
(DISABLE ADPP-UNTAG-LISTP)
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-LISTP-OFF
(PROVE-LEMMA ADPP-ADD-ADDR-0
(REWRITE)
(IMPLIES (AND (ADPP (UNTAG ADDR) DATA-SEG)
(EQUAL (CDDR ADDR) NIL)
(EQUAL (TYPE ADDR) 'ADDR)
(ZEROP N))
(EQUAL (ADD-ADDR ADDR N) ADDR))
((ENABLE ADPP ADD-ADDR TAG TYPE UNTAG)))
WARNING: Note that ADPP-ADD-ADDR-0 contains the free variable DATA-SEG which
will be chosen by instantiating the hypothesis (ADPP (UNTAG ADDR) DATA-SEG).
This formula can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-NAME, ADP-OFFSET, ADPP, AND, IMPLIES, TYPE, and UNTAG, to:
(IMPLIES (AND (LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR)
(ZEROP N))
(EQUAL (ADD-ADDR ADDR N) ADDR)),
which simplifies, applying PLUS-ZERO-ARG2 and CONS-CAR-CDR, and expanding
ZEROP, TAG, ADD-ADP, ADP-NAME, ADP-OFFSET, UNTAG, TYPE, and ADD-ADDR, to the
following two new conjectures:
Case 2. (IMPLIES (AND (LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR)
(EQUAL N 0))
(EQUAL (LIST 'ADDR (CADR ADDR))
ADDR)).
This again simplifies, obviously, to:
(IMPLIES (AND (LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR))
(EQUAL (LIST 'ADDR (CADR ADDR))
ADDR)).
Applying the lemma CAR-CDR-ELIM, replace ADDR by (CONS Z X) to eliminate
(CDR ADDR) and (CAR ADDR), X by (CONS V W) to eliminate (CAR X) and (CDR X),
and V by (CONS D X) to eliminate (CDR V) and (CAR V). This produces the
following three new conjectures:
Case 2.3.
(IMPLIES (AND (NOT (LISTP ADDR))
(LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR))
(EQUAL (LIST 'ADDR (CADR ADDR))
ADDR)).
But this further simplifies, applying the lemma CDR-NLISTP, and unfolding
CAR and LISTP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP X))
(LISTP (CAR X))
(NUMBERP (CDAR X))
(DEFINEDP (CAAR X) DATA-SEG)
(LESSP (CDAR X)
(LENGTH (CDR (ASSOC (CAAR X) DATA-SEG))))
(EQUAL (CDR X) NIL)
(EQUAL Z 'ADDR))
(EQUAL (LIST 'ADDR (CAR X))
(CONS Z X))),
which further simplifies, applying CAR-NLISTP, and opening up LISTP, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP X)
(DEFINEDP D DATA-SEG)
(LESSP X
(LENGTH (CDR (ASSOC D DATA-SEG))))
(EQUAL W NIL)
(EQUAL Z 'ADDR))
(EQUAL (LIST 'ADDR (CONS D X))
(CONS Z (CONS (CONS D X) W)))).
This further simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR)
(NOT (NUMBERP N)))
(EQUAL (LIST 'ADDR (CADR ADDR))
ADDR)).
Appealing to the lemma CAR-CDR-ELIM, we now replace ADDR by (CONS Z X) to
eliminate (CDR ADDR) and (CAR ADDR), X by (CONS V W) to eliminate (CAR X)
and (CDR X), and V by (CONS D X) to eliminate (CDR V) and (CAR V). The
result is three new formulas:
Case 1.3.
(IMPLIES (AND (NOT (LISTP ADDR))
(LISTP (CADR ADDR))
(NUMBERP (CDADR ADDR))
(DEFINEDP (CAADR ADDR) DATA-SEG)
(LESSP (CDADR ADDR)
(LENGTH (CDR (ASSOC (CAADR ADDR) DATA-SEG))))
(EQUAL (CDDR ADDR) NIL)
(EQUAL (CAR ADDR) 'ADDR)
(NOT (NUMBERP N)))
(EQUAL (LIST 'ADDR (CADR ADDR))
ADDR)),
which further simplifies, applying CDR-NLISTP, and opening up CAR and
LISTP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP X))
(LISTP (CAR X))
(NUMBERP (CDAR X))
(DEFINEDP (CAAR X) DATA-SEG)
(LESSP (CDAR X)
(LENGTH (CDR (ASSOC (CAAR X) DATA-SEG))))
(EQUAL (CDR X) NIL)
(EQUAL Z 'ADDR)
(NOT (NUMBERP N)))
(EQUAL (LIST 'ADDR (CAR X))
(CONS Z X))).
This further simplifies, rewriting with CAR-NLISTP, and expanding the
function LISTP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(DEFINEDP D DATA-SEG)
(LESSP X
(LENGTH (CDR (ASSOC D DATA-SEG))))
(EQUAL W NIL)
(EQUAL Z 'ADDR)
(NOT (NUMBERP N)))
(EQUAL (LIST 'ADDR (CONS D X))
(CONS Z (CONS (CONS D X) W)))).
This further simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.1 ]
ADPP-ADD-ADDR-0
(DISABLE ADPP-ADD-ADDR-0)
[ 0.0 0.0 0.0 ]
ADPP-ADD-ADDR-0-OFF
(PROVE-LEMMA ADPP-UNTAG-LESSP-OFFSET
(REWRITE)
(IMPLIES (ADPP (UNTAG ADDR) DATA-SEG)
(LESSP (OFFSET ADDR)
(LENGTH (CDR (ASSOC (AREA-NAME ADDR) DATA-SEG)))))
((ENABLE AREA-NAME OFFSET)))
WARNING: Note that the proposed lemma ADPP-UNTAG-LESSP-OFFSET is to be stored
as zero type prescription rules, zero compound recognizer rules, one linear
rule, and zero replacement rules.
This conjecture can be simplified, using the abbreviations DEFINITION, VALUE,
ADPP, IMPLIES, ADP-NAME, AREA-NAME, ADP-OFFSET, and OFFSET, to:
T.
This simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-LESSP-OFFSET
(DISABLE ADPP-UNTAG-LESSP-OFFSET)
[ 0.0 0.0 0.0 ]
ADPP-UNTAG-LESSP-OFFSET-OFF
(PROVE-LEMMA ADPP-SAME-SIGNATURE NIL
(IMPLIES (SAME-SIGNATURE DATA-SEG2 DATA-SEG1)
(EQUAL (ADPP ADP DATA-SEG2)
(ADPP ADP DATA-SEG1)))
((ENABLE SAME-SIGNATURE-IMPLIES-EQUAL-LENGTHS
SAME-SIGNATURE-IMPLIES-EQUAL-DEFINEDP)))
This simplifies, rewriting with SAME-SIGNATURE-IMPLIES-EQUAL-LENGTHS and
SAME-SIGNATURE-IMPLIES-EQUAL-DEFINEDP, and expanding VALUE, DEFINITION,
ADP-NAME, ADP-OFFSET, and ADPP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADPP-SAME-SIGNATURE
(DISABLE ADPP)
[ 0.0 0.0 0.0 ]
ADPP-OFF
(PROVE-LEMMA P-OBJECTP-SIMILAR-P-STATES
(REWRITE)
(IMPLIES (AND (P-OBJECTP OBJECT P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(P-OBJECTP OBJECT P1))
((ENABLE P-OBJECTP SAME-SIGNATURE-IMPLIES-EQUAL-DEFINEDP)
(USE (ADPP-SAME-SIGNATURE (ADP (UNTAG OBJECT))
(DATA-SEG2 (P-DATA-SEGMENT P0))
(DATA-SEG1 (P-DATA-SEGMENT P1))))
(DISABLE ADPP BIT-VECTORP BOOLEANP DEFINEDP PCPP SMALL-NATURALP
SMALL-INTEGERP)))
WARNING: Note that P-OBJECTP-SIMILAR-P-STATES contains the free variable P0
which will be chosen by instantiating the hypothesis (P-OBJECTP OBJECT P0).
This conjecture can be simplified, using the abbreviations P-OBJECTP, AND, and
IMPLIES, to:
(IMPLIES (AND (IMPLIES (SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (ADPP (UNTAG OBJECT)
(P-DATA-SEGMENT P0))
(ADPP (UNTAG OBJECT)
(P-DATA-SEGMENT P1))))
(LISTP OBJECT)
(EQUAL (CDDR OBJECT) NIL)
(CASE (TYPE OBJECT)
(NAT (SMALL-NATURALP (UNTAG OBJECT)
(P-WORD-SIZE P0)))
(INT (SMALL-INTEGERP (UNTAG OBJECT)
(P-WORD-SIZE P0)))
(BITV (BIT-VECTORP (UNTAG OBJECT)
(P-WORD-SIZE P0)))
(BOOL (BOOLEANP (UNTAG OBJECT)))
(ADDR (ADPP (UNTAG OBJECT)
(P-DATA-SEGMENT P0)))
(PC (PCPP (UNTAG OBJECT)
(P-PROG-SEGMENT P0)))
(SUBR (DEFINEDP (UNTAG OBJECT)
(P-PROG-SEGMENT P0)))
(OTHERWISE F))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(P-OBJECTP OBJECT P1)).
This simplifies, rewriting with the lemma P-OBJECTP-OPENER, and unfolding the
definitions of IMPLIES and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
P-OBJECTP-SIMILAR-P-STATES
(PROVE-LEMMA ALL-P-OBJECTPS-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)))
WARNING: Note that ALL-P-OBJECTPS-LR->P-SIMILAR-STATES contains the free
variable P0 which will be chosen by instantiating the hypothesis
(ALL-P-OBJECTPS LST P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P0),
(P-PSW P0), (P-MAX-TEMP-STK-SIZE P0), (P-MAX-CTRL-STK-SIZE P0),
(P-DATA-SEGMENT P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0), (P-CTRL-STK P0),
and (P-PC P0). We would thus like to prove the following two new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
But this simplifies, rewriting with P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(ALL-P-OBJECTPS LST P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P1),
(P-PSW P1), (P-MAX-TEMP-STK-SIZE P1), (P-MAX-CTRL-STK-SIZE P1),
(P-DATA-SEGMENT P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1), (P-CTRL-STK P1),
and (P-PC P1). We thus obtain the following two new conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(ALL-P-OBJECTPS LST P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
But this further simplifies, applying the lemmas P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, and opening up the
definitions of EQUAL and SAME-SIGNATURE, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(ALL-P-OBJECTPS LST P0))
(ALL-P-OBJECTPS LST P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p LST P1 P0))
(IMPLIES (AND (NOT (NLISTP LST))
(p (CDR LST) P1 P0))
(p LST P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP LST)
(ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
This simplifies, unfolding the definitions of NLISTP, ALL-P-OBJECTPS, EQUAL,
and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (ALL-P-OBJECTPS (CDR LST) P0))
(ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
This simplifies, expanding the functions NLISTP and ALL-P-OBJECTPS, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(ALL-P-OBJECTPS (CDR LST) P1)
(ALL-P-OBJECTPS LST P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(ALL-P-OBJECTPS LST P1)).
This simplifies, applying P-OBJECTP-SIMILAR-P-STATES, and opening up NLISTP
and ALL-P-OBJECTPS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
ALL-P-OBJECTPS-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)))
WARNING: Note that PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES contains the
free variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-DATA-SEGMENTP DATA-SEG P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P0),
(P-PSW P0), (P-MAX-TEMP-STK-SIZE P0), (P-MAX-CTRL-STK-SIZE P0),
(P-DATA-SEGMENT P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0), (P-CTRL-STK P0),
and (P-PC P0). We would thus like to prove the following two new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
But this simplifies, rewriting with P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P1),
(P-PSW P1), (P-MAX-TEMP-STK-SIZE P1), (P-MAX-CTRL-STK-SIZE P1),
(P-DATA-SEGMENT P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1), (P-CTRL-STK P1),
and (P-PC P1). We thus obtain the following two new conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
But this further simplifies, applying the lemmas P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, and opening up the
definitions of EQUAL and SAME-SIGNATURE, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP DATA-SEG)
(p DATA-SEG P1 P0))
(IMPLIES (AND (NOT (NLISTP DATA-SEG))
(p (CDR DATA-SEG) P1 P0))
(p DATA-SEG P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT DATA-SEG) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP DATA-SEG)
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
This simplifies, unfolding the definitions of NLISTP, PROPER-P-DATA-SEGMENTP,
EQUAL, and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP DATA-SEG))
(NOT (PROPER-P-DATA-SEGMENTP (CDR DATA-SEG)
P0))
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
This simplifies, expanding the functions NLISTP, PROPER-P-DATA-SEGMENTP, and
PROPER-P-AREA, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP DATA-SEG))
(PROPER-P-DATA-SEGMENTP (CDR DATA-SEG)
P1)
(PROPER-P-DATA-SEGMENTP DATA-SEG P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-DATA-SEGMENTP DATA-SEG P1)).
This simplifies, applying ALL-P-OBJECTPS-LR->P-SIMILAR-STATES, and opening
up NLISTP, PROPER-P-DATA-SEGMENTP, and PROPER-P-AREA, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-TEMP-VAR-DCLSP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)))
WARNING: Note that PROPER-P-TEMP-VAR-DCLSP-LR->P-SIMILAR-STATES contains the
free variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P0),
(P-PSW P0), (P-MAX-TEMP-STK-SIZE P0), (P-MAX-CTRL-STK-SIZE P0),
(P-DATA-SEGMENT P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0), (P-CTRL-STK P0),
and (P-PC P0). We would thus like to prove the following two new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
But this simplifies, rewriting with P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C D W V X Z) to eliminate (P-WORD-SIZE P1),
(P-PSW P1), (P-MAX-TEMP-STK-SIZE P1), (P-MAX-CTRL-STK-SIZE P1),
(P-DATA-SEGMENT P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1), (P-CTRL-STK P1),
and (P-PC P1). We thus obtain the following two new conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL 0 (P-WORD-SIZE P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(SAME-SIGNATURE 0
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
But this further simplifies, applying the lemmas P-WORD-SIZE-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-DATA-SEGMENT-NP-STATEP, and opening up the
definitions of EQUAL and SAME-SIGNATURE, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP TEMP-VAR-DCLS)
(p TEMP-VAR-DCLS P1 P0))
(IMPLIES (AND (NOT (NLISTP TEMP-VAR-DCLS))
(p (CDR TEMP-VAR-DCLS) P1 P0))
(p TEMP-VAR-DCLS P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT TEMP-VAR-DCLS) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP TEMP-VAR-DCLS)
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
This simplifies, unfolding the definitions of NLISTP and
PROPER-P-TEMP-VAR-DCLSP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP TEMP-VAR-DCLS))
(NOT (PROPER-P-TEMP-VAR-DCLSP (CDR TEMP-VAR-DCLS)
P0))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
This simplifies, expanding the functions NLISTP and PROPER-P-TEMP-VAR-DCLSP,
to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP TEMP-VAR-DCLS))
(PROPER-P-TEMP-VAR-DCLSP (CDR TEMP-VAR-DCLS)
P1)
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P0)
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1)))
(PROPER-P-TEMP-VAR-DCLSP TEMP-VAR-DCLS P1)).
This simplifies, applying P-OBJECTP-SIMILAR-P-STATES, and opening up NLISTP
and PROPER-P-TEMP-VAR-DCLSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-P-TEMP-VAR-DCLSP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-INSTRUCTIONP-SIMILAR-P-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-INSTRUCTIONP INS NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-INSTRUCTIONP INS NAME P1))
((ENABLE PROPER-P-INSTRUCTIONP
SAME-SIGNATURE-IMPLIES-EQUAL-DEFINEDP)))
WARNING: Note that PROPER-P-INSTRUCTIONP-SIMILAR-P-STATES contains the free
variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-INSTRUCTIONP INS NAME P0).
This formula can be simplified, using the abbreviations
PROPER-P-NOT-BOOL-INSTRUCTIONP, PROPER-P-AND-BOOL-INSTRUCTIONP,
PROPER-P-OR-BOOL-INSTRUCTIONP, PROPER-P-LSH-BITV-INSTRUCTIONP,
PROPER-P-RSH-BITV-INSTRUCTIONP, PROPER-P-XOR-BITV-INSTRUCTIONP,
PROPER-P-NOT-BITV-INSTRUCTIONP, PROPER-P-AND-BITV-INSTRUCTIONP,
PROPER-P-OR-BITV-INSTRUCTIONP, PROPER-P-DIV2-NAT-INSTRUCTIONP,
PROPER-P-MULT2-NAT-WITH-CARRY-OUT-INSTRUCTIONP,
PROPER-P-MULT2-NAT-INSTRUCTIONP, PROPER-P-LT-NAT-INSTRUCTIONP,
PROPER-P-SUB1-NAT-INSTRUCTIONP, PROPER-P-SUB-NAT-WITH-CARRY-INSTRUCTIONP,
PROPER-P-SUB-NAT-INSTRUCTIONP, PROPER-P-ADD1-NAT-INSTRUCTIONP,
PROPER-P-ADD-NAT-WITH-CARRY-INSTRUCTIONP, PROPER-P-ADD-NAT-INSTRUCTIONP,
PROPER-P-INT-TO-NAT-INSTRUCTIONP, PROPER-P-LT-INT-INSTRUCTIONP,
PROPER-P-NEG-INT-INSTRUCTIONP, PROPER-P-SUB1-INT-INSTRUCTIONP,
PROPER-P-SUB-INT-WITH-CARRY-INSTRUCTIONP, PROPER-P-SUB-INT-INSTRUCTIONP,
PROPER-P-ADD1-INT-INSTRUCTIONP, PROPER-P-ADD-INT-WITH-CARRY-INSTRUCTIONP,
PROPER-P-ADD-INT-INSTRUCTIONP, PROPER-P-DEPOSIT-INSTRUCTIONP,
PROPER-P-FETCH-INSTRUCTIONP, PROPER-P-LT-ADDR-INSTRUCTIONP,
PROPER-P-EQ-INSTRUCTIONP, PROPER-P-SUB-ADDR-INSTRUCTIONP,
PROPER-P-ADD-ADDR-INSTRUCTIONP, PROPER-P-NO-OP-INSTRUCTIONP,
PROPER-P-POPJ-INSTRUCTIONP, PROPER-P-DEPOSIT-TEMP-STK-INSTRUCTIONP,
PROPER-P-FETCH-TEMP-STK-INSTRUCTIONP, PROPER-P-POP-CALL-INSTRUCTIONP,
PROPER-P-POPN-INSTRUCTIONP, PROPER-P-POP-INSTRUCTIONP,
PROPER-P-PUSH-TEMP-STK-FREE-SIZE-INSTRUCTIONP,
PROPER-P-PUSH-CTRL-STK-FREE-SIZE-INSTRUCTIONP, PROPER-P-RET-INSTRUCTIONP,
PROPER-P-INSTRUCTIONP, AND, and IMPLIES, to:
(IMPLIES
(AND
(PLISTP INS)
(CASE
(CAR INS)
(CALL (PROPER-P-CALL-INSTRUCTIONP INS NAME P0))
(RET (EQUAL (LENGTH INS) 1))
(LOCN (PROPER-P-LOCN-INSTRUCTIONP INS NAME P0))
(PUSH-CONSTANT (PROPER-P-PUSH-CONSTANT-INSTRUCTIONP INS NAME P0))
(PUSH-LOCAL (PROPER-P-PUSH-LOCAL-INSTRUCTIONP INS NAME P0))
(PUSH-GLOBAL (PROPER-P-PUSH-GLOBAL-INSTRUCTIONP INS NAME P0))
(PUSH-CTRL-STK-FREE-SIZE (EQUAL (LENGTH INS) 1))
(PUSH-TEMP-STK-FREE-SIZE (EQUAL (LENGTH INS) 1))
(PUSH-TEMP-STK-INDEX (PROPER-P-PUSH-TEMP-STK-INDEX-INSTRUCTIONP INS
NAME
P0))
(JUMP-IF-TEMP-STK-FULL
(PROPER-P-JUMP-IF-TEMP-STK-FULL-INSTRUCTIONP INS
NAME
P0))
(JUMP-IF-TEMP-STK-EMPTY
(PROPER-P-JUMP-IF-TEMP-STK-EMPTY-INSTRUCTIONP INS
NAME
P0))
(POP (EQUAL (LENGTH INS) 1))
(POP* (PROPER-P-POP*-INSTRUCTIONP INS NAME P0))
(POPN (EQUAL (LENGTH INS) 1))
(POP-LOCAL (PROPER-P-POP-LOCAL-INSTRUCTIONP INS NAME P0))
(POP-GLOBAL (PROPER-P-POP-GLOBAL-INSTRUCTIONP INS NAME P0))
(POP-LOCN (PROPER-P-POP-LOCN-INSTRUCTIONP INS NAME P0))
(POP-CALL (EQUAL (LENGTH INS) 1))
(FETCH-TEMP-STK (EQUAL (LENGTH INS) 1))
(DEPOSIT-TEMP-STK (EQUAL (LENGTH INS) 1))
(JUMP (PROPER-P-JUMP-INSTRUCTIONP INS NAME P0))
(JUMP-CASE (PROPER-P-JUMP-CASE-INSTRUCTIONP INS NAME P0))
(PUSHJ (PROPER-P-PUSHJ-INSTRUCTIONP INS NAME P0))
(POPJ (EQUAL (LENGTH INS) 1))
(SET-LOCAL (PROPER-P-SET-LOCAL-INSTRUCTIONP INS NAME P0))
(SET-GLOBAL (PROPER-P-SET-GLOBAL-INSTRUCTIONP INS NAME P0))
(TEST-NAT-AND-JUMP (PROPER-P-TEST-NAT-AND-JUMP-INSTRUCTIONP INS NAME
P0))
(TEST-INT-AND-JUMP (PROPER-P-TEST-INT-AND-JUMP-INSTRUCTIONP INS NAME
P0))
(TEST-BOOL-AND-JUMP (PROPER-P-TEST-BOOL-AND-JUMP-INSTRUCTIONP INS
NAME
P0))
(TEST-BITV-AND-JUMP (PROPER-P-TEST-BITV-AND-JUMP-INSTRUCTIONP INS
NAME
P0))
(NO-OP (EQUAL (LENGTH INS) 1))
(ADD-ADDR (EQUAL (LENGTH INS) 1))
(SUB-ADDR (EQUAL (LENGTH INS) 1))
(EQ (EQUAL (LENGTH INS) 1))
(LT-ADDR (EQUAL (LENGTH INS) 1))
(FETCH (EQUAL (LENGTH INS) 1))
(DEPOSIT (EQUAL (LENGTH INS) 1))
(ADD-INT (EQUAL (LENGTH INS) 1))
(ADD-INT-WITH-CARRY (EQUAL (LENGTH INS) 1))
(ADD1-INT (EQUAL (LENGTH INS) 1))
(SUB-INT (EQUAL (LENGTH INS) 1))
(SUB-INT-WITH-CARRY (EQUAL (LENGTH INS) 1))
(SUB1-INT (EQUAL (LENGTH INS) 1))
(NEG-INT (EQUAL (LENGTH INS) 1))
(LT-INT (EQUAL (LENGTH INS) 1))
(INT-TO-NAT (EQUAL (LENGTH INS) 1))
(ADD-NAT (EQUAL (LENGTH INS) 1))
(ADD-NAT-WITH-CARRY (EQUAL (LENGTH INS) 1))
(ADD1-NAT (EQUAL (LENGTH INS) 1))
(SUB-NAT (EQUAL (LENGTH INS) 1))
(SUB-NAT-WITH-CARRY (EQUAL (LENGTH INS) 1))
(SUB1-NAT (EQUAL (LENGTH INS) 1))
(LT-NAT (EQUAL (LENGTH INS) 1))
(MULT2-NAT (EQUAL (LENGTH INS) 1))
(MULT2-NAT-WITH-CARRY-OUT (EQUAL (LENGTH INS) 1))
(DIV2-NAT (EQUAL (LENGTH INS) 1))
(OR-BITV (EQUAL (LENGTH INS) 1))
(AND-BITV (EQUAL (LENGTH INS) 1))
(NOT-BITV (EQUAL (LENGTH INS) 1))
(XOR-BITV (EQUAL (LENGTH INS) 1))
(RSH-BITV (EQUAL (LENGTH INS) 1))
(LSH-BITV (EQUAL (LENGTH INS) 1))
(OR-BOOL (EQUAL (LENGTH INS) 1))
(AND-BOOL (EQUAL (LENGTH INS) 1))
(NOT-BOOL (EQUAL (LENGTH INS) 1))
(OTHERWISE F))
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-INSTRUCTIONP INS NAME P1)),
which simplifies, applying MEMBER-APPEND,
SAME-SIGNATURE-IMPLIES-EQUAL-DEFINEDP, PROPER-P-INSTRUCTIONP-OPENER, and
P-OBJECTP-SIMILAR-P-STATES, and expanding PROPER-P-CALL-INSTRUCTIONP,
LOCAL-VARS, DEFINITION, PROPER-P-LOCN-INSTRUCTIONP,
PROPER-P-PUSH-CONSTANT-INSTRUCTIONP, PROPER-P-PUSH-LOCAL-INSTRUCTIONP,
PROPER-P-PUSH-GLOBAL-INSTRUCTIONP, SMALL-NATURALP,
PROPER-P-PUSH-TEMP-STK-INDEX-INSTRUCTIONP,
PROPER-P-JUMP-IF-TEMP-STK-FULL-INSTRUCTIONP,
PROPER-P-JUMP-IF-TEMP-STK-EMPTY-INSTRUCTIONP, PROPER-P-POP*-INSTRUCTIONP,
PROPER-P-POP-LOCAL-INSTRUCTIONP, PROPER-P-POP-GLOBAL-INSTRUCTIONP,
PROPER-P-POP-LOCN-INSTRUCTIONP, PROPER-P-JUMP-INSTRUCTIONP,
PROPER-P-JUMP-CASE-INSTRUCTIONP, PROPER-P-PUSHJ-INSTRUCTIONP,
PROPER-P-SET-LOCAL-INSTRUCTIONP, PROPER-P-SET-GLOBAL-INSTRUCTIONP,
PROPER-P-TEST-NAT-AND-JUMP-INSTRUCTIONP,
PROPER-P-TEST-INT-AND-JUMP-INSTRUCTIONP,
PROPER-P-TEST-BOOL-AND-JUMP-INSTRUCTIONP,
PROPER-P-TEST-BITV-AND-JUMP-INSTRUCTIONP, EQUAL,
PROPER-P-NOT-BOOL-INSTRUCTIONP, PROPER-P-PUSH-CTRL-STK-FREE-SIZE-INSTRUCTIONP,
PROPER-P-FETCH-TEMP-STK-INSTRUCTIONP, PROPER-P-NO-OP-INSTRUCTIONP,
PROPER-P-SUB-ADDR-INSTRUCTIONP, PROPER-P-LT-ADDR-INSTRUCTIONP,
PROPER-P-DEPOSIT-INSTRUCTIONP, PROPER-P-ADD-INT-WITH-CARRY-INSTRUCTIONP,
PROPER-P-SUB-INT-INSTRUCTIONP, PROPER-P-SUB1-INT-INSTRUCTIONP,
PROPER-P-LT-INT-INSTRUCTIONP, PROPER-P-ADD-NAT-INSTRUCTIONP,
PROPER-P-ADD1-NAT-INSTRUCTIONP, PROPER-P-SUB-NAT-WITH-CARRY-INSTRUCTIONP,
PROPER-P-LT-NAT-INSTRUCTIONP, PROPER-P-MULT2-NAT-WITH-CARRY-OUT-INSTRUCTIONP,
PROPER-P-OR-BITV-INSTRUCTIONP, PROPER-P-NOT-BITV-INSTRUCTIONP,
PROPER-P-RSH-BITV-INSTRUCTIONP, PROPER-P-OR-BOOL-INSTRUCTIONP,
PROPER-P-AND-BOOL-INSTRUCTIONP, PROPER-P-LSH-BITV-INSTRUCTIONP,
PROPER-P-XOR-BITV-INSTRUCTIONP, PROPER-P-AND-BITV-INSTRUCTIONP,
PROPER-P-DIV2-NAT-INSTRUCTIONP, PROPER-P-MULT2-NAT-INSTRUCTIONP,
PROPER-P-SUB1-NAT-INSTRUCTIONP, PROPER-P-SUB-NAT-INSTRUCTIONP,
PROPER-P-ADD-NAT-WITH-CARRY-INSTRUCTIONP, PROPER-P-INT-TO-NAT-INSTRUCTIONP,
PROPER-P-NEG-INT-INSTRUCTIONP, PROPER-P-SUB-INT-WITH-CARRY-INSTRUCTIONP,
PROPER-P-ADD1-INT-INSTRUCTIONP, PROPER-P-ADD-INT-INSTRUCTIONP,
PROPER-P-FETCH-INSTRUCTIONP, PROPER-P-EQ-INSTRUCTIONP,
PROPER-P-ADD-ADDR-INSTRUCTIONP, PROPER-P-POPJ-INSTRUCTIONP,
PROPER-P-DEPOSIT-TEMP-STK-INSTRUCTIONP, PROPER-P-POP-CALL-INSTRUCTIONP,
PROPER-P-POPN-INSTRUCTIONP, PROPER-P-POP-INSTRUCTIONP,
PROPER-P-PUSH-TEMP-STK-FREE-SIZE-INSTRUCTIONP, and PROPER-P-RET-INSTRUCTIONP,
to:
T.
Q.E.D.
[ 0.0 16.4 0.0 ]
PROPER-P-INSTRUCTIONP-SIMILAR-P-STATES
(PROVE-LEMMA PROPER-LABELED-P-INSTRUCTIONSP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)))
WARNING: Note that PROPER-LABELED-P-INSTRUCTIONSP-LR->P-SIMILAR-STATES
contains the free variable P0 which will be chosen by instantiating the
hypothesis (PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate (P-DATA-SEGMENT P0),
(P-PSW P0), (P-WORD-SIZE P0), (P-MAX-TEMP-STK-SIZE P0),
(P-MAX-CTRL-STK-SIZE P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0),
(P-CTRL-STK P0), and (P-PC P0). We thus obtain the following two new
conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)).
However this simplifies, applying P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate
(P-DATA-SEGMENT P1), (P-PSW P1), (P-WORD-SIZE P1), (P-MAX-TEMP-STK-SIZE P1),
(P-MAX-CTRL-STK-SIZE P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1),
(P-CTRL-STK P1), and (P-PC P1). This produces the following two new goals:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)).
However this further simplifies, applying P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, and opening up the
functions SAME-SIGNATURE and EQUAL, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)),
which we would normally push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us return to:
(IMPLIES (AND (PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)),
named *1. Let us appeal to the induction principle. There are two plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (NLISTP LST)
(p LST NAME P1 P0))
(IMPLIES (AND (NOT (NLISTP LST))
(p (CDR LST) NAME P1 P0))
(p LST NAME P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces three new formulas:
Case 3. (IMPLIES (AND (NLISTP LST)
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)),
which simplifies, opening up the definitions of NLISTP,
PROPER-LABELED-P-INSTRUCTIONSP, EQUAL, and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (PROPER-LABELED-P-INSTRUCTIONSP (CDR LST)
NAME P0))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)),
which simplifies, unfolding NLISTP and PROPER-LABELED-P-INSTRUCTIONSP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(PROPER-LABELED-P-INSTRUCTIONSP (CDR LST)
NAME P1)
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-LABELED-P-INSTRUCTIONSP LST NAME P1)),
which simplifies, applying PROPER-P-INSTRUCTIONP-SIMILAR-P-STATES, and
opening up NLISTP and PROPER-LABELED-P-INSTRUCTIONSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-LABELED-P-INSTRUCTIONSP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1))
((DISABLE FALL-OFF-PROOFP PROPER-P-TEMP-VAR-DCLSP)))
WARNING: Note that PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES contains the
free variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-PROG-SEGMENTP PROGRAMS P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate (P-DATA-SEGMENT P0),
(P-PSW P0), (P-WORD-SIZE P0), (P-MAX-TEMP-STK-SIZE P0),
(P-MAX-CTRL-STK-SIZE P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0),
(P-CTRL-STK P0), and (P-PC P0). We would thus like to prove the following two
new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
But this simplifies, rewriting with P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate
(P-DATA-SEGMENT P1), (P-PSW P1), (P-WORD-SIZE P1), (P-MAX-TEMP-STK-SIZE P1),
(P-MAX-CTRL-STK-SIZE P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1),
(P-CTRL-STK P1), and (P-PC P1). We thus obtain the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
But this further simplifies, applying the lemmas P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, and opening up the
definitions of SAME-SIGNATURE and EQUAL, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP PROGRAMS)
(p PROGRAMS P1 P0))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(p (CDR PROGRAMS) P1 P0))
(p PROGRAMS P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT PROGRAMS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP PROGRAMS)
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
This simplifies, unfolding the definitions of NLISTP, PROPER-P-PROG-SEGMENTP,
EQUAL, and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (PROPER-P-PROG-SEGMENTP (CDR PROGRAMS)
P0))
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
This simplifies, expanding the functions NLISTP, PROPER-P-PROG-SEGMENTP,
PROPER-P-PROGRAM-BODYP, and PROPER-P-PROGRAMP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(PROPER-P-PROG-SEGMENTP (CDR PROGRAMS)
P1)
(PROPER-P-PROG-SEGMENTP PROGRAMS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-PROG-SEGMENTP PROGRAMS P1)).
This simplifies, applying
PROPER-LABELED-P-INSTRUCTIONSP-LR->P-SIMILAR-STATES and
PROPER-P-TEMP-VAR-DCLSP-LR->P-SIMILAR-STATES, and opening up NLISTP,
PROPER-P-PROG-SEGMENTP, PROPER-P-PROGRAM-BODYP, and PROPER-P-PROGRAMP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)))
WARNING: Note that PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES contains the free
variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-TEMP-STKP TEMP-STK P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate (P-DATA-SEGMENT P0),
(P-PSW P0), (P-WORD-SIZE P0), (P-MAX-TEMP-STK-SIZE P0),
(P-MAX-CTRL-STK-SIZE P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0),
(P-CTRL-STK P0), and (P-PC P0). We would thus like to prove the following two
new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
But this simplifies, rewriting with P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate
(P-DATA-SEGMENT P1), (P-PSW P1), (P-WORD-SIZE P1), (P-MAX-TEMP-STK-SIZE P1),
(P-MAX-CTRL-STK-SIZE P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1),
(P-CTRL-STK P1), and (P-PC P1). We thus obtain the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
But this further simplifies, applying the lemmas P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, and opening up the
definitions of SAME-SIGNATURE and EQUAL, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-TEMP-STKP TEMP-STK P0))
(PROPER-P-TEMP-STKP TEMP-STK P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP TEMP-STK)
(p TEMP-STK P1 P0))
(IMPLIES (AND (NOT (NLISTP TEMP-STK))
(p (POP TEMP-STK) P1 P0))
(p TEMP-STK P1 P0))).
Linear arithmetic, the lemma CDR-LESSP, and the definitions of POP and NLISTP
inform us that the measure (COUNT TEMP-STK) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP TEMP-STK)
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
This simplifies, unfolding the definitions of NLISTP, PROPER-P-TEMP-STKP,
EQUAL, and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP TEMP-STK))
(NOT (PROPER-P-TEMP-STKP (POP TEMP-STK)
P0))
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
This simplifies, expanding the functions NLISTP, PROPER-P-TEMP-STKP, and TOP,
to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP TEMP-STK))
(PROPER-P-TEMP-STKP (POP TEMP-STK) P1)
(PROPER-P-TEMP-STKP TEMP-STK P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-TEMP-STKP TEMP-STK P1)).
This simplifies, applying P-OBJECTP-SIMILAR-P-STATES, and opening up NLISTP,
PROPER-P-TEMP-STKP, and TOP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-ALISTP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)))
WARNING: Note that PROPER-P-ALISTP-LR->P-SIMILAR-STATES contains the free
variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-ALISTP BINDINGS P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate (P-DATA-SEGMENT P0),
(P-PSW P0), (P-WORD-SIZE P0), (P-MAX-TEMP-STK-SIZE P0),
(P-MAX-CTRL-STK-SIZE P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0),
(P-CTRL-STK P0), and (P-PC P0). We would thus like to prove the following two
new conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
But this simplifies, rewriting with P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, to:
(IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate
(P-DATA-SEGMENT P1), (P-PSW P1), (P-WORD-SIZE P1), (P-MAX-TEMP-STK-SIZE P1),
(P-MAX-CTRL-STK-SIZE P1), (P-PROG-SEGMENT P1), (P-TEMP-STK P1),
(P-CTRL-STK P1), and (P-PC P1). We thus obtain the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE 0 (P-DATA-SEGMENT P1))
(EQUAL 0 (P-PROG-SEGMENT P1))
(EQUAL 0 (P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
But this further simplifies, applying the lemmas P-DATA-SEGMENT-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP, and opening up the
definitions of SAME-SIGNATURE and EQUAL, to:
(IMPLIES (AND (NOT (P-STATEP P1))
(NOT (P-STATEP P0))
(PROPER-P-ALISTP BINDINGS P0))
(PROPER-P-ALISTP BINDINGS P1)),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)),
which we named *1 above. We will appeal to induction. There are two
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP BINDINGS)
(p BINDINGS P1 P0))
(IMPLIES (AND (NOT (NLISTP BINDINGS))
(p (CDR BINDINGS) P1 P0))
(p BINDINGS P1 P0))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT BINDINGS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (NLISTP BINDINGS)
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
This simplifies, unfolding the definitions of NLISTP, PROPER-P-ALISTP, EQUAL,
and LISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (PROPER-P-ALISTP (CDR BINDINGS) P0))
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
This simplifies, expanding the functions NLISTP and PROPER-P-ALISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(PROPER-P-ALISTP (CDR BINDINGS) P1)
(PROPER-P-ALISTP BINDINGS P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-ALISTP BINDINGS P1)).
This simplifies, applying P-OBJECTP-SIMILAR-P-STATES, and opening up NLISTP
and PROPER-P-ALISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-P-ALISTP-LR->P-SIMILAR-STATES
(PROVE-LEMMA PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES
(REWRITE)
(IMPLIES (AND (PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)))
WARNING: Note that PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES contains the free
variable P0 which will be chosen by instantiating the hypothesis:
(PROPER-P-CTRL-STKP CTRL-STK NAME P0).
.
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P0 by (P-STATE V1 Z1 X1 C X D W V Z) to eliminate (P-DATA-SEGMENT P0),
(P-PSW P0), (P-WORD-SIZE P0), (P-MAX-TEMP-STK-SIZE P0),
(P-MAX-CTRL-STK-SIZE P0), (P-PROG-SEGMENT P0), (P-TEMP-STK P0),
(P-CTRL-STK P0), and (P-PC P0). We thus obtain the following two new
conjectures:
Case 2. (IMPLIES (AND (NOT (P-STATEP P0))
(PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
However this simplifies, applying P-PROG-SEGMENT-NP-STATEP,
P-OBJECTP-TYPE-OPENER, P-DATA-SEGMENT-NP-STATEP, and P-WORD-SIZE-NP-STATEP,
and unfolding the functions PROPER-P-FRAMEP, ASSOC, LISTP, DEFINITION,
LOCAL-VARS, DEFINEDP, ADP-NAME, ADP-OFFSET, PCPP, TOP, PROPER-P-CTRL-STKP,
and EQUAL, to:
T.
Case 1. (IMPLIES (AND (PROPER-P-CTRL-STKP CTRL-STK NAME
(P-STATE V1 Z1 X1 C X D W V Z))
(SAME-SIGNATURE X (P-DATA-SEGMENT P1))
(EQUAL C (P-PROG-SEGMENT P1))
(EQUAL V (P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
This simplifies, trivially, to:
(IMPLIES (AND (PROPER-P-CTRL-STKP CTRL-STK NAME
(P-STATE V1 Z1 X1
(P-PROG-SEGMENT P1)
X D W
(P-WORD-SIZE P1)
Z))
(SAME-SIGNATURE X
(P-DATA-SEGMENT P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
Applying the lemma
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM,
replace P1 by (P-STATE W2 V2 Z2 V X2 C1 D1 W1 C) to eliminate
(P-PROG-SEGMENT P1), (P-PSW P1), (P-WORD-SIZE P1), (P-MAX-TEMP-STK-SIZE P1),
(P-MAX-CTRL-STK-SIZE P1), (P-DATA-SEGMENT P1), (P-TEMP-STK P1),
(P-CTRL-STK P1), and (P-PC P1). We would thus like to prove the following
two new goals:
Case 1.2.
(IMPLIES (AND (NOT (P-STATEP P1))
(PROPER-P-CTRL-STKP CTRL-STK NAME
(P-STATE V1 Z1 X1
(P-PROG-SEGMENT P1)
X D W
(P-WORD-SIZE P1)
Z))
(SAME-SIGNATURE X
(P-DATA-SEGMENT P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
But this further simplifies, rewriting with P-PROG-SEGMENT-NP-STATEP,
P-WORD-SIZE-NP-STATEP, P-PROG-SEGMENT-P-STATE, P-OBJECTP-TYPE-OPENER, and
P-DATA-SEGMENT-NP-STATEP, and unfolding the definitions of PROPER-P-FRAMEP,
ASSOC, LISTP, DEFINITION, LOCAL-VARS, DEFINEDP, ADP-NAME, ADP-OFFSET, PCPP,
TOP, PROPER-P-CTRL-STKP, and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (PROPER-P-CTRL-STKP CTRL-STK NAME
(P-STATE V1 Z1 X1 V X D W W1 Z))
(SAME-SIGNATURE X X2))
(PROPER-P-CTRL-STKP CTRL-STK NAME
(P-STATE W2 V2 Z2 V X2 C1 D1 W1 C))),
which we would usually push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us consider:
(IMPLIES (AND (PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are two plausible inductions. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP CTRL-STK)
(p CTRL-STK NAME P1 P0))
(IMPLIES (AND (NOT (NLISTP CTRL-STK))
(p (POP CTRL-STK)
(AREA-NAME (RET-PC (TOP CTRL-STK)))
P1 P0))
(p CTRL-STK NAME P1 P0))).
Linear arithmetic, the lemma CDR-LESSP, and the definitions of POP and NLISTP
inform us that the measure (COUNT CTRL-STK) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for NAME. The above induction scheme
produces the following three new goals:
Case 3. (IMPLIES (AND (NLISTP CTRL-STK)
(PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
This simplifies, unfolding the definitions of NLISTP, PROPER-P-CTRL-STKP,
EQUAL, and LISTP, to:
T.
Case 2. (IMPLIES
(AND (NOT (NLISTP CTRL-STK))
(NOT (PROPER-P-CTRL-STKP (POP CTRL-STK)
(AREA-NAME (RET-PC (TOP CTRL-STK)))
P0))
(PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
This simplifies, rewriting with the lemma P-OBJECTP-TYPE-OPENER, and
unfolding the definitions of NLISTP, PROPER-P-CTRL-STKP, TOP, PCPP,
ADP-OFFSET, ADP-NAME, LOCAL-VARS, DEFINITION, and PROPER-P-FRAMEP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP CTRL-STK))
(PROPER-P-CTRL-STKP (POP CTRL-STK)
(AREA-NAME (RET-PC (TOP CTRL-STK)))
P1)
(PROPER-P-CTRL-STKP CTRL-STK NAME P0)
(SAME-SIGNATURE (P-DATA-SEGMENT P0)
(P-DATA-SEGMENT P1))
(EQUAL (P-PROG-SEGMENT P0)
(P-PROG-SEGMENT P1))
(EQUAL (P-WORD-SIZE P0)
(P-WORD-SIZE P1)))
(PROPER-P-CTRL-STKP CTRL-STK NAME P1)).
This simplifies, applying P-OBJECTP-TYPE-OPENER and
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, and opening up the functions NLISTP,
PROPER-P-CTRL-STKP, TOP, PCPP, ADP-OFFSET, ADP-NAME, LOCAL-VARS, DEFINITION,
PROPER-P-FRAMEP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES
(DEFN P-GOOD-RESULTP
(P DATA-SEG TEMP-STK CTRL-STK PC)
(IF (NOT (EQUAL (P-PSW P) 'RUN))
T
(AND (EQUAL (P-DATA-SEGMENT P) DATA-SEG)
(EQUAL (P-TEMP-STK P) TEMP-STK)
(LISTP CTRL-STK)
(EQUAL (P-CTRL-STK P) CTRL-STK)
(EQUAL (P-PC P) PC))))
Note that:
(OR (FALSEP (P-GOOD-RESULTP P DATA-SEG TEMP-STK CTRL-STK PC))
(TRUEP (P-GOOD-RESULTP P DATA-SEG TEMP-STK CTRL-STK PC)))
is a theorem.
[ 0.0 0.0 0.0 ]
P-GOOD-RESULTP
(PROVE-LEMMA ASSOC-APPEND-1
(REWRITE)
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(IF (DEFINEDP X LIST1)
(ASSOC X LIST1)
(ASSOC X LIST2))))
This conjecture simplifies, obviously, to the following two new conjectures:
Case 2. (IMPLIES (NOT (DEFINEDP X LIST1))
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(ASSOC X LIST2))).
Give the above formula the name *1.
Case 1. (IMPLIES (DEFINEDP X LIST1)
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(ASSOC X LIST1))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(IF (DEFINEDP X LIST1)
(ASSOC X LIST1)
(ASSOC X LIST2))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest four inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (AND (LISTP LIST1)
(p X (CDR LIST1) LIST2))
(p X LIST1 LIST2))
(IMPLIES (NOT (LISTP LIST1))
(p X LIST1 LIST2))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT LIST1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme leads to the
following two new conjectures:
Case 2. (IMPLIES (AND (LISTP LIST1)
(EQUAL (ASSOC X (APPEND (CDR LIST1) LIST2))
(IF (DEFINEDP X (CDR LIST1))
(ASSOC X (CDR LIST1))
(ASSOC X LIST2))))
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(IF (DEFINEDP X LIST1)
(ASSOC X LIST1)
(ASSOC X LIST2)))).
This simplifies, applying CDR-CONS and CAR-CONS, and expanding the functions
APPEND, ASSOC, and DEFINEDP, to:
T.
Case 1. (IMPLIES (NOT (LISTP LIST1))
(EQUAL (ASSOC X (APPEND LIST1 LIST2))
(IF (DEFINEDP X LIST1)
(ASSOC X LIST1)
(ASSOC X LIST2)))),
which simplifies, rewriting with APPEND-LEFT-ID, and expanding DEFINEDP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
ASSOC-APPEND-1
(DISABLE ASSOC-APPEND-1)
[ 0.0 0.0 0.0 ]
ASSOC-APPEND-1-OFF
(PROVE-LEMMA LR-PROGRAMS-PROPERP-1-ALL-USER-FNAMESP-NOT-USER-FNAMEP
(REWRITE)
(IMPLIES (AND (ALL-USER-FNAMESP (STRIP-CARS PROGRAMS))
(NOT (USER-FNAMEP X)))
(NOT (DEFINEDP X PROGRAMS))))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP PROGRAMS)
(p X PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL X (CAAR PROGRAMS)))
(p X PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL X (CAAR PROGRAMS)))
(p X (CDR PROGRAMS)))
(p X PROGRAMS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT PROGRAMS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following four new conjectures:
Case 4. (IMPLIES (AND (NLISTP PROGRAMS)
(ALL-USER-FNAMESP (STRIP-CARS PROGRAMS))
(NOT (USER-FNAMEP X)))
(NOT (DEFINEDP X PROGRAMS))).
This simplifies, opening up NLISTP, STRIP-CARS, ALL-USER-FNAMESP, and
DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL X (CAAR PROGRAMS))
(ALL-USER-FNAMESP (STRIP-CARS PROGRAMS))
(NOT (USER-FNAMEP X)))
(NOT (DEFINEDP X PROGRAMS))).
This simplifies, rewriting with CAR-CONS, and expanding the functions NLISTP,
STRIP-CARS, and ALL-USER-FNAMESP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL X (CAAR PROGRAMS)))
(NOT (ALL-USER-FNAMESP (STRIP-CARS (CDR PROGRAMS))))
(ALL-USER-FNAMESP (STRIP-CARS PROGRAMS))
(NOT (USER-FNAMEP X)))
(NOT (DEFINEDP X PROGRAMS))),
which simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding NLISTP,
STRIP-CARS, and ALL-USER-FNAMESP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL X (CAAR PROGRAMS)))
(NOT (DEFINEDP X (CDR PROGRAMS)))
(ALL-USER-FNAMESP (STRIP-CARS PROGRAMS))
(NOT (USER-FNAMEP X)))
(NOT (DEFINEDP X PROGRAMS))).
This simplifies, applying CDR-CONS and CAR-CONS, and expanding NLISTP,
STRIP-CARS, ALL-USER-FNAMESP, and DEFINEDP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-1-ALL-USER-FNAMESP-NOT-USER-FNAMEP
(PROVE-LEMMA DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP
(REWRITE)
(IMPLIES (LR-PROGRAMS-PROPERP L TABLE)
(AND (EQUAL (ASSOC 'CAR
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-CAR-CODE))
(EQUAL (ASSOC 'CDR
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-CDR-CODE))
(EQUAL (ASSOC 'CONS
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-CONS-CODE))
(EQUAL (ASSOC 'FALSE
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-FALSE-CODE))
(EQUAL (ASSOC 'FALSEP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-FALSEP-CODE))
(EQUAL (ASSOC 'LISTP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-LISTP-CODE))
(EQUAL (ASSOC 'NLISTP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-NLISTP-CODE))
(EQUAL (ASSOC 'TRUE
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-TRUE-CODE))
(EQUAL (ASSOC 'TRUEP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(P-TRUEP-CODE))))
((ENABLE COMP-PROGRAMS NAME LR-PROGRAMS-PROPERP ASSOC-APPEND-1)
(DISABLE COMP-PROGRAMS-1)))
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that the proposed lemma DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP
is to be stored as zero type prescription rules, zero compound recognizer
rules, zero linear rules, and nine replacement rules.
This formula can be simplified, using the abbreviations LR-PROGRAMS-PROPERP,
IMPLIES, LR-TRUE-TAG, P-TRUEP-CODE, P-TRUE-CODE, P-NLISTP-CODE,
P-RECOGNIZER-CODE, P-LISTP-CODE, P-FALSEP-CODE, P-FALSE-CODE,
LR-REF-COUNT-OFFSET, P-CONS-CODE, LR-CDR-OFFSET, P-CDR-CODE, LR-CAR-OFFSET,
LR-NODE-SIZE, LR-UNDEF-ADDR, LR-F-ADDR, LR-T-ADDR, LR-0-ADDR, LR-CONS-TAG,
P-ACCESSOR-CODE, and P-CAR-CODE, to the new goal:
(IMPLIES
(AND
(DEFINEDP (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (CDR (STRIP-CARS (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE))
(AND
(EQUAL
(ASSOC 'CAR
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'CAR
(CONS
'(X)
(CONS NIL
(CONS
'(PUSH-LOCAL X)
(CONS
'(FETCH)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 5))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP T ARG1)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4)
4))
(CONS '(RET)
(CONS '(DL ARG1 NIL (PUSH-LOCAL X))
(CONS (LIST 'PUSH-CONSTANT (TAG 'NAT 2))
'((ADD-ADDR)
(FETCH)
(RET)))))))))))))))
(EQUAL
(ASSOC 'CDR
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'CDR
(CONS
'(X)
(CONS NIL
(CONS
'(PUSH-LOCAL X)
(CONS
'(FETCH)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 5))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP T ARG1)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4)
4))
(CONS '(RET)
(CONS '(DL ARG1 NIL (PUSH-LOCAL X))
(CONS (LIST 'PUSH-CONSTANT (TAG 'NAT 3))
'((ADD-ADDR)
(FETCH)
(RET)))))))))))))))
(EQUAL
(ASSOC 'CONS
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'CONS
(CONS NIL
(CONS
'((TEMP (NAT 0)))
(CONS
'(PUSH-GLOBAL FREE-PTR)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 3))
(CONS
'(ADD-ADDR)
(CONS
'(DEPOSIT)
(CONS
'(PUSH-GLOBAL FREE-PTR)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 2))
(CONS
'(ADD-ADDR)
(CONS
'(DEPOSIT)
(CONS
'(PUSH-GLOBAL FREE-PTR)
(CONS
'(PUSH-GLOBAL FREE-PTR)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 1))
(CONS
'(ADD-ADDR)
(CONS
'(SET-LOCAL TEMP)
(CONS
'(FETCH)
(CONS
'(PUSH-CONSTANT (NAT 1))
(CONS
'(PUSH-LOCAL TEMP)
(CONS '(DEPOSIT)
(CONS (LIST 'PUSH-CONSTANT (TAG 'NAT 5))
'((PUSH-GLOBAL FREE-PTR)
(DEPOSIT)
(POP-GLOBAL FREE-PTR)
(RET))))))))))))))))))))))))
(EQUAL
(ASSOC 'FALSE
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'FALSE
(CONS NIL
(CONS NIL
(CONS (LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
'((RET)))))))
(EQUAL
(ASSOC 'FALSEP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'FALSEP
(CONS NIL
(CONS NIL
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP T TRUE)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(CONS
'(RET)
(CONS
(LIST 'DL
'TRUE
NIL
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4)))
'((RET))))))))))))
(EQUAL
(ASSOC 'LISTP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'LISTP
(CONS NIL
(CONS NIL
(CONS
'(FETCH)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 5))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP F FALSE)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4))
(CONS '(RET)
(CONS (LIST 'DL
'FALSE
NIL
(LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
'((RET)))))))))))))
(EQUAL
(ASSOC 'NLISTP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'NLISTP
(CONS NIL
(CONS NIL
(CONS
'(FETCH)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 5))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP F TRUE)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4))
(CONS
'(RET)
(CONS
(LIST 'DL
'TRUE
NIL
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4)))
'((RET)))))))))))))
(EQUAL
(ASSOC 'TRUE
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'TRUE
(CONS NIL
(CONS NIL
(CONS (LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4))
'((RET)))))))
(EQUAL
(ASSOC 'TRUEP
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(CONS 'TRUEP
(CONS NIL
(CONS NIL
(CONS
'(FETCH)
(CONS
(LIST 'PUSH-CONSTANT (TAG 'NAT 3))
(CONS
'(EQ)
(CONS
'(TEST-BOOL-AND-JUMP F FALSE)
(CONS
(LIST 'PUSH-CONSTANT
(ADD-ADDR (ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)
4))
(CONS '(RET)
(CONS (LIST 'DL
'FALSE
NIL
(LIST 'PUSH-CONSTANT
(ADD-ADDR (TAG 'ADDR '(HEAP . 0))
4)))
'((RET))))))))))))))),
which simplifies, appealing to the lemmas CDR-CONS, CAR-CONS,
LR-PROGRAMS-PROPERP-1-ALL-USER-FNAMESP-NOT-USER-FNAMEP,
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG, and ASSOC-APPEND-1, and expanding the
functions DEFINEDP, STRIP-CARS, P-RUNTIME-SUPPORT-PROGRAMS, LR-MAKE-PROGRAM,
CONS, AREA-NAME, LR-ANSWER-ADDR, NAME, COMP-PROGRAMS, EQUAL, ASSOC,
USER-FNAMEP, TAG, ADD-ADDR, and AND, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP
(DISABLE LR-PROGRAMS-PROPERP-1-ALL-USER-FNAMESP-NOT-USER-FNAMEP)
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-1-ALL-USER-FNAMESP-NOT-USER-FNAMEP-OFF
(DISABLE DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP)
[ 0.0 0.0 0.0 ]
DEFINITIONS-SUBRPS-LR-PROGRAMS-PROPERP-OFF
(PROVE-LEMMA P-GOOD-RESULTP-P-STATE-OPENER
(REWRITE)
(EQUAL (P-GOOD-RESULTP (P-STATE PC CTRL-STK TEMP-STK PROG-SEG
DATA-SEG MAX-CTRL-STK-SIZE
MAX-TEMP-STK-SIZE WORD-SIZE
'RUN)
RESULT-DATA-SEG RESULT-TEMP-STK
RESULT-CTRL-STK RESULT-PC)
(AND (EQUAL DATA-SEG RESULT-DATA-SEG)
(EQUAL TEMP-STK RESULT-TEMP-STK)
(LISTP RESULT-CTRL-STK)
(EQUAL CTRL-STK RESULT-CTRL-STK)
(EQUAL PC RESULT-PC))))
WARNING: Note that the rewrite rule P-GOOD-RESULTP-P-STATE-OPENER will be
stored so as to apply only to terms with the nonrecursive function symbol
P-GOOD-RESULTP.
This conjecture simplifies, rewriting with P-PC-P-STATE, P-CTRL-STK-P-STATE,
P-TEMP-STK-P-STATE, P-DATA-SEGMENT-P-STATE, and P-PSW-P-STATE, and opening up
EQUAL, P-GOOD-RESULTP, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-GOOD-RESULTP-P-STATE-OPENER
(PROVE-LEMMA P-GOOD-RESULTP-P-HALT-ERRORP-OPENER
(REWRITE)
(IMPLIES (NOT (EQUAL PSW 'RUN))
(P-GOOD-RESULTP (P-HALT P PSW)
DATA-SEG TEMP-STK CTRL-STK PC)))
WARNING: Note that the rewrite rule P-GOOD-RESULTP-P-HALT-ERRORP-OPENER will
be stored so as to apply only to terms with the nonrecursive function symbol
P-GOOD-RESULTP.
This formula can be simplified, using the abbreviations P-ACCESSORS-P-HALT,
P-GOOD-RESULTP, NOT, and IMPLIES, to:
T,
which simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-GOOD-RESULTP-P-HALT-ERRORP-OPENER
(DISABLE P-GOOD-RESULTP)
[ 0.0 0.0 0.0 ]
P-GOOD-RESULTP-OFF
(PROVE-LEMMA ALL-P-OBJECTPS-BAD-TYPE
(REWRITE)
(IMPLIES (AND (NOT (EQUAL (GET OFFSET LST)
(LIST (TYPE (GET OFFSET LST))
(UNTAG (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P)))
((ENABLE GET P-OBJECTP TYPE UNTAG)
(DISABLE BOOLEANP BIT-VECTORP PCPP SMALL-INTEGERP
SMALL-NATURALP *1*P-RUNTIME-SUPPORT-PROGRAMS
P-OBJECTP-OPENER)))
WARNING: Note that ALL-P-OBJECTPS-BAD-TYPE contains the free variable OFFSET
which will be chosen by instantiating the hypothesis:
(NOT (EQUAL (GET OFFSET LST)
(LIST (TYPE (GET OFFSET LST))
(UNTAG (GET OFFSET LST))))).
This formula can be simplified, using the abbreviations NOT, AND, IMPLIES,
UNTAG, and TYPE, to:
(IMPLIES (AND (NOT (EQUAL (GET OFFSET LST)
(LIST (CAR (GET OFFSET LST))
(CADR (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P))),
which we will name *1.
We will appeal to induction. There are six plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP OFFSET)
(p LST P OFFSET))
(IMPLIES (AND (NOT (ZEROP OFFSET))
(p (CDR LST) P (SUB1 OFFSET)))
(p LST P OFFSET))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT OFFSET) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for LST. The above induction scheme
produces four new conjectures:
Case 4. (IMPLIES (AND (ZEROP OFFSET)
(NOT (EQUAL (GET OFFSET LST)
(LIST (CAR (GET OFFSET LST))
(CADR (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P))),
which simplifies, applying GET-ZEROP, and unfolding ZEROP, NUMBERP, LENGTH,
EQUAL, LESSP, ALL-P-OBJECTPS, UNTAG, TYPE, and P-OBJECTP, to the following
seven new formulas:
Case 4.7.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'NAT)
(SMALL-NATURALP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
This again simplifies, rewriting with CAR-CONS and CDR-CONS, and unfolding
the definition of EQUAL, to:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'NAT (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'NAT)
(SMALL-NATURALP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Applying the lemma CAR-CDR-ELIM, replace LST by (CONS X Z) to eliminate
(CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X) and (CAR X),
and V by (CONS X D) to eliminate (CAR V) and (CDR V). We would thus like
to prove the following two new goals:
Case 4.7.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'NAT (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'NAT)
(SMALL-NATURALP (CAR V)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))).
However this further simplifies, applying CAR-NLISTP, CAR-CONS, CDR-CONS,
and CDR-NLISTP, and unfolding CONS, CAR, EQUAL, and CDR, to:
T.
Case 4.7.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'NAT X)))
(EQUAL D NIL)
(EQUAL W 'NAT)
(SMALL-NATURALP X (P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, clearly, to:
T.
Case 4.6.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(EQUAL (CAAR LST) 'BITV)
(BIT-VECTORP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
But this again simplifies, applying the lemmas CAR-CONS and CDR-CONS, and
opening up EQUAL, to the conjecture:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'BITV (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'BITV)
(BIT-VECTORP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Appealing to the lemma CAR-CDR-ELIM, we now replace LST by (CONS X Z) to
eliminate (CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X)
and (CAR X), and V by (CONS X D) to eliminate (CAR V) and (CDR V). This
generates two new goals:
Case 4.6.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'BITV (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'BITV)
(BIT-VECTORP (CAR V) (P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))),
which further simplifies, appealing to the lemmas CAR-NLISTP, CAR-CONS,
CDR-CONS, and CDR-NLISTP, and opening up CONS, CAR, EQUAL, and CDR, to:
T.
Case 4.6.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'BITV X)))
(EQUAL D NIL)
(EQUAL W 'BITV)
(BIT-VECTORP X (P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))),
which further simplifies, obviously, to:
T.
Case 4.5.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(EQUAL (CAAR LST) 'ADDR)
(ADPP (CADAR LST) (P-DATA-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
This again simplifies, rewriting with CAR-CONS and CDR-CONS, and opening
up the definition of EQUAL, to:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'ADDR (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'ADDR)
(ADPP (CADAR LST) (P-DATA-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Applying the lemma CAR-CDR-ELIM, replace LST by (CONS X Z) to eliminate
(CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X) and (CAR X),
and V by (CONS X D) to eliminate (CAR V) and (CDR V). We would thus like
to prove the following two new conjectures:
Case 4.5.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'ADDR (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'ADDR)
(ADPP (CAR V) (P-DATA-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, applying CAR-NLISTP, CAR-CONS, CDR-CONS, and
CDR-NLISTP, and opening up the functions CONS, CAR, EQUAL, and CDR, to:
T.
Case 4.5.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'ADDR X)))
(EQUAL D NIL)
(EQUAL W 'ADDR)
(ADPP X (P-DATA-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, trivially, to:
T.
Case 4.4.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(NOT (EQUAL (CAAR LST) 'ADDR))
(NOT (EQUAL (CAAR LST) 'PC))
(EQUAL (CAAR LST) 'SUBR)
(DEFINEDP (CADAR LST)
(P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
This again simplifies, appealing to the lemmas CAR-CONS and CDR-CONS, and
unfolding the function EQUAL, to the conjecture:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'SUBR (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'SUBR)
(DEFINEDP (CADAR LST)
(P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Appealing to the lemma CAR-CDR-ELIM, we now replace LST by (CONS X Z) to
eliminate (CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X)
and (CAR X), and V by (CONS X D) to eliminate (CAR V) and (CDR V). This
generates two new formulas:
Case 4.4.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'SUBR (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'SUBR)
(DEFINEDP (CAR V) (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))),
which further simplifies, rewriting with CAR-NLISTP, CAR-CONS, CDR-CONS,
and CDR-NLISTP, and opening up CONS, CAR, EQUAL, and CDR, to:
T.
Case 4.4.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'SUBR X)))
(EQUAL D NIL)
(EQUAL W 'SUBR)
(DEFINEDP X (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, trivially, to:
T.
Case 4.3.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(NOT (EQUAL (CAAR LST) 'ADDR))
(EQUAL (CAAR LST) 'PC)
(PCPP (CADAR LST) (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
However this again simplifies, applying CAR-CONS and CDR-CONS, and
unfolding the definition of EQUAL, to:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'PC (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'PC)
(PCPP (CADAR LST) (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Applying the lemma CAR-CDR-ELIM, replace LST by (CONS X Z) to eliminate
(CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X) and (CAR X),
and V by (CONS X D) to eliminate (CAR V) and (CDR V). We thus obtain the
following two new formulas:
Case 4.3.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'PC (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'PC)
(PCPP (CAR V) (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, rewriting with the lemmas CAR-NLISTP, CAR-CONS,
CDR-CONS, and CDR-NLISTP, and expanding the definitions of CONS, CAR,
EQUAL, and CDR, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'PC X)))
(EQUAL D NIL)
(EQUAL W 'PC)
(PCPP X (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS Z P))),
which further simplifies, clearly, to:
T.
Case 4.2.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(EQUAL (CAAR LST) 'BOOL)
(BOOLEANP (CADAR LST)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
But this again simplifies, rewriting with CAR-CONS and CDR-CONS, and
expanding the function EQUAL, to:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'BOOL (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'BOOL)
(BOOLEANP (CADAR LST)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Applying the lemma CAR-CDR-ELIM, replace LST by (CONS X Z) to eliminate
(CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X) and (CAR X),
and V by (CONS X D) to eliminate (CAR V) and (CDR V). We would thus like
to prove the following two new goals:
Case 4.2.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'BOOL (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'BOOL)
(BOOLEANP (CAR V)))
(NOT (ALL-P-OBJECTPS Z P))).
But this further simplifies, rewriting with CAR-NLISTP, CAR-CONS,
CDR-CONS, and CDR-NLISTP, and unfolding the definitions of CONS, CAR,
EQUAL, and CDR, to:
T.
Case 4.2.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'BOOL X)))
(EQUAL D NIL)
(EQUAL W 'BOOL)
(BOOLEANP X))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, obviously, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL OFFSET 0)
(NOT (EQUAL (CAR LST)
(LIST (CAAR LST) (CADAR LST))))
(LISTP LST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LST))) 0))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(EQUAL (CAAR LST) 'INT)
(SMALL-INTEGERP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
But this again simplifies, applying the lemmas CAR-CONS and CDR-CONS, and
opening up the definition of EQUAL, to:
(IMPLIES (AND (NOT (EQUAL (CAR LST)
(LIST 'INT (CADAR LST))))
(LISTP LST)
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'INT)
(SMALL-INTEGERP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))).
Appealing to the lemma CAR-CDR-ELIM, we now replace LST by (CONS X Z) to
eliminate (CAR LST) and (CDR LST), X by (CONS W V) to eliminate (CDR X)
and (CAR X), and V by (CONS X D) to eliminate (CAR V) and (CDR V). The
result is two new goals:
Case 4.1.2.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (CONS W V)
(LIST 'INT (CAR V))))
(EQUAL (CDR V) NIL)
(EQUAL W 'INT)
(SMALL-INTEGERP (CAR V)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))),
which further simplifies, applying CAR-NLISTP, CAR-CONS, CDR-CONS, and
CDR-NLISTP, and unfolding CONS, CAR, EQUAL, and CDR, to:
T.
Case 4.1.1.
(IMPLIES (AND (NOT (EQUAL (CONS W (CONS X D))
(LIST 'INT X)))
(EQUAL D NIL)
(EQUAL W 'INT)
(SMALL-INTEGERP X (P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS Z P))).
This further simplifies, clearly, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP OFFSET))
(EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST)))))
(NOT (EQUAL (GET OFFSET LST)
(LIST (CAR (GET OFFSET LST))
(CADR (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P))).
This simplifies, opening up the definitions of ZEROP and GET, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP OFFSET))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET OFFSET LST)
(LIST (CAR (GET OFFSET LST))
(CADR (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P))).
This simplifies, expanding the functions ZEROP, GET, LENGTH, ALL-P-OBJECTPS,
UNTAG, TYPE, and P-OBJECTP, to the following eight new formulas:
Case 2.8.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(NOT (LISTP LST))
(LESSP OFFSET 0))
(NOT (EQUAL LST NIL))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(EQUAL (CAAR LST) 'NAT)
(SMALL-NATURALP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.6.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(EQUAL (CAAR LST) 'BITV)
(BIT-VECTORP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(EQUAL (CAAR LST) 'ADDR)
(ADPP (CADAR LST) (P-DATA-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.4.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(NOT (EQUAL (CAAR LST) 'ADDR))
(NOT (EQUAL (CAAR LST) 'PC))
(EQUAL (CAAR LST) 'SUBR)
(DEFINEDP (CADAR LST)
(P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(NOT (EQUAL (CAAR LST) 'BOOL))
(NOT (EQUAL (CAAR LST) 'ADDR))
(EQUAL (CAAR LST) 'PC)
(PCPP (CADAR LST) (P-PROG-SEGMENT P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(NOT (EQUAL (CAAR LST) 'INT))
(NOT (EQUAL (CAAR LST) 'BITV))
(EQUAL (CAAR LST) 'BOOL)
(BOOLEANP (CADAR LST)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES
(AND (NOT (EQUAL OFFSET 0))
(NOT (LESSP (SUB1 OFFSET)
(LENGTH (CDR LST))))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(LISTP LST)
(LESSP OFFSET
(ADD1 (LENGTH (CDR LST))))
(LISTP (CAR LST))
(EQUAL (CDDAR LST) NIL)
(NOT (EQUAL (CAAR LST) 'NAT))
(EQUAL (CAAR LST) 'INT)
(SMALL-INTEGERP (CADAR LST)
(P-WORD-SIZE P)))
(NOT (ALL-P-OBJECTPS (CDR LST) P))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP OFFSET))
(NOT (ALL-P-OBJECTPS (CDR LST) P))
(NOT (EQUAL (GET OFFSET LST)
(LIST (CAR (GET OFFSET LST))
(CADR (GET OFFSET LST)))))
(NUMBERP OFFSET)
(LESSP OFFSET (LENGTH LST)))
(NOT (ALL-P-OBJECTPS LST P))),
which simplifies, expanding the functions ZEROP, GET, LENGTH, ALL-P-OBJECTPS,
UNTAG, TYPE, and P-OBJECTP, to:
(IMPLIES (AND (NOT (EQUAL OFFSET 0))
(NOT (ALL-P-OBJECTPS (CDR LST) P))
(NOT (EQUAL (GET (SUB1 OFFSET) (CDR LST))
(LIST (CAR (GET (SUB1 OFFSET) (CDR LST)))
(CADR (GET (SUB1 OFFSET) (CDR LST))))))
(NUMBERP OFFSET)
(NOT (LISTP LST))
(LESSP OFFSET 0))
(NOT (EQUAL LST NIL))).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.1 ]
ALL-P-OBJECTPS-BAD-TYPE
(PROVE-LEMMA PROPER-P-DATA-SEGMENTP-BAD-TYPE NIL
(IMPLIES (AND (NOT (EQUAL (FETCH ADDR DATA-SEG)
(LIST (TYPE (FETCH ADDR DATA-SEG))
(UNTAG (FETCH ADDR DATA-SEG)))))
(ADPP (UNTAG ADDR) DATA-SEG))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P)))
((ENABLE ADPP FETCH DEFINEDP-ASSOC-FACT-1 GET-ANYTHING-NIL)))
This conjecture can be simplified, using the abbreviations DEFINITION, VALUE,
ADP-NAME, ADP-OFFSET, ADPP, NOT, AND, IMPLIES, and FETCH, to:
(IMPLIES
(AND (NOT (EQUAL (FETCH-ADP (UNTAG ADDR) DATA-SEG)
(LIST (TYPE (FETCH-ADP (UNTAG ADDR) DATA-SEG))
(UNTAG (FETCH-ADP (UNTAG ADDR) DATA-SEG)))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, unfolding the definitions of VALUE, DEFINITION, ADP-NAME,
ADP-OFFSET, and FETCH-ADP, to the new conjecture:
(IMPLIES
(AND
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))),
which we will name *1.
We will appeal to induction. Six inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (NLISTP DATA-SEG)
(p DATA-SEG P ADDR))
(IMPLIES (AND (NOT (NLISTP DATA-SEG))
(EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(p DATA-SEG P ADDR))
(IMPLIES (AND (NOT (NLISTP DATA-SEG))
(NOT (EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(p (CDR DATA-SEG) P ADDR))
(p DATA-SEG P ADDR))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT DATA-SEG) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following six new conjectures:
Case 6. (IMPLIES
(AND
(NLISTP DATA-SEG)
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, rewriting with the lemma GET-ANYTHING-NIL, and expanding
the definitions of NLISTP, ASSOC, CDR, TYPE, UNTAG, CONS, EQUAL, and
DEFINEDP, to:
T.
Case 5. (IMPLIES
(AND
(NOT (NLISTP DATA-SEG))
(EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG))
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, appealing to the lemma ALL-P-OBJECTPS-BAD-TYPE, and
unfolding NLISTP, ASSOC, DEFINEDP, PROPER-P-DATA-SEGMENTP, and PROPER-P-AREA,
to:
T.
Case 4. (IMPLIES
(AND
(NOT (NLISTP DATA-SEG))
(NOT (EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
(CDR DATA-SEG))))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
(CDR DATA-SEG)))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
(CDR DATA-SEG)))))))
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, expanding NLISTP and ASSOC, to:
T.
Case 3. (IMPLIES
(AND
(NOT (NLISTP DATA-SEG))
(NOT (EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(NOT (DEFINEDP (CAR (UNTAG ADDR))
(CDR DATA-SEG)))
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, opening up the functions NLISTP, ASSOC, and DEFINEDP, to:
T.
Case 2. (IMPLIES
(AND
(NOT (NLISTP DATA-SEG))
(NOT (EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(NOT (LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
(CDR DATA-SEG))))))
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, expanding the functions NLISTP, ASSOC, and DEFINEDP, to:
T.
Case 1. (IMPLIES
(AND
(NOT (NLISTP DATA-SEG))
(NOT (EQUAL (CAR (UNTAG ADDR))
(CAAR DATA-SEG)))
(NOT (PROPER-P-DATA-SEGMENTP (CDR DATA-SEG)
P))
(NOT
(EQUAL (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG)))
(LIST (TYPE (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR)) DATA-SEG))))
(UNTAG (GET (CDR (UNTAG ADDR))
(CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))))
(LISTP (UNTAG ADDR))
(NUMBERP (CDR (UNTAG ADDR)))
(DEFINEDP (CAR (UNTAG ADDR)) DATA-SEG)
(LESSP (CDR (UNTAG ADDR))
(LENGTH (CDR (ASSOC (CAR (UNTAG ADDR))
DATA-SEG)))))
(NOT (PROPER-P-DATA-SEGMENTP DATA-SEG P))).
This simplifies, opening up the functions NLISTP, ASSOC, DEFINEDP,
PROPER-P-DATA-SEGMENTP, and PROPER-P-AREA, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.4 ]
PROPER-P-DATA-SEGMENTP-BAD-TYPE
(PROVE-LEMMA P-CURRENT-PROGRAM-P-STATE
(REWRITE)
(EQUAL (P-CURRENT-PROGRAM (P-STATE PC CTRL-STK TEMP-STK PROG-SEG
DATA-SEG MAX-CTRL-STK-SIZE
MAX-TEMP-STK-SIZE WORD-SIZE
PSW))
(ASSOC (AREA-NAME PC) PROG-SEG))
((ENABLE P-CURRENT-PROGRAM)))
This formula simplifies, applying P-PROG-SEGMENT-P-STATE and P-PC-P-STATE, and
unfolding DEFINITION and P-CURRENT-PROGRAM, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-CURRENT-PROGRAM-P-STATE
(PROVE-LEMMA P-CURRENT-INSTRUCTION-OPENER
(REWRITE)
(EQUAL (P-CURRENT-INSTRUCTION (P-STATE PC TEMP-STK CTRL-STK
PROG-SEGMENT DATA-SEGMENT
MAX-CTRL-STK-SIZE
MAX-TEMP-STK-SIZE
WORD-SIZE PSW))
(UNLABEL (GET (OFFSET PC)
(PROGRAM-BODY (ASSOC (AREA-NAME PC)
PROG-SEGMENT)))))
((ENABLE P-CURRENT-INSTRUCTION P-CURRENT-PROGRAM)))
This simplifies, rewriting with P-CURRENT-PROGRAM-P-STATE and P-PC-P-STATE,
and expanding the function P-CURRENT-INSTRUCTION, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
P-CURRENT-INSTRUCTION-OPENER
(DISABLE P-CURRENT-INSTRUCTION-OPENER)
[ 0.0 0.0 0.0 ]
P-CURRENT-INSTRUCTION-OPENER-OFF
(PROVE-LEMMA FETCH-DEPOSIT
(REWRITE)
(IMPLIES (AND (NUMBERP (OFFSET ADDR1))
(NUMBERP (OFFSET ADDR2)))
(EQUAL (FETCH ADDR1
(DEPOSIT VALUE ADDR2 DATA-SEG))
(IF (DEFINEDP (AREA-NAME ADDR2) DATA-SEG)
(IF (EQUAL (AREA-NAME ADDR1)
(AREA-NAME ADDR2))
(IF (EQUAL (OFFSET ADDR1) (OFFSET ADDR2))
VALUE
(FETCH ADDR1 DATA-SEG))
(FETCH ADDR1 DATA-SEG))
(FETCH ADDR1 DATA-SEG))))
((ENABLE ADPP AREA-NAME DEPOSIT FETCH OFFSET TYPE UNTAG
ASSOC-PUT-ASSOC-3 DEFINEDP-ASSOC-FACT-1
GET-ANYTHING-NIL MY-GET-PUT)))
This conjecture can be simplified, using the abbreviations AND, IMPLIES,
ADP-NAME, AREA-NAME, DEPOSIT, FETCH, UNTAG, ADP-OFFSET, and OFFSET, to:
(IMPLIES (AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2)))
(EQUAL (FETCH-ADP (CADR ADDR1)
(DEPOSIT-ADP VALUE
(CADR ADDR2)
DATA-SEG))
(IF (DEFINEDP (CAADR ADDR2) DATA-SEG)
(IF (EQUAL (CAADR ADDR1) (CAADR ADDR2))
(IF (EQUAL (CDADR ADDR1) (CDADR ADDR2))
VALUE
(FETCH-ADP (CADR ADDR1) DATA-SEG))
(FETCH-ADP (CADR ADDR1) DATA-SEG))
(FETCH-ADP (CADR ADDR1) DATA-SEG)))).
This simplifies, applying the lemma ASSOC-PUT-ASSOC-3, and expanding the
definitions of PUT-VALUE, VALUE, DEFINITION, ADP-NAME, ADP-OFFSET, DEPOSIT-ADP,
and FETCH-ADP, to the following six new goals:
Case 6. (IMPLIES
(AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(NOT (EQUAL (CDADR ADDR1) (CDADR ADDR2)))
(DEFINEDP (CAADR ADDR1) DATA-SEG))
(EQUAL (GET (CDADR ADDR1)
(CDR (CONS (CAADR ADDR1)
(PUT VALUE
(CDADR ADDR2)
(CDR (ASSOC (CAADR ADDR2) DATA-SEG))))))
(GET (CDADR ADDR1)
(CDR (ASSOC (CAADR ADDR1) DATA-SEG))))).
This again simplifies, rewriting with CDR-CONS and MY-GET-PUT, to:
T.
Case 5. (IMPLIES
(AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(NOT (DEFINEDP (CAADR ADDR2) DATA-SEG))
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(DEFINEDP (CAADR ADDR1) DATA-SEG))
(EQUAL (GET (CDADR ADDR1)
(CDR (CONS (CAADR ADDR1)
(PUT VALUE
(CDADR ADDR2)
(CDR (ASSOC (CAADR ADDR2) DATA-SEG))))))
(GET (CDADR ADDR1)
(CDR (ASSOC (CAADR ADDR1) DATA-SEG))))).
This again simplifies, clearly, to:
T.
Case 4. (IMPLIES (AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(NOT (EQUAL (CDADR ADDR1) (CDADR ADDR2)))
(NOT (DEFINEDP (CAADR ADDR1) DATA-SEG)))
(EQUAL (GET (CDADR ADDR1) (CDR F))
(GET (CDADR ADDR1)
(CDR (ASSOC (CAADR ADDR1) DATA-SEG))))).
However this again simplifies, applying GET-ANYTHING-NIL and
DEFINEDP-ASSOC-FACT-1, and opening up CDR and EQUAL, to:
T.
Case 3. (IMPLIES (AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(NOT (DEFINEDP (CAADR ADDR2) DATA-SEG))
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(NOT (DEFINEDP (CAADR ADDR1) DATA-SEG)))
(EQUAL (GET (CDADR ADDR1) (CDR F))
(GET (CDADR ADDR1)
(CDR (ASSOC (CAADR ADDR1) DATA-SEG))))).
This again simplifies, rewriting with the lemmas GET-ANYTHING-NIL and
DEFINEDP-ASSOC-FACT-1, and opening up the functions CDR and EQUAL, to:
T.
Case 2. (IMPLIES
(AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(DEFINEDP (CAADR ADDR2) DATA-SEG)
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(EQUAL (CDADR ADDR1) (CDADR ADDR2))
(DEFINEDP (CAADR ADDR1) DATA-SEG))
(EQUAL (GET (CDADR ADDR1)
(CDR (CONS (CAADR ADDR1)
(PUT VALUE
(CDADR ADDR2)
(CDR (ASSOC (CAADR ADDR2) DATA-SEG))))))
VALUE)),
which again simplifies, rewriting with CDR-CONS and MY-GET-PUT, to:
T.
Case 1. (IMPLIES (AND (NUMBERP (CDADR ADDR1))
(NUMBERP (CDADR ADDR2))
(DEFINEDP (CAADR ADDR2) DATA-SEG)
(EQUAL (CAADR ADDR1) (CAADR ADDR2))
(EQUAL (CDADR ADDR1) (CDADR ADDR2))
(NOT (DEFINEDP (CAADR ADDR1) DATA-SEG)))
(EQUAL (GET (CDADR ADDR1) (CDR F))
VALUE)).
This again simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
FETCH-DEPOSIT
(PROVE-LEMMA AREA-NAME-ADD-ADDR
(REWRITE)
(EQUAL (AREA-NAME (ADD-ADDR ADDR N))
(AREA-NAME ADDR))
((ENABLE AREA-NAME ADD-ADDR)))
This conjecture can be simplified, using the abbreviations ADP-NAME and
AREA-NAME, to:
(EQUAL (CAR (UNTAG (ADD-ADDR ADDR N)))
(CAR (UNTAG ADDR))).
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, UNTAG-TAG, and CAR-CONS,
and expanding ADD-ADP, ADP-NAME, ADP-OFFSET, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AREA-NAME-ADD-ADDR
(PROVE-LEMMA OFFSET-ADD-ADDR
(REWRITE)
(EQUAL (OFFSET (ADD-ADDR ADDR N))
(PLUS (OFFSET ADDR) N))
((ENABLE OFFSET ADD-ADDR)))
This formula can be simplified, using the abbreviations ADP-OFFSET and OFFSET,
to:
(EQUAL (CDR (UNTAG (ADD-ADDR ADDR N)))
(PLUS (CDR (UNTAG ADDR)) N)),
which simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS, UNTAG-TAG,
and CDR-CONS, and unfolding ADD-ADP, ADP-NAME, ADP-OFFSET, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
OFFSET-ADD-ADDR
(PROVE-LEMMA ADP-NAME-UNTAG-ADD-ADDR
(REWRITE)
(EQUAL (ADP-NAME (UNTAG (ADD-ADDR ADDR N)))
(AREA-NAME ADDR))
((ENABLE AREA-NAME UNTAG ADD-ADDR TAG)))
WARNING: Note that the rewrite rule ADP-NAME-UNTAG-ADD-ADDR will be stored so
as to apply only to terms with the nonrecursive function symbol ADP-NAME.
This conjecture can be simplified, using the abbreviations AREA-NAME, UNTAG,
and ADP-NAME, to the conjecture:
(EQUAL (CAADR (ADD-ADDR ADDR N))
(CAADR ADDR)).
This simplifies, applying COMMUTATIVITY-OF-PLUS, CDR-CONS, and CAR-CONS, and
unfolding the definitions of TAG, ADD-ADP, ADP-NAME, ADP-OFFSET, UNTAG, and
ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADP-NAME-UNTAG-ADD-ADDR
(PROVE-LEMMA ADD-ADDR-OF-NON-NUMBER
(REWRITE)
(IMPLIES (NOT (NUMBERP N))
(EQUAL (ADD-ADDR ADDR N)
(ADD-ADDR ADDR 0)))
((ENABLE ADD-ADDR)))
This simplifies, appealing to the lemma PLUS-ZERO-ARG2, and opening up the
definitions of ADD-ADP, ADP-NAME, ADP-OFFSET, ZEROP, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADD-ADDR-OF-NON-NUMBER
(PROVE-LEMMA ADD-ADDR-ADD-ADDR
(REWRITE)
(EQUAL (ADD-ADDR (ADD-ADDR ADDR N) M)
(ADD-ADDR ADDR (PLUS N M)))
((ENABLE ADD-ADDR)))
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, CAR-CONS,
ADP-OFFSET-CONS, COMMUTATIVITY2-OF-PLUS, ASSOCIATIVITY-OF-PLUS, UNTAG-TAG, and
TYPE-TAG, and expanding ADD-ADP, ADP-NAME, ADP-OFFSET, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADD-ADDR-ADD-ADDR
(PROVE-LEMMA LISTP-UNTAG-ADD-ADDR
(REWRITE)
(LISTP (UNTAG (ADD-ADDR ADDR N)))
((ENABLE ADD-ADDR)))
This simplifies, applying COMMUTATIVITY-OF-PLUS and UNTAG-TAG, and opening up
the definitions of ADD-ADP, ADP-NAME, ADP-OFFSET, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-UNTAG-ADD-ADDR
(PROVE-LEMMA TYPE-ADD-ADDR
(REWRITE)
(EQUAL (TYPE (ADD-ADDR ADDR N))
(TYPE ADDR))
((ENABLE ADD-ADDR)))
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS and TYPE-TAG, and
unfolding ADD-ADP, ADP-NAME, ADP-OFFSET, and ADD-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TYPE-ADD-ADDR
(PROVE-LEMMA CDDR-ADD-ADDR
(REWRITE)
(EQUAL (CDDR (ADD-ADDR ADDR N)) NIL)
((ENABLE ADD-ADDR)))
This formula simplifies, applying the lemmas COMMUTATIVITY-OF-PLUS and
CDDR-TAG, and expanding the definitions of ADD-ADP, ADP-NAME, ADP-OFFSET,
ADD-ADDR, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDDR-ADD-ADDR
(PROVE-LEMMA AREA-NAME-LR-RETURN-PC
(REWRITE)
(EQUAL (AREA-NAME (LR-RETURN-PC L))
(AREA-NAME (P-PC L)))
((ENABLE LR-RETURN-PC)))
This conjecture simplifies, appealing to the lemmas AREA-NAME-LR-P-PC and
AREA-NAME-ADD-ADDR, and expanding the function LR-RETURN-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AREA-NAME-LR-RETURN-PC
(PROVE-LEMMA LISTP-UNTAG-LR-RETURN-PC
(REWRITE)
(LISTP (UNTAG (LR-RETURN-PC L)))
((ENABLE LR-RETURN-PC)))
This formula simplifies, applying LISTP-UNTAG-ADD-ADDR, and unfolding the
definition of LR-RETURN-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-UNTAG-LR-RETURN-PC
(PROVE-LEMMA TYPE-LR-RETURN-PC
(REWRITE)
(EQUAL (TYPE (LR-RETURN-PC L)) 'PC)
((ENABLE LR-RETURN-PC)))
This formula simplifies, rewriting with TYPE-LR-P-PC and TYPE-ADD-ADDR, and
expanding the functions LR-RETURN-PC and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TYPE-LR-RETURN-PC
(PROVE-LEMMA CDDR-LR-RETURN-PC
(REWRITE)
(EQUAL (CDDR (LR-RETURN-PC L)) NIL)
((ENABLE LR-RETURN-PC)))
This conjecture simplifies, appealing to the lemma CDDR-ADD-ADDR, and
expanding the functions LR-RETURN-PC and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDDR-LR-RETURN-PC
(PROVE-LEMMA NUMBERP-OFFSET-RETURN-PC
(REWRITE)
(NUMBERP (OFFSET (LR-RETURN-PC L)))
((ENABLE LR-RETURN-PC)))
This formula simplifies, applying OFFSET-ADD-ADDR, and unfolding the
definition of LR-RETURN-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-OFFSET-RETURN-PC
(PROVE-LEMMA NUMBERP-CDR-UNTAG-RETURN-PC
(REWRITE)
(NUMBERP (CDR (UNTAG (LR-RETURN-PC L))))
((ENABLE OFFSET)
(USE (NUMBERP-OFFSET-RETURN-PC (L L)))
(DISABLE NUMBERP-OFFSET-RETURN-PC)))
This conjecture can be simplified, using the abbreviations ADP-OFFSET and
OFFSET, to:
T.
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-CDR-UNTAG-RETURN-PC
(PROVE-LEMMA CAR-UNTAG-LR-RETURN-PC
(REWRITE)
(EQUAL (CAR (UNTAG (LR-RETURN-PC L)))
(CAR (UNTAG (P-PC L))))
((ENABLE AREA-NAME)
(USE (AREA-NAME-LR-RETURN-PC (L L)))
(DISABLE AREA-NAME-LR-RETURN-PC)))
This conjecture can be simplified, using the abbreviations ADP-NAME and
AREA-NAME, to:
T.
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-UNTAG-LR-RETURN-PC
(PROVE-LEMMA AREA-NAME-SUB-ADDR
(REWRITE)
(EQUAL (AREA-NAME (SUB-ADDR ADDR N))
(AREA-NAME ADDR))
((ENABLE AREA-NAME SUB-ADDR)))
This conjecture can be simplified, using the abbreviations ADP-NAME and
AREA-NAME, to:
(EQUAL (CAR (UNTAG (SUB-ADDR ADDR N)))
(CAR (UNTAG ADDR))).
This simplifies, rewriting with UNTAG-TAG and CAR-CONS, and expanding SUB-ADP,
ADP-NAME, ADP-OFFSET, and SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
AREA-NAME-SUB-ADDR
(PROVE-LEMMA CDDR-SUB-ADDR
(REWRITE)
(EQUAL (CDDR (SUB-ADDR ADDR N)) NIL)
((ENABLE SUB-ADDR)))
This formula simplifies, applying the lemma CDDR-TAG, and expanding the
definitions of SUB-ADP, ADP-NAME, ADP-OFFSET, SUB-ADDR, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDDR-SUB-ADDR
(PROVE-LEMMA TYPE-SUB-ADDR
(REWRITE)
(EQUAL (TYPE (SUB-ADDR ADDR N))
(TYPE ADDR))
((ENABLE SUB-ADDR)))
This simplifies, rewriting with TYPE-TAG, and unfolding SUB-ADP, ADP-NAME,
ADP-OFFSET, and SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TYPE-SUB-ADDR
(PROVE-LEMMA LISTP-UNTAG-SUB-ADDR
(REWRITE)
(LISTP (UNTAG (SUB-ADDR ADDR N)))
((ENABLE SUB-ADDR)))
This simplifies, applying UNTAG-TAG, and opening up the definitions of SUB-ADP,
ADP-NAME, ADP-OFFSET, and SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-UNTAG-SUB-ADDR
(PROVE-LEMMA OFFSET-SUB-ADDR
(REWRITE)
(EQUAL (OFFSET (SUB-ADDR ADDR N))
(DIFFERENCE (OFFSET ADDR) N))
((ENABLE OFFSET SUB-ADDR)))
This formula can be simplified, using the abbreviations ADP-OFFSET and OFFSET,
to:
(EQUAL (CDR (UNTAG (SUB-ADDR ADDR N)))
(DIFFERENCE (CDR (UNTAG ADDR)) N)),
which simplifies, appealing to the lemmas UNTAG-TAG and CDR-CONS, and
unfolding SUB-ADP, ADP-NAME, ADP-OFFSET, and SUB-ADDR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
OFFSET-SUB-ADDR
(PROVE-LEMMA LR-BOUNDARY-NODEP-SUB-ADDR
(REWRITE)
(IMPLIES (LR-BOUNDARY-NODEP ADDR)
(LR-BOUNDARY-NODEP (SUB-ADDR ADDR
(IDENTITY (LR-NODE-SIZE)))))
((DISABLE DIFFERENCE-ADD1-ARG2)))
WARNING: Note that the rewrite rule LR-BOUNDARY-NODEP-SUB-ADDR will be stored
so as to apply only to terms with the nonrecursive function symbol
LR-BOUNDARY-NODEP.
This formula can be simplified, using the abbreviations IMPLIES,
OFFSET-SUB-ADDR, IDENTITY, LR-NODE-SIZE, LR-BOUNDARY-OFFSETP, and
LR-BOUNDARY-NODEP, to:
(IMPLIES (EQUAL (REMAINDER (OFFSET ADDR) 4) 0)
(EQUAL (REMAINDER (DIFFERENCE (OFFSET ADDR) 4)
4)
0)),
which simplifies, using linear arithmetic, appealing to the lemma
DIFFERENCE-LEQ-ARG1, and unfolding NUMBERP, EQUAL, REMAINDER, and DIFFERENCE,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-BOUNDARY-NODEP-SUB-ADDR
(PROVE-LEMMA LR-BOUNDARY-NODEP-ADD-ADDR-LR-NODE-SIZE
(REWRITE)
(IMPLIES (LR-BOUNDARY-NODEP ADDR)
(LR-BOUNDARY-NODEP (ADD-ADDR ADDR
(IDENTITY (LR-NODE-SIZE)))))
((ENABLE LR-BOUNDARY-NODEP)))
WARNING: Note that the rewrite rule LR-BOUNDARY-NODEP-ADD-ADDR-LR-NODE-SIZE
will be stored so as to apply only to terms with the nonrecursive function
symbol LR-BOUNDARY-NODEP.
This formula can be simplified, using the abbreviations IMPLIES,
OFFSET-ADD-ADDR, IDENTITY, LR-NODE-SIZE, LR-BOUNDARY-OFFSETP, and
LR-BOUNDARY-NODEP, to:
(IMPLIES (EQUAL (REMAINDER (OFFSET ADDR) 4) 0)
(EQUAL (REMAINDER (PLUS (OFFSET ADDR) 4) 4)
0)),
which simplifies, appealing to the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
DIFFERENCE-ADD1-ARG2, and SUB1-ADD1, and unfolding NUMBERP, ZEROP, DIFFERENCE,
LESSP, SUB1, EQUAL, and REMAINDER, to:
(IMPLIES (AND (EQUAL (REMAINDER (OFFSET ADDR) 4) 0)
(NOT (NUMBERP (OFFSET ADDR))))
(EQUAL (REMAINDER 0 4) 0)).
This again simplifies, applying REMAINDER-OF-NON-NUMBER, and expanding the
definitions of REMAINDER and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LR-BOUNDARY-NODEP-ADD-ADDR-LR-NODE-SIZE
(DISABLE LR-BOUNDARY-NODEP)
[ 0.0 0.0 0.0 ]
LR-BOUNDARY-NODEP-OFF
(PROVE-LEMMA LR-NODEP-OPENER
(REWRITE)
(EQUAL (LR-NODEP ADDR DATA-SEG)
(AND (EQUAL (TYPE ADDR) 'ADDR)
(EQUAL (CDDR ADDR) NIL)
(LISTP ADDR)
(ADPP (UNTAG ADDR) DATA-SEG)
(LR-BOUNDARY-NODEP ADDR)
(EQUAL (AREA-NAME ADDR)
(IDENTITY (LR-HEAP-NAME))))))
WARNING: Note that the rewrite rule LR-NODEP-OPENER will be stored so as to
apply only to terms with the nonrecursive function symbol LR-NODEP.
This conjecture can be simplified, using the abbreviations LR-HEAP-NAME and
IDENTITY, to:
(EQUAL (LR-NODEP ADDR DATA-SEG)
(AND (EQUAL (TYPE ADDR) 'ADDR)
(EQUAL (CDDR ADDR) NIL)
(LISTP ADDR)
(ADPP (UNTAG ADDR) DATA-SEG)
(LR-BOUNDARY-NODEP ADDR)
(EQUAL (AREA-NAME ADDR) 'HEAP))).
This simplifies, expanding the definitions of LR-HEAP-NAME, LR-NODEP, and AND,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-NODEP-OPENER
(DISABLE LR-NODEP)
[ 0.0 0.0 0.0 ]
LR-NODEP-OFF
(PROVE-LEMMA LR-GOOD-POINTERP-OPENER
(REWRITE)
(EQUAL (LR-GOOD-POINTERP ADDR DATA-SEG)
(AND (EQUAL (TYPE ADDR) 'ADDR)
(EQUAL (CDDR ADDR) NIL)
(LISTP ADDR)
(ADPP (UNTAG ADDR) DATA-SEG)
(LR-BOUNDARY-NODEP ADDR)
(EQUAL (AREA-NAME ADDR)
(IDENTITY (LR-HEAP-NAME)))
(EQUAL (TYPE (FETCH (ADD-ADDR ADDR
(IDENTITY (LR-REF-COUNT-OFFSET)))
DATA-SEG))
'NAT))))
WARNING: Note that the rewrite rule LR-GOOD-POINTERP-OPENER will be stored so
as to apply only to terms with the nonrecursive function symbol
LR-GOOD-POINTERP.
This formula can be simplified, using the abbreviations LR-REF-COUNT-OFFSET,
LR-HEAP-NAME, and IDENTITY, to:
(EQUAL (LR-GOOD-POINTERP ADDR DATA-SEG)
(AND (EQUAL (TYPE ADDR) 'ADDR)
(EQUAL (CDDR ADDR) NIL)
(LISTP ADDR)
(ADPP (UNTAG ADDR) DATA-SEG)
(LR-BOUNDARY-NODEP ADDR)
(EQUAL (AREA-NAME ADDR) 'HEAP)
(EQUAL (TYPE (FETCH (ADD-ADDR ADDR 1) DATA-SEG))
'NAT))),
which simplifies, applying LR-NODEP-OPENER, and expanding the functions
LR-REF-COUNT-OFFSET, LR-GOOD-POINTERP, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-GOOD-POINTERP-OPENER
(DISABLE LR-GOOD-POINTERP)
[ 0.0 0.0 0.0 ]
LR-GOOD-POINTERP-OFF
(PROVE-LEMMA EQUAL-PLUS-REMAINDER-0-FACT NIL
(IMPLIES (AND (EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2))))
((DISABLE-THEORY ADDITION REMAINDERS)
(ENABLE CORRECTNESS-OF-CANCEL-EQUAL-PLUS COMMUTATIVITY-OF-PLUS
REMAINDER-NOOP REMAINDER-ZERO)
(INDUCT (DOUBLE-REMAINDER-INDUCTION OFFSET1 OFFSET2 MAX))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following four new goals:
Case 4. (IMPLIES (AND (ZEROP MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2)))).
This simplifies, applying REMAINDER-ZERO, and opening up ZEROP, EQUAL, and
LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2)))),
which simplifies, rewriting with REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS,
and expanding NUMBERP, EQUAL, PLUS, FIX, and AND, to the following ten new
formulas:
Case 3.10.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NOT (NUMBERP N))
(EQUAL 0 (PLUS M OFFSET2))
(NUMBERP M))
(EQUAL 0 M)).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.9.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NUMBERP N)
(EQUAL N (PLUS M OFFSET2))
(NUMBERP M))
(EQUAL N M)),
which again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS, and expanding EQUAL, LESSP, PLUS,
and NUMBERP, to:
T.
Case 3.8.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NUMBERP N)
(EQUAL N (PLUS M OFFSET2))
(NOT (NUMBERP M)))
(EQUAL N 0)).
But this again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS, and expanding the functions
EQUAL, LESSP, PLUS, and NUMBERP, to:
T.
Case 3.7.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NOT (NUMBERP N))
(NOT (EQUAL 0 (PLUS M OFFSET2)))
(EQUAL 0 M))
(NOT (EQUAL 0 OFFSET2))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NOT (NUMBERP N))
(NOT (EQUAL 0 (PLUS M OFFSET2)))
(NOT (NUMBERP M)))
(NOT (EQUAL 0 OFFSET2))),
which again simplifies, using linear arithmetic, applying REMAINDER-NOOP
and COMMUTATIVITY-OF-PLUS, and expanding the functions EQUAL, LESSP,
NUMBERP, and PLUS, to:
T.
Case 3.5.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NUMBERP N)
(NOT (EQUAL N (PLUS M OFFSET2)))
(NUMBERP M)
(EQUAL N M))
(NOT (EQUAL 0 OFFSET2))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NUMBERP N)
(NOT (EQUAL N (PLUS M OFFSET2)))
(NOT (NUMBERP M))
(EQUAL N 0))
(NOT (EQUAL 0 OFFSET2))),
which again simplifies, applying the lemmas REMAINDER-NOOP and
COMMUTATIVITY-OF-PLUS, and expanding the functions EQUAL, LESSP, NUMBERP,
and PLUS, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NOT (NUMBERP N))
(EQUAL 0 (PLUS M OFFSET2))
(EQUAL 0 M))
(EQUAL (EQUAL 0 OFFSET2) T)),
which again simplifies, using linear arithmetic, applying REMAINDER-NOOP,
and unfolding EQUAL, LESSP, NUMBERP, and PLUS, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NOT (NUMBERP N))
(EQUAL 0 (PLUS M OFFSET2))
(NOT (NUMBERP M)))
(EQUAL (EQUAL 0 OFFSET2) T)).
However this again simplifies, using linear arithmetic, applying
REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS, and expanding the functions
EQUAL, LESSP, NUMBERP, and PLUS, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(LESSP OFFSET1 MAX)
(EQUAL OFFSET1 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET2)
(NUMBERP N)
(EQUAL N (PLUS M OFFSET2)))
(EQUAL (EQUAL 0 OFFSET2) T)).
However this again simplifies, using linear arithmetic, appealing to the
lemmas REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS, and expanding the
definitions of EQUAL, LESSP, PLUS, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2)))),
which simplifies, applying REMAINDER-NOOP and COMMUTATIVITY-OF-PLUS, and
expanding the definitions of NUMBERP, EQUAL, PLUS, FIX, and AND, to the
following ten new formulas:
Case 2.10.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NOT (NUMBERP M))
(EQUAL (PLUS N OFFSET1) 0)
(NUMBERP N))
(EQUAL N 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP M)
(EQUAL (PLUS N OFFSET1) M)
(NUMBERP N))
(EQUAL N M)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP M)
(EQUAL (PLUS N OFFSET1) M)
(NOT (NUMBERP N)))
(EQUAL 0 M)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NOT (NUMBERP M))
(NOT (EQUAL (PLUS N OFFSET1) 0))
(EQUAL N 0))
(NOT (EQUAL OFFSET1 0))),
which again simplifies, clearly, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NOT (NUMBERP M))
(NOT (EQUAL (PLUS N OFFSET1) 0))
(NOT (NUMBERP N)))
(NOT (EQUAL OFFSET1 0))).
This again simplifies, clearly, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP M)
(NOT (EQUAL (PLUS N OFFSET1) M))
(NUMBERP N)
(EQUAL N M))
(NOT (EQUAL OFFSET1 0))).
This again simplifies, trivially, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP M)
(NOT (EQUAL (PLUS N OFFSET1) M))
(NOT (NUMBERP N))
(EQUAL 0 M))
(NOT (EQUAL OFFSET1 0))).
This again simplifies, clearly, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NOT (NUMBERP M))
(EQUAL (PLUS N OFFSET1) 0)
(EQUAL N 0))
(EQUAL (EQUAL OFFSET1 0) T)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NOT (NUMBERP M))
(EQUAL (PLUS N OFFSET1) 0)
(NOT (NUMBERP N)))
(EQUAL (EQUAL OFFSET1 0) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(LESSP OFFSET2 MAX)
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL OFFSET2 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP M)
(EQUAL (PLUS N OFFSET1) M))
(EQUAL (EQUAL OFFSET1 0) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP (DIFFERENCE OFFSET1 MAX))
(NUMBERP (DIFFERENCE OFFSET2 MAX)))
(EQUAL (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX)))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))))
(EQUAL (REMAINDER OFFSET1 MAX) 0)
(EQUAL (REMAINDER OFFSET2 MAX) 0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2)))),
which simplifies, applying the lemma CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and
unfolding the functions AND, FIX, IMPLIES, REMAINDER, LESSP, PLUS, and EQUAL,
to 14 new goals:
Case 1.14.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (NUMBERP M))
(NUMBERP N)
(NOT (EQUAL N 0))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(NOT (EQUAL (PLUS N OFFSET1) OFFSET2))),
which again simplifies, expanding the definition of PLUS, to the goal:
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP (PLUS N OFFSET1) MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(DIFFERENCE (PLUS N OFFSET1) MAX)))
(NOT (NUMBERP M))
(NUMBERP N)
(NOT (EQUAL N 0))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE (PLUS N OFFSET1) MAX)
MAX)
0)
(LESSP N MAX))
(NOT (NUMBERP OFFSET1))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.13.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NUMBERP M)
(NOT (NUMBERP N))
(NOT (EQUAL 0 M))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(NOT (EQUAL OFFSET1 (PLUS M OFFSET2)))),
which again simplifies, expanding the definition of PLUS, to:
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP (PLUS M OFFSET2) MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (DIFFERENCE (PLUS M OFFSET2) MAX)
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NUMBERP M)
(NOT (NUMBERP N))
(NOT (EQUAL 0 M))
(EQUAL (REMAINDER (DIFFERENCE (PLUS M OFFSET2) MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP M MAX))
(NOT (NUMBERP OFFSET2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.12.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NUMBERP M)
(NUMBERP N)
(NOT (EQUAL N M))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NOT (NUMBERP M))
(NOT (NUMBERP N)))
(EQUAL (EQUAL OFFSET1 OFFSET2) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NOT (NUMBERP M))
(EQUAL N 0))
(EQUAL (EQUAL OFFSET1 OFFSET2) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NOT (NUMBERP N))
(EQUAL 0 M))
(EQUAL (EQUAL OFFSET1 OFFSET2) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NUMBERP M)
(NUMBERP N))
(EQUAL (EQUAL OFFSET1 OFFSET2) T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NOT (NUMBERP M))
(NOT (NUMBERP N)))
(NOT (EQUAL OFFSET1 OFFSET2))),
which again simplifies, clearly, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NOT (NUMBERP M))
(EQUAL N 0))
(NOT (EQUAL OFFSET1 OFFSET2))).
This again simplifies, trivially, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NOT (NUMBERP N))
(EQUAL 0 M))
(NOT (EQUAL OFFSET1 OFFSET2))).
This again simplifies, obviously, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NUMBERP M)
(NUMBERP N)
(EQUAL N M))
(NOT (EQUAL OFFSET1 OFFSET2))).
This again simplifies, obviously, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NOT (NUMBERP M))
(NUMBERP N))
(EQUAL N 0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NUMBERP M)
(NOT (NUMBERP N)))
(EQUAL 0 M)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL MAX 0))
(NUMBERP MAX)
(NOT (LESSP OFFSET1 MAX))
(NOT (LESSP OFFSET2 MAX))
(NOT (EQUAL (PLUS N (DIFFERENCE OFFSET1 MAX))
(PLUS M (DIFFERENCE OFFSET2 MAX))))
(NOT (EQUAL (DIFFERENCE OFFSET1 MAX)
(DIFFERENCE OFFSET2 MAX)))
(EQUAL (REMAINDER (DIFFERENCE OFFSET1 MAX)
MAX)
0)
(EQUAL (REMAINDER (DIFFERENCE OFFSET2 MAX)
MAX)
0)
(LESSP N MAX)
(LESSP M MAX)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2)
(EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NUMBERP M)
(NUMBERP N))
(EQUAL N M)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.3 0.1 ]
EQUAL-PLUS-REMAINDER-0-FACT
(PROVE-LEMMA LR-BOUNDARY-OFFSETP-EQUAL-PLUS-FACT
(REWRITE)
(IMPLIES (AND (LR-BOUNDARY-OFFSETP OFFSET1)
(LR-BOUNDARY-OFFSETP OFFSET2)
(LESSP N (LR-NODE-SIZE))
(LESSP M (LR-NODE-SIZE))
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2))))
((DISABLE-THEORY ADDITION QUOTIENTS)
(USE (EQUAL-PLUS-REMAINDER-0-FACT (OFFSET1 OFFSET1)
(OFFSET2 OFFSET2)
(MAX (LR-NODE-SIZE))
(N N)
(M M)))))
This conjecture can be simplified, using the abbreviations AND, IMPLIES,
LR-BOUNDARY-OFFSETP, and LR-NODE-SIZE, to:
(IMPLIES (AND (IMPLIES (AND (EQUAL (REMAINDER OFFSET1 4) 0)
(EQUAL (REMAINDER OFFSET2 4) 0)
(LESSP N 4)
(LESSP M 4)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2))))
(EQUAL (REMAINDER OFFSET1 4) 0)
(EQUAL (REMAINDER OFFSET2 4) 0)
(LESSP N 4)
(LESSP M 4)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(AND (EQUAL (FIX N) (FIX M))
(EQUAL OFFSET1 OFFSET2)))).
This simplifies, opening up EQUAL, AND, FIX, IMPLIES, NUMBERP, LESSP, and PLUS,
to the following three new conjectures:
Case 3. (IMPLIES (AND (NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NOT (NUMBERP M))
(NUMBERP N)
(NOT (EQUAL N 0))
(EQUAL (REMAINDER OFFSET1 4) 0)
(EQUAL (REMAINDER OFFSET2 4) 0)
(LESSP N 4)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(NOT (EQUAL (PLUS N OFFSET1) OFFSET2))).
This again simplifies, expanding PLUS, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2)))
(NUMBERP M)
(NOT (NUMBERP N))
(NOT (EQUAL 0 M))
(EQUAL (REMAINDER OFFSET1 4) 0)
(EQUAL (REMAINDER OFFSET2 4) 0)
(LESSP M 4)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(NOT (EQUAL OFFSET1 (PLUS M OFFSET2)))),
which again simplifies, unfolding the function PLUS, to:
T.
Case 1. (IMPLIES (AND (EQUAL (PLUS N OFFSET1)
(PLUS M OFFSET2))
(NUMBERP M)
(NUMBERP N)
(EQUAL N M)
(EQUAL (EQUAL OFFSET1 OFFSET2) T)
(EQUAL (REMAINDER OFFSET1 4) 0)
(EQUAL (REMAINDER OFFSET2 4) 0)
(LESSP M 4)
(NUMBERP OFFSET1)
(NUMBERP OFFSET2))
(EQUAL (PLUS M OFFSET1)
(PLUS M OFFSET2))),
which again simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LR-BOUNDARY-OFFSETP-EQUAL-PLUS-FACT
(PROVE-LEMMA GOOD-POSP-LIST-NX-T-SIMPLE
(REWRITE)
(IMPLIES (AND (GOOD-POSP 'LIST POS BODY)
(LISTP POS)
(LESSP (CAR (LAST POS))
(LENGTH (CUR-EXPR (BUTLAST POS) BODY))))
(AND (GOOD-POSP 'LIST (NX POS) BODY)
(GOOD-POSP1 POS BODY)))
((ENABLE GOOD-POSP)))
WARNING: Note that the proposed lemma GOOD-POSP-LIST-NX-T-SIMPLE is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula simplifies, using linear arithmetic, applying SUB1-ADD1,
EQUAL-LENGTH-0, BUTLAST-NX, CAR-CONS, LAST-NX, LISTP-RESTN, and
GOOD-POSP1-LIST-GOOD-POSP-LIST-T, and expanding the functions GOOD-POSP-LIST,
S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, EQUAL, GOOD-POSP, LESSP, and AND, to
the formula:
(IMPLIES (AND (LISTP (CUR-EXPR (BUTLAST POS) BODY))
(NOT (EQUAL (CAR (CUR-EXPR (BUTLAST POS) BODY))
'(TEMP-FETCH)))
(NOT (EQUAL (CAR (CUR-EXPR (BUTLAST POS) BODY))
'(TEMP-EVAL)))
(NOT (EQUAL (CAR (CUR-EXPR (BUTLAST POS) BODY))
'(TEMP-TEST)))
(NOT (EQUAL (CAR (CUR-EXPR (BUTLAST POS) BODY))
'QUOTE))
(NOT (EQUAL (CAR (LAST POS)) 0))
(NUMBERP (CAR (LAST POS)))
(NOT (LESSP (LENGTH (CUR-EXPR (BUTLAST POS) BODY))
(CAR (LAST POS))))
(GOOD-POSP1 (BUTLAST POS) BODY)
(LISTP POS)
(LESSP (CAR (LAST POS))
(LENGTH (CUR-EXPR (BUTLAST POS) BODY))))
(NOT (LESSP (SUB1 (LENGTH (CUR-EXPR (BUTLAST POS) BODY)))
(CAR (LAST POS))))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
GOOD-POSP-LIST-NX-T-SIMPLE
(PROVE-LEMMA LR-PROGRAMS-PROPERP-1-LR-PROPER-EXPRP NIL
(IMPLIES (AND (LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(MEMBER PROG PROGS))
(LR-PROPER-EXPRP T
(PROGRAM-BODY PROG)
PROGRAM-NAMES
(FORMAL-VARS PROG)
(STRIP-CARS (TEMP-VAR-DCLS PROG))
TABLE))
((DISABLE LR-PROPER-EXPRP)
(ENABLE LR-PROGRAMS-PROPERP-1)))
Name the conjecture *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest two inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP PROGS)
(p PROG PROGRAM-NAMES TABLE
(CDR PROGS)))
(p PROG PROGRAM-NAMES TABLE PROGS))
(IMPLIES (NOT (LISTP PROGS))
(p PROG PROGRAM-NAMES TABLE PROGS))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT PROGS) decreases according to the well-founded relation LESSP
in each induction step of the scheme. The above induction scheme generates
the following three new conjectures:
Case 3. (IMPLIES (AND (LISTP PROGS)
(NOT (LR-PROGRAMS-PROPERP-1 (CDR PROGS)
PROGRAM-NAMES TABLE))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(MEMBER PROG PROGS))
(LR-PROPER-EXPRP T
(PROGRAM-BODY PROG)
PROGRAM-NAMES
(FORMAL-VARS PROG)
(STRIP-CARS (TEMP-VAR-DCLS PROG))
TABLE)).
This simplifies, expanding the function LR-PROGRAMS-PROPERP-1, to:
T.
Case 2. (IMPLIES (AND (LISTP PROGS)
(NOT (MEMBER PROG (CDR PROGS)))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(MEMBER PROG PROGS))
(LR-PROPER-EXPRP T
(PROGRAM-BODY PROG)
PROGRAM-NAMES
(FORMAL-VARS PROG)
(STRIP-CARS (TEMP-VAR-DCLS PROG))
TABLE)).
This simplifies, opening up the functions LR-PROGRAMS-PROPERP-1 and MEMBER,
to the new formula:
(IMPLIES
(AND (LISTP PROGS)
(NOT (MEMBER PROG (CDR PROGS)))
(ALL-LITATOMS (FORMAL-VARS (CAR PROGS)))
(ALL-LITATOMS (STRIP-CARS (TEMP-VAR-DCLS (CAR PROGS))))
(ALL-UNDEF-ADDRS (STRIP-CADRS (TEMP-VAR-DCLS (CAR PROGS))))
(LR-PROPER-EXPRP T
(PROGRAM-BODY (CAR PROGS))
PROGRAM-NAMES
(FORMAL-VARS (CAR PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (CAR PROGS)))
TABLE)
(LR-PROGRAMS-PROPERP-1 (CDR PROGS)
PROGRAM-NAMES TABLE)
(EQUAL PROG (CAR PROGS)))
(LR-PROPER-EXPRP T
(PROGRAM-BODY PROG)
PROGRAM-NAMES
(FORMAL-VARS PROG)
(STRIP-CARS (TEMP-VAR-DCLS PROG))
TABLE)),
which again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PROGS))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(MEMBER PROG PROGS))
(LR-PROPER-EXPRP T
(PROGRAM-BODY PROG)
PROGRAM-NAMES
(FORMAL-VARS PROG)
(STRIP-CARS (TEMP-VAR-DCLS PROG))
TABLE)).
This simplifies, rewriting with the lemma MEMBER-NON-LIST, and unfolding the
function LR-PROGRAMS-PROPERP-1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-1-LR-PROPER-EXPRP
(PROVE-LEMMA LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T
(REWRITE)
(IMPLIES (LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE)
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP N (LENGTH EXPR))))
((ENABLE GET GET-ANYTHING-NIL)
(INDUCT (GET N EXPR))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new conjectures:
Case 2. (IMPLIES (AND (ZEROP N)
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP N (LENGTH EXPR)))),
which simplifies, rewriting with GET-ZEROP and EQUAL-LENGTH-0, and opening
up the functions ZEROP, EQUAL, and LESSP, to the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (EQUAL N 0)
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))).
This again simplifies, obviously, to:
(IMPLIES (LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE)
(EQUAL (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))).
Applying the lemma CAR-CDR-ELIM, replace EXPR by (CONS X Z) to eliminate
(CAR EXPR) and (CDR EXPR). We would thus like to prove the following two
new formulas:
Case 2.2.2.
(IMPLIES (AND (NOT (LISTP EXPR))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))).
However this further simplifies, unfolding EQUAL, LR-PROPER-EXPRP, CAR,
LISTP, and LITATOM, to:
T.
Case 2.2.1.
(IMPLIES (LR-PROPER-EXPRP 'LIST
(CONS X Z)
PNAMES FORMALS TEMPS TABLE)
(EQUAL (LR-PROPER-EXPRP T X PNAMES FORMALS TEMPS TABLE)
(LISTP (CONS X Z)))),
which further simplifies, rewriting with CAR-CONS, and opening up EQUAL
and LR-PROPER-EXPRP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP N))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))).
Appealing to the lemma CAR-CDR-ELIM, we now replace EXPR by (CONS X Z) to
eliminate (CAR EXPR) and (CDR EXPR). This generates two new conjectures:
Case 2.1.2.
(IMPLIES (AND (NOT (LISTP EXPR))
(NOT (NUMBERP N))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(CAR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))),
which further simplifies, unfolding the definitions of EQUAL,
LR-PROPER-EXPRP, CAR, LISTP, and LITATOM, to:
T.
Case 2.1.1.
(IMPLIES (AND (NOT (NUMBERP N))
(LR-PROPER-EXPRP 'LIST
(CONS X Z)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T X PNAMES FORMALS TEMPS TABLE)
(LISTP (CONS X Z)))),
which further simplifies, rewriting with CAR-CONS, and unfolding EQUAL
and LR-PROPER-EXPRP, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(IMPLIES (LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE)
(EQUAL (LR-PROPER-EXPRP T
(GET (SUB1 N) (CDR EXPR))
PNAMES FORMALS TEMPS
TABLE)
(LESSP (SUB1 N) (LENGTH (CDR EXPR)))))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP N (LENGTH EXPR)))).
This simplifies, applying the lemma GET-ANYTHING-NIL, and unfolding IMPLIES,
EQUAL, LR-PROPER-EXPRP, LISTP, LITATOM, LENGTH, LESSP, and GET, to the
following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LR-PROPER-EXPRP T
(GET (SUB1 N) (CDR EXPR))
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (LENGTH (CDR EXPR))))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE)
(NOT (LISTP EXPR)))
(EQUAL (LESSP (SUB1 N) (LENGTH (CDR EXPR)))
(LESSP N 0))).
But this again simplifies, applying CDR-NLISTP and GET-ANYTHING-NIL, and
unfolding LISTP, LITATOM, EQUAL, LR-PROPER-EXPRP, LENGTH, LESSP, and CDR,
to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LR-PROPER-EXPRP T
(GET (SUB1 N) (CDR EXPR))
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (LENGTH (CDR EXPR))))
(LR-PROPER-EXPRP 'LIST
EXPR PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))
(EQUAL (LESSP (SUB1 N) (LENGTH (CDR EXPR)))
(LESSP N
(ADD1 (LENGTH (CDR EXPR)))))).
However this again simplifies, applying SUB1-ADD1, and unfolding the
definition of LESSP, to:
T.
Q.E.D.
[ 0.0 0.7 0.0 ]
LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T
(PROVE-LEMMA LR-PROPER-EXPRP-T-LR-PROPER-GET-T
(REWRITE)
(IMPLIES (AND (NOT (EQUAL (CAR EXPR) (S-TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) (S-TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (ZEROP N))
(LR-PROPER-EXPRP T EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP N (LENGTH EXPR))))
((ENABLE GET-ANYTHING-NIL GET-CONS)
(DISABLE *1*P-RUNTIME-SUPPORT-PROGRAMS)
(EXPAND (LR-PROPER-EXPRP T EXPR PNAMES FORMALS TEMPS TABLE))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
IMPLIES, S-TEMP-TEST, S-TEMP-EVAL, and S-TEMP-FETCH, to:
(IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(LR-PROPER-EXPRP T EXPR PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP N (LENGTH EXPR)))).
This simplifies, rewriting with SUB1-ADD1, GET-ANYTHING-NIL, and LENGTH-NLISTP,
and expanding the functions LR-PROPER-EXPRP, EQUAL, S-TEMP-FETCH, S-TEMP-EVAL,
S-TEMP-TEST, LENGTH, LESSP, ARITY, LISTP, and LITATOM, to three new formulas:
Case 3. (IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LITATOM EXPR))
(LISTP EXPR)
(PLISTP EXPR)
(SUBRP (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(EQUAL (CAR EXPR) 'IF)
(NOT (MEMBER 'IF PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) 3))),
which again simplifies, expanding the functions EQUAL, SUBRP, and ARITY, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LISTP EXPR)
(PLISTP EXPR)
(EQUAL (LENGTH (CDR EXPR)) 3)
(EQUAL (CAR EXPR) 'IF)
(NOT (MEMBER 'IF PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) 3))).
Appealing to the lemma CAR-CDR-ELIM, we now replace EXPR by (CONS Z X) to
eliminate (CDR EXPR) and (CAR EXPR). The result is:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(PLISTP (CONS Z X))
(EQUAL (LENGTH X) 3)
(EQUAL Z 'IF)
(NOT (MEMBER 'IF PNAMES))
(LR-PROPER-EXPRP 'LIST
X PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N (CONS Z X))
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) 3))).
But this further simplifies, applying PLISTP-CONS, GET-CONS, and
LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LITATOM EXPR))
(LISTP EXPR)
(PLISTP EXPR)
(SUBRP (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(NOT (EQUAL (CAR EXPR) 'IF))
(DEFINEDP (CAR EXPR)
(P-RUNTIME-SUPPORT-PROGRAMS))
(NOT (MEMBER (CAR EXPR) PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY (CAR EXPR))))).
This again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(LISTP EXPR)
(PLISTP EXPR)
(SUBRP (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(NOT (EQUAL (CAR EXPR) 'IF))
(DEFINEDP (CAR EXPR)
(P-RUNTIME-SUPPORT-PROGRAMS))
(NOT (MEMBER (CAR EXPR) PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY (CAR EXPR))))).
Applying the lemma CAR-CDR-ELIM, replace EXPR by (CONS X Z) to eliminate
(CAR EXPR) and (CDR EXPR). This produces:
(IMPLIES (AND (NOT (EQUAL X '(TEMP-FETCH)))
(NOT (EQUAL X '(TEMP-EVAL)))
(NOT (EQUAL X '(TEMP-TEST)))
(NOT (EQUAL X 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(PLISTP (CONS X Z))
(SUBRP X)
(EQUAL (LENGTH Z) (ARITY X))
(NOT (EQUAL X 'IF))
(DEFINEDP X
(P-RUNTIME-SUPPORT-PROGRAMS))
(NOT (MEMBER X PNAMES))
(LR-PROPER-EXPRP 'LIST
Z PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N (CONS X Z))
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY X)))),
which further simplifies, applying PLISTP-CONS, GET-CONS, and
LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LITATOM EXPR))
(LISTP EXPR)
(PLISTP EXPR)
(NOT (SUBRP (CAR EXPR)))
(BODY (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(MEMBER (CAR EXPR) PNAMES)
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY (CAR EXPR))))).
This again simplifies, obviously, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(NOT (EQUAL (CAR EXPR) 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(LISTP EXPR)
(PLISTP EXPR)
(NOT (SUBRP (CAR EXPR)))
(BODY (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(MEMBER (CAR EXPR) PNAMES)
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N EXPR)
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY (CAR EXPR))))).
Applying the lemma CAR-CDR-ELIM, replace EXPR by (CONS X Z) to eliminate
(CAR EXPR) and (CDR EXPR). We would thus like to prove the new formula:
(IMPLIES (AND (NOT (EQUAL X '(TEMP-FETCH)))
(NOT (EQUAL X '(TEMP-EVAL)))
(NOT (EQUAL X '(TEMP-TEST)))
(NOT (EQUAL X 'QUOTE))
(NOT (EQUAL N 0))
(NUMBERP N)
(PLISTP (CONS X Z))
(NOT (SUBRP X))
(BODY X)
(EQUAL (LENGTH Z) (ARITY X))
(MEMBER X PNAMES)
(LR-PROPER-EXPRP 'LIST
Z PNAMES FORMALS TEMPS TABLE))
(EQUAL (LR-PROPER-EXPRP T
(GET N (CONS X Z))
PNAMES FORMALS TEMPS TABLE)
(LESSP (SUB1 N) (ARITY X)))),
which further simplifies, appealing to the lemmas PLISTP-CONS, GET-CONS, and
LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
LR-PROPER-EXPRP-T-LR-PROPER-GET-T
(DISABLE LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T)
[ 0.0 0.0 0.0 ]
LR-PROPER-EXPRP-LIST-LR-PROPER-GET-T-OFF
(PROVE-LEMMA LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR NIL
(IMPLIES (AND (LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE))
((ENABLE GOOD-POSP1)))
Name the conjecture *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest three inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (NLISTP POS)
(p POS BODY PNAMES FORMALS TEMPS TABLE))
(IMPLIES (AND (NOT (NLISTP POS)) (NLISTP BODY))
(p POS BODY PNAMES FORMALS TEMPS TABLE))
(IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(EQUAL (CAR BODY) (S-TEMP-FETCH)))
(p POS BODY PNAMES FORMALS TEMPS TABLE))
(IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST)))
(p (CDR POS)
(CADR BODY)
PNAMES FORMALS TEMPS TABLE))
(p POS BODY PNAMES FORMALS TEMPS TABLE))
(IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(EQUAL (CAR BODY) 'QUOTE))
(p POS BODY PNAMES FORMALS TEMPS TABLE))
(IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(p (CDR POS)
(GET (CAR POS) BODY)
PNAMES FORMALS TEMPS TABLE))
(p POS BODY PNAMES FORMALS TEMPS TABLE))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definitions
of OR, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, and NLISTP can be used to prove
that the measure (COUNT POS) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instances chosen for BODY. The above induction scheme generates the following
ten new conjectures:
Case 10.(IMPLIES (AND (NLISTP POS)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, applying GOOD-POSP1-NLISTP, and opening up the definitions
of NLISTP and CUR-EXPR, to:
T.
Case 9. (IMPLIES (AND (NOT (NLISTP POS))
(NLISTP BODY)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, opening up the functions NLISTP, EQUAL, LR-PROPER-EXPRP,
and GOOD-POSP1, to:
T.
Case 8. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(EQUAL (CAR BODY) (S-TEMP-FETCH))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, unfolding the definitions of NLISTP, S-TEMP-FETCH, EQUAL,
LR-PROPER-EXPRP, and GOOD-POSP1, to:
T.
Case 7. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST)))
(NOT (LR-PROPER-EXPRP T
(CADR BODY)
PNAMES FORMALS TEMPS TABLE))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, applying ADD1-EQUAL, and opening up NLISTP, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, OR, NUMBERP, LENGTH, PLISTP, EQUAL, and
LR-PROPER-EXPRP, to:
T.
Case 6. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST)))
(NOT (GOOD-POSP1 (CDR POS) (CADR BODY)))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, applying ADD1-EQUAL, and opening up NLISTP, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, OR, NUMBERP, LENGTH, PLISTP, EQUAL,
LR-PROPER-EXPRP, and GOOD-POSP1, to:
T.
Case 5. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST)))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS) (CADR BODY))
PNAMES FORMALS TEMPS TABLE)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, rewriting with the lemma ADD1-EQUAL, and opening up NLISTP,
S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, OR, NUMBERP, LENGTH, PLISTP, EQUAL,
LR-PROPER-EXPRP, GOOD-POSP1, and CUR-EXPR, to two new goals:
Case 5.2.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS) (CADR BODY))
PNAMES FORMALS TEMPS TABLE)
(PLISTP (CDR BODY))
(MEMBER (CADDR BODY) TEMPS)
(EQUAL (LENGTH (CDR BODY)) 2)
(LR-PROPER-EXPRP T
(CADR BODY)
PNAMES FORMALS TEMPS TABLE)
(EQUAL (CAR POS) 1)
(GOOD-POSP1 (CDR POS) (CADR BODY)))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS)
(GET (CAR POS) BODY))
PNAMES FORMALS TEMPS TABLE)),
which again simplifies, applying the lemmas GET-ZEROP and GET-ADD1-OPENER,
and expanding EQUAL and ZEROP, to:
T.
Case 5.1.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS) (CADR BODY))
PNAMES FORMALS TEMPS TABLE)
(PLISTP (CDR BODY))
(MEMBER (CADDR BODY) TEMPS)
(EQUAL (LENGTH (CDR BODY)) 2)
(LR-PROPER-EXPRP T
(CADR BODY)
PNAMES FORMALS TEMPS TABLE)
(EQUAL (CAR POS) 1)
(GOOD-POSP1 (CDR POS) (CADR BODY)))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS)
(GET (CAR POS) BODY))
PNAMES FORMALS TEMPS TABLE)),
which again simplifies, rewriting with GET-ZEROP and GET-ADD1-OPENER, and
unfolding the definitions of EQUAL and ZEROP, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(EQUAL (CAR BODY) 'QUOTE)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, unfolding the definitions of NLISTP, S-TEMP-FETCH, EQUAL,
S-TEMP-EVAL, S-TEMP-TEST, OR, ARITY, LR-PROPER-EXPRP, and GOOD-POSP1, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(NOT (LR-PROPER-EXPRP T
(GET (CAR POS) BODY)
PNAMES FORMALS TEMPS TABLE))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, opening up the definitions of NLISTP, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, OR, GOOD-POSP1, and CUR-EXPR, to the new goal:
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(NOT (LR-PROPER-EXPRP T
(GET (CAR POS) BODY)
PNAMES FORMALS TEMPS TABLE))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(LESSP (CAR POS) (LENGTH BODY))
(GOOD-POSP1 (CDR POS)
(GET (CAR POS) BODY)))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS)
(GET (CAR POS) BODY))
PNAMES FORMALS TEMPS TABLE)),
which again simplifies, applying LR-PROPER-EXPRP-T-LR-PROPER-GET-T, and
unfolding S-TEMP-TEST, S-TEMP-EVAL, and S-TEMP-FETCH, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(NOT (GOOD-POSP1 (CDR POS)
(GET (CAR POS) BODY)))
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, unfolding the definitions of NLISTP, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, OR, and GOOD-POSP1, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP POS))
(NOT (NLISTP BODY))
(NOT (EQUAL (CAR BODY) (S-TEMP-FETCH)))
(NOT (OR (EQUAL (CAR BODY) (S-TEMP-EVAL))
(EQUAL (CAR BODY) (S-TEMP-TEST))))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LR-PROPER-EXPRP T
(CUR-EXPR (CDR POS)
(GET (CAR POS) BODY))
PNAMES FORMALS TEMPS TABLE)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, opening up the functions NLISTP, S-TEMP-FETCH, S-TEMP-EVAL,
S-TEMP-TEST, OR, GOOD-POSP1, and CUR-EXPR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.0 0.0 ]
LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR
(PROVE-LEMMA LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1
(REWRITE)
(IMPLIES (AND (LR-PROGRAMS-PROPERP L TABLE)
(EQUAL PROG-SEG (P-PROG-SEGMENT L)))
(AND (LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR PROG-SEG))
TABLE)
(DEFINEDP (AREA-NAME (P-PC L))
PROG-SEG)))
((ENABLE LR-PROGRAMS-PROPERP)))
WARNING: Note that LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1 contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that the proposed lemma:
LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1
is to be stored as zero type prescription rules, zero compound recognizer
rules, zero linear rules, and two replacement rules.
This conjecture can be simplified, using the abbreviations LR-PROGRAMS-PROPERP,
AND, and IMPLIES, to:
(IMPLIES
(AND
(DEFINEDP (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (CDR (STRIP-CARS (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL PROG-SEG (P-PROG-SEGMENT L)))
(AND (LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR PROG-SEG))
TABLE)
(DEFINEDP (AREA-NAME (P-PC L))
PROG-SEG))).
This simplifies, appealing to the lemma CDR-CONS, and unfolding DEFINEDP,
STRIP-CARS, AND, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1
(PROVE-LEMMA LR-PROGRAMS-PROPERP-LR-PROPER-EXPRP-LR-EXPR NIL
(IMPLIES (AND (LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
(LR-PROPER-EXPRP T
(LR-EXPR L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS (P-CURRENT-PROGRAM L))
(STRIP-CARS (TEMP-VAR-DCLS (P-CURRENT-PROGRAM L)))
TABLE))
((USE
(LR-PROGRAMS-PROPERP-1-LR-PROPER-EXPRP
(PROG (P-CURRENT-PROGRAM L))
(PROGRAM-NAMES (STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L))))
(PROGS (P-PROG-SEGMENT L))
(TABLE TABLE))
(LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR
(BODY (PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PNAMES (STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L))))
(FORMALS (FORMAL-VARS (P-CURRENT-PROGRAM L)))
(TEMPS (STRIP-CARS (TEMP-VAR-DCLS (P-CURRENT-PROGRAM L))))
(POS (OFFSET (P-PC L)))
(TABLE TABLE)))
(ENABLE CUR-EXPR LR-EXPR STRIP-CARS P-CURRENT-PROGRAM
GOOD-POSP1-LIST-GOOD-POSP-LIST-T)
(DISABLE LR-PROPER-EXPRP)))
This conjecture simplifies, applying the lemmas
LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1 and MEMBER-ASSOC, and expanding
DEFINITION, P-CURRENT-PROGRAM, AND, IMPLIES, and LR-EXPR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-LR-PROPER-EXPRP-LR-EXPR
(PROVE-LEMMA LR-PROPER-EXPRP-LENGTH-CUR-EXPR NIL
(IMPLIES (AND (LR-PROPER-EXPRP T EXPR PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR)
(OR (SUBRP (CAR EXPR))
(BODY (CAR EXPR)))
(NOT (EQUAL (CAR EXPR) 'QUOTE)))
(EQUAL (LENGTH EXPR)
(ADD1 (ARITY (CAR EXPR)))))
((DISABLE LR-PROPER-EXPRP *1*P-RUNTIME-SUPPORT-PROGRAMS)
(EXPAND (LR-PROPER-EXPRP T EXPR PNAMES FORMALS TEMPS TABLE))))
This simplifies, rewriting with ADD1-EQUAL and SUBRP-BODY, and opening up the
functions LR-PROPER-EXPRP, EQUAL, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST,
SUBRP, BODY, OR, LENGTH, ARITY, ADD1, and NUMBERP, to:
(IMPLIES (AND (PLISTP EXPR)
(NOT (EQUAL (CAR EXPR) '(TEMP-FETCH)))
(NOT (EQUAL (CAR EXPR) '(TEMP-EVAL)))
(NOT (EQUAL (CAR EXPR) '(TEMP-TEST)))
(SUBRP (CAR EXPR))
(EQUAL (LENGTH (CDR EXPR))
(ARITY (CAR EXPR)))
(EQUAL (CAR EXPR) 'IF)
(NOT (MEMBER 'IF PNAMES))
(LR-PROPER-EXPRP 'LIST
(CDR EXPR)
PNAMES FORMALS TEMPS TABLE)
(LISTP EXPR))
(EQUAL (ARITY (CAR EXPR)) 3)),
which again simplifies, unfolding EQUAL, SUBRP, and ARITY, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROPER-EXPRP-LENGTH-CUR-EXPR
(PROVE-LEMMA LISTP-COMP-BODY-1
(REWRITE)
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))
((INDUCT (COMP-BODY-1 FLAG BODY N))
(DISABLE COMP-IF COMP-TEMP-TEST)
(EXPAND (COMP-BODY-1 FLAG BODY N)
(COMP-BODY-1 'LIST BODY N))))
This conjecture can be simplified, using the abbreviations NOT, OR, AND,
S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, and PLUS-ADD1-ARG1, to nine new goals:
Case 9. (IMPLIES
(AND (EQUAL FLAG 'LIST)
(LISTP BODY)
(EQUAL (LISTP (COMP-BODY-1 'LIST
(CDR BODY)
(PLUS N (LR-P-C-SIZE T (CAR BODY)))))
(IF (EQUAL 'LIST 'LIST)
(LISTP (CDR BODY))
T))
(EQUAL (LISTP (COMP-BODY-1 T (CAR BODY) N))
(IF (EQUAL T 'LIST)
(LISTP (CAR BODY))
T)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, appealing to the lemma LISTP-APPEND, and expanding EQUAL
and COMP-BODY-1, to:
T.
Case 8. (IMPLIES (AND (EQUAL FLAG 'LIST)
(NOT (LISTP BODY)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, opening up the definitions of COMP-BODY-1, EQUAL, and
LISTP, to:
T.
Case 7. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL
(LISTP
(COMP-BODY-1 T
(CADDDR BODY)
(PLUS N
(ADD1
(ADD1 (ADD1 (ADD1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))))))))))
(IF (EQUAL T 'LIST)
(LISTP (CADDDR BODY))
T))
(EQUAL
(LISTP
(COMP-BODY-1 T
(CADDR BODY)
(PLUS N
(ADD1 (ADD1 (ADD1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY)))))))))
(IF (EQUAL T 'LIST)
(LISTP (CADDR BODY))
T))
(EQUAL (LISTP (COMP-BODY-1 T (CADR BODY) N))
(IF (EQUAL T 'LIST)
(LISTP (CADR BODY))
T)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, applying the lemmas PLUS-ADD1-ARG2 and PLUS-ADD1-ARG1, and
expanding the functions EQUAL, PLUS, and COMP-BODY-1, to:
T.
Case 6. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, unfolding EQUAL, COMP-BODY-1, and S-TEMP-FETCH, to:
T.
Case 5. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL))
(EQUAL (LISTP (COMP-BODY-1 T (CADR BODY) N))
(IF (EQUAL T 'LIST)
(LISTP (CADR BODY))
T)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, unfolding the definitions of EQUAL, COMP-BODY-1,
S-TEMP-FETCH, and S-TEMP-EVAL, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST))
(EQUAL (LISTP (COMP-BODY-1 T
(CADR BODY)
(PLUS N 4)))
(IF (EQUAL T 'LIST)
(LISTP (CADR BODY))
T)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, applying the lemmas PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and
expanding the functions EQUAL, NUMBERP, ZEROP, COMP-BODY-1, S-TEMP-FETCH,
S-TEMP-EVAL, S-TEMP-TEST, and ADD1, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, expanding the functions EQUAL, COMP-BODY-1, S-TEMP-FETCH,
S-TEMP-EVAL, and S-TEMP-TEST, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LISTP (COMP-BODY-1 'LIST (CDR BODY) N))
(IF (EQUAL 'LIST 'LIST)
(LISTP (CDR BODY))
T)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, unfolding EQUAL, COMP-BODY-1, S-TEMP-FETCH, S-TEMP-EVAL,
S-TEMP-TEST, P-RUNTIME-SUPPORT-PROGRAMS, CDR, CAR, LISTP, and DEFINEDP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP BODY)))
(EQUAL (LISTP (COMP-BODY-1 FLAG BODY N))
(IF (EQUAL FLAG 'LIST)
(LISTP BODY)
T))),
which simplifies, expanding the definitions of COMP-BODY-1 and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
LISTP-COMP-BODY-1
(PROVE-LEMMA CAR-APPEND
(REWRITE)
(IMPLIES (LISTP X)
(EQUAL (CAR (APPEND X Y)) (CAR X))))
.
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate (CAR X)
and (CDR X). We would thus like to prove:
(EQUAL (CAR (APPEND (CONS Z V) Y)) Z),
which simplifies, applying CDR-CONS and CAR-CONS, and opening up the function
APPEND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-APPEND
(PROVE-LEMMA LENGTH-CDR-COMP-IF-COMP-BODY
(REWRITE)
(EQUAL (LENGTH (COMP-IF (COMP-BODY-1 T TEST N1)
(COMP-BODY-1 T THEN N2)
(COMP-BODY-1 T ELSE N3)
N))
(PLUS (LENGTH (COMP-BODY-1 T TEST N1))
(LENGTH (COMP-BODY-1 T THEN N2))
(LENGTH (COMP-BODY-1 T ELSE N3))
4)))
This simplifies, rewriting with the lemmas APPEND-LEFT-ID, CAR-CONS, CDR-CONS,
COMMUTATIVITY2-OF-PLUS, COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, PLUS-ADD1-ARG1,
LENGTH-CONS, LENGTH-APPEND, and PLUS-ZERO-ARG2, and expanding APPEND, PLUS,
EQUAL, CONS, LR-F-ADDR, COMP-IF, NUMBERP, and ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-CDR-COMP-IF-COMP-BODY
(PROVE-LEMMA LR-P-C-SIZE-LIST-0-OPENER
(REWRITE)
(EQUAL (LR-P-C-SIZE-LIST 0 EXPR) 0))
This simplifies, unfolding EQUAL and LR-P-C-SIZE-LIST, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE-LIST-0-OPENER
(PROVE-LEMMA LR-P-C-SIZE-LIST-ADD1-OPENER
(REWRITE)
(IMPLIES (LESSP (ADD1 N) (LENGTH EXPR))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 N) EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST N (CDR EXPR)))))
((EXPAND (LR-P-C-SIZE-LIST 1 EXPR))
(INDUCT (LR-P-C-SIZE-LIST N EXPR))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (ZEROP N)
(LESSP (ADD1 N) (LENGTH EXPR)))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 N) EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST N (CDR EXPR))))),
which simplifies, appealing to the lemmas LENGTH-NLISTP,
LR-P-C-SIZE-LIST-0-OPENER, CDR-NLISTP, SUB1-ADD1, EQUAL-LENGTH-0, GET-ZEROP,
GET-ADD1-OPENER, PLUS-ZERO-ARG2, and SUB1-TYPE-RESTRICTION, and opening up
ZEROP, ADD1, LENGTH, LR-P-C-SIZE-LIST, EQUAL, NUMBERP, LESSP, SUB1, CAR,
LR-P-C-SIZE, and PLUS, to four new formulas:
Case 3.4.
(IMPLIES (AND (EQUAL N 0) (NOT (LISTP EXPR)))
(NOT (LESSP 1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL N 0)
(LISTP EXPR)
(LESSP 1 (ADD1 (LENGTH (CDR EXPR))))
(NOT (LISTP (CDR EXPR))))
(EQUAL 0
(LR-P-C-SIZE T (CADR EXPR)))),
which again simplifies, applying LENGTH-NLISTP, and expanding ADD1 and
LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP EXPR)))
(NOT (LESSP 1 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP N))
(LISTP EXPR)
(LESSP 1 (ADD1 (LENGTH (CDR EXPR))))
(NOT (LISTP (CDR EXPR))))
(EQUAL 0
(LR-P-C-SIZE T (CADR EXPR)))),
which again simplifies, rewriting with LENGTH-NLISTP, and opening up the
definitions of ADD1 and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP N (LENGTH EXPR))
(IMPLIES (LESSP (ADD1 (SUB1 N)) (LENGTH EXPR))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 (SUB1 N))
EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST (SUB1 N)
(CDR EXPR)))))
(LESSP (ADD1 N) (LENGTH EXPR)))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 N) EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST N (CDR EXPR))))).
This simplifies, rewriting with ADD1-SUB1, LENGTH-NLISTP,
LR-P-C-SIZE-LIST-0-OPENER, CDR-NLISTP, EQUAL-SUB1-0, SUB1-ADD1,
COMMUTATIVITY-OF-PLUS, GET-ADD1-OPENER, and CORRECTNESS-OF-CANCEL-EQUAL-PLUS,
and opening up the functions LENGTH, EQUAL, LESSP, SUB1, LR-P-C-SIZE-LIST,
CAR, LR-P-C-SIZE, PLUS, IMPLIES, and FIX, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LISTP EXPR)
(LESSP N (ADD1 (LENGTH (CDR EXPR))))
(NOT (LESSP (SUB1 N) (LENGTH (CDR EXPR))))
(LESSP N (LENGTH (CDR EXPR))))
(EQUAL (LR-P-C-SIZE-LIST N EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST (SUB1 N)
(CDR EXPR))))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP N (LENGTH EXPR)))
(IMPLIES (LESSP (ADD1 (SUB1 (LENGTH EXPR)))
(LENGTH EXPR))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 (SUB1 (LENGTH EXPR)))
EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH EXPR))
(CDR EXPR)))))
(LESSP (ADD1 N) (LENGTH EXPR)))
(EQUAL (LR-P-C-SIZE-LIST (ADD1 N) EXPR)
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST N (CDR EXPR))))),
which simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
LR-P-C-SIZE-LIST-ADD1-OPENER
(PROVE-LEMMA LENGTH-COMP-BODY-1-LR-P-C-SIZE
(REWRITE)
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))
((ENABLE CAR-RESTN-GET GET-ADD1-OPENER GET-ZEROP)
(INDUCT (COMP-BODY-1 FLAG BODY N))
(DISABLE COMP-IF LR-P-C-SIZE LR-P-C-SIZE-LIST)
(EXPAND (COMP-BODY-1 FLAG BODY N)
(COMP-BODY-1 'LIST BODY N)
(LR-P-C-SIZE FLAG BODY)
(LR-P-C-SIZE 'LIST BODY))))
This conjecture can be simplified, using the abbreviations NOT, OR, AND,
S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, and PLUS-ADD1-ARG1, to nine new goals:
Case 9. (IMPLIES
(AND (EQUAL FLAG 'LIST)
(LISTP BODY)
(EQUAL (LENGTH (COMP-BODY-1 'LIST
(CDR BODY)
(PLUS N (LR-P-C-SIZE T (CAR BODY)))))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (LENGTH (COMP-BODY-1 T (CAR BODY) N))
(LR-P-C-SIZE T (CAR BODY))))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))),
which simplifies, applying LENGTH-APPEND, and expanding COMP-BODY-1, EQUAL,
and LR-P-C-SIZE, to:
T.
Case 8. (IMPLIES (AND (EQUAL FLAG 'LIST)
(NOT (LISTP BODY)))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, opening up COMP-BODY-1, EQUAL, LENGTH, and LR-P-C-SIZE, to:
T.
Case 7. (IMPLIES
(AND
(NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL
(LENGTH
(COMP-BODY-1 T
(CADDDR BODY)
(PLUS N
(ADD1
(ADD1 (ADD1 (ADD1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))))))))))
(LR-P-C-SIZE T (CADDDR BODY)))
(EQUAL
(LENGTH
(COMP-BODY-1 T
(CADDR BODY)
(PLUS N
(ADD1 (ADD1 (ADD1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY)))))))))
(LR-P-C-SIZE T (CADDR BODY)))
(EQUAL (LENGTH (COMP-BODY-1 T (CADR BODY) N))
(LR-P-C-SIZE T (CADR BODY))))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, rewriting with PLUS-ADD1-ARG2, PLUS-ADD1-ARG1,
PLUS-ZERO-ARG2, and LENGTH-CDR-COMP-IF-COMP-BODY, and expanding the
functions EQUAL, PLUS, COMP-BODY-1, NUMBERP, ZEROP, and LR-P-C-SIZE, to:
T.
Case 6. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))),
which simplifies, rewriting with LENGTH-CONS, and expanding the definitions
of EQUAL, COMP-BODY-1, S-TEMP-FETCH, LENGTH, ADD1, and LR-P-C-SIZE, to:
T.
Case 5. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL))
(EQUAL (LENGTH (COMP-BODY-1 T (CADR BODY) N))
(LR-P-C-SIZE T (CADR BODY))))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, rewriting with LENGTH-CONS, PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
and LENGTH-APPEND, and expanding the functions EQUAL, COMP-BODY-1,
S-TEMP-FETCH, S-TEMP-EVAL, LENGTH, ADD1, NUMBERP, ZEROP, and LR-P-C-SIZE, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST))
(EQUAL (LENGTH (COMP-BODY-1 T
(CADR BODY)
(PLUS N 4)))
(LR-P-C-SIZE T (CADR BODY))))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))),
which simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
APPEND-LEFT-ID, CAR-CONS, CDR-CONS, PLUS-ADD1-ARG1, LENGTH-CONS, and
LENGTH-APPEND, and expanding the definitions of EQUAL, NUMBERP, ZEROP,
COMP-BODY-1, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, ADD1, APPEND, PLUS,
CONS, LR-UNDEF-ADDR, COMP-TEMP-TEST, LENGTH, and LR-P-C-SIZE, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, appealing to the lemma LENGTH-CONS, and unfolding EQUAL,
COMP-BODY-1, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, LENGTH, ADD1, and
LR-P-C-SIZE, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY))))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, applying PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and unfolding
the functions COMP-BODY-1, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST,
P-RUNTIME-SUPPORT-PROGRAMS, CDR, CAR, LISTP, DEFINEDP, LR-P-C-SIZE, NUMBERP,
and ZEROP, to ten new goals:
Case 2.10.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'CAR))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))),
which again simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LENGTH-APPEND, and expanding the functions EQUAL, LENGTH, NUMBERP, and
ZEROP, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'CONS))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))).
But this again simplifies, applying the lemmas PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, and LENGTH-APPEND, and expanding the functions EQUAL,
LENGTH, NUMBERP, and ZEROP, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'FALSEP))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))),
which again simplifies, appealing to the lemmas PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, and LENGTH-APPEND, and unfolding EQUAL, LENGTH, NUMBERP,
and ZEROP, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'NLISTP))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))),
which again simplifies, rewriting with the lemmas PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, and LENGTH-APPEND, and expanding the functions EQUAL,
LENGTH, NUMBERP, and ZEROP, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'TRUEP))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))),
which again simplifies, applying the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
and LENGTH-APPEND, and opening up the definitions of EQUAL, LENGTH,
NUMBERP, and ZEROP, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'TRUE))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))),
which again simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LENGTH-APPEND, and opening up the functions EQUAL, LENGTH, NUMBERP, and
ZEROP, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'LISTP))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))).
But this again simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
and LENGTH-APPEND, and opening up the functions EQUAL, LENGTH, NUMBERP,
and ZEROP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'FALSE))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))).
But this again simplifies, applying PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LENGTH-APPEND, and opening up the functions EQUAL, LENGTH, NUMBERP, and
ZEROP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(EQUAL (CAR BODY) 'CDR))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL (CAR BODY)))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))).
But this again simplifies, applying PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LENGTH-APPEND, and expanding the functions EQUAL, LENGTH, NUMBERP, and
ZEROP, to:
T.
Case 2.1.
(IMPLIES
(AND (NOT (EQUAL FLAG 'LIST))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(EQUAL (LENGTH (COMP-BODY-1 'LIST (CDR BODY) N))
(LR-P-C-SIZE 'LIST (CDR BODY)))
(NOT (EQUAL (CAR BODY) 'CAR))
(NOT (EQUAL (CAR BODY) 'CDR))
(NOT (EQUAL (CAR BODY) 'CONS))
(NOT (EQUAL (CAR BODY) 'FALSE))
(NOT (EQUAL (CAR BODY) 'FALSEP))
(NOT (EQUAL (CAR BODY) 'LISTP))
(NOT (EQUAL (CAR BODY) 'NLISTP))
(NOT (EQUAL (CAR BODY) 'TRUE))
(NOT (EQUAL (CAR BODY) 'TRUEP)))
(EQUAL (LENGTH (APPEND (COMP-BODY-1 'LIST (CDR BODY) N)
(LIST (LIST 'CALL
(USER-FNAME (CAR BODY))))))
(ADD1 (LR-P-C-SIZE 'LIST (CDR BODY))))).
This again simplifies, applying LENGTH-CONS, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, and LENGTH-APPEND, and unfolding the definitions of LENGTH,
ADD1, NUMBERP, and ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL FLAG 'LIST))
(NOT (LISTP BODY)))
(EQUAL (LENGTH (COMP-BODY-1 FLAG BODY N))
(LR-P-C-SIZE FLAG BODY))).
This simplifies, applying LENGTH-CONS, and unfolding the definitions of
COMP-BODY-1, LENGTH, ADD1, LR-P-C-SIZE, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.5 0.1 ]
LENGTH-COMP-BODY-1-LR-P-C-SIZE
(DISABLE LR-P-C-SIZE-LIST-ADD1-OPENER)
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE-LIST-ADD1-OPENER-OFF
(PROVE-LEMMA LENGTH-LABEL-INSTRS
(REWRITE)
(EQUAL (LENGTH (LABEL-INSTRS INSTRS N))
(LENGTH INSTRS)))
Call the conjecture *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest two inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP INSTRS)
(p (CDR INSTRS) (ADD1 N)))
(p INSTRS N))
(IMPLIES (NOT (LISTP INSTRS))
(p INSTRS N))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish that the
measure (COUNT INSTRS) decreases according to the well-founded relation LESSP
in each induction step of the scheme. Note, however, the inductive instance
chosen for N. The above induction scheme generates the following two new
formulas:
Case 2. (IMPLIES (AND (LISTP INSTRS)
(EQUAL (LENGTH (LABEL-INSTRS (CDR INSTRS) (ADD1 N)))
(LENGTH (CDR INSTRS))))
(EQUAL (LENGTH (LABEL-INSTRS INSTRS N))
(LENGTH INSTRS))).
This simplifies, applying LENGTH-CONS, and expanding the functions
LABEL-INSTRS, DL, and LENGTH, to:
T.
Case 1. (IMPLIES (NOT (LISTP INSTRS))
(EQUAL (LENGTH (LABEL-INSTRS INSTRS N))
(LENGTH INSTRS))),
which simplifies, appealing to the lemma LENGTH-NLISTP, and unfolding the
functions LABEL-INSTRS, LENGTH, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-LABEL-INSTRS
(PROVE-LEMMA LENGTH-COMP-BODY-LR-P-C-SIZE
(REWRITE)
(EQUAL (LENGTH (COMP-BODY BODY))
(ADD1 (LR-P-C-SIZE T BODY)))
((ENABLE COMP-BODY)
(DISABLE LR-P-C-SIZE)))
This conjecture can be simplified, using the abbreviations LENGTH-CONS,
LENGTH-COMP-BODY-1-LR-P-C-SIZE, LENGTH-APPEND, LENGTH-LABEL-INSTRS, and
COMP-BODY, to:
(EQUAL (PLUS (LR-P-C-SIZE T BODY)
(ADD1 (LENGTH NIL)))
(ADD1 (LR-P-C-SIZE T BODY))).
This simplifies, applying PLUS-ZERO-ARG2 and PLUS-ADD1-ARG2, and unfolding the
functions LENGTH, ADD1, NUMBERP, and ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-COMP-BODY-LR-P-C-SIZE
(PROVE-LEMMA LR-P-C-SIZE-FLAG-LIST
(REWRITE)
(EQUAL (LR-P-C-SIZE 'LIST (CDR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH EXPR))
EXPR))
((INDUCT (LENGTH EXPR))
(ENABLE LR-P-C-SIZE-LIST-ADD1-OPENER)
(EXPAND (LR-P-C-SIZE-LIST 0 EXPR))
(DISABLE LR-P-C-SIZE-LIST)))
This formula can be simplified, using the abbreviations NOT, OR, and AND, to
the following two new formulas:
Case 2. (IMPLIES (NOT (LISTP EXPR))
(EQUAL (LR-P-C-SIZE 'LIST (CDR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH EXPR))
EXPR))).
This simplifies, appealing to the lemmas CDR-NLISTP, LENGTH-NLISTP, and
LR-P-C-SIZE-LIST-0-OPENER, and unfolding LR-P-C-SIZE, SUB1, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (LISTP EXPR)
(EQUAL (LR-P-C-SIZE 'LIST (CDDR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH (CDR EXPR)))
(CDR EXPR))))
(EQUAL (LR-P-C-SIZE 'LIST (CDR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH EXPR))
EXPR))).
This simplifies, using linear arithmetic, applying the lemmas LENGTH-NLISTP,
LR-P-C-SIZE-LIST-0-OPENER, SUB1-ADD1, and LR-P-C-SIZE-LIST-ADD1-OPENER, and
expanding the definitions of LENGTH, EQUAL, LR-P-C-SIZE, ADD1, and SUB1, to:
(IMPLIES
(AND (LISTP EXPR)
(LISTP (CDR EXPR))
(EQUAL (LR-P-C-SIZE 'LIST (CDDR EXPR))
(LR-P-C-SIZE-LIST (SUB1 (ADD1 (LENGTH (CDDR EXPR))))
(CDR EXPR))))
(EQUAL (LR-P-C-SIZE 'LIST (CDR EXPR))
(PLUS (LR-P-C-SIZE T (CADR EXPR))
(LR-P-C-SIZE-LIST (LENGTH (CDDR EXPR))
(CDR EXPR))))),
which again simplifies, applying the lemma SUB1-ADD1, and expanding the
functions EQUAL and LR-P-C-SIZE, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE-FLAG-LIST
(PROVE-LEMMA LR-PROPER-EXPRP-CAR-IF-CADR
(REWRITE)
(IMPLIES (AND (LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF))
(LR-PROPER-EXPRP T
(CADR BODY)
PNAMES FORMALS TEMPS TABLE)))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace BODY by (CONS X Z) to
eliminate (CAR BODY) and (CDR BODY) and Z by (CONS V W) to eliminate (CAR Z)
and (CDR Z). We must thus prove two new formulas:
Case 2. (IMPLIES (AND (NOT (LISTP Z))
(LR-PROPER-EXPRP T
(CONS X Z)
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CAR Z)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, applying CDR-CONS, CAR-CONS, PLISTP-CONS, and
PLISTP-NLISTP, and unfolding ARITY, LENGTH, SUBRP, S-TEMP-TEST, S-TEMP-EVAL,
S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP, to:
T.
Case 1. (IMPLIES (AND (LR-PROPER-EXPRP T
(CONS X (CONS V W))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T V PNAMES FORMALS TEMPS TABLE)).
But this simplifies, rewriting with the lemmas ADD1-EQUAL, LENGTH-CONS,
CDR-CONS, CAR-CONS, and PLISTP-CONS, and opening up the definitions of
NUMBERP, ARITY, SUBRP, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and
LR-PROPER-EXPRP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROPER-EXPRP-CAR-IF-CADR
(PROVE-LEMMA LR-PROPER-EXPRP-CAR-IF-CADDR
(REWRITE)
(IMPLIES (AND (LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF))
(LR-PROPER-EXPRP T
(CADDR BODY)
PNAMES FORMALS TEMPS TABLE)))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace BODY by (CONS X Z) to
eliminate (CAR BODY) and (CDR BODY), Z by (CONS W V) to eliminate (CDR Z) and
(CAR Z), and V by (CONS Z D) to eliminate (CAR V) and (CDR V). The result is
three new formulas:
Case 3. (IMPLIES (AND (NOT (LISTP Z))
(LR-PROPER-EXPRP T
(CONS X Z)
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CADR Z)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, applying CDR-CONS, CAR-CONS, PLISTP-CONS, and
PLISTP-NLISTP, and expanding ARITY, LENGTH, SUBRP, S-TEMP-TEST, S-TEMP-EVAL,
S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP V))
(LR-PROPER-EXPRP T
(CONS X (CONS W V))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CAR V)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, rewriting with LENGTH-CONS, CDR-CONS, CAR-CONS, PLISTP-CONS,
and PLISTP-NLISTP, and unfolding the definitions of ARITY, ADD1, LENGTH,
SUBRP, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP,
to:
T.
Case 1. (IMPLIES (AND (LR-PROPER-EXPRP T
(CONS X (CONS W (CONS Z D)))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T Z PNAMES FORMALS TEMPS TABLE)).
This simplifies, rewriting with ADD1-EQUAL, LENGTH-CONS, CDR-CONS, CAR-CONS,
and PLISTP-CONS, and expanding the definitions of NUMBERP, ARITY, SUBRP,
S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LR-PROPER-EXPRP-CAR-IF-CADDR
(PROVE-LEMMA LR-PROPER-EXPRP-CAR-IF-CADDDR
(REWRITE)
(IMPLIES (AND (LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF))
(LR-PROPER-EXPRP T
(CADDDR BODY)
PNAMES FORMALS TEMPS TABLE)))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace BODY by (CONS X Z) to
eliminate (CAR BODY) and (CDR BODY), Z by (CONS W V) to eliminate (CDR Z) and
(CAR Z), V by (CONS D Z) to eliminate (CDR V) and (CAR V), and Z by (CONS V C)
to eliminate (CAR Z) and (CDR Z). This generates four new formulas:
Case 4. (IMPLIES (AND (NOT (LISTP Z))
(LR-PROPER-EXPRP T
(CONS X Z)
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CADDR Z)
PNAMES FORMALS TEMPS TABLE)),
which simplifies, rewriting with CDR-CONS, CAR-CONS, PLISTP-CONS, and
PLISTP-NLISTP, and opening up the definitions of ARITY, LENGTH, SUBRP,
S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP V))
(LR-PROPER-EXPRP T
(CONS X (CONS W V))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CADR V)
PNAMES FORMALS TEMPS TABLE)).
However this simplifies, applying LENGTH-CONS, CDR-CONS, CAR-CONS,
PLISTP-CONS, and PLISTP-NLISTP, and expanding the definitions of ARITY, ADD1,
LENGTH, SUBRP, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and
LR-PROPER-EXPRP, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP Z))
(LR-PROPER-EXPRP T
(CONS X (CONS W (CONS D Z)))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T
(CAR Z)
PNAMES FORMALS TEMPS TABLE)).
This simplifies, applying LENGTH-CONS, CDR-CONS, CAR-CONS, PLISTP-CONS, and
PLISTP-NLISTP, and expanding the definitions of ARITY, ADD1, LENGTH, SUBRP,
S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, EQUAL, and LR-PROPER-EXPRP, to:
T.
Case 1. (IMPLIES (AND (LR-PROPER-EXPRP T
(CONS X (CONS W (CONS D (CONS V C))))
PNAMES FORMALS TEMPS TABLE)
(EQUAL X 'IF))
(LR-PROPER-EXPRP T V PNAMES FORMALS TEMPS TABLE)).
This simplifies, appealing to the lemmas ADD1-EQUAL, EQUAL-LENGTH-0,
LENGTH-CONS, CDR-CONS, CAR-CONS, and PLISTP-CONS, and opening up the
definitions of NUMBERP, ARITY, SUBRP, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH,
EQUAL, and LR-PROPER-EXPRP, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
LR-PROPER-EXPRP-CAR-IF-CADDDR
(PROVE-LEMMA GOOD-POSP-LIST-T-OFFSET-PROGRAM-BODY
(REWRITE)
(IMPLIES (AND (GOOD-POSP 'LIST
(OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(LISTP (LR-EXPR-LIST L))
(LISTP (OFFSET (P-PC L))))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
((ENABLE GOOD-POSP LR-EXPR-LIST)
(DISABLE GOOD-POSP-LIST)))
This conjecture simplifies, appealing to the lemmas LISTP-RESTN and
GOOD-POSP-LIST-NX-T-SIMPLE, and opening up EQUAL, GOOD-POSP, and LR-EXPR-LIST,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
GOOD-POSP-LIST-T-OFFSET-PROGRAM-BODY
(PROVE-LEMMA GOOD-POSP-LIST-NX-OFFSET-PROGRAM-BODY
(REWRITE)
(IMPLIES (AND (GOOD-POSP 'LIST
(OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(LISTP (OFFSET (P-PC L)))
(LISTP (LR-EXPR-LIST L)))
(GOOD-POSP 'LIST
(NX (OFFSET (P-PC L)))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
((ENABLE GOOD-POSP LR-EXPR-LIST)))
This simplifies, applying the lemmas LISTP-RESTN and
GOOD-POSP-LIST-NX-T-SIMPLE, and opening up the functions GOOD-POSP-LIST,
S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, EQUAL, GOOD-POSP, and LR-EXPR-LIST, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
GOOD-POSP-LIST-NX-OFFSET-PROGRAM-BODY
(PROVE-LEMMA NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS
(REWRITE)
(AND (EQUAL (NAME (CONS NAME REST)) NAME)
(EQUAL (FORMAL-VARS (CONS NAME (CONS FORMAL-VARS REST)))
FORMAL-VARS)
(EQUAL (TEMP-VAR-DCLS (CONS NAME
(CONS FORMAL-VARS
(CONS TEMP-VAR-DCLS PROGRAM-BODY))))
TEMP-VAR-DCLS)
(EQUAL (PROGRAM-BODY (CONS NAME
(CONS FORMAL-VARS
(CONS TEMP-VAR-DCLS PROGRAM-BODY))))
PROGRAM-BODY))
((ENABLE NAME FORMAL-VARS TEMP-VAR-DCLS PROGRAM-BODY)))
WARNING: Note that the proposed lemma:
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS
is to be stored as zero type prescription rules, zero compound recognizer
rules, zero linear rules, and four replacement rules.
This conjecture can be simplified, using the abbreviations AND, PROGRAM-BODY,
TEMP-VAR-DCLS, CDR-CONS, FORMAL-VARS, CAR-CONS, and NAME, to four new formulas:
Case 4. (EQUAL NAME NAME),
which simplifies, trivially, to:
T.
Case 3. (EQUAL FORMAL-VARS FORMAL-VARS).
This simplifies, clearly, to:
T.
Case 2. (EQUAL TEMP-VAR-DCLS TEMP-VAR-DCLS).
This simplifies, obviously, to:
T.
Case 1. (EQUAL PROGRAM-BODY PROGRAM-BODY).
This simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS
(PROVE-LEMMA PROGRAM-BODY-ASSOC-COMP-PROGRAMS-1
(REWRITE)
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (PROGRAM-BODY (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (PROGRAM-BODY (ASSOC NAME PROGRAMS)))))
((ENABLE NAME PROGRAM-BODY)))
This formula can be simplified, using the abbreviations IMPLIES and
PROGRAM-BODY, to the new conjecture:
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (CDDDR (ASSOC NAME PROGRAMS))))),
which we will name *1.
Perhaps we can prove it by induction. Three inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP PROGRAMS)
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS)))
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(p NAME (CDR PROGRAMS)))
(p NAME PROGRAMS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT PROGRAMS) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces four new formulas:
Case 4. (IMPLIES (AND (NLISTP PROGRAMS)
(DEFINEDP NAME PROGRAMS))
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (CDDDR (ASSOC NAME PROGRAMS))))),
which simplifies, opening up the definitions of NLISTP and DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (CDDDR (ASSOC NAME PROGRAMS))))),
which simplifies, appealing to the lemmas CAR-CONS and CDR-CONS, and
expanding the definitions of NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME,
PROGRAM-BODY, LR-MAKE-PROGRAM, and ASSOC, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(NOT (DEFINEDP NAME (CDR PROGRAMS)))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (CDDDR (ASSOC NAME PROGRAMS))))),
which simplifies, unfolding the definitions of NLISTP and DEFINEDP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(COMP-BODY (CDDDR (ASSOC NAME (CDR PROGRAMS)))))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CDDDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(COMP-BODY (CDDDR (ASSOC NAME PROGRAMS))))),
which simplifies, applying CDR-CONS and CAR-CONS, and opening up the
functions NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME, PROGRAM-BODY,
LR-MAKE-PROGRAM, and ASSOC, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROGRAM-BODY-ASSOC-COMP-PROGRAMS-1
(PROVE-LEMMA PROGRAM-BODY-ASSOC-COMP-PROGRAMS
(REWRITE)
(IMPLIES
(DEFINEDP NAME PROGRAMS)
(EQUAL
(PROGRAM-BODY (ASSOC NAME (COMP-PROGRAMS PROGRAMS)))
(IF
(EQUAL NAME (NAME (CAR PROGRAMS)))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
(LIST (IDENTITY (LIST 'SET-GLOBAL
(AREA-NAME (LR-ANSWER-ADDR))))
'(RET)))
0)
(COMP-BODY (PROGRAM-BODY (ASSOC NAME (CDR PROGRAMS)))))))
((ENABLE COMP-PROGRAMS NAME ASSOC-APPEND-1)
(DISABLE COMP-PROGRAMS-1)))
This conjecture can be simplified, using the abbreviations IMPLIES, CAR-CONS,
ADP-NAME, AREA-NAME-TAG, LR-ANSWER-ADDR, IDENTITY, and NAME, to:
(IMPLIES
(DEFINEDP NAME PROGRAMS)
(EQUAL
(PROGRAM-BODY (ASSOC NAME (COMP-PROGRAMS PROGRAMS)))
(IF (EQUAL NAME (CAAR PROGRAMS))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)
(COMP-BODY (PROGRAM-BODY (ASSOC NAME (CDR PROGRAMS))))))).
This simplifies, rewriting with CDR-CONS, CAR-CONS,
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG, ASSOC-APPEND-1, and
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS, and opening up the
definitions of DEFINEDP, P-RUNTIME-SUPPORT-PROGRAMS, LR-MAKE-PROGRAM, CONS,
AREA-NAME, LR-ANSWER-ADDR, NAME, COMP-PROGRAMS, and ASSOC, to two new formulas:
Case 2. (IMPLIES
(AND (LISTP PROGRAMS)
(DEFINEDP NAME (CDR PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS))))
(EQUAL (PROGRAM-BODY (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(COMP-BODY (PROGRAM-BODY (ASSOC NAME (CDR PROGRAMS)))))),
which again simplifies, appealing to the lemma
PROGRAM-BODY-ASSOC-COMP-PROGRAMS-1, to:
T.
Case 1. (IMPLIES
(AND (LISTP PROGRAMS)
(DEFINEDP NAME (CDR PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS)))
(EQUAL
(PROGRAM-BODY
(CONS NAME
(CONS
(FORMAL-VARS (CAR PROGRAMS))
(CONS
(TEMP-VAR-DCLS (CAR PROGRAMS))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
'((SET-GLOBAL ANSWER) (RET)))
0))),
which again simplifies, applying the lemma
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PROGRAM-BODY-ASSOC-COMP-PROGRAMS
(PROVE-LEMMA DEFINEDP-AREA-NAME-MEMBER-P-CURRENT-PROGRAM
(REWRITE)
(IMPLIES (DEFINEDP (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))
(MEMBER (P-CURRENT-PROGRAM L)
(P-PROG-SEGMENT L)))
((ENABLE P-CURRENT-PROGRAM)))
This conjecture simplifies, applying MEMBER-ASSOC, and expanding the functions
DEFINITION and P-CURRENT-PROGRAM, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DEFINEDP-AREA-NAME-MEMBER-P-CURRENT-PROGRAM
(DEFN INDUCT-HINT-6
(N BODY)
(IF (LESSP N (LENGTH BODY))
(INDUCT-HINT-6 (ADD1 N) BODY)
T)
((LESSP (DIFFERENCE (ADD1 (LENGTH BODY)) N))))
Linear arithmetic informs us that the measure:
(DIFFERENCE (ADD1 (LENGTH BODY)) N)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, INDUCT-HINT-6 is accepted under the definitional principle. From the
definition we can conclude that (TRUEP (INDUCT-HINT-6 N BODY)) is a theorem.
[ 0.0 0.0 0.0 ]
INDUCT-HINT-6
(PROVE-LEMMA LR-P-C-SIZE-LIST-0
(REWRITE)
(IMPLIES (LISTP BODY)
(EQUAL (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(OR (ZEROP N) (NLISTP (CDR BODY))))))
This formula simplifies, opening up the definitions of ZEROP, NLISTP, and OR,
to the following four new formulas:
Case 4. (IMPLIES (AND (LISTP BODY)
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)))
(LISTP (CDR BODY))).
Appealing to the lemma CAR-CDR-ELIM, we now replace BODY by (CONS Z X) to
eliminate (CDR BODY) and (CAR BODY). This generates:
(IMPLIES (NOT (EQUAL (LR-P-C-SIZE-LIST N (CONS Z X))
0))
(LISTP X)),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(IMPLIES (LISTP BODY)
(EQUAL (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(OR (ZEROP N) (NLISTP (CDR BODY))))),
which we named *1 above. We will appeal to induction. There is only one
plausible induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N BODY))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP N (LENGTH BODY))
(p (SUB1 N) BODY))
(p N BODY))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP N (LENGTH BODY)))
(p (SUB1 (LENGTH BODY)) BODY))
(p N BODY))).
Linear arithmetic, the lemmas COUNT-NUMBERP and EQUAL-LENGTH-0, and the
definitions of ZEROP, SUB1, LESSP, and EQUAL can be used to prove that the
measure (COUNT N) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to three
new formulas:
Case 3. (IMPLIES (AND (ZEROP N) (LISTP BODY))
(EQUAL (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(OR (ZEROP N) (NLISTP (CDR BODY))))),
which simplifies, applying LR-P-C-SIZE-LIST-0-OPENER, and unfolding ZEROP,
EQUAL, NLISTP, OR, and LR-P-C-SIZE-LIST, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP N (LENGTH BODY))
(EQUAL (EQUAL (LR-P-C-SIZE-LIST (SUB1 N) BODY)
0)
(OR (ZEROP (SUB1 N))
(NLISTP (CDR BODY))))
(LISTP BODY))
(EQUAL (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(OR (ZEROP N) (NLISTP (CDR BODY))))).
This simplifies, rewriting with SUB1-ADD1, EQUAL-SUB1-0, LENGTH-NLISTP,
COMMUTATIVITY-OF-PLUS, and EQUAL-PLUS-0, and opening up the functions ZEROP,
LENGTH, LESSP, NLISTP, OR, LR-P-C-SIZE-LIST, ADD1, SUB1, NUMBERP, and EQUAL,
to three new goals:
Case 2.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 N) BODY)
0)
(NOT (LISTP (CDR BODY)))
(LISTP BODY))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)
0)),
which again simplifies, rewriting with LENGTH-NLISTP, and opening up the
functions EQUAL and LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 N) BODY)
0)
(EQUAL N 1)
(LISTP BODY)
(NOT (EQUAL (LR-P-C-SIZE-LIST 1 BODY) 0)))
(LISTP (CDR BODY))).
However this again simplifies, applying the lemma LENGTH-NLISTP, and
expanding the definitions of EQUAL, NUMBERP, SUB1, and LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 N) BODY)
0)
(EQUAL N 1)
(LISTP BODY)
(EQUAL (LR-P-C-SIZE-LIST 1 BODY) 0))
(NOT (LISTP (CDR BODY)))),
which again simplifies, rewriting with EQUAL-LENGTH-0,
LR-P-C-SIZE-LIST-0-OPENER, PLUS-ZERO-ARG2, GET-ADD1-OPENER, GET-ZEROP,
SUB1-ADD1, and LR-P-C-SIZE-FLAG-NOT-LIST-NOT-0, and unfolding EQUAL,
NUMBERP, SUB1, LESSP, ZEROP, LENGTH, and LR-P-C-SIZE-LIST, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP N (LENGTH BODY)))
(EQUAL (EQUAL (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)
0)
(OR (ZEROP (SUB1 (LENGTH BODY)))
(NLISTP (CDR BODY))))
(LISTP BODY))
(EQUAL (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(OR (ZEROP N) (NLISTP (CDR BODY))))).
This simplifies, applying SUB1-ADD1, EQUAL-LENGTH-0, LENGTH-NLISTP, and
COMMUTATIVITY-OF-PLUS, and opening up ZEROP, LENGTH, LESSP, NLISTP, OR,
LR-P-C-SIZE-LIST, EQUAL, and ADD1, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR BODY))))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)
0)
(NOT (LISTP (CDR BODY)))
(LISTP BODY)
(LESSP N 1))
(EQUAL (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))
0)).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LR-P-C-SIZE-LIST-0
(DISABLE LR-P-C-SIZE-LIST-0)
[ 0.0 0.0 0.0 ]
LR-P-C-SIZE-LIST-0-OFF
(PROVE-LEMMA LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH
(REWRITE)
(IMPLIES (NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)))
((INDUCT (INDUCT-HINT-6 N BODY))
(ENABLE LR-P-C-SIZE-LIST-0)))
WARNING: When the linear lemma LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH is
stored under (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY)) BODY) it contains the free
variable N which will be chosen by instantiating the hypothesis:
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)).
WARNING: Note that the proposed lemma:
LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH
is to be stored as zero type prescription rules, zero compound recognizer
rules, two linear rules, and zero replacement rules.
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to two new goals:
Case 2. (IMPLIES (AND (LESSP N (LENGTH BODY))
(IMPLIES (NOT (EQUAL (LR-P-C-SIZE-LIST (ADD1 N) BODY)
0))
(LESSP (SUB1 (LR-P-C-SIZE-LIST (ADD1 N) BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)))
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which simplifies, rewriting with GET-ADD1-OPENER, EQUAL-LENGTH-0, SUB1-ADD1,
LR-P-C-SIZE-LIST-0-OPENER, LENGTH-NLISTP, and LR-P-C-SIZE-LIST-0, and
unfolding the functions LESSP, LR-P-C-SIZE-LIST, NOT, IMPLIES, SUB1, and
EQUAL, to the following four new formulas:
Case 2.4.
(IMPLIES (AND (LESSP N (LENGTH BODY))
(NUMBERP N)
(NOT (LESSP N (SUB1 (LENGTH BODY))))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)
0))
(EQUAL (LR-P-C-SIZE-LIST N BODY) 0)).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (LENGTH BODY) (PLUS 1 N))
(LESSP N (PLUS 1 N))
(NUMBERP N)
(NOT (LESSP N (SUB1 (PLUS 1 N))))
(EQUAL (LR-P-C-SIZE-LIST (SUB1 (PLUS 1 N))
BODY)
0))
(EQUAL (LR-P-C-SIZE-LIST N BODY) 0)).
This again simplifies, rewriting with PLUS-ADD1-ARG1, SUB1-ADD1, and
LR-P-C-SIZE-LIST-0-OPENER, and expanding EQUAL, PLUS, LESSP, NUMBERP, and
SUB1, to:
T.
Case 2.3.
(IMPLIES (AND (LESSP N (LENGTH BODY))
(LISTP BODY)
(NUMBERP N)
(LESSP N (SUB1 (LENGTH BODY)))
(EQUAL (PLUS (LR-P-C-SIZE T (GET N (CDR BODY)))
(LR-P-C-SIZE-LIST N BODY))
0)
(NOT (EQUAL N 0))
(LISTP (CDR BODY)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(LESSP N (LENGTH BODY))
(LISTP BODY)
(NUMBERP N)
(LESSP N (SUB1 (LENGTH BODY)))
(EQUAL (PLUS (LR-P-C-SIZE T (GET N (CDR BODY)))
(LR-P-C-SIZE-LIST N BODY))
0)
(NOT (EQUAL N 0))
(LISTP (CDR BODY)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
However this again simplifies, applying LR-P-C-SIZE-LIST-0, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP N (LENGTH BODY))
(NUMBERP N)
(NOT (LESSP N (SUB1 (LENGTH BODY))))
(LESSP (SUB1 (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
However this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (EQUAL (LENGTH BODY) (PLUS 1 N))
(LESSP N (PLUS 1 N))
(NUMBERP N)
(NOT (LESSP N (SUB1 (PLUS 1 N))))
(LESSP (SUB1 (LR-P-C-SIZE-LIST (SUB1 (PLUS 1 N))
BODY))
(LR-P-C-SIZE-LIST (SUB1 (PLUS 1 N))
BODY))
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (PLUS 1 N))
BODY))).
This again simplifies, applying PLUS-ADD1-ARG1, SUB1-ADD1, and
LR-P-C-SIZE-LIST-0-OPENER, and opening up the functions EQUAL, PLUS, LESSP,
NUMBERP, and SUB1, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP N (LENGTH BODY))
(LISTP BODY)
(NUMBERP N)
(LESSP N (SUB1 (LENGTH BODY)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE T (GET N (CDR BODY)))
(LR-P-C-SIZE-LIST N BODY)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(NOT (EQUAL N 0))
(LISTP (CDR BODY)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
However this again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)
(LESSP N (LENGTH BODY))
(LISTP BODY)
(NUMBERP N)
(LESSP N (SUB1 (LENGTH BODY)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE T (GET N (CDR BODY)))
(LR-P-C-SIZE-LIST N BODY)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(NOT (EQUAL N 0))
(LISTP (CDR BODY)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
However this again simplifies, rewriting with LR-P-C-SIZE-LIST-0, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP N (LENGTH BODY)))
(NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
This simplifies, unfolding the function LR-P-C-SIZE-LIST, to:
(IMPLIES (AND (NOT (LESSP N (LENGTH BODY)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)
0)))
(LESSP (SUB1 (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH
(PROVE-LEMMA LR-P-PC-1-BODY-0
(REWRITE)
(EQUAL (LR-P-PC-1 0 POS) 0))
This simplifies, unfolding LISTP, LR-P-PC-1, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-PC-1-BODY-0
(PROVE-LEMMA LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1
(REWRITE)
(IMPLIES (AND (LISTP BODY)
(NOT (ZEROP N))
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET N BODY) POS)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)))
((USE (LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH (N N)
(BODY BODY)))
(ENABLE GET-LARGE-INDEX LR-P-C-SIZE-LIST-0)
(EXPAND (LR-P-C-SIZE-LIST N BODY))
(DISABLE LR-P-C-SIZE-LIST LR-P-PC-1
LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH)))
WARNING: When the linear lemma LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1 is stored
under (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY)) BODY) it contains the free
variables POS and N which will be chosen by instantiating the hypotheses
(NOT (ZEROP N)) and:
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY))).
WARNING: When the linear lemma LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1 is stored
under (LR-P-C-SIZE-LIST (SUB1 N) BODY) it contains the free variable POS which
will be chosen by instantiating the hypothesis:
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY))).
WARNING: Note that the proposed lemma LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1 is
to be stored as zero type prescription rules, zero compound recognizer rules,
three linear rules, and zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (IMPLIES (NOT (EQUAL (LR-P-C-SIZE-LIST N BODY) 0))
(LESSP (SUB1 (LR-P-C-SIZE-LIST N BODY))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY)))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET N BODY) POS)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
This simplifies, applying the lemmas EQUAL-LENGTH-0, COMMUTATIVITY-OF-PLUS,
GET-LARGE-INDEX, and LR-P-PC-1-BODY-0, and unfolding the functions
LR-P-C-SIZE-LIST, LESSP, NOT, IMPLIES, LR-P-C-SIZE, and EQUAL, to the
following two new formulas:
Case 2. (IMPLIES (AND (LESSP (SUB1 N) (SUB1 (LENGTH BODY)))
(EQUAL (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))
0)
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET N BODY) POS)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP (SUB1 N) (SUB1 (LENGTH BODY)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET N BODY) POS)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS))
0)
(LESSP (SUB1 N) (SUB1 (LENGTH BODY)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LR-P-PC-1 (GET N BODY) POS)
(LR-P-C-SIZE T (GET N BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET N BODY) POS)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-PC-1 (GET N BODY) POS)))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1
(PROVE-LEMMA LESSP-LR-P-PC-1-LR-P-C-SIZE
(REWRITE)
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))
((INDUCT (LR-P-PC-1 BODY POS))
(EXPAND (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))
(DISABLE LR-P-PC-1 LR-P-C-SIZE LR-P-C-SIZE-LIST)))
WARNING: Note that the proposed lemma LESSP-LR-P-PC-1-LR-P-C-SIZE is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, OR, AND,
S-TEMP-TEST, S-TEMP-EVAL, and S-TEMP-FETCH, to the following 11 new formulas:
Case 11.(IMPLIES (NOT (LISTP POS))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))).
This simplifies, applying the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LR-P-C-SIZE-FLAG-LIST, and opening up the definitions of LR-P-PC-1,
LR-P-C-SIZE, EQUAL, NUMBERP, ZEROP, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST,
and LESSP, to the following four new conjectures:
Case 11.4.
(IMPLIES
(AND (NOT (LISTP POS))
(LISTP BODY)
(EQUAL (CAR BODY) 'IF))
(NOT
(EQUAL
(ADD1 (ADD1 (ADD1 (ADD1 (PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY)))))))
0))).
This again simplifies, using linear arithmetic, to:
T.
Case 11.3.
(IMPLIES (AND (NOT (LISTP POS))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE T (CADR BODY)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 11.2.
(IMPLIES (AND (NOT (LISTP POS))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 11.1.
(IMPLIES
(AND (NOT (LISTP POS))
(LISTP BODY)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT
(EQUAL
(ADD1
(ADD1
(ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (LR-P-C-SIZE T (CADR BODY)))))))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 10.(IMPLIES (AND (LISTP POS) (NOT (LISTP BODY)))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, expanding LR-P-PC-1, LR-P-C-SIZE, EQUAL, and LESSP, to:
T.
Case 9. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(ZEROP (CAR POS)))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, applying PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
LR-P-C-SIZE-FLAG-LIST, and opening up ZEROP, LR-P-PC-1, EQUAL, LR-P-C-SIZE,
NUMBERP, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, and LESSP, to the following
eight new conjectures:
Case 9.8.
(IMPLIES
(AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR POS) 0)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT
(EQUAL
(ADD1
(ADD1
(ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (LR-P-C-SIZE T (CADR BODY)))))))))
0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 9.7.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR POS) 0)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.6.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR POS) 0)
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE T (CADR BODY)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.5.
(IMPLIES
(AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR POS) 0)
(EQUAL (CAR BODY) 'IF))
(NOT
(EQUAL
(ADD1 (ADD1 (ADD1 (ADD1 (PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY)))))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.4.
(IMPLIES
(AND (LISTP POS)
(LISTP BODY)
(NOT (NUMBERP (CAR POS)))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT
(EQUAL
(ADD1
(ADD1
(ADD1 (ADD1 (ADD1 (ADD1 (ADD1 (LR-P-C-SIZE T (CADR BODY)))))))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.3.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (NUMBERP (CAR POS)))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.2.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (NUMBERP (CAR POS)))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (ADD1 (LR-P-C-SIZE T (CADR BODY)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 9.1.
(IMPLIES
(AND (LISTP POS)
(LISTP BODY)
(NOT (NUMBERP (CAR POS)))
(EQUAL (CAR BODY) 'IF))
(NOT
(EQUAL
(ADD1 (ADD1 (ADD1 (ADD1 (PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY)))))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 8. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, applying PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, SUB1-ADD1, and
EQUAL-SUB1-0, and expanding the functions EQUAL, NUMBERP, LR-P-PC-1,
LR-P-C-SIZE, ZEROP, and LESSP, to the new conjecture:
(IMPLIES
(AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to three new conjectures:
Case 8.3.
(IMPLIES
(AND (EQUAL (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to two new goals:
Case 8.3.2.
(IMPLIES
(AND (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
0)
(EQUAL (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 0)
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to:
T.
Case 8.3.1.
(IMPLIES
(AND (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
0)
(EQUAL (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 0)
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to:
T.
Case 8.2.
(IMPLIES
(AND (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
0)
(EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL 0 1)))
(LESSP (SUB1 (SUB1 0))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))).
This again simplifies, using linear arithmetic, to:
T.
Case 8.1.
(IMPLIES
(AND (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 1)
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1))
(NOT (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to:
T.
Case 7. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR POS) 1))
(EQUAL (CAR POS) 2)
(LESSP (LR-P-PC-1 (CADDR BODY) (CDR POS))
(LR-P-C-SIZE T (CADDR BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, rewriting with PLUS-ADD1-ARG1, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, SUB1-ADD1, EQUAL-PLUS-0, LR-P-C-SIZE-FLAG-NOT-LIST-NOT-0,
and CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and expanding the definitions of EQUAL,
NUMBERP, LR-P-PC-1, LR-P-C-SIZE, ZEROP, and LESSP, to:
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 2)
(LESSP (LR-P-PC-1 (CADDR BODY) (CDR POS))
(LR-P-C-SIZE T (CADDR BODY))))
(LESSP (SUB1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY))
(LR-P-PC-1 (CADDR BODY) (CDR POS))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (PLUS 0
(LR-P-C-SIZE T (CADR BODY))
(LR-P-PC-1 (CADDR BODY) (CDR POS)))
0)
(LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(EQUAL (CAR POS) 2)
(LESSP (LR-P-PC-1 (CADDR BODY) (CDR POS))
(LR-P-C-SIZE T (CADDR BODY))))
(LESSP (SUB1 (PLUS 0
(LR-P-C-SIZE T (CADR BODY))
(LR-P-PC-1 (CADDR BODY) (CDR POS))))
(PLUS (LR-P-C-SIZE T (CADR BODY))
(LR-P-C-SIZE T (CADDR BODY))
(LR-P-C-SIZE T (CADDDR BODY))))).
This again simplifies, rewriting with LR-P-C-SIZE-FLAG-NOT-LIST-NOT-0 and
EQUAL-PLUS-0, and expanding the definitions of EQUAL and PLUS, to:
T.
Case 6. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(EQUAL (CAR BODY) 'IF)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR POS) 1))
(NOT (EQUAL (CAR POS) 2))
(LESSP (LR-P-PC-1 (CADDDR BODY) (CDR POS))
(LR-P-C-SIZE T (CADDDR BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))).
This simplifies, appealing to the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
SUB1-ADD1, and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding LR-P-PC-1,
EQUAL, NUMBERP, ZEROP, LR-P-C-SIZE, LESSP, and FIX, to:
T.
Case 5. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(EQUAL (CAR BODY) '(TEMP-FETCH)))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))).
This simplifies, expanding EQUAL, LR-P-PC-1, S-TEMP-FETCH, LR-P-C-SIZE, and
LESSP, to:
T.
Case 4. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(EQUAL (CAR BODY) '(TEMP-EVAL))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))).
This simplifies, appealing to the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, and
SUB1-ADD1, and expanding EQUAL, LR-P-PC-1, S-TEMP-FETCH, S-TEMP-EVAL,
LR-P-C-SIZE, NUMBERP, ZEROP, and LESSP, to:
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR BODY) '(TEMP-EVAL))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0)))
(LESSP (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
(LR-P-C-SIZE T (CADR BODY)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, applying the lemmas PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
SUB1-ADD1, and EQUAL-SUB1-0, and expanding the functions EQUAL, LR-P-PC-1,
S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, NUMBERP, ZEROP, LR-P-C-SIZE, and
LESSP, to:
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
(LR-P-C-SIZE T (CADR BODY)))).
But this again simplifies, using linear arithmetic, to two new formulas:
Case 3.2.
(IMPLIES
(AND (EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
0)
(LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
(LR-P-C-SIZE T (CADR BODY)))),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
0)
(EQUAL (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS))))
0)
(LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1)))
(LESSP (SUB1 0)
(LR-P-C-SIZE T (CADR BODY)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES
(AND (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
0)
(LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(EQUAL (CAR BODY) '(TEMP-TEST))
(LESSP (LR-P-PC-1 (CADR BODY) (CDR POS))
(LR-P-C-SIZE T (CADR BODY)))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
0))
(NOT (EQUAL (LR-P-PC-1 (CADR BODY) (CDR POS))
1))
(NOT (EQUAL (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))
1)))
(LESSP (SUB1 (SUB1 (SUB1 (LR-P-PC-1 (CADR BODY) (CDR POS)))))
(LR-P-C-SIZE T (CADR BODY)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, expanding EQUAL, LR-P-PC-1, S-TEMP-FETCH, S-TEMP-EVAL,
S-TEMP-TEST, LR-P-C-SIZE, and LESSP, to:
T.
Case 1. (IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
(LR-P-C-SIZE T (GET (CAR POS) BODY))))
(LESSP (LR-P-PC-1 BODY POS)
(LR-P-C-SIZE T BODY))),
which simplifies, applying the lemmas LR-P-C-SIZE-FLAG-LIST, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, SUB1-ADD1, and EQUAL-PLUS-0, and opening up the functions
LR-P-PC-1, S-TEMP-FETCH, S-TEMP-EVAL, S-TEMP-TEST, LR-P-C-SIZE, EQUAL,
NUMBERP, ZEROP, and LESSP, to two new goals:
Case 1.2.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
(LR-P-C-SIZE T (GET (CAR POS) BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which again simplifies, using linear arithmetic and rewriting with the
lemma LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1, to:
(IMPLIES (AND (EQUAL (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS)))
0)
(LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
(LR-P-C-SIZE T (GET (CAR POS) BODY)))
(NOT (EQUAL (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
(LR-P-C-SIZE T (GET (CAR POS) BODY)))
(NOT (EQUAL (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which again simplifies, using linear arithmetic and applying
LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1 and
LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH, to:
(IMPLIES (AND (EQUAL (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS)))
0)
(LISTP POS)
(LISTP BODY)
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR BODY) 'IF))
(NOT (EQUAL (CAR BODY) '(TEMP-FETCH)))
(NOT (EQUAL (CAR BODY) '(TEMP-EVAL)))
(NOT (EQUAL (CAR BODY) '(TEMP-TEST)))
(NOT (EQUAL (CAR BODY) 'QUOTE))
(LESSP (LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))
(LR-P-C-SIZE T (GET (CAR POS) BODY)))
(NOT (EQUAL (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
0)))
(LESSP (SUB1 (PLUS (LR-P-C-SIZE-LIST (SUB1 (CAR POS))
BODY)
(LR-P-PC-1 (GET (CAR POS) BODY)
(CDR POS))))
(LR-P-C-SIZE-LIST (SUB1 (LENGTH BODY))
BODY))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.3 0.1 ]
LESSP-LR-P-PC-1-LR-P-C-SIZE
(DISABLE LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1)
[ 0.0 0.0 0.0 ]
LESSP-LR-P-PC-1-LR-P-C-SIZE-HELPER-1-OFF
(PROVE-LEMMA NOT-LESSP-P-MAX-TEMP-STK-SIZE-LR-PUSH-TSTK
(REWRITE)
(IMPLIES (EQUAL (P-PSW (LR-PUSH-TSTK L ANYTHING))
'RUN)
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-PUSH-TSTK L ANYTHING))))))
((ENABLE LR-PUSH-TSTK)))
WARNING: Note that the proposed lemma:
NOT-LESSP-P-MAX-TEMP-STK-SIZE-LR-PUSH-TSTK
is to be stored as zero type prescription rules, zero compound recognizer
rules, one linear rule, and zero replacement rules.
This conjecture simplifies, applying P-ACCESSORS-LR-SET-TSTK, LENGTH-CONS,
SUB1-ADD1, and P-ACCESSORS-LR-SET-ERROR, and opening up the definitions of
PUSH, LR-PUSH-TSTK, EQUAL, and LESSP, to four new formulas:
Case 4. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS ANYTHING (P-TEMP-STK L))))
'RUN))
(NOT (EQUAL (P-MAX-TEMP-STK-SIZE L) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS ANYTHING (P-TEMP-STK L))))
'RUN))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 2. (IMPLIES
(AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS ANYTHING (P-TEMP-STK L))))
'RUN))
(NOT (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PSW (LR-SET-ERROR L
'LR-PUSH-TSTK-FULL-STACK))
'RUN))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and
unfolding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-P-MAX-TEMP-STK-SIZE-LR-PUSH-TSTK
(PROVE-LEMMA PROPER-P-TEMP-STKP-LR->P-LR-PUSH-TSTK
(REWRITE)
(EQUAL (PROPER-P-TEMP-STKP TEMP-STKP
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP TEMP-STKP
(LR->P L))))
Name the conjecture *1.
Let us appeal to the induction principle. The recursive terms in the
conjecture suggest two inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP TEMP-STKP)
(p TEMP-STKP L ANYTHING))
(IMPLIES (AND (NOT (NLISTP TEMP-STKP))
(p (POP TEMP-STKP) L ANYTHING))
(p TEMP-STKP L ANYTHING))).
Linear arithmetic, the lemma CDR-LESSP, and the definitions of POP and NLISTP
can be used to show that the measure (COUNT TEMP-STKP) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to the following two new goals:
Case 2. (IMPLIES (NLISTP TEMP-STKP)
(EQUAL (PROPER-P-TEMP-STKP TEMP-STKP
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP TEMP-STKP
(LR->P L)))).
This simplifies, expanding the definitions of NLISTP and PROPER-P-TEMP-STKP,
to:
T.
Case 1. (IMPLIES
(AND (NOT (NLISTP TEMP-STKP))
(EQUAL (PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P L))))
(EQUAL (PROPER-P-TEMP-STKP TEMP-STKP
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP TEMP-STKP
(LR->P L)))).
This simplifies, unfolding NLISTP, PROPER-P-TEMP-STKP, and TOP, to the
following two new goals:
Case 1.2.
(IMPLIES
(AND (LISTP TEMP-STKP)
(EQUAL (PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P L)))
(NOT (P-OBJECTP (CAR TEMP-STKP) (LR->P L)))
(P-OBJECTP (CAR TEMP-STKP)
(LR->P (LR-PUSH-TSTK L ANYTHING))))
(EQUAL (PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P L))
F)).
This again simplifies, applying the lemmas
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, P-ACCESSORS-LR-PUSH-TSTK,
P-ACCESSORS-LR->P, PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES, and
P-OBJECTP-SIMILAR-P-STATES, to:
T.
Case 1.1.
(IMPLIES
(AND (LISTP TEMP-STKP)
(EQUAL (PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P (LR-PUSH-TSTK L ANYTHING)))
(PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P L)))
(P-OBJECTP (CAR TEMP-STKP) (LR->P L))
(NOT (P-OBJECTP (CAR TEMP-STKP)
(LR->P (LR-PUSH-TSTK L ANYTHING)))))
(EQUAL F
(PROPER-P-TEMP-STKP (POP TEMP-STKP)
(LR->P L)))),
which again simplifies, rewriting with
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, P-ACCESSORS-LR-PUSH-TSTK,
P-ACCESSORS-LR->P, PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES, and
P-OBJECTP-SIMILAR-P-STATES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-P-TEMP-STKP-LR->P-LR-PUSH-TSTK
(PROVE-LEMMA PROPER-P-ALISTP-P-OBJECTP NIL
(IMPLIES (AND (PROPER-P-ALISTP BINDINGS L)
(DEFINEDP NAME BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME BINDINGS))
L)))
Give the conjecture the name *1.
Let us appeal to the induction principle. The recursive terms in the
conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP BINDINGS)
(p NAME BINDINGS L))
(IMPLIES (AND (NOT (NLISTP BINDINGS))
(p NAME (CDR BINDINGS) L))
(p NAME BINDINGS L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT BINDINGS) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates the following four new
conjectures:
Case 4. (IMPLIES (AND (NLISTP BINDINGS)
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP NAME BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME BINDINGS))
L)).
This simplifies, opening up the functions NLISTP, PROPER-P-ALISTP, LISTP,
and DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (PROPER-P-ALISTP (CDR BINDINGS) L))
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP NAME BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME BINDINGS))
L)).
This simplifies, unfolding the functions NLISTP and PROPER-P-ALISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (DEFINEDP NAME (CDR BINDINGS)))
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP NAME BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME BINDINGS))
L)).
This simplifies, applying SAME-SIGNATURE-REFLEXIVE-GENERALIZED and
P-OBJECTP-SIMILAR-P-STATES, and unfolding the functions NLISTP,
PROPER-P-ALISTP, DEFINEDP, and ASSOC, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME (CDR BINDINGS)))
L)
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP NAME BINDINGS))
(P-OBJECTP (CDR (ASSOC NAME BINDINGS))
L)),
which simplifies, rewriting with SAME-SIGNATURE-REFLEXIVE-GENERALIZED and
P-OBJECTP-SIMILAR-P-STATES, and expanding the functions NLISTP,
PROPER-P-ALISTP, DEFINEDP, and ASSOC, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-P-ALISTP-P-OBJECTP
(PROVE-LEMMA FORMAL-VARS-ASSOC-COMP-PROGRAMS-1
(REWRITE)
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (FORMAL-VARS (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(FORMAL-VARS (ASSOC NAME PROGRAMS))))
((ENABLE FORMAL-VARS NAME)))
This formula can be simplified, using the abbreviations IMPLIES and
FORMAL-VARS, to:
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADR (ASSOC NAME PROGRAMS)))),
which we will name *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP PROGRAMS)
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS)))
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(p NAME (CDR PROGRAMS)))
(p NAME PROGRAMS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT PROGRAMS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following four new goals:
Case 4. (IMPLIES (AND (NLISTP PROGRAMS)
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADR (ASSOC NAME PROGRAMS)))).
This simplifies, expanding the functions NLISTP and DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADR (ASSOC NAME PROGRAMS)))).
This simplifies, applying CAR-CONS and CDR-CONS, and unfolding the
definitions of NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME, FORMAL-VARS,
LR-MAKE-PROGRAM, and ASSOC, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(NOT (DEFINEDP NAME (CDR PROGRAMS)))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADR (ASSOC NAME PROGRAMS)))),
which simplifies, expanding the definitions of NLISTP and DEFINEDP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(CADR (ASSOC NAME (CDR PROGRAMS))))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADR (ASSOC NAME PROGRAMS)))),
which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
functions NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME, FORMAL-VARS,
LR-MAKE-PROGRAM, and ASSOC, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
FORMAL-VARS-ASSOC-COMP-PROGRAMS-1
(PROVE-LEMMA FORMAL-VARS-ASSOC-COMP-PROGRAMS
(REWRITE)
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (FORMAL-VARS (ASSOC NAME (COMP-PROGRAMS PROGRAMS)))
(FORMAL-VARS (ASSOC NAME PROGRAMS))))
((ENABLE COMP-PROGRAMS NAME ASSOC-APPEND-1)
(DISABLE COMP-PROGRAMS-1 *1*P-RUNTIME-SUPPORT-PROGRAMS)))
This simplifies, rewriting with CDR-CONS, CAR-CONS,
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG, and ASSOC-APPEND-1, and opening up
LR-MAKE-PROGRAM, CONS, AREA-NAME, LR-ANSWER-ADDR, NAME, COMP-PROGRAMS, and
ASSOC, to three new conjectures:
Case 3. (IMPLIES (AND (DEFINEDP NAME PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(DEFINEDP NAME (CDR PROGRAMS)))
(EQUAL (FORMAL-VARS (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(FORMAL-VARS (ASSOC NAME PROGRAMS)))),
which again simplifies, appealing to the lemma
FORMAL-VARS-ASSOC-COMP-PROGRAMS-1, and expanding the definition of DEFINEDP,
to the goal:
(IMPLIES (AND (LISTP PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(DEFINEDP NAME (CDR PROGRAMS)))
(EQUAL (FORMAL-VARS (ASSOC NAME (CDR PROGRAMS)))
(FORMAL-VARS (ASSOC NAME PROGRAMS)))).
However this again simplifies, opening up the definition of ASSOC, to:
T.
Case 2. (IMPLIES (AND (DEFINEDP NAME PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(NOT (DEFINEDP NAME (CDR PROGRAMS))))
(EQUAL (FORMAL-VARS (ASSOC NAME
(P-RUNTIME-SUPPORT-PROGRAMS)))
(FORMAL-VARS (ASSOC NAME PROGRAMS)))),
which again simplifies, unfolding the definition of DEFINEDP, to:
T.
Case 1. (IMPLIES
(AND (DEFINEDP NAME PROGRAMS)
(EQUAL NAME (CAAR PROGRAMS)))
(EQUAL
(FORMAL-VARS
(CONS NAME
(CONS
(FORMAL-VARS (CAR PROGRAMS))
(CONS
(TEMP-VAR-DCLS (CAR PROGRAMS))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))))
(FORMAL-VARS (ASSOC NAME PROGRAMS)))),
which again simplifies, rewriting with the lemma
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS, and opening up the
functions DEFINEDP and ASSOC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
FORMAL-VARS-ASSOC-COMP-PROGRAMS
(PROVE-LEMMA TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1
(REWRITE)
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (TEMP-VAR-DCLS (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS))))
((ENABLE TEMP-VAR-DCLS NAME)))
This formula can be simplified, using the abbreviations IMPLIES and
TEMP-VAR-DCLS, to:
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADDR (ASSOC NAME PROGRAMS)))),
which we will name *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP PROGRAMS)
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS)))
(p NAME PROGRAMS))
(IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(p NAME (CDR PROGRAMS)))
(p NAME PROGRAMS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT PROGRAMS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following four new goals:
Case 4. (IMPLIES (AND (NLISTP PROGRAMS)
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADDR (ASSOC NAME PROGRAMS)))).
This simplifies, expanding the functions NLISTP and DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(EQUAL NAME (CAAR PROGRAMS))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADDR (ASSOC NAME PROGRAMS)))).
This simplifies, applying CAR-CONS and CDR-CONS, and unfolding the
definitions of NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME, TEMP-VAR-DCLS,
LR-MAKE-PROGRAM, and ASSOC, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(NOT (DEFINEDP NAME (CDR PROGRAMS)))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADDR (ASSOC NAME PROGRAMS)))),
which simplifies, expanding the definitions of NLISTP and DEFINEDP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PROGRAMS))
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(CADDR (ASSOC NAME (CDR PROGRAMS))))
(DEFINEDP NAME PROGRAMS))
(EQUAL (CADDR (ASSOC NAME
(COMP-PROGRAMS-1 PROGRAMS)))
(CADDR (ASSOC NAME PROGRAMS)))),
which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
functions NLISTP, DEFINEDP, COMP-PROGRAMS-1, NAME, TEMP-VAR-DCLS,
LR-MAKE-PROGRAM, and ASSOC, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.3 ]
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1
(PROVE-LEMMA TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS
(REWRITE)
(IMPLIES (DEFINEDP NAME PROGRAMS)
(EQUAL (TEMP-VAR-DCLS (ASSOC NAME (COMP-PROGRAMS PROGRAMS)))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS))))
((ENABLE COMP-PROGRAMS NAME ASSOC-APPEND-1)
(DISABLE COMP-PROGRAMS-1 *1*P-RUNTIME-SUPPORT-PROGRAMS)))
This simplifies, rewriting with CDR-CONS, CAR-CONS,
DEFINEDP-COMP-PROGRAMS-1-DEFINEDP-ORIG, and ASSOC-APPEND-1, and opening up
LR-MAKE-PROGRAM, CONS, AREA-NAME, LR-ANSWER-ADDR, NAME, COMP-PROGRAMS, and
ASSOC, to three new conjectures:
Case 3. (IMPLIES
(AND (DEFINEDP NAME PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(DEFINEDP NAME (CDR PROGRAMS)))
(EQUAL (TEMP-VAR-DCLS (ASSOC NAME
(COMP-PROGRAMS-1 (CDR PROGRAMS))))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS)))),
which again simplifies, appealing to the lemma
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1, and expanding the definition of
DEFINEDP, to the goal:
(IMPLIES (AND (LISTP PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(DEFINEDP NAME (CDR PROGRAMS)))
(EQUAL (TEMP-VAR-DCLS (ASSOC NAME (CDR PROGRAMS)))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS)))).
However this again simplifies, opening up the definition of ASSOC, to:
T.
Case 2. (IMPLIES (AND (DEFINEDP NAME PROGRAMS)
(NOT (EQUAL NAME (CAAR PROGRAMS)))
(NOT (DEFINEDP NAME (CDR PROGRAMS))))
(EQUAL (TEMP-VAR-DCLS (ASSOC NAME
(P-RUNTIME-SUPPORT-PROGRAMS)))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS)))),
which again simplifies, unfolding the definition of DEFINEDP, to:
T.
Case 1. (IMPLIES
(AND (DEFINEDP NAME PROGRAMS)
(EQUAL NAME (CAAR PROGRAMS)))
(EQUAL
(TEMP-VAR-DCLS
(CONS NAME
(CONS
(FORMAL-VARS (CAR PROGRAMS))
(CONS
(TEMP-VAR-DCLS (CAR PROGRAMS))
(LABEL-INSTRS (APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR PROGRAMS))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))))
(TEMP-VAR-DCLS (ASSOC NAME PROGRAMS)))),
which again simplifies, rewriting with the lemma
NAME-FORMAL-VARS-TEMP-VAR-DCLS-PROGRAM-BODY-CONS, and opening up the
functions DEFINEDP and ASSOC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS
(PROVE-LEMMA LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC
(REWRITE)
(IMPLIES (LR-PROGRAMS-PROPERP L TABLE)
(DEFINEDP (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L)))
((ENABLE AREA-NAME LR-PROGRAMS-PROPERP)))
WARNING: Note that LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This formula can be simplified, using the abbreviations ADP-NAME, AREA-NAME,
LR-PROGRAMS-PROPERP, and IMPLIES, to the new conjecture:
T,
which simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC
(PROVE-LEMMA P-OBJECTP-CDR-ASSOC-LITATOM-PROPER-P-ALISTP
(REWRITE)
(IMPLIES
(AND
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L)))))))
(LITATOM (LR-EXPR L)))
(P-OBJECTP (CDR (ASSOC (LR-EXPR L) BINDINGS))
LP))
((ENABLE AREA-NAME LR-EXPR P-CURRENT-PROGRAM)
(USE (LR-PROGRAMS-PROPERP-LR-PROPER-EXPRP-LR-EXPR (L L)
(TABLE TABLE))
(PROPER-P-ALISTP-P-OBJECTP (BINDINGS BINDINGS)
(L LP)
(NAME (LR-EXPR L)))
(MEMBER-STRIP-CARS-DEFINEDP (X (LR-EXPR L))
(Y BINDINGS))
(MEMBER-APPEND (A (LR-EXPR L))
(Y (STRIP-CARS (TEMP-VAR-DCLS (P-CURRENT-PROGRAM L))))
(X (FORMAL-VARS (P-CURRENT-PROGRAM L)))))
(DISABLE COMP-PROGRAMS-1 CUR-EXPR MEMBER-APPEND P-OBJECTP-OPENER)))
WARNING: Note that P-OBJECTP-CDR-ASSOC-LITATOM-PROPER-P-ALISTP contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This conjecture simplifies, applying SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, MEMBER-NON-LIST,
LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC, FORMAL-VARS-ASSOC-COMP-PROGRAMS-1,
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1, and P-OBJECTP-SIMILAR-P-STATES, and
opening up DEFINITION, ASSOC, AREA-NAME, ADP-NAME, P-CURRENT-PROGRAM, AND,
LR-EXPR, IMPLIES, PROGRAM-BODY, FORMAL-VARS, TEMP-VAR-DCLS, STRIP-CARS, APPEND,
OR, EQUAL, and DEFINEDP, to six new goals:
Case 6. (IMPLIES (AND (NOT (LISTP (P-PROG-SEGMENT L)))
(NOT (GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY F)))
(NOT (DEFINEDP (CUR-EXPR (OFFSET (P-PC L)) 0)
BINDINGS))
(NOT (MEMBER (CUR-EXPR (OFFSET (P-PC L)) 0)
(STRIP-CARS BINDINGS)))
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L)) 0)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (STRIP-CARS BINDINGS) NIL)
(LITATOM (CUR-EXPR (OFFSET (P-PC L)) 0)))
(P-OBJECTP (CDR (ASSOC (CUR-EXPR (OFFSET (P-PC L)) 0)
BINDINGS))
LP)),
which again simplifies, expanding the function PROGRAM-BODY, to:
T.
Case 5. (IMPLIES
(AND (NOT (LISTP (P-PROG-SEGMENT L)))
(LR-PROPER-EXPRP T
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY F))
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS F)
(STRIP-CARS (TEMP-VAR-DCLS F))
TABLE)
(NOT (DEFINEDP (CUR-EXPR (OFFSET (P-PC L)) 0)
BINDINGS))
(NOT (MEMBER (CUR-EXPR (OFFSET (P-PC L)) 0)
(STRIP-CARS BINDINGS)))
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L)) 0)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (STRIP-CARS BINDINGS) NIL)
(LITATOM (CUR-EXPR (OFFSET (P-PC L)) 0)))
(P-OBJECTP (CDR (ASSOC (CUR-EXPR (OFFSET (P-PC L)) 0)
BINDINGS))
LP)),
which again simplifies, applying CDR-NLISTP and MEMBER-NON-LIST, and
unfolding the functions PROGRAM-BODY, STRIP-LOGIC-FNAMES, FORMAL-VARS,
TEMP-VAR-DCLS, STRIP-CARS, EQUAL, and LR-PROPER-EXPRP, to:
T.
Case 4. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L)))
(CAAR (P-PROG-SEGMENT L)))
(LR-PROPER-EXPRP T
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))
TABLE)
(NOT (DEFINEDP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
BINDINGS))
(NOT (MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(STRIP-CARS BINDINGS)))
(NOT (MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(FORMAL-VARS (CAR (P-PROG-SEGMENT L)))))
(EQUAL
(MEMBER
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(LITATOM (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))))
(P-OBJECTP
(CDR (ASSOC (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
BINDINGS))
LP)).
But this again simplifies, unfolding the functions EQUAL and LR-PROPER-EXPRP,
to:
T.
Case 3. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L)))
(CAAR (P-PROG-SEGMENT L)))
(LR-PROPER-EXPRP T
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))
TABLE)
(NOT (DEFINEDP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
BINDINGS))
(NOT (MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(STRIP-CARS BINDINGS)))
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(FORMAL-VARS (CAR (P-PROG-SEGMENT L))))
(EQUAL
(MEMBER
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
T)
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(LITATOM (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))))
(P-OBJECTP
(CDR (ASSOC (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L))))
BINDINGS))
LP)),
which again simplifies, unfolding the functions EQUAL and LR-PROPER-EXPRP,
to:
T.
Case 2. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(CAAR (P-PROG-SEGMENT L))))
(LR-PROPER-EXPRP T
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
TABLE)
(NOT
(DEFINEDP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
BINDINGS))
(NOT
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(STRIP-CARS BINDINGS)))
(NOT
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))))
(EQUAL
(MEMBER
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(MEMBER
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LITATOM (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(P-OBJECTP
(CDR
(ASSOC (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
BINDINGS))
LP)),
which again simplifies, opening up EQUAL and LR-PROPER-EXPRP, to:
T.
Case 1. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(CAAR (P-PROG-SEGMENT L))))
(LR-PROPER-EXPRP T
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
TABLE)
(NOT
(DEFINEDP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
BINDINGS))
(NOT
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(STRIP-CARS BINDINGS)))
(MEMBER (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(EQUAL
(MEMBER
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
T)
(PROPER-P-ALISTP BINDINGS LP)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LITATOM (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(P-OBJECTP
(CDR
(ASSOC (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))
BINDINGS))
LP)),
which again simplifies, expanding the functions EQUAL and LR-PROPER-EXPRP,
to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
P-OBJECTP-CDR-ASSOC-LITATOM-PROPER-P-ALISTP
(PROVE-LEMMA PROPER-P-TEMP-STKP-LR-PUSH-TSTK-ASSOC-BINDINGS
(REWRITE)
(IMPLIES
(AND
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(LITATOM (LR-EXPR L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L))))))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
(LR->P L))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))))
((ENABLE LR-PUSH-TSTK)
(DISABLE COMP-PROGRAMS-1 *1*P-RUNTIME-SUPPORT-PROGRAMS)))
WARNING: Note that PROPER-P-TEMP-STKP-LR-PUSH-TSTK-ASSOC-BINDINGS contains
the free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This formula simplifies, applying LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC,
FORMAL-VARS-ASSOC-COMP-PROGRAMS-1, and TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1,
and unfolding PUSH and LR-PUSH-TSTK, to two new goals:
Case 2. (IMPLIES
(AND
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(LITATOM (LR-EXPR L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L))))))
(EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-SET-TSTK L
(CONS (CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))
(P-TEMP-STK L))))
(LR->P L))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L)))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, CDR-CONS,
P-OBJECTP-CDR-ASSOC-LITATOM-PROPER-P-ALISTP,
LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC,
FORMAL-VARS-ASSOC-COMP-PROGRAMS-1, TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1, and
CAR-CONS, and unfolding POP, TOP, and PROPER-P-TEMP-STKP, to:
T.
Case 1. (IMPLIES
(AND
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(LITATOM (LR-EXPR L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L))))))
(EQUAL (P-PSW L) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-SET-ERROR L
'LR-PUSH-TSTK-FULL-STACK))
(LR->P L))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L)))).
But this again simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
PROPER-P-TEMP-STKP-LR-PUSH-TSTK-ASSOC-BINDINGS
(PROVE-LEMMA LR-P-PC-LR-PUSH-TSTK
(REWRITE)
(EQUAL (LR-P-PC (LR-PUSH-TSTK L ANYTHING))
(LR-P-PC L))
((ENABLE LR-P-PC P-CURRENT-PROGRAM)))
This simplifies, rewriting with P-ACCESSORS-LR-PUSH-TSTK, and unfolding
P-CURRENT-PROGRAM, DEFINITION, and LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-PC-LR-PUSH-TSTK
(PROVE-LEMMA PROPER-P-STATEP-LR->P-LR-PUSH-TSTK
(REWRITE)
(IMPLIES
(AND
(PROPER-P-STATEP (LR->P L))
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL (P-PSW (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
'RUN)
(LITATOM (LR-EXPR L)))
(PROPER-P-STATEP
(LR->P (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))))
((ENABLE AREA-NAME P-CURRENT-PROGRAM PROPER-P-STATEP)
(DISABLE DEFINEDP PCPP PROPER-P-PROG-SEGMENTP *1*P-RUNTIME-SUPPORT-PROGRAMS
PROPER-P-TEMP-STKP-LR-PUSH-TSTK-ASSOC-BINDINGS)
(USE (PROPER-P-TEMP-STKP-LR-PUSH-TSTK-ASSOC-BINDINGS (L L)
(FLAG FLAG)))))
WARNING: Note that PROPER-P-STATEP-LR->P-LR-PUSH-TSTK contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This formula can be simplified, using the abbreviations DEFINITION,
PROPER-P-FRAMEP, CDDR-NIL-LR-P-PC, TYPE-LR-P-PC, P-OBJECTP-TYPE-OPENER, POP,
CAR-UNTAG-LR-P-PC, ADP-NAME, AREA-NAME, TOP, P-ACCESSORS-LR->P,
PROPER-P-STATEP, AND, and IMPLIES, to:
(IMPLIES
(AND
(IMPLIES
(AND
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(LITATOM (LR-EXPR L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS-1 (P-PROG-SEGMENT L))))))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
(LR->P L))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))))
(P-STATEP (LR->P L))
(EQUAL 'PC 'PC)
(EQUAL NIL NIL)
(PCPP (UNTAG (LR-P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(LOCAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(PCPP (UNTAG (RET-PC (CAR (P-CTRL-STK L))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP 0 (P-WORD-SIZE L))
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL
(P-PSW (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
'RUN)
(LITATOM (LR-EXPR L)))
(PROPER-P-STATEP
(LR->P (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L))))))))),
which simplifies, rewriting with SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
P-ACCESSORS-LR->P, PROPER-P-ALISTP-LR->P-SIMILAR-STATES,
LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC, FORMAL-VARS-ASSOC-COMP-PROGRAMS-1,
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS-1, PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES,
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS, FORMAL-VARS-ASSOC-COMP-PROGRAMS,
COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG1, SUB1-ADD1, EQUAL-SUB1-0,
PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-TEMP-STKP-LR->P-LR-PUSH-TSTK, PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES,
AREA-NAME-LR-P-PC, P-OBJECTP-TYPE-OPENER, P-ACCESSORS-LR-PUSH-TSTK,
CDDR-NIL-LR-P-PC, TYPE-LR-P-PC, and LR-P-PC-LR-PUSH-TSTK, and opening up the
functions DEFINITION, AREA-NAME, ADP-NAME, P-CURRENT-PROGRAM, AND, IMPLIES,
EQUAL, LOCAL-VARS, P-FRAME-SIZE, PLUS, TOP, P-CTRL-STK-SIZE, LESSP, POP,
PROPER-P-FRAMEP, and PROPER-P-STATEP, to:
(IMPLIES
(AND
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
(LR->P L))
(PCPP (UNTAG (LR-P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(PCPP (UNTAG (RET-PC (CAR (P-CTRL-STK L))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L))))
(EQUAL
(P-PSW (LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L)))))))
'RUN)
(LITATOM (LR-EXPR L)))
(NOT
(LESSP
(P-MAX-TEMP-STK-SIZE L)
(LENGTH
(P-TEMP-STK
(LR-PUSH-TSTK L
(CDR (ASSOC (LR-EXPR L)
(BINDINGS (CAR (P-CTRL-STK L))))))))))),
which again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-P-MAX-TEMP-STK-SIZE-LR-PUSH-TSTK, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
PROPER-P-STATEP-LR->P-LR-PUSH-TSTK
(PROVE-LEMMA GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP
(REWRITE)
(IMPLIES (AND (EQUAL (CAR (CUR-EXPR POS BODY)) 'IF)
(GOOD-POSP1 POS BODY)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE))
(AND (GOOD-POSP1 (DV POS 1) BODY)
(GOOD-POSP1 (DV POS 2) BODY)
(GOOD-POSP1 (DV POS 3) BODY)))
((ENABLE DV GOOD-POSP1)
(USE (LR-PROPER-EXPRP-LENGTH-CUR-EXPR (EXPR (CUR-EXPR POS BODY))
(PNAMES PNAMES)
(FORMALS FORMALS)
(TEMPS TEMPS)
(TABLE TABLE))
(LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR (BODY BODY)
(POS POS)
(PNAMES PNAMES)
(FORMALS FORMALS)
(TEMPS TEMPS)
(TABLE TABLE)))
(DISABLE LR-PROPER-EXPRP)))
WARNING: Note that GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP contains the
free variables TABLE, TEMPS, FORMALS, and PNAMES which will be chosen by
instantiating the hypothesis:
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE).
WARNING: Note that GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP contains the
free variables TABLE, TEMPS, FORMALS, and PNAMES which will be chosen by
instantiating the hypothesis:
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE).
WARNING: Note that GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP contains the
free variables TABLE, TEMPS, FORMALS, and PNAMES which will be chosen by
instantiating the hypothesis:
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE).
WARNING: Note that the proposed lemma:
GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP
is to be stored as zero type prescription rules, zero compound recognizer
rules, zero linear rules, and three replacement rules.
This formula can be simplified, using the abbreviations IMPLIES, AND, and DV,
to:
(IMPLIES (AND (IMPLIES (AND (LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)
(LISTP (CUR-EXPR POS BODY))
(OR (SUBRP (CAR (CUR-EXPR POS BODY)))
(BODY (CAR (CUR-EXPR POS BODY))))
(NOT (EQUAL (CAR (CUR-EXPR POS BODY))
'QUOTE)))
(EQUAL (LENGTH (CUR-EXPR POS BODY))
(ADD1 (ARITY (CAR (CUR-EXPR POS BODY))))))
(IMPLIES (AND (LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS
TABLE)
(GOOD-POSP1 POS BODY))
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE))
(EQUAL (CAR (CUR-EXPR POS BODY)) 'IF)
(GOOD-POSP1 POS BODY)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE))
(AND (GOOD-POSP1 (APPEND POS '(1)) BODY)
(GOOD-POSP1 (APPEND POS '(2)) BODY)
(GOOD-POSP1 (APPEND POS '(3)) BODY))),
which simplifies, rewriting with CAR-NLISTP, GOOD-POSP1-FLAG-NOT-LIST-NIL,
GET-ADD1-OPENER, GET-ZEROP, and GOOD-POSP1-APPEND, and expanding the
definitions of SUBRP, BODY, OR, EQUAL, NOT, AND, ARITY, ADD1, IMPLIES, ZEROP,
CDR, LESSP, NUMBERP, CAR, S-TEMP-TEST, S-TEMP-EVAL, S-TEMP-FETCH, LISTP, and
GOOD-POSP1, to:
(IMPLIES (AND (EQUAL (LENGTH (CUR-EXPR POS BODY)) 4)
(LR-PROPER-EXPRP T
(CUR-EXPR POS BODY)
PNAMES FORMALS TEMPS TABLE)
(EQUAL (CAR (CUR-EXPR POS BODY)) 'IF)
(GOOD-POSP1 POS BODY)
(LR-PROPER-EXPRP T BODY PNAMES FORMALS TEMPS TABLE))
(LISTP (CUR-EXPR POS BODY))),
which again simplifies, applying LENGTH-NLISTP, and expanding the function
EQUAL, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP
(PROVE-LEMMA GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP
(REWRITE)
(IMPLIES (AND (EQUAL (CAR (LR-EXPR L)) 'IF)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(LR-PROGRAMS-PROPERP L TABLE))
(AND (GOOD-POSP1 (DV (OFFSET (P-PC L)) 1)
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(GOOD-POSP1 (DV (OFFSET (P-PC L)) 2)
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(GOOD-POSP1 (DV (OFFSET (P-PC L)) 3)
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))))
((ENABLE LR-EXPR P-CURRENT-PROGRAM)
(DISABLE CUR-EXPR LR-PROPER-EXPRP)
(USE
(LR-PROGRAMS-PROPERP-1-LR-PROPER-EXPRP
(PROG (P-CURRENT-PROGRAM L))
(PROGRAM-NAMES (STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L))))
(PROGS (P-PROG-SEGMENT L))
(TABLE TABLE)))))
WARNING: Note that GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP contains the
free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
WARNING: Note that the proposed lemma:
GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP
is to be stored as zero type prescription rules, zero compound recognizer
rules, zero linear rules, and three replacement rules.
This simplifies, applying the lemmas LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1,
MEMBER-ASSOC, and GOOD-POSP1-CONS-LESSP-4-IF-LR-PROPER-EXPRP, and expanding
the functions DEFINITION, P-CURRENT-PROGRAM, AND, IMPLIES, and LR-EXPR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
GOOD-POSP-CONS-LESSP-4-IF-LR-PROGRAMS-PROPERP
(PROVE-LEMMA PROPER-P-STATEP-LR->P-LR-SET-POS
(REWRITE)
(IMPLIES (AND (LR-PROGRAMS-PROPERP L TABLE)
(PROPER-P-STATEP (LR->P L)))
(PROPER-P-STATEP (LR->P (LR-SET-POS L POS))))
((ENABLE ADP-NAME AREA-NAME LR-P-PC LR-PROGRAMS-PROPERP NAME
PROPER-P-STATEP P-CURRENT-PROGRAM)
(DISABLE LR-P-PC-1 PROPER-P-ALISTP PROPER-P-CTRL-STKP
PROPER-P-TEMP-STKP PROPER-P-PROG-SEGMENTP)))
WARNING: Note that PROPER-P-STATEP-LR->P-LR-SET-POS contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This conjecture can be simplified, using the abbreviations PROPER-P-FRAMEP,
DEFINITION, ADP-OFFSET, PCPP, CDDR-NIL-LR-P-PC, TYPE-LR-P-PC,
P-OBJECTP-TYPE-OPENER, POP, CAR-UNTAG-LR-P-PC, TOP, P-ACCESSORS-LR->P,
PROPER-P-STATEP, ADP-NAME, AREA-NAME, LR-PROGRAMS-PROPERP, AND, and IMPLIES,
to:
(IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(P-PROG-SEGMENT L))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (CDR (STRIP-CARS (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(P-STATEP (LR->P L))
(EQUAL 'PC 'PC)
(EQUAL NIL NIL)
(LISTP (UNTAG (LR-P-PC L)))
(NUMBERP (CDR (UNTAG (LR-P-PC L))))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(LOCAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP 0 (P-WORD-SIZE L)))
(PROPER-P-STATEP (LR->P (LR-SET-POS L POS)))).
This simplifies, applying CDR-CONS, UNTAG-TAG,
DEFINEDP-COMP-PROGRAMS-DEFINEDP-ORIG, PROGRAM-BODY-ASSOC-COMP-PROGRAMS,
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS, FORMAL-VARS-ASSOC-COMP-PROGRAMS,
COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG1, SUB1-ADD1, EQUAL-SUB1-0,
PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES,
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES, SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, P-OBJECTP-TYPE-OPENER,
LENGTH-COMP-BODY-LR-P-C-SIZE, CDDR-TAG, TYPE-TAG, P-ACCESSORS-LR->P,
P-ACCESSORS-LR-SET-POS, CAR-CONS, AREA-NAME-TAG, P-CURRENT-PROGRAM-LR-SET-POS,
ADP-OFFSET-CONS, OFFSET-TAG, LENGTH-COMP-BODY-1-LR-P-C-SIZE, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, LENGTH-APPEND, and LENGTH-LABEL-INSTRS, and expanding DEFINEDP,
STRIP-CARS, EQUAL, P-CURRENT-PROGRAM, ASSOC, DEFINITION, AREA-NAME, ADP-NAME,
LR-P-PC, NAME, LOCAL-VARS, P-FRAME-SIZE, PLUS, TOP, P-CTRL-STK-SIZE, LESSP,
POP, PROPER-P-FRAMEP, ADP-OFFSET, PCPP, PROPER-P-STATEP, LENGTH, NUMBERP, and
ZEROP, to five new conjectures:
Case 5. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(NOT (EQUAL (CAR (UNTAG (P-PC L))) 'MAIN))
(LESSP
(LR-P-PC-1 (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(OFFSET (P-PC L)))
(LENGTH
(COMP-BODY (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT
(EQUAL (LR-P-PC-1 (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
POS)
0)))
(LESSP
(SUB1 (LR-P-PC-1 (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))
POS))
(LR-P-C-SIZE T
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))))),
which again simplifies, using linear arithmetic and applying the lemma
LESSP-LR-P-PC-1-LR-P-C-SIZE, to:
T.
Case 4. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(LESSP
(LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic and applying the lemma
LESSP-LR-P-PC-1-LR-P-C-SIZE, to:
(IMPLIES
(AND
(EQUAL (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS))
0)
(LISTP (P-PROG-SEGMENT L))
(DEFINEDP 'MAIN
(CDR (P-PROG-SEGMENT L)))
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(LESSP
(LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
0)
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic and rewriting with
LESSP-LR-P-PC-1-LR-P-C-SIZE, to:
(IMPLIES
(AND
(EQUAL (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS))
0)
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
0)
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
1)
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic and rewriting with the lemma
LESSP-LR-P-PC-1-LR-P-C-SIZE, to:
(IMPLIES
(AND
(EQUAL (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS))
0)
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))
1)
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic and applying
LESSP-LR-P-PC-1-LR-P-C-SIZE, to:
(IMPLIES
(AND
(EQUAL (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS))
0)
(LISTP (P-PROG-SEGMENT L))
(EQUAL (CAR (UNTAG (P-PC L))) 'MAIN)
(EQUAL (CAAR (P-PROG-SEGMENT L))
'MAIN)
(ALL-USER-FNAMESP (STRIP-CARS (CDR (P-PROG-SEGMENT L))))
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L)))
TABLE)
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
(OFFSET (P-PC L)))))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (CAR (P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (CAR (P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
0))
(NOT (EQUAL (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)
1)))
(LESSP (SUB1 (SUB1 (LR-P-PC-1 (PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
POS)))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 1.3 0.1 ]
PROPER-P-STATEP-LR->P-LR-SET-POS
(PROVE-LEMMA LR-P-PC-LR-POP-TSTK
(REWRITE)
(EQUAL (LR-P-PC (LR-POP-TSTK L))
(LR-P-PC L))
((ENABLE LR-P-PC P-CURRENT-PROGRAM)))
This formula simplifies, rewriting with P-ACCESSORS-LR-POP-TSTK, and expanding
the functions P-CURRENT-PROGRAM, DEFINITION, and LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-PC-LR-POP-TSTK
(PROVE-LEMMA PROPER-P-STATEP-LR->P-LR-POP-TSTK
(REWRITE)
(IMPLIES (PROPER-P-STATEP (LR->P L))
(PROPER-P-STATEP (LR->P (LR-POP-TSTK L))))
((ENABLE PROPER-P-STATEP)
(DISABLE EXP P-CTRL-STK-SIZE PROPER-P-ALISTP PROPER-P-CTRL-STKP
PROPER-P-DATA-SEGMENTP PROPER-P-PROG-SEGMENTP)))
This formula can be simplified, using the abbreviations PROPER-P-FRAMEP,
DEFINITION, CAR-UNTAG-LR-P-PC, ADP-NAME, ADP-OFFSET, PCPP, CDDR-NIL-LR-P-PC,
TYPE-LR-P-PC, P-OBJECTP-TYPE-OPENER, POP, AREA-NAME-LR-P-PC, TOP,
P-ACCESSORS-LR->P, PROPER-P-STATEP, and IMPLIES, to:
(IMPLIES
(AND
(P-STATEP (LR->P L))
(EQUAL 'PC 'PC)
(EQUAL NIL NIL)
(LISTP (UNTAG (LR-P-PC L)))
(NUMBERP (CDR (UNTAG (LR-P-PC L))))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(LOCAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP 0 (P-WORD-SIZE L)))
(PROPER-P-STATEP (LR->P (LR-POP-TSTK L)))),
which simplifies, appealing to the lemmas LISTP-UNTAG-LR-P-PC,
NUMBERP-CDR-LR-P-PC, PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES, P-TEMP-STK-LR-POP-TSTK,
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES, SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, AREA-NAME-LR-P-PC, P-OBJECTP-TYPE-OPENER,
CAR-UNTAG-LR-P-PC, P-ACCESSORS-LR-POP-TSTK, CDDR-NIL-LR-P-PC, TYPE-LR-P-PC,
P-ACCESSORS-LR->P, and LR-P-PC-LR-POP-TSTK, and unfolding EQUAL, LOCAL-VARS,
LESSP, POP, PROPER-P-FRAMEP, TOP, PCPP, ADP-OFFSET, ADP-NAME, DEFINITION, and
PROPER-P-STATEP, to four new conjectures:
Case 4. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (P-PSW L) 'RUN)))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P (LR-POP-TSTK L)))),
which again simplifies, applying SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
P-ACCESSORS-LR-POP-TSTK, P-ACCESSORS-LR->P, and
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES, to:
T.
Case 3. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (LISTP (P-TEMP-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P (LR-POP-TSTK L)))).
This again simplifies, opening up the functions PROPER-P-TEMP-STKP, LENGTH,
EQUAL, LESSP, and LISTP, to:
T.
Case 2. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P (LR-POP-TSTK L)))).
Applying the lemmas
P-PC-P-CTRL-STK-P-TEMP-STK-P-PROG-SEGMENT-P-DATA-SEGMENT-P-MAX-CTRL-STK-SIZE-P-MAX-TEMP-STK-SIZE-P-WORD-SIZE-P-PSW-ELIM
and CAR-CDR-ELIM, replace L by (P-STATE X V1 Z1 X1 C D W V Z) to eliminate
(P-PC L), (P-PSW L), (P-WORD-SIZE L), (P-MAX-TEMP-STK-SIZE L),
(P-MAX-CTRL-STK-SIZE L), (P-DATA-SEGMENT L), (P-PROG-SEGMENT L),
(P-TEMP-STK L), and (P-CTRL-STK L), V1 by (CONS W1 D1) to eliminate (CAR V1)
and (CDR V1), W1 by (CONS C1 V1) to eliminate (CDR W1) and (CAR W1), V1 by
(CONS X2 W1) to eliminate (CDR V1) and (CAR V1), and Z1 by (CONS Z2 V1) to
eliminate (CDR Z1) and (CAR Z1). We thus obtain the following two new goals:
Case 2.2.
(IMPLIES
(AND
(NOT (P-STATEP L))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P (LR-POP-TSTK L)))).
But this further simplifies, rewriting with P-PC-NP-STATEP,
P-PROG-SEGMENT-NP-STATEP, and P-CTRL-STK-NP-STATEP, and opening up UNTAG,
CAR, COMP-PROGRAMS, DEFINEDP, ASSOC, PROGRAM-BODY, LENGTH, and LISTP, to:
T.
Case 2.1.
(IMPLIES
(AND
(DEFINEDP (CAR (UNTAG X))
(COMP-PROGRAMS X1))
(LESSP
(CDR (UNTAG (LR-P-PC (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z))))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG X))
(COMP-PROGRAMS X1)))))
(EQUAL W1 NIL)
(PROPER-P-ALISTP (BINDINGS (CONS C1 (CONS X2 W1)))
(LR->P (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z)))
(EQUAL
(STRIP-CARS (BINDINGS (CONS C1 (CONS X2 W1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME X)
(COMP-PROGRAMS X1)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME X)
(COMP-PROGRAMS X1))))))
(EQUAL (TYPE (RET-PC (CONS C1 (CONS X2 W1))))
'PC)
(EQUAL (CDDR (RET-PC (CONS C1 (CONS X2 W1))))
NIL)
(LISTP (UNTAG (RET-PC (CONS C1 (CONS X2 W1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CONS C1 (CONS X2 W1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CONS C1 (CONS X2 W1)))))
(COMP-PROGRAMS X1))
(LESSP
(CDR (UNTAG (RET-PC (CONS C1 (CONS X2 W1)))))
(LENGTH
(PROGRAM-BODY
(ASSOC (CAR (UNTAG (RET-PC (CONS C1 (CONS X2 W1)))))
(COMP-PROGRAMS X1)))))
(PROPER-P-CTRL-STKP D1
(AREA-NAME (RET-PC (CONS C1 (CONS X2 W1))))
(LR->P (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z)))
(NOT (LESSP D
(P-CTRL-STK-SIZE (CONS (CONS C1 (CONS X2 W1)) D1))))
(PROPER-P-TEMP-STKP
(CONS Z2 V1)
(LR->P (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z)))
(NOT (LESSP W (LENGTH (CONS Z2 V1))))
(PROPER-P-PROG-SEGMENTP
(COMP-PROGRAMS X1)
(LR->P (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z)))
(PROPER-P-DATA-SEGMENTP C
(LR->P (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP V)
(LESSP D (EXP 2 V))
(LESSP W (EXP 2 V))
(NOT (EQUAL V 0))
(EQUAL Z 'RUN))
(PROPER-P-TEMP-STKP V1
(LR->P (LR-POP-TSTK (P-STATE X
(CONS (CONS C1 (CONS X2 W1)) D1)
(CONS Z2 V1)
X1 C D W V Z))))).
However this further simplifies, rewriting with CDR-CONS, CAR-CONS,
LENGTH-CONS, SUB1-ADD1, P-WORD-SIZE-P-STATE, P-PROG-SEGMENT-P-STATE,
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, P-ACCESSORS-LR-POP-TSTK,
P-ACCESSORS-LR->P, P-DATA-SEGMENT-P-STATE, and
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES, and opening up the definitions of
POP, TOP, PROPER-P-TEMP-STKP, and LESSP, to:
T.
Case 1. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (CDR (P-TEMP-STK L)))))).
This again simplifies, applying SUB1-ADD1, and opening up LENGTH and LESSP,
to the new formula:
(IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (EQUAL (P-MAX-TEMP-STK-SIZE L) 0))
(NOT (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (CDR (P-TEMP-STK L)))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (CDR (P-TEMP-STK L)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.3 0.1 ]
PROPER-P-STATEP-LR->P-LR-POP-TSTK
(PROVE-LEMMA GOOD-POSP-DV-1-TEMPS-LR-EXPR
(REWRITE)
(IMPLIES (AND (OR (EQUAL (CAR (LR-EXPR L))
(S-TEMP-EVAL))
(EQUAL (CAR (LR-EXPR L))
(S-TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
(GOOD-POSP1 (DV (OFFSET (P-PC L)) 1)
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
((ENABLE DV LR-EXPR)
(EXPAND (GOOD-POSP1 '(1)
(CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))))))
This conjecture can be simplified, using the abbreviations AND, IMPLIES, DV,
S-TEMP-TEST, and S-TEMP-EVAL, to:
(IMPLIES (AND (OR (EQUAL (CAR (LR-EXPR L)) '(TEMP-EVAL))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
(GOOD-POSP1 (APPEND (OFFSET (P-PC L)) '(1))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))).
This simplifies, applying GOOD-POSP1-FLAG-NOT-LIST-NIL and GOOD-POSP1-APPEND,
and expanding LR-EXPR, OR, GOOD-POSP1, LISTP, S-TEMP-FETCH, EQUAL, S-TEMP-EVAL,
CAR, CDR, and S-TEMP-TEST, to two new goals:
Case 2. (IMPLIES
(AND (EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
'(TEMP-EVAL))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
(LISTP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))),
which again simplifies, applying CAR-NLISTP, and unfolding the definition of
EQUAL, to:
T.
Case 1. (IMPLIES
(AND (EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))
(LISTP (CUR-EXPR (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L))))).
This again simplifies, rewriting with CAR-NLISTP, and expanding the function
EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
GOOD-POSP-DV-1-TEMPS-LR-EXPR
(PROVE-LEMMA PROPER-P-ALISTP-PUT-ASSOC
(REWRITE)
(IMPLIES (AND (PROPER-P-ALISTP BINDINGS L)
(P-OBJECTP OBJECT L))
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME BINDINGS)
L)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP BINDINGS)
(p OBJECT VAR-NAME BINDINGS L))
(IMPLIES (AND (NOT (NLISTP BINDINGS))
(p OBJECT VAR-NAME (CDR BINDINGS) L))
(p OBJECT VAR-NAME BINDINGS L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT BINDINGS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new conjectures:
Case 3. (IMPLIES (AND (NLISTP BINDINGS)
(PROPER-P-ALISTP BINDINGS L)
(P-OBJECTP OBJECT L))
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME BINDINGS)
L)).
This simplifies, rewriting with the lemma NOT-DEFINEDP-PUT-ASSOC, and
opening up the definitions of NLISTP, PROPER-P-ALISTP, DEFINEDP, LISTP, and
EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (PROPER-P-ALISTP (CDR BINDINGS) L))
(PROPER-P-ALISTP BINDINGS L)
(P-OBJECTP OBJECT L))
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME BINDINGS)
L)).
This simplifies, opening up the functions NLISTP and PROPER-P-ALISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME
(CDR BINDINGS))
L)
(PROPER-P-ALISTP BINDINGS L)
(P-OBJECTP OBJECT L))
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME BINDINGS)
L)).
This simplifies, unfolding NLISTP, PROPER-P-ALISTP, and PUT-ASSOC, to the
following two new goals:
Case 1.2.
(IMPLIES (AND (LISTP BINDINGS)
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME
(CDR BINDINGS))
L)
(LISTP (CAR BINDINGS))
(LITATOM (CAAR BINDINGS))
(P-OBJECTP (CDAR BINDINGS) L)
(PROPER-P-ALISTP (CDR BINDINGS) L)
(P-OBJECTP OBJECT L)
(NOT (EQUAL VAR-NAME (CAAR BINDINGS))))
(PROPER-P-ALISTP (CONS (CAR BINDINGS)
(PUT-ASSOC OBJECT VAR-NAME
(CDR BINDINGS)))
L)).
This again simplifies, rewriting with PROPER-P-ALISTP-LR->P-SIMILAR-STATES,
CDR-CONS, P-OBJECTP-SIMILAR-P-STATES, SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
and CAR-CONS, and expanding the definition of PROPER-P-ALISTP, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP BINDINGS)
(PROPER-P-ALISTP (PUT-ASSOC OBJECT VAR-NAME
(CDR BINDINGS))
L)
(LISTP (CAR BINDINGS))
(LITATOM (CAAR BINDINGS))
(P-OBJECTP (CDAR BINDINGS) L)
(PROPER-P-ALISTP (CDR BINDINGS) L)
(P-OBJECTP OBJECT L)
(EQUAL VAR-NAME (CAAR BINDINGS)))
(PROPER-P-ALISTP (CONS (CONS VAR-NAME OBJECT)
(CDR BINDINGS))
L)).
But this again simplifies, rewriting with the lemmas
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, P-OBJECTP-SIMILAR-P-STATES,
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, CDR-CONS, and CAR-CONS, and opening
up PROPER-P-ALISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
PROPER-P-ALISTP-PUT-ASSOC
(PROVE-LEMMA LISTP-P-TEMP-STK-LR-PUSH-TSTK
(REWRITE)
(IMPLIES (EQUAL (P-PSW (LR-PUSH-TSTK L OBJECT))
'RUN)
(LISTP (P-TEMP-STK (LR-PUSH-TSTK L OBJECT))))
((ENABLE LR-PUSH-TSTK)))
This formula simplifies, applying P-ACCESSORS-LR-SET-TSTK and
P-ACCESSORS-LR-SET-ERROR, and unfolding PUSH, LR-PUSH-TSTK, and EQUAL, to:
(IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PSW (LR-SET-ERROR L
'LR-PUSH-TSTK-FULL-STACK))
'RUN))
(LISTP (P-TEMP-STK L))),
which again simplifies, applying LENGTH-NLISTP and P-ACCESSORS-LR-SET-ERROR,
and expanding the functions EQUAL and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-P-TEMP-STK-LR-PUSH-TSTK
(PROVE-LEMMA LR-P-PC-LR-SET-TEMP
(REWRITE)
(EQUAL (LR-P-PC (LR-SET-TEMP L VALUE VAR-NAME))
(LR-P-PC L))
((ENABLE LR-P-PC P-CURRENT-PROGRAM)))
This conjecture simplifies, appealing to the lemma P-ACCESSORS-LR-SET-TEMP,
and expanding the functions P-CURRENT-PROGRAM, DEFINITION, and LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-PC-LR-SET-TEMP
(PROVE-LEMMA PROPER-P-STATEP-LR-SET-TEMP
(REWRITE)
(IMPLIES (AND (PROPER-P-STATEP (LR->P L))
(LISTP (P-TEMP-STK L)))
(PROPER-P-STATEP (LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME))))
((ENABLE PROPER-P-STATEP)
(DISABLE EXP PROPER-P-ALISTP PROPER-P-CTRL-STKP
PROPER-P-DATA-SEGMENTP PROPER-P-PROG-SEGMENTP
PROPER-P-TEMP-STKP)
(EXPAND (PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L)))))
This conjecture can be simplified, using the abbreviations PROPER-P-FRAMEP,
DEFINITION, CAR-UNTAG-LR-P-PC, ADP-NAME, ADP-OFFSET, PCPP, CDDR-NIL-LR-P-PC,
TYPE-LR-P-PC, P-OBJECTP-TYPE-OPENER, POP, AREA-NAME-LR-P-PC, TOP,
P-ACCESSORS-LR->P, PROPER-P-STATEP, AND, and IMPLIES, to:
(IMPLIES
(AND
(P-STATEP (LR->P L))
(EQUAL 'PC 'PC)
(EQUAL NIL NIL)
(LISTP (UNTAG (LR-P-PC L)))
(NUMBERP (CDR (UNTAG (LR-P-PC L))))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(LOCAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP 0 (P-WORD-SIZE L))
(LISTP (P-TEMP-STK L)))
(PROPER-P-STATEP (LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))).
This simplifies, rewriting with the lemmas LISTP-UNTAG-LR-P-PC,
NUMBERP-CDR-LR-P-PC, COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG1, SUB1-ADD1,
EQUAL-SUB1-0, PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES, P-OBJECTP-SIMILAR-P-STATES,
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, AREA-NAME-LR-P-PC, P-OBJECTP-TYPE-OPENER,
CAR-UNTAG-LR-P-PC, P-ACCESSORS-LR-SET-TEMP, CDDR-NIL-LR-P-PC, TYPE-LR-P-PC,
P-ACCESSORS-LR->P, and LR-P-PC-LR-SET-TEMP, and expanding the functions EQUAL,
LOCAL-VARS, P-FRAME-SIZE, PLUS, TOP, P-CTRL-STK-SIZE, LESSP,
PROPER-P-TEMP-STKP, POP, SET-LOCAL-VAR-VALUE, PUT-VALUE, PUSH, PCPP,
ADP-OFFSET, ADP-NAME, DEFINITION, and PROPER-P-STATEP, to the following six
new goals:
Case 6. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(NOT (EQUAL (P-PSW L) 'RUN)))
(PROPER-P-FRAMEP (CAR (P-CTRL-STK L))
(AREA-NAME (P-PC L))
(LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))).
This again simplifies, applying the lemmas P-OBJECTP-TYPE-OPENER,
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, P-ACCESSORS-LR->P,
P-ACCESSORS-LR-SET-TEMP, and SAME-SIGNATURE-REFLEXIVE-GENERALIZED, and
unfolding the definitions of PCPP, ADP-OFFSET, ADP-NAME, LOCAL-VARS,
DEFINITION, EQUAL, and PROPER-P-FRAMEP, to:
T.
Case 5. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(PROPER-P-FRAMEP
(CAR (CONS (P-FRAME (PUT-ASSOC (CAR (P-TEMP-STK L))
VAR-NAME
(BINDINGS (CAR (P-CTRL-STK L))))
(RET-PC (CAR (P-CTRL-STK L))))
(CDR (P-CTRL-STK L))))
(AREA-NAME (P-PC L))
(LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))),
which again simplifies, rewriting with CAR-CONS, P-OBJECTP-TYPE-OPENER,
RET-PC-P-FRAME, STRIP-CARS-PUT-ASSOC, PROPER-P-ALISTP-PUT-ASSOC,
SAME-SIGNATURE-REFLEXIVE-GENERALIZED, P-ACCESSORS-LR-SET-TEMP,
P-ACCESSORS-LR->P, PROPER-P-ALISTP-LR->P-SIMILAR-STATES,
P-OBJECTP-SIMILAR-P-STATES, BINDINGS-P-FRAME, EQUAL-CDDR-P-FRAME-NIL, and
LISTP-CDR-P-FRAME, and unfolding PCPP, ADP-OFFSET, ADP-NAME, LOCAL-VARS,
DEFINITION, EQUAL, and PROPER-P-FRAMEP, to:
T.
Case 4. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(NOT (EQUAL (P-PSW L) 'RUN)))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))).
But this again simplifies, applying SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
P-ACCESSORS-LR-SET-TEMP, P-ACCESSORS-LR->P, and
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES, to:
T.
Case 3. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(PROPER-P-CTRL-STKP
(CDR (CONS (P-FRAME (PUT-ASSOC (CAR (P-TEMP-STK L))
VAR-NAME
(BINDINGS (CAR (P-CTRL-STK L))))
(RET-PC (CAR (P-CTRL-STK L))))
(CDR (P-CTRL-STK L))))
(AREA-NAME
(RET-PC
(CAR (CONS (P-FRAME (PUT-ASSOC (CAR (P-TEMP-STK L))
VAR-NAME
(BINDINGS (CAR (P-CTRL-STK L))))
(RET-PC (CAR (P-CTRL-STK L))))
(CDR (P-CTRL-STK L))))))
(LR->P (LR-SET-TEMP L
(CAR (P-TEMP-STK L))
VAR-NAME)))).
This again simplifies, rewriting with the lemmas CDR-CONS, CAR-CONS,
RET-PC-P-FRAME, SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
P-ACCESSORS-LR-SET-TEMP, P-ACCESSORS-LR->P, and
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES, to:
T.
Case 2. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(NOT (EQUAL (P-PSW L) 'RUN)))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))),
which again simplifies, rewriting with the lemmas COMMUTATIVITY-OF-PLUS,
PLUS-ADD1-ARG1, SUB1-ADD1, and EQUAL-SUB1-0, and unfolding the definitions
of P-FRAME-SIZE, EQUAL, PLUS, TOP, P-CTRL-STK-SIZE, and LESSP, to:
T.
Case 1. (IMPLIES
(AND
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(P-OBJECTP (CAR (P-TEMP-STK L))
(LR->P L))
(PROPER-P-TEMP-STKP (CDR (P-TEMP-STK L))
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(LISTP (P-TEMP-STK L))
(EQUAL (P-PSW L) 'RUN))
(NOT
(LESSP
(P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE
(CONS (P-FRAME (PUT-ASSOC (CAR (P-TEMP-STK L))
VAR-NAME
(BINDINGS (CAR (P-CTRL-STK L))))
(RET-PC (CAR (P-CTRL-STK L))))
(CDR (P-CTRL-STK L))))))),
which again simplifies, applying COMMUTATIVITY-OF-PLUS, CDR-CONS,
BINDINGS-P-FRAME, LENGTH-PUT-ASSOC, PLUS-ADD1-ARG1, CAR-CONS, SUB1-ADD1, and
EQUAL-SUB1-0, and expanding the functions P-FRAME-SIZE, EQUAL, PLUS, TOP,
P-CTRL-STK-SIZE, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.8 0.1 ]
PROPER-P-STATEP-LR-SET-TEMP
(PROVE-LEMMA P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP
(REWRITE)
(IMPLIES (AND (PROPER-P-ALISTP BINDINGS L)
(DEFINEDP OBJECT BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT BINDINGS))
L)))
Give the conjecture the name *1.
Let us appeal to the induction principle. The recursive terms in the
conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP BINDINGS)
(p OBJECT BINDINGS L))
(IMPLIES (AND (NOT (NLISTP BINDINGS))
(p OBJECT (CDR BINDINGS) L))
(p OBJECT BINDINGS L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT BINDINGS) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates the following four new
conjectures:
Case 4. (IMPLIES (AND (NLISTP BINDINGS)
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP OBJECT BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT BINDINGS))
L)).
This simplifies, opening up the functions NLISTP, PROPER-P-ALISTP, LISTP,
and DEFINEDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (PROPER-P-ALISTP (CDR BINDINGS) L))
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP OBJECT BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT BINDINGS))
L)).
This simplifies, unfolding the functions NLISTP and PROPER-P-ALISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(NOT (DEFINEDP OBJECT (CDR BINDINGS)))
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP OBJECT BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT BINDINGS))
L)).
This simplifies, applying SAME-SIGNATURE-REFLEXIVE-GENERALIZED and
P-OBJECTP-SIMILAR-P-STATES, and unfolding the functions NLISTP,
PROPER-P-ALISTP, DEFINEDP, and ASSOC, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT (CDR BINDINGS)))
L)
(PROPER-P-ALISTP BINDINGS L)
(DEFINEDP OBJECT BINDINGS))
(P-OBJECTP (CDR (ASSOC OBJECT BINDINGS))
L)),
which simplifies, rewriting with SAME-SIGNATURE-REFLEXIVE-GENERALIZED and
P-OBJECTP-SIMILAR-P-STATES, and expanding the functions NLISTP,
PROPER-P-ALISTP, DEFINEDP, and ASSOC, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP
(PROVE-LEMMA DEFINEDP-CADDR-LR-EXPR-BINDINGS-CTRL-STK NIL
(IMPLIES
(AND
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(DEFINEDP NAME PROGS)
(OR (EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(S-TEMP-FETCH))
(EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(S-TEMP-TEST)))
(GOOD-POSP1 POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
(EQUAL (STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (ASSOC NAME (COMP-PROGRAMS PROGS)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME
(COMP-PROGRAMS PROGS)))))))
(DEFINEDP (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
BINDINGS))
((USE
(LR-PROGRAMS-PROPERP-1-LR-PROPER-EXPRP (PROG (ASSOC NAME PROGS))
(PROGRAM-NAMES PROGRAM-NAMES)
(PROGS PROGS)
(TABLE TABLE))
(LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR
(BODY (PROGRAM-BODY (ASSOC NAME PROGS)))
(PNAMES PROGRAM-NAMES)
(FORMALS (FORMAL-VARS (ASSOC NAME PROGS)))
(TEMPS (STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))
(POS POS)
(TABLE TABLE))
(MEMBER-STRIP-CARS-DEFINEDP
(X (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(Y BINDINGS))
(MEMBER-APPEND (A (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(X (FORMAL-VARS (ASSOC NAME PROGS)))
(Y (STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))))
(EXPAND (LR-PROPER-EXPRP T
(CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE))
(DISABLE LR-PROPER-EXPRP *1*P-RUNTIME-SUPPORT-PROGRAMS MEMBER-APPEND
LR-PROPER-EXPRP-LR-PROPER-EXPRP-CUR-EXPR)))
This formula can be simplified, using the abbreviations IMPLIES, AND,
S-TEMP-TEST, and S-TEMP-FETCH, to the new formula:
(IMPLIES
(AND
(IMPLIES
(AND (LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(MEMBER (ASSOC NAME PROGS) PROGS))
(LR-PROPER-EXPRP T
(PROGRAM-BODY (ASSOC NAME PROGS))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE))
(IMPLIES
(AND (LR-PROPER-EXPRP T
(PROGRAM-BODY (ASSOC NAME PROGS))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE)
(GOOD-POSP1 POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(LR-PROPER-EXPRP T
(CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE))
(EQUAL (MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS BINDINGS))
(DEFINEDP (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
BINDINGS))
(EQUAL
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(APPEND (FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))))
(OR (MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(FORMAL-VARS (ASSOC NAME PROGS)))
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(DEFINEDP NAME PROGS)
(OR (EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
'(TEMP-FETCH))
(EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
'(TEMP-TEST)))
(GOOD-POSP1 POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
(EQUAL
(STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (ASSOC NAME (COMP-PROGRAMS PROGS)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME
(COMP-PROGRAMS PROGS)))))))
(DEFINEDP (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
BINDINGS)),
which simplifies, rewriting with MEMBER-ASSOC, ADD1-EQUAL, CDR-NLISTP,
CAR-NLISTP, FORMAL-VARS-ASSOC-COMP-PROGRAMS, and
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS, and unfolding the definitions of AND,
IMPLIES, LR-PROPER-EXPRP, EQUAL, PLISTP, S-TEMP-FETCH, LENGTH, NUMBERP,
S-TEMP-EVAL, S-TEMP-TEST, ARITY, CDR, CAR, and OR, to the following two new
formulas:
Case 2. (IMPLIES
(AND
(LR-PROPER-EXPRP T
(PROGRAM-BODY (ASSOC NAME PROGS))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE)
(NOT (LITATOM (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(LISTP (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(LISTP (CDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(PLISTP (CDDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
'(TEMP-TEST))
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))
(EQUAL
(ADD1 (LENGTH (CDDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))))
2)
(LR-PROPER-EXPRP T
(CADR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE)
(NOT (MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS BINDINGS)))
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(APPEND (FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(DEFINEDP NAME PROGS)
(GOOD-POSP1 POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
(EQUAL (STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))))
(DEFINEDP (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
BINDINGS)).
But this again simplifies, rewriting with the lemma ADD1-EQUAL, and
expanding NUMBERP, to:
T.
Case 1. (IMPLIES
(AND
(LR-PROPER-EXPRP T
(PROGRAM-BODY (ASSOC NAME PROGS))
PROGRAM-NAMES
(FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))
TABLE)
(NOT (LITATOM (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(LISTP (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(LISTP (CDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(PLISTP (CDDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS)))))
(EQUAL (CAR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
'(TEMP-FETCH))
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))
(EQUAL
(ADD1 (LENGTH (CDDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))))
2)
(NOT (MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(STRIP-CARS BINDINGS)))
(MEMBER (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
(APPEND (FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS)))))
(LR-PROGRAMS-PROPERP-1 PROGS PROGRAM-NAMES TABLE)
(DEFINEDP NAME PROGS)
(GOOD-POSP1 POS
(PROGRAM-BODY (ASSOC NAME PROGS)))
(EQUAL (STRIP-CARS BINDINGS)
(APPEND (FORMAL-VARS (ASSOC NAME PROGS))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC NAME PROGS))))))
(DEFINEDP (CADDR (CUR-EXPR POS
(PROGRAM-BODY (ASSOC NAME PROGS))))
BINDINGS)),
which again simplifies, rewriting with the lemma ADD1-EQUAL, and expanding
the function NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
DEFINEDP-CADDR-LR-EXPR-BINDINGS-CTRL-STK
(PROVE-LEMMA PROPER-P-TEMP-STKP-P-TEMP-STK-LR-DO-TEMP-FETCH
(REWRITE)
(IMPLIES (AND (PROPER-P-FRAMEP (TOP (P-CTRL-STK L1))
(AREA-NAME (P-PC L1))
L2)
(LR-PROGRAMS-PROPERP L1 TABLE)
(OR (EQUAL (CAR (LR-EXPR L1))
(S-TEMP-FETCH))
(EQUAL (CAR (LR-EXPR L1))
(S-TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (P-CURRENT-PROGRAM L1)))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (P-PROG-SEGMENT (LR->P L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2)))
(EQUAL (PROPER-P-TEMP-STKP (P-TEMP-STK (LR-DO-TEMP-FETCH L1))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2)))
((ENABLE LR-EXPR LR-DO-TEMP-FETCH LR-PUSH-TSTK P-CURRENT-PROGRAM)
(DISABLE CUR-EXPR LR-PROPER-EXPRP)
(USE
(DEFINEDP-CADDR-LR-EXPR-BINDINGS-CTRL-STK
(PROGS (P-PROG-SEGMENT L1))
(PROGRAM-NAMES (STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L1))))
(BINDINGS (BINDINGS (CAR (P-CTRL-STK L1))))
(NAME (AREA-NAME (P-PC L1)))
(POS (OFFSET (P-PC L1)))))))
WARNING: Note that PROPER-P-TEMP-STKP-P-TEMP-STK-LR-DO-TEMP-FETCH contains
the free variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L1 TABLE).
This conjecture can be simplified, using the abbreviations ADP-NAME,
ADP-OFFSET, PCPP, P-OBJECTP-TYPE-OPENER, DEFINITION, PROPER-P-FRAMEP, AND,
IMPLIES, P-ACCESSORS-LR->P, TOP, S-TEMP-TEST, and S-TEMP-FETCH, to:
(IMPLIES
(AND
(IMPLIES
(AND
(LR-PROGRAMS-PROPERP-1 (P-PROG-SEGMENT L1)
(STRIP-LOGIC-FNAMES (CDR (P-PROG-SEGMENT L1)))
TABLE)
(DEFINEDP (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L1))
(OR
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L1)))))
'(TEMP-FETCH))
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L1)))))
'(TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L1))))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND
(FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(COMP-PROGRAMS (P-PROG-SEGMENT L1))))
(STRIP-CARS
(TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(COMP-PROGRAMS (P-PROG-SEGMENT L1))))))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1)))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(LOCAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(OR (EQUAL (CAR (LR-EXPR L1))
'(TEMP-FETCH))
(EQUAL (CAR (LR-EXPR L1))
'(TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (P-CURRENT-PROGRAM L1)))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2)))
(EQUAL (PROPER-P-TEMP-STKP (P-TEMP-STK (LR-DO-TEMP-FETCH L1))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
This simplifies, rewriting with the lemmas
LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1, CUR-EXPR-NLISTP, and CAR-NLISTP,
and expanding the functions ASSOC, OR, AND, IMPLIES, LOCAL-VARS,
P-CURRENT-PROGRAM, DEFINITION, LR-EXPR, PROGRAM-BODY, EQUAL, LR-PUSH-TSTK,
PUSH, LOCAL-VAR-VALUE, TOP, VALUE, and LR-DO-TEMP-FETCH, to the following 12
new formulas:
Case 12.(IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(NOT (LR-EVAL-TEMP-SETP L1)))
(EQUAL
(PROPER-P-TEMP-STKP (P-TEMP-STK (LR-SET-ERROR L1
'TEMP-FETCH-NOT-SET))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
But this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 11.(IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-SET-ERROR L1
'LR-PUSH-TSTK-FULL-STACK))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 10.(IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1)))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-SET-TSTK L1
(CONS
(CDR
(ASSOC
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1)))))
(P-TEMP-STK L1))))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, CDR-CONS,
P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP, and CAR-CONS, and unfolding
the functions POP, TOP, and PROPER-P-TEMP-STKP, to:
T.
Case 9. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(NOT (LR-EVAL-TEMP-SETP L1)))
(EQUAL
(PROPER-P-TEMP-STKP (P-TEMP-STK (LR-SET-ERROR L1
'TEMP-FETCH-NOT-SET))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
But this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 8. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-SET-ERROR L1
'LR-PUSH-TSTK-FULL-STACK))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
But this again simplifies, rewriting with the lemma P-ACCESSORS-LR-SET-ERROR,
to:
T.
Case 7. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1)))
(DEFINEDP (CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL (CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1)))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-SET-TSTK L1
(CONS
(CDR
(ASSOC
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L1)))))
(BINDINGS (CAR (P-CTRL-STK L1)))))
(P-TEMP-STK L1))))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-TSTK, CDR-CONS,
P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP, and CAR-CONS, and expanding
the functions POP, TOP, and PROPER-P-TEMP-STKP, to:
T.
Case 6. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(NOT (LR-EVAL-TEMP-SETP L1)))
(EQUAL
(PROPER-P-TEMP-STKP (P-TEMP-STK (LR-SET-ERROR L1
'TEMP-FETCH-NOT-SET))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
This again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 5. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-SET-ERROR L1
'LR-PUSH-TSTK-FULL-STACK))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
However this again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 4. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1)))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-SET-TSTK L1
(CONS
(CDR
(ASSOC
(CADDR
(CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1)))))
(P-TEMP-STK L1))))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
However this again simplifies, applying P-ACCESSORS-LR-SET-TSTK, CDR-CONS,
P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP, and CAR-CONS, and expanding
the definitions of POP, TOP, and PROPER-P-TEMP-STKP, to:
T.
Case 3. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(NOT (LR-EVAL-TEMP-SETP L1)))
(EQUAL
(PROPER-P-TEMP-STKP (P-TEMP-STK (LR-SET-ERROR L1
'TEMP-FETCH-NOT-SET))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
This again simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 2. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1))))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK (LR-SET-ERROR L1
'LR-PUSH-TSTK-FULL-STACK))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))),
which again simplifies, applying P-ACCESSORS-LR-SET-ERROR, to:
T.
Case 1. (IMPLIES
(AND
(LISTP (P-PROG-SEGMENT L1))
(NOT (EQUAL (AREA-NAME (P-PC L1))
(CAAR (P-PROG-SEGMENT L1))))
(DEFINEDP
(CADDR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1))))
(LISTP (CAR (P-CTRL-STK L1)))
(LISTP (CDAR (P-CTRL-STK L1)))
(EQUAL (CDDAR (P-CTRL-STK L1)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L1)))
L2)
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L1))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L1))
(P-PROG-SEGMENT L2))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L1))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L1))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L1)))))
(P-PROG-SEGMENT L2)))))
(LR-PROGRAMS-PROPERP L1 TABLE)
(EQUAL
(CAR (CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
'(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1)))))
(SAME-SIGNATURE (P-DATA-SEGMENT L1)
(P-DATA-SEGMENT L2))
(EQUAL (COMP-PROGRAMS (P-PROG-SEGMENT L1))
(P-PROG-SEGMENT L2))
(EQUAL (P-WORD-SIZE L1)
(P-WORD-SIZE L2))
(LR-EVAL-TEMP-SETP L1)
(EQUAL (P-PSW L1) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L1))
(P-MAX-TEMP-STK-SIZE L1)))
(EQUAL
(PROPER-P-TEMP-STKP
(P-TEMP-STK
(LR-SET-TSTK L1
(CONS
(CDR
(ASSOC
(CADDR
(CUR-EXPR (OFFSET (P-PC L1))
(PROGRAM-BODY (ASSOC (AREA-NAME (P-PC L1))
(CDR (P-PROG-SEGMENT L1))))))
(BINDINGS (CAR (P-CTRL-STK L1)))))
(P-TEMP-STK L1))))
L2)
(PROPER-P-TEMP-STKP (P-TEMP-STK L1)
L2))).
However this again simplifies, applying P-ACCESSORS-LR-SET-TSTK, CDR-CONS,
P-OBJECTP-CDR-ASSOC-BINDINGS-PROPER-P-ALISTP, and CAR-CONS, and unfolding
the definitions of POP, TOP, and PROPER-P-TEMP-STKP, to:
T.
Q.E.D.
[ 0.0 1.2 0.0 ]
PROPER-P-TEMP-STKP-P-TEMP-STK-LR-DO-TEMP-FETCH
(PROVE-LEMMA LENGTH-LR-DO-TEMP-FETCH
(REWRITE)
(IMPLIES (EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-DO-TEMP-FETCH L))))))
((ENABLE LR-DO-TEMP-FETCH)))
WARNING: Note that the proposed lemma LENGTH-LR-DO-TEMP-FETCH is to be stored
as zero type prescription rules, zero compound recognizer rules, one linear
rule, and zero replacement rules.
This formula simplifies, applying the lemma P-ACCESSORS-LR-SET-ERROR, and
unfolding LOCAL-VAR-VALUE, TOP, DEFINITION, VALUE, and LR-DO-TEMP-FETCH, to
the following two new goals:
Case 2. (IMPLIES (AND (NOT (LR-EVAL-TEMP-SETP L))
(EQUAL (P-PSW (LR-SET-ERROR L 'TEMP-FETCH-NOT-SET))
'RUN))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))).
However this again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and
opening up the definition of EQUAL, to:
T.
Case 1. (IMPLIES
(AND
(LR-EVAL-TEMP-SETP L)
(EQUAL
(P-PSW (LR-PUSH-TSTK L
(CDR (ASSOC (CADDR (LR-EXPR L))
(BINDINGS (CAR (P-CTRL-STK L)))))))
'RUN))
(NOT
(LESSP
(P-MAX-TEMP-STK-SIZE L)
(LENGTH
(P-TEMP-STK
(LR-PUSH-TSTK L
(CDR (ASSOC (CADDR (LR-EXPR L))
(BINDINGS (CAR (P-CTRL-STK L))))))))))).
But this again simplifies, using linear arithmetic and rewriting with the
lemma NOT-LESSP-P-MAX-TEMP-STK-SIZE-LR-PUSH-TSTK, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-LR-DO-TEMP-FETCH
(PROVE-LEMMA LR-P-PC-LR-DO-TEMP-FETCH
(REWRITE)
(EQUAL (LR-P-PC (LR-DO-TEMP-FETCH L))
(LR-P-PC L))
((ENABLE LR-P-PC P-CURRENT-PROGRAM)))
This formula simplifies, rewriting with P-ACCESSORS-LR-DO-TEMP-FETCH, and
expanding the functions P-CURRENT-PROGRAM, DEFINITION, and LR-P-PC, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-P-PC-LR-DO-TEMP-FETCH
(PROVE-LEMMA PROPER-P-STATEP-LR-DO-TEMP-FETCH
(REWRITE)
(IMPLIES (AND (EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(OR (EQUAL (CAR (LR-EXPR L))
(S-TEMP-FETCH))
(EQUAL (CAR (LR-EXPR L))
(S-TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(PROPER-P-STATEP (LR->P L)))
(PROPER-P-STATEP (LR->P (LR-DO-TEMP-FETCH L))))
((ENABLE PROPER-P-STATEP)
(DISABLE EXP PROPER-P-ALISTP PROPER-P-CTRL-STKP
PROPER-P-DATA-SEGMENTP PROPER-P-PROG-SEGMENTP
PROPER-P-TEMP-STKP)))
WARNING: Note that PROPER-P-STATEP-LR-DO-TEMP-FETCH contains the free
variable TABLE which will be chosen by instantiating the hypothesis:
(LR-PROGRAMS-PROPERP L TABLE).
This formula can be simplified, using the abbreviations PROPER-P-FRAMEP,
DEFINITION, CAR-UNTAG-LR-P-PC, ADP-NAME, ADP-OFFSET, PCPP, CDDR-NIL-LR-P-PC,
TYPE-LR-P-PC, P-OBJECTP-TYPE-OPENER, POP, AREA-NAME-LR-P-PC, TOP,
P-ACCESSORS-LR->P, PROPER-P-STATEP, AND, IMPLIES, S-TEMP-TEST, and
S-TEMP-FETCH, to:
(IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(OR (EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH))
(EQUAL (CAR (LR-EXPR L))
'(TEMP-TEST)))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(P-STATEP (LR->P L))
(EQUAL 'PC 'PC)
(EQUAL NIL NIL)
(LISTP (UNTAG (LR-P-PC L)))
(NUMBERP (CDR (UNTAG (LR-P-PC L))))
(DEFINEDP (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL (STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(LOCAL-VARS (ASSOC (AREA-NAME (P-PC L))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (LESSP (P-MAX-CTRL-STK-SIZE L)
(P-CTRL-STK-SIZE (P-CTRL-STK L))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP 0 (P-WORD-SIZE L)))
(PROPER-P-STATEP (LR->P (LR-DO-TEMP-FETCH L)))),
which simplifies, using linear arithmetic, applying LISTP-UNTAG-LR-P-PC,
NUMBERP-CDR-LR-P-PC, LR-PROGRAMS-PROPERP-DEFINEDP-CAR-UNTAG-P-PC,
DEFINEDP-COMP-PROGRAMS-DEFINEDP-ORIG, PROGRAM-BODY-ASSOC-COMP-PROGRAMS,
TEMP-VAR-DCLS-ASSOC-COMP-PROGRAMS, FORMAL-VARS-ASSOC-COMP-PROGRAMS,
LR-PROGRAMS-PROPERP-LR-PROGRAMS-PROPERP-1, COMMUTATIVITY-OF-PLUS,
PLUS-ADD1-ARG1, SUB1-ADD1, EQUAL-SUB1-0,
PROPER-P-DATA-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-PROG-SEGMENTP-LR->P-SIMILAR-STATES,
PROPER-P-TEMP-STKP-P-TEMP-STK-LR-DO-TEMP-FETCH,
PROPER-P-TEMP-STKP-LR->P-SIMILAR-STATES,
PROPER-P-CTRL-STKP-LR->P-SIMILAR-STATES, SAME-SIGNATURE-REFLEXIVE-GENERALIZED,
PROPER-P-ALISTP-LR->P-SIMILAR-STATES, AREA-NAME-LR-P-PC, P-OBJECTP-TYPE-OPENER,
CAR-UNTAG-LR-P-PC, LENGTH-COMP-BODY-LR-P-C-SIZE, P-ACCESSORS-LR-DO-TEMP-FETCH,
CDDR-NIL-LR-P-PC, TYPE-LR-P-PC, P-ACCESSORS-LR->P, LR-P-PC-LR-DO-TEMP-FETCH,
LENGTH-COMP-BODY-1-LR-P-C-SIZE, PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, LENGTH-APPEND,
and LENGTH-LABEL-INSTRS, and opening up the functions OR, EQUAL, LOCAL-VARS,
P-FRAME-SIZE, PLUS, TOP, P-CTRL-STK-SIZE, LESSP, S-TEMP-FETCH, S-TEMP-TEST,
POP, PROPER-P-FRAMEP, PCPP, ADP-OFFSET, ADP-NAME, DEFINITION, PROPER-P-STATEP,
LENGTH, NUMBERP, and ZEROP, to the following eight new goals:
Case 8. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L)))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(COMP-BODY (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 0)))
(LESSP
(SUB1 (CDR (UNTAG (LR-P-PC L))))
(LR-P-C-SIZE T
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))))).
However this again simplifies, rewriting with the lemmas
LENGTH-COMP-BODY-LR-P-C-SIZE, SUB1-ADD1, and NUMBERP-CDR-LR-P-PC, and
opening up LESSP, to:
T.
Case 7. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L)))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(COMP-BODY (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0)))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-DO-TEMP-FETCH L)))))),
which again simplifies, using linear arithmetic and rewriting with
LENGTH-LR-DO-TEMP-FETCH, to:
T.
Case 6. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 1)))
(LESSP (SUB1 (SUB1 (CDR (UNTAG (LR-P-PC L)))))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))).
But this again simplifies, rewriting with LENGTH-COMP-BODY-1-LR-P-C-SIZE,
PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, LENGTH-APPEND, LENGTH-LABEL-INSTRS,
SUB1-ADD1, NUMBERP-CDR-LR-P-PC, and EQUAL-SUB1-0, and unfolding LENGTH,
NUMBERP, ZEROP, and LESSP, to:
T.
Case 5. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L))
'(TEMP-FETCH))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0)))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-DO-TEMP-FETCH L)))))).
However this again simplifies, using linear arithmetic and rewriting with
LENGTH-LR-DO-TEMP-FETCH, to:
T.
Case 4. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L)))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(COMP-BODY (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 0)))
(LESSP
(SUB1 (CDR (UNTAG (LR-P-PC L))))
(LR-P-C-SIZE T
(PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L))))))).
This again simplifies, applying LENGTH-COMP-BODY-LR-P-C-SIZE, SUB1-ADD1, and
NUMBERP-CDR-LR-P-PC, and expanding the function LESSP, to:
T.
Case 3. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(NOT (EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L)))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(COMP-BODY (PROGRAM-BODY (ASSOC (CAR (UNTAG (P-PC L)))
(CDR (P-PROG-SEGMENT L)))))))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0)))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-DO-TEMP-FETCH L)))))).
But this again simplifies, using linear arithmetic and applying
LENGTH-LR-DO-TEMP-FETCH, to:
T.
Case 2. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 0))
(NOT (EQUAL (CDR (UNTAG (LR-P-PC L))) 1)))
(LESSP (SUB1 (SUB1 (CDR (UNTAG (LR-P-PC L)))))
(LR-P-C-SIZE T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))))).
However this again simplifies, rewriting with the lemmas
LENGTH-COMP-BODY-1-LR-P-C-SIZE, PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
LENGTH-APPEND, LENGTH-LABEL-INSTRS, SUB1-ADD1, NUMBERP-CDR-LR-P-PC, and
EQUAL-SUB1-0, and unfolding the definitions of LENGTH, NUMBERP, ZEROP, and
LESSP, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LR-PROGRAMS-PROPERP L TABLE)
(EQUAL (CAR (LR-EXPR L)) '(TEMP-TEST))
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(EQUAL (CAR (UNTAG (P-PC L)))
(NAME (CAR (P-PROG-SEGMENT L))))
(LESSP
(CDR (UNTAG (LR-P-PC L)))
(LENGTH
(LABEL-INSTRS
(APPEND (COMP-BODY-1 T
(PROGRAM-BODY (CAR (P-PROG-SEGMENT L)))
0)
'((SET-GLOBAL ANSWER) (RET)))
0)))
(LISTP (P-CTRL-STK L))
(LISTP (CAR (P-CTRL-STK L)))
(LISTP (CDAR (P-CTRL-STK L)))
(EQUAL (CDDAR (P-CTRL-STK L)) NIL)
(PROPER-P-ALISTP (BINDINGS (CAR (P-CTRL-STK L)))
(LR->P L))
(EQUAL
(STRIP-CARS (BINDINGS (CAR (P-CTRL-STK L))))
(APPEND (FORMAL-VARS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L)))
(STRIP-CARS (TEMP-VAR-DCLS (ASSOC (AREA-NAME (P-PC L))
(P-PROG-SEGMENT L))))))
(EQUAL (TYPE (RET-PC (CAR (P-CTRL-STK L))))
'PC)
(EQUAL (CDDR (RET-PC (CAR (P-CTRL-STK L))))
NIL)
(LISTP (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(NUMBERP (CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L))))))
(DEFINEDP (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L)))
(LESSP
(CDR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(LENGTH
(PROGRAM-BODY (ASSOC (CAR (UNTAG (RET-PC (CAR (P-CTRL-STK L)))))
(COMP-PROGRAMS (P-PROG-SEGMENT L))))))
(PROPER-P-CTRL-STKP (CDR (P-CTRL-STK L))
(AREA-NAME (RET-PC (CAR (P-CTRL-STK L))))
(LR->P L))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 0))
(NOT (EQUAL (P-MAX-CTRL-STK-SIZE L) 1))
(NOT (LESSP (SUB1 (SUB1 (P-MAX-CTRL-STK-SIZE L)))
(PLUS (P-CTRL-STK-SIZE (CDR (P-CTRL-STK L)))
(LENGTH (BINDINGS (CAR (P-CTRL-STK L)))))))
(PROPER-P-TEMP-STKP (P-TEMP-STK L)
(LR->P L))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))
(PROPER-P-PROG-SEGMENTP (COMP-PROGRAMS (P-PROG-SEGMENT L))
(LR->P L))
(PROPER-P-DATA-SEGMENTP (P-DATA-SEGMENT L)
(LR->P L))
(NUMBERP (P-MAX-CTRL-STK-SIZE L))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))
(NUMBERP (P-WORD-SIZE L))
(LESSP (P-MAX-CTRL-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(LESSP (P-MAX-TEMP-STK-SIZE L)
(EXP 2 (P-WORD-SIZE L)))
(NOT (EQUAL (P-WORD-SIZE L) 0)))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-DO-TEMP-FETCH L)))))),
which again simplifies, using linear arithmetic and applying
LENGTH-LR-DO-TEMP-FETCH, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
PROPER-P-STATEP-LR-DO-TEMP-FETCH
(PROVE-LEMMA LENGTH-LR-PUSH-TSTK
(REWRITE)
(IMPLIES (EQUAL (P-PSW (LR-PUSH-TSTK L OBJECT))
'RUN)
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK (LR-PUSH-TSTK L OBJECT))))))
((ENABLE LR-PUSH-TSTK)))
WARNING: Note that the proposed lemma LENGTH-LR-PUSH-TSTK is to be stored as
zero type prescription rules, zero compound recognizer rules, one linear rule,
and zero replacement rules.
This conjecture simplifies, applying P-ACCESSORS-LR-SET-TSTK, LENGTH-CONS,
SUB1-ADD1, and P-ACCESSORS-LR-SET-ERROR, and opening up the definitions of
PUSH, LR-PUSH-TSTK, EQUAL, and LESSP, to four new formulas:
Case 4. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS OBJECT (P-TEMP-STK L))))
'RUN))
(NOT (EQUAL (P-MAX-TEMP-STK-SIZE L) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS OBJECT (P-TEMP-STK L))))
'RUN))
(NUMBERP (P-MAX-TEMP-STK-SIZE L))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 2. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L))
(EQUAL (P-PSW (LR-SET-TSTK L
(CONS OBJECT (P-TEMP-STK L))))
'RUN))
(NOT (LESSP (SUB1 (P-MAX-TEMP-STK-SIZE L))
(LENGTH (P-TEMP-STK L))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (EQUAL (P-PSW L) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PSW (LR-SET-ERROR L
'LR-PUSH-TSTK-FULL-STACK))
'RUN))
(NOT (LESSP (P-MAX-TEMP-STK-SIZE L)
(LENGTH (P-TEMP-STK L))))),
which again simplifies, rewriting with P-ACCESSORS-LR-SET-ERROR, and
unfolding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-LR-PUSH-TSTK
(PROVE-LEMMA LISTP-P-TEMP-STK-LR-DO-TEMP-FETCH
(REWRITE)
(IMPLIES (EQUAL (P-PSW (LR-DO-TEMP-FETCH L))
'RUN)
(LISTP (P-TEMP-STK (LR-DO-TEMP-FETCH L))))
((ENABLE LR-DO-TEMP-FETCH LR-PUSH-TSTK)))
This simplifies, appealing to the lemmas P-ACCESSORS-LR-SET-ERROR and
P-ACCESSORS-LR-SET-TSTK, and opening up the definitions of LR-PUSH-TSTK, PUSH,
LOCAL-VAR-VALUE, TOP, DEFINITION, VALUE, LR-DO-TEMP-FETCH, and EQUAL, to two
new goals:
Case 2. (IMPLIES (AND (NOT (LR-EVAL-TEMP-SETP L))
(EQUAL (P-PSW (LR-SET-ERROR L 'TEMP-FETCH-NOT-SET))
'RUN))
(LISTP (P-TEMP-STK L))),
which again simplifies, appealing to the lemma P-ACCESSORS-LR-SET-ERROR, and
unfolding EQUAL, to:
T.
Case 1. (IMPLIES (AND (LR-EVAL-TEMP-SETP L)
(EQUAL (P-PSW L) 'RUN)
(NOT (LESSP (LENGTH (P-TEMP-STK L))
(P-MAX-TEMP-STK-SIZE L)))
(EQUAL (P-PSW (LR-SET-ERROR L
'LR-PUSH-TSTK-FULL-STACK))
'RUN))
(LISTP (P-TEMP-STK L))),
which again simplifies, rewriting with the lemmas LENGTH-NLISTP and
P-ACCESSORS-LR-SET-ERROR, and expanding the functions EQUAL and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-P-TEMP-STK-LR-DO-TEMP-FETCH
(PROVE-LEMMA PROPER-P-PROG-SEGMENTP-APPEND
(REWRITE)
(IMPLIES (PLISTP SEGMENT1)
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP SEGMENT1 P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P))))
((DISABLE PROPER-P-PROGRAMP)))
This formula simplifies, opening up AND, to the following two new formulas:
Case 2. (IMPLIES (AND (PLISTP SEGMENT1)
(NOT (PROPER-P-PROG-SEGMENTP SEGMENT1 P)))
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
F)).
This again simplifies, trivially, to the new formula:
(IMPLIES (AND (PLISTP SEGMENT1)
(NOT (PROPER-P-PROG-SEGMENTP SEGMENT1 P)))
(NOT (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P))),
which we will name *1.
Case 1. (IMPLIES (AND (PLISTP SEGMENT1)
(PROPER-P-PROG-SEGMENTP SEGMENT1 P))
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(IMPLIES (PLISTP SEGMENT1)
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP SEGMENT1 P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P)))).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are four plausible inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (AND (LISTP SEGMENT1)
(p (CDR SEGMENT1) SEGMENT2 P))
(p SEGMENT1 SEGMENT2 P))
(IMPLIES (NOT (LISTP SEGMENT1))
(p SEGMENT1 SEGMENT2 P))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT SEGMENT1) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme generates the
following three new formulas:
Case 3. (IMPLIES (AND (LISTP SEGMENT1)
(NOT (PLISTP (CDR SEGMENT1)))
(PLISTP SEGMENT1))
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP SEGMENT1 P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P)))).
This simplifies, expanding the definition of PLISTP, to:
T.
Case 2. (IMPLIES
(AND (LISTP SEGMENT1)
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND (CDR SEGMENT1) SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP (CDR SEGMENT1)
P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P)))
(PLISTP SEGMENT1))
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP SEGMENT1 P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P)))).
This simplifies, appealing to the lemmas CDR-CONS and CAR-CONS, and
expanding the definitions of AND, PLISTP, APPEND, PROPER-P-PROG-SEGMENTP,
and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP SEGMENT1))
(PLISTP SEGMENT1))
(EQUAL (PROPER-P-PROG-SEGMENTP (APPEND SEGMENT1 SEGMENT2)
P)
(AND (PROPER-P-PROG-SEGMENTP SEGMENT1 P)
(PROPER-P-PROG-SEGMENTP SEGMENT2 P)))).
This simplifies, applying PLISTP-NLISTP and APPEND-LEFT-ID, and opening up
the functions EQUAL, LISTP, PROPER-P-PROG-SEGMENTP, and AND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
PROPER-P-PROG-SEGMENTP-APPEND
(PROVE-LEMMA LR-PROGRAMS-PROPERP-EXPR-QUOTE-TYPE-ADDR NIL
(IMPLIES (AND (LR-PROGRAMS-PROPERP L TABLE)
(GOOD-POSP1 (OFFSET (P-PC L))
(PROGRAM-BODY (P-CURRENT-PROGRAM L)))
(LISTP (LR-EXPR L))
(EQUAL (CAR (LR-EXPR L)) 'QUOTE))
(EQUAL (TYPE (CADR (LR-EXPR L)))
'ADDR))
((USE (LR-PROGRAMS-PROPERP-LR-PROPER-EXPRP-LR-EXPR (L L)
(TABLE TABLE)))))
This conjecture simplifies, unfolding the definitions of AND, S-TEMP-TEST,
S-TEMP-EVAL, S-TEMP-FETCH, PLISTP, EQUAL, LR-PROPER-EXPRP, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LR-PROGRAMS-PROPERP-EXPR-QUOTE-TYPE-ADDR
(PROVE-LEMMA PROPER-P-INSTRUCTIONP-PUSH-CONSTANT-OPENER
(REWRITE)
(EQUAL (PROPER-P-INSTRUCTIONP (LIST 'PUSH-CONSTANT OBJECT)
NAME P)
(PROPER-P-PUSH-CONSTANT-INSTRUCTIONP (LIST 'PUSH-CONSTANT OBJECT)
NAME P))
((ENABLE PROPER-P-INSTRUCTIONP)))
This formula simplifies, appealing to the lemmas LENGTH-CONS, CDR-CONS,
CAR-CONS, and PLISTP-CONS, and unfolding the definitions of
PROPER-P-PUSH-CONSTANT-INSTRUCTIONP, LENGTH, ADD1, DEFINITION, EQUAL, PLISTP,
and PROPER-P-INSTRUCTIONP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-P-INSTRUCTIONP-PUSH-CONSTANT-OPENER
(PROVE-LEMMA PROPER-LABELED-P-INSTRUCTIONSP-FIND-LABELP-NON-LITATOM NIL
(IMPLIES (AND (PROPER-LABELED-P-INSTRUCTIONSP BODY NAME P)
(NOT (LITATOM LABEL)))
(EQUAL (FIND-LABELP LABEL BODY) F))
((ENABLE LEGAL-LABELP)))
Name the conjecture *1.
We will try to prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP BODY)
(p LABEL BODY NAME P))
(IMPLIES (AND (NOT (NLISTP BODY))
(p LABEL (CDR BODY) NAME P))
(p LABEL BODY NAME P))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT BODY) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates three new conjectures:
Case 3. (IMPLIES (AND (NLISTP BODY)
(PROPER-LABELED-P-INSTRUCTIONSP BODY NAME P)
(NOT (LITATOM LABEL)))
(NOT (FIND-LABELP LABEL BODY))),
which simplifies, opening up NLISTP, PROPER-LABELED-P-INSTRUCTIONSP, LISTP,
and FIND-LABELP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP BODY))
(NOT (PROPER-LABELED-P-INSTRUCTIONSP (CDR BODY)
NAME P))
(PROPER-LABELED-P-INSTRUCTIONSP BODY NAME P)
(NOT (LITATOM LABEL)))
(NOT (FIND-LABELP LABEL BODY))),
which simplifies, unfolding NLISTP, PROPER-LABELED-P-INSTRUCTIONSP,
LABELLEDP, and LEGAL-LABELP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP BODY))
(NOT (FIND-LABELP LABEL (CDR BODY)))
(PROPER-LABELED-P-INSTRUCTIONSP BODY NAME P)
(NOT (LITATOM LABEL)))
(NOT (FIND-LABELP LABEL BODY))),
which simplifies, expanding the definitions of NLISTP,
PROPER-LABELED-P-INSTRUCTIONSP, LABELLEDP, LEGAL-LABELP, and FIND-LABELP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPER-LABELED-P-INSTRUCTIONSP-FIND-LABELP-NON-LITATOM
(PROVE-LEMMA LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3 NIL
(IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL N 1))
(NOT (EQUAL N 2))
(LESSP N 4))
(EQUAL N 3)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (EQUAL N 2))
(LESSP N 4))
(EQUAL N 3)).
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3
(PROVE-LEMMA LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3-GET-CAR-POS
(REWRITE)
(IMPLIES (AND (NOT (ZEROP (CAR POS)))
(NOT (EQUAL (CAR POS) 1))
(NOT (EQUAL (CAR POS) 2))
(LESSP (CAR POS) 4))
(EQUAL (GET (CAR POS) BODY)
(CADDDR BODY)))
((USE (LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3 (N (CAR POS))))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (IMPLIES (AND (NOT (ZEROP (CAR POS)))
(NOT (EQUAL (CAR POS) 1))
(NOT (EQUAL (CAR POS) 2))
(LESSP (CAR POS) 4))
(EQUAL (CAR POS) 3))
(NOT (EQUAL (CAR POS) 0))
(NUMBERP (CAR POS))
(NOT (EQUAL (CAR POS) 1))
(NOT (EQUAL (CAR POS) 2))
(LESSP (CAR POS) 4))
(EQUAL (GET (CAR POS) BODY)
(CADDDR BODY))),
which simplifies, appealing to the lemmas GET-ZEROP and GET-ADD1-OPENER, and
unfolding ZEROP, NOT, AND, IMPLIES, EQUAL, NUMBERP, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3-GET-CAR-POS
(DISABLE LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3-GET-CAR-POS)
[ 0.0 0.0 0.0 ]
LESSP-4-NOT-ZEROP-NOT-1-NOT-2-3-GET-CAR-POS-OFF
(PROVE-LEMMA LESSP-INDEX-LESSP-LR-P-C-SIZE-LIST NIL
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(LR-P-C-SIZE-LIST N BODY)))
((DISABLE LR-P-C-SIZE)))
.
Applying the lemma CAR-CDR-ELIM, replace BODY by (CONS Z X) to eliminate
(CDR BODY) and (CAR BODY). We would thus like to prove the following two new
goals:
Case 2. (IMPLIES (NOT (LISTP BODY))
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(LR-P-C-SIZE-LIST N BODY)))).
This simplifies, applying the lemmas CDR-NLISTP, LR-P-C-SIZE-LIST-0-OPENER,
and LENGTH-NLISTP, and opening up the definitions of LENGTH, SUB1, LESSP,
EQUAL, and LR-P-C-SIZE-LIST, to:
T.
Case 1. (NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH X)
(CONS Z X))
(LR-P-C-SIZE-LIST N (CONS Z X)))),
which simplifies, using linear arithmetic and applying
LESSP-LR-P-C-SIZE-LIST-LESSP-SUB1-LENGTH, SUB1-ADD1, and LENGTH-CONS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-INDEX-LESSP-LR-P-C-SIZE-LIST
(PROVE-LEMMA LESSP-PLUS-LR-P-C-SIZE-LR-P-PC-1-HELPER
(REWRITE)
(IMPLIES (AND (LISTP BODY)
(NOT (ZEROP N))
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(EQUAL LEN (LENGTH (CDR BODY))))
(EQUAL (LESSP (PLUS (LR-P-C-SIZE-LIST LEN BODY) 1)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
X))
F))
((ENABLE LR-P-C-SIZE-LIST-0)
(USE (LESSP-INDEX-LESSP-LR-P-C-SIZE-LIST (N N)
(BODY BODY)))
(EXPAND (LR-P-C-SIZE-LIST N BODY))
(DISABLE LR-P-C-SIZE LR-P-C-SIZE-LIST LR-P-PC-1)))
This formula can be simplified, using the abbreviations ZEROP, AND, IMPLIES,
and NOT, to the new conjecture:
(IMPLIES (AND (NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(LR-P-C-SIZE-LIST N BODY)))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(EQUAL LEN (LENGTH (CDR BODY))))
(EQUAL (LESSP (PLUS (LR-P-C-SIZE-LIST LEN BODY) 1)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
X))
F)),
which simplifies, applying SUB1-ADD1, COMMUTATIVITY-OF-PLUS, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, EQUAL-PLUS-0, LR-P-C-SIZE-LIST-0, and EQUAL-SUB1-0, and
expanding the definitions of LR-P-C-SIZE-LIST, LENGTH, LESSP, NUMBERP, and
ZEROP, to the following three new conjectures:
Case 3. (IMPLIES (AND (NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(NOT (EQUAL X 0))
(NUMBERP X))
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(SUB1 (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY)))))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY))
0)
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(NOT (EQUAL X 0))
(NUMBERP X))
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(SUB1 (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY)))))).
This again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(NOT (NUMBERP X))
(NOT (EQUAL N 1))
(LISTP (CDR BODY)))
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(SUB1 (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY)))))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (EQUAL (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY))
0)
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(PLUS (LR-P-C-SIZE-LIST (SUB1 N) BODY)
(LR-P-C-SIZE T (GET N BODY)))))
(LISTP BODY)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LR-P-C-SIZE T (GET N BODY))
X))
(LESSP (SUB1 N) (LENGTH (CDR BODY)))
(NOT (NUMBERP X))
(NOT (EQUAL N 1))
(LISTP (CDR BODY)))
(NOT (LESSP (LR-P-C-SIZE-LIST (LENGTH (CDR BODY))
BODY)
(SUB1 (PLUS X
(LR-P-C-SIZE-LIST (SUB1 N) BODY)))))).
However this ag