(NOTE-LIB "naturals" T)
Loading ./numbers/naturals.lib
Finished loading ./numbers/naturals.lib
Loading ./numbers/naturals.o
Finished loading ./numbers/naturals.o
(#./numbers/naturals.lib #./numbers/naturals)
(DEFN TK-NAME (PT) (CAR PT))
[ 0.0 0.0 0.0 ]
TK-NAME
(DEFN TK-PERIOD (PT) (CADR PT))
[ 0.0 0.0 0.0 ]
TK-PERIOD
(DEFN TK-DURATION (PT) (CADDR PT))
[ 0.0 0.0 0.0 ]
TK-DURATION
(DEFN PERIODIC-TASKP
(PT)
(AND (LISTP PT)
(LITATOM (TK-NAME PT))
(NOT (EQUAL (TK-NAME PT) NIL))
(LESSP 0 (TK-PERIOD PT))
(LESSP 0 (TK-DURATION PT))
(EQUAL NIL (CDR (CDR (CDR PT))))))
Observe that:
(OR (FALSEP (PERIODIC-TASKP PT))
(TRUEP (PERIODIC-TASKP PT)))
is a theorem.
[ 0.0 0.0 0.0 ]
PERIODIC-TASKP
(DEFN PERIODIC-TASKSP
(PTS)
(IF (LISTP PTS)
(AND (PERIODIC-TASKP (CAR PTS))
(NOT (ASSOC (TK-NAME (CAR PTS)) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS)))
(EQUAL PTS NIL)))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, PERIODIC-TASKSP is accepted under the principle of
definition. Observe that:
(OR (FALSEP (PERIODIC-TASKSP PTS))
(TRUEP (PERIODIC-TASKSP PTS)))
is a theorem.
[ 0.0 0.0 0.0 ]
PERIODIC-TASKSP
(DEFN PERIODIC-TASK-REQUESTS
(PT STARTING-TIME ENDING-TIME)
(IF (PERIODIC-TASKP PT)
(IF (LESSP STARTING-TIME ENDING-TIME)
(CONS (LIST (TK-NAME PT)
STARTING-TIME
(PLUS STARTING-TIME (TK-PERIOD PT))
(TK-DURATION PT))
(PERIODIC-TASK-REQUESTS PT
(PLUS STARTING-TIME (TK-PERIOD PT))
ENDING-TIME))
NIL)
NIL)
((LESSP (DIFFERENCE ENDING-TIME STARTING-TIME))))
Linear arithmetic, the lemmas EQUAL-DIFFERENCE-0 and DIFFERENCE-LEQ-ARG1,
and the definitions of PERIODIC-TASKP, TK-NAME, UNPACK, TK-PERIOD, EQUAL,
LESSP, and TK-DURATION establish that the measure:
(DIFFERENCE ENDING-TIME STARTING-TIME)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, PERIODIC-TASK-REQUESTS is accepted under the principle of definition.
From the definition we can conclude that:
(OR (LITATOM (PERIODIC-TASK-REQUESTS PT STARTING-TIME ENDING-TIME))
(LISTP (PERIODIC-TASK-REQUESTS PT STARTING-TIME ENDING-TIME)))
is a theorem.
[ 0.0 0.0 0.0 ]
PERIODIC-TASK-REQUESTS
(DEFN PERIODIC-TASKS-REQUESTS
(PTS STARTING-TIME ENDING-TIME)
(IF (PERIODIC-TASKSP PTS)
(IF (LISTP PTS)
(APPEND (PERIODIC-TASK-REQUESTS (CAR PTS)
STARTING-TIME ENDING-TIME)
(PERIODIC-TASKS-REQUESTS (CDR PTS)
STARTING-TIME ENDING-TIME))
NIL)
NIL))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, PERIODIC-TASKS-REQUESTS is accepted under the
definitional principle. Observe that:
(OR (LITATOM (PERIODIC-TASKS-REQUESTS PTS STARTING-TIME ENDING-TIME))
(LISTP (PERIODIC-TASKS-REQUESTS PTS STARTING-TIME ENDING-TIME)))
is a theorem.
[ 0.0 0.0 0.0 ]
PERIODIC-TASKS-REQUESTS
(DEFN REPEAT
(N VAL)
(IF (ZEROP N)
NIL
(CONS VAL (REPEAT (SUB1 N) VAL))))
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, REPEAT is accepted under the
definitional principle. From the definition we can conclude that:
(OR (LITATOM (REPEAT N VAL))
(LISTP (REPEAT N VAL)))
is a theorem.
[ 0.0 0.0 0.0 ]
REPEAT
(DEFN SUBSTRING-SCHEDULE
(PTS BIGP)
(IF (LISTP PTS)
(APPEND (REPEAT (QUOTIENT (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
(CAAR PTS))
(SUBSTRING-SCHEDULE (CDR PTS) BIGP))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, SUBSTRING-SCHEDULE is accepted under the principle of
definition. From the definition we can conclude that:
(OR (LITATOM (SUBSTRING-SCHEDULE PTS BIGP))
(LISTP (SUBSTRING-SCHEDULE PTS BIGP)))
is a theorem.
[ 0.0 0.0 0.0 ]
SUBSTRING-SCHEDULE
(DEFN MAKE-LENGTH
(LENGTH LIST FILL)
(IF (ZEROP LENGTH)
NIL
(IF (LISTP LIST)
(CONS (CAR LIST)
(MAKE-LENGTH (SUB1 LENGTH)
(CDR LIST)
FILL))
(CONS FILL
(MAKE-LENGTH (SUB1 LENGTH)
NIL FILL)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
can be used to show that the measure (COUNT LENGTH) decreases according to the
well-founded relation LESSP in each recursive call. Hence, MAKE-LENGTH is
accepted under the definitional principle. From the definition we can
conclude that:
(OR (LITATOM (MAKE-LENGTH LENGTH LIST FILL))
(LISTP (MAKE-LENGTH LENGTH LIST FILL)))
is a theorem.
[ 0.0 0.0 0.0 ]
MAKE-LENGTH
(DEFN REPEAT-LIST
(LIST TIMES)
(IF (ZEROP TIMES)
NIL
(APPEND LIST
(REPEAT-LIST LIST (SUB1 TIMES)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
inform us that the measure (COUNT TIMES) decreases according to the
well-founded relation LESSP in each recursive call. Hence, REPEAT-LIST is
accepted under the definitional principle. From the definition we can
conclude that:
(OR (LITATOM (REPEAT-LIST LIST TIMES))
(LISTP (REPEAT-LIST LIST TIMES)))
is a theorem.
[ 0.0 0.0 0.0 ]
REPEAT-LIST
(DEFN MAKE-SIMPLE-SCHEDULE
(PTS BIGP LENGTH)
(REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT LENGTH BIGP)))
Note that:
(OR (LITATOM (MAKE-SIMPLE-SCHEDULE PTS BIGP LENGTH))
(LISTP (MAKE-SIMPLE-SCHEDULE PTS BIGP LENGTH)))
is a theorem.
[ 0.0 0.0 0.0 ]
MAKE-SIMPLE-SCHEDULE
(DEFN FIRSTN
(N LIST)
(IF (ZEROP N)
NIL
(CONS (CAR LIST)
(FIRSTN (SUB1 N) (CDR LIST)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each recursive call. Hence, FIRSTN is accepted under the
definitional principle. Note that:
(OR (LITATOM (FIRSTN N LIST))
(LISTP (FIRSTN N LIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
FIRSTN
(DEFN NTH
(N LIST)
(IF (ZEROP N)
(CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each recursive call. Hence, NTH is accepted under the
principle of definition.
[ 0.0 0.0 0.0 ]
NTH
(DEFN NTHCDR
(N LIST)
(IF (ZEROP N)
LIST
(NTHCDR (SUB1 N) (CDR LIST))))
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, NTHCDR is accepted under the
principle of definition.
[ 0.0 0.0 0.0 ]
NTHCDR
(DEFN LENGTH
(LIST)
(IF (LISTP LIST)
(ADD1 (LENGTH (CDR LIST)))
0))
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, LENGTH is accepted under the principle of definition.
From the definition we can conclude that (NUMBERP (LENGTH LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
LENGTH
(PROVE-LEMMA LENGTH-APPEND
(REWRITE)
(EQUAL (LENGTH (APPEND X Y))
(PLUS (LENGTH X) (LENGTH Y))))
Call the conjecture *1.
Perhaps we can prove it by induction. Three inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X) (p (CDR X) Y))
(p X Y))
(IMPLIES (NOT (LISTP X)) (p X Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to two
new goals:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (LENGTH (APPEND (CDR X) Y))
(PLUS (LENGTH (CDR X)) (LENGTH Y))))
(EQUAL (LENGTH (APPEND X Y))
(PLUS (LENGTH X) (LENGTH Y)))),
which simplifies, applying the lemmas COMMUTATIVITY-OF-PLUS, CDR-CONS, and
PLUS-ADD1-ARG1, and opening up the definitions of APPEND and LENGTH, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (LENGTH (APPEND X Y))
(PLUS (LENGTH X) (LENGTH Y)))),
which simplifies, unfolding the functions APPEND, LENGTH, EQUAL, and PLUS,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-APPEND
(PROVE-LEMMA LENGTH-FIRSTN
(REWRITE)
(EQUAL (LENGTH (FIRSTN N LIST))
(FIX N)))
This simplifies, unfolding FIX, to two new formulas:
Case 2. (IMPLIES (NOT (NUMBERP N))
(EQUAL (LENGTH (FIRSTN N LIST)) 0)),
which again simplifies, unfolding FIRSTN, LENGTH, and EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP N)
(EQUAL (LENGTH (FIRSTN N LIST)) N)),
which we will name *1.
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 LIST))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) (CDR LIST)))
(p N LIST))).
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 induction step of the scheme. Note, however, the inductive
instance chosen for LIST. The above induction scheme generates the following
two new goals:
Case 2. (IMPLIES (AND (ZEROP N) (NUMBERP N))
(EQUAL (LENGTH (FIRSTN N LIST)) N)).
This simplifies, opening up the definitions of ZEROP, NUMBERP, EQUAL, FIRSTN,
and LENGTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (LENGTH (FIRSTN (SUB1 N) (CDR LIST)))
(SUB1 N))
(NUMBERP N))
(EQUAL (LENGTH (FIRSTN N LIST)) N)).
This simplifies, applying ADD1-SUB1 and CDR-CONS, and expanding ZEROP,
FIRSTN, and LENGTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-FIRSTN
(PROVE-LEMMA LENGTH-NTHCDR
(REWRITE)
(EQUAL (LENGTH (NTHCDR N LIST))
(DIFFERENCE (LENGTH LIST) N)))
Name the conjecture *1.
We will appeal to 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 (ZEROP N) (p N LIST))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) (CDR LIST)))
(p N LIST))).
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 induction step of the scheme. Note, however, the inductive
instance chosen for LIST. The above induction scheme produces the following
two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (LENGTH (NTHCDR N LIST))
(DIFFERENCE (LENGTH LIST) N))).
This simplifies, expanding the definitions of ZEROP, EQUAL, NTHCDR, LENGTH,
and DIFFERENCE, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))))
(EQUAL (LENGTH (NTHCDR N LIST))
(DIFFERENCE (LENGTH LIST) N))).
This simplifies, expanding the definitions of ZEROP, NTHCDR, and LENGTH, to
the following two new goals:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(NOT (LISTP LIST)))
(EQUAL (DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))
(DIFFERENCE 0 N))).
But this again simplifies, using linear arithmetic and appealing to the
lemmas DIFFERENCE-LEQ-ARG1 and EQUAL-DIFFERENCE-0, to the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(NOT (LISTP LIST)))
(NOT (LESSP (SUB1 N)
(LENGTH (CDR LIST))))).
However this further simplifies, rewriting with CDR-NLISTP and
DIFFERENCE-SUB1-ARG2, and opening up LENGTH, EQUAL, and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(LISTP LIST))
(EQUAL (DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))
(DIFFERENCE (ADD1 (LENGTH (CDR LIST)))
N))).
However this again simplifies, using linear arithmetic, to two new
formulas:
Case 1.1.2.
(IMPLIES (AND (LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(LISTP LIST))
(EQUAL (DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))
(DIFFERENCE (ADD1 (LENGTH (CDR LIST)))
N))),
which again simplifies, using linear arithmetic and applying
DIFFERENCE-LEQ-ARG1 and EQUAL-DIFFERENCE-0, to the new goal:
(IMPLIES (AND (LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(LISTP LIST))
(NOT (LESSP (SUB1 N)
(LENGTH (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES (AND (LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(LISTP LIST))
(EQUAL (DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))
(DIFFERENCE (ADD1 (LENGTH (CDR LIST)))
N))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (LENGTH (CDR LIST)) (SUB1 N))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (LENGTH (NTHCDR (SUB1 N) (CDR LIST)))
(DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N)))
(LISTP LIST))
(EQUAL (DIFFERENCE (LENGTH (CDR LIST))
(SUB1 N))
(DIFFERENCE (ADD1 (LENGTH (CDR LIST)))
N))).
However this again simplifies, appealing to the lemma SUB1-ADD1, and
opening up LESSP and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LENGTH-NTHCDR
(PROVE-LEMMA EQUAL-LENGTH-0
(REWRITE)
(EQUAL (EQUAL (LENGTH X) 0)
(NOT (LISTP X))))
This formula simplifies, expanding the function NOT, to two new conjectures:
Case 2. (IMPLIES (NOT (EQUAL (LENGTH X) 0))
(LISTP X)),
which again simplifies, opening up the functions LENGTH and EQUAL, to:
T.
Case 1. (IMPLIES (EQUAL (LENGTH X) 0)
(NOT (LISTP X))),
which we will name *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X) (p (CDR X)))
(p X))
(IMPLIES (NOT (LISTP X)) (p X))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces the following two new
formulas:
Case 2. (IMPLIES (AND (NOT (EQUAL (LENGTH (CDR X)) 0))
(EQUAL (LENGTH X) 0))
(NOT (LISTP X))).
This simplifies, expanding LENGTH, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP (CDR X)))
(EQUAL (LENGTH X) 0))
(NOT (LISTP X))).
This simplifies, unfolding LENGTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-LENGTH-0
(DEFN EXPANDED-TASKSP
(TS P)
(IF (LISTP TS)
(AND (ZEROP (REMAINDER (CADAR TS) P))
(ZEROP (REMAINDER (CADDAR TS) P))
(ZEROP (REMAINDER (TIMES P (CADDAR TS))
(CADAR TS)))
(EXPANDED-TASKSP (CDR TS) P))
T))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT TS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, EXPANDED-TASKSP is accepted under the definitional
principle. Observe that:
(OR (FALSEP (EXPANDED-TASKSP TS P))
(TRUEP (EXPANDED-TASKSP TS P)))
is a theorem.
[ 0.0 0.0 0.0 ]
EXPANDED-TASKSP
(DEFN PLIST
(LIST)
(IF (LISTP LIST)
(CONS (CAR LIST) (PLIST (CDR LIST)))
NIL))
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, PLIST is accepted under the definitional principle.
From the definition we can conclude that:
(OR (LITATOM (PLIST LIST))
(LISTP (PLIST LIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
PLIST
(DEFN NAME (R) (CAR R))
[ 0.0 0.0 0.0 ]
NAME
(DEFN REQUEST-TIME (R) (CADR R))
[ 0.0 0.0 0.0 ]
REQUEST-TIME
(DEFN DEADLINE (R) (CADDR R))
[ 0.0 0.0 0.0 ]
DEADLINE
(DEFN DURATION (R) (CADDDR R))
[ 0.0 0.0 0.0 ]
DURATION
(DEFTHEORY TASK-ABBR
(NAME REQUEST-TIME DEADLINE DURATION TK-NAME TK-DURATION TK-PERIOD))
[ 0.0 0.0 0.0 ]
TASK-ABBR
(DEFN GOOD-SCHEDULE
(S R)
(IF (LISTP R)
(AND (EQUAL (OCCURRENCES (NAME (CAR R))
(FIRSTN (DIFFERENCE (DEADLINE (CAR R))
(REQUEST-TIME (CAR R)))
(NTHCDR (REQUEST-TIME (CAR R)) S)))
(DURATION (CAR R)))
(GOOD-SCHEDULE S (CDR R)))
T))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT R) decreases according to the well-founded relation LESSP in each
recursive call. Hence, GOOD-SCHEDULE is accepted under the principle of
definition. Note that:
(OR (FALSEP (GOOD-SCHEDULE S R))
(TRUEP (GOOD-SCHEDULE S R)))
is a theorem.
[ 0.0 0.0 0.0 ]
GOOD-SCHEDULE
(DEFN BIG-PERIOD
(PTS)
(IF (LISTP PTS)
(TIMES (TK-PERIOD (CAR PTS))
(BIG-PERIOD (CDR PTS)))
1))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, BIG-PERIOD is accepted under the definitional
principle. Observe that (NUMBERP (BIG-PERIOD PTS)) is a theorem.
[ 0.0 0.0 0.0 ]
BIG-PERIOD
(DEFN ACTIVE-TASK-REQUESTS
(TIME R)
(IF (LISTP R)
(IF (AND (LESSP TIME (DEADLINE (CAR R)))
(NOT (LESSP TIME (REQUEST-TIME (CAR R)))))
(CONS (CAR R)
(ACTIVE-TASK-REQUESTS TIME (CDR R)))
(ACTIVE-TASK-REQUESTS TIME (CDR R)))
NIL))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT R) decreases according to the well-founded relation LESSP in each
recursive call. Hence, ACTIVE-TASK-REQUESTS is accepted under the
definitional principle. From the definition we can conclude that:
(OR (LITATOM (ACTIVE-TASK-REQUESTS TIME R))
(LISTP (ACTIVE-TASK-REQUESTS TIME R)))
is a theorem.
[ 0.0 0.0 0.0 ]
ACTIVE-TASK-REQUESTS
(DEFN UNFULFILLED
(TIME S R)
(IF (LISTP R)
(IF (EQUAL (OCCURRENCES (NAME (CAR R))
(FIRSTN (DIFFERENCE TIME
(REQUEST-TIME (CAR R)))
(NTHCDR (REQUEST-TIME (CAR R)) S)))
(DURATION (CAR R)))
(UNFULFILLED TIME S (CDR R))
(CONS (CAR R)
(UNFULFILLED TIME S (CDR R))))
NIL))
Linear arithmetic and the lemma CDR-LESSP can be used to establish that
the measure (COUNT R) decreases according to the well-founded relation LESSP
in each recursive call. Hence, UNFULFILLED is accepted under the definitional
principle. Observe that:
(OR (LITATOM (UNFULFILLED TIME S R))
(LISTP (UNFULFILLED TIME S R)))
is a theorem.
[ 0.0 0.0 0.0 ]
UNFULFILLED
(DEFN LEAST-DEADLINE
(R)
(IF (LISTP R)
(IF (LISTP (CDR R))
(IF (LESSP (DEADLINE (CAR R))
(DEADLINE (CAR (CDR R))))
(LEAST-DEADLINE (CONS (CAR R) (CDR (CDR R))))
(LEAST-DEADLINE (CDR R)))
(CAR R))
NIL)
((LESSP (LENGTH R))))
Linear arithmetic, the lemmas EQUAL-LENGTH-0, SUB1-ADD1, and CDR-CONS,
and the definitions of LESSP, LENGTH, and DEADLINE establish that the measure
(LENGTH R) decreases according to the well-founded relation LESSP in each
recursive call. Hence, LEAST-DEADLINE is accepted under the definitional
principle.
[ 0.0 0.0 0.0 ]
LEAST-DEADLINE
(DEFN FIRST-INSTANCE
(TIME TASK S)
(IF (LESSP TIME (LENGTH S))
(IF (EQUAL (NTH TIME S) TASK)
TIME
(FIRST-INSTANCE (ADD1 TIME) TASK S))
F)
((LESSP (DIFFERENCE (LENGTH S) TIME))))
Linear arithmetic can be used to prove that the measure:
(DIFFERENCE (LENGTH S) TIME)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, FIRST-INSTANCE is accepted under the principle of definition. Observe
that:
(OR (OR (FALSEP (FIRST-INSTANCE TIME TASK S))
(NUMBERP (FIRST-INSTANCE TIME TASK S)))
(EQUAL (FIRST-INSTANCE TIME TASK S)
TIME))
is a theorem.
[ 0.0 0.0 0.0 ]
FIRST-INSTANCE
(DEFN REPLACE-NTH
(N VAL LIST)
(IF (ZEROP N)
(CONS VAL (CDR LIST))
(CONS (CAR LIST)
(REPLACE-NTH (SUB1 N)
VAL
(CDR LIST)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
can be used to show that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each recursive call. Hence, REPLACE-NTH is
accepted under the definitional principle. Observe that:
(LISTP (REPLACE-NTH N VAL LIST))
is a theorem.
[ 0.0 0.0 0.0 ]
REPLACE-NTH
(DEFN SWAP
(I J LIST)
(REPLACE-NTH I
(NTH J LIST)
(REPLACE-NTH J (NTH I LIST) LIST)))
Observe that (LISTP (SWAP I J LIST)) is a theorem.
[ 0.0 0.0 0.0 ]
SWAP
(PROVE-LEMMA LENGTH-REPLACE-NTH
(REWRITE)
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(IF (LESSP I (LENGTH LIST))
(LENGTH LIST)
(ADD1 I))))
This conjecture simplifies, obviously, to the following two new conjectures:
Case 2. (IMPLIES (NOT (LESSP I (LENGTH LIST)))
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(ADD1 I))).
Give the above formula the name *1.
Case 1. (IMPLIES (LESSP I (LENGTH LIST))
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(LENGTH 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:
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(IF (LESSP I (LENGTH LIST))
(LENGTH LIST)
(ADD1 I))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest four inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP I) (p I VAL LIST))
(IMPLIES (AND (NOT (ZEROP I))
(p (SUB1 I) VAL (CDR LIST)))
(p I VAL LIST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT I) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for LIST. The above induction scheme leads to the following
two new conjectures:
Case 2. (IMPLIES (ZEROP I)
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(IF (LESSP I (LENGTH LIST))
(LENGTH LIST)
(ADD1 I)))).
This simplifies, applying CDR-CONS and SUB1-TYPE-RESTRICTION, and expanding
the functions ZEROP, EQUAL, REPLACE-NTH, LENGTH, LESSP, and ADD1, to four
new formulas:
Case 2.4.
(IMPLIES (AND (EQUAL I 0)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 1)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (EQUAL I 0) (NOT (LISTP LIST)))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 1)),
which again simplifies, rewriting with EQUAL-LENGTH-0 and ADD1-EQUAL, and
expanding the function NUMBERP, to:
(IMPLIES (NOT (LISTP LIST))
(NOT (LISTP (CDR LIST)))),
which again simplifies, applying CDR-NLISTP, and opening up the definition
of LISTP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 1)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (LISTP LIST)))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 1)),
which again simplifies, applying the lemmas EQUAL-LENGTH-0 and ADD1-EQUAL,
and unfolding NUMBERP, to:
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (LISTP LIST)))
(NOT (LISTP (CDR LIST)))).
However this again simplifies, rewriting with CDR-NLISTP, and expanding
LISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
(IF (LESSP (SUB1 I) (LENGTH (CDR LIST)))
(LENGTH (CDR LIST))
(ADD1 (SUB1 I)))))
(EQUAL (LENGTH (REPLACE-NTH I VAL LIST))
(IF (LESSP I (LENGTH LIST))
(LENGTH LIST)
(ADD1 I)))).
This simplifies, applying ADD1-SUB1 and CDR-CONS, and opening up the
definitions of ZEROP, REPLACE-NTH, and LENGTH, to five new formulas:
Case 1.5.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (LESSP (SUB1 I) (LENGTH (CDR LIST))))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
I)
(LISTP LIST)
(LESSP I (ADD1 (LENGTH (CDR LIST)))))
(EQUAL (ADD1 I)
(ADD1 (LENGTH (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (LESSP (SUB1 I) (LENGTH (CDR LIST))))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
I)
(NOT (LISTP LIST))
(LESSP I 0))
(EQUAL (ADD1 I) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(LESSP (SUB1 I) (LENGTH (CDR LIST)))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
(LENGTH (CDR LIST)))
(LISTP LIST)
(NOT (LESSP I (ADD1 (LENGTH (CDR LIST))))))
(EQUAL (ADD1 (LENGTH (CDR LIST)))
(ADD1 I))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(LESSP (SUB1 I) (LENGTH (CDR LIST)))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
(LENGTH (CDR LIST)))
(NOT (LISTP LIST))
(NOT (LESSP I 0)))
(EQUAL (ADD1 (LENGTH (CDR LIST)))
(ADD1 I))),
which again simplifies, applying ADD1-EQUAL, and expanding EQUAL and LESSP,
to:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(LESSP (SUB1 I) (LENGTH (CDR LIST)))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
(LENGTH (CDR LIST)))
(NOT (LISTP LIST)))
(EQUAL (LENGTH (CDR LIST)) I)),
which further simplifies, rewriting with CDR-NLISTP, and opening up the
functions LENGTH, EQUAL, and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(LESSP (SUB1 I) (LENGTH (CDR LIST)))
(EQUAL (LENGTH (REPLACE-NTH (SUB1 I) VAL (CDR LIST)))
(LENGTH (CDR LIST)))
(NOT (LISTP LIST))
(LESSP I 0))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-REPLACE-NTH
(PROVE-LEMMA LENGTH-SWAP
(REWRITE)
(EQUAL (LENGTH (SWAP I J LIST))
(IF (LESSP I (LENGTH LIST))
(IF (LESSP J (LENGTH LIST))
(LENGTH LIST)
(ADD1 J))
(IF (LESSP I J) (ADD1 J) (ADD1 I)))))
This formula simplifies, rewriting with LENGTH-REPLACE-NTH, and expanding the
definition of SWAP, to the following four new conjectures:
Case 4. (IMPLIES (AND (LESSP I (LENGTH LIST))
(NOT (LESSP J (LENGTH LIST)))
(NOT (LESSP I (ADD1 J))))
(EQUAL (ADD1 I) (ADD1 J))).
This again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP I J)
(NOT (LESSP J (LENGTH LIST)))
(NOT (LESSP I (ADD1 J))))
(EQUAL (ADD1 I) (ADD1 J))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (LESSP I (LENGTH LIST)))
(LESSP I J)
(LESSP J (LENGTH LIST)))
(EQUAL (ADD1 I) (ADD1 J))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I (LENGTH LIST)))
(NOT (LESSP I J))
(NOT (LESSP J (LENGTH LIST)))
(LESSP I (ADD1 J)))
(EQUAL (ADD1 J) (ADD1 I))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-SWAP
(DEFN MAKE-ELEMENT-EDF
(S R TIME)
(LET ((UNFULFILLED (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
(LET ((FIRST (FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE UNFULFILLED))
S)))
(IF (AND (LISTP UNFULFILLED) FIRST)
(SWAP TIME FIRST S)
S))))
Observe that:
(OR (LISTP (MAKE-ELEMENT-EDF S R TIME))
(EQUAL (MAKE-ELEMENT-EDF S R TIME) S))
is a theorem.
[ 0.0 0.0 0.0 ]
MAKE-ELEMENT-EDF
(PROVE-LEMMA LESSP-FIRST-INSTANCE
(REWRITE)
(IMPLIES (LISTP S)
(LESSP (FIRST-INSTANCE TIME TASK S)
(LENGTH S))))
WARNING: Note that the proposed lemma LESSP-FIRST-INSTANCE 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 try to 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 (LESSP TIME (LENGTH S))
(EQUAL (NTH TIME S) TASK))
(p TIME TASK S))
(IMPLIES (AND (LESSP TIME (LENGTH S))
(NOT (EQUAL (NTH TIME S) TASK))
(p (ADD1 TIME) TASK S))
(p TIME TASK S))
(IMPLIES (NOT (LESSP TIME (LENGTH S)))
(p TIME TASK S))).
Linear arithmetic establishes that the measure (DIFFERENCE (LENGTH S) TIME)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates three new goals:
Case 3. (IMPLIES (AND (LESSP TIME (LENGTH S))
(EQUAL (NTH TIME S) TASK)
(LISTP S))
(LESSP (FIRST-INSTANCE TIME TASK S)
(LENGTH S))),
which simplifies, expanding FIRST-INSTANCE, to:
T.
Case 2. (IMPLIES (AND (LESSP TIME (LENGTH S))
(NOT (EQUAL (NTH TIME S) TASK))
(LESSP (FIRST-INSTANCE (ADD1 TIME) TASK S)
(LENGTH S))
(LISTP S))
(LESSP (FIRST-INSTANCE TIME TASK S)
(LENGTH S))),
which simplifies, opening up the function FIRST-INSTANCE, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP TIME (LENGTH S)))
(LISTP S))
(LESSP (FIRST-INSTANCE TIME TASK S)
(LENGTH S))),
which simplifies, applying the lemma EQUAL-LENGTH-0, and unfolding the
definitions of FIRST-INSTANCE, NUMBERP, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-FIRST-INSTANCE
(PROVE-LEMMA LENGTH-MAKE-ELEMENT-EDF
(REWRITE)
(IMPLIES (LESSP TIME (LENGTH S))
(EQUAL (LENGTH (MAKE-ELEMENT-EDF S R TIME))
(LENGTH S))))
This conjecture simplifies, expanding the definitions of SWAP and
MAKE-ELEMENT-EDF, to the new conjecture:
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(EQUAL
(LENGTH
(REPLACE-NTH TIME
(NTH
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
S)
(REPLACE-NTH
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NTH TIME S)
S)))
(LENGTH S))),
which again simplifies, applying LENGTH-REPLACE-NTH, to the following two new
formulas:
Case 2. (IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NOT
(LESSP TIME
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))))
(EQUAL (ADD1 TIME) (LENGTH S))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(LESSP TIME
(ADD1
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))),
which again simplifies, applying the lemmas SUB1-ADD1 and
SUB1-TYPE-RESTRICTION, and unfolding LESSP, to four new conjectures:
Case 1.4.
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(EQUAL TIME 0))
(EQUAL
(ADD1
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S))
(LENGTH S))),
which again simplifies, applying EQUAL-LENGTH-0, and unfolding EQUAL and
LESSP, to:
(IMPLIES
(AND
(LISTP S)
(LISTP (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R)))
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S)
(LENGTH S))))
(EQUAL
(ADD1
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S))
(LENGTH S))),
which again simplifies, using linear arithmetic and rewriting with the
lemma LESSP-FIRST-INSTANCE, to:
T.
Case 1.3.
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NOT (NUMBERP TIME)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))),
which again simplifies, rewriting with the lemma EQUAL-LENGTH-0, and
unfolding the definition of LESSP, to the conjecture:
(IMPLIES
(AND
(LISTP S)
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NOT (NUMBERP TIME)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))).
This again simplifies, using linear arithmetic and rewriting with
LESSP-FIRST-INSTANCE, to:
T.
Case 1.2.
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NOT
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))
(LESSP (SUB1 TIME) 0))
(EQUAL 1 (LENGTH S))).
But this again simplifies, applying EQUAL-LENGTH-0, and opening up LESSP,
EQUAL, LENGTH, FIRST-INSTANCE, and NUMBERP, to:
T.
Case 1.1.
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(FIRST-INSTANCE TIME
(CAR (LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LESSP
(SUB1 TIME)
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))).
This again simplifies, clearly, to:
(IMPLIES
(AND
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LESSP
(SUB1 TIME)
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))).
Applying the lemma SUB1-ELIM, replace TIME by (ADD1 X) to eliminate
(SUB1 TIME). We use the type restriction lemma noted when SUB1 was
introduced to restrict the new variable. We thus obtain the following
three new conjectures:
Case 1.1.3.
(IMPLIES
(AND
(EQUAL TIME 0)
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LESSP
(SUB1 TIME)
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))).
However this further simplifies, rewriting with EQUAL-LENGTH-0, and
unfolding the definitions of EQUAL, LESSP, and SUB1, to:
(IMPLIES
(AND
(LISTP S)
(LISTP (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R)))
(NOT
(LESSP
(FIRST-INSTANCE 0
(CAR
(LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S))
(NOT
(EQUAL
(FIRST-INSTANCE 0
(CAR
(LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S)
0)))
(EQUAL
(ADD1
(FIRST-INSTANCE 0
(CAR (LEAST-DEADLINE (UNFULFILLED 0 S
(ACTIVE-TASK-REQUESTS 0 R))))
S))
(LENGTH S))),
which finally simplifies, using linear arithmetic and applying
LESSP-FIRST-INSTANCE, to:
T.
Case 1.1.2.
(IMPLIES
(AND
(NOT (NUMBERP TIME))
(LESSP TIME (LENGTH S))
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LESSP
(SUB1 TIME)
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))).
But this further simplifies, rewriting with EQUAL-LENGTH-0 and
SUB1-NNUMBERP, and opening up the functions LESSP and EQUAL, to:
(IMPLIES
(AND
(NOT (NUMBERP TIME))
(LISTP S)
(LISTP (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R)))
(NOT
(LESSP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(NOT
(EQUAL
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S)
0)))
(EQUAL
(ADD1
(FIRST-INSTANCE TIME
(CAR
(LEAST-DEADLINE (UNFULFILLED TIME S
(ACTIVE-TASK-REQUESTS TIME R))))
S))
(LENGTH S))),
which finally simplifies, using linear arithmetic and rewriting with
LESSP-FIRST-INSTANCE, to:
T.
Case 1.1.1.
(IMPLIES
(AND
(NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(LESSP (ADD1 X) (LENGTH S))
(LISTP (UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R)))
(NOT
(LESSP
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S))
(LESSP X
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S))
(LENGTH S))).
This further simplifies, applying SUB1-ADD1 and EQUAL-LENGTH-0, and
expanding the definition of LESSP, to the new formula:
(IMPLIES
(AND
(NUMBERP X)
(LISTP S)
(LESSP X (SUB1 (LENGTH S)))
(LISTP (UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R)))
(NOT
(LESSP
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S)
(LENGTH S)))
(NUMBERP
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S))
(LESSP X
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S)))
(EQUAL
(ADD1
(FIRST-INSTANCE
(ADD1 X)
(CAR
(LEAST-DEADLINE
(UNFULFILLED (ADD1 X)
S
(ACTIVE-TASK-REQUESTS (ADD1 X) R))))
S))
(LENGTH S))),
which finally simplifies, using linear arithmetic and rewriting with
LESSP-FIRST-INSTANCE, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
LENGTH-MAKE-ELEMENT-EDF
(DISABLE MAKE-ELEMENT-EDF)
[ 0.0 0.0 0.0 ]
MAKE-ELEMENT-EDF-OFF
(DEFN MAKE-SCHEDULE-EDF
(S R FIRST)
(IF (LESSP FIRST (LENGTH S))
(MAKE-SCHEDULE-EDF (MAKE-ELEMENT-EDF S R FIRST)
R
(ADD1 FIRST))
S)
((LESSP (DIFFERENCE (LENGTH S) FIRST))))
Linear arithmetic and the lemmas DIFFERENCE-ADD1-ARG2 and
LENGTH-MAKE-ELEMENT-EDF can be used to establish that the measure:
(DIFFERENCE (LENGTH S) FIRST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, MAKE-SCHEDULE-EDF is accepted under the principle of definition. Note
that:
(OR (LISTP (MAKE-SCHEDULE-EDF S R FIRST))
(EQUAL (MAKE-SCHEDULE-EDF S R FIRST)
S))
is a theorem.
[ 0.0 0.0 0.0 ]
MAKE-SCHEDULE-EDF
(ENABLE MAKE-ELEMENT-EDF)
[ 0.0 0.0 0.0 ]
MAKE-ELEMENT-EDF-ON
(PROVE-LEMMA PLIST-REPEAT-LIST
(REWRITE)
(EQUAL (PLIST (REPEAT-LIST S N))
(REPEAT-LIST S N)))
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 (ZEROP N) (p S N))
(IMPLIES (AND (NOT (ZEROP N)) (p S (SUB1 N)))
(p S N))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) 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 (ZEROP N)
(EQUAL (PLIST (REPEAT-LIST S N))
(REPEAT-LIST S N))).
This simplifies, expanding ZEROP, EQUAL, REPEAT-LIST, and PLIST, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (PLIST (REPEAT-LIST S (SUB1 N)))
(REPEAT-LIST S (SUB1 N))))
(EQUAL (PLIST (REPEAT-LIST S N))
(REPEAT-LIST S N))).
This simplifies, unfolding ZEROP and REPEAT-LIST, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (PLIST (REPEAT-LIST S (SUB1 N)))
(REPEAT-LIST S (SUB1 N))))
(EQUAL (PLIST (APPEND S (REPEAT-LIST S (SUB1 N))))
(APPEND S (REPEAT-LIST S (SUB1 N))))).
Applying the lemma SUB1-ELIM, replace N by (ADD1 X) to eliminate (SUB1 N).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We would thus like to prove:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (PLIST (REPEAT-LIST S X))
(REPEAT-LIST S X)))
(EQUAL (PLIST (APPEND S (REPEAT-LIST S X)))
(APPEND S (REPEAT-LIST S X)))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP X)
(EQUAL (PLIST (REPEAT-LIST S X))
(REPEAT-LIST S X)))
(EQUAL (PLIST (APPEND S (REPEAT-LIST S X)))
(APPEND S (REPEAT-LIST S X)))).
We use the above equality hypothesis by cross-fertilizing:
(PLIST (REPEAT-LIST S X))
for (REPEAT-LIST S X) and throwing away the equality. We must thus prove
the formula:
(IMPLIES (NUMBERP X)
(EQUAL (PLIST (APPEND S (REPEAT-LIST S X)))
(APPEND S
(PLIST (REPEAT-LIST S X))))).
We will try to prove the above formula by generalizing it, replacing
(REPEAT-LIST S X) by Y. This generates:
(IMPLIES (NUMBERP X)
(EQUAL (PLIST (APPEND S Y))
(APPEND S (PLIST Y)))).
Eliminate the irrelevant term. This produces:
(EQUAL (PLIST (APPEND S Y))
(APPEND S (PLIST Y))),
which we will finally name *1.1.
We will appeal to induction. Three inductions are suggested by terms in
the conjecture. They merge into two likely candidate inductions. However,
only one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP S) (p (CDR S) Y))
(p S Y))
(IMPLIES (NOT (LISTP S)) (p S Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT S) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme generates two new
formulas:
Case 2. (IMPLIES (AND (LISTP S)
(EQUAL (PLIST (APPEND (CDR S) Y))
(APPEND (CDR S) (PLIST Y))))
(EQUAL (PLIST (APPEND S Y))
(APPEND S (PLIST Y)))),
which simplifies, applying CDR-CONS and CAR-CONS, and expanding the
definitions of APPEND and PLIST, to:
T.
Case 1. (IMPLIES (NOT (LISTP S))
(EQUAL (PLIST (APPEND S Y))
(APPEND S (PLIST Y)))).
This simplifies, opening up the function APPEND, to:
T.
That finishes the proof of *1.1, which, consequently, also finishes the
proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PLIST-REPEAT-LIST
(PROVE-LEMMA LENGTH-REPEAT-LIST
(REWRITE)
(EQUAL (LENGTH (REPEAT-LIST S N))
(TIMES N (LENGTH S))))
Name the conjecture *1.
We will appeal to 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 (ZEROP N) (p S N))
(IMPLIES (AND (NOT (ZEROP N)) (p S (SUB1 N)))
(p S 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 induction step of the scheme. The above induction scheme
produces the following two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (LENGTH (REPEAT-LIST S N))
(TIMES N (LENGTH S)))).
This simplifies, expanding the definitions of ZEROP, EQUAL, REPEAT-LIST,
LENGTH, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (LENGTH (REPEAT-LIST S (SUB1 N)))
(TIMES (SUB1 N) (LENGTH S))))
(EQUAL (LENGTH (REPEAT-LIST S N))
(TIMES N (LENGTH S)))).
This simplifies, applying LENGTH-APPEND, and expanding the definitions of
ZEROP, REPEAT-LIST, and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-REPEAT-LIST
(PROVE-LEMMA APPEND-NIL
(REWRITE)
(EQUAL (APPEND LIST NIL)
(PLIST LIST)))
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 LIST) (p (CDR LIST)))
(p LIST))
(IMPLIES (NOT (LISTP LIST))
(p LIST))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish that the
measure (COUNT LIST) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme generates the
following two new formulas:
Case 2. (IMPLIES (AND (LISTP LIST)
(EQUAL (APPEND (CDR LIST) NIL)
(PLIST (CDR LIST))))
(EQUAL (APPEND LIST NIL)
(PLIST LIST))).
This simplifies, expanding the definitions of APPEND and PLIST, to:
T.
Case 1. (IMPLIES (NOT (LISTP LIST))
(EQUAL (APPEND LIST NIL)
(PLIST LIST))).
This simplifies, opening up the functions APPEND, PLIST, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
APPEND-NIL
(PROVE-LEMMA GOOD-SCHEDULE-APPEND
(REWRITE)
(EQUAL (GOOD-SCHEDULE S (APPEND R1 R2))
(AND (GOOD-SCHEDULE S R1)
(GOOD-SCHEDULE S R2))))
This simplifies, opening up the function AND, to two new conjectures:
Case 2. (IMPLIES (NOT (GOOD-SCHEDULE S R1))
(EQUAL (GOOD-SCHEDULE S (APPEND R1 R2))
F)),
which again simplifies, clearly, to:
(IMPLIES (NOT (GOOD-SCHEDULE S R1))
(NOT (GOOD-SCHEDULE S (APPEND R1 R2)))),
which we will name *1.
Case 1. (IMPLIES (GOOD-SCHEDULE S R1)
(EQUAL (GOOD-SCHEDULE S (APPEND R1 R2))
(GOOD-SCHEDULE S R2))),
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 (GOOD-SCHEDULE S (APPEND R1 R2))
(AND (GOOD-SCHEDULE S R1)
(GOOD-SCHEDULE S R2))),
which we named *1 above. We will appeal to 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 R1) (p S (CDR R1) R2))
(p S R1 R2))
(IMPLIES (NOT (LISTP R1))
(p S R1 R2))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT R1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme produces two new
conjectures:
Case 2. (IMPLIES (AND (LISTP R1)
(EQUAL (GOOD-SCHEDULE S (APPEND (CDR R1) R2))
(AND (GOOD-SCHEDULE S (CDR R1))
(GOOD-SCHEDULE S R2))))
(EQUAL (GOOD-SCHEDULE S (APPEND R1 R2))
(AND (GOOD-SCHEDULE S R1)
(GOOD-SCHEDULE S R2)))),
which simplifies, applying the lemmas CDR-CONS and CAR-CONS, and expanding
AND, APPEND, DURATION, REQUEST-TIME, DEADLINE, NAME, GOOD-SCHEDULE, and
EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP R1))
(EQUAL (GOOD-SCHEDULE S (APPEND R1 R2))
(AND (GOOD-SCHEDULE S R1)
(GOOD-SCHEDULE S R2)))),
which simplifies, opening up the definitions of APPEND, GOOD-SCHEDULE, and
AND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
GOOD-SCHEDULE-APPEND
(DEFN SUBLISTP
(A B)
(IF (LISTP B)
(IF (LISTP A)
(IF (EQUAL (CAR A) (CAR B))
(SUBLISTP (CDR A) (CDR B))
(SUBLISTP A (CDR B)))
T)
(NLISTP A)))
Linear arithmetic and the lemma CDR-LESSP can be used to show that the
measure (COUNT B) decreases according to the well-founded relation LESSP in
each recursive call. Hence, SUBLISTP is accepted under the definitional
principle. From the definition we can conclude that:
(OR (FALSEP (SUBLISTP A B))
(TRUEP (SUBLISTP A B)))
is a theorem.
[ 0.0 0.0 0.0 ]
SUBLISTP
(DEFN REMOVE-UNTIL
(V L)
(IF (LISTP L)
(IF (EQUAL V (CAR L))
(CDR L)
(REMOVE-UNTIL V (CDR L)))
L))
Linear arithmetic and the lemma CDR-LESSP can be used to establish that
the measure (COUNT L) decreases according to the well-founded relation LESSP
in each recursive call. Hence, REMOVE-UNTIL is accepted under the principle
of definition.
[ 0.0 0.0 0.0 ]
REMOVE-UNTIL
(PROVE-LEMMA SUBLISTP-CONS-REWRITE
(REWRITE)
(EQUAL (SUBLISTP (CONS C X) Y)
(AND (MEMBER C Y)
(SUBLISTP X (REMOVE-UNTIL C Y)))))
This simplifies, unfolding the function AND, to the following two new formulas:
Case 2. (IMPLIES (NOT (MEMBER C Y))
(EQUAL (SUBLISTP (CONS C X) Y) F)).
This again simplifies, trivially, to the new conjecture:
(IMPLIES (NOT (MEMBER C Y))
(NOT (SUBLISTP (CONS C X) Y))),
which we will name *1.
Case 1. (IMPLIES (MEMBER C Y)
(EQUAL (SUBLISTP (CONS C X) Y)
(SUBLISTP X (REMOVE-UNTIL C Y)))),
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 (SUBLISTP (CONS C X) Y)
(AND (MEMBER C Y)
(SUBLISTP X (REMOVE-UNTIL C Y)))),
which we named *1 above. We will appeal to induction. There are three
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP Y)
(EQUAL (CAR (CONS C X)) (CAR Y))
(p C X (CDR Y)))
(p C X Y))
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL (CAR (CONS C X)) (CAR Y)))
(p C X (CDR Y)))
(p C X Y))
(IMPLIES (NOT (LISTP Y)) (p C X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT Y)
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 Y)
(EQUAL (CAR (CONS C X)) (CAR Y))
(EQUAL (SUBLISTP (CONS C X) (CDR Y))
(AND (MEMBER C (CDR Y))
(SUBLISTP X
(REMOVE-UNTIL C (CDR Y))))))
(EQUAL (SUBLISTP (CONS C X) Y)
(AND (MEMBER C Y)
(SUBLISTP X (REMOVE-UNTIL C Y))))).
This simplifies, applying CAR-CONS and CDR-CONS, and opening up AND,
SUBLISTP, MEMBER, and REMOVE-UNTIL, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (EQUAL (CAR (CONS C X)) (CAR Y)))
(EQUAL (SUBLISTP (CONS C X) (CDR Y))
(AND (MEMBER C (CDR Y))
(SUBLISTP X
(REMOVE-UNTIL C (CDR Y))))))
(EQUAL (SUBLISTP (CONS C X) Y)
(AND (MEMBER C Y)
(SUBLISTP X (REMOVE-UNTIL C Y))))),
which simplifies, applying the lemma CAR-CONS, and opening up the
definitions of AND, SUBLISTP, MEMBER, REMOVE-UNTIL, and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP Y))
(EQUAL (SUBLISTP (CONS C X) Y)
(AND (MEMBER C Y)
(SUBLISTP X (REMOVE-UNTIL C Y))))),
which simplifies, applying MEMBER-NON-LIST, and unfolding the functions
SUBLISTP, REMOVE-UNTIL, AND, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBLISTP-CONS-REWRITE
(PROVE-LEMMA LISTP-REMOVE-UNTIL-MEANS-LISTP
(REWRITE)
(IMPLIES (LISTP (REMOVE-UNTIL A Z))
(LISTP Z)))
WARNING: Note that LISTP-REMOVE-UNTIL-MEANS-LISTP contains the free variable
A which will be chosen by instantiating the hypothesis:
(LISTP (REMOVE-UNTIL A Z)).
This simplifies, unfolding REMOVE-UNTIL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-REMOVE-UNTIL-MEANS-LISTP
(PROVE-LEMMA LESSP-REMOVE-UNTIL
(REWRITE)
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A Y))
(LENGTH Y))
(LISTP Y)))
Call 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 (AND (LISTP Y) (EQUAL A (CAR Y)))
(p A Y))
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL A (CAR Y)))
(p A (CDR Y)))
(p A Y))
(IMPLIES (NOT (LISTP Y)) (p A Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to three
new goals:
Case 3. (IMPLIES (AND (LISTP Y) (EQUAL A (CAR Y)))
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A Y))
(LENGTH Y))
(LISTP Y))),
which simplifies, applying the lemmas SUB1-ADD1 and EQUAL-LENGTH-0, and
opening up the definitions of REMOVE-UNTIL, LENGTH, and LESSP, to:
(IMPLIES (AND (LISTP Y) (LISTP (CDR Y)))
(LESSP (SUB1 (LENGTH (CDR Y)))
(LENGTH (CDR Y)))).
However this again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (EQUAL (LENGTH (CDR Y)) 0)
(LISTP Y)
(LISTP (CDR Y)))
(LESSP (SUB1 (LENGTH (CDR Y)))
(LENGTH (CDR Y)))).
However this again simplifies, applying the lemma EQUAL-LENGTH-0, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (EQUAL A (CAR Y)))
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A (CDR Y)))
(LENGTH (CDR Y)))
(LISTP (CDR Y))))
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A Y))
(LENGTH Y))
(LISTP Y))),
which simplifies, applying SUB1-ADD1 and EQUAL-LENGTH-0, and opening up the
functions REMOVE-UNTIL, LENGTH, and LESSP, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL A (CAR Y)))
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A (CDR Y)))
(LENGTH (CDR Y)))
(LISTP (CDR Y)))
(LISTP (REMOVE-UNTIL A (CDR Y))))
(LESSP (SUB1 (LENGTH (REMOVE-UNTIL A (CDR Y))))
(LENGTH (CDR Y)))),
which again simplifies, applying LISTP-REMOVE-UNTIL-MEANS-LISTP, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL A (CAR Y)))
(LESSP (LENGTH (REMOVE-UNTIL A (CDR Y)))
(LENGTH (CDR Y)))
(LISTP (REMOVE-UNTIL A (CDR Y))))
(LESSP (SUB1 (LENGTH (REMOVE-UNTIL A (CDR Y))))
(LENGTH (CDR Y)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (LENGTH (REMOVE-UNTIL A (CDR Y)))
0)
(LISTP Y)
(NOT (EQUAL A (CAR Y)))
(LESSP (LENGTH (REMOVE-UNTIL A (CDR Y)))
(LENGTH (CDR Y)))
(LISTP (REMOVE-UNTIL A (CDR Y))))
(LESSP (SUB1 (LENGTH (REMOVE-UNTIL A (CDR Y))))
(LENGTH (CDR Y)))).
This again simplifies, applying EQUAL-LENGTH-0, to:
T.
Case 1. (IMPLIES (NOT (LISTP Y))
(EQUAL (LESSP (LENGTH (REMOVE-UNTIL A Y))
(LENGTH Y))
(LISTP Y))).
This simplifies, expanding REMOVE-UNTIL, LENGTH, LESSP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-REMOVE-UNTIL
(PROVE-LEMMA REMOVE-UNTIL-APPEND
(REWRITE)
(EQUAL (REMOVE-UNTIL A (APPEND X Y))
(IF (MEMBER A X)
(APPEND (REMOVE-UNTIL A X) Y)
(REMOVE-UNTIL A Y))))
This formula simplifies, trivially, to two new formulas:
Case 2. (IMPLIES (NOT (MEMBER A X))
(EQUAL (REMOVE-UNTIL A (APPEND X Y))
(REMOVE-UNTIL A Y))),
which we will name *1.
Case 1. (IMPLIES (MEMBER A X)
(EQUAL (REMOVE-UNTIL A (APPEND X Y))
(APPEND (REMOVE-UNTIL A X) Y))),
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 (REMOVE-UNTIL A (APPEND X Y))
(IF (MEMBER A X)
(APPEND (REMOVE-UNTIL A X) Y)
(REMOVE-UNTIL A Y))),
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 X) (p A (CDR X) Y))
(p A X Y))
(IMPLIES (NOT (LISTP X)) (p A X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following two new
goals:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (REMOVE-UNTIL A (APPEND (CDR X) Y))
(IF (MEMBER A (CDR X))
(APPEND (REMOVE-UNTIL A (CDR X)) Y)
(REMOVE-UNTIL A Y))))
(EQUAL (REMOVE-UNTIL A (APPEND X Y))
(IF (MEMBER A X)
(APPEND (REMOVE-UNTIL A X) Y)
(REMOVE-UNTIL A Y)))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and expanding APPEND,
REMOVE-UNTIL, and MEMBER, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (REMOVE-UNTIL A (APPEND X Y))
(IF (MEMBER A X)
(APPEND (REMOVE-UNTIL A X) Y)
(REMOVE-UNTIL A Y)))),
which simplifies, applying MEMBER-NON-LIST, and unfolding APPEND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REMOVE-UNTIL-APPEND
(DEFN LIST-UNTIL
(V L)
(IF (LISTP L)
(IF (EQUAL V (CAR L))
(LIST V)
(CONS (CAR L) (LIST-UNTIL V (CDR L))))
L))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT L) decreases according to the well-founded relation LESSP in each
recursive call. Hence, LIST-UNTIL is accepted under the definitional
principle. Note that (OR (LISTP (LIST-UNTIL V L)) (EQUAL (LIST-UNTIL V L) L))
is a theorem.
[ 0.0 0.0 0.0 ]
LIST-UNTIL
(PROVE-LEMMA APPEND-REMOVE-UNTIL-LIST-UNTIL
(REWRITE)
(EQUAL (APPEND (LIST-UNTIL V L)
(REMOVE-UNTIL V L))
L))
Give the conjecture the name *1.
Let us appeal to the induction principle. 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 L) (EQUAL V (CAR L)))
(p V L))
(IMPLIES (AND (LISTP L)
(NOT (EQUAL V (CAR L)))
(p V (CDR L)))
(p V L))
(IMPLIES (NOT (LISTP L)) (p V L))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT L)
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 (LISTP L) (EQUAL V (CAR L)))
(EQUAL (APPEND (LIST-UNTIL V L)
(REMOVE-UNTIL V L))
L)),
which simplifies, applying CDR-CONS, CAR-CONS, and CONS-CAR-CDR, and opening
up LIST-UNTIL, REMOVE-UNTIL, APPEND, and LISTP, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL V (CAR L)))
(EQUAL (APPEND (LIST-UNTIL V (CDR L))
(REMOVE-UNTIL V (CDR L)))
(CDR L)))
(EQUAL (APPEND (LIST-UNTIL V L)
(REMOVE-UNTIL V L))
L)).
This simplifies, applying the lemmas CONS-CAR-CDR, CDR-CONS, and CAR-CONS,
and unfolding the functions LIST-UNTIL, REMOVE-UNTIL, and APPEND, to:
T.
Case 1. (IMPLIES (NOT (LISTP L))
(EQUAL (APPEND (LIST-UNTIL V L)
(REMOVE-UNTIL V L))
L)).
This simplifies, unfolding the functions LIST-UNTIL, REMOVE-UNTIL, and
APPEND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
APPEND-REMOVE-UNTIL-LIST-UNTIL
(DEFN SUBLISTP-APPEND-INDUCT
(A B Y Z)
(IF (LISTP A)
(SUBLISTP-APPEND-INDUCT (CDR A)
B
(APPEND Y (LIST-UNTIL (CAR A) Z))
(REMOVE-UNTIL (CAR A) Z))
(IF (NLISTP B)
T
(IF (LISTP Y)
(IF (MEMBER (CAR B) Y)
(SUBLISTP-APPEND-INDUCT (LIST (CAR B))
(CDR B)
(REMOVE-UNTIL (CAR B) Y)
Z)
T)
T)))
((ORD-LESSP (CONS (ADD1 (LENGTH B)) (LENGTH A)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, EQUAL-LENGTH-0,
SUB1-ADD1, and ADD1-EQUAL, and the definitions of ORDINALP, LESSP, ORD-LESSP,
LENGTH, ADD1, and NLISTP can be used to establish that the measure:
(CONS (ADD1 (LENGTH B)) (LENGTH A))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, SUBLISTP-APPEND-INDUCT is accepted under the principle of
definition. From the definition we can conclude that:
(TRUEP (SUBLISTP-APPEND-INDUCT A B Y Z))
is a theorem.
[ 0.0 0.0 0.0 ]
SUBLISTP-APPEND-INDUCT
(PROVE-LEMMA MEMBER-APPEND
(REWRITE)
(EQUAL (MEMBER A (APPEND X Y))
(OR (MEMBER A X) (MEMBER A Y))))
This simplifies, opening up the function OR, to two new conjectures:
Case 2. (IMPLIES (NOT (MEMBER A X))
(EQUAL (MEMBER A (APPEND X Y))
(MEMBER A Y))),
which we will name *1.
Case 1. (IMPLIES (MEMBER A X)
(EQUAL (MEMBER A (APPEND X Y)) T)).
This again simplifies, trivially, to the new formula:
(IMPLIES (MEMBER A X)
(MEMBER A (APPEND X Y))),
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 (MEMBER A (APPEND X Y))
(OR (MEMBER A X) (MEMBER A Y))).
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 X) (p A (CDR X) Y))
(p A X Y))
(IMPLIES (NOT (LISTP X)) (p A X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
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 X)
(EQUAL (MEMBER A (APPEND (CDR X) Y))
(OR (MEMBER A (CDR X)) (MEMBER A Y))))
(EQUAL (MEMBER A (APPEND X Y))
(OR (MEMBER A X) (MEMBER A Y)))),
which simplifies, applying CDR-CONS and CAR-CONS, and unfolding OR, APPEND,
MEMBER, and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (MEMBER A (APPEND X Y))
(OR (MEMBER A X) (MEMBER A Y)))).
This simplifies, applying MEMBER-NON-LIST, and opening up the functions
APPEND and OR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-APPEND
(PROVE-LEMMA LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER
(REWRITE)
(IMPLIES (LISTP (BAGINT Y (LIST Z)))
(MEMBER Z Y)))
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 (AND (LISTP Y)
(MEMBER (CAR Y) (LIST Z))
(p Z (CDR Y)))
(p Z Y))
(IMPLIES (AND (LISTP Y)
(NOT (MEMBER (CAR Y) (LIST Z)))
(p Z (CDR Y)))
(p Z Y))
(IMPLIES (NOT (LISTP Y)) (p Z Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme leads to the
following five new goals:
Case 5. (IMPLIES (AND (LISTP Y)
(MEMBER (CAR Y) (LIST Z))
(NOT (LISTP (BAGINT (CDR Y) (LIST Z))))
(LISTP (BAGINT Y (LIST Z))))
(MEMBER Z Y)).
This simplifies, applying MEMBER-NON-LIST, CDR-CONS, and CAR-CONS, and
expanding the functions MEMBER, BAGINT, and DELETE, to:
T.
Case 4. (IMPLIES (AND (LISTP Y)
(MEMBER (CAR Y) (LIST Z))
(MEMBER Z (CDR Y))
(LISTP (BAGINT Y (LIST Z))))
(MEMBER Z Y)),
which simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, and CAR-CONS,
and opening up the functions MEMBER, BAGINT, and DELETE, to:
T.
Case 3. (IMPLIES (AND (LISTP Y)
(NOT (MEMBER (CAR Y) (LIST Z)))
(NOT (LISTP (BAGINT (CDR Y) (LIST Z))))
(LISTP (BAGINT Y (LIST Z))))
(MEMBER Z Y)).
This simplifies, applying MEMBER-NON-LIST, CDR-CONS, and CAR-CONS, and
opening up the definitions of MEMBER and BAGINT, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (MEMBER (CAR Y) (LIST Z)))
(MEMBER Z (CDR Y))
(LISTP (BAGINT Y (LIST Z))))
(MEMBER Z Y)),
which simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, and CAR-CONS,
and expanding the definitions of MEMBER and BAGINT, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Y))
(LISTP (BAGINT Y (LIST Z))))
(MEMBER Z Y)).
This simplifies, expanding the functions BAGINT and LISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER
(PROVE-LEMMA BAGINT-SINGLETON
(REWRITE)
(EQUAL (BAGINT X (LIST Y))
(IF (MEMBER Y X) (LIST Y) NIL)))
This formula simplifies, trivially, to two new formulas:
Case 2. (IMPLIES (NOT (MEMBER Y X))
(EQUAL (BAGINT X (LIST Y)) NIL)),
which we will name *1.
Case 1. (IMPLIES (MEMBER Y X)
(EQUAL (BAGINT X (LIST Y)) (LIST Y))),
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 (BAGINT X (LIST Y))
(IF (MEMBER Y X) (LIST Y) NIL)),
which we named *1 above. We will appeal to 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 X)
(MEMBER (CAR X) (LIST Y))
(p (CDR X) Y))
(p X Y))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (LIST Y)))
(p (CDR X) Y))
(p X Y))
(IMPLIES (NOT (LISTP X)) (p X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following three new
goals:
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (LIST Y))
(EQUAL (BAGINT (CDR X) (LIST Y))
(IF (MEMBER Y (CDR X)) (LIST Y) NIL)))
(EQUAL (BAGINT X (LIST Y))
(IF (MEMBER Y X) (LIST Y) NIL))).
This simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, CAR-CONS,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and CONS-EQUAL, and expanding
MEMBER, BAGINT, and DELETE, to two new formulas:
Case 3.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) Y)
(NOT (MEMBER Y (CDR X)))
(EQUAL (BAGINT (CDR X) (LIST Y)) NIL))
(EQUAL (BAGINT (CDR X) NIL) NIL)),
which again simplifies, obviously, to the new formula:
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (CDR X)))
(EQUAL (BAGINT (CDR X) (LIST (CAR X)))
NIL))
(EQUAL (BAGINT (CDR X) NIL) NIL)).
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 the new goal:
(IMPLIES (AND (NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)),
which we will name *1.1.
Case 3.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) Y)
(MEMBER Y (CDR X))
(EQUAL (BAGINT (CDR X) (LIST Y))
(LIST Y)))
(EQUAL (BAGINT (CDR X) NIL) NIL)).
But this again simplifies, rewriting with
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, to:
(IMPLIES (AND (LISTP X)
(EQUAL (BAGINT (CDR X) (LIST (CAR X)))
(LIST (CAR X))))
(EQUAL (BAGINT (CDR X) NIL) NIL)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to eliminate
(CDR X) and (CAR X). We would thus like to prove:
(IMPLIES (EQUAL (BAGINT Z (LIST V)) (LIST V))
(EQUAL (BAGINT Z NIL) NIL)),
which we will name *1.2.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (LIST Y)))
(EQUAL (BAGINT (CDR X) (LIST Y))
(IF (MEMBER Y (CDR X)) (LIST Y) NIL)))
(EQUAL (BAGINT X (LIST Y))
(IF (MEMBER Y X) (LIST Y) NIL))).
This simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and unfolding the functions
MEMBER, BAGINT, and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (BAGINT X (LIST Y))
(IF (MEMBER Y X) (LIST Y) NIL))),
which simplifies, rewriting with the lemma MEMBER-NON-LIST, and expanding
BAGINT and EQUAL, to:
T.
So we now return to:
(IMPLIES (EQUAL (BAGINT Z (LIST V)) (LIST V))
(EQUAL (BAGINT Z NIL) NIL)),
which is formula *1.2 above. Let us appeal to the induction principle. 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 Z)
(MEMBER (CAR Z) (LIST V))
(p (CDR Z) V))
(p Z V))
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (LIST V)))
(p (CDR Z) V))
(p Z V))
(IMPLIES (NOT (LISTP Z)) (p Z V))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT Z)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates five new conjectures:
Case 5. (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) (LIST V))
(NOT (EQUAL (BAGINT (CDR Z) (LIST V))
(LIST V)))
(EQUAL (BAGINT Z (LIST V)) (LIST V)))
(EQUAL (BAGINT Z NIL) NIL)),
which simplifies, applying MEMBER-NON-LIST, CDR-CONS, CAR-CONS,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and CONS-EQUAL, and opening up
the definitions of MEMBER, BAGINT, DELETE, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) (LIST V))
(EQUAL (BAGINT (CDR Z) NIL) NIL)
(EQUAL (BAGINT Z (LIST V)) (LIST V)))
(EQUAL (BAGINT Z NIL) NIL)).
This simplifies, applying MEMBER-NON-LIST, CDR-CONS, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the definitions of
MEMBER, BAGINT, DELETE, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (LIST V)))
(NOT (EQUAL (BAGINT (CDR Z) (LIST V))
(LIST V)))
(EQUAL (BAGINT Z (LIST V)) (LIST V)))
(EQUAL (BAGINT Z NIL) NIL)),
which simplifies, applying MEMBER-NON-LIST, CDR-CONS, and CAR-CONS, and
unfolding MEMBER and BAGINT, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (LIST V)))
(EQUAL (BAGINT (CDR Z) NIL) NIL)
(EQUAL (BAGINT Z (LIST V)) (LIST V)))
(EQUAL (BAGINT Z NIL) NIL)).
This simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, and CAR-CONS, and
expanding MEMBER, BAGINT, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Z))
(EQUAL (BAGINT Z (LIST V)) (LIST V)))
(EQUAL (BAGINT Z NIL) NIL)),
which simplifies, expanding the function BAGINT, to:
T.
That finishes the proof of *1.2.
So we now return to:
(IMPLIES (AND (NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)),
which we named *1.1 above. Let us appeal to the induction principle. 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 V) (p V Z))
(IMPLIES (AND (NOT (NLISTP V))
(EQUAL Z (CAR V)))
(p V Z))
(IMPLIES (AND (NOT (NLISTP V))
(NOT (EQUAL Z (CAR V)))
(p (CDR V) Z))
(p V Z))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT V) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to five new goals:
Case 5. (IMPLIES (AND (NLISTP V)
(NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)),
which simplifies, rewriting with MEMBER-NON-LIST, and opening up the
definitions of NLISTP, BAGINT, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP V))
(EQUAL Z (CAR V))
(NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)).
This simplifies, opening up the functions NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP V))
(NOT (EQUAL Z (CAR V)))
(MEMBER Z (CDR V))
(NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)).
This simplifies, opening up the functions NLISTP and MEMBER, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP V))
(NOT (EQUAL Z (CAR V)))
(NOT (EQUAL (BAGINT (CDR V) (LIST Z)) NIL))
(NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)).
This simplifies, applying MEMBER-NON-LIST, CDR-CONS, and CAR-CONS, and
opening up the functions NLISTP, MEMBER, and BAGINT, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP V))
(NOT (EQUAL Z (CAR V)))
(EQUAL (BAGINT (CDR V) NIL) NIL)
(NOT (MEMBER Z V))
(EQUAL (BAGINT V (LIST Z)) NIL))
(EQUAL (BAGINT V NIL) NIL)),
which simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS, and CAR-CONS,
and opening up NLISTP, MEMBER, BAGINT, and EQUAL, to:
T.
That finishes the proof of *1.1, which, consequently, also finishes the
proof of *1. Q.E.D.
[ 0.0 0.3 0.1 ]
BAGINT-SINGLETON
(PROVE-LEMMA TRANSITIVITY-OF-APPEND
(REWRITE)
(EQUAL (APPEND (APPEND A B) C)
(APPEND A (APPEND B C))))
Call the conjecture *1.
Perhaps we can prove it by induction. Three inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP A) (p (CDR A) B C))
(p A B C))
(IMPLIES (NOT (LISTP A)) (p A B C))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT A) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to two
new goals:
Case 2. (IMPLIES (AND (LISTP A)
(EQUAL (APPEND (APPEND (CDR A) B) C)
(APPEND (CDR A) (APPEND B C))))
(EQUAL (APPEND (APPEND A B) C)
(APPEND A (APPEND B C)))),
which simplifies, applying the lemmas CDR-CONS and CAR-CONS, and opening up
the definition of APPEND, to:
T.
Case 1. (IMPLIES (NOT (LISTP A))
(EQUAL (APPEND (APPEND A B) C)
(APPEND A (APPEND B C)))),
which simplifies, unfolding the function APPEND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TRANSITIVITY-OF-APPEND
(PROVE-LEMMA SUBLISTP-APPEND
(REWRITE)
(IMPLIES (SUBLISTP (APPEND A B) Z)
(SUBLISTP B (APPEND Y Z)))
((INDUCT (SUBLISTP-APPEND-INDUCT A B Y Z))))
WARNING: Note that SUBLISTP-APPEND contains the free variable A which will be
chosen by instantiating the hypothesis (SUBLISTP (APPEND A B) Z).
This formula can be simplified, using the abbreviations NLISTP, IMPLIES, NOT,
OR, AND, APPEND-REMOVE-UNTIL-LIST-UNTIL, and TRANSITIVITY-OF-APPEND, to the
following five new conjectures:
Case 5. (IMPLIES (AND (LISTP A)
(IMPLIES (SUBLISTP (APPEND (CDR A) B)
(REMOVE-UNTIL (CAR A) Z))
(SUBLISTP B (APPEND Y Z)))
(SUBLISTP (APPEND A B) Z))
(SUBLISTP B (APPEND Y Z))).
This simplifies, rewriting with SUBLISTP-CONS-REWRITE, and expanding the
definitions of IMPLIES and APPEND, to:
T.
Case 4. (IMPLIES (AND (NOT (LISTP A))
(NOT (LISTP B))
(SUBLISTP (APPEND A B) Z))
(SUBLISTP B (APPEND Y Z))),
which simplifies, expanding the definitions of APPEND and SUBLISTP, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP A))
(LISTP B)
(LISTP Y)
(MEMBER (CAR B) Y)
(IMPLIES (SUBLISTP (APPEND (LIST (CAR B)) (CDR B))
Z)
(SUBLISTP (CDR B)
(APPEND (REMOVE-UNTIL (CAR B) Y) Z)))
(SUBLISTP (APPEND A B) Z))
(SUBLISTP B (APPEND Y Z))),
which simplifies, rewriting with the lemmas CDR-CONS, CAR-CONS, and
CONS-CAR-CDR, and expanding the functions APPEND, LISTP, and IMPLIES, to the
formula:
(IMPLIES (AND (NOT (LISTP A))
(LISTP B)
(LISTP Y)
(MEMBER (CAR B) Y)
(SUBLISTP (CDR B)
(APPEND (REMOVE-UNTIL (CAR B) Y) Z))
(SUBLISTP B Z))
(SUBLISTP B (APPEND Y Z))).
Appealing to the lemma CAR-CDR-ELIM, we now replace B by (CONS X V) to
eliminate (CAR B) and (CDR B). We must thus prove:
(IMPLIES (AND (NOT (LISTP A))
(LISTP Y)
(MEMBER X Y)
(SUBLISTP V
(APPEND (REMOVE-UNTIL X Y) Z))
(SUBLISTP (CONS X V) Z))
(SUBLISTP (CONS X V) (APPEND Y Z))).
But this further simplifies, applying SUBLISTP-CONS-REWRITE, MEMBER-APPEND,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, BAGINT-SINGLETON, and
REMOVE-UNTIL-APPEND, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP A))
(LISTP B)
(LISTP Y)
(NOT (MEMBER (CAR B) Y))
(SUBLISTP (APPEND A B) Z))
(SUBLISTP B (APPEND Y Z))).
This simplifies, unfolding the function APPEND, to the new conjecture:
(IMPLIES (AND (NOT (LISTP A))
(LISTP B)
(LISTP Y)
(NOT (MEMBER (CAR B) Y))
(SUBLISTP B Z))
(SUBLISTP B (APPEND Y Z))).
Applying the lemma CAR-CDR-ELIM, replace B by (CONS X V) to eliminate
(CAR B) and (CDR B). We thus obtain the new formula:
(IMPLIES (AND (NOT (LISTP A))
(LISTP Y)
(NOT (MEMBER X Y))
(SUBLISTP (CONS X V) Z))
(SUBLISTP (CONS X V) (APPEND Y Z))),
which further simplifies, rewriting with SUBLISTP-CONS-REWRITE,
MEMBER-APPEND, LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, BAGINT-SINGLETON,
and REMOVE-UNTIL-APPEND, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP A))
(LISTP B)
(NOT (LISTP Y))
(SUBLISTP (APPEND A B) Z))
(SUBLISTP B (APPEND Y Z))).
This simplifies, unfolding the function APPEND, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
SUBLISTP-APPEND
(PROVE-LEMMA SUBLISTP-CDR1
(REWRITE)
(IMPLIES (SUBLISTP X Y)
(SUBLISTP (CDR X) Y))
((USE (SUBLISTP-APPEND (A (LIST (CAR X)))
(B (CDR X))
(Z Y)
(Y NIL)))))
This formula simplifies, applying CDR-CONS, CAR-CONS, CONS-CAR-CDR, and
CDR-NLISTP, and expanding the functions APPEND, LISTP, IMPLIES, and SUBLISTP,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SUBLISTP-CDR1
(PROVE-LEMMA SUBLISTP-CDR2
(REWRITE)
(IMPLIES (SUBLISTP X (CDR Y))
(SUBLISTP X Y))
((USE (SUBLISTP-APPEND (A NIL)
(B X)
(Y (LIST (CAR Y)))
(Z (CDR Y))))))
This formula simplifies, applying CDR-CONS, CAR-CONS, CONS-CAR-CDR, and
CDR-NLISTP, and expanding the functions LISTP, APPEND, IMPLIES, and SUBLISTP,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SUBLISTP-CDR2
(PROVE-LEMMA REMAINDER-BIG-PERIOD-SUBLIST
(REWRITE)
(IMPLIES (AND (PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)))
Give the conjecture the name *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest four inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(p (CDR Y) (CDR X)))
(p Y X))
(IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(p (CDR Y) X))
(p Y X))
(IMPLIES (AND (LISTP Y) (NOT (LISTP X)))
(p Y X))
(IMPLIES (NOT (LISTP Y)) (p Y X))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for X. The
above induction scheme leads to the following eight new conjectures:
Case 8. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(NOT (PERIODIC-TASKSP (CDR Y)))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, opening up the functions PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 7. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(NOT (SUBLISTP (CDR X) (CDR Y)))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, opening up the functions PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP, and SUBLISTP, to:
T.
Case 6. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(EQUAL (REMAINDER (BIG-PERIOD (CDR Y))
(BIG-PERIOD (CDR X)))
0)
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
functions PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK,
TK-NAME, PERIODIC-TASKP, SUBLISTP, and BIG-PERIOD, to:
(IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(EQUAL (REMAINDER (BIG-PERIOD (CDR Y))
(BIG-PERIOD (CDR X)))
0)
(LISTP (CAR X))
(LITATOM (CAAR X))
(NOT (EQUAL (CAAR X) NIL))
(NOT (EQUAL (CADAR X) 0))
(NUMBERP (CADAR X))
(NOT (EQUAL (CADDAR X) 0))
(NUMBERP (CADDAR X))
(EQUAL NIL (CDDDAR X))
(NOT (ASSOC (CAAR X) (CDR Y)))
(PERIODIC-TASKSP (CDR Y))
(SUBLISTP (CDR X) (CDR Y)))
(EQUAL (REMAINDER (TIMES (BIG-PERIOD (CDR Y)) (CADAR X))
(BIG-PERIOD X))
0)).
However this further simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
REMAINDER-TIMES2-INSTANCE, and expanding the definitions of UNPACK,
TK-PERIOD, BIG-PERIOD, EQUAL, and TIMES, to:
T.
Case 5. (IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(NOT (PERIODIC-TASKSP (CDR Y)))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, opening up the functions PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 4. (IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(NOT (SUBLISTP X (CDR Y)))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, expanding PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL,
TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP, and SUBLISTP, to:
T.
Case 3. (IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(EQUAL (REMAINDER (BIG-PERIOD (CDR Y))
(BIG-PERIOD X))
0)
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES and
REMAINDER-TIMES1, and expanding the definitions of PERIODIC-TASKSP,
TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP,
SUBLISTP, and BIG-PERIOD, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (LISTP X))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and expanding
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME,
PERIODIC-TASKP, SUBLISTP, and BIG-PERIOD, to:
(IMPLIES (AND (LISTP Y)
(NOT (LISTP X))
(LISTP (CAR Y))
(LITATOM (CAAR Y))
(NOT (EQUAL (CAAR Y) NIL))
(NOT (EQUAL (CADAR Y) 0))
(NUMBERP (CADAR Y))
(NOT (EQUAL (CADDAR Y) 0))
(NUMBERP (CADDAR Y))
(EQUAL NIL (CDDDAR Y))
(NOT (ASSOC (CAAR Y) (CDR Y)))
(PERIODIC-TASKSP (CDR Y)))
(EQUAL (REMAINDER (TIMES (BIG-PERIOD (CDR Y)) (CADAR Y))
(BIG-PERIOD X))
0)),
which further simplifies, rewriting with REMAINDER-1-ARG2, and unfolding the
definitions of UNPACK, BIG-PERIOD, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Y))
(PERIODIC-TASKSP Y)
(SUBLISTP X Y))
(EQUAL (REMAINDER (BIG-PERIOD Y)
(BIG-PERIOD X))
0)).
This simplifies, rewriting with the lemma REMAINDER-1-ARG1, and expanding
the definitions of PERIODIC-TASKSP, LISTP, SUBLISTP, and BIG-PERIOD, to the
new goal:
(IMPLIES (AND (NOT (LISTP Y))
(EQUAL Y NIL)
(NOT (LISTP X)))
(EQUAL (BIG-PERIOD X) 1)),
which again simplifies, unfolding LISTP, to the formula:
(IMPLIES (NOT (LISTP X))
(EQUAL (BIG-PERIOD X) 1)).
But this further simplifies, opening up the definitions of BIG-PERIOD and
EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.0 ]
REMAINDER-BIG-PERIOD-SUBLIST
(PROVE-LEMMA REMAINDER-BIG-PERIOD-CDR
(REWRITE)
(IMPLIES (EQUAL (REMAINDER N (BIG-PERIOD PTS))
0)
(EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0)))
This formula simplifies, applying the lemmas COMMUTATIVITY-OF-TIMES,
CDR-NLISTP, and REMAINDER-1-ARG2, and unfolding TK-PERIOD, BIG-PERIOD, and
EQUAL, to:
(IMPLIES (AND (LISTP PTS)
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace N by:
(PLUS X
(TIMES (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
Z))
to eliminate (REMAINDER N (TIMES (BIG-PERIOD (CDR PTS)) (CADAR PTS))) and:
(QUOTIENT N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
. We employ LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. This produces the following four
new conjectures:
Case 4. (IMPLIES (AND (NOT (NUMBERP N))
(LISTP PTS)
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0)).
But this further simplifies, rewriting with the lemmas
REMAINDER-OF-NON-NUMBER, QUOTIENT-OF-NON-NUMBER, COMMUTATIVITY-OF-TIMES, and
REMAINDER-TIMES2, and expanding REMAINDER, NUMBERP, EQUAL, LESSP, QUOTIENT,
and TIMES, to:
T.
Case 3. (IMPLIES (AND (EQUAL (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
0)
(LISTP PTS)
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0)),
which further simplifies, applying EQUAL-TIMES-0, REMAINDER-ZERO, and
REMAINDER-OF-NON-NUMBER, and unfolding ZEROP, REMAINDER, EQUAL, LESSP, and
NUMBERP, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))))
(LISTP PTS)
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0)).
This further simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
(NOT (ZEROP (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))))
(NUMBERP Z)
(NOT (EQUAL (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
0))
(LISTP PTS)
(EQUAL X 0))
(EQUAL (REMAINDER (PLUS X
(TIMES (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
Z))
(BIG-PERIOD (CDR PTS)))
0)).
This further simplifies, applying EQUAL-TIMES-0, COMMUTATIVITY-OF-TIMES,
COMMUTATIVITY2-OF-TIMES, ASSOCIATIVITY-OF-TIMES, REMAINDER-TIMES1-INSTANCE,
and REMAINDER-TIMES1, and opening up NUMBERP, EQUAL, LESSP, ZEROP, NOT, and
PLUS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
REMAINDER-BIG-PERIOD-CDR
(PROVE-LEMMA REPEAT-LIST-PLUS
(REWRITE)
(EQUAL (REPEAT-LIST L (PLUS A B))
(APPEND (REPEAT-LIST L A)
(REPEAT-LIST L B))))
Call the conjecture *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 (ZEROP A) (p L A B))
(IMPLIES (AND (NOT (ZEROP A)) (p L (SUB1 A) B))
(p L A B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP inform us that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates two new goals:
Case 2. (IMPLIES (ZEROP A)
(EQUAL (REPEAT-LIST L (PLUS A B))
(APPEND (REPEAT-LIST L A)
(REPEAT-LIST L B)))),
which simplifies, opening up the functions ZEROP, EQUAL, PLUS, REPEAT-LIST,
LISTP, and APPEND, to two new formulas:
Case 2.2.
(IMPLIES (AND (EQUAL A 0) (NOT (NUMBERP B)))
(EQUAL (REPEAT-LIST L 0)
(REPEAT-LIST L B))),
which again simplifies, opening up EQUAL and REPEAT-LIST, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (NUMBERP B)))
(EQUAL (REPEAT-LIST L 0)
(REPEAT-LIST L B))),
which again simplifies, opening up the definitions of EQUAL and
REPEAT-LIST, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(EQUAL (REPEAT-LIST L (PLUS (SUB1 A) B))
(APPEND (REPEAT-LIST L (SUB1 A))
(REPEAT-LIST L B))))
(EQUAL (REPEAT-LIST L (PLUS A B))
(APPEND (REPEAT-LIST L A)
(REPEAT-LIST L B)))),
which simplifies, applying the lemmas SUB1-ADD1 and TRANSITIVITY-OF-APPEND,
and expanding ZEROP, PLUS, and REPEAT-LIST, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REPEAT-LIST-PLUS
(PROVE-LEMMA NTHCDR-APPEND
(REWRITE)
(EQUAL (NTHCDR N (APPEND L1 L2))
(IF (LESSP N (LENGTH L1))
(APPEND (NTHCDR N L1) L2)
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2))))
This simplifies, clearly, to the following two new conjectures:
Case 2. (IMPLIES (NOT (LESSP N (LENGTH L1)))
(EQUAL (NTHCDR N (APPEND L1 L2))
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace N by
(PLUS (LENGTH L1) X) to eliminate (DIFFERENCE N (LENGTH L1)). We use the
type restriction lemma noted when DIFFERENCE was introduced to constrain the
new variable. We must thus prove two new goals:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LESSP N (LENGTH L1))))
(EQUAL (NTHCDR N (APPEND L1 L2))
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2))),
which further simplifies, using linear arithmetic, applying EQUAL-LENGTH-0
and DIFFERENCE-LEQ-ARG1, and opening up the definitions of LESSP, APPEND,
NTHCDR, LENGTH, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS (LENGTH L1) X)
(LENGTH L1))))
(EQUAL (NTHCDR (PLUS (LENGTH L1) X)
(APPEND L1 L2))
(NTHCDR X L2))).
But this further simplifies, applying COMMUTATIVITY-OF-PLUS and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, to the new conjecture:
(IMPLIES (NUMBERP X)
(EQUAL (NTHCDR (PLUS X (LENGTH L1))
(APPEND L1 L2))
(NTHCDR X 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 (NTHCDR N (APPEND L1 L2))
(IF (LESSP N (LENGTH L1))
(APPEND (NTHCDR N L1) L2)
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2))).
We named this *1. We will try to prove it by induction. There are seven
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N L1 L2))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) (CDR L1) L2))
(p N L1 L2))).
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 induction step of the scheme. Note, however, the inductive
instance chosen for L1. The above induction scheme produces two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (NTHCDR N (APPEND L1 L2))
(IF (LESSP N (LENGTH L1))
(APPEND (NTHCDR N L1) L2)
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2)))),
which simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and unfolding ZEROP, APPEND, EQUAL, NTHCDR, LENGTH, and
LESSP, to the following two new goals:
Case 2.2.
(IMPLIES (AND (EQUAL N 0)
(LISTP L1)
(EQUAL (ADD1 (LENGTH (CDR L1))) 0))
(EQUAL (CONS (CAR L1) (APPEND (CDR L1) L2))
L2)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP N))
(LISTP L1)
(EQUAL (ADD1 (LENGTH (CDR L1))) 0))
(EQUAL (CONS (CAR L1) (APPEND (CDR L1) L2))
L2)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(IF (LESSP (SUB1 N) (LENGTH (CDR L1)))
(APPEND (NTHCDR (SUB1 N) (CDR L1)) L2)
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))))
(EQUAL (NTHCDR N (APPEND L1 L2))
(IF (LESSP N (LENGTH L1))
(APPEND (NTHCDR N L1) L2)
(NTHCDR (DIFFERENCE N (LENGTH L1))
L2)))),
which simplifies, opening up the functions ZEROP, APPEND, LENGTH, and NTHCDR,
to eight new conjectures:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(LISTP L1)
(NOT (LESSP N (ADD1 (LENGTH (CDR L1))))))
(EQUAL (NTHCDR N
(CONS (CAR L1) (APPEND (CDR L1) L2)))
(NTHCDR (DIFFERENCE N
(ADD1 (LENGTH (CDR L1))))
L2))),
which again simplifies, rewriting with the lemmas SUB1-ADD1, CDR-CONS, and
DIFFERENCE-ADD1-ARG2, and opening up the functions LESSP and NTHCDR, to
two new formulas:
Case 1.8.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(LISTP L1)
(NOT (LESSP (LENGTH (CDR L1)) N)))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR 0 L2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.8.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(LISTP L1)
(LESSP (LENGTH (CDR L1)) N))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (SUB1 (DIFFERENCE N (LENGTH (CDR L1))))
L2))).
Applying the lemmas SUB1-ELIM and DIFFERENCE-ELIM, replace N by (ADD1 X)
to eliminate (SUB1 N) and X by (PLUS (LENGTH (CDR L1)) Z) to eliminate:
(DIFFERENCE X (LENGTH (CDR L1)))
. We use the type restriction lemma noted when SUB1 was introduced and
the type restriction lemma noted when DIFFERENCE was introduced to
restrict the new variables. We would thus like to prove:
(IMPLIES
(AND (NUMBERP Z)
(NOT (EQUAL (ADD1 (PLUS (LENGTH (CDR L1)) Z))
0))
(NOT (LESSP (PLUS (LENGTH (CDR L1)) Z)
(LENGTH (CDR L1))))
(EQUAL (NTHCDR (PLUS (LENGTH (CDR L1)) Z)
(APPEND (CDR L1) L2))
(NTHCDR Z L2))
(LISTP L1)
(LESSP (LENGTH (CDR L1))
(ADD1 (PLUS (LENGTH (CDR L1)) Z))))
(EQUAL (NTHCDR (PLUS (LENGTH (CDR L1)) Z)
(APPEND (CDR L1) L2))
(NTHCDR (SUB1 (DIFFERENCE (ADD1 (PLUS (LENGTH (CDR L1)) Z))
(LENGTH (CDR L1))))
L2))),
which further simplifies, applying COMMUTATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, SUB1-ADD1, EQUAL-LENGTH-0,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, DIFFERENCE-SUB1-ARG2, and
PLUS-ZERO-ARG2, and expanding the definitions of LESSP, LENGTH, EQUAL,
PLUS, APPEND, DIFFERENCE, FIX, and ZEROP, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(LISTP L1)
(LESSP N (ADD1 (LENGTH (CDR L1)))))
(EQUAL (NTHCDR N
(CONS (CAR L1) (APPEND (CDR L1) L2)))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(NOT (LISTP L1))
(NOT (LESSP N 0)))
(EQUAL (NTHCDR N L2)
(NTHCDR (DIFFERENCE N 0) L2))),
which again simplifies, opening up the functions EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR L1))))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(NTHCDR (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(NOT (LISTP L1))
(LESSP N 0))
(EQUAL (NTHCDR N L2)
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR L1)))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))
(LISTP L1)
(NOT (LESSP N (ADD1 (LENGTH (CDR L1))))))
(EQUAL (NTHCDR N
(CONS (CAR L1) (APPEND (CDR L1) L2)))
(NTHCDR (DIFFERENCE N
(ADD1 (LENGTH (CDR L1))))
L2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR L1)))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))
(LISTP L1)
(LESSP N (ADD1 (LENGTH (CDR L1)))))
(EQUAL (NTHCDR N
(CONS (CAR L1) (APPEND (CDR L1) L2)))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))),
which again simplifies, rewriting with the lemmas SUB1-ADD1 and CDR-CONS,
and opening up LESSP and NTHCDR, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR L1)))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))
(NOT (LISTP L1))
(NOT (LESSP N 0)))
(EQUAL (NTHCDR N L2)
(NTHCDR (DIFFERENCE N 0) L2))),
which again simplifies, unfolding EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LENGTH (CDR L1)))
(EQUAL (NTHCDR (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))
(NOT (LISTP L1))
(LESSP N 0))
(EQUAL (NTHCDR N L2)
(APPEND (NTHCDR (SUB1 N) (CDR L1))
L2))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.2 ]
NTHCDR-APPEND
(PROVE-LEMMA FIRSTN-APPEND
(REWRITE)
(EQUAL (FIRSTN N (APPEND L1 L2))
(IF (LESSP (LENGTH L1) N)
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2))
(FIRSTN N L1))))
This simplifies, clearly, to the following two new conjectures:
Case 2. (IMPLIES (NOT (LESSP (LENGTH L1) N))
(EQUAL (FIRSTN N (APPEND L1 L2))
(FIRSTN N L1))).
Name the above subgoal *1.
Case 1. (IMPLIES (LESSP (LENGTH L1) N)
(EQUAL (FIRSTN N (APPEND L1 L2))
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2)))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace N by
(PLUS (LENGTH L1) X) to eliminate (DIFFERENCE N (LENGTH L1)). We employ the
type restriction lemma noted when DIFFERENCE was introduced to constrain the
new variable. This generates three new goals:
Case 1.3.
(IMPLIES (AND (LESSP N (LENGTH L1))
(LESSP (LENGTH L1) N))
(EQUAL (FIRSTN N (APPEND L1 L2))
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2)))),
which further simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP (LENGTH L1) N))
(EQUAL (FIRSTN N (APPEND L1 L2))
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2)))),
which further simplifies, opening up LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS (LENGTH L1) X)
(LENGTH L1)))
(LESSP (LENGTH L1)
(PLUS (LENGTH L1) X)))
(EQUAL (FIRSTN (PLUS (LENGTH L1) X)
(APPEND L1 L2))
(APPEND L1 (FIRSTN X L2)))),
which further simplifies, applying the lemmas COMMUTATIVITY-OF-PLUS and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up the definitions of FIX,
ZEROP, and NOT, to:
(IMPLIES (AND (NUMBERP X) (NOT (EQUAL X 0)))
(EQUAL (FIRSTN (PLUS X (LENGTH L1))
(APPEND L1 L2))
(APPEND L1 (FIRSTN X L2)))),
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 (FIRSTN N (APPEND L1 L2))
(IF (LESSP (LENGTH L1) N)
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2))
(FIRSTN N L1))).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are eight plausible inductions. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N L1 L2))
(IMPLIES (AND (NOT (ZEROP N))
(ZEROP (LENGTH L1)))
(p N L1 L2))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (ZEROP (LENGTH L1)))
(p (SUB1 N) (CDR L1) L2))
(p N L1 L2))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for L1. The above induction scheme
generates three new formulas:
Case 3. (IMPLIES (ZEROP N)
(EQUAL (FIRSTN N (APPEND L1 L2))
(IF (LESSP (LENGTH L1) N)
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2))
(FIRSTN N L1)))),
which simplifies, opening up the functions ZEROP, APPEND, EQUAL, FIRSTN,
LENGTH, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(ZEROP (LENGTH L1)))
(EQUAL (FIRSTN N (APPEND L1 L2))
(IF (LESSP (LENGTH L1) N)
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2))
(FIRSTN N L1)))),
which simplifies, opening up the functions ZEROP, LENGTH, APPEND, EQUAL,
LESSP, and DIFFERENCE, to two new goals:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (ADD1 (LENGTH (CDR L1))) 0)
(NOT (LISTP L1)))
(EQUAL (FIRSTN N L2)
(APPEND L1 (FIRSTN N L2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (ADD1 (LENGTH (CDR L1))) 0)
(LISTP L1))
(EQUAL (FIRSTN N
(CONS (CAR L1) (APPEND (CDR L1) L2)))
(APPEND L1 (FIRSTN N L2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (ZEROP (LENGTH L1)))
(EQUAL (FIRSTN (SUB1 N) (APPEND (CDR L1) L2))
(IF (LESSP (LENGTH (CDR L1)) (SUB1 N))
(APPEND (CDR L1)
(FIRSTN (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2))
(FIRSTN (SUB1 N) (CDR L1)))))
(EQUAL (FIRSTN N (APPEND L1 L2))
(IF (LESSP (LENGTH L1) N)
(APPEND L1
(FIRSTN (DIFFERENCE N (LENGTH L1))
L2))
(FIRSTN N L1)))),
which simplifies, rewriting with the lemmas CDR-CONS, CAR-CONS, SUB1-ADD1,
and DIFFERENCE-ADD1-ARG2, and opening up the functions ZEROP, LENGTH, APPEND,
FIRSTN, and LESSP, to two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LISTP L1)
(NOT (EQUAL (ADD1 (LENGTH (CDR L1))) 0))
(LESSP (LENGTH (CDR L1)) (SUB1 N))
(EQUAL (FIRSTN (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (CDR L1)
(FIRSTN (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2)))
(NOT (LESSP (LENGTH (CDR L1)) N)))
(EQUAL (CONS (CAR L1)
(FIRSTN (SUB1 N)
(APPEND (CDR L1) L2)))
(APPEND L1 (FIRSTN 0 L2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(LISTP L1)
(NOT (EQUAL (ADD1 (LENGTH (CDR L1))) 0))
(LESSP (LENGTH (CDR L1)) (SUB1 N))
(EQUAL (FIRSTN (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (CDR L1)
(FIRSTN (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2)))
(LESSP (LENGTH (CDR L1)) N))
(EQUAL (CONS (CAR L1)
(FIRSTN (SUB1 N)
(APPEND (CDR L1) L2)))
(APPEND L1
(FIRSTN (SUB1 (DIFFERENCE N (LENGTH (CDR L1))))
L2)))),
which again simplifies, trivially, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(LISTP L1)
(LESSP (LENGTH (CDR L1)) (SUB1 N))
(EQUAL (FIRSTN (SUB1 N) (APPEND (CDR L1) L2))
(APPEND (CDR L1)
(FIRSTN (DIFFERENCE (SUB1 N)
(LENGTH (CDR L1)))
L2)))
(LESSP (LENGTH (CDR L1)) N))
(EQUAL (CONS (CAR L1)
(FIRSTN (SUB1 N)
(APPEND (CDR L1) L2)))
(APPEND L1
(FIRSTN (SUB1 (DIFFERENCE N (LENGTH (CDR L1))))
L2)))).
Applying the lemmas SUB1-ELIM and DIFFERENCE-ELIM, replace N by (ADD1 X)
to eliminate (SUB1 N) and X by (PLUS (LENGTH (CDR L1)) Z) to eliminate:
(DIFFERENCE X (LENGTH (CDR L1)))
. We use the type restriction lemma noted when SUB1 was introduced and
the type restriction lemma noted when DIFFERENCE was introduced to
restrict the new variables. We would thus like to prove the following two
new conjectures:
Case 1.1.2.
(IMPLIES
(AND (LESSP X (LENGTH (CDR L1)))
(NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(LISTP L1)
(LESSP (LENGTH (CDR L1)) X)
(EQUAL (FIRSTN X (APPEND (CDR L1) L2))
(APPEND (CDR L1)
(FIRSTN (DIFFERENCE X (LENGTH (CDR L1)))
L2)))
(LESSP (LENGTH (CDR L1)) (ADD1 X)))
(EQUAL (CONS (CAR L1)
(FIRSTN X (APPEND (CDR L1) L2)))
(APPEND L1
(FIRSTN (SUB1 (DIFFERENCE (ADD1 X)
(LENGTH (CDR L1))))
L2)))).
This further simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS (LENGTH (CDR L1)) Z)
(LENGTH (CDR L1))))
(NOT (EQUAL (ADD1 (PLUS (LENGTH (CDR L1)) Z))
0))
(LISTP L1)
(LESSP (LENGTH (CDR L1))
(PLUS (LENGTH (CDR L1)) Z))
(EQUAL (FIRSTN (PLUS (LENGTH (CDR L1)) Z)
(APPEND (CDR L1) L2))
(APPEND (CDR L1) (FIRSTN Z L2)))
(LESSP (LENGTH (CDR L1))
(ADD1 (PLUS (LENGTH (CDR L1)) Z))))
(EQUAL
(CONS (CAR L1)
(FIRSTN (PLUS (LENGTH (CDR L1)) Z)
(APPEND (CDR L1) L2)))
(APPEND L1
(FIRSTN (SUB1 (DIFFERENCE (ADD1 (PLUS (LENGTH (CDR L1)) Z))
(LENGTH (CDR L1))))
L2)))),
which further simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, SUB1-ADD1, EQUAL-LENGTH-0,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, DIFFERENCE-SUB1-ARG2, and
PLUS-ZERO-ARG2, and unfolding FIX, ZEROP, NOT, LESSP, LENGTH, EQUAL,
PLUS, APPEND, and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
FIRSTN-APPEND
(DEFN NTHCDR-REPEAT-LIST-INDUCT
(N1 N2 LIST)
(IF (ZEROP N1)
T
(NTHCDR-REPEAT-LIST-INDUCT (SUB1 N1)
(DIFFERENCE N2 (LENGTH LIST))
LIST)))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N1) decreases according to the well-founded
relation LESSP in each recursive call. Hence, NTHCDR-REPEAT-LIST-INDUCT is
accepted under the definitional principle. Note that:
(TRUEP (NTHCDR-REPEAT-LIST-INDUCT N1 N2 LIST))
is a theorem.
[ 0.0 0.0 0.0 ]
NTHCDR-REPEAT-LIST-INDUCT
(PROVE-LEMMA NTHCDR-REPEAT-LIST
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (NTHCDR N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(DIFFERENCE N2
(QUOTIENT N1 (LENGTH LIST))))))
((INDUCT (NTHCDR-REPEAT-LIST-INDUCT N2 N1 LIST))
(DISABLE QUOTIENT-DIFFERENCE QUOTIENT-DIFFERENCE1)))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new formulas:
Case 2. (IMPLIES
(AND (ZEROP N2)
(EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (NTHCDR N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(DIFFERENCE N2
(QUOTIENT N1 (LENGTH LIST)))))),
which simplifies, using linear arithmetic, applying EQUAL-LENGTH-0,
QUOTIENT-OF-NON-NUMBER, and DIFFERENCE-LEQ-ARG1, and unfolding the
definitions of ZEROP, EQUAL, TIMES, LESSP, REPEAT-LIST, NTHCDR, QUOTIENT,
and DIFFERENCE, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(IMPLIES
(AND (EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (TIMES (SUB1 N2) (LENGTH LIST))
(DIFFERENCE N1 (LENGTH LIST)))))
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))))
(EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (NTHCDR N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(DIFFERENCE N2
(QUOTIENT N1 (LENGTH LIST)))))).
This simplifies, using linear arithmetic, applying COMMUTATIVITY-OF-TIMES,
EQUAL-LENGTH-0, QUOTIENT-ZERO, NTHCDR-APPEND, DIFFERENCE-LEQ-ARG1,
QUOTIENT-LESSP-ARG1, and DIFFERENCE-ADD1-ARG2, and opening up the
definitions of NOT, AND, IMPLIES, REMAINDER, LENGTH, EQUAL, TIMES, LESSP,
APPEND, REPEAT-LIST, NTHCDR, ZEROP, DIFFERENCE, and QUOTIENT, to ten new
formulas:
Case 1.10.
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0))
(LESSP N1 (LENGTH LIST))
(EQUAL N1 0)
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))),
which again simplifies, opening up the functions LENGTH, DIFFERENCE,
REMAINDER, and EQUAL, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0))
(LESSP N1 (LENGTH LIST))
(NOT (NUMBERP N1))
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))),
which again simplifies, using linear arithmetic, applying
DIFFERENCE-LEQ-ARG1, and opening up the definitions of LENGTH, REMAINDER,
and EQUAL, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(NOT (LESSP (QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
N2)))
(EQUAL (NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES
(AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(LESSP (QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
N2))
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LESSP N1 (LENGTH LIST))
(EQUAL N1 0)
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))),
which again simplifies, expanding LENGTH, EQUAL, TIMES, DIFFERENCE, and
LESSP, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LESSP N1 (LENGTH LIST))
(NOT (NUMBERP N1))
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))),
which again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-LEQ-ARG1, and unfolding the definitions of LENGTH, EQUAL, TIMES,
and LESSP, to:
T.
Case 1.4.
(IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(NOT (LESSP (QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
N2)))
(EQUAL (NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST 0))),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and expanding the definitions of EQUAL and
REPEAT-LIST, to:
T.
Case 1.3.
(IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(LESSP (QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
N2))
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))))).
Appealing to the lemmas REMAINDER-QUOTIENT-ELIM, DIFFERENCE-ELIM, and
SUB1-ELIM, we now replace N1 by (PLUS (LENGTH LIST) X) to eliminate:
(DIFFERENCE N1 (LENGTH LIST))
X by (PLUS V (TIMES (LENGTH LIST) Z)) to eliminate:
(QUOTIENT X (LENGTH LIST))
and (REMAINDER X (LENGTH LIST)), N2 by (PLUS Z X) to eliminate
(DIFFERENCE N2 Z), and X by (ADD1 W) to eliminate (SUB1 X). We rely upon
LESSP-REMAINDER, the type restriction lemma noted when QUOTIENT was
introduced, the type restriction lemma noted when REMAINDER was introduced,
the type restriction lemma noted when DIFFERENCE was introduced, and the
type restriction lemma noted when SUB1 was introduced to constrain the new
variables. This generates six new conjectures:
Case 1.3.6.
(IMPLIES
(AND
(NOT (NUMBERP N1))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(LESSP (QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
N2))
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))))),
which further simplifies, using linear arithmetic, applying
DIFFERENCE-LEQ-ARG1, EQUAL-LENGTH-0, QUOTIENT-LESSP-ARG1, and
EQUAL-SUB1-0, and unfolding the functions EQUAL, NTHCDR, LESSP, and
DIFFERENCE, to:
T.
Case 1.3.5.
(IMPLIES
(AND (EQUAL (LENGTH LIST) 0)
(NUMBERP X)
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (NTHCDR X
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT X (LENGTH LIST)))))
(LISTP LIST)
(NOT (LESSP (PLUS (LENGTH LIST) X)
(LENGTH LIST)))
(EQUAL (REMAINDER X (LENGTH LIST)) 0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
(PLUS (LENGTH LIST) X)))
(LESSP (QUOTIENT X (LENGTH LIST)) N2))
(EQUAL
(NTHCDR X
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2
(QUOTIENT X (LENGTH LIST))))))).
This further simplifies, applying EQUAL-LENGTH-0, to:
T.
Case 1.3.4.
(IMPLIES
(AND (NOT (NUMBERP (LENGTH LIST)))
(NUMBERP X)
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (NTHCDR X
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT X (LENGTH LIST)))))
(LISTP LIST)
(NOT (LESSP (PLUS (LENGTH LIST) X)
(LENGTH LIST)))
(EQUAL (REMAINDER X (LENGTH LIST)) 0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
(PLUS (LENGTH LIST) X)))
(LESSP (QUOTIENT X (LENGTH LIST)) N2))
(EQUAL
(NTHCDR X
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2
(QUOTIENT X (LENGTH LIST))))))).
This further simplifies, clearly, to:
T.
Case 1.3.3.
(IMPLIES (AND (LESSP N2 Z)
(NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V (LENGTH LIST))
(NOT (ZEROP (LENGTH LIST))))
(NOT (EQUAL (LENGTH LIST) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2) Z)))
(LISTP LIST)
(NOT (LESSP (PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))
(LENGTH LIST)))
(EQUAL V 0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
(PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))))
(LESSP Z N2))
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(SUB1 (DIFFERENCE N2 Z))))).
This further simplifies, using linear arithmetic, to:
T.
Case 1.3.2.
(IMPLIES
(AND (EQUAL X 0)
(NUMBERP X)
(NOT (LESSP (PLUS Z X) Z))
(NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V (LENGTH LIST))
(NOT (ZEROP (LENGTH LIST))))
(NOT (EQUAL (LENGTH LIST) 0))
(NOT (EQUAL (PLUS Z X) 0))
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST (SUB1 (PLUS Z X))))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 (PLUS Z X)) Z)))
(LISTP LIST)
(NOT (LESSP (PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))
(LENGTH LIST)))
(EQUAL V 0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST)
(SUB1 (PLUS Z X))))
(PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))))
(LESSP Z (PLUS Z X)))
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST (SUB1 (PLUS Z X))))
(REPEAT-LIST LIST (SUB1 X)))),
which further simplifies, using linear arithmetic, to:
T.
Case 1.3.1.
(IMPLIES
(AND (NUMBERP W)
(NOT (EQUAL (ADD1 W) 0))
(NOT (LESSP (PLUS Z (ADD1 W)) Z))
(NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V (LENGTH LIST))
(NOT (ZEROP (LENGTH LIST))))
(NOT (EQUAL (LENGTH LIST) 0))
(NOT (EQUAL (PLUS Z (ADD1 W)) 0))
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST
(SUB1 (PLUS Z (ADD1 W)))))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 (PLUS Z (ADD1 W)))
Z)))
(LISTP LIST)
(NOT (LESSP (PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))
(LENGTH LIST)))
(EQUAL V 0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST)
(SUB1 (PLUS Z (ADD1 W)))))
(PLUS (LENGTH LIST)
V
(TIMES (LENGTH LIST) Z))))
(LESSP Z (PLUS Z (ADD1 W))))
(EQUAL (NTHCDR (PLUS V (TIMES (LENGTH LIST) Z))
(REPEAT-LIST LIST
(SUB1 (PLUS Z (ADD1 W)))))
(REPEAT-LIST LIST W))),
which further simplifies, using linear arithmetic, rewriting with
COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, SUB1-ADD1, EQUAL-LENGTH-0,
COMMUTATIVITY-OF-TIMES, PLUS-ZERO-ARG2, LESSP-PLUS-TIMES1,
REPEAT-LIST-PLUS, LENGTH-REPEAT-LIST, CORRECTNESS-OF-CANCEL-LESSP-TIMES,
NTHCDR-APPEND, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS,
TIMES-DISTRIBUTES-OVER-PLUS, CORRECTNESS-OF-CANCEL-LESSP-PLUS, and
LESSP-TIMES2, and unfolding the functions LESSP, NUMBERP, EQUAL, ZEROP,
NOT, PLUS, TIMES, NTHCDR, DIFFERENCE, REPEAT-LIST, FIX, and AND, to:
T.
Case 1.2.
(IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(LESSP N1 (LENGTH LIST))
(EQUAL N1 0)
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))).
However this again simplifies, applying EQUAL-SUB1-0, and opening up the
functions LENGTH, DIFFERENCE, EQUAL, NTHCDR, QUOTIENT, and LESSP, to:
T.
Case 1.1.
(IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL
(NTHCDR (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(DIFFERENCE (SUB1 N2)
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(LESSP N1 (LENGTH LIST))
(NOT (NUMBERP N1))
(NOT (LISTP LIST)))
(EQUAL (REPEAT-LIST LIST (SUB1 N2))
(APPEND LIST
(REPEAT-LIST LIST (SUB1 N2))))).
This again simplifies, using linear arithmetic, applying
DIFFERENCE-LEQ-ARG1 and EQUAL-SUB1-0, and unfolding the functions LENGTH,
EQUAL, NTHCDR, QUOTIENT, DIFFERENCE, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.7 0.1 ]
NTHCDR-REPEAT-LIST
(PROVE-LEMMA LENGTH-MAKE-LENGTH
(REWRITE)
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
(FIX N)))
This conjecture simplifies, opening up the function FIX, to the following two
new goals:
Case 2. (IMPLIES (NOT (NUMBERP N))
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
0)).
But this again simplifies, expanding the definitions of MAKE-LENGTH, LENGTH,
and EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP N)
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
N)),
which we will name *1.
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 LIST FILL))
(IMPLIES (AND (NOT (ZEROP N))
(LISTP LIST)
(p (SUB1 N) (CDR LIST) FILL))
(p N LIST FILL))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LISTP LIST))
(p (SUB1 N) NIL FILL))
(p N LIST FILL))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for LIST. The above induction scheme
generates three new goals:
Case 3. (IMPLIES (AND (ZEROP N) (NUMBERP N))
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
N)),
which simplifies, expanding ZEROP, NUMBERP, EQUAL, MAKE-LENGTH, and LENGTH,
to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LISTP LIST)
(EQUAL (LENGTH (MAKE-LENGTH (SUB1 N)
(CDR LIST)
FILL))
(SUB1 N))
(NUMBERP N))
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
N)),
which simplifies, rewriting with ADD1-SUB1 and CDR-CONS, and unfolding the
definitions of ZEROP, MAKE-LENGTH, and LENGTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LISTP LIST))
(EQUAL (LENGTH (MAKE-LENGTH (SUB1 N) NIL FILL))
(SUB1 N))
(NUMBERP N))
(EQUAL (LENGTH (MAKE-LENGTH N LIST FILL))
N)).
This simplifies, rewriting with the lemmas ADD1-SUB1 and CDR-CONS, and
opening up ZEROP, MAKE-LENGTH, and LENGTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LENGTH-MAKE-LENGTH
(PROVE-LEMMA MEMBER-EXPANDED
(REWRITE)
(IMPLIES (AND (MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)))
WARNING: Note that MEMBER-EXPANDED contains the free variable PTS which will
be chosen by instantiating the hypothesis (MEMBER TK PTS).
.
Appealing to the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace TK by (CONS Z X) to eliminate (CDR TK) and (CAR TK), X by (CONS V W)
to eliminate (CAR X) and (CDR X), and V by (PLUS X (TIMES BIGP D)) to
eliminate (REMAINDER V BIGP) and (QUOTIENT V BIGP). We use LESSP-REMAINDER,
the type restriction lemma noted when REMAINDER was introduced, and the type
restriction lemma noted when QUOTIENT was introduced to constrain the new
variables. This generates six new formulas:
Case 6. (IMPLIES (AND (NOT (LISTP TK))
(MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)),
which simplifies, applying the lemma CDR-NLISTP, and opening up CAR, LESSP,
EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 5. (IMPLIES (AND (NOT (LISTP X))
(MEMBER (CONS Z X) PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CAR X) BIGP) 0)),
which simplifies, applying CAR-NLISTP, and unfolding the definitions of
LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP V))
(MEMBER (CONS Z (CONS V W)) PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER V BIGP) 0)).
But this simplifies, applying REMAINDER-OF-NON-NUMBER, and expanding the
definitions of LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 3. (IMPLIES (AND (EQUAL BIGP 0)
(MEMBER (CONS Z (CONS V W)) PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER V BIGP) 0)).
However this simplifies, rewriting with the lemma REMAINDER-ZERO, and
opening up ZEROP, to the conjecture:
(IMPLIES (AND (MEMBER (CONS Z (CONS V W)) PTS)
(EXPANDED-TASKSP PTS 0)
(NUMBERP V))
(EQUAL V 0)),
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 (MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)).
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 PTS) (p TK BIGP PTS))
(IMPLIES (AND (NOT (NLISTP PTS))
(EQUAL TK (CAR PTS)))
(p TK BIGP PTS))
(IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(p TK BIGP (CDR PTS)))
(p TK BIGP PTS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT PTS) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates four new conjectures:
Case 4. (IMPLIES (AND (NLISTP PTS)
(MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)),
which simplifies, appealing to the lemma MEMBER-NON-LIST, and expanding the
function NLISTP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PTS))
(EQUAL TK (CAR PTS))
(MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)),
which simplifies, applying BAGINT-SINGLETON and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the functions
NLISTP, MEMBER, and EXPANDED-TASKSP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(NOT (MEMBER TK (CDR PTS)))
(MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)).
This simplifies, expanding NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(NOT (EXPANDED-TASKSP (CDR PTS) BIGP))
(MEMBER TK PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)).
This simplifies, opening up the functions NLISTP, MEMBER, and
EXPANDED-TASKSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
MEMBER-EXPANDED
(PROVE-LEMMA FIRSTN-LENGTH-LIST
(REWRITE)
(EQUAL (FIRSTN (LENGTH X) X)
(PLIST X)))
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 X) (p (CDR X)))
(p X))
(IMPLIES (NOT (LISTP X)) (p X))).
Linear arithmetic and the lemma CDR-LESSP can be used to establish that the
measure (COUNT X) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme generates the
following two new formulas:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (FIRSTN (LENGTH (CDR X)) (CDR X))
(PLIST (CDR X))))
(EQUAL (FIRSTN (LENGTH X) X)
(PLIST X))).
This simplifies, applying SUB1-ADD1, and expanding the functions LENGTH,
FIRSTN, and PLIST, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (FIRSTN (LENGTH X) X)
(PLIST X))),
which simplifies, opening up the functions LENGTH, EQUAL, FIRSTN, and PLIST,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
FIRSTN-LENGTH-LIST
(PROVE-LEMMA FIRSTN-REPEAT-LIST
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (FIRSTN N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(QUOTIENT N1 (LENGTH LIST)))))
((INDUCT (NTHCDR-REPEAT-LIST-INDUCT N2 N1 LIST))
(DISABLE QUOTIENT-DIFFERENCE QUOTIENT-DIFFERENCE1)))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following two new formulas:
Case 2. (IMPLIES (AND (ZEROP N2)
(EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (FIRSTN N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(QUOTIENT N1 (LENGTH LIST))))).
This simplifies, applying EQUAL-LENGTH-0 and QUOTIENT-OF-NON-NUMBER, and
unfolding the definitions of ZEROP, EQUAL, TIMES, LESSP, REPEAT-LIST, FIRSTN,
and QUOTIENT, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL N2 0))
(NUMBERP N2)
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (TIMES (SUB1 N2) (LENGTH LIST))
(DIFFERENCE N1 (LENGTH LIST)))))
(EQUAL (FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))
(EQUAL (REMAINDER N1 (LENGTH LIST)) 0)
(NOT (LESSP (TIMES N2 (LENGTH LIST)) N1)))
(EQUAL (FIRSTN N1 (REPEAT-LIST LIST N2))
(REPEAT-LIST LIST
(QUOTIENT N1 (LENGTH LIST))))),
which simplifies, rewriting with COMMUTATIVITY-OF-TIMES, EQUAL-LENGTH-0,
QUOTIENT-ZERO, FIRSTN-APPEND, QUOTIENT-LESSP-ARG1, and SUB1-ADD1, and
opening up the definitions of NOT, AND, IMPLIES, REMAINDER, LENGTH, EQUAL,
TIMES, LESSP, APPEND, REPEAT-LIST, FIRSTN, ZEROP, and QUOTIENT, to the
following three new formulas:
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(NOT (LESSP (LENGTH LIST) N1)))
(EQUAL (FIRSTN N1 LIST)
(APPEND LIST
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(LESSP (TIMES (LENGTH LIST) (SUB1 N2))
(DIFFERENCE N1 (LENGTH LIST)))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(LESSP (LENGTH LIST) N1))
(EQUAL (APPEND LIST
(FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2))))
(APPEND LIST
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(NOT (LESSP (LENGTH LIST) N1)))
(EQUAL (FIRSTN N1 LIST)
(APPEND LIST
(FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.1.2.
(IMPLIES
(AND (NOT (NUMBERP N1))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))))
(LISTP LIST)
(NOT (LESSP N1 (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE N1 (LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
N1))
(NOT (LESSP (LENGTH LIST) N1)))
(EQUAL (FIRSTN N1 LIST)
(APPEND LIST
(FIRSTN (DIFFERENCE N1 (LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))))),
which again simplifies, applying DIFFERENCE-LEQ-ARG1, EQUAL-LENGTH-0,
and QUOTIENT-LESSP-ARG1, and opening up the functions EQUAL, FIRSTN,
LESSP, and REPEAT-LIST, to:
T.
Case 1.1.1.
(IMPLIES
(AND (NUMBERP N1)
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (FIRSTN (DIFFERENCE (LENGTH LIST)
(LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))
(REPEAT-LIST LIST
(QUOTIENT (DIFFERENCE (LENGTH LIST)
(LENGTH LIST))
(LENGTH LIST))))
(LISTP LIST)
(NOT (LESSP (LENGTH LIST) (LENGTH LIST)))
(EQUAL (REMAINDER (DIFFERENCE (LENGTH LIST)
(LENGTH LIST))
(LENGTH LIST))
0)
(NOT (LESSP (PLUS (LENGTH LIST)
(TIMES (LENGTH LIST) (SUB1 N2)))
(LENGTH LIST)))
(NOT (LESSP (LENGTH LIST) (LENGTH LIST))))
(EQUAL (FIRSTN (LENGTH LIST) LIST)
(APPEND LIST
(FIRSTN (DIFFERENCE (LENGTH LIST)
(LENGTH LIST))
(REPEAT-LIST LIST (SUB1 N2)))))).
However this again simplifies, applying DIFFERENCE-X-X, EQUAL-LENGTH-0,
QUOTIENT-LESSP-ARG1, REMAINDER-NOOP, LESSP-PLUS-TIMES1,
FIRSTN-LENGTH-LIST, and APPEND-NIL, and unfolding the functions EQUAL,
FIRSTN, LESSP, REPEAT-LIST, and NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
FIRSTN-REPEAT-LIST
(PROVE-LEMMA LESSP-REMAINDER-SPECIAL
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP Y (PLUS X Z))
(AND (NOT (ZEROP Z))
(NOT (LESSP X Y)))))
((INDUCT (DOUBLE-REMAINDER-INDUCTION Z X Y))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to four new conjectures:
Case 4. (IMPLIES (AND (ZEROP Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP Y (PLUS X Z))
(AND (NOT (ZEROP Z))
(NOT (LESSP X Y))))),
which simplifies, applying EQUAL-PLUS-0 and REMAINDER-OF-NON-NUMBER, and
unfolding the definitions of ZEROP, LESSP, EQUAL, NUMBERP, REMAINDER, NOT,
and AND, to the following four new goals:
Case 4.4.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(NOT (EQUAL X 0)))
(NOT (NUMBERP X))).
But this again simplifies, applying REMAINDER-ZERO, and unfolding the
definition of ZEROP, to:
T.
Case 4.3.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(NOT (EQUAL X 0)))
(NOT (NUMBERP X))).
This again simplifies, rewriting with REMAINDER-ZERO, and opening up ZEROP,
to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(NOT (EQUAL X 0)))
(NOT (NUMBERP X))).
But this again simplifies, applying the lemma REMAINDER-ZERO, and
unfolding the function ZEROP, to:
T.
Case 4.1.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(NOT (EQUAL X 0)))
(NOT (NUMBERP X))),
which again simplifies, rewriting with the lemma REMAINDER-ZERO, and
expanding the definition of ZEROP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP Y (PLUS X Z))
(AND (NOT (ZEROP Z))
(NOT (LESSP X Y))))),
which simplifies, opening up the definitions of ZEROP, NOT, and AND, to four
new goals:
Case 3.4.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(EQUAL Z 0))
(EQUAL (LESSP Y (PLUS X Z)) F)),
which again simplifies, applying REMAINDER-ZERO, and expanding the
definitions of EQUAL, LESSP, and ZEROP, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(NOT (NUMBERP Z)))
(EQUAL (LESSP Y (PLUS X Z)) F)).
However this again simplifies, rewriting with REMAINDER-ZERO, and opening
up the functions LESSP and ZEROP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP X Y))
(EQUAL (LESSP Y (PLUS X Z)) F)).
This again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP X Y))
(NOT (LESSP Y (PLUS X Z)))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z). We
use LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. We would thus like to prove the
following four new formulas:
Case 3.2.4.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP X Y))
(NOT (LESSP Y (PLUS X Z)))).
But this further simplifies, using linear arithmetic, applying the
lemmas REMAINDER-NOOP and REMAINDER-OF-NON-NUMBER, and unfolding the
functions NUMBERP, EQUAL, LESSP, and PLUS, to two new formulas:
Case 3.2.4.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER Y Z) 0)
(NOT (NUMBERP Z)))
(NOT (LESSP Y 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.4.1.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER Y Z) 0)
(NUMBERP Z))
(NOT (LESSP Y Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.3.
(IMPLIES (AND (EQUAL Z 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP X Y))
(NOT (LESSP Y (PLUS X Z)))),
which further simplifies, using linear arithmetic, to:
T.
Case 3.2.2.
(IMPLIES (AND (NOT (NUMBERP Z))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP X Y))
(NOT (LESSP Y (PLUS X Z)))),
which further simplifies, rewriting with REMAINDER-ZERO, and expanding
the definitions of LESSP and ZEROP, to:
T.
Case 3.2.1.
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL V 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP (PLUS V (TIMES Z W)) Y))
(NOT (LESSP Y
(PLUS (PLUS V (TIMES Z W)) Z)))).
But this further simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
COMMUTATIVITY-OF-PLUS, and unfolding the definitions of NUMBERP, EQUAL,
LESSP, ZEROP, NOT, and PLUS, to:
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER Y Z) 0)
(LESSP (TIMES W Z) Y))
(NOT (LESSP Y (PLUS Z (TIMES W Z))))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS V (TIMES Z D)) to eliminate (REMAINDER Y Z) and (QUOTIENT Y Z).
We employ LESSP-REMAINDER, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables. We would thus
like to prove:
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL (PLUS V (TIMES Z D)) 0))
(LESSP Z (PLUS V (TIMES Z D)))
(EQUAL V 0)
(LESSP (TIMES W Z)
(PLUS V (TIMES Z D))))
(NOT (LESSP (PLUS V (TIMES Z D))
(PLUS Z (TIMES W Z))))),
which further simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
EQUAL-TIMES-0, LESSP-TIMES3, and CORRECTNESS-OF-CANCEL-LESSP-TIMES, and
expanding the definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS,
FIX, and AND, to:
(IMPLIES (AND (NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which we will finally name *1.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP X Y)))
(EQUAL (LESSP Y (PLUS X Z)) T)).
This again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP X Y)))
(LESSP Y (PLUS X Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(LESSP X Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP Y (PLUS X Z))
(AND (NOT (ZEROP Z))
(NOT (LESSP X Y))))),
which simplifies, using linear arithmetic, rewriting with REMAINDER-NOOP and
DIFFERENCE-LEQ-ARG1, and unfolding NUMBERP, REMAINDER, EQUAL, PLUS, ZEROP,
NOT, LESSP, and AND, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0)
(EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (LESSP Y
(PLUS (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(AND (NOT (ZEROP (DIFFERENCE Z Y)))
(NOT (LESSP (DIFFERENCE X Y) Y)))))
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP Y (PLUS X Z))
(AND (NOT (ZEROP Z))
(NOT (LESSP X Y))))).
This simplifies, using linear arithmetic, applying PLUS-DIFFERENCE-ARG1,
PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2, EQUAL-DIFFERENCE-0, REMAINDER-NOOP,
DIFFERENCE-LEQ-ARG1, REMAINDER-OF-NON-NUMBER, and REMAINDER-ZERO, and
expanding AND, EQUAL, PLUS, ZEROP, NOT, IMPLIES, NUMBERP, REMAINDER, and
LESSP, to four new conjectures:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z)))
(LESSP Y (PLUS X Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z)))
(LESSP Y (PLUS X Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Z))
(LESSP Y X)
(NUMBERP X)
(EQUAL (LESSP Y (DIFFERENCE X Y)) F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z))
(LESSP Y (PLUS X Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Z))
(NOT (LESSP Y X))
(EQUAL (LESSP Y 0) F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z))
(LESSP Y (PLUS X Z))),
which again simplifies, using linear arithmetic, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which we named *1 above. We will try to prove it by induction. There are six
plausible inductions. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (OR (EQUAL D 0) (NOT (NUMBERP D)))
(p D Z W))
(IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p D Z W))
(IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p (SUB1 D) Z (SUB1 W)))
(p D Z W))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT D) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for W. The above induction scheme
leads to six new goals:
Case 6. (IMPLIES (AND (OR (EQUAL D 0) (NOT (NUMBERP D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which simplifies, opening up NOT and OR, to:
T.
Case 5. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which simplifies, unfolding the functions NOT, OR, EQUAL, and NUMBERP, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(EQUAL (SUB1 D) 0)
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 2)))
(NUMBERP 2)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL 2 0))
(LESSP 1 2)
(LESSP W 2))
(NOT (LESSP (TIMES 2 Z)
(PLUS Z (TIMES W Z))))).
But this again simplifies, rewriting with the lemmas TIMES-1-ARG1 and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding the functions EQUAL, NUMBERP,
NOT, OR, SUB1, LESSP, TIMES, and FIX, to two new goals:
Case 3.2.
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP W 2)
(NOT (EQUAL W 0)))
(NOT (LESSP Z
(PLUS Z (TIMES (SUB1 W) Z))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NUMBERP 1)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 2)
(NOT (EQUAL 1 0)))
(NOT (LESSP Z
(PLUS Z (TIMES (SUB1 1) Z))))).
However this again simplifies, applying PLUS-ZERO-ARG2, and expanding the
functions NUMBERP, LESSP, EQUAL, SUB1, TIMES, and ZEROP, to:
(IMPLIES (AND (NUMBERP Z) (NOT (EQUAL Z 0)))
(NOT (LESSP Z Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP W 2)
(EQUAL W 0))
(NOT (LESSP Z 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (SUB1 W) (SUB1 D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL W 0)
(NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (SUB1 W) (SUB1 D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))).
This again simplifies, applying EQUAL-SUB1-0, and expanding the definitions
of NOT, OR, EQUAL, NUMBERP, SUB1, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (TIMES (SUB1 D) Z)
(PLUS Z (TIMES (SUB1 W) Z))))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP W D))
(NOT (LESSP (TIMES D Z)
(PLUS Z (TIMES W Z))))).
This simplifies, rewriting with EQUAL-SUB1-0, PLUS-ZERO-ARG2,
LESSP-PLUS-TIMES1, and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the
definitions of NOT, OR, EQUAL, NUMBERP, LESSP, SUB1, TIMES, ZEROP, and FIX,
to:
(IMPLIES (AND (NOT (LESSP (TIMES (SUB1 D) Z)
(PLUS Z (TIMES (SUB1 W) Z))))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(NOT (EQUAL D 1))
(LESSP (SUB1 W) (SUB1 D))
(EQUAL W 0))
(NOT (LESSP (TIMES (SUB1 D) Z) 0))).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.1 ]
LESSP-REMAINDER-SPECIAL
(PROVE-LEMMA LESSP-DIFFERENCE-SPECIAL
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z)
(AND (NOT (ZEROP Z))
(NOT (LESSP Y X)))))
((INDUCT (DOUBLE-REMAINDER-INDUCTION Z X Y))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, AND, and DIFFERENCE-DIFFERENCE-ARG1, to four new conjectures:
Case 4. (IMPLIES (AND (ZEROP Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z)
(AND (NOT (ZEROP Z))
(NOT (LESSP Y X))))),
which simplifies, applying REMAINDER-OF-NON-NUMBER, and unfolding the
definitions of ZEROP, LESSP, EQUAL, NUMBERP, REMAINDER, DIFFERENCE, NOT, and
AND, to the following 14 new goals:
Case 4.14.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (LESSP X Z) F)).
But this again simplifies, applying REMAINDER-NOOP, to:
T.
Case 4.13.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) F)).
This again simplifies, applying REMAINDER-ZERO, and unfolding ZEROP, EQUAL,
and LESSP, to:
T.
Case 4.12.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(EQUAL X 0))
(EQUAL (LESSP 0 Z) F)).
However this again simplifies, opening up REMAINDER, EQUAL, and LESSP, to:
T.
Case 4.11.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) F)),
which again simplifies, rewriting with REMAINDER-ZERO, and opening up
ZEROP, EQUAL, and LESSP, to:
T.
Case 4.10.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(EQUAL X 0))
(EQUAL (LESSP 0 Z) F)).
But this again simplifies, applying REMAINDER-ZERO, and expanding the
functions ZEROP, NUMBERP, EQUAL, and LESSP, to:
T.
Case 4.9.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(EQUAL X 0))
(EQUAL (LESSP 0 Z) T)).
But this again simplifies, expanding the functions NUMBERP, LESSP, EQUAL,
and REMAINDER, to:
T.
Case 4.8.
(IMPLIES (AND (EQUAL Y 0)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) T)),
which again simplifies, applying REMAINDER-OF-NON-NUMBER, and expanding
the definitions of NUMBERP, LESSP, EQUAL, and REMAINDER, to:
T.
Case 4.7.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (LESSP X Z) F)).
However this again simplifies, rewriting with REMAINDER-NOOP, to:
T.
Case 4.6.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) F)).
But this again simplifies, rewriting with REMAINDER-ZERO, and expanding
the definitions of ZEROP, EQUAL, and LESSP, to:
T.
Case 4.5.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(EQUAL Z 0)
(EQUAL X 0))
(EQUAL (LESSP 0 Z) F)).
This again simplifies, opening up REMAINDER, EQUAL, and LESSP, to:
T.
Case 4.4.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) F)),
which again simplifies, rewriting with REMAINDER-ZERO, and opening up the
functions ZEROP, EQUAL, and LESSP, to:
T.
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (NUMBERP Z))
(EQUAL X 0))
(EQUAL (LESSP 0 Z) F)).
But this again simplifies, rewriting with REMAINDER-ZERO, and opening up
the definitions of ZEROP, NUMBERP, EQUAL, and LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(EQUAL X 0))
(EQUAL (LESSP 0 Z) T)).
However this again simplifies, expanding the definitions of NUMBERP, LESSP,
EQUAL, and REMAINDER, to:
T.
Case 4.1.
(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (NUMBERP X)))
(EQUAL (LESSP 0 Z) T)),
which again simplifies, rewriting with REMAINDER-OF-NON-NUMBER, and
expanding NUMBERP, LESSP, EQUAL, and REMAINDER, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z)
(AND (NOT (ZEROP Z))
(NOT (LESSP Y X))))).
This simplifies, unfolding the functions ZEROP, NOT, and AND, to the
following four new formulas:
Case 3.4.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(EQUAL Z 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)).
This again simplifies, rewriting with REMAINDER-ZERO, and expanding EQUAL,
LESSP, and ZEROP, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(NOT (NUMBERP Z)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)).
This again simplifies, applying REMAINDER-ZERO, and opening up LESSP and
ZEROP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)).
This again simplifies, clearly, to the new goal:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y X))
(NOT (LESSP (DIFFERENCE X Y) Z))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace X by
(PLUS V (TIMES Z W)) to eliminate (REMAINDER X Z) and (QUOTIENT X Z). We
rely upon LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. We thus obtain the following
four new formulas:
Case 3.2.4.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y X))
(NOT (LESSP (DIFFERENCE X Y) Z))).
However this further simplifies, using linear arithmetic, applying the
lemmas REMAINDER-NOOP and REMAINDER-OF-NON-NUMBER, and expanding NUMBERP,
EQUAL, and LESSP, to:
T.
Case 3.2.3.
(IMPLIES (AND (EQUAL Z 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y X))
(NOT (LESSP (DIFFERENCE X Y) Z))),
which further simplifies, using linear arithmetic, to:
T.
Case 3.2.2.
(IMPLIES (AND (NOT (NUMBERP Z))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y X))
(NOT (LESSP (DIFFERENCE X Y) Z))),
which further simplifies, rewriting with the lemma REMAINDER-ZERO, and
opening up LESSP and ZEROP, to:
T.
Case 3.2.1.
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL V 0)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y (PLUS V (TIMES Z W))))
(NOT (LESSP (DIFFERENCE (PLUS V (TIMES Z W)) Y)
Z))),
which further simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
expanding the functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to
the new formula:
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER Y Z) 0)
(LESSP Y (TIMES W Z)))
(NOT (LESSP (DIFFERENCE (TIMES W Z) Y)
Z))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS V (TIMES Z D)) to eliminate (REMAINDER Y Z) and (QUOTIENT Y Z).
We employ LESSP-REMAINDER, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables. We thus obtain:
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL (PLUS V (TIMES Z D)) 0))
(LESSP Z (PLUS V (TIMES Z D)))
(EQUAL V 0)
(LESSP (PLUS V (TIMES Z D))
(TIMES W Z)))
(NOT (LESSP (DIFFERENCE (TIMES W Z)
(PLUS V (TIMES Z D)))
Z))),
which further simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
EQUAL-TIMES-0, LESSP-TIMES3, and CORRECTNESS-OF-CANCEL-LESSP-TIMES, and
opening up the functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, FIX,
and AND, to:
(IMPLIES (AND (NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which we will finally name *1.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Z Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)).
However this again simplifies, appealing to the lemma DIFFERENCE-LEQ-ARG1,
and opening up EQUAL and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(LESSP X Y)
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z)
(AND (NOT (ZEROP Z))
(NOT (LESSP Y X))))),
which simplifies, using linear arithmetic, rewriting with REMAINDER-NOOP and
DIFFERENCE-LEQ-ARG1, and opening up NUMBERP, REMAINDER, EQUAL, LESSP, ZEROP,
NOT, and AND, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0)
(EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
(AND (NOT (ZEROP (DIFFERENCE Z Y)))
(NOT (LESSP Y (DIFFERENCE X Y))))))
(EQUAL (REMAINDER X Z) 0)
(EQUAL (REMAINDER Y Z) 0))
(EQUAL (LESSP (DIFFERENCE X Y) Z)
(AND (NOT (ZEROP Z))
(NOT (LESSP Y X))))).
This simplifies, using linear arithmetic, applying EQUAL-DIFFERENCE-0,
REMAINDER-NOOP, and DIFFERENCE-LEQ-ARG1, and unfolding the definitions of
AND, ZEROP, NOT, IMPLIES, NUMBERP, and REMAINDER, to eight new conjectures:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.8.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)),
which again simplifies, unfolding the function LESSP, to:
T.
Case 1.8.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL X 0))
(NOT (LESSP Y X))
(NOT (LESSP X X))
(NOT (EQUAL (REMAINDER (DIFFERENCE X X)
(DIFFERENCE Y X))
0))
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP X Y))
(NOT (LESSP X X)))
(EQUAL (LESSP (DIFFERENCE X X) Y) T)),
which again simplifies, applying DIFFERENCE-X-X and DIFFERENCE-LEQ-ARG1,
and opening up the definitions of REMAINDER and EQUAL, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER (DIFFERENCE X Y)
(DIFFERENCE Y Y))
0))
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Y) F)).
However this again simplifies, rewriting with DIFFERENCE-X-X,
REMAINDER-ZERO, EQUAL-DIFFERENCE-0, and REMAINDER-NOOP, and expanding
ZEROP and REMAINDER, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)).
But this again simplifies, using linear arithmetic, to two new conjectures:
Case 1.6.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)),
which again simplifies, expanding LESSP, to:
T.
Case 1.6.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL X 0))
(NOT (LESSP Y X))
(NOT (LESSP X X))
(NOT (EQUAL (REMAINDER X (DIFFERENCE Y X))
0))
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP X Y))
(NOT (LESSP X X)))
(EQUAL (LESSP (DIFFERENCE X X) Y) T)),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, REMAINDER-ZERO, REMAINDER-NOOP, and DIFFERENCE-X-X,
and expanding the functions ZEROP, NUMBERP, REMAINDER, EQUAL, and LESSP,
to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER Y (DIFFERENCE Z Y))
0))
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP X Y))
(NOT (EQUAL (REMAINDER Y (DIFFERENCE Y Y))
0))
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Y) F)).
However this again simplifies, rewriting with DIFFERENCE-X-X,
REMAINDER-ZERO, REMAINDER-NOOP, and EQUAL-DIFFERENCE-0, and expanding
ZEROP and REMAINDER, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(LESSP Y (DIFFERENCE X Y))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(LESSP Y (DIFFERENCE X Y))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP X Y))
(LESSP Y (DIFFERENCE X Y))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Y Y))
F)
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Y) F)).
This again simplifies, rewriting with DIFFERENCE-X-X, REMAINDER-NOOP, and
EQUAL-DIFFERENCE-0, and expanding the definitions of EQUAL, LESSP, and
REMAINDER, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Z))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)).
But this again simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Z))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y X)))
(EQUAL (LESSP (DIFFERENCE X Y) Z) T)),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL X 0))
(NOT (LESSP Y X))
(NOT (LESSP X X))
(NOT (LESSP X Y))
(EQUAL (LESSP (DIFFERENCE X (PLUS X X))
(DIFFERENCE Y X))
F)
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP X X)))
(EQUAL (LESSP (DIFFERENCE X X) Y) T)),
which again simplifies, using linear arithmetic, rewriting with the
lemmas DIFFERENCE-LEQ-ARG1, REMAINDER-NOOP, and DIFFERENCE-X-X, and
unfolding the definitions of LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Z))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Z Y))
F)
(EQUAL (REMAINDER X Z) 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Z) F)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP X Y))
(NOT (LESSP Y Y))
(EQUAL (LESSP (DIFFERENCE X (PLUS Y Y))
(DIFFERENCE Y Y))
F)
(EQUAL (REMAINDER X Y) 0)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP Y X))
(EQUAL (LESSP (DIFFERENCE X Y) Y) F)).
This again simplifies, appealing to the lemmas DIFFERENCE-X-X,
REMAINDER-NOOP, and EQUAL-DIFFERENCE-0, and unfolding the functions EQUAL,
LESSP, and REMAINDER, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which is formula *1 above. Let us appeal to the induction principle. The
recursive terms in the conjecture suggest six inductions. They merge into two
likely candidate inductions. However, only one is unflawed. We will induct
according to the following scheme:
(AND (IMPLIES (OR (EQUAL D 0) (NOT (NUMBERP D)))
(p W Z D))
(IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p W Z D))
(IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p (SUB1 W) Z (SUB1 D)))
(p W Z D))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT D) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for W. The above induction scheme
generates six new goals:
Case 6. (IMPLIES (AND (OR (EQUAL D 0) (NOT (NUMBERP D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, expanding the functions NOT and OR, to:
T.
Case 5. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, opening up NOT, OR, EQUAL, and NUMBERP, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(EQUAL (SUB1 D) 0)
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 D)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 2)))
(NUMBERP 2)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL 2 0))
(LESSP 1 2)
(LESSP 2 W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES 2 Z))
Z))).
This again simplifies, rewriting with the lemma TIMES-1-ARG1, and unfolding
the functions EQUAL, NUMBERP, NOT, OR, SUB1, LESSP, and TIMES, to two new
formulas:
Case 3.2.
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 2 W)
(NOT (EQUAL W 0)))
(NOT (LESSP (DIFFERENCE (PLUS Z (TIMES (SUB1 W) Z))
(PLUS Z Z))
Z))),
which again simplifies, appealing to the lemma
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and unfolding the function FIX, to:
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 2 W)
(NOT (EQUAL W 0)))
(NOT (LESSP (DIFFERENCE (TIMES (SUB1 W) Z) Z)
Z))).
But this further simplifies, applying COMMUTATIVITY-OF-TIMES, to:
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 2 W)
(NOT (EQUAL W 0)))
(NOT (LESSP (DIFFERENCE (TIMES Z (SUB1 W)) Z)
Z))).
Applying the lemma SUB1-ELIM, replace W by (ADD1 X) to eliminate (SUB1 W).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We thus obtain:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 2 (ADD1 X))
(NOT (EQUAL (ADD1 X) 0)))
(NOT (LESSP (DIFFERENCE (TIMES Z X) Z)
Z))),
which further simplifies, applying SUB1-ADD1 and COMMUTATIVITY-OF-TIMES,
and expanding the functions SUB1, NUMBERP, EQUAL, and LESSP, to the new
goal:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))),
which we will finally name *1.1.
Case 3.1.
(IMPLIES (AND (NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 2 W)
(EQUAL W 0))
(NOT (LESSP (DIFFERENCE 0 (PLUS Z Z)) Z))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (SUB1 D) (SUB1 W)))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL D 0) (NOT (NUMBERP D))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (DIFFERENCE (TIMES (SUB1 W) Z)
(TIMES (SUB1 D) Z))
Z))
(NUMBERP D)
(NUMBERP W)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(NOT (EQUAL D 0))
(LESSP 1 D)
(LESSP D W))
(NOT (LESSP (DIFFERENCE (TIMES W Z) (TIMES D Z))
Z))),
which simplifies, applying EQUAL-SUB1-0 and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and expanding the definitions of NOT,
OR, EQUAL, NUMBERP, LESSP, SUB1, TIMES, and FIX, to:
T.
So let us turn our attention to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))),
which we named *1.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 (OR (EQUAL X 0) (NOT (NUMBERP X)))
(p X Z))
(IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p X Z))
(IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(p (SUB1 X) Z))
(p X Z))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL X 0) (NOT (NUMBERP X)))
(NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))).
This simplifies, opening up the functions NOT, OR, NUMBERP, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(OR (EQUAL 1 0) (NOT (NUMBERP 1)))
(NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))).
This simplifies, expanding NOT, OR, EQUAL, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 X)))
(NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))).
This simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP 1 (SUB1 2)))
(NUMBERP 2)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 2))
(NOT (LESSP (DIFFERENCE (TIMES 2 Z) Z)
Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL 1 0) (NOT (NUMBERP 1))))
(NOT (LESSP (DIFFERENCE (TIMES (SUB1 X) Z) Z)
Z))
(NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL Z 0))
(LESSP 1 X))
(NOT (LESSP (DIFFERENCE (TIMES X Z) Z)
Z))),
which simplifies, using linear arithmetic, rewriting with EQUAL-SUB1-0,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and LESSP-TIMES2, and expanding NOT,
OR, EQUAL, NUMBERP, LESSP, SUB1, TIMES, and FIX, to:
T.
That finishes the proof of *1.1, which also finishes the proof of *1.
Q.E.D.
[ 0.0 0.4 0.1 ]
LESSP-DIFFERENCE-SPECIAL
(PROVE-LEMMA OCCURRENCES-APPEND
(REWRITE)
(EQUAL (OCCURRENCES A (APPEND X Y))
(PLUS (OCCURRENCES A X)
(OCCURRENCES A Y))))
Call the conjecture *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 X) (p A (CDR X) Y))
(p A X Y))
(IMPLIES (NOT (LISTP X)) (p A X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates two new goals:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (OCCURRENCES A (APPEND (CDR X) Y))
(PLUS (OCCURRENCES A (CDR X))
(OCCURRENCES A Y))))
(EQUAL (OCCURRENCES A (APPEND X Y))
(PLUS (OCCURRENCES A X)
(OCCURRENCES A Y)))),
which simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS, CDR-CONS,
and CAR-CONS, and unfolding APPEND and OCCURRENCES, to two new formulas:
Case 2.2.
(IMPLIES (AND (LISTP X)
(EQUAL (OCCURRENCES A (APPEND (CDR X) Y))
(PLUS (OCCURRENCES A Y)
(OCCURRENCES A (CDR X))))
(NOT (EQUAL A (CAR X))))
(EQUAL (OCCURRENCES A (APPEND (CDR X) Y))
(PLUS (OCCURRENCES A Y)
(OCCURRENCES A (CDR X))))),
which again simplifies, clearly, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(EQUAL (OCCURRENCES A (APPEND (CDR X) Y))
(PLUS (OCCURRENCES A Y)
(OCCURRENCES A (CDR X))))
(EQUAL A (CAR X)))
(EQUAL (ADD1 (OCCURRENCES A (APPEND (CDR X) Y)))
(PLUS (OCCURRENCES A Y)
(ADD1 (OCCURRENCES A (CDR X)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (OCCURRENCES A (APPEND X Y))
(PLUS (OCCURRENCES A X)
(OCCURRENCES A Y)))),
which simplifies, opening up the definitions of APPEND, OCCURRENCES, EQUAL,
and PLUS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-APPEND
(PROVE-LEMMA OCCURRENCES-REPEAT-LIST
(REWRITE)
(EQUAL (OCCURRENCES V (REPEAT-LIST LIST N))
(TIMES N (OCCURRENCES V LIST))))
Call the conjecture *1.
Perhaps we can prove it by induction. Three inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (ZEROP N) (p V LIST N))
(IMPLIES (AND (NOT (ZEROP N))
(p V LIST (SUB1 N)))
(p V LIST N))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP 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 two new goals:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (OCCURRENCES V (REPEAT-LIST LIST N))
(TIMES N (OCCURRENCES V LIST)))),
which simplifies, opening up the definitions of ZEROP, EQUAL, REPEAT-LIST,
LISTP, OCCURRENCES, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (OCCURRENCES V
(REPEAT-LIST LIST (SUB1 N)))
(TIMES (SUB1 N)
(OCCURRENCES V LIST))))
(EQUAL (OCCURRENCES V (REPEAT-LIST LIST N))
(TIMES N (OCCURRENCES V LIST)))),
which simplifies, applying OCCURRENCES-APPEND, and unfolding ZEROP,
REPEAT-LIST, and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-REPEAT-LIST
(PROVE-LEMMA OCCURRENCES-MAKE-LENGTH
(REWRITE)
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(IF (LESSP SIZE (LENGTH LIST))
(OCCURRENCES V (FIRSTN SIZE LIST))
(IF (EQUAL V FILL)
(PLUS (OCCURRENCES V LIST)
(DIFFERENCE SIZE (LENGTH LIST)))
(OCCURRENCES V LIST))))
((EXPAND (MAKE-LENGTH 1 LIST FILL))))
This simplifies, applying COMMUTATIVITY-OF-PLUS, PLUS-ZERO-ARG2, and
PLUS-DIFFERENCE-ARG2, and unfolding ZEROP, to the following four new goals:
Case 4. (IMPLIES (AND (NOT (LESSP SIZE (LENGTH LIST)))
(EQUAL V FILL)
(NOT (LESSP (LENGTH LIST) SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(OCCURRENCES FILL LIST))).
However this again simplifies, using linear arithmetic, to two new formulas:
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP SIZE))
(NOT (LESSP SIZE (LENGTH LIST)))
(NOT (LESSP (LENGTH LIST) SIZE)))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH SIZE LIST FILL))
(OCCURRENCES FILL LIST))),
which again simplifies, applying EQUAL-LENGTH-0, and expanding LESSP,
LENGTH, MAKE-LENGTH, LISTP, OCCURRENCES, and EQUAL, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP SIZE)
(NOT (LESSP (LENGTH LIST) (LENGTH LIST)))
(NOT (LESSP (LENGTH LIST) (LENGTH LIST))))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (LENGTH LIST) LIST FILL))
(OCCURRENCES FILL LIST))).
This again simplifies, trivially, to the new conjecture:
(IMPLIES (AND (NUMBERP SIZE)
(NOT (LESSP (LENGTH LIST) (LENGTH LIST))))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (LENGTH LIST) LIST FILL))
(OCCURRENCES FILL LIST))),
which we will name *1.
Case 3. (IMPLIES (AND (NOT (LESSP SIZE (LENGTH LIST)))
(EQUAL V FILL)
(LESSP (LENGTH LIST) SIZE))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(DIFFERENCE (PLUS SIZE (OCCURRENCES FILL LIST))
(LENGTH LIST)))).
This again simplifies, clearly, to the new conjecture:
(IMPLIES (AND (NOT (LESSP SIZE (LENGTH LIST)))
(LESSP (LENGTH LIST) SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH SIZE LIST FILL))
(DIFFERENCE (PLUS SIZE (OCCURRENCES FILL LIST))
(LENGTH LIST)))),
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 (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(COND ((LESSP SIZE (LENGTH LIST))
(OCCURRENCES V (FIRSTN SIZE LIST)))
((EQUAL V FILL)
(PLUS (OCCURRENCES V LIST)
(DIFFERENCE SIZE (LENGTH LIST))))
(T (OCCURRENCES V LIST)))),
named *1. Let us appeal to the induction principle. There are eight
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP SIZE)
(p V SIZE LIST FILL))
(IMPLIES (AND (NOT (ZEROP SIZE))
(LISTP LIST)
(p V (SUB1 SIZE) (CDR LIST) FILL))
(p V SIZE LIST FILL))
(IMPLIES (AND (NOT (ZEROP SIZE))
(NOT (LISTP LIST))
(p V (SUB1 SIZE) NIL FILL))
(p V SIZE LIST FILL))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT SIZE) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for LIST. The above induction scheme
produces three new formulas:
Case 3. (IMPLIES (ZEROP SIZE)
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(COND ((LESSP SIZE (LENGTH LIST))
(OCCURRENCES V (FIRSTN SIZE LIST)))
((EQUAL V FILL)
(PLUS (OCCURRENCES V LIST)
(DIFFERENCE SIZE (LENGTH LIST))))
(T (OCCURRENCES V LIST))))),
which simplifies, using linear arithmetic, applying the lemmas
DIFFERENCE-LEQ-ARG1 and PLUS-ZERO-ARG2, and opening up the definitions of
ZEROP, EQUAL, MAKE-LENGTH, LISTP, OCCURRENCES, LENGTH, LESSP, and FIRSTN, to
eight new formulas:
Case 3.8.
(IMPLIES (AND (EQUAL SIZE 0)
(NOT (LISTP LIST))
(EQUAL V FILL))
(EQUAL 0 (OCCURRENCES FILL LIST))),
which again simplifies, expanding the functions OCCURRENCES and EQUAL, to:
T.
Case 3.7.
(IMPLIES (AND (EQUAL SIZE 0)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V FILL))
(EQUAL 0 (OCCURRENCES FILL LIST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (EQUAL SIZE 0)
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V FILL))
(EQUAL V (CAR LIST)))
(EQUAL 0
(ADD1 (OCCURRENCES V (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.5.
(IMPLIES (AND (EQUAL SIZE 0)
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V FILL))
(NOT (EQUAL V (CAR LIST))))
(EQUAL 0 (OCCURRENCES V (CDR LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (NUMBERP SIZE))
(NOT (LISTP LIST))
(EQUAL V FILL))
(EQUAL 0 (OCCURRENCES FILL LIST))),
which again simplifies, expanding the functions OCCURRENCES and EQUAL, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP SIZE))
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V FILL))
(EQUAL 0 (OCCURRENCES FILL LIST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP SIZE))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V FILL))
(EQUAL V (CAR LIST)))
(EQUAL 0
(ADD1 (OCCURRENCES V (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP SIZE))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V FILL))
(NOT (EQUAL V (CAR LIST))))
(EQUAL 0 (OCCURRENCES V (CDR LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES
(AND (NOT (ZEROP SIZE))
(LISTP LIST)
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(COND ((LESSP (SUB1 SIZE)
(LENGTH (CDR LIST)))
(OCCURRENCES V
(FIRSTN (SUB1 SIZE) (CDR LIST))))
((EQUAL V FILL)
(PLUS (OCCURRENCES V (CDR LIST))
(DIFFERENCE (SUB1 SIZE)
(LENGTH (CDR LIST)))))
(T (OCCURRENCES V (CDR LIST))))))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(COND ((LESSP SIZE (LENGTH LIST))
(OCCURRENCES V (FIRSTN SIZE LIST)))
((EQUAL V FILL)
(PLUS (OCCURRENCES V LIST)
(DIFFERENCE SIZE (LENGTH LIST))))
(T (OCCURRENCES V LIST))))),
which simplifies, rewriting with COMMUTATIVITY-OF-PLUS, PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, CDR-CONS, CAR-CONS, SUB1-ADD1, and
DIFFERENCE-ADD1-ARG2, and unfolding ZEROP, MAKE-LENGTH, OCCURRENCES, LENGTH,
LESSP, and FIRSTN, to the following 12 new goals:
Case 2.12.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(EQUAL FILL (CAR LIST))
(LESSP (LENGTH (CDR LIST)) SIZE)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V (CDR LIST))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES FILL (CDR LIST)))))).
This again simplifies, trivially, to:
T.
Case 2.11.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(EQUAL FILL (CAR LIST))
(LESSP (LENGTH (CDR LIST)) SIZE)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES FILL (CDR LIST)))))).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP SIZE (LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES (CAR LIST)
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
(CAR LIST)))
(OCCURRENCES (CAR LIST) (CDR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE)
(EQUAL (CAR LIST) (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST)))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.10.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(EQUAL FILL (CAR LIST))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V (CDR LIST))
(PLUS 0
(ADD1 (OCCURRENCES FILL (CDR LIST)))))),
which again simplifies, trivially, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(EQUAL FILL (CAR LIST))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(PLUS 0
(ADD1 (OCCURRENCES FILL (CDR LIST)))))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V (CDR LIST))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP SIZE (LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES FILL (CDR LIST)))
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE)
(NOT (EQUAL FILL (CAR LIST))))
(EQUAL (OCCURRENCES FILL (CDR LIST))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, obviously, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(NOT (EQUAL FILL (CAR LIST)))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V (CDR LIST))
(PLUS 0
(OCCURRENCES FILL (CDR LIST))))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 SIZE)))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(OCCURRENCES V (CDR LIST)))
(EQUAL V FILL)
(NOT (EQUAL FILL (CAR LIST)))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(PLUS 0
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, trivially, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(EQUAL V FILL)
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES V (CDR LIST)))
(LENGTH (CDR LIST))))
(NOT (EQUAL FILL (CAR LIST)))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE)))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(PLUS 0
(OCCURRENCES FILL (CDR LIST))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(EQUAL V FILL)
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES V (CDR LIST)))
(LENGTH (CDR LIST))))
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 2.3.2.
(IMPLIES
(AND (LESSP (PLUS (SUB1 SIZE)
(OCCURRENCES FILL (CDR LIST)))
(LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES FILL (CDR LIST)))
(LENGTH (CDR LIST))))
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.1.
(IMPLIES
(AND (LESSP SIZE (LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES FILL (CDR LIST)))
(LENGTH (CDR LIST))))
(NOT (EQUAL FILL (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(OCCURRENCES FILL (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(EQUAL V FILL)
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES V (CDR LIST)))
(LENGTH (CDR LIST))))
(EQUAL FILL (CAR LIST))
(NOT (LESSP (LENGTH (CDR LIST)) SIZE)))
(EQUAL (ADD1 (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL)))
(PLUS 0
(ADD1 (OCCURRENCES FILL (CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(EQUAL V FILL)
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES V (CDR LIST)))
(LENGTH (CDR LIST))))
(EQUAL FILL (CAR LIST))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (ADD1 (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
FILL)))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES FILL (CDR LIST)))))),
which again simplifies, using linear arithmetic, to two new goals:
Case 2.1.2.
(IMPLIES
(AND (LESSP (PLUS (SUB1 SIZE)
(OCCURRENCES (CAR LIST) (CDR LIST)))
(LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES (CAR LIST)
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
(CAR LIST)))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES (CAR LIST) (CDR LIST)))
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
(CAR LIST))))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.1.
(IMPLIES
(AND (LESSP SIZE (LENGTH (CDR LIST)))
(NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(LISTP LIST)
(NOT (LESSP (SUB1 SIZE)
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST))
(SUB1 SIZE))
(EQUAL (OCCURRENCES (CAR LIST)
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
(CAR LIST)))
(DIFFERENCE (PLUS (SUB1 SIZE)
(OCCURRENCES (CAR LIST) (CDR LIST)))
(LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) SIZE))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(MAKE-LENGTH (SUB1 SIZE)
(CDR LIST)
(CAR LIST))))
(PLUS (SUB1 (DIFFERENCE SIZE (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP SIZE))
(NOT (LISTP LIST))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(COND ((LESSP (SUB1 SIZE) (LENGTH NIL))
(OCCURRENCES V
(FIRSTN (SUB1 SIZE) NIL)))
((EQUAL V FILL)
(PLUS (OCCURRENCES V NIL)
(DIFFERENCE (SUB1 SIZE)
(LENGTH NIL))))
(T (OCCURRENCES V NIL)))))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH SIZE LIST FILL))
(COND ((LESSP SIZE (LENGTH LIST))
(OCCURRENCES V (FIRSTN SIZE LIST)))
((EQUAL V FILL)
(PLUS (OCCURRENCES V LIST)
(DIFFERENCE SIZE (LENGTH LIST))))
(T (OCCURRENCES V LIST))))),
which simplifies, rewriting with EQUAL-LENGTH-0, EQUAL-SUB1-0,
PLUS-ZERO-ARG2, MEMBER-NON-LIST, EQUAL-OCCURRENCES-ZERO,
COMMUTATIVITY-OF-PLUS, PLUS-DIFFERENCE-ARG2, CDR-CONS, and CAR-CONS, and
opening up the functions ZEROP, LISTP, LESSP, DIFFERENCE, MAKE-LENGTH,
OCCURRENCES, LENGTH, EQUAL, PLUS, NUMBERP, SUB1, and ADD1, to the following
four new conjectures:
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(NOT (LESSP (SUB1 SIZE) (LENGTH NIL)))
(EQUAL V FILL)
(NOT (EQUAL SIZE 1))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(SUB1 SIZE)))
(EQUAL (ADD1 (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE) NIL FILL)))
SIZE)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(NOT (LESSP (SUB1 SIZE) (LENGTH NIL)))
(EQUAL SIZE 1)
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(OCCURRENCES V NIL))
(NOT (EQUAL V FILL)))
(EQUAL (OCCURRENCES V NIL) 0)),
which again simplifies, applying EQUAL-LENGTH-0, MEMBER-NON-LIST, and
EQUAL-OCCURRENCES-ZERO, and opening up the functions EQUAL, NUMBERP, SUB1,
LISTP, LESSP, MAKE-LENGTH, and OCCURRENCES, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(LESSP (SUB1 SIZE) (LENGTH NIL))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(OCCURRENCES V
(FIRSTN (SUB1 SIZE) NIL)))
(NOT (EQUAL V FILL)))
(EQUAL (OCCURRENCES V
(FIRSTN (SUB1 SIZE) NIL))
0)).
But this again simplifies, applying the lemma EQUAL-OCCURRENCES-ZERO, to:
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(LESSP (SUB1 SIZE) (LENGTH NIL))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(OCCURRENCES V
(FIRSTN (SUB1 SIZE) NIL)))
(NOT (EQUAL V FILL)))
(NOT (MEMBER V (FIRSTN (SUB1 SIZE) NIL)))).
However this further simplifies, expanding the definitions of LENGTH,
EQUAL, and LESSP, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(LESSP (SUB1 SIZE) (LENGTH NIL))
(EQUAL (OCCURRENCES V
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(OCCURRENCES V
(FIRSTN (SUB1 SIZE) NIL)))
(EQUAL V FILL))
(EQUAL (ADD1 (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE) NIL FILL)))
SIZE)),
which again simplifies, trivially, to the new goal:
(IMPLIES (AND (NOT (EQUAL SIZE 0))
(NUMBERP SIZE)
(NOT (LISTP LIST))
(LESSP (SUB1 SIZE) (LENGTH NIL))
(EQUAL (OCCURRENCES FILL
(MAKE-LENGTH (SUB1 SIZE) NIL FILL))
(OCCURRENCES FILL
(FIRSTN (SUB1 SIZE) NIL))))
(EQUAL (ADD1 (OCCURRENCES FILL
(FIRSTN (SUB1 SIZE) NIL)))
SIZE)),
which further simplifies, expanding the functions LENGTH, EQUAL, and LESSP,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.1 ]
OCCURRENCES-MAKE-LENGTH
(PROVE-LEMMA OCCURRENCES-REPEAT
(REWRITE)
(EQUAL (OCCURRENCES X (REPEAT N Y))
(IF (EQUAL X Y) (FIX N) 0)))
This formula simplifies, expanding FIX, to three new conjectures:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (OCCURRENCES X (REPEAT N Y))
0)),
which again simplifies, expanding the definitions of REPEAT, LISTP,
OCCURRENCES, and EQUAL, to:
T.
Case 2. (IMPLIES (NOT (EQUAL X Y))
(EQUAL (OCCURRENCES X (REPEAT N Y))
0)),
which again simplifies, applying the lemma EQUAL-OCCURRENCES-ZERO, to the
goal:
(IMPLIES (NOT (EQUAL X Y))
(NOT (MEMBER X (REPEAT N Y)))).
Name the above subgoal *1.
Case 1. (IMPLIES (AND (EQUAL X Y) (NUMBERP N))
(EQUAL (OCCURRENCES X (REPEAT N Y))
N)).
This again simplifies, clearly, to the new conjecture:
(IMPLIES (NUMBERP N)
(EQUAL (OCCURRENCES Y (REPEAT N Y))
N)),
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 (OCCURRENCES X (REPEAT N Y))
(IF (EQUAL X Y) (FIX N) 0)),
named *1. Let us appeal to the induction principle. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p X N Y))
(IMPLIES (AND (NOT (ZEROP N)) (p X (SUB1 N) Y))
(p X N Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP 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 generates the following two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (OCCURRENCES X (REPEAT N Y))
(IF (EQUAL X Y) (FIX N) 0))).
This simplifies, expanding the definitions of ZEROP, EQUAL, REPEAT, LISTP,
OCCURRENCES, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (OCCURRENCES X (REPEAT (SUB1 N) Y))
(IF (EQUAL X Y) (FIX (SUB1 N)) 0)))
(EQUAL (OCCURRENCES X (REPEAT N Y))
(IF (EQUAL X Y) (FIX N) 0))).
This simplifies, applying CDR-CONS and CAR-CONS, and expanding the
definitions of ZEROP, FIX, REPEAT, OCCURRENCES, and EQUAL, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL X Y)
(EQUAL (OCCURRENCES X (REPEAT (SUB1 N) Y))
(SUB1 N)))
(EQUAL (ADD1 (OCCURRENCES X (REPEAT (SUB1 N) X)))
N)).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-REPEAT
(PROVE-LEMMA MEMBER-REPEAT
(REWRITE)
(EQUAL (MEMBER X (REPEAT N V))
(AND (LESSP 0 N) (EQUAL X V))))
This formula simplifies, expanding EQUAL, LESSP, and AND, to three new
conjectures:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (MEMBER X (REPEAT N V)) F)),
which again simplifies, applying MEMBER-NON-LIST, and expanding the
functions REPEAT and EQUAL, to:
T.
Case 2. (IMPLIES (EQUAL N 0)
(EQUAL (MEMBER X (REPEAT N V)) F)).
But this again simplifies, rewriting with the lemma MEMBER-NON-LIST, and
opening up the definitions of EQUAL and REPEAT, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (MEMBER X (REPEAT N V))
(EQUAL X V))),
which again simplifies, obviously, to the following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X V)))
(NOT (MEMBER X (REPEAT N V)))).
Call the above conjecture *1.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL X V))
(EQUAL (MEMBER X (REPEAT N V)) T)).
This again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(MEMBER V (REPEAT N V))),
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 (MEMBER X (REPEAT N V))
(AND (LESSP 0 N) (EQUAL X V))),
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 (ZEROP N) (p X N V))
(IMPLIES (AND (NOT (ZEROP N)) (p X (SUB1 N) V))
(p X N V))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP 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 generates the following two new conjectures:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (MEMBER X (REPEAT N V))
(AND (LESSP 0 N) (EQUAL X V)))).
This simplifies, applying MEMBER-NON-LIST, and expanding the definitions of
ZEROP, EQUAL, REPEAT, LESSP, and AND, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (MEMBER X (REPEAT (SUB1 N) V))
(AND (LESSP 0 (SUB1 N)) (EQUAL X V))))
(EQUAL (MEMBER X (REPEAT N V))
(AND (LESSP 0 N) (EQUAL X V)))),
which simplifies, applying CDR-CONS and CAR-CONS, and opening up the
functions ZEROP, AND, REPEAT, MEMBER, LESSP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-REPEAT
(PROVE-LEMMA MEMBER-SUBSTRING-SCHEDULE
(REWRITE)
(IMPLIES (AND (PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL V NIL)))
(IFF (MEMBER V (SUBSTRING-SCHEDULE Z BIGP))
(ASSOC V Z)))
((INDUCT (ASSOC V Z))))
This conjecture can be simplified, using the abbreviations IMPLIES, NLISTP,
NOT, OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (NOT (LISTP Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL V NIL)))
(IFF (MEMBER V (SUBSTRING-SCHEDULE Z BIGP))
(ASSOC V Z))),
which simplifies, applying the lemma MEMBER-NON-LIST, and opening up
PERIODIC-TASKSP, LISTP, EXPANDED-TASKSP, SUBSTRING-SCHEDULE, ASSOC, and IFF,
to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(EQUAL V (CAAR Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL V NIL)))
(IFF (MEMBER V (SUBSTRING-SCHEDULE Z BIGP))
(ASSOC V Z))),
which simplifies, expanding the definitions of ASSOC and IFF, to two new
conjectures:
Case 2.2.
(IMPLIES (AND (LISTP Z)
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL (CAAR Z) NIL))
(NOT (MEMBER (CAAR Z)
(SUBSTRING-SCHEDULE Z BIGP))))
(NOT (CAR Z))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS X W) to eliminate
(CAR Z) and (CDR Z) and X by (CONS D C) to eliminate (CAR X) and (CDR X).
We thus obtain the following two new conjectures:
Case 2.2.2.
(IMPLIES (AND (NOT (LISTP X))
(PERIODIC-TASKSP (CONS X W))
(EXPANDED-TASKSP (CONS X W) BIGP)
(NOT (EQUAL (CAR X) NIL))
(NOT (MEMBER (CAR X)
(SUBSTRING-SCHEDULE (CONS X W)
BIGP))))
(NOT X)).
However this further simplifies, applying CAR-CONS, and expanding the
definitions of PERIODIC-TASKP and PERIODIC-TASKSP, to:
T.
Case 2.2.1.
(IMPLIES (AND (PERIODIC-TASKSP (CONS (CONS D C) W))
(EXPANDED-TASKSP (CONS (CONS D C) W)
BIGP)
(NOT (EQUAL D NIL)))
(MEMBER D
(SUBSTRING-SCHEDULE (CONS (CONS D C) W)
BIGP))).
However this further simplifies, applying CDR-CONS, CAR-CONS,
EQUAL-QUOTIENT-0, MEMBER-REPEAT, and MEMBER-APPEND, and unfolding
PERIODIC-TASKP, TK-NAME, UNPACK, TK-PERIOD, EQUAL, LESSP, TK-DURATION,
PERIODIC-TASKSP, EXPANDED-TASKSP, and SUBSTRING-SCHEDULE, to the new
conjecture:
(IMPLIES (AND (LITATOM D)
(NOT (EQUAL (CAR C) 0))
(NUMBERP (CAR C))
(NOT (EQUAL (CADR C) 0))
(NUMBERP (CADR C))
(EQUAL NIL (CDDR C))
(NOT (ASSOC D W))
(PERIODIC-TASKSP W)
(EQUAL (REMAINDER (CAR C) BIGP) 0)
(EQUAL (REMAINDER (CADR C) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR C))
(CAR C))
0)
(EXPANDED-TASKSP W BIGP)
(NOT (EQUAL D NIL))
(LESSP (TIMES BIGP (CADR C)) (CAR C)))
(MEMBER D
(SUBSTRING-SCHEDULE W BIGP))),
which again simplifies, appealing to the lemmas REMAINDER-NOOP and
EQUAL-TIMES-0, and expanding the definitions of UNPACK, EQUAL, TIMES,
and LESSP, to two new conjectures:
Case 2.2.1.2.
(IMPLIES (AND (LITATOM D)
(NOT (EQUAL (CAR C) 0))
(NUMBERP (CAR C))
(NOT (EQUAL (CADR C) 0))
(NUMBERP (CADR C))
(EQUAL NIL (CDDR C))
(NOT (ASSOC D W))
(PERIODIC-TASKSP W)
(EQUAL (REMAINDER (CAR C) BIGP) 0)
(EQUAL (REMAINDER (CADR C) BIGP) 0)
(EQUAL BIGP 0)
(EXPANDED-TASKSP W 0)
(NOT (EQUAL D NIL)))
(MEMBER D (SUBSTRING-SCHEDULE W 0))),
which again simplifies, rewriting with REMAINDER-ZERO, and opening up
ZEROP, to:
T.
Case 2.2.1.1.
(IMPLIES (AND (LITATOM D)
(NOT (EQUAL (CAR C) 0))
(NUMBERP (CAR C))
(NOT (EQUAL (CADR C) 0))
(NUMBERP (CADR C))
(EQUAL NIL (CDDR C))
(NOT (ASSOC D W))
(PERIODIC-TASKSP W)
(EQUAL (REMAINDER (CAR C) BIGP) 0)
(EQUAL (REMAINDER (CADR C) BIGP) 0)
(NOT (NUMBERP BIGP))
(EXPANDED-TASKSP W BIGP)
(NOT (EQUAL D NIL)))
(MEMBER D
(SUBSTRING-SCHEDULE W BIGP))).
However this again simplifies, rewriting with the lemma REMAINDER-ZERO,
and expanding the function ZEROP, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP Z)
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL (CAAR Z) NIL))
(MEMBER (CAAR Z)
(SUBSTRING-SCHEDULE Z BIGP)))
(CAR Z)),
which again simplifies, opening up PERIODIC-TASKP and PERIODIC-TASKSP, to:
T.
Case 1. (IMPLIES (AND (LISTP Z)
(NOT (EQUAL V (CAAR Z)))
(IMPLIES (AND (PERIODIC-TASKSP (CDR Z))
(EXPANDED-TASKSP (CDR Z) BIGP)
(NOT (EQUAL V NIL)))
(IFF (MEMBER V
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(ASSOC V (CDR Z))))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP)
(NOT (EQUAL V NIL)))
(IFF (MEMBER V (SUBSTRING-SCHEDULE Z BIGP))
(ASSOC V Z))),
which simplifies, rewriting with the lemmas MEMBER-APPEND,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, BAGINT-SINGLETON, MEMBER-REPEAT,
and EQUAL-QUOTIENT-0, and unfolding the definitions of NOT, AND, IFF,
IMPLIES, PERIODIC-TASKP, TK-NAME, UNPACK, TK-PERIOD, EQUAL, LESSP,
TK-DURATION, PERIODIC-TASKSP, EXPANDED-TASKSP, SUBSTRING-SCHEDULE, and ASSOC,
to:
T.
Q.E.D.
[ 0.0 1.3 0.0 ]
MEMBER-SUBSTRING-SCHEDULE
(PROVE-LEMMA MEMBER-CAR-X-X
(REWRITE)
(EQUAL (MEMBER (CAR X) X) (LISTP X)))
This simplifies, unfolding MEMBER, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-CAR-X-X
(PROVE-LEMMA OCCURRENCES-SUBSTRING-SCHEDULE
(REWRITE)
(IMPLIES (AND (MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))))
This conjecture simplifies, expanding the definitions of EQUAL and LESSP, to:
(IMPLIES (AND (MEMBER TK PTS)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace TK by (CONS X Z) to
eliminate (CAR TK) and (CDR TK), 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). We must thus
prove four new goals:
Case 4. (IMPLIES (AND (NOT (LISTP TK))
(MEMBER TK PTS)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))),
which further simplifies, applying CAR-NLISTP, CDR-NLISTP,
COMMUTATIVITY-OF-TIMES, MEMBER-SUBSTRING-SCHEDULE, and
EQUAL-OCCURRENCES-ZERO, and unfolding the definitions of CDR, CAR, EQUAL,
TIMES, and QUOTIENT, to the new conjecture:
(IMPLIES (AND (NOT (LISTP TK))
(MEMBER TK PTS)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(NOT (ASSOC 0 PTS))),
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 (MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))),
named *1. Let us appeal to the induction principle. The recursive terms in
the conjecture suggest six inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (NLISTP PTS) (p TK PTS BIGP))
(IMPLIES (AND (NOT (NLISTP PTS))
(EQUAL TK (CAR PTS)))
(p TK PTS BIGP))
(IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(p TK (CDR PTS) BIGP))
(p TK PTS BIGP))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT PTS) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to six new conjectures:
Case 6. (IMPLIES (AND (NLISTP PTS)
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))),
which simplifies, applying the lemma MEMBER-NON-LIST, and expanding NLISTP,
to:
T.
Case 5. (IMPLIES (AND (NOT (NLISTP PTS))
(EQUAL TK (CAR PTS))
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))),
which simplifies, applying MEMBER-CAR-X-X, OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and opening up NLISTP, EQUAL, LESSP, PERIODIC-TASKSP,
TK-DURATION, TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP, EXPANDED-TASKSP,
SUBSTRING-SCHEDULE, and ZEROP, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(NOT (MEMBER TK (CDR PTS)))
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))).
This simplifies, expanding NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(NOT (PERIODIC-TASKSP (CDR PTS)))
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))).
This simplifies, unfolding NLISTP, MEMBER, EQUAL, LESSP, PERIODIC-TASKSP,
TK-DURATION, TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(NOT (EXPANDED-TASKSP (CDR PTS) BIGP))
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))).
This simplifies, opening up the definitions of NLISTP, MEMBER, EQUAL, LESSP,
PERIODIC-TASKSP, TK-DURATION, TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP,
and EXPANDED-TASKSP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP PTS))
(NOT (EQUAL TK (CAR PTS)))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE (CDR PTS) BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK PTS)
(LESSP 0 BIGP)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE PTS BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))).
This simplifies, rewriting with the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, OCCURRENCES-APPEND, and
CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and opening up NLISTP, MEMBER, EQUAL,
LESSP, PERIODIC-TASKSP, TK-DURATION, TK-PERIOD, UNPACK, TK-NAME,
PERIODIC-TASKP, EXPANDED-TASKSP, SUBSTRING-SCHEDULE, and FIX, to:
(IMPLIES (AND (LISTP PTS)
(NOT (EQUAL TK (CAR PTS)))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE (CDR PTS) BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK (CDR PTS))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER (CADAR PTS) BIGP) 0)
(EQUAL (REMAINDER (CADDAR PTS) BIGP)
0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
0)
(EXPANDED-TASKSP (CDR PTS) BIGP)
(EQUAL (CAR TK) (CAAR PTS)))
(EQUAL (QUOTIENT (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
0)),
which again simplifies, applying EQUAL-QUOTIENT-0, and opening up the
function UNPACK, to the new formula:
(IMPLIES (AND (LISTP PTS)
(NOT (EQUAL TK (CAR PTS)))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE (CDR PTS) BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK (CDR PTS))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LISTP (CAR PTS))
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAR TK) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER (CADAR PTS) BIGP) 0)
(EQUAL (REMAINDER (CADDAR PTS) BIGP)
0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
0)
(EXPANDED-TASKSP (CDR PTS) BIGP)
(EQUAL (CAR TK) (CAAR PTS)))
(LESSP (TIMES BIGP (CADDAR PTS))
(CADAR PTS))).
Applying the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, replace PTS by
(CONS X Z) to eliminate (CAR PTS) and (CDR PTS), X by (CONS W V) to
eliminate (CDR X) and (CAR X), V by (CONS X D) to eliminate (CAR V) and
(CDR V), D by (CONS V C) to eliminate (CAR D) and (CDR D), V by
(PLUS D (TIMES BIGP X1)) to eliminate (REMAINDER V BIGP) and
(QUOTIENT V BIGP), X by (PLUS V (TIMES BIGP Z1)) to eliminate
(REMAINDER X BIGP) and (QUOTIENT X BIGP), and X by (PLUS V (TIMES BIGP C))
to eliminate (REMAINDER X BIGP) and (QUOTIENT X BIGP). We rely upon
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. This produces the following three
new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL TK (CONS W V)))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL (CAR V) 0))
(NUMBERP (CAR V))
(NOT (EQUAL (CADR V) 0))
(NUMBERP (CADR V))
(EQUAL NIL (CDDR V))
(NOT (ASSOC (CAR TK) Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (CAR V) BIGP) 0)
(EQUAL (REMAINDER (CADR V) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR V))
(CAR V))
0)
(EXPANDED-TASKSP Z BIGP)
(EQUAL (CAR TK) W))
(LESSP (TIMES BIGP (CADR V))
(CAR V))).
But this further simplifies, rewriting with CAR-NLISTP, and unfolding the
definitions of UNPACK and EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP C)
(NOT (LISTP D))
(NOT (EQUAL TK
(CONS W
(CONS (PLUS V (TIMES BIGP C)) D))))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL (PLUS V (TIMES BIGP C)) 0))
(NOT (EQUAL (CAR D) 0))
(NUMBERP (CAR D))
(EQUAL NIL (CDR D))
(NOT (ASSOC (CAR TK) Z))
(PERIODIC-TASKSP Z)
(EQUAL V 0)
(EQUAL (REMAINDER (CAR D) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR D))
(PLUS V (TIMES BIGP C)))
0)
(EXPANDED-TASKSP Z BIGP)
(EQUAL (CAR TK) W))
(LESSP (TIMES BIGP (CAR D))
(PLUS V (TIMES BIGP C)))).
But this further simplifies, rewriting with the lemmas EQUAL-TIMES-0 and
CAR-NLISTP, and unfolding the definitions of NUMBERP, EQUAL, LESSP, ZEROP,
NOT, PLUS, and UNPACK, to:
T.
Case 1.1.
(IMPLIES
(AND (NUMBERP V)
(EQUAL (LESSP V BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP Z1)
(NUMBERP D)
(EQUAL (LESSP D BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X1)
(NOT (EQUAL TK
(CONS W
(CONS (PLUS V (TIMES BIGP Z1))
(CONS (PLUS D (TIMES BIGP X1)) C)))))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL (PLUS V (TIMES BIGP Z1)) 0))
(NOT (EQUAL (PLUS D (TIMES BIGP X1)) 0))
(EQUAL NIL C)
(NOT (ASSOC (CAR TK) Z))
(PERIODIC-TASKSP Z)
(EQUAL V 0)
(EQUAL D 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS D (TIMES BIGP X1)))
(PLUS V (TIMES BIGP Z1)))
0)
(EXPANDED-TASKSP Z BIGP)
(EQUAL (CAR TK) W))
(LESSP (TIMES BIGP (PLUS D (TIMES BIGP X1)))
(PLUS V (TIMES BIGP Z1)))),
which further simplifies, applying EQUAL-TIMES-0,
REMAINDER-TIMES2-INSTANCE, and CORRECTNESS-OF-CANCEL-LESSP-TIMES, and
expanding NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, UNPACK, FIX, and AND,
to the new formula:
(IMPLIES (AND (NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL TK
(LIST (CAR TK)
(TIMES BIGP Z1)
(TIMES BIGP X1))))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC (CAR TK) Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
Applying the lemma CAR-CDR-ELIM, replace TK by (CONS X V) to eliminate
(CAR TK) and (CDR TK), V by (CONS D W) to eliminate (CDR V) and (CAR V),
and W by (CONS V C) to eliminate (CAR W) and (CDR W). We thus obtain the
following four new formulas:
Case 1.1.4.
(IMPLIES (AND (NOT (LISTP TK))
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL TK
(LIST (CAR TK)
(TIMES BIGP Z1)
(TIMES BIGP X1))))
(EQUAL (OCCURRENCES (CAR TK)
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADDR TK))
(CADR TK)))
(MEMBER TK Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC (CAR TK) Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
This finally simplifies, applying the lemmas CAR-NLISTP, CDR-NLISTP,
COMMUTATIVITY-OF-TIMES, MEMBER-SUBSTRING-SCHEDULE, and
EQUAL-OCCURRENCES-ZERO, and expanding the definitions of CDR, CAR, EQUAL,
TIMES, QUOTIENT, and LITATOM, to:
T.
Case 1.1.3.
(IMPLIES (AND (NOT (LISTP V))
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL (CONS X V)
(LIST X
(TIMES BIGP Z1)
(TIMES BIGP X1))))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CADR V))
(CAR V)))
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)),
which further simplifies, rewriting with CAR-CONS, CDR-CONS, CDR-NLISTP,
COMMUTATIVITY-OF-TIMES, CAR-NLISTP, MEMBER-SUBSTRING-SCHEDULE, and
EQUAL-OCCURRENCES-ZERO, and unfolding CAR, EQUAL, TIMES, QUOTIENT, and
UNPACK, to:
(IMPLIES (AND (NOT (LISTP V))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)),
which we generalize by replacing (TIMES BIGP X1) by Y. We restrict the
new variable by recalling the type restriction lemma noted when TIMES
was introduced. This produces:
(IMPLIES (AND (NUMBERP Y)
(NOT (LISTP V))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER Y Z1) 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS W (TIMES Z1 D)) to eliminate (REMAINDER Y Z1) and (QUOTIENT Y Z1).
We use LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. We thus obtain:
(IMPLIES (AND (NUMBERP W)
(EQUAL (LESSP W Z1) (NOT (ZEROP Z1)))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL W 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (PLUS W (TIMES Z1 D)) Z1)),
which further simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
opening up the functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, UNPACK, and
PLUS, to:
(IMPLIES (AND (NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)),
which has two irrelevant terms in it. By eliminating these terms we get
the new goal:
(IMPLIES (AND (NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)),
which we will finally name *1.1.
Case 1.1.2.
(IMPLIES (AND (NOT (LISTP W))
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL (CONS X (CONS D W))
(LIST X
(TIMES BIGP Z1)
(TIMES BIGP X1))))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP (CAR W)) D))
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
This further simplifies, rewriting with CAR-CONS, CDR-CONS, CONS-EQUAL,
CAR-NLISTP, COMMUTATIVITY-OF-TIMES, MEMBER-SUBSTRING-SCHEDULE, and
EQUAL-OCCURRENCES-ZERO, and unfolding EQUAL, TIMES, LESSP, QUOTIENT, and
UNPACK, to:
(IMPLIES (AND (NOT (LISTP W))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)),
which we generalize by replacing (TIMES BIGP X1) by Y. We restrict the
new variable by recalling the type restriction lemma noted when TIMES
was introduced. We would thus like to prove:
(IMPLIES (AND (NUMBERP Y)
(NOT (LISTP W))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER Y Z1) 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS V (TIMES Z1 C)) to eliminate (REMAINDER Y Z1) and (QUOTIENT Y Z1).
We rely upon LESSP-REMAINDER, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to restrict the new variables. This produces:
(IMPLIES (AND (NUMBERP V)
(EQUAL (LESSP V Z1) (NOT (ZEROP Z1)))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL V 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (PLUS V (TIMES Z1 C)) Z1)),
which further simplifies, applying COMMUTATIVITY-OF-TIMES, and opening
up the definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT, UNPACK, and
PLUS, to the new formula:
(IMPLIES (AND (NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NUMBERP X1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)),
which has two irrelevant terms in it. By eliminating these terms we get:
(IMPLIES (AND (NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)),
which we will finally name *1.2.
Case 1.1.1.
(IMPLIES (AND (NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL (CONS X (CONS D (CONS V C)))
(LIST X
(TIMES BIGP Z1)
(TIMES BIGP X1))))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
But this further simplifies, applying the lemmas CAR-CONS, CDR-CONS, and
CONS-EQUAL, and expanding the function UNPACK, to three new goals:
Case 1.1.1.3.
(IMPLIES (AND (NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)),
which we generalize by replacing (TIMES BIGP X1) by Y. We restrict
the new variable by recalling the type restriction lemma noted when
TIMES was introduced. We thus obtain:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER Y Z1) 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS W (TIMES Z1 V1)) to eliminate (REMAINDER Y Z1) and
(QUOTIENT Y Z1). We employ LESSP-REMAINDER, the type restriction
lemma noted when REMAINDER was introduced, and the type restriction
lemma noted when QUOTIENT was introduced to restrict the new variables.
This produces:
(IMPLIES (AND (NUMBERP W)
(EQUAL (LESSP W Z1) (NOT (ZEROP Z1)))
(NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL W 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (PLUS W (TIMES Z1 V1)) Z1)),
which further simplifies, applying COMMUTATIVITY-OF-TIMES, and
expanding the functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, UNPACK, and
PLUS, to the new goal:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which has two irrelevant terms in it. By eliminating these terms we
get the new conjecture:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which we will finally name *1.3.
Case 1.1.1.2.
(IMPLIES (AND (NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL V (TIMES BIGP X1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
We will try to prove the above formula by generalizing it, replacing
(TIMES BIGP X1) by Y. We restrict the new variable by recalling the
type restriction lemma noted when TIMES was introduced. We thus
obtain the new formula:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER Y Z1) 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS W (TIMES Z1 V1)) to eliminate (REMAINDER Y Z1) and
(QUOTIENT Y Z1). We rely upon LESSP-REMAINDER, the type restriction
lemma noted when REMAINDER was introduced, and the type restriction
lemma noted when QUOTIENT was introduced to restrict the new variables.
We thus obtain:
(IMPLIES (AND (NUMBERP W)
(EQUAL (LESSP W Z1) (NOT (ZEROP Z1)))
(NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL V (PLUS W (TIMES Z1 V1))))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL W 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (PLUS W (TIMES Z1 V1)) Z1)),
which further simplifies, applying the lemma COMMUTATIVITY-OF-TIMES,
and expanding the definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT,
PLUS, and UNPACK, to:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL V (TIMES V1 Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
We will try to prove the above formula by generalizing it, replacing
(TIMES V1 Z1) by Y. We restrict the new variable by recalling the
type restriction lemma noted when TIMES was introduced. We would thus
like to prove the new goal:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which has three irrelevant terms in it. By eliminating these terms we
get:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which we will finally name *1.4.
Case 1.1.1.1.
(IMPLIES (AND (NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER (TIMES BIGP X1) Z1)
0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES BIGP X1) Z1)).
We will try to prove the above formula by generalizing it, replacing
(TIMES BIGP X1) by Y. We restrict the new variable by recalling the
type restriction lemma noted when TIMES was introduced. We thus
obtain:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL (REMAINDER Y Z1) 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace Y by
(PLUS W (TIMES Z1 V1)) to eliminate (REMAINDER Y Z1) and
(QUOTIENT Y Z1). We use LESSP-REMAINDER, the type restriction lemma
noted when REMAINDER was introduced, and the type restriction lemma
noted when QUOTIENT was introduced to restrict the new variables.
This produces:
(IMPLIES (AND (NUMBERP W)
(EQUAL (LESSP W Z1) (NOT (ZEROP Z1)))
(NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EQUAL W 0)
(EXPANDED-TASKSP Z BIGP))
(LESSP (PLUS W (TIMES Z1 V1)) Z1)),
which further simplifies, applying COMMUTATIVITY-OF-TIMES, and
unfolding NUMBERP, EQUAL, LESSP, ZEROP, NOT, UNPACK, and PLUS, to:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NUMBERP X1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which has two irrelevant terms in it. By eliminating these terms we
get the new conjecture:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which we will finally name *1.5.
We will appeal to induction. There are eight plausible inductions. They
merge into four likely candidate inductions, two of which are unflawed.
However, one of these is more likely than the other. We will induct according
to the following scheme:
(AND (IMPLIES (AND (LISTP Z)
(p V1 Z1 (CDR Z) BIGP X D V C))
(p V1 Z1 Z BIGP X D V C))
(IMPLIES (NOT (LISTP Z))
(p V1 Z1 Z BIGP X D V C))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT Z)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces the following six new
formulas:
Case 6. (IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, rewriting with the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, and OCCURRENCES-APPEND, and expanding
SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to
the following two new goals:
Case 6.2.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
But this again simplifies, applying OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and expanding SUBSTRING-SCHEDULE, ZEROP, and NUMBERP,
to:
T.
Case 6.1.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LISTP (CAR Z))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
But this again simplifies, applying OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and unfolding the functions SUBSTRING-SCHEDULE, ZEROP,
and NUMBERP, to:
T.
Case 5. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, applying OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS, and
OCCURRENCES-APPEND, and unfolding the functions SUBSTRING-SCHEDULE, MEMBER,
UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to:
(IMPLIES
(AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this again simplifies, rewriting with PLUS-ZERO-ARG2, and unfolding
ZEROP and UNPACK, to:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which further simplifies, unfolding the function UNPACK, to:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
Appealing to the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace Z by (CONS W X1) to eliminate (CAR Z) and (CDR Z), W by (CONS D1 W1)
to eliminate (CDR W) and (CAR W), W1 by (CONS W C1) to eliminate (CAR W1)
and (CDR W1), C1 by (CONS W1 X2) to eliminate (CAR C1) and (CDR C1), W1 by:
(PLUS C1 (TIMES BIGP Z2))
to eliminate (REMAINDER W1 BIGP) and (QUOTIENT W1 BIGP), W by:
(PLUS W1 (TIMES BIGP V2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP), and W by:
(PLUS W1 (TIMES BIGP X2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP). We use
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. The result is four new
conjectures:
Case 5.4.
(IMPLIES (AND (NOT (LISTP W))
(NOT (MEMBER W X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X (CAR W)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C))) W)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM (CAR W))
(NOT (EQUAL (CAR W) NIL))
(NOT (EQUAL (CADR W) 0))
(NUMBERP (CADR W))
(NOT (EQUAL (CADDR W) 0))
(NUMBERP (CADDR W))
(EQUAL NIL (CDDDR W))
(NOT (ASSOC (CAR W) X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CADR W) BIGP) 0)
(EQUAL (REMAINDER (CADDR W) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR W))
(CADR W))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which further simplifies, clearly, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP W1))
(NOT (MEMBER (CONS D1 W1) X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1 W1))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (CAR W1) 0))
(NUMBERP (CAR W1))
(NOT (EQUAL (CADR W1) 0))
(NUMBERP (CADR W1))
(EQUAL NIL (CDDR W1))
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CAR W1) BIGP) 0)
(EQUAL (REMAINDER (CADR W1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR W1))
(CAR W1))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this further simplifies, rewriting with CAR-CONS, to:
T.
Case 5.2.
(IMPLIES (AND (NUMBERP W1)
(EQUAL (LESSP W1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X2)
(NOT (LISTP C1))
(NOT (MEMBER (CONS D1
(CONS (PLUS W1 (TIMES BIGP X2)) C1))
X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1
(CONS (PLUS W1 (TIMES BIGP X2)) C1)))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (PLUS W1 (TIMES BIGP X2)) 0))
(NOT (EQUAL (CAR C1) 0))
(NUMBERP (CAR C1))
(EQUAL NIL (CDR C1))
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL W1 0)
(EQUAL (REMAINDER (CAR C1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR C1))
(PLUS W1 (TIMES BIGP X2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
But this further simplifies, applying CAR-CONS, and unfolding NUMBERP,
EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 5.1.
(IMPLIES
(AND (NUMBERP W1)
(EQUAL (LESSP W1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP V2)
(NUMBERP C1)
(EQUAL (LESSP C1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP Z2)
(NOT (MEMBER (CONS D1
(CONS (PLUS W1 (TIMES BIGP V2))
(CONS (PLUS C1 (TIMES BIGP Z2)) X2)))
X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1
(CONS (PLUS W1 (TIMES BIGP V2))
(CONS (PLUS C1 (TIMES BIGP Z2)) X2))))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (PLUS W1 (TIMES BIGP V2)) 0))
(NOT (EQUAL (PLUS C1 (TIMES BIGP Z2)) 0))
(EQUAL NIL X2)
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL W1 0)
(EQUAL C1 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS C1 (TIMES BIGP Z2)))
(PLUS W1 (TIMES BIGP V2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This further simplifies, rewriting with the lemma CAR-CONS, and expanding
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 4. (IMPLIES (AND (LISTP Z)
(ASSOC X (CDR Z))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which simplifies, rewriting with OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS,
and OCCURRENCES-APPEND, and unfolding the definitions of SUBSTRING-SCHEDULE,
MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, and PERIODIC-TASKP, to:
T.
Case 3. (IMPLIES (AND (LISTP Z)
(NOT (PERIODIC-TASKSP (CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, applying OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS, and
OCCURRENCES-APPEND, and unfolding the functions SUBSTRING-SCHEDULE, MEMBER,
UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (EXPANDED-TASKSP (CDR Z) BIGP))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which simplifies, rewriting with OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS,
and OCCURRENCES-APPEND, and opening up SUBSTRING-SCHEDULE, MEMBER, UNPACK,
ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME,
PERIODIC-TASKP, and EXPANDED-TASKSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Z))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL C NIL))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, rewriting with EQUAL-QUOTIENT-0 and MEMBER-NON-LIST, and
opening up SUBSTRING-SCHEDULE, LISTP, and OCCURRENCES, to:
T.
That finishes the proof of *1.5.
So next consider:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which is formula *1.4 above. Let us appeal to the induction principle. Eight
inductions are suggested by terms in the conjecture. They merge into three
likely candidate inductions, two of which are unflawed. However, one of these
is more likely than the other. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP Z)
(p Y Z1 (CDR Z) BIGP X D V C))
(p Y Z1 Z BIGP X D V C))
(IMPLIES (NOT (LISTP Z))
(p Y Z1 Z BIGP X D V C))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT Z)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates six new formulas:
Case 6. (IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which simplifies, applying OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS, and
OCCURRENCES-APPEND, and unfolding the definitions of SUBSTRING-SCHEDULE,
MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to the following two new
formulas:
Case 6.2.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP Y Z1)).
This again simplifies, applying OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and expanding SUBSTRING-SCHEDULE, ZEROP, and NUMBERP,
to:
T.
Case 6.1.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LISTP (CAR Z))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP Y Z1)).
But this again simplifies, rewriting with OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and expanding the functions SUBSTRING-SCHEDULE, ZEROP,
and NUMBERP, to:
T.
Case 5. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
This simplifies, rewriting with OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS,
and OCCURRENCES-APPEND, and unfolding the functions SUBSTRING-SCHEDULE,
MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to:
(IMPLIES
(AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP Y Z1)).
This again simplifies, applying PLUS-ZERO-ARG2, and expanding the functions
ZEROP and UNPACK, to the new conjecture:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP Y Z1)),
which further simplifies, opening up the function UNPACK, to:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (CDR Z)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP Y Z1)).
Appealing to the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace Z by (CONS W X1) to eliminate (CAR Z) and (CDR Z), W by (CONS W1 V1)
to eliminate (CDR W) and (CAR W), V1 by (CONS W D1) to eliminate (CAR V1)
and (CDR V1), D1 by (CONS V1 C1) to eliminate (CAR D1) and (CDR D1), V1 by:
(PLUS D1 (TIMES BIGP X2))
to eliminate (REMAINDER V1 BIGP) and (QUOTIENT V1 BIGP), W by:
(PLUS V1 (TIMES BIGP Z2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP), and W by:
(PLUS V1 (TIMES BIGP C1))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP). We use
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. We must thus prove four new
conjectures:
Case 5.4.
(IMPLIES (AND (NOT (LISTP W))
(NOT (MEMBER W X1))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X (CAR W)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C))) W)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM (CAR W))
(NOT (EQUAL (CAR W) NIL))
(NOT (EQUAL (CADR W) 0))
(NUMBERP (CADR W))
(NOT (EQUAL (CADDR W) 0))
(NUMBERP (CADDR W))
(EQUAL NIL (CDDDR W))
(NOT (ASSOC (CAR W) X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CADR W) BIGP) 0)
(EQUAL (REMAINDER (CADDR W) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR W))
(CADR W))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP Y Z1)),
which further simplifies, obviously, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP V1))
(NOT (MEMBER (CONS W1 V1) X1))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X W1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS W1 V1))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (CAR V1) 0))
(NUMBERP (CAR V1))
(NOT (EQUAL (CADR V1) 0))
(NUMBERP (CADR V1))
(EQUAL NIL (CDDR V1))
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CAR V1) BIGP) 0)
(EQUAL (REMAINDER (CADR V1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR V1))
(CAR V1))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP Y Z1)).
This further simplifies, rewriting with the lemma CAR-CONS, to:
T.
Case 5.2.
(IMPLIES (AND (NUMBERP V1)
(EQUAL (LESSP V1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP C1)
(NOT (LISTP D1))
(NOT (MEMBER (CONS W1
(CONS (PLUS V1 (TIMES BIGP C1)) D1))
X1))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X W1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS W1
(CONS (PLUS V1 (TIMES BIGP C1)) D1)))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (PLUS V1 (TIMES BIGP C1)) 0))
(NOT (EQUAL (CAR D1) 0))
(NUMBERP (CAR D1))
(EQUAL NIL (CDR D1))
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL V1 0)
(EQUAL (REMAINDER (CAR D1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR D1))
(PLUS V1 (TIMES BIGP C1)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP Y Z1)),
which further simplifies, rewriting with CAR-CONS, and opening up the
functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 5.1.
(IMPLIES
(AND (NUMBERP V1)
(EQUAL (LESSP V1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP Z2)
(NUMBERP D1)
(EQUAL (LESSP D1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X2)
(NOT (MEMBER (CONS W1
(CONS (PLUS V1 (TIMES BIGP Z2))
(CONS (PLUS D1 (TIMES BIGP X2)) C1)))
X1))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(NOT (EQUAL X W1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS W1
(CONS (PLUS V1 (TIMES BIGP Z2))
(CONS (PLUS D1 (TIMES BIGP X2)) C1))))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (PLUS V1 (TIMES BIGP Z2)) 0))
(NOT (EQUAL (PLUS D1 (TIMES BIGP X2)) 0))
(EQUAL NIL C1)
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL V1 0)
(EQUAL D1 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS D1 (TIMES BIGP X2)))
(PLUS V1 (TIMES BIGP Z2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP Y Z1)).
But this further simplifies, rewriting with CAR-CONS, and expanding
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 4. (IMPLIES (AND (LISTP Z)
(ASSOC X (CDR Z))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
This simplifies, rewriting with OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS,
and OCCURRENCES-APPEND, and unfolding SUBSTRING-SCHEDULE, MEMBER, UNPACK,
ASSOC, PERIODIC-TASKSP, and PERIODIC-TASKP, to:
T.
Case 3. (IMPLIES (AND (LISTP Z)
(NOT (PERIODIC-TASKSP (CDR Z)))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which simplifies, rewriting with OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS,
and OCCURRENCES-APPEND, and expanding SUBSTRING-SCHEDULE, MEMBER, UNPACK,
ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME, and
PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (EXPANDED-TASKSP (CDR Z) BIGP))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)).
This simplifies, applying OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS, and
OCCURRENCES-APPEND, and expanding the definitions of SUBSTRING-SCHEDULE,
MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Z))
(NUMBERP Y)
(NUMBERP Z1)
(NOT (EQUAL V Y))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP Y Z1)),
which simplifies, applying the lemmas EQUAL-QUOTIENT-0 and MEMBER-NON-LIST,
and expanding SUBSTRING-SCHEDULE, LISTP, and OCCURRENCES, to:
T.
That finishes the proof of *1.4.
So we now return to:
(IMPLIES (AND (NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
named *1.3 above. We will try to prove it by induction. The recursive terms
in the conjecture suggest nine inductions. They merge into four likely
candidate inductions, two of which are unflawed. However, one of these is
more likely than the other. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP Z)
(p V1 Z1 (CDR Z) BIGP X D V C))
(p V1 Z1 Z BIGP X D V C))
(IMPLIES (NOT (LISTP Z))
(p V1 Z1 Z BIGP X D V C))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT Z) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme generates the
following six new conjectures:
Case 6. (IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, appealing to the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, and OCCURRENCES-APPEND, and unfolding the definitions
of SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to
the following two new formulas:
Case 6.2.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this again simplifies, rewriting with OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and opening up the definitions of SUBSTRING-SCHEDULE,
ZEROP, and NUMBERP, to:
T.
Case 6.1.
(IMPLIES
(AND (LISTP Z)
(NOT (EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LISTP (CAR Z))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this again simplifies, applying the lemmas OCCURRENCES-REPEAT,
MEMBER-SUBSTRING-SCHEDULE, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, and
OCCURRENCES-APPEND, and expanding the functions SUBSTRING-SCHEDULE, ZEROP,
and NUMBERP, to:
T.
Case 5. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which simplifies, appealing to the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, and OCCURRENCES-APPEND, and expanding the definitions
of SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to:
(IMPLIES
(AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (PLUS (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
0)
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this again simplifies, appealing to the lemma PLUS-ZERO-ARG2, and
unfolding the functions ZEROP and UNPACK, to:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CONS X (CONS D (CONS V C)))
(CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
But this further simplifies, unfolding the definition of UNPACK, to:
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) (CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAAR Z)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE (CDR Z) BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CAR Z))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES V1 Z1) Z1)).
Appealing to the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace Z by (CONS W X1) to eliminate (CAR Z) and (CDR Z), W by (CONS D1 W1)
to eliminate (CDR W) and (CAR W), W1 by (CONS W C1) to eliminate (CAR W1)
and (CDR W1), C1 by (CONS W1 X2) to eliminate (CAR C1) and (CDR C1), W1 by:
(PLUS C1 (TIMES BIGP Z2))
to eliminate (REMAINDER W1 BIGP) and (QUOTIENT W1 BIGP), W by:
(PLUS W1 (TIMES BIGP V2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP), and W by:
(PLUS W1 (TIMES BIGP X2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP). We rely upon
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. We must thus prove four new
goals:
Case 5.4.
(IMPLIES (AND (NOT (LISTP W))
(NOT (MEMBER W X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X (CAR W)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C))) W)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM (CAR W))
(NOT (EQUAL (CAR W) NIL))
(NOT (EQUAL (CADR W) 0))
(NUMBERP (CADR W))
(NOT (EQUAL (CADDR W) 0))
(NUMBERP (CADDR W))
(EQUAL NIL (CDDDR W))
(NOT (ASSOC (CAR W) X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CADR W) BIGP) 0)
(EQUAL (REMAINDER (CADDR W) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR W))
(CADR W))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which further simplifies, obviously, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP W1))
(NOT (MEMBER (CONS D1 W1) X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1 W1))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (CAR W1) 0))
(NUMBERP (CAR W1))
(NOT (EQUAL (CADR W1) 0))
(NUMBERP (CADR W1))
(EQUAL NIL (CDDR W1))
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CAR W1) BIGP) 0)
(EQUAL (REMAINDER (CADR W1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR W1))
(CAR W1))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this further simplifies, applying CAR-CONS, to:
T.
Case 5.2.
(IMPLIES (AND (NUMBERP W1)
(EQUAL (LESSP W1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X2)
(NOT (LISTP C1))
(NOT (MEMBER (CONS D1
(CONS (PLUS W1 (TIMES BIGP X2)) C1))
X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1
(CONS (PLUS W1 (TIMES BIGP X2)) C1)))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (PLUS W1 (TIMES BIGP X2)) 0))
(NOT (EQUAL (CAR C1) 0))
(NUMBERP (CAR C1))
(EQUAL NIL (CDR C1))
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL W1 0)
(EQUAL (REMAINDER (CAR C1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR C1))
(PLUS W1 (TIMES BIGP X2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this further simplifies, rewriting with CAR-CONS, and unfolding
the functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 5.1.
(IMPLIES
(AND (NUMBERP W1)
(EQUAL (LESSP W1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP V2)
(NUMBERP C1)
(EQUAL (LESSP C1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP Z2)
(NOT (MEMBER (CONS D1
(CONS (PLUS W1 (TIMES BIGP V2))
(CONS (PLUS C1 (TIMES BIGP Z2)) X2)))
X1))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(NOT (EQUAL X D1))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE X1 BIGP))
(QUOTIENT (TIMES BIGP V) D))
(EQUAL (CONS X (CONS D (CONS V C)))
(CONS D1
(CONS (PLUS W1 (TIMES BIGP V2))
(CONS (PLUS C1 (TIMES BIGP Z2)) X2))))
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X X1))
(LITATOM D1)
(NOT (EQUAL D1 NIL))
(NOT (EQUAL (PLUS W1 (TIMES BIGP V2)) 0))
(NOT (EQUAL (PLUS C1 (TIMES BIGP Z2)) 0))
(EQUAL NIL X2)
(NOT (ASSOC D1 X1))
(PERIODIC-TASKSP X1)
(EQUAL W1 0)
(EQUAL C1 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS C1 (TIMES BIGP Z2)))
(PLUS W1 (TIMES BIGP V2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES V1 Z1) Z1)).
However this further simplifies, applying CAR-CONS, and opening up NUMBERP,
EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 4. (IMPLIES (AND (LISTP Z)
(ASSOC X (CDR Z))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, rewriting with the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, and OCCURRENCES-APPEND, and opening up the functions
SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, and
PERIODIC-TASKP, to:
T.
Case 3. (IMPLIES (AND (LISTP Z)
(NOT (PERIODIC-TASKSP (CDR Z)))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)).
This simplifies, applying OCCURRENCES-REPEAT, COMMUTATIVITY-OF-PLUS, and
OCCURRENCES-APPEND, and opening up SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME, and
PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (EXPANDED-TASKSP (CDR Z) BIGP))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which simplifies, appealing to the lemmas OCCURRENCES-REPEAT,
COMMUTATIVITY-OF-PLUS, and OCCURRENCES-APPEND, and opening up
SUBSTRING-SCHEDULE, MEMBER, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Z))
(NUMBERP V1)
(NUMBERP Z1)
(NOT (EQUAL D (TIMES BIGP Z1)))
(EQUAL (OCCURRENCES X
(SUBSTRING-SCHEDULE Z BIGP))
(QUOTIENT (TIMES BIGP V) D))
(MEMBER (CONS X (CONS D (CONS V C)))
Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES V1 Z1) Z1)),
which simplifies, applying the lemmas EQUAL-QUOTIENT-0 and MEMBER-NON-LIST,
and opening up SUBSTRING-SCHEDULE, LISTP, and OCCURRENCES, to:
T.
That finishes the proof of *1.3.
So let us turn our attention to:
(IMPLIES (AND (NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)),
which we named *1.2 above. We will try to prove it by induction. The
recursive terms in the conjecture suggest six inductions. They merge into
three likely candidate inductions, two of which are unflawed. However, one of
these is more likely than the other. We will induct according to the
following scheme:
(AND (IMPLIES (NLISTP Z)
(p C Z1 Z BIGP X D W))
(IMPLIES (AND (NOT (NLISTP Z))
(EQUAL (CONS X (CONS D W)) (CAR Z)))
(p C Z1 Z BIGP X D W))
(IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X (CONS D W)) (CAR Z)))
(p C Z1 (CDR Z) BIGP X D W))
(p C Z1 Z BIGP X D W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT Z) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to six new formulas:
Case 6. (IMPLIES (AND (NLISTP Z)
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)),
which simplifies, applying MEMBER-NON-LIST, and unfolding NLISTP, to:
T.
Case 5. (IMPLIES (AND (NOT (NLISTP Z))
(EQUAL (CONS X (CONS D W)) (CAR Z))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)).
This simplifies, rewriting with MEMBER-CAR-X-X, and opening up NLISTP,
UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to the conjecture:
(IMPLIES (AND (LISTP Z)
(EQUAL (CONS X (CONS D W)) (CAR Z))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X (CAAR Z)))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES C Z1) Z1)).
Appealing to the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace Z by (CONS V X1) to eliminate (CAR Z) and (CDR Z), V by (CONS W1 V1)
to eliminate (CDR V) and (CAR V), V1 by (CONS V D1) to eliminate (CAR V1)
and (CDR V1), D1 by (CONS V1 C1) to eliminate (CAR D1) and (CDR D1), V1 by:
(PLUS D1 (TIMES BIGP X2))
to eliminate (REMAINDER V1 BIGP) and (QUOTIENT V1 BIGP), V by:
(PLUS V1 (TIMES BIGP Z2))
to eliminate (REMAINDER V BIGP) and (QUOTIENT V BIGP), and V by:
(PLUS V1 (TIMES BIGP C1))
to eliminate (REMAINDER V BIGP) and (QUOTIENT V BIGP). We employ
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. The result is four new formulas:
Case 5.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL (CONS X (CONS D W)) V)
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X (CAR V)))
(NOT (ASSOC X X1))
(LITATOM (CAR V))
(NOT (EQUAL (CAR V) NIL))
(NOT (EQUAL (CADR V) 0))
(NUMBERP (CADR V))
(NOT (EQUAL (CADDR V) 0))
(NUMBERP (CADDR V))
(EQUAL NIL (CDDDR V))
(NOT (ASSOC (CAR V) X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CADR V) BIGP) 0)
(EQUAL (REMAINDER (CADDR V) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR V))
(CADR V))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES C Z1) Z1)),
which further simplifies, clearly, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP V1))
(EQUAL (CONS X (CONS D W))
(CONS W1 V1))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X W1))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (CAR V1) 0))
(NUMBERP (CAR V1))
(NOT (EQUAL (CADR V1) 0))
(NUMBERP (CADR V1))
(EQUAL NIL (CDDR V1))
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL (REMAINDER (CAR V1) BIGP) 0)
(EQUAL (REMAINDER (CADR V1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR V1))
(CAR V1))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES C Z1) Z1)).
But this further simplifies, appealing to the lemma CAR-CONS, to:
T.
Case 5.2.
(IMPLIES (AND (NUMBERP V1)
(EQUAL (LESSP V1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP C1)
(NOT (LISTP D1))
(EQUAL (CONS X (CONS D W))
(CONS W1
(CONS (PLUS V1 (TIMES BIGP C1)) D1)))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X W1))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (PLUS V1 (TIMES BIGP C1)) 0))
(NOT (EQUAL (CAR D1) 0))
(NUMBERP (CAR D1))
(EQUAL NIL (CDR D1))
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL V1 0)
(EQUAL (REMAINDER (CAR D1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR D1))
(PLUS V1 (TIMES BIGP C1)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES C Z1) Z1)),
which further simplifies, applying CAR-CONS, and unfolding the definitions
of NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 5.1.
(IMPLIES
(AND (NUMBERP V1)
(EQUAL (LESSP V1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP Z2)
(NUMBERP D1)
(EQUAL (LESSP D1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X2)
(EQUAL (CONS X (CONS D W))
(CONS W1
(CONS (PLUS V1 (TIMES BIGP Z2))
(CONS (PLUS D1 (TIMES BIGP X2)) C1))))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X W1))
(NOT (ASSOC X X1))
(LITATOM W1)
(NOT (EQUAL W1 NIL))
(NOT (EQUAL (PLUS V1 (TIMES BIGP Z2)) 0))
(NOT (EQUAL (PLUS D1 (TIMES BIGP X2)) 0))
(EQUAL NIL C1)
(NOT (ASSOC W1 X1))
(PERIODIC-TASKSP X1)
(EQUAL V1 0)
(EQUAL D1 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS D1 (TIMES BIGP X2)))
(PLUS V1 (TIMES BIGP Z2)))
0)
(EXPANDED-TASKSP X1 BIGP))
(LESSP (TIMES C Z1) Z1)).
But this further simplifies, rewriting with CAR-CONS, and expanding
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X (CONS D W)) (CAR Z)))
(NOT (MEMBER (CONS X (CONS D W)) (CDR Z)))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)).
This simplifies, opening up the functions NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X (CONS D W)) (CAR Z)))
(ASSOC X (CDR Z))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)).
This simplifies, unfolding the functions NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X (CONS D W)) (CAR Z)))
(NOT (PERIODIC-TASKSP (CDR Z)))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)).
This simplifies, unfolding the functions NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME, and
PERIODIC-TASKP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X (CONS D W)) (CAR Z)))
(NOT (EXPANDED-TASKSP (CDR Z) BIGP))
(NUMBERP C)
(NOT (LISTP W))
(NUMBERP Z1)
(MEMBER (CONS X (CONS D W)) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES C Z1) Z1)).
This simplifies, expanding the definitions of NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME,
PERIODIC-TASKP, and EXPANDED-TASKSP, to:
T.
That finishes the proof of *1.2.
So we now return to:
(IMPLIES (AND (NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)),
which is formula *1.1 above. Perhaps we can prove it by induction. Six
inductions are suggested by terms in the conjecture. They merge into three
likely candidate inductions, two of which are unflawed. However, one of these
is more likely than the other. We will induct according to the following
scheme:
(AND (IMPLIES (NLISTP Z)
(p D Z1 Z BIGP X V))
(IMPLIES (AND (NOT (NLISTP Z))
(EQUAL (CONS X V) (CAR Z)))
(p D Z1 Z BIGP X V))
(IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X V) (CAR Z)))
(p D Z1 (CDR Z) BIGP X V))
(p D Z1 Z BIGP X V))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT Z) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following six new goals:
Case 6. (IMPLIES (AND (NLISTP Z)
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)).
This simplifies, applying MEMBER-NON-LIST, and unfolding NLISTP, to:
T.
Case 5. (IMPLIES (AND (NOT (NLISTP Z))
(EQUAL (CONS X V) (CAR Z))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)),
which simplifies, applying MEMBER-CAR-X-X, and opening up the definitions of
NLISTP, UNPACK, ASSOC, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
TK-NAME, PERIODIC-TASKP, and EXPANDED-TASKSP, to the new formula:
(IMPLIES (AND (LISTP Z)
(EQUAL (CONS X V) (CAR Z))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X (CAAR Z)))
(NOT (ASSOC X (CDR Z)))
(LITATOM (CAAR Z))
(NOT (EQUAL (CAAR Z) NIL))
(NOT (EQUAL (CADAR Z) 0))
(NUMBERP (CADAR Z))
(NOT (EQUAL (CADDAR Z) 0))
(NUMBERP (CADDAR Z))
(EQUAL NIL (CDDDAR Z))
(NOT (ASSOC (CAAR Z) (CDR Z)))
(PERIODIC-TASKSP (CDR Z))
(EQUAL (REMAINDER (CADAR Z) BIGP) 0)
(EQUAL (REMAINDER (CADDAR Z) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR Z))
(CADAR Z))
0)
(EXPANDED-TASKSP (CDR Z) BIGP))
(LESSP (TIMES D Z1) Z1)).
Applying the lemmas CAR-CDR-ELIM and REMAINDER-QUOTIENT-ELIM, replace Z by
(CONS W C) to eliminate (CAR Z) and (CDR Z), W by (CONS V1 X1) to eliminate
(CDR W) and (CAR W), X1 by (CONS W W1) to eliminate (CAR X1) and (CDR X1),
W1 by (CONS X1 D1) to eliminate (CAR W1) and (CDR W1), X1 by:
(PLUS W1 (TIMES BIGP C1))
to eliminate (REMAINDER X1 BIGP) and (QUOTIENT X1 BIGP), W by:
(PLUS X1 (TIMES BIGP X2))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP), and W by:
(PLUS X1 (TIMES BIGP D1))
to eliminate (REMAINDER W BIGP) and (QUOTIENT W BIGP). We use
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. We thus obtain the following four
new conjectures:
Case 5.4.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL (CONS X V) W)
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X (CAR W)))
(NOT (ASSOC X C))
(LITATOM (CAR W))
(NOT (EQUAL (CAR W) NIL))
(NOT (EQUAL (CADR W) 0))
(NUMBERP (CADR W))
(NOT (EQUAL (CADDR W) 0))
(NUMBERP (CADDR W))
(EQUAL NIL (CDDDR W))
(NOT (ASSOC (CAR W) C))
(PERIODIC-TASKSP C)
(EQUAL (REMAINDER (CADR W) BIGP) 0)
(EQUAL (REMAINDER (CADDR W) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR W))
(CADR W))
0)
(EXPANDED-TASKSP C BIGP))
(LESSP (TIMES D Z1) Z1)).
This further simplifies, obviously, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP X1))
(EQUAL (CONS X V) (CONS V1 X1))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X V1))
(NOT (ASSOC X C))
(LITATOM V1)
(NOT (EQUAL V1 NIL))
(NOT (EQUAL (CAR X1) 0))
(NUMBERP (CAR X1))
(NOT (EQUAL (CADR X1) 0))
(NUMBERP (CADR X1))
(EQUAL NIL (CDDR X1))
(NOT (ASSOC V1 C))
(PERIODIC-TASKSP C)
(EQUAL (REMAINDER (CAR X1) BIGP) 0)
(EQUAL (REMAINDER (CADR X1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADR X1))
(CAR X1))
0)
(EXPANDED-TASKSP C BIGP))
(LESSP (TIMES D Z1) Z1)).
This further simplifies, rewriting with CAR-CONS, to:
T.
Case 5.2.
(IMPLIES (AND (NUMBERP X1)
(EQUAL (LESSP X1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP D1)
(NOT (LISTP W1))
(EQUAL (CONS X V)
(CONS V1
(CONS (PLUS X1 (TIMES BIGP D1)) W1)))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X V1))
(NOT (ASSOC X C))
(LITATOM V1)
(NOT (EQUAL V1 NIL))
(NOT (EQUAL (PLUS X1 (TIMES BIGP D1)) 0))
(NOT (EQUAL (CAR W1) 0))
(NUMBERP (CAR W1))
(EQUAL NIL (CDR W1))
(NOT (ASSOC V1 C))
(PERIODIC-TASKSP C)
(EQUAL X1 0)
(EQUAL (REMAINDER (CAR W1) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CAR W1))
(PLUS X1 (TIMES BIGP D1)))
0)
(EXPANDED-TASKSP C BIGP))
(LESSP (TIMES D Z1) Z1)).
However this further simplifies, applying CAR-CONS, and expanding the
functions NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 5.1.
(IMPLIES
(AND (NUMBERP X1)
(EQUAL (LESSP X1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP X2)
(NUMBERP W1)
(EQUAL (LESSP W1 BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP C1)
(EQUAL (CONS X V)
(CONS V1
(CONS (PLUS X1 (TIMES BIGP X2))
(CONS (PLUS W1 (TIMES BIGP C1)) D1))))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (EQUAL X V1))
(NOT (ASSOC X C))
(LITATOM V1)
(NOT (EQUAL V1 NIL))
(NOT (EQUAL (PLUS X1 (TIMES BIGP X2)) 0))
(NOT (EQUAL (PLUS W1 (TIMES BIGP C1)) 0))
(EQUAL NIL D1)
(NOT (ASSOC V1 C))
(PERIODIC-TASKSP C)
(EQUAL X1 0)
(EQUAL W1 0)
(EQUAL (REMAINDER (TIMES BIGP (PLUS W1 (TIMES BIGP C1)))
(PLUS X1 (TIMES BIGP X2)))
0)
(EXPANDED-TASKSP C BIGP))
(LESSP (TIMES D Z1) Z1)).
This further simplifies, applying CAR-CONS, and expanding the definitions
of NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X V) (CAR Z)))
(NOT (MEMBER (CONS X V) (CDR Z)))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)).
This simplifies, expanding NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X V) (CAR Z)))
(ASSOC X (CDR Z))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)).
This simplifies, expanding the functions NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X V) (CAR Z)))
(NOT (PERIODIC-TASKSP (CDR Z)))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)).
This simplifies, unfolding the definitions of NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME, and
PERIODIC-TASKP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP Z))
(NOT (EQUAL (CONS X V) (CAR Z)))
(NOT (EXPANDED-TASKSP (CDR Z) BIGP))
(NUMBERP D)
(NOT (LISTP V))
(NUMBERP Z1)
(MEMBER (CONS X V) Z)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(LITATOM X)
(NOT (EQUAL X NIL))
(NOT (EQUAL Z1 0))
(NOT (ASSOC X Z))
(PERIODIC-TASKSP Z)
(EXPANDED-TASKSP Z BIGP))
(LESSP (TIMES D Z1) Z1)).
This simplifies, expanding the functions NLISTP, MEMBER, UNPACK, ASSOC,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, TK-NAME,
PERIODIC-TASKP, and EXPANDED-TASKSP, to:
T.
That finishes the proof of *1.1, which, in turn, also finishes the proof
of *1. Q.E.D.
[ 0.0 12.7 0.3 ]
OCCURRENCES-SUBSTRING-SCHEDULE
(PROVE-LEMMA TIMES-QUOTIENT-QUOTIENT-SPECIAL
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER X BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP Y) X) 0)
(LESSP 0 BIGP))
(EQUAL (TIMES (QUOTIENT X BIGP)
(QUOTIENT (TIMES BIGP Y) X))
(FIX Y))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-QUOTIENT-QUOTIENT-SPECIAL could!
This conjecture simplifies, opening up EQUAL, LESSP, and FIX, to two new
conjectures:
Case 2. (IMPLIES (AND (EQUAL (REMAINDER X BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP Y) X) 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NOT (NUMBERP Y)))
(EQUAL (TIMES (QUOTIENT X BIGP)
(QUOTIENT (TIMES BIGP Y) X))
0)),
which again simplifies, applying TIMES-ZERO and COMMUTATIVITY-OF-TIMES, and
expanding the definitions of ZEROP, LESSP, EQUAL, NUMBERP, REMAINDER,
QUOTIENT, and TIMES, to:
T.
Case 1. (IMPLIES (AND (EQUAL (REMAINDER X BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP Y) X) 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NUMBERP Y))
(EQUAL (TIMES (QUOTIENT X BIGP)
(QUOTIENT (TIMES BIGP Y) X))
Y)).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by
(PLUS Z (TIMES BIGP V)) to eliminate (REMAINDER X BIGP) and
(QUOTIENT X BIGP). We use LESSP-REMAINDER, the type restriction lemma noted
when REMAINDER was introduced, and the type restriction lemma noted when
QUOTIENT was introduced to constrain the new variables. This generates two
new formulas:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP X))
(EQUAL (REMAINDER X BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP Y) X) 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NUMBERP Y))
(EQUAL (TIMES (QUOTIENT X BIGP)
(QUOTIENT (TIMES BIGP Y) X))
Y)),
which further simplifies, using linear arithmetic, applying REMAINDER-NOOP,
REMAINDER-OF-NON-NUMBER, REMAINDER-ZERO, EQUAL-TIMES-0,
QUOTIENT-LESSP-ARG1, COMMUTATIVITY-OF-TIMES, and QUOTIENT-ZERO, and
unfolding NUMBERP, EQUAL, ZEROP, and TIMES, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z BIGP)
(NOT (ZEROP BIGP)))
(NUMBERP V)
(EQUAL Z 0)
(EQUAL (REMAINDER (TIMES BIGP Y)
(PLUS Z (TIMES BIGP V)))
0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NUMBERP Y))
(EQUAL (TIMES V
(QUOTIENT (TIMES BIGP Y)
(PLUS Z (TIMES BIGP V))))
Y)).
However this further simplifies, appealing to the lemmas
REMAINDER-TIMES2-INSTANCE, EQUAL-TIMES-0, and
CORRECTNESS-OF-CANCEL-QUOTIENT-TIMES, and expanding the functions NUMBERP,
EQUAL, LESSP, ZEROP, NOT, PLUS, and FIX, to the formula:
(IMPLIES (AND (NUMBERP V)
(EQUAL (REMAINDER Y V) 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NUMBERP Y))
(EQUAL (TIMES V (QUOTIENT Y V)) Y)).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
(PLUS Z (TIMES V W)) to eliminate (REMAINDER Y V) and (QUOTIENT Y V). We
employ LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. The result is two new formulas:
Case 1.1.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(EQUAL (REMAINDER Y V) 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NUMBERP Y))
(EQUAL (TIMES V (QUOTIENT Y V)) Y)),
which further simplifies, appealing to the lemma REMAINDER-ZERO, and
opening up the definitions of NUMBERP, ZEROP, QUOTIENT, TIMES, and EQUAL,
to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z V) (NOT (ZEROP V)))
(NUMBERP W)
(NOT (EQUAL V 0))
(NUMBERP V)
(EQUAL Z 0)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP))
(EQUAL (TIMES V W)
(PLUS Z (TIMES V W)))),
which further simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
TIMES-QUOTIENT-QUOTIENT-SPECIAL
(PROVE-LEMMA GOOD-SCHEDULE-PERIODIC-TASK-REQUESTS
(REWRITE)
(IMPLIES
(AND (MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N2 N1))
(NUMBERP N2)
(NUMBERP N1)
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (CADR TK)))
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N2 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK N1 N2)))
((INDUCT (PERIODIC-TASK-REQUESTS TK N1 N2))))
This formula can be simplified, using the abbreviations IMPLIES, TK-DURATION,
TK-NAME, PERIODIC-TASKP, NOT, OR, AND, and TK-PERIOD, to the following three
new goals:
Case 3. (IMPLIES
(AND
(LISTP TK)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(LESSP 0 (CADR TK))
(LESSP 0 (CADDR TK))
(EQUAL NIL (CDDDR TK))
(LESSP N1 N2)
(IMPLIES
(AND (MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N2 (PLUS N1 (CADR TK))))
(NUMBERP N2)
(NUMBERP (PLUS N1 (CADR TK)))
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER (PLUS N1 (CADR TK)) BIGP))
(ZEROP (REMAINDER (PLUS N1 (CADR TK))
(CADR TK)))
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N2 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE
(REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK
(PLUS N1 (CADR TK))
N2)))
(MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N2 N1))
(NUMBERP N2)
(NUMBERP N1)
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (CADR TK)))
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N2 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK N1 N2))).
This simplifies, using linear arithmetic, applying BAGINT-SINGLETON,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, MEMBER-EXPANDED, REMAINDER-PLUS,
REMAINDER-X-X, OCCURRENCES-REPEAT-LIST, TIMES-QUOTIENT-QUOTIENT-SPECIAL,
OCCURRENCES-MAKE-LENGTH, OCCURRENCES-SUBSTRING-SCHEDULE, FIRSTN-REPEAT-LIST,
TIMES-DISTRIBUTES-OVER-DIFFERENCE, LESSP-DIFFERENCE-SPECIAL,
NTHCDR-REPEAT-LIST, LENGTH-MAKE-LENGTH, TIMES-QUOTIENT,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, CDR-CONS, and CAR-CONS, and unfolding
UNPACK, EQUAL, LESSP, NOT, ZEROP, AND, IMPLIES, PERIODIC-TASKP, TK-NAME,
TK-PERIOD, TK-DURATION, PERIODIC-TASK-REQUESTS, DURATION, FIX, REQUEST-TIME,
DEADLINE, NAME, and GOOD-SCHEDULE, to:
(IMPLIES
(AND (LISTP TK)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(NOT (EQUAL (CADR TK) 0))
(NUMBERP (CADR TK))
(NOT (EQUAL (CADDR TK) 0))
(NUMBERP (CADDR TK))
(EQUAL NIL (CDDDR TK))
(LESSP N1 N2)
(LESSP N2 (PLUS N1 (CADR TK)))
(MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(NOT (EQUAL BIGP 0))
(NUMBERP BIGP)
(NOT (LESSP N2 N1))
(NUMBERP N2)
(NUMBERP N1)
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)
(EQUAL (REMAINDER N1 BIGP) 0)
(EQUAL (REMAINDER N1 (CADR TK)) 0)
(EQUAL (REMAINDER N2 BIGP) 0)
(EQUAL (REMAINDER N2 (BIG-PERIOD PTS))
0)
(EQUAL (REMAINDER N2 (CADR TK)) 0)
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK
(PLUS N1 (CADR TK))
N2))).
This again simplifies, rewriting with LESSP-REMAINDER-SPECIAL, and unfolding
the definition of UNPACK, to:
T.
Case 2. (IMPLIES
(AND (LISTP TK)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(LESSP 0 (CADR TK))
(LESSP 0 (CADDR TK))
(EQUAL NIL (CDDDR TK))
(NOT (LESSP N1 N2))
(MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N2 N1))
(NUMBERP N2)
(NUMBERP N1)
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (CADR TK)))
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N2 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK N1 N2))).
This simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LISTP TK)
(LITATOM (CAR TK))
(NOT (EQUAL (CAR TK) NIL))
(LESSP 0 (CADR TK))
(LESSP 0 (CADDR TK))
(EQUAL NIL (CDDDR TK))
(NOT (LESSP N1 N1))
(MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N1 N1))
(NUMBERP N1)
(NUMBERP N1)
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N1 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N1 BIGP))
(PERIODIC-TASK-REQUESTS TK N1 N1))),
which again simplifies, applying MEMBER-EXPANDED, and opening up UNPACK,
EQUAL, LESSP, ZEROP, PERIODIC-TASKP, TK-NAME, TK-PERIOD, TK-DURATION,
PERIODIC-TASK-REQUESTS, LISTP, and GOOD-SCHEDULE, to:
T.
Case 1. (IMPLIES
(AND (NOT (PERIODIC-TASKP TK))
(MEMBER TK PTS)
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(NOT (LESSP N2 N1))
(NUMBERP N2)
(NUMBERP N1)
(ZEROP (REMAINDER (CADR TK) BIGP))
(ZEROP (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK)))
(ZEROP (REMAINDER N1 BIGP))
(ZEROP (REMAINDER N1 (CADR TK)))
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS)))
(ZEROP (REMAINDER N2 (CADR TK)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP)))))
(GOOD-SCHEDULE (REPEAT-LIST (MAKE-LENGTH BIGP
(SUBSTRING-SCHEDULE PTS BIGP)
NIL)
(QUOTIENT N2 BIGP))
(PERIODIC-TASK-REQUESTS TK N1 N2))).
This simplifies, using linear arithmetic, appealing to the lemmas CDR-NLISTP,
REMAINDER-NOOP, COMMUTATIVITY-OF-TIMES, REMAINDER-ZERO, QUOTIENT-LESSP-ARG1,
MEMBER-EXPANDED, EQUAL-TIMES-0, and TIMES-ZERO, and expanding the functions
TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, PERIODIC-TASKP, CAR,
NUMBERP, ZEROP, CDR, TIMES, REMAINDER, REPEAT-LIST, PERIODIC-TASK-REQUESTS,
GOOD-SCHEDULE, LISTP, and LITATOM, to:
T.
Q.E.D.
[ 0.0 4.2 0.0 ]
GOOD-SCHEDULE-PERIODIC-TASK-REQUESTS
(PROVE-LEMMA MEMBER-SUBLISTP
(REWRITE)
(IMPLIES (AND (SUBLISTP X Y) (MEMBER E X))
(MEMBER E Y)))
WARNING: Note that MEMBER-SUBLISTP contains the free variable X which will be
chosen by instantiating the hypothesis (SUBLISTP X Y).
Call the conjecture *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 (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(p E (CDR Y) (CDR X)))
(p E Y X))
(IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(p E (CDR Y) X))
(p E Y X))
(IMPLIES (AND (LISTP Y) (NOT (LISTP X)))
(p E Y X))
(IMPLIES (NOT (LISTP Y)) (p E Y X))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme. Note, however, the inductive instances
chosen for X. The above induction scheme leads to seven new goals:
Case 7. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(NOT (SUBLISTP (CDR X) (CDR Y)))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)),
which simplifies, opening up the definition of SUBLISTP, to:
T.
Case 6. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(NOT (MEMBER E (CDR X)))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)),
which simplifies, expanding SUBLISTP and MEMBER, to:
(IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(NOT (MEMBER E (CDR X)))
(SUBLISTP (CDR X) (CDR Y))
(MEMBER E X)
(NOT (EQUAL E (CAR X))))
(MEMBER E (CDR Y))).
But this further simplifies, opening up the function MEMBER, to:
T.
Case 5. (IMPLIES (AND (LISTP Y)
(LISTP X)
(EQUAL (CAR X) (CAR Y))
(MEMBER E (CDR Y))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)),
which simplifies, applying the lemmas BAGINT-SINGLETON and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and opening up SUBLISTP and
MEMBER, to:
T.
Case 4. (IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(NOT (SUBLISTP X (CDR Y)))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)),
which simplifies, opening up the definition of SUBLISTP, to:
T.
Case 3. (IMPLIES (AND (LISTP Y)
(LISTP X)
(NOT (EQUAL (CAR X) (CAR Y)))
(MEMBER E (CDR Y))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)),
which simplifies, applying BAGINT-SINGLETON and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the functions
SUBLISTP and MEMBER, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (LISTP X))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)).
This simplifies, expanding the definitions of SUBLISTP and MEMBER, to:
(IMPLIES (AND (LISTP Y)
(NOT (LISTP X))
(MEMBER E X)
(NOT (EQUAL E (CAR Y))))
(MEMBER E (CDR Y))),
which further simplifies, rewriting with MEMBER-NON-LIST, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Y))
(SUBLISTP X Y)
(MEMBER E X))
(MEMBER E Y)).
This simplifies, applying MEMBER-NON-LIST, and expanding SUBLISTP, to:
(IMPLIES (AND (NOT (LISTP Y)) (NOT (LISTP X)))
(NOT (MEMBER E X))).
However this further simplifies, appealing to the lemma MEMBER-NON-LIST, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-SUBLISTP
(PROVE-LEMMA MEMBER-EXPANDED-TASKSP-MEANS
(REWRITE)
(IMPLIES (AND (EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(AND (EQUAL (REMAINDER (CADR TK) BIGP) 0)
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0))))
WARNING: Note that MEMBER-EXPANDED-TASKSP-MEANS contains the free variable
PTS which will be chosen by instantiating the hypothesis:
(EXPANDED-TASKSP PTS BIGP).
WARNING: the previously added lemma, MEMBER-EXPANDED, could be applied
whenever the newly proposed MEMBER-EXPANDED-TASKSP-MEANS could!
WARNING: Note that MEMBER-EXPANDED-TASKSP-MEANS contains the free variable
PTS which will be chosen by instantiating the hypothesis:
(EXPANDED-TASKSP PTS BIGP).
WARNING: Note that the proposed lemma MEMBER-EXPANDED-TASKSP-MEANS is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula simplifies, rewriting with MEMBER-EXPANDED, and opening up the
definitions of EQUAL and AND, to:
(IMPLIES (AND (EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)).
Applying the lemma CAR-CDR-ELIM, replace TK by (CONS Z X) to eliminate
(CDR TK) and (CAR TK), 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
four new conjectures:
Case 4. (IMPLIES (AND (NOT (LISTP TK))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)).
This further simplifies, applying the lemmas CDR-NLISTP and
COMMUTATIVITY-OF-TIMES, and opening up the functions CDR, CAR, EQUAL, TIMES,
and REMAINDER, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP X))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER (CONS Z X) PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADR X))
(CAR X))
0)),
which further simplifies, rewriting with CDR-NLISTP, COMMUTATIVITY-OF-TIMES,
and CAR-NLISTP, and opening up CAR, EQUAL, TIMES, and REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP V))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER (CONS Z (CONS W V)) PTS))
(EQUAL (REMAINDER (TIMES BIGP (CAR V)) W)
0)).
However this further simplifies, applying CAR-NLISTP and
COMMUTATIVITY-OF-TIMES, and unfolding EQUAL, TIMES, LESSP, NUMBERP, and
REMAINDER, to:
T.
Case 1. (IMPLIES (AND (EXPANDED-TASKSP PTS BIGP)
(MEMBER (CONS Z (CONS W (CONS X D)))
PTS))
(EQUAL (REMAINDER (TIMES BIGP X) W)
0)),
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:
(AND (IMPLIES (AND (EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (CADR TK) BIGP) 0))
(IMPLIES (AND (EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest five 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 PTS)
(p BIGP TK (CDR PTS)))
(p BIGP TK PTS))
(IMPLIES (NOT (LISTP PTS))
(p BIGP TK PTS))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT PTS) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to six
new goals:
Case 6. (IMPLIES (AND (LISTP PTS)
(NOT (EXPANDED-TASKSP (CDR PTS) BIGP))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)),
which simplifies, unfolding the function EXPANDED-TASKSP, to:
T.
Case 5. (IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)),
which simplifies, expanding EXPANDED-TASKSP and MEMBER, to the goal:
(IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(EQUAL (REMAINDER (CADAR PTS) BIGP) 0)
(EQUAL (REMAINDER (CADDAR PTS) BIGP)
0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
0)
(EXPANDED-TASKSP (CDR PTS) BIGP)
(EQUAL TK (CAR PTS)))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)).
This again simplifies, clearly, to:
T.
Case 4. (IMPLIES (AND (NOT (LISTP PTS))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (CADR TK) BIGP) 0)).
This simplifies, rewriting with MEMBER-NON-LIST, and opening up the function
EXPANDED-TASKSP, to:
T.
Case 3. (IMPLIES (AND (LISTP PTS)
(NOT (EXPANDED-TASKSP (CDR PTS) BIGP))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)),
which simplifies, unfolding the definition of EXPANDED-TASKSP, to:
T.
Case 2. (IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)),
which simplifies, unfolding the definitions of EXPANDED-TASKSP and MEMBER,
to the goal:
(IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(EQUAL (REMAINDER (CADAR PTS) BIGP) 0)
(EQUAL (REMAINDER (CADDAR PTS) BIGP)
0)
(EQUAL (REMAINDER (TIMES BIGP (CADDAR PTS))
(CADAR PTS))
0)
(EXPANDED-TASKSP (CDR PTS) BIGP)
(EQUAL TK (CAR PTS)))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)).
This again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PTS))
(EXPANDED-TASKSP PTS BIGP)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES BIGP (CADDR TK))
(CADR TK))
0)).
This simplifies, rewriting with the lemma MEMBER-NON-LIST, and opening up
the definition of EXPANDED-TASKSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.7 0.0 ]
MEMBER-EXPANDED-TASKSP-MEANS
(PROVE-LEMMA REMAINDER-PERIOD-IF-REMAINDER-BIG-PERIOD
(REWRITE)
(IMPLIES (AND (PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)))
WARNING: Note that REMAINDER-PERIOD-IF-REMAINDER-BIG-PERIOD contains the free
variable PTS which will be chosen by instantiating the hypothesis
(PERIODIC-TASKSP PTS).
This conjecture simplifies, expanding ZEROP, to:
(IMPLIES (AND (PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(EQUAL (REMAINDER N (BIG-PERIOD PTS))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace N by:
(PLUS X (TIMES (BIG-PERIOD PTS) Z))
to eliminate (REMAINDER N (BIG-PERIOD PTS)) and (QUOTIENT N (BIG-PERIOD PTS)).
We rely upon LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. This produces the following four
new conjectures:
Case 4. (IMPLIES (AND (NOT (NUMBERP N))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(EQUAL (REMAINDER N (BIG-PERIOD PTS))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
But this further simplifies, applying REMAINDER-OF-NON-NUMBER, and expanding
the functions LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 3. (IMPLIES (AND (EQUAL (BIG-PERIOD PTS) 0)
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(EQUAL (REMAINDER N (BIG-PERIOD PTS))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
This further simplifies, rewriting with REMAINDER-ZERO and
REMAINDER-OF-NON-NUMBER, and opening up the definitions of ZEROP, LESSP,
EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP (BIG-PERIOD PTS)))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(EQUAL (REMAINDER N (BIG-PERIOD PTS))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
This further simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X (BIG-PERIOD PTS))
(NOT (ZEROP (BIG-PERIOD PTS))))
(NUMBERP Z)
(NOT (EQUAL (BIG-PERIOD PTS) 0))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(EQUAL X 0))
(EQUAL (REMAINDER (PLUS X (TIMES (BIG-PERIOD PTS) Z))
(CADR TK))
0)).
This further simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL (BIG-PERIOD PTS) 0))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES Z (BIG-PERIOD PTS))
(CADR TK))
0)).
Applying the lemma CAR-CDR-ELIM, replace TK by (CONS V X) to eliminate
(CDR TK) and (CAR TK) and X by (CONS W D) to eliminate (CAR X) and (CDR X).
We thus obtain the following three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (LISTP TK))
(NUMBERP Z)
(NOT (EQUAL (BIG-PERIOD PTS) 0))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS))
(EQUAL (REMAINDER (TIMES Z (BIG-PERIOD PTS))
(CADR TK))
0)).
This further simplifies, applying CDR-NLISTP, REMAINDER-ZERO, and
EQUAL-TIMES-0, and opening up CAR and ZEROP, to:
(IMPLIES (AND (NOT (LISTP TK))
(NUMBERP Z)
(NOT (EQUAL (BIG-PERIOD PTS) 0))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS))
(EQUAL Z 0)),
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 (PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)),
named *1. Let us appeal to the induction principle. There are five plausible
inductions. They merge into three likely candidate inductions. However, only
one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP PTS) (p N TK (CDR PTS)))
(p N TK PTS))
(IMPLIES (NOT (LISTP PTS))
(p N TK PTS))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT PTS) 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 (LISTP PTS)
(NOT (PERIODIC-TASKSP (CDR PTS)))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)).
This simplifies, expanding PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL,
TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 3. (IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and opening up the
functions PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK,
TK-NAME, PERIODIC-TASKP, MEMBER, BIG-PERIOD, and ZEROP, to the conjecture:
(IMPLIES (AND (LISTP PTS)
(NOT (MEMBER TK (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL TK (CAR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADR TK)))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
But this again simplifies, opening up UNPACK, to:
(IMPLIES (AND (LISTP PTS)
(NOT (MEMBER (CAR PTS) (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (CADAR PTS)) 0)).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace N by:
(PLUS X
(TIMES (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
Z))
to eliminate (REMAINDER N (TIMES (BIG-PERIOD (CDR PTS)) (CADAR PTS))) and:
(QUOTIENT N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
. We use LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. We must thus prove four new
conjectures:
Case 3.4.
(IMPLIES (AND (NOT (NUMBERP N))
(LISTP PTS)
(NOT (MEMBER (CAR PTS) (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (CADAR PTS)) 0)),
which further simplifies, using linear arithmetic, rewriting with
COMMUTATIVITY-OF-TIMES, REMAINDER-BIG-PERIOD-CDR, REMAINDER-NOOP,
QUOTIENT-LESSP-ARG1, REMAINDER-TIMES2, REMAINDER-OF-NON-NUMBER, and
QUOTIENT-OF-NON-NUMBER, and unfolding the functions UNPACK, TK-PERIOD,
BIG-PERIOD, EQUAL, NUMBERP, LESSP, REMAINDER, TIMES, and QUOTIENT, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
0)
(LISTP PTS)
(NOT (MEMBER (CAR PTS) (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (CADAR PTS)) 0)).
However this further simplifies, using linear arithmetic, applying the
lemmas EQUAL-TIMES-0, REMAINDER-ZERO, REMAINDER-NOOP, and
REMAINDER-OF-NON-NUMBER, and unfolding the definitions of UNPACK, ZEROP,
NUMBERP, and EQUAL, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))))
(LISTP PTS)
(NOT (MEMBER (CAR PTS) (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (CADAR PTS)) 0)),
which further simplifies, obviously, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
(NOT (ZEROP (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))))
(NUMBERP Z)
(NOT (EQUAL (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
0))
(LISTP PTS)
(NOT (MEMBER (CAR PTS) (CDR PTS)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL X 0))
(EQUAL (REMAINDER (PLUS X
(TIMES (TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS))
Z))
(CADAR PTS))
0)).
However this further simplifies, rewriting with the lemmas EQUAL-TIMES-0,
COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES, ASSOCIATIVITY-OF-TIMES,
REMAINDER-TIMES1-INSTANCE, and REMAINDER-TIMES1, and opening up the
definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT, UNPACK, and PLUS, to:
T.
Case 2. (IMPLIES (AND (LISTP PTS)
(NOT (ZEROP (REMAINDER N (BIG-PERIOD (CDR PTS)))))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)),
which simplifies, applying COMMUTATIVITY-OF-TIMES, and expanding the
definitions of ZEROP, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD,
UNPACK, TK-NAME, PERIODIC-TASKP, MEMBER, and BIG-PERIOD, to the following
two new formulas:
Case 2.2.
(IMPLIES (AND (LISTP PTS)
(NOT (EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(EQUAL TK (CAR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADR TK)))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)).
However this again simplifies, rewriting with the lemmas
COMMUTATIVITY-OF-TIMES and REMAINDER-BIG-PERIOD-CDR, and unfolding the
functions EQUAL, TK-PERIOD, and BIG-PERIOD, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP PTS)
(NOT (EQUAL (REMAINDER N (BIG-PERIOD (CDR PTS)))
0))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS))
(MEMBER TK (CDR PTS))
(EQUAL (REMAINDER N
(TIMES (BIG-PERIOD (CDR PTS))
(CADAR PTS)))
0))
(EQUAL (REMAINDER N (CADR TK)) 0)),
which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
REMAINDER-BIG-PERIOD-CDR, and opening up EQUAL, TK-PERIOD, and BIG-PERIOD,
to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PTS))
(PERIODIC-TASKSP PTS)
(MEMBER TK PTS)
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(EQUAL (REMAINDER N (CADR TK)) 0)).
This simplifies, applying the lemma MEMBER-NON-LIST, and opening up the
function PERIODIC-TASKSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.7 0.1 ]
REMAINDER-PERIOD-IF-REMAINDER-BIG-PERIOD
(PROVE-LEMMA GOOD-SIMPLE-SCHEDULE-SUBLIST NIL
(IMPLIES (AND (NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS2 BIGP))))
(EQUAL N1 0)
(SUBLISTP PTS1 PTS2)
(PERIODIC-TASKSP PTS2)
(EXPANDED-TASKSP PTS2 BIGP)
(LESSP 0 BIGP)
(NUMBERP N2)
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS2))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS2 BIGP N2)
(PERIODIC-TASKS-REQUESTS PTS1 N1 N2)))
((INDUCT (PERIODIC-TASKS-REQUESTS PTS1 N1 N2))))
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to three new conjectures:
Case 3. (IMPLIES
(AND
(PERIODIC-TASKSP PTS1)
(LISTP PTS1)
(IMPLIES (AND (NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS2 BIGP))))
(EQUAL N1 0)
(SUBLISTP (CDR PTS1) PTS2)
(PERIODIC-TASKSP PTS2)
(EXPANDED-TASKSP PTS2 BIGP)
(LESSP 0 BIGP)
(NUMBERP N2)
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS2))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS2 BIGP N2)
(PERIODIC-TASKS-REQUESTS (CDR PTS1)
N1 N2)))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS2 BIGP))))
(EQUAL N1 0)
(SUBLISTP PTS1 PTS2)
(PERIODIC-TASKSP PTS2)
(EXPANDED-TASKSP PTS2 BIGP)
(LESSP 0 BIGP)
(NUMBERP N2)
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS2))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS2 BIGP N2)
(PERIODIC-TASKS-REQUESTS PTS1 N1 N2))),
which simplifies, using linear arithmetic, appealing to the lemmas
SUBLISTP-CDR1, EQUAL-LENGTH-0, REMAINDER-PERIOD-IF-REMAINDER-BIG-PERIOD,
REMAINDER-NOOP, MEMBER-EXPANDED-TASKSP-MEANS, MEMBER-SUBLISTP,
MEMBER-CAR-X-X, GOOD-SCHEDULE-PERIODIC-TASK-REQUESTS, and
GOOD-SCHEDULE-APPEND, and opening up the definitions of PERIODIC-TASKP,
TK-NAME, UNPACK, TK-PERIOD, EQUAL, LESSP, TK-DURATION, PERIODIC-TASKSP, NOT,
ZEROP, AND, MAKE-SIMPLE-SCHEDULE, IMPLIES, PERIODIC-TASKS-REQUESTS,
REMAINDER, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (PERIODIC-TASKSP PTS1)
(NOT (LISTP PTS1))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS2 BIGP))))
(EQUAL N1 0)
(SUBLISTP PTS1 PTS2)
(PERIODIC-TASKSP PTS2)
(EXPANDED-TASKSP PTS2 BIGP)
(LESSP 0 BIGP)
(NUMBERP N2)
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS2))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS2 BIGP N2)
(PERIODIC-TASKS-REQUESTS PTS1 N1 N2))),
which simplifies, applying SUBLISTP-CDR2, and unfolding PERIODIC-TASKSP,
LISTP, SUBLISTP, EQUAL, LESSP, ZEROP, MAKE-SIMPLE-SCHEDULE,
PERIODIC-TASKS-REQUESTS, and GOOD-SCHEDULE, to:
T.
Case 1. (IMPLIES (AND (NOT (PERIODIC-TASKSP PTS1))
(NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS2 BIGP))))
(EQUAL N1 0)
(SUBLISTP PTS1 PTS2)
(PERIODIC-TASKSP PTS2)
(EXPANDED-TASKSP PTS2 BIGP)
(LESSP 0 BIGP)
(NUMBERP N2)
(ZEROP (REMAINDER N2 BIGP))
(ZEROP (REMAINDER N2 (BIG-PERIOD PTS2))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS2 BIGP N2)
(PERIODIC-TASKS-REQUESTS PTS1 N1 N2))).
This simplifies, expanding the definitions of EQUAL, LESSP, ZEROP,
MAKE-SIMPLE-SCHEDULE, PERIODIC-TASKS-REQUESTS, LISTP, and GOOD-SCHEDULE, to:
T.
Q.E.D.
[ 0.0 2.6 0.0 ]
GOOD-SIMPLE-SCHEDULE-SUBLIST
(PROVE-LEMMA SUBLISTP-X-X
(REWRITE)
(SUBLISTP X X))
Give the conjecture the name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) (CAR X))
(p (CDR X)))
(p X))
(IMPLIES (AND (LISTP X)
(NOT (EQUAL (CAR X) (CAR X)))
(p (CDR X)))
(p X))
(IMPLIES (NOT (LISTP X)) (p X))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
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 X)
(EQUAL (CAR X) (CAR X))
(SUBLISTP (CDR X) (CDR X)))
(SUBLISTP X X)).
This simplifies, expanding the function SUBLISTP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (EQUAL (CAR X) (CAR X)))
(SUBLISTP (CDR X) (CDR X)))
(SUBLISTP X X)).
This simplifies, trivially, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(SUBLISTP X X)).
This simplifies, rewriting with SUBLISTP-CDR2 and CDR-NLISTP, and unfolding
CDR, LISTP, and SUBLISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBLISTP-X-X
(PROVE-LEMMA PERIODIC-TASKS-REQUESTS-SIMPLE
(REWRITE)
(IMPLIES (NOT (LESSP N1 N2))
(EQUAL (PERIODIC-TASKS-REQUESTS PTS N1 N2)
NIL)))
Give the conjecture the name *1.
We will appeal to 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 (PERIODIC-TASKSP PTS)
(LISTP PTS)
(p (CDR PTS) N1 N2))
(p PTS N1 N2))
(IMPLIES (AND (PERIODIC-TASKSP PTS)
(NOT (LISTP PTS)))
(p PTS N1 N2))
(IMPLIES (NOT (PERIODIC-TASKSP PTS))
(p PTS N1 N2))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme produces the
following three new formulas:
Case 3. (IMPLIES (AND (PERIODIC-TASKSP PTS)
(LISTP PTS)
(EQUAL (PERIODIC-TASKS-REQUESTS (CDR PTS)
N1 N2)
NIL)
(NOT (LESSP N1 N2)))
(EQUAL (PERIODIC-TASKS-REQUESTS PTS N1 N2)
NIL)).
This simplifies, opening up PERIODIC-TASKP, TK-NAME, UNPACK, TK-PERIOD,
EQUAL, LESSP, TK-DURATION, PERIODIC-TASKSP, PERIODIC-TASKS-REQUESTS,
PERIODIC-TASK-REQUESTS, and APPEND, to:
T.
Case 2. (IMPLIES (AND (PERIODIC-TASKSP PTS)
(NOT (LISTP PTS))
(NOT (LESSP N1 N2)))
(EQUAL (PERIODIC-TASKS-REQUESTS PTS N1 N2)
NIL)).
This simplifies, opening up the definitions of PERIODIC-TASKSP, LISTP,
PERIODIC-TASKS-REQUESTS, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (PERIODIC-TASKSP PTS))
(NOT (LESSP N1 N2)))
(EQUAL (PERIODIC-TASKS-REQUESTS PTS N1 N2)
NIL)).
This simplifies, opening up the definitions of PERIODIC-TASKS-REQUESTS and
EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PERIODIC-TASKS-REQUESTS-SIMPLE
(PROVE-LEMMA GOOD-SIMPLE-SCHEDULE
(REWRITE)
(IMPLIES (AND (NOT (LESSP BIGP
(LENGTH (SUBSTRING-SCHEDULE PTS BIGP))))
(PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP PTS BIGP)
(LESSP 0 BIGP)
(ZEROP (REMAINDER N BIGP))
(ZEROP (REMAINDER N (BIG-PERIOD PTS))))
(GOOD-SCHEDULE (MAKE-SIMPLE-SCHEDULE PTS BIGP N)
(PERIODIC-TASKS-REQUESTS PTS 0 N)))
((USE (GOOD-SIMPLE-SCHEDULE-SUBLIST (N2 N)
(N1 0)
(PTS2 PTS)
(PTS1 PTS)))
(DISABLE-THEORY T)
(ENABLE SUBLISTP-X-X PERIODIC-TASKS-REQUESTS-SIMPLE
GOOD-SCHEDULE)
(ENABLE-THEORY GROUND-ZERO TASK-ABBR)))
This conjecture simplifies, using linear arithmetic, rewriting with the lemmas
SUBLISTP-X-X and PERIODIC-TASKS-REQUESTS-SIMPLE, and opening up the functions
NOT, EQUAL, LESSP, ZEROP, AND, IMPLIES, REMAINDER, LISTP, and GOOD-SCHEDULE,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
GOOD-SIMPLE-SCHEDULE
(DEFN EXPAND-TASKS
(PTS BIGP)
(IF (LISTP PTS)
(CONS (LIST (CAAR PTS)
(TIMES BIGP (CADAR PTS))
(TIMES BIGP (CADDAR PTS)))
(EXPAND-TASKS (CDR PTS) BIGP))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
recursive call. Hence, EXPAND-TASKS is accepted under the principle of
definition. Note that:
(OR (LITATOM (EXPAND-TASKS PTS BIGP))
(LISTP (EXPAND-TASKS PTS BIGP)))
is a theorem.
[ 0.0 0.0 0.0 ]
EXPAND-TASKS
(PROVE-LEMMA EXPANDED-TASKSP-EXPAND-TASK-HELPER
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (ZEROP X)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by:
(PLUS Z (TIMES (BIG-PERIOD PTS1) V))
to eliminate (REMAINDER X (BIG-PERIOD PTS1)) and:
(QUOTIENT X (BIG-PERIOD PTS1))
. We use LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was introduced
to constrain the new variables. The result is three new conjectures:
Case 3. (IMPLIES (AND (EQUAL (BIG-PERIOD PTS1) 0)
(EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)),
which simplifies, applying REMAINDER-ZERO, and expanding the function ZEROP,
to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP (BIG-PERIOD PTS1)))
(EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
This simplifies, obviously, to:
T.
Case 1. (IMPLIES
(AND (NUMBERP Z)
(EQUAL (LESSP Z (BIG-PERIOD PTS1))
(NOT (ZEROP (BIG-PERIOD PTS1))))
(NUMBERP V)
(NOT (EQUAL (BIG-PERIOD PTS1) 0))
(EQUAL Z 0)
(NOT (EQUAL (PLUS Z (TIMES (BIG-PERIOD PTS1) V))
0)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1
(PLUS Z (TIMES (BIG-PERIOD PTS1) V)))
(PLUS Z
(TIMES (BIG-PERIOD PTS1) V)))).
However this simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
EQUAL-TIMES-0, and opening up the functions NUMBERP, EQUAL, LESSP, ZEROP,
NOT, and PLUS, to:
(IMPLIES (AND (NUMBERP V)
(NOT (EQUAL (BIG-PERIOD PTS1) 0))
(NOT (EQUAL V 0)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1
(TIMES V (BIG-PERIOD PTS1)))
(TIMES V (BIG-PERIOD PTS1)))),
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 (EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (ZEROP X)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
We named this *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 (AND (LISTP PTS1) (p (CDR PTS1) X))
(p PTS1 X))
(IMPLIES (NOT (LISTP PTS1))
(p PTS1 X))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT PTS1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme produces the
following three new formulas:
Case 3. (IMPLIES (AND (LISTP PTS1)
(NOT (EQUAL (REMAINDER X (BIG-PERIOD (CDR PTS1)))
0))
(EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (ZEROP X)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
This simplifies, applying the lemma REMAINDER-BIG-PERIOD-CDR, and expanding
the function EQUAL, to:
T.
Case 2. (IMPLIES (AND (LISTP PTS1)
(EXPANDED-TASKSP (EXPAND-TASKS (CDR PTS1) X)
X)
(EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (ZEROP X)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, EQUAL-TIMES-0,
REMAINDER-TIMES2-INSTANCE, REMAINDER-TIMES1-INSTANCE, CDR-CONS, and CAR-CONS,
and expanding the definitions of BIG-PERIOD, TK-PERIOD, ZEROP, EXPAND-TASKS,
EQUAL, and EXPANDED-TASKSP, to:
(IMPLIES (AND (LISTP PTS1)
(EXPANDED-TASKSP (EXPAND-TASKS (CDR PTS1) X)
X)
(EQUAL (REMAINDER X
(TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (REMAINDER (TIMES X (CADDAR PTS1))
(CADAR PTS1))
0)).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by:
(PLUS Z
(TIMES (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
V))
to eliminate (REMAINDER X (TIMES (BIG-PERIOD (CDR PTS1)) (CADAR PTS1))) and:
(QUOTIENT X
(TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))
. We employ LESSP-REMAINDER, the type restriction lemma noted when
REMAINDER was introduced, and the type restriction lemma noted when QUOTIENT
was introduced to constrain the new variables. The result is three new
conjectures:
Case 2.3.
(IMPLIES (AND (EQUAL (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
0)
(LISTP PTS1)
(EXPANDED-TASKSP (EXPAND-TASKS (CDR PTS1) X)
X)
(EQUAL (REMAINDER X
(TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (REMAINDER (TIMES X (CADDAR PTS1))
(CADAR PTS1))
0)),
which further simplifies, rewriting with the lemmas EQUAL-TIMES-0 and
REMAINDER-ZERO, and expanding the definition of ZEROP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))))
(LISTP PTS1)
(EXPANDED-TASKSP (EXPAND-TASKS (CDR PTS1) X)
X)
(EQUAL (REMAINDER X
(TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))
0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (REMAINDER (TIMES X (CADDAR PTS1))
(CADAR PTS1))
0)),
which further simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES
(AND
(NUMBERP Z)
(EQUAL (LESSP Z
(TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))
(NOT (ZEROP (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1)))))
(NUMBERP V)
(NOT (EQUAL (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
0))
(LISTP PTS1)
(EXPANDED-TASKSP
(EXPAND-TASKS (CDR PTS1)
(PLUS Z
(TIMES (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
V)))
(PLUS Z
(TIMES (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
V)))
(EQUAL Z 0)
(NOT (EQUAL (PLUS Z
(TIMES (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
V))
0)))
(EQUAL (REMAINDER (TIMES (PLUS Z
(TIMES (TIMES (BIG-PERIOD (CDR PTS1))
(CADAR PTS1))
V))
(CADDAR PTS1))
(CADAR PTS1))
0)).
But this further simplifies, rewriting with EQUAL-TIMES-0,
COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES, ASSOCIATIVITY-OF-TIMES,
REMAINDER-TIMES1, and REMAINDER-TIMES1-INSTANCE, and expanding NUMBERP,
EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PTS1))
(EQUAL (REMAINDER X (BIG-PERIOD PTS1))
0)
(NOT (ZEROP X)))
(EXPANDED-TASKSP (EXPAND-TASKS PTS1 X)
X)).
This simplifies, appealing to the lemma REMAINDER-1-ARG2, and unfolding the
functions BIG-PERIOD, EQUAL, ZEROP, EXPAND-TASKS, LISTP, and EXPANDED-TASKSP,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.6 0.0 ]
EXPANDED-TASKSP-EXPAND-TASK-HELPER
(PROVE-LEMMA ZEROP-BIG-PERIOD
(REWRITE)
(IMPLIES (PERIODIC-TASKSP PTS)
(LESSP 0 (BIG-PERIOD PTS))))
WARNING: Note that the proposed lemma ZEROP-BIG-PERIOD is to be stored as
zero type prescription rules, zero compound recognizer rules, one linear rule,
and zero replacement rules.
This formula simplifies, opening up the definitions of EQUAL and LESSP, to:
(IMPLIES (PERIODIC-TASKSP PTS)
(NOT (EQUAL (BIG-PERIOD PTS) 0))).
Give the above formula the name *1.
Perhaps we can 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 PTS) (p (CDR PTS)))
(p PTS))
(IMPLIES (NOT (LISTP PTS)) (p PTS))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PTS) 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 PTS)
(NOT (PERIODIC-TASKSP (CDR PTS)))
(PERIODIC-TASKSP PTS))
(NOT (EQUAL (BIG-PERIOD PTS) 0))).
This simplifies, opening up the definitions of PERIODIC-TASKSP, TK-DURATION,
LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP PTS)
(NOT (EQUAL (BIG-PERIOD (CDR PTS)) 0))
(PERIODIC-TASKSP PTS))
(NOT (EQUAL (BIG-PERIOD PTS) 0))).
This simplifies, applying COMMUTATIVITY-OF-TIMES and EQUAL-TIMES-0, and
opening up PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK,
TK-NAME, PERIODIC-TASKP, and BIG-PERIOD, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PTS))
(PERIODIC-TASKSP PTS))
(NOT (EQUAL (BIG-PERIOD PTS) 0))),
which simplifies, opening up PERIODIC-TASKSP, BIG-PERIOD, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
ZEROP-BIG-PERIOD
(PROVE-LEMMA EXPANDED-TASKSP-EXPAND-TASK
(REWRITE)
(IMPLIES (PERIODIC-TASKSP PTS)
(EXPANDED-TASKSP (EXPAND-TASKS PTS (BIG-PERIOD PTS))
(BIG-PERIOD PTS))))
This simplifies, using linear arithmetic, rewriting with ZEROP-BIG-PERIOD,
REMAINDER-BIG-PERIOD-SUBLIST, SUBLISTP-X-X, and
EXPANDED-TASKSP-EXPAND-TASK-HELPER, and expanding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EXPANDED-TASKSP-EXPAND-TASK
(PROVE-LEMMA ASSOC-EXPAND-TASKS
(REWRITE)
(IMPLIES (PERIODIC-TASKSP X)
(IFF (ASSOC V (EXPAND-TASKS X N))
(ASSOC V X))))
This formula simplifies, opening up the function IFF, to the following two new
goals:
Case 2. (IMPLIES (AND (PERIODIC-TASKSP X)
(NOT (ASSOC V (EXPAND-TASKS X N))))
(NOT (ASSOC V X))).
Call the above conjecture *1.
Case 1. (IMPLIES (AND (PERIODIC-TASKSP X)
(ASSOC V (EXPAND-TASKS X N)))
(ASSOC V 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 (PERIODIC-TASKSP X)
(IFF (ASSOC V (EXPAND-TASKS X N))
(ASSOC V X))).
We gave this the name *1 above. 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 (AND (LISTP X) (p V (CDR X) N))
(p V X N))
(IMPLIES (NOT (LISTP X)) (p V X N))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
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 X)
(NOT (PERIODIC-TASKSP (CDR X)))
(PERIODIC-TASKSP X))
(IFF (ASSOC V (EXPAND-TASKS X N))
(ASSOC V X))).
This simplifies, opening up PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL,
TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(IFF (ASSOC V (EXPAND-TASKS (CDR X) N))
(ASSOC V (CDR X)))
(PERIODIC-TASKSP X))
(IFF (ASSOC V (EXPAND-TASKS X N))
(ASSOC V X))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and opening up the
functions IFF, PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK,
TK-NAME, PERIODIC-TASKP, EXPAND-TASKS, and ASSOC, to two new goals:
Case 2.2.
(IMPLIES (AND (LISTP X)
(NOT (ASSOC V (EXPAND-TASKS (CDR X) N)))
(NOT (ASSOC V (CDR X)))
(LISTP (CAR X))
(LITATOM (CAAR X))
(NOT (EQUAL (CAAR X) NIL))
(NOT (EQUAL (CADAR X) 0))
(NUMBERP (CADAR X))
(NOT (EQUAL (CADDAR X) 0))
(NUMBERP (CADDAR X))
(EQUAL NIL (CDDDAR X))
(NOT (ASSOC (CAAR X) (CDR X)))
(PERIODIC-TASKSP (CDR X))
(NOT (EQUAL V (CAAR X))))
(IFF F F)),
which again simplifies, opening up the functions UNPACK and IFF, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(NOT (ASSOC V (EXPAND-TASKS (CDR X) N)))
(NOT (ASSOC V (CDR X)))
(LISTP (CAR X))
(LITATOM (CAAR X))
(NOT (EQUAL (CAAR X) NIL))
(NOT (EQUAL (CADAR X) 0))
(NUMBERP (CADAR X))
(NOT (EQUAL (CADDAR X) 0))
(NUMBERP (CADDAR X))
(EQUAL NIL (CDDDAR X))
(NOT (ASSOC (CAAR X) (CDR X)))
(PERIODIC-TASKSP (CDR X))
(EQUAL V (CAAR X)))
(IFF (LIST (CAAR X)
(TIMES N (CADAR X))
(TIMES N (CADDAR X)))
(CAR X))),
which again simplifies, opening up the functions UNPACK and IFF, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X))
(PERIODIC-TASKSP X))
(IFF (ASSOC V (EXPAND-TASKS X N))
(ASSOC V X))),
which simplifies, opening up PERIODIC-TASKSP, LISTP, EXPAND-TASKS, ASSOC,
and IFF, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
ASSOC-EXPAND-TASKS
(PROVE-LEMMA PERIODIC-TASKSP-EXPAND-TASKS
(REWRITE)
(IMPLIES (PERIODIC-TASKSP PTS)
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
(OR (NOT (ZEROP N))
(NOT (LISTP PTS))))))
This simplifies, opening up the functions ZEROP, NOT, and OR, to four new
goals:
Case 4. (IMPLIES (AND (PERIODIC-TASKSP PTS)
(NOT (NUMBERP N))
(LISTP PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
F)),
which again simplifies, obviously, to:
(IMPLIES (AND (PERIODIC-TASKSP PTS)
(NOT (NUMBERP N))
(LISTP PTS))
(NOT (PERIODIC-TASKSP (EXPAND-TASKS PTS N)))),
which we will name *1.
Case 3. (IMPLIES (AND (PERIODIC-TASKSP PTS)
(EQUAL N 0)
(LISTP PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
F)).
This again simplifies, clearly, to:
(IMPLIES (AND (PERIODIC-TASKSP PTS)
(LISTP PTS))
(NOT (PERIODIC-TASKSP (EXPAND-TASKS PTS 0)))),
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 (PERIODIC-TASKSP PTS)
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
(OR (NOT (ZEROP N))
(NOT (LISTP PTS))))).
We named this *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 PTS) (p (CDR PTS) N))
(p PTS N))
(IMPLIES (NOT (LISTP PTS))
(p PTS N))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT PTS) decreases according to the well-founded relation LESSP in each
induction step of the scheme. The above induction scheme generates three new
formulas:
Case 3. (IMPLIES (AND (LISTP PTS)
(NOT (PERIODIC-TASKSP (CDR PTS)))
(PERIODIC-TASKSP PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
(OR (NOT (ZEROP N))
(NOT (LISTP PTS))))),
which simplifies, opening up PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL,
TK-PERIOD, UNPACK, TK-NAME, and PERIODIC-TASKP, to:
T.
Case 2. (IMPLIES (AND (LISTP PTS)
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS (CDR PTS) N))
(OR (NOT (ZEROP N))
(NOT (LISTP (CDR PTS)))))
(PERIODIC-TASKSP PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
(OR (NOT (ZEROP N))
(NOT (LISTP PTS))))),
which simplifies, applying the lemmas CDR-CONS, CAR-CONS, ASSOC-EXPAND-TASKS,
EQUAL-TIMES-0, and LESSP-TIMES1, and expanding ZEROP, NOT, OR,
PERIODIC-TASKSP, TK-DURATION, LESSP, EQUAL, TK-PERIOD, UNPACK, TK-NAME,
PERIODIC-TASKP, EXPAND-TASKS, TIMES, CONS, CAR, and ASSOC, to the conjecture:
(IMPLIES (AND (LISTP PTS)
(EQUAL N 0)
(LISTP (CDR PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS (CDR PTS) N))
F)
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS)))
(NOT (PERIODIC-TASKSP (EXPAND-TASKS PTS 0)))).
But this again simplifies, expanding the definition of UNPACK, to:
(IMPLIES (AND (LISTP PTS)
(LISTP (CDR PTS))
(NOT (PERIODIC-TASKSP (EXPAND-TASKS (CDR PTS) 0)))
(LISTP (CAR PTS))
(LITATOM (CAAR PTS))
(NOT (EQUAL (CAAR PTS) NIL))
(NOT (EQUAL (CADAR PTS) 0))
(NUMBERP (CADAR PTS))
(NOT (EQUAL (CADDAR PTS) 0))
(NUMBERP (CADDAR PTS))
(EQUAL NIL (CDDDAR PTS))
(NOT (ASSOC (CAAR PTS) (CDR PTS)))
(PERIODIC-TASKSP (CDR PTS)))
(NOT (PERIODIC-TASKSP (EXPAND-TASKS PTS 0)))).
But this again simplifies, appealing to the lemmas CDR-CONS and CAR-CONS,
and expanding the functions UNPACK, CONS, TIMES, EQUAL, EXPAND-TASKS,
PERIODIC-TASKP, TK-NAME, CAR, TK-PERIOD, LESSP, and PERIODIC-TASKSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP PTS))
(PERIODIC-TASKSP PTS))
(EQUAL (PERIODIC-TASKSP (EXPAND-TASKS PTS N))
(OR (NOT (ZEROP N))
(NOT (LISTP PTS))))),
which simplifies, expanding the definitions of PERIODIC-TASKSP, LISTP,
EXPAND-TASKS, ZEROP, NOT, OR, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PERIODIC-TASKSP-EXPAND-TASKS
(DEFN NON-OVERLAPPING-REQUESTS3
(REQUEST REQUEST-LIST)
(IF (LISTP REQUEST-LIST)
(AND (OR (NOT (EQUAL (CAR REQUEST)
(CAAR REQUEST-LIST)))
(NOT (LESSP (CADR REQUEST)
(CADDAR REQUEST-LIST)))
(NOT (LESSP (CADAR REQUEST-LIST)
(CADDR REQUEST)))
(EQUAL (CAR REQUEST-LIST) REQUEST))
(NON-OVERLAPPING-REQUESTS3 REQUEST
(CDR REQUEST-LIST)))
T))
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT REQUEST-LIST) decreases according to the well-founded relation
LESSP in each recursive call. Hence, NON-OVERLAPPING-REQUESTS3 is accepted
under the definitional principle. From the definition we can conclude that:
(OR (FALSEP (NON-OVERLAPPING-REQUESTS3 REQUEST REQUEST-LIST))
(TRUEP (NON-OVERLAPPING-REQUESTS3 REQUEST REQUEST-LIST)))
is a theorem.
[ 0.0 0.0 0.0 ]
NON-OVERLAPPING-REQUESTS3
(DEFN NON-OVERLAPPING-REQUESTS2
(R1 R2)
(IF (LISTP R1)
(AND (NON-OVERLAPPING-REQUESTS3 (CAR R1)
R2)
(NON-OVERLAPPING-REQUESTS2 (CDR R1)
R2))
T))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT R1) decreases according to the well-founded relation LESSP in each
recursive call. Hence, NON-OVERLAPPING-REQUESTS2 is accepted under the
principle of definition. Note that:
(OR (FALSEP (NON-OVERLAPPING-REQUESTS2 R1 R2))
(TRUEP (NON-OVERLAPPING-REQUESTS2 R1 R2)))
is a theorem.
[ 0.0 0.0 0.0 ]
NON-OVERLAPPING-REQUESTS2
(DEFN NON-OVERLAPPING-REQUESTS
(R)
(NON-OVERLAPPING-REQUESTS2 R R))
Note that:
(OR (FALSEP (NON-OVERLAPPING-REQUESTS R))
(TRUEP (NON-OVERLAPPING-REQUESTS R)))
is a theorem.
[ 0.0 0.0 0.0 ]
NON-OVERLAPPING-REQUESTS
(DEFN DOUBLE-CDR-INDUCTION
(A B)
(IF (LISTP A)
(DOUBLE-CDR-INDUCTION (CDR A) (CDR B))
T))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT A) decreases according to the well-founded relation LESSP in each
recursive call. Hence, DOUBLE-CDR-INDUCTION is accepted under the principle
of definition. Observe that (TRUEP (DOUBLE-CDR-INDUCTION A B)) is a theorem.
[ 0.0 0.0 0.0 ]
DOUBLE-CDR-INDUCTION
(PROVE-LEMMA PLIST-FIRSTN
(REWRITE)
(EQUAL (PLIST (FIRSTN N L))
(FIRSTN N L)))
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 (ZEROP N) (p N L))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) (CDR L)))
(p N L))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for L. The above induction scheme produces the
following two new goals:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (PLIST (FIRSTN N L))
(FIRSTN N L))).
This simplifies, expanding ZEROP, EQUAL, FIRSTN, and PLIST, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (PLIST (FIRSTN (SUB1 N) (CDR L)))
(FIRSTN (SUB1 N) (CDR L))))
(EQUAL (PLIST (FIRSTN N L))
(FIRSTN N L))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding the
definitions of ZEROP, FIRSTN, and PLIST, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PLIST-FIRSTN
(PROVE-LEMMA CONS-NTH-NTHCDR
(REWRITE)
(IMPLIES (LESSP N (LENGTH L))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))))
This formula simplifies, applying the lemma CDR-NLISTP, and unfolding LENGTH,
to the following two new goals:
Case 2. (IMPLIES (AND (NOT (LISTP L)) (LESSP N 0))
(EQUAL (CONS (NTH N L) (NTHCDR N 0))
(NTHCDR N L))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LISTP L)
(LESSP N (ADD1 (LENGTH (CDR L)))))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))),
which again simplifies, applying SUB1-ADD1 and CONS-CAR-CDR, and unfolding
the functions LESSP, EQUAL, NTH, and NTHCDR, to:
(IMPLIES (AND (LISTP L)
(LESSP (SUB1 N) (LENGTH (CDR L))))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))).
Applying the lemma SUB1-ELIM, replace N by (ADD1 X) to eliminate (SUB1 N).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We thus obtain the following three new
conjectures:
Case 1.3.
(IMPLIES (AND (EQUAL N 0)
(LISTP L)
(LESSP (SUB1 N) (LENGTH (CDR L))))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))).
However this further simplifies, rewriting with EQUAL-LENGTH-0 and
CONS-CAR-CDR, and unfolding the functions SUB1, EQUAL, LESSP, NTH, and
NTHCDR, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP N))
(LISTP L)
(LESSP (SUB1 N) (LENGTH (CDR L))))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))).
This further simplifies, applying SUB1-NNUMBERP, EQUAL-LENGTH-0, and
CONS-CAR-CDR, and opening up EQUAL, LESSP, NTH, and NTHCDR, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(LISTP L)
(LESSP X (LENGTH (CDR L))))
(EQUAL (CONS (NTH (ADD1 X) L)
(NTHCDR (ADD1 X) (CDR L)))
(NTHCDR (ADD1 X) L))).
But this further simplifies, rewriting with SUB1-ADD1, and unfolding the
functions NTH and NTHCDR, to:
(IMPLIES (AND (NUMBERP X)
(LISTP L)
(LESSP X (LENGTH (CDR L))))
(EQUAL (CONS (NTH X (CDR L))
(NTHCDR X (CDDR L)))
(NTHCDR X (CDR L)))).
Applying the lemma CAR-CDR-ELIM, replace L by (CONS V Z) to eliminate
(CDR L) and (CAR L) and Z by (CONS D W) to eliminate (CDR Z) and (CAR Z).
We thus obtain the following two new formulas:
Case 1.1.2.
(IMPLIES (AND (NOT (LISTP Z))
(NUMBERP X)
(LESSP X (LENGTH Z)))
(EQUAL (CONS (NTH X Z) (NTHCDR X (CDR Z)))
(NTHCDR X Z))).
However this finally simplifies, expanding the definitions of LENGTH,
EQUAL, and LESSP, to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP X)
(LESSP X (LENGTH (CONS D W))))
(EQUAL (CONS (NTH X (CONS D W)) (NTHCDR X W))
(NTHCDR X (CONS D W)))),
which further simplifies, applying CDR-CONS, SUB1-ADD1, and CAR-CONS,
and unfolding LENGTH, LESSP, EQUAL, NTH, and NTHCDR, to:
(IMPLIES (AND (NUMBERP X)
(LESSP (SUB1 X) (LENGTH W)))
(EQUAL (CONS (NTH X (CONS D W)) (NTHCDR X W))
(NTHCDR X (CONS D W)))),
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 (LESSP N (LENGTH L))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))),
named *1. Let us appeal to the induction principle. Five 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 (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L))))
(p N L))
(IMPLIES (AND (NOT (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(p N L))
(IMPLIES (AND (NOT (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(p (SUB1 N) (CDR L)))
(p N L))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for L. The above induction scheme
produces four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L))))
(LESSP N (LENGTH L)))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))),
which simplifies, expanding the definitions of LENGTH, NOT, OR, EQUAL, and
LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L)))))
(OR (EQUAL N 0) (NOT (NUMBERP N)))
(LESSP N (LENGTH L)))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))),
which simplifies, rewriting with the lemma CONS-CAR-CDR, and expanding
LENGTH, NOT, OR, EQUAL, LESSP, NTH, and NTHCDR, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP (SUB1 N) (LENGTH (CDR L))))
(LESSP N (LENGTH L)))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))),
which simplifies, applying SUB1-ADD1, and unfolding the definitions of
LENGTH, NOT, OR, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH L) 0)
(NOT (NUMBERP (LENGTH L)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(EQUAL (CONS (NTH (SUB1 N) (CDR L))
(NTHCDR (SUB1 N) (CDDR L)))
(NTHCDR (SUB1 N) (CDR L)))
(LESSP N (LENGTH L)))
(EQUAL (CONS (NTH N L) (NTHCDR N (CDR L)))
(NTHCDR N L))).
This simplifies, rewriting with SUB1-ADD1, and expanding the functions
LENGTH, NOT, OR, LESSP, NTH, and NTHCDR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.2 ]
CONS-NTH-NTHCDR
(PROVE-LEMMA EQUAL-APPEND
(REWRITE)
(EQUAL (EQUAL (APPEND A B) Y)
(IF (NLISTP Y)
(AND (NLISTP A) (EQUAL B Y))
(AND (NOT (LESSP (LENGTH Y) (LENGTH A)))
(EQUAL (FIRSTN (LENGTH A) Y)
(PLIST A))
(EQUAL (NTHCDR (LENGTH A) Y) B))))
((INDUCT (DOUBLE-CDR-INDUCTION A Y))))
This conjecture can be simplified, using the abbreviations NOT, OR, and AND,
to two new conjectures:
Case 2. (IMPLIES (AND (LISTP A)
(EQUAL (EQUAL (APPEND (CDR A) B) (CDR Y))
(IF (NLISTP (CDR Y))
(AND (NLISTP (CDR A))
(EQUAL B (CDR Y)))
(AND (NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)))))
(EQUAL (EQUAL (APPEND A B) Y)
(IF (NLISTP Y)
(AND (NLISTP A) (EQUAL B Y))
(AND (NOT (LESSP (LENGTH Y) (LENGTH A)))
(EQUAL (FIRSTN (LENGTH A) Y)
(PLIST A))
(EQUAL (NTHCDR (LENGTH A) Y) B))))),
which simplifies, rewriting with the lemmas SUB1-ADD1, EQUAL-LENGTH-0,
CAR-CONS, and CONS-EQUAL, and opening up NLISTP, NOT, AND, APPEND, LENGTH,
ADD1, SUB1, NUMBERP, EQUAL, LESSP, FIRSTN, PLIST, and NTHCDR, to 17 new
formulas:
Case 2.17.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(LISTP (CDR A)))
(NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))),
which again simplifies, applying the lemma CDR-CONS, to:
T.
Case 2.16.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(LISTP (CDR Y))
(NOT (EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))))
(NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))),
which again simplifies, rewriting with the lemma CDR-CONS, to:
T.
Case 2.15.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(LISTP (CDR Y))
(LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))),
which again simplifies, appealing to the lemma CDR-CONS, to:
T.
Case 2.14.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(LISTP (CDR Y))
(NOT (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)))
(NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))),
which again simplifies, applying CDR-CONS, to:
T.
Case 2.13.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(EQUAL (CAR Y) (CAR A))).
This again simplifies, applying CDR-CONS, to:
T.
Case 2.12.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))).
However this again simplifies, applying CDR-CONS, to:
T.
Case 2.11.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(NOT (LISTP (CDR A)))).
This again simplifies, rewriting with the lemma CDR-CONS, to:
T.
Case 2.10.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(LISTP Y)),
which again simplifies, obviously, to:
T.
Case 2.9.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(NOT (EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(LISTP Y)
(NOT (LISTP (CDR A)))
(EQUAL (CAR Y) (CAR A))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A))))
(NOT (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B))).
However this again simplifies, unfolding the definitions of LENGTH, EQUAL,
NTHCDR, and APPEND, to:
T.
Case 2.8.
(IMPLIES (AND (LISTP A)
(NOT (EQUAL (APPEND (CDR A) B) (CDR Y)))
(NOT (LISTP (CDR Y)))
(NOT (EQUAL B (CDR Y)))
(EQUAL (CONS (CAR A) (APPEND (CDR A) B))
Y))
(EQUAL (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)
T)),
which again simplifies, rewriting with CDR-CONS, to:
T.
Case 2.7.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)
T)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (EQUAL (CAR Y) (CAR A)) T)).
This again simplifies, obviously, to:
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (CAR Y) (CAR A))),
which again simplifies, clearly, to:
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A)
(NTHCDR (LENGTH (CDR A)) (CDR Y)))
(CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (CAR Y) (CAR A))).
Applying the lemma CAR-CDR-ELIM, replace A by (CONS Z X) to eliminate
(CDR A) and (CAR A). We would thus like to prove:
(IMPLIES (AND (EQUAL (APPEND X (NTHCDR (LENGTH X) (CDR Y)))
(CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y)) (LENGTH X)))
(EQUAL (FIRSTN (LENGTH X) (CDR Y))
(PLIST X))
(EQUAL (CONS Z (CDR Y)) Y))
(EQUAL (CAR Y) Z)).
Applying the lemma CAR-CDR-ELIM, replace Y by (CONS W V) to eliminate
(CDR Y) and (CAR Y). We would thus like to prove the following two new
conjectures:
Case 2.7.2.
(IMPLIES (AND (NOT (LISTP Y))
(EQUAL (APPEND X (NTHCDR (LENGTH X) (CDR Y)))
(CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y)) (LENGTH X)))
(EQUAL (FIRSTN (LENGTH X) (CDR Y))
(PLIST X))
(EQUAL (CONS Z (CDR Y)) Y))
(EQUAL (CAR Y) Z)).
This finally simplifies, trivially, to:
T.
Case 2.7.1.
(IMPLIES (AND (EQUAL (APPEND X (NTHCDR (LENGTH X) V))
V)
(LISTP V)
(NOT (LESSP (LENGTH V) (LENGTH X)))
(EQUAL (FIRSTN (LENGTH X) V)
(PLIST X))
(EQUAL (CONS Z V) (CONS W V)))
(EQUAL W Z)).
But this finally simplifies, rewriting with CAR-CONS, to:
T.
Case 2.6.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)
T)
(NOT (EQUAL (CONS (CAR A) (CDR Y)) Y))
(LISTP Y))
(NOT (EQUAL (CAR Y) (CAR A)))).
But this again simplifies, rewriting with CAR-CONS and CDR-CONS, to:
T.
Case 2.5.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(LISTP (CDR Y))
(NOT (LESSP (LENGTH (CDR Y))
(LENGTH (CDR A))))
(EQUAL (FIRSTN (LENGTH (CDR A)) (CDR Y))
(PLIST (CDR A)))
(EQUAL (EQUAL (NTHCDR (LENGTH (CDR A)) (CDR Y))
B)
T)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(LISTP Y)).
This again simplifies, trivially, to:
T.
Case 2.4.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (EQUAL B (CDR Y)) T)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (FIRSTN 1 Y) (LIST (CAR A)))).
This again simplifies, expanding APPEND, to the formula:
(IMPLIES (AND (LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL B (CDR Y))
(EQUAL (CONS (CAR A) B) Y))
(EQUAL (FIRSTN 1 Y) (LIST (CAR A)))).
This again simplifies, clearly, to:
(IMPLIES (AND (LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (FIRSTN 1 Y) (LIST (CAR A)))).
Applying the lemma CAR-CDR-ELIM, replace Y by (CONS Z X) to eliminate
(CDR Y) and (CAR Y). We would thus like to prove the following two new
formulas:
Case 2.4.2.
(IMPLIES (AND (NOT (LISTP Y))
(LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (FIRSTN 1 Y) (LIST (CAR A)))).
This further simplifies, clearly, to:
T.
Case 2.4.1.
(IMPLIES (AND (LISTP A)
(NOT (LISTP X))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) X) (CONS Z X)))
(EQUAL (FIRSTN 1 (CONS Z X))
(LIST (CAR A)))).
But this further simplifies, rewriting with CAR-CONS, CONS-EQUAL, and
CDR-CONS, and unfolding the functions SUB1, NUMBERP, EQUAL, and FIRSTN,
to:
T.
Case 2.3.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (EQUAL B (CDR Y)) T)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(LISTP Y)).
This again simplifies, obviously, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (EQUAL B (CDR Y)) T)
(NOT (EQUAL (CONS (CAR A) (CDR Y)) Y))
(LISTP Y)
(EQUAL (FIRSTN 1 Y) (LIST (CAR A))))
(NOT (EQUAL (NTHCDR 1 Y) B))).
But this again simplifies, rewriting with the lemma CAR-CONS, and opening
up APPEND, to:
(IMPLIES (AND (LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (NTHCDR 1 Y) (CDR Y))
(NOT (EQUAL (CONS (CAR A) (CDR Y)) Y))
(LISTP Y))
(NOT (EQUAL (FIRSTN 1 Y) (LIST (CAR A))))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS Z X) to
eliminate (CDR Y) and (CAR Y). This generates the formula:
(IMPLIES (AND (LISTP A)
(NOT (LISTP X))
(NOT (LISTP (CDR A)))
(EQUAL (NTHCDR 1 (CONS Z X)) X)
(NOT (EQUAL (CONS (CAR A) X) (CONS Z X))))
(NOT (EQUAL (FIRSTN 1 (CONS Z X))
(LIST (CAR A))))).
But this further simplifies, rewriting with CDR-CONS, CAR-CONS, and
CONS-EQUAL, and opening up the functions SUB1, NUMBERP, EQUAL, NTHCDR, and
FIRSTN, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP A)
(EQUAL (APPEND (CDR A) B) (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (EQUAL B (CDR Y)) T)
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (EQUAL (NTHCDR 1 Y) B) T)).
However this again simplifies, opening up APPEND, to the conjecture:
(IMPLIES (AND (LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL B (CDR Y))
(EQUAL (CONS (CAR A) B) Y))
(EQUAL (NTHCDR 1 Y) B)).
This again simplifies, trivially, to the new conjecture:
(IMPLIES (AND (LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (NTHCDR 1 Y) (CDR Y))).
Applying the lemma CAR-CDR-ELIM, replace Y by (CONS Z X) to eliminate
(CDR Y) and (CAR Y). We thus obtain the following two new goals:
Case 2.1.2.
(IMPLIES (AND (NOT (LISTP Y))
(LISTP A)
(NOT (LISTP (CDR Y)))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) (CDR Y)) Y))
(EQUAL (NTHCDR 1 Y) (CDR Y))).
This further simplifies, obviously, to:
T.
Case 2.1.1.
(IMPLIES (AND (LISTP A)
(NOT (LISTP X))
(NOT (LISTP (CDR A)))
(EQUAL (CONS (CAR A) X) (CONS Z X)))
(EQUAL (NTHCDR 1 (CONS Z X)) X)).
However this further simplifies, appealing to the lemmas CAR-CONS,
CONS-EQUAL, and CDR-CONS, and opening up the functions SUB1, NUMBERP,
EQUAL, and NTHCDR, to:
T.
Case 1. (IMPLIES (NOT (LISTP A))
(EQUAL (EQUAL (APPEND A B) Y)
(IF (NLISTP Y)
(AND (NLISTP A) (EQUAL B Y))
(AND (NOT (LESSP (LENGTH Y) (LENGTH A)))
(EQUAL (FIRSTN (LENGTH A) Y)
(PLIST A))
(EQUAL (NTHCDR (LENGTH A) Y) B))))),
which simplifies, opening up the functions APPEND, NLISTP, LENGTH, EQUAL,
LESSP, NOT, FIRSTN, PLIST, NTHCDR, and AND, to three new formulas:
Case 1.3.
(IMPLIES (AND (NOT (LISTP A))
(NOT (EQUAL B Y))
(LISTP Y))
(NOT (EQUAL Y B))),
which again simplifies, obviously, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP A))
(EQUAL B Y)
(LISTP Y))
(EQUAL (EQUAL Y B) T)).
But this again simplifies, expanding the function EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (LISTP A))
(EQUAL B Y)
(NOT (LISTP Y)))
(EQUAL (EQUAL B Y) T)),
which again simplifies, opening up the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EQUAL-APPEND
(PROVE-LEMMA REPLACE-NTH-REPLACE-NTH
(REWRITE)
(IMPLIES (NOT (EQUAL (FIX I) (FIX J)))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH J Y
(REPLACE-NTH I X L)))))
This formula simplifies, appealing to the lemma CAR-CONS, and unfolding the
definitions of FIX and REPLACE-NTH, to the following three new formulas:
Case 3. (IMPLIES (AND (NOT (NUMBERP J))
(NUMBERP I)
(NOT (EQUAL I 0)))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(CONS Y (CDR (REPLACE-NTH I X L))))).
Appealing to the lemma CAR-CDR-ELIM, we now replace L by (CONS V Z) to
eliminate (CDR L) and (CAR L). We must thus prove two new conjectures:
Case 3.2.
(IMPLIES (AND (NOT (LISTP L))
(NOT (NUMBERP J))
(NUMBERP I)
(NOT (EQUAL I 0)))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(CONS Y (CDR (REPLACE-NTH I X L))))),
which further simplifies, rewriting with CDR-NLISTP and CAR-CONS, to:
(IMPLIES (AND (NOT (LISTP L))
(NOT (NUMBERP J))
(NUMBERP I)
(NOT (EQUAL I 0)))
(EQUAL (REPLACE-NTH I X (CONS Y 0))
(CONS Y (CDR (REPLACE-NTH I X L))))),
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 (FIX I) (FIX J)))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH J Y
(REPLACE-NTH I X L)))),
named *1. Let us appeal to the induction principle. The recursive terms in
the conjecture suggest four inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP I) (p I X J Y L))
(IMPLIES (AND (NOT (ZEROP I))
(p (SUB1 I) X (SUB1 J) Y (CDR L)))
(p I X J Y L))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT I) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instances chosen for J and L. The above induction scheme leads to
three new goals:
Case 3. (IMPLIES (AND (ZEROP I)
(NOT (EQUAL (FIX I) (FIX J))))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH J Y
(REPLACE-NTH I X L)))),
which simplifies, unfolding the functions ZEROP, FIX, REPLACE-NTH, and EQUAL,
to two new goals:
Case 3.2.
(IMPLIES (AND (EQUAL I 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (REPLACE-NTH 0 X
(CONS (CAR L)
(REPLACE-NTH (SUB1 J) Y (CDR L))))
(REPLACE-NTH J Y (CONS X (CDR L))))),
which again simplifies, applying CDR-CONS and CAR-CONS, and opening up the
definitions of EQUAL and REPLACE-NTH, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (REPLACE-NTH I X
(CONS (CAR L)
(REPLACE-NTH (SUB1 J) Y (CDR L))))
(REPLACE-NTH J Y (CONS X (CDR L))))).
This again simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding
the definition of REPLACE-NTH, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (FIX (SUB1 I)) (FIX (SUB1 J)))
(NOT (EQUAL (FIX I) (FIX J))))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH J Y
(REPLACE-NTH I X L)))).
This simplifies, expanding the definitions of ZEROP, FIX, and REPLACE-NTH,
to the following four new conjectures:
Case 2.4.
(IMPLIES
(AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (SUB1 I) (SUB1 J))
(NOT (EQUAL I J))
(NOT (EQUAL J 0))
(NUMBERP J))
(EQUAL (REPLACE-NTH I X
(CONS (CAR L)
(REPLACE-NTH (SUB1 J) Y (CDR L))))
(REPLACE-NTH J Y
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) X (CDR L)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES
(AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (SUB1 I) (SUB1 J))
(NOT (EQUAL I J))
(EQUAL J 0))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(REPLACE-NTH J Y
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) X (CDR L)))))),
which again simplifies, applying EQUAL-SUB1-0, CDR-CONS, CAR-CONS, and
CONS-EQUAL, and opening up the definitions of SUB1, EQUAL, NUMBERP, and
REPLACE-NTH, to:
(IMPLIES (AND (NUMBERP I) (EQUAL I 1))
(EQUAL (CONS X (CDDR L))
(REPLACE-NTH (SUB1 I) X (CDR L)))),
which again simplifies, opening up the functions NUMBERP, SUB1, EQUAL, and
REPLACE-NTH, to:
T.
Case 2.2.
(IMPLIES
(AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (SUB1 I) (SUB1 J))
(NOT (EQUAL I J))
(NOT (NUMBERP J)))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(REPLACE-NTH J Y
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) X (CDR L)))))),
which again simplifies, applying SUB1-NNUMBERP, EQUAL-SUB1-0, CDR-CONS,
CAR-CONS, and CONS-EQUAL, and expanding the functions SUB1, NUMBERP, EQUAL,
and REPLACE-NTH, to the new goal:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL I 1)
(NOT (NUMBERP J)))
(EQUAL (CONS X (CDDR L))
(REPLACE-NTH (SUB1 I) X (CDR L)))),
which again simplifies, unfolding EQUAL, NUMBERP, SUB1, and REPLACE-NTH,
to:
T.
Case 2.1.
(IMPLIES
(AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (SUB1 I) (SUB1 J))
(NOT (NUMBERP J)))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(REPLACE-NTH J Y
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) X (CDR L)))))),
which again simplifies, applying SUB1-NNUMBERP, EQUAL-SUB1-0, CDR-CONS,
CAR-CONS, and CONS-EQUAL, and opening up the definitions of SUB1, NUMBERP,
EQUAL, and REPLACE-NTH, to:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL I 1)
(NOT (NUMBERP J)))
(EQUAL (CONS X (CDDR L))
(REPLACE-NTH (SUB1 I) X (CDR L)))),
which again simplifies, opening up the functions EQUAL, NUMBERP, SUB1, and
REPLACE-NTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (REPLACE-NTH (SUB1 I)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))
(REPLACE-NTH (SUB1 J)
Y
(REPLACE-NTH (SUB1 I) X (CDR L))))
(NOT (EQUAL (FIX I) (FIX J))))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH J Y
(REPLACE-NTH I X L)))),
which simplifies, rewriting with CAR-CONS and CDR-CONS, and unfolding ZEROP,
FIX, and REPLACE-NTH, to the following three new goals:
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (REPLACE-NTH (SUB1 I)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))
(REPLACE-NTH (SUB1 J)
Y
(REPLACE-NTH (SUB1 I) X (CDR L))))
(NOT (EQUAL I J))
(NOT (EQUAL J 0))
(NUMBERP J))
(EQUAL (REPLACE-NTH I X
(CONS (CAR L)
(REPLACE-NTH (SUB1 J) Y (CDR L))))
(CONS (CAR L)
(REPLACE-NTH (SUB1 I)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))))).
However this again simplifies, applying the lemmas CDR-CONS and CAR-CONS,
and unfolding the function REPLACE-NTH, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (REPLACE-NTH (SUB1 I)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))
(REPLACE-NTH (SUB1 J)
Y
(REPLACE-NTH (SUB1 I) X (CDR L))))
(NOT (EQUAL I J))
(EQUAL J 0))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(CONS Y
(REPLACE-NTH (SUB1 I) X (CDR L))))),
which again simplifies, rewriting with CAR-CONS and CDR-CONS, and
expanding the definitions of SUB1, EQUAL, and REPLACE-NTH, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (REPLACE-NTH (SUB1 I)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))
(REPLACE-NTH (SUB1 J)
Y
(REPLACE-NTH (SUB1 I) X (CDR L))))
(NOT (EQUAL I J))
(NOT (NUMBERP J)))
(EQUAL (REPLACE-NTH I X (CONS Y (CDR L)))
(CONS Y
(REPLACE-NTH (SUB1 I) X (CDR L))))).
This again simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding
the definition of REPLACE-NTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
REPLACE-NTH-REPLACE-NTH
(PROVE-LEMMA REPLACE-NTH-IDEMPOTENT
(REWRITE)
(IMPLIES (EQUAL (FIX I) (FIX J))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH J Y L))
(REPLACE-NTH I X L))))
This formula simplifies, applying the lemma CDR-CONS, and unfolding FIX, EQUAL,
and REPLACE-NTH, to:
(IMPLIES (AND (NUMBERP J)
(NUMBERP I)
(EQUAL I J))
(EQUAL (REPLACE-NTH I X (REPLACE-NTH I Y L))
(REPLACE-NTH I X L))),
which again simplifies, obviously, to the new goal:
(IMPLIES (NUMBERP J)
(EQUAL (REPLACE-NTH J X (REPLACE-NTH J Y L))
(REPLACE-NTH J X L))),
which we will name *1.
We will appeal to induction. There are three plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP J) (p J X Y L))
(IMPLIES (AND (NOT (ZEROP J))
(p (SUB1 J) X Y (CDR L)))
(p J X Y L))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT J) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for L. The above induction scheme
leads to two new formulas:
Case 2. (IMPLIES (AND (ZEROP J) (NUMBERP J))
(EQUAL (REPLACE-NTH J X (REPLACE-NTH J Y L))
(REPLACE-NTH J X L))),
which simplifies, applying CDR-CONS, and unfolding ZEROP, NUMBERP, EQUAL,
and REPLACE-NTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP J))
(EQUAL (REPLACE-NTH (SUB1 J)
X
(REPLACE-NTH (SUB1 J) Y (CDR L)))
(REPLACE-NTH (SUB1 J) X (CDR L)))
(NUMBERP J))
(EQUAL (REPLACE-NTH J X (REPLACE-NTH J Y L))
(REPLACE-NTH J X L))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and opening up the
functions ZEROP and REPLACE-NTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REPLACE-NTH-IDEMPOTENT
(PROVE-LEMMA MEMBER-NTH
(REWRITE)
(IMPLIES (LESSP N (LENGTH LIST))
(MEMBER (NTH N LIST) LIST)))
Give the conjecture the name *1.
We will try to prove it by induction. There are four plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST))))
(p N LIST))
(IMPLIES (AND (NOT (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(p N LIST))
(IMPLIES (AND (NOT (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(p (SUB1 N) (CDR LIST)))
(p N LIST))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for LIST. The above induction scheme
generates four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST))))
(LESSP N (LENGTH LIST)))
(MEMBER (NTH N LIST) LIST)),
which simplifies, expanding LENGTH, NOT, OR, EQUAL, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST)))))
(OR (EQUAL N 0) (NOT (NUMBERP N)))
(LESSP N (LENGTH LIST)))
(MEMBER (NTH N LIST) LIST)),
which simplifies, appealing to the lemma MEMBER-CAR-X-X, and unfolding the
definitions of LENGTH, NOT, OR, EQUAL, LESSP, and NTH, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(LESSP N (LENGTH LIST)))
(MEMBER (NTH N LIST) LIST)),
which simplifies, rewriting with SUB1-ADD1, and expanding the functions
LENGTH, NOT, OR, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (LENGTH LIST) 0)
(NOT (NUMBERP (LENGTH LIST)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(MEMBER (NTH (SUB1 N) (CDR LIST))
(CDR LIST))
(LESSP N (LENGTH LIST)))
(MEMBER (NTH N LIST) LIST)).
This simplifies, appealing to the lemmas SUB1-ADD1, BAGINT-SINGLETON, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and opening up the functions
LENGTH, NOT, OR, LESSP, NTH, and MEMBER, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-NTH
(PROVE-LEMMA SWAP-COMMUTATIVE
(REWRITE)
(EQUAL (SWAP J I S) (SWAP I J S)))
WARNING: Note that the rewrite rule SWAP-COMMUTATIVE will be stored so as to
apply only to terms with the nonrecursive function symbol SWAP.
This conjecture simplifies, opening up the function SWAP, to:
(EQUAL (REPLACE-NTH J
(NTH I S)
(REPLACE-NTH I (NTH J S) S))
(REPLACE-NTH I
(NTH J S)
(REPLACE-NTH J (NTH I S) S))),
which we will name *1.
Perhaps we can prove it by induction. There are eight plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (ZEROP J) (p J I S))
(IMPLIES (AND (NOT (ZEROP J))
(p (SUB1 J) (SUB1 I) (CDR S)))
(p J I S))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT J) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for I and S. The above induction
scheme generates two new conjectures:
Case 2. (IMPLIES (ZEROP J)
(EQUAL (REPLACE-NTH J
(NTH I S)
(REPLACE-NTH I (NTH J S) S))
(REPLACE-NTH I
(NTH J S)
(REPLACE-NTH J (NTH I S) S)))),
which simplifies, unfolding the definitions of ZEROP, NTH, EQUAL, and
REPLACE-NTH, to six new goals:
Case 2.6.
(IMPLIES (AND (EQUAL J 0)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (REPLACE-NTH 0
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (NTH (SUB1 I) (CDR S))
(CDR S))))),
which again simplifies, applying CAR-CONS, and unfolding the functions
EQUAL and REPLACE-NTH, to:
(IMPLIES (AND (NOT (EQUAL I 0)) (NUMBERP I))
(EQUAL (CONS (NTH (SUB1 I) (CDR S))
(CDR (REPLACE-NTH I (CAR S) S)))
(REPLACE-NTH I
(CAR S)
(CONS (NTH (SUB1 I) (CDR S))
(CDR S))))).
Applying the lemma SUB1-ELIM, replace I by (ADD1 X) to eliminate (SUB1 I).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We thus obtain the new goal:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0)))
(EQUAL (CONS (NTH X (CDR S))
(CDR (REPLACE-NTH (ADD1 X) (CAR S) S)))
(REPLACE-NTH (ADD1 X)
(CAR S)
(CONS (NTH X (CDR S)) (CDR S))))),
which further simplifies, applying SUB1-ADD1, CDR-CONS, and CAR-CONS, and
opening up REPLACE-NTH, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL J 0) (EQUAL I 0))
(EQUAL (REPLACE-NTH 0
(CAR S)
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (CAR S) (CDR S))))).
This again simplifies, applying CONS-CAR-CDR, and unfolding the
definitions of EQUAL and REPLACE-NTH, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL J 0) (NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH 0
(CAR S)
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (CAR S) (CDR S))))).
However this again simplifies, applying CONS-CAR-CDR, and unfolding the
definitions of REPLACE-NTH and EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (REPLACE-NTH J
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (NTH (SUB1 I) (CDR S))
(CDR S))))).
This again simplifies, using linear arithmetic, applying
REPLACE-NTH-REPLACE-NTH, and opening up the functions FIX and REPLACE-NTH,
to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP J)) (EQUAL I 0))
(EQUAL (REPLACE-NTH J
(CAR S)
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (CAR S) (CDR S))))).
But this again simplifies, applying CONS-CAR-CDR, and opening up the
definitions of EQUAL and REPLACE-NTH, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH J
(CAR S)
(REPLACE-NTH I (CAR S) S))
(REPLACE-NTH I
(CAR S)
(CONS (CAR S) (CDR S))))).
But this again simplifies, appealing to the lemma CONS-CAR-CDR, and
unfolding REPLACE-NTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP J))
(EQUAL (REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S)))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(CDR S)))))
(EQUAL (REPLACE-NTH J
(NTH I S)
(REPLACE-NTH I (NTH J S) S))
(REPLACE-NTH I
(NTH J S)
(REPLACE-NTH J (NTH I S) S)))),
which simplifies, opening up the functions ZEROP, NTH, and REPLACE-NTH, to
three new goals:
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S)))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(CDR S))))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (REPLACE-NTH J
(NTH (SUB1 I) (CDR S))
(CONS (CAR S)
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S))))
(REPLACE-NTH I
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH J
(NTH (SUB1 I) (CDR S))
S)))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
unfolding the function REPLACE-NTH, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S)))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(CDR S))))
(EQUAL I 0))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(REPLACE-NTH I
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH J (CAR S) S)))).
This again simplifies, applying CAR-CONS, and expanding the definitions of
SUB1, EQUAL, NTH, and REPLACE-NTH, to:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(CADR S)
(CONS (NTH (SUB1 J) (CDR S))
(CDDR S)))
(REPLACE-NTH 0
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(CADR S)
(CDR S)))))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH J (CAR S) S))))),
which again simplifies, applying the lemma CAR-CONS, and unfolding EQUAL
and REPLACE-NTH, to:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(CADR S)
(CONS (NTH (SUB1 J) (CDR S))
(CDDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH (SUB1 J)
(CADR S)
(CDR S))))))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH J (CAR S) S))))).
Appealing to the lemma SUB1-ELIM, we now replace J by (ADD1 X) to
eliminate (SUB1 J). We use the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. The result is the formula:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (REPLACE-NTH X
(CADR S)
(CONS (NTH X (CDR S)) (CDDR S)))
(CONS (NTH X (CDR S))
(CDR (REPLACE-NTH X (CADR S) (CDR S))))))
(EQUAL (REPLACE-NTH (ADD1 X)
(CAR S)
(CONS (NTH X (CDR S)) (CDR S)))
(CONS (NTH X (CDR S))
(CDR (REPLACE-NTH (ADD1 X) (CAR S) S))))).
This further simplifies, rewriting with CAR-CONS, CDR-CONS, and SUB1-ADD1,
and expanding the definition of REPLACE-NTH, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S)))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(CDR S))))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(REPLACE-NTH I
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH J (CAR S) S)))).
This again simplifies, rewriting with CAR-CONS, and unfolding the
definition of REPLACE-NTH, to:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(CDR S)))
(REPLACE-NTH (SUB1 I)
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(NTH (SUB1 I) (CDR S))
(CDR S))))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH J (CAR S) S))))),
which further simplifies, applying SUB1-NNUMBERP and CAR-CONS, and
expanding the functions EQUAL, NTH, and REPLACE-NTH, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(CADR S)
(CONS (NTH (SUB1 J) (CDR S))
(CDDR S)))
(REPLACE-NTH 0
(NTH (SUB1 J) (CDR S))
(REPLACE-NTH (SUB1 J)
(CADR S)
(CDR S))))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH J (CAR S) S))))),
which again simplifies, applying CAR-CONS, and expanding the definitions
of EQUAL and REPLACE-NTH, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (REPLACE-NTH (SUB1 J)
(CADR S)
(CONS (NTH (SUB1 J) (CDR S))
(CDDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH (SUB1 J)
(CADR S)
(CDR S)))))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH J
(CAR S)
(CONS (NTH (SUB1 J) (CDR S)) (CDR S)))
(CONS (NTH (SUB1 J) (CDR S))
(CDR (REPLACE-NTH J (CAR S) S))))).
Applying the lemma SUB1-ELIM, replace J by (ADD1 X) to eliminate (SUB1 J).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. This produces:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (REPLACE-NTH X
(CADR S)
(CONS (NTH X (CDR S)) (CDDR S)))
(CONS (NTH X (CDR S))
(CDR (REPLACE-NTH X (CADR S) (CDR S)))))
(NOT (NUMBERP I)))
(EQUAL (REPLACE-NTH (ADD1 X)
(CAR S)
(CONS (NTH X (CDR S)) (CDR S)))
(CONS (NTH X (CDR S))
(CDR (REPLACE-NTH (ADD1 X) (CAR S) S))))),
which finally simplifies, appealing to the lemmas CAR-CONS, CDR-CONS, and
SUB1-ADD1, and expanding REPLACE-NTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
SWAP-COMMUTATIVE
(PROVE-LEMMA MEMBER-REPLACE-NTH
(REWRITE)
(IMPLIES (NOT (MEMBER X L))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))))
This formula simplifies, opening up the functions AND and OR, to the following
three new conjectures:
Case 3. (IMPLIES (AND (NOT (MEMBER X L))
(NOT (EQUAL X V))
(EQUAL X 0))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(LESSP (LENGTH L) I))).
This again simplifies, trivially, to:
(IMPLIES (AND (NOT (MEMBER 0 L))
(NOT (EQUAL 0 V)))
(EQUAL (MEMBER 0 (REPLACE-NTH I V L))
(LESSP (LENGTH L) I))),
which we will name *1.
Case 2. (IMPLIES (AND (NOT (MEMBER X L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
F)).
This again simplifies, clearly, to:
(IMPLIES (AND (NOT (MEMBER X L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH I V L)))),
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 (MEMBER X L))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))).
We named this *1. We will try to prove it by induction. There are four
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP L) (p X I V L))
(IMPLIES (AND (NOT (NLISTP L))
(EQUAL X (CAR L)))
(p X I V L))
(IMPLIES (AND (NOT (NLISTP L))
(NOT (EQUAL X (CAR L)))
(p X (SUB1 I) V (CDR L)))
(p X I V L))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT L) decreases according to
the well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for I. The above induction scheme
leads to the following four new formulas:
Case 4. (IMPLIES (AND (NLISTP L) (NOT (MEMBER X L)))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))).
This simplifies, rewriting with the lemmas MEMBER-NON-LIST, CDR-NLISTP, and
CAR-NLISTP, and expanding the functions NLISTP, REPLACE-NTH, LENGTH, EQUAL,
LESSP, AND, and OR, to the following eight new conjectures:
Case 4.8.
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(EQUAL X 0)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (MEMBER X
(CONS 0
(REPLACE-NTH (SUB1 I) V (CDR L))))
(NUMBERP I))).
This again simplifies, appealing to the lemmas BAGINT-SINGLETON, CAR-CONS,
and LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the
definitions of LISTP, MEMBER, EQUAL, and CONS, to:
T.
Case 4.7.
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(EQUAL X 0)
(NOT (EQUAL I 0))
(NOT (NUMBERP I)))
(EQUAL (MEMBER X (CONS V 0))
(NUMBERP I))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the functions MEMBER and EQUAL, to:
T.
Case 4.6.
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(NOT (NUMBERP I)))
(EQUAL (MEMBER X (CONS V 0)) F)).
However this again simplifies, rewriting with MEMBER-NON-LIST, CDR-CONS,
and CAR-CONS, and expanding the functions MEMBER and EQUAL, to:
T.
Case 4.5.
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(EQUAL I 0))
(EQUAL (MEMBER X (CONS V 0)) F)).
However this again simplifies, applying MEMBER-NON-LIST, CDR-CONS, and
CAR-CONS, and expanding the functions MEMBER and EQUAL, to:
T.
Case 4.4.
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (MEMBER X
(CONS 0
(REPLACE-NTH (SUB1 I) V (CDR L))))
F)).
This again simplifies, rewriting with CDR-CONS and CAR-CONS, and opening
up the function MEMBER, to:
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L))))),
which further simplifies, rewriting with CDR-NLISTP, to:
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (MEMBER X
(REPLACE-NTH (SUB1 I) V 0)))).
Applying the lemma SUB1-ELIM, replace I by (ADD1 Z) to eliminate (SUB1 I).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. This produces:
(IMPLIES (AND (NUMBERP Z)
(NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(NOT (EQUAL (ADD1 Z) 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP Z)
(NOT (LISTP L))
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))),
which has an irrelevant term in it. By eliminating the term we get the
new conjecture:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))),
which we will finally name *1.1.
Case 4.3.
(IMPLIES (AND (NOT (LISTP L))
(EQUAL X V)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (MEMBER X
(CONS 0
(REPLACE-NTH (SUB1 I) V (CDR L))))
T)).
However this again simplifies, rewriting with the lemmas CDR-CONS and
CAR-CONS, and opening up the definition of MEMBER, to the goal:
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL V 0)))
(MEMBER V
(REPLACE-NTH (SUB1 I) V (CDR L)))).
But this further simplifies, rewriting with the lemma CDR-NLISTP, to:
(IMPLIES (AND (NOT (LISTP L))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL V 0)))
(MEMBER V
(REPLACE-NTH (SUB1 I) V 0))).
Appealing to the lemma SUB1-ELIM, we now replace I by (ADD1 Z) to
eliminate (SUB1 I). We rely upon the type restriction lemma noted when
SUB1 was introduced to constrain the new variable. We must thus prove:
(IMPLIES (AND (NUMBERP Z)
(NOT (LISTP L))
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))).
This further simplifies, clearly, to:
(IMPLIES (AND (NUMBERP Z)
(NOT (LISTP L))
(NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))),
which has an irrelevant term in it. By eliminating the term we get:
(IMPLIES (AND (NUMBERP Z) (NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))),
which we will finally name *1.2.
Case 4.2.
(IMPLIES (AND (NOT (LISTP L))
(EQUAL X V)
(EQUAL I 0))
(EQUAL (MEMBER X (CONS V 0)) T)).
This again simplifies, rewriting with BAGINT-SINGLETON, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and unfolding the functions
MEMBER and EQUAL, to:
T.
Case 4.1.
(IMPLIES (AND (NOT (LISTP L))
(EQUAL X V)
(NOT (NUMBERP I)))
(EQUAL (MEMBER X (CONS V 0)) T)).
But this again simplifies, applying the lemmas BAGINT-SINGLETON, CAR-CONS,
and LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding MEMBER and
EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP L))
(EQUAL X (CAR L))
(NOT (MEMBER X L)))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))),
which simplifies, applying MEMBER-CAR-X-X, and expanding the function NLISTP,
to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP L))
(NOT (EQUAL X (CAR L)))
(MEMBER X (CDR L))
(NOT (MEMBER X L)))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))).
This simplifies, applying BAGINT-SINGLETON and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the definitions of
NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP L))
(NOT (EQUAL X (CAR L)))
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH (CDR L)) (SUB1 I)))))
(NOT (MEMBER X L)))
(EQUAL (MEMBER X (REPLACE-NTH I V L))
(OR (EQUAL X V)
(AND (EQUAL X 0)
(LESSP (LENGTH L) I))))),
which simplifies, appealing to the lemma SUB1-ADD1, and expanding the
functions NLISTP, AND, OR, MEMBER, REPLACE-NTH, EQUAL, LENGTH, and LESSP, to
12 new formulas:
Case 1.12.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(NOT (EQUAL 0 V))
(NOT (NUMBERP I)))
(EQUAL (MEMBER 0 (CONS V (CDR L)))
F)),
which again simplifies, appealing to the lemmas CDR-CONS and CAR-CONS, and
unfolding the definitions of MEMBER and EQUAL, to:
T.
Case 1.11.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(NOT (EQUAL 0 V))
(EQUAL I 0))
(EQUAL (MEMBER 0 (CONS V (CDR L)))
F)),
which again simplifies, applying CDR-CONS, CAR-CONS, and MEMBER-NON-LIST,
and opening up the functions SUB1, EQUAL, REPLACE-NTH, MEMBER, and LESSP,
to:
T.
Case 1.10.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(NOT (EQUAL 0 V))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (MEMBER 0
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) V (CDR L))))
(LESSP (LENGTH (CDR L)) (SUB1 I)))).
This again simplifies, appealing to the lemmas CDR-CONS and CAR-CONS, and
unfolding MEMBER, to:
T.
Case 1.9.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(EQUAL 0 V)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (MEMBER 0
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) V (CDR L))))
T)),
which again simplifies, trivially, to:
T.
Case 1.8.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(EQUAL 0 V)
(EQUAL I 0))
(EQUAL (MEMBER 0 (CONS V (CDR L)))
T)).
This again simplifies, obviously, to:
T.
Case 1.7.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(EQUAL X 0)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
(LESSP (LENGTH (CDR L)) (SUB1 I)))
(NOT (EQUAL 0 (CAR L)))
(NOT (MEMBER 0 (CDR L)))
(EQUAL 0 V)
(NOT (NUMBERP I)))
(EQUAL (MEMBER 0 (CONS V (CDR L)))
T)).
This again simplifies, trivially, to:
T.
Case 1.6.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
F)
(NOT (MEMBER X (CDR L)))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (MEMBER X
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) V (CDR L)))))).
But this again simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
unfolding MEMBER, to:
T.
Case 1.5.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
F)
(NOT (MEMBER X (CDR L)))
(EQUAL I 0))
(NOT (MEMBER X (CONS V (CDR L))))),
which again simplifies, applying CDR-CONS and CAR-CONS, and opening up the
definitions of SUB1, EQUAL, REPLACE-NTH, and MEMBER, to:
T.
Case 1.4.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (EQUAL X V))
(NOT (EQUAL X 0))
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
F)
(NOT (MEMBER X (CDR L)))
(NOT (NUMBERP I)))
(NOT (MEMBER X (CONS V (CDR L))))).
But this again simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the function MEMBER, to:
T.
Case 1.3.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(EQUAL X V)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
T)
(NOT (EQUAL V (CAR L)))
(NOT (MEMBER V (CDR L)))
(NOT (EQUAL I 0))
(NUMBERP I))
(MEMBER V
(CONS (CAR L)
(REPLACE-NTH (SUB1 I) V (CDR L))))).
But this again simplifies, applying CAR-CONS, CDR-CONS, BAGINT-SINGLETON,
and LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and unfolding the
definition of MEMBER, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(EQUAL X V)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
T)
(NOT (EQUAL V (CAR L)))
(NOT (MEMBER V (CDR L)))
(EQUAL I 0))
(MEMBER V (CONS V (CDR L)))).
However this again simplifies, applying BAGINT-SINGLETON, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and unfolding SUB1, EQUAL,
REPLACE-NTH, and MEMBER, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(EQUAL X V)
(EQUAL (MEMBER X
(REPLACE-NTH (SUB1 I) V (CDR L)))
T)
(NOT (EQUAL V (CAR L)))
(NOT (MEMBER V (CDR L)))
(NOT (NUMBERP I)))
(MEMBER V (CONS V (CDR L)))).
However this again simplifies, applying BAGINT-SINGLETON, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and expanding the function
MEMBER, to:
T.
So let us turn our attention to:
(IMPLIES (AND (NUMBERP Z) (NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))),
which we named *1.2 above. We will appeal to induction. There is only one
plausible induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP Z) (p V Z))
(IMPLIES (AND (NOT (ZEROP Z)) (p V (SUB1 Z)))
(p V Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT Z) decreases according to the well-founded
relation LESSP in each induction step of the scheme. The above induction
scheme generates the following two new conjectures:
Case 2. (IMPLIES (AND (ZEROP Z)
(NUMBERP Z)
(NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))).
This simplifies, rewriting with BAGINT-SINGLETON, CAR-CONS, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and opening up the definitions
of ZEROP, NUMBERP, CDR, EQUAL, REPLACE-NTH, and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Z))
(MEMBER V (REPLACE-NTH (SUB1 Z) V 0))
(NUMBERP Z)
(NOT (EQUAL V 0)))
(MEMBER V (REPLACE-NTH Z V 0))),
which simplifies, applying CAR-CONS, CDR-CONS, BAGINT-SINGLETON, and
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and unfolding the definitions of
ZEROP, REPLACE-NTH, CAR, CDR, and MEMBER, to:
T.
That finishes the proof of *1.2.
So we now return to:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))),
named *1.1 above. Perhaps we can prove it by induction. There is only one
plausible induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP Z) (p X Z V))
(IMPLIES (AND (NOT (ZEROP Z)) (p X (SUB1 Z) V))
(p X Z V))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT Z) 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 (AND (ZEROP Z)
(NUMBERP Z)
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))).
This simplifies, appealing to the lemmas MEMBER-NON-LIST, CDR-CONS, and
CAR-CONS, and expanding the functions ZEROP, NUMBERP, CDR, EQUAL,
REPLACE-NTH, and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Z))
(NOT (MEMBER X (REPLACE-NTH (SUB1 Z) V 0)))
(NUMBERP Z)
(NOT (EQUAL X V))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (REPLACE-NTH Z V 0)))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and expanding the
functions ZEROP, REPLACE-NTH, CAR, CDR, and MEMBER, to:
T.
That finishes the proof of *1.1, which, in turn, finishes the proof of *1.
Q.E.D.
[ 0.0 0.3 0.1 ]
MEMBER-REPLACE-NTH
(PROVE-LEMMA OCCURRENCES-REPLACE-NTH
(REWRITE)
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST)
(IF (EQUAL V X) 1 0)
(IF (EQUAL X 0)
(DIFFERENCE N (LENGTH LIST))
0))
(IF (AND (EQUAL X (NTH N LIST))
(LESSP N (LENGTH LIST)))
1 0)))
((DO-NOT-GENERALIZE T)))
This simplifies, expanding the function AND, to the following 12 new
conjectures:
Case 12.(IMPLIES (AND (NOT (EQUAL X (NTH N LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X)))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST) 0 0)
0))).
This again simplifies, rewriting with PLUS-ZERO-ARG2 and
EQUAL-OCCURRENCES-ZERO, and unfolding the functions PLUS, ZEROP, EQUAL, and
DIFFERENCE, to the following two new conjectures:
Case 12.2.
(IMPLIES (AND (NOT (EQUAL X (NTH N LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(NOT (MEMBER X LIST)))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
0)).
However this again simplifies, rewriting with the lemmas
MEMBER-REPLACE-NTH and EQUAL-OCCURRENCES-ZERO, to:
T.
Case 12.1.
(IMPLIES (AND (NOT (EQUAL X (NTH N LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(MEMBER X LIST))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(OCCURRENCES X LIST))),
which we will name *1.
Case 11.(IMPLIES (AND (NOT (LESSP N (LENGTH LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X)))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST) 0 0)
0))).
However this again simplifies, appealing to the lemmas PLUS-ZERO-ARG2 and
EQUAL-OCCURRENCES-ZERO, and opening up PLUS, ZEROP, EQUAL, and DIFFERENCE,
to two new goals:
Case 11.2.
(IMPLIES (AND (NOT (LESSP N (LENGTH LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(NOT (MEMBER X LIST)))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
0)),
which again simplifies, rewriting with MEMBER-REPLACE-NTH and
EQUAL-OCCURRENCES-ZERO, to:
T.
Case 11.1.
(IMPLIES (AND (NOT (LESSP N (LENGTH LIST)))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(MEMBER X LIST))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(OCCURRENCES X 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:
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST)
(IF (EQUAL V X) 1 0)
(IF (EQUAL X 0)
(DIFFERENCE N (LENGTH LIST))
0))
(IF (AND (EQUAL X (NTH N LIST))
(LESSP N (LENGTH LIST)))
1 0))),
which we named *1 above. We will appeal to induction. Seven 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 (ZEROP N) (p X N V LIST))
(IMPLIES (AND (NOT (ZEROP N))
(p X (SUB1 N) V (CDR LIST)))
(p X N V LIST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for LIST. The above induction scheme produces the
following two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST)
(IF (EQUAL V X) 1 0)
(IF (EQUAL X 0)
(DIFFERENCE N (LENGTH LIST))
0))
(IF (AND (EQUAL X (NTH N LIST))
(LESSP N (LENGTH LIST)))
1 0)))).
This simplifies, using linear arithmetic, rewriting with CDR-CONS, CAR-CONS,
DIFFERENCE-LEQ-ARG1, PLUS-ZERO-ARG2, and COMMUTATIVITY-OF-PLUS, and
unfolding the functions ZEROP, EQUAL, REPLACE-NTH, OCCURRENCES, LENGTH, NTH,
LESSP, and AND, to 32 new formulas:
Case 2.32.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
1))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
0)
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL (CAR LIST) V)))
(EQUAL (OCCURRENCES (CAR LIST) (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.31.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
1))),
which again simplifies, obviously, to:
T.
Case 2.30.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
1))).
This again simplifies, obviously, to:
T.
Case 2.29.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
1))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (PLUS 1
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
0)
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL (CAR LIST) (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.28.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.27.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
0))),
which again simplifies, obviously, to:
T.
Case 2.26.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
0))).
This again simplifies, obviously, to:
T.
Case 2.25.
(IMPLIES (AND (EQUAL N 0)
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.24.
(IMPLIES (AND (EQUAL N 0)
(NOT (LISTP LIST))
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, and
expanding PLUS and DIFFERENCE, to the new conjecture:
(IMPLIES (AND (NOT (LISTP LIST))
(NOT (EQUAL X V)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, applying CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 2.23.
(IMPLIES (AND (EQUAL N 0)
(NOT (LISTP LIST))
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))).
This again simplifies, obviously, to:
T.
Case 2.22.
(IMPLIES (AND (EQUAL N 0)
(NOT (LISTP LIST))
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1 0) 0))).
This again simplifies, trivially, to:
T.
Case 2.21.
(IMPLIES (AND (EQUAL N 0)
(NOT (LISTP LIST))
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1 0) 0))).
This again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO and
ADD1-EQUAL, and expanding PLUS, DIFFERENCE, and NUMBERP, to:
(IMPLIES (NOT (LISTP LIST))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, rewriting with the lemmas CDR-NLISTP and
MEMBER-NON-LIST, to:
T.
Case 2.20.
(IMPLIES (AND (EQUAL N 0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (LESSP (PLUS 0 (OCCURRENCES X (CDR LIST)))
0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.19.
(IMPLIES (AND (EQUAL N 0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))),
which again simplifies, obviously, to:
T.
Case 2.18.
(IMPLIES (AND (EQUAL N 0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
This again simplifies, trivially, to:
T.
Case 2.17.
(IMPLIES (AND (EQUAL N 0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
But this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (LESSP (PLUS 1 (OCCURRENCES X (CDR LIST)))
0)
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL X X))
(EQUAL (ADD1 (OCCURRENCES X (CDR LIST)))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.16.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
1))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES
(AND (EQUAL (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
0)
(NOT (NUMBERP N))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL (CAR LIST) V)))
(EQUAL (OCCURRENCES (CAR LIST) (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.15.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
1))),
which again simplifies, clearly, to:
T.
Case 2.14.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
1))).
This again simplifies, obviously, to:
T.
Case 2.13.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
1))).
This again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (PLUS 1
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
0)
(NOT (NUMBERP N))
(LISTP LIST)
(NOT (EQUAL (ADD1 (LENGTH (CDR LIST))) 0))
(EQUAL (CAR LIST) (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES (CAR LIST) (CDR LIST))))
1))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.12.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.11.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES X (CDR LIST))))
0))),
which again simplifies, trivially, to:
T.
Case 2.10.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
0))).
This again simplifies, clearly, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (NUMBERP N))
(EQUAL X (CAR LIST))
(LISTP LIST)
(EQUAL (ADD1 (LENGTH (CDR LIST))) 0)
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1
(ADD1 (OCCURRENCES X (CDR LIST))))
0))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST))
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, and
unfolding the definitions of PLUS and DIFFERENCE, to:
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST))
(NOT (EQUAL X V)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, rewriting with CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST))
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))).
This again simplifies, trivially, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST))
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1 0) 0))).
This again simplifies, trivially, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST))
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1 0) 0))).
This again simplifies, applying EQUAL-OCCURRENCES-ZERO and ADD1-EQUAL, and
expanding the definitions of PLUS, DIFFERENCE, and NUMBERP, to the new
goal:
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LISTP LIST)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, applying CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))).
But this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (LESSP (PLUS 0 (OCCURRENCES X (CDR LIST)))
0)
(NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(NOT (EQUAL V X))
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 0 (OCCURRENCES X (CDR LIST)))
0))),
which again simplifies, trivially, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL V X)
(NOT (EQUAL X V)))
(EQUAL (OCCURRENCES X (CDR LIST))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
This again simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL V X)
(EQUAL X V))
(EQUAL (ADD1 (OCCURRENCES V (CDR LIST)))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS 1 (OCCURRENCES X (CDR LIST)))
0)
(NOT (NUMBERP N))
(NOT (EQUAL X (CAR LIST)))
(LISTP LIST)
(EQUAL X X))
(EQUAL (ADD1 (OCCURRENCES X (CDR LIST)))
(DIFFERENCE (PLUS 1 (OCCURRENCES X (CDR LIST)))
0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (ZEROP N))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
(IF (EQUAL V X) 1 0)
(IF (EQUAL X 0)
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0))
(IF (AND (EQUAL X (NTH (SUB1 N) (CDR LIST)))
(LESSP (SUB1 N) (LENGTH (CDR LIST))))
1 0))))
(EQUAL (OCCURRENCES X (REPLACE-NTH N V LIST))
(DIFFERENCE (PLUS (OCCURRENCES X LIST)
(IF (EQUAL V X) 1 0)
(IF (EQUAL X 0)
(DIFFERENCE N (LENGTH LIST))
0))
(IF (AND (EQUAL X (NTH N LIST))
(LESSP N (LENGTH LIST)))
1 0)))),
which simplifies, rewriting with CDR-CONS, CAR-CONS, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG1, COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, SUB1-ADD1,
DIFFERENCE-SUB1-ARG2, and PLUS-DIFFERENCE-ARG2, and opening up ZEROP, AND,
REPLACE-NTH, OCCURRENCES, PLUS, NTH, LENGTH, EQUAL, and DIFFERENCE, to the
following 330 new formulas:
Case 1.330.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL (OCCURRENCES X (CDR LIST)) 0)))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(OCCURRENCES X (CDR LIST)))).
This again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL (OCCURRENCES X (CDR LIST)) 0)))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(OCCURRENCES X (CDR LIST)))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.329.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (LISTP LIST))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
0)),
which again simplifies, rewriting with the lemmas PLUS-ZERO-ARG2,
EQUAL-OCCURRENCES-ZERO, CAR-NLISTP, DIFFERENCE-LEQ-ARG1,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and BAGINT-SINGLETON, and
opening up PLUS, ZEROP, EQUAL, DIFFERENCE, and LESSP, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(MEMBER X (CDR LIST))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(OCCURRENCES X (CDR LIST))))
(LISTP LIST)).
This again simplifies, applying the lemmas CDR-NLISTP and MEMBER-NON-LIST,
to:
T.
Case 1.328.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (CAR LIST)))
(EQUAL (OCCURRENCES X (CDR LIST)) 0))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
0)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES
(AND (LESSP (PLUS 0 0 0) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0 0) 0))
(NOT (EQUAL X (CAR LIST)))
(EQUAL (OCCURRENCES X (CDR LIST)) 0))
(EQUAL (DIFFERENCE (PLUS 0 0 0) 0)
0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.327.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(EQUAL X (CAR LIST))
(NOT (EQUAL (ADD1 (OCCURRENCES X (CDR LIST)))
0)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(ADD1 (OCCURRENCES X (CDR LIST))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(NOT (EQUAL V (CAR LIST)))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(LISTP LIST)
(NOT (EQUAL (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST))))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.326.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (LISTP LIST))
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
0)),
which again simplifies, rewriting with CAR-NLISTP, and opening up the
definition of EQUAL, to:
T.
Case 1.325.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(EQUAL X (CAR LIST))
(EQUAL (ADD1 (OCCURRENCES X (CDR LIST)))
0))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.324.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE 0 0))),
which again simplifies, applying the lemmas PLUS-ZERO-ARG2,
EQUAL-OCCURRENCES-ZERO, CAR-NLISTP, DIFFERENCE-LEQ-ARG1,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and BAGINT-SINGLETON, and
unfolding the definitions of PLUS, ZEROP, EQUAL, DIFFERENCE, and LESSP, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(MEMBER X (CDR LIST))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(OCCURRENCES X (CDR LIST)))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST)))))
(LISTP LIST)).
However this again simplifies, applying CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 1.323.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE 0 0))).
However this again simplifies, rewriting with PLUS-ZERO-ARG2,
EQUAL-OCCURRENCES-ZERO, CAR-NLISTP, DIFFERENCE-LEQ-ARG1,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and BAGINT-SINGLETON, and
opening up PLUS, ZEROP, EQUAL, DIFFERENCE, and LESSP, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(MEMBER X (CDR LIST))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(OCCURRENCES X (CDR LIST))))
(LISTP LIST)),
which again simplifies, applying CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 1.322.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE 0 0))).
But this again simplifies, applying CAR-NLISTP, and unfolding the
definition of EQUAL, to:
T.
Case 1.321.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE 0 0))).
This again simplifies, applying CAR-NLISTP, and unfolding the definition
of EQUAL, to:
T.
Case 1.320.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(EQUAL X (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE 0 1))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.319.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(EQUAL X (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE 0 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.318.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES X (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.318.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(NOT (EQUAL V (CAR LIST)))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.318.1.
(IMPLIES
(AND (LESSP (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(NOT (EQUAL V (CAR LIST)))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.317.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES X (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.317.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(NOT (EQUAL V (CAR LIST)))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST))))))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.317.1.
(IMPLIES
(AND (LESSP (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(NOT (EQUAL V (CAR LIST)))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST))))))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES (CAR LIST) (CDR LIST)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.316.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.316.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.316.1.
(IMPLIES
(AND (LESSP (OCCURRENCES X (CDR LIST)) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.315.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.315.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.315.1.
(IMPLIES
(AND (LESSP (OCCURRENCES X (CDR LIST)) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.314.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(EQUAL X (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL X (CAR LIST)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(DIFFERENCE (ADD1 (OCCURRENCES X (CDR LIST)))
1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.313.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0))
(EQUAL X (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL X (CAR LIST))))
(EQUAL (DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 0 0)
0)
(DIFFERENCE (OCCURRENCES X (CDR LIST))
1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.312.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, trivially, to:
T.
Case 1.311.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))).
This again simplifies, trivially, to:
T.
Case 1.310.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))).
But this again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL X 0)))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES X (CDR LIST)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.309.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL X 0)))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES X (CDR LIST)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.308.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, trivially, to:
T.
Case 1.307.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))).
This again simplifies, trivially, to:
T.
Case 1.306.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL (CAR LIST) 0)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST))))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.305.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0))
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL (CAR LIST) 0)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST))))))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.304.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))),
which again simplifies, trivially, to:
T.
Case 1.303.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, obviously, to:
T.
Case 1.302.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, trivially, to:
T.
Case 1.301.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, trivially, to:
T.
Case 1.300.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))).
But this again simplifies, applying CDR-NLISTP, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, CAR-NLISTP, EQUAL-OCCURRENCES-ZERO, and ADD1-EQUAL, and
unfolding the definitions of PLUS, NUMBERP, ZEROP, EQUAL, DIFFERENCE,
LESSP, and ADD1, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X 0))
(ADD1 (OCCURRENCES X (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, appealing to the lemmas CDR-NLISTP and
MEMBER-NON-LIST, to:
T.
Case 1.299.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))),
which again simplifies, applying CDR-NLISTP, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, CAR-NLISTP, EQUAL-OCCURRENCES-ZERO, and ADD1-EQUAL, and
unfolding the functions PLUS, NUMBERP, ZEROP, EQUAL, DIFFERENCE, and ADD1,
to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X 0))
(ADD1 (OCCURRENCES X (CDR LIST))))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, rewriting with CDR-NLISTP and MEMBER-NON-LIST, to:
T.
Case 1.298.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))).
But this again simplifies, rewriting with CAR-NLISTP, and unfolding the
function EQUAL, to:
T.
Case 1.297.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))).
But this again simplifies, applying CAR-NLISTP, and unfolding the function
EQUAL, to:
T.
Case 1.296.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, clearly, to:
T.
Case 1.295.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.294.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(LESSP (PLUS 0 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.293.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N 0) 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.292.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))).
This again simplifies, clearly, to:
T.
Case 1.291.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL
(ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))).
This again simplifies, clearly, to:
T.
Case 1.290.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0))
(LESSP (PLUS 0 (OCCURRENCES V (CDR LIST)))
1))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, trivially, to:
T.
Case 1.289.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, clearly, to:
T.
Case 1.288.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(LESSP (PLUS 0 0) 1)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, obviously, to:
T.
Case 1.287.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N 0) 0) 1)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, trivially, to:
T.
Case 1.286.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 (OCCURRENCES V (CDR LIST)))
1)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS 0 (OCCURRENCES V (CDR LIST)))
1)))).
This again simplifies, clearly, to:
T.
Case 1.285.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1)))
(EQUAL
(OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1)))).
This again simplifies, trivially, to:
T.
Case 1.284.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 0) 1))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS 0 0) 1)))).
This again simplifies, trivially, to:
T.
Case 1.283.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 0) 1))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS 0 0) 1)))).
This again simplifies, trivially, to:
T.
Case 1.282.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N 0) 0) 1))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N 0) 0)
1)))).
This again simplifies, obviously, to:
T.
Case 1.281.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N 0) 0) 1))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N 0) 0)
1)))).
This again simplifies, clearly, to:
T.
Case 1.280.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))).
This again simplifies, obviously, to:
T.
Case 1.279.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))).
This again simplifies, clearly, to:
T.
Case 1.278.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL X 0)))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES X (CDR LIST)))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.277.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL X (CAR LIST)))
(NOT (EQUAL X 0)))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES X (CDR LIST)))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.276.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, trivially, to:
T.
Case 1.275.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))).
This again simplifies, obviously, to:
T.
Case 1.274.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL (CAR LIST) 0)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST))))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.273.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL (CAR LIST) 0))
(EQUAL (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES (CAR LIST) (CDR LIST))
1 0)
0))
(NOT (EQUAL (CAR LIST)
(NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL (CAR LIST) 0)))
(EQUAL (ADD1 (OCCURRENCES (CAR LIST)
(REPLACE-NTH (SUB1 N)
(CAR LIST)
(CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES (CAR LIST)
(CDR LIST))))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.272.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))),
which again simplifies, trivially, to:
T.
Case 1.271.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, trivially, to:
T.
Case 1.270.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, clearly, to:
T.
Case 1.269.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, obviously, to:
T.
Case 1.268.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))).
This again simplifies, rewriting with CDR-NLISTP, PLUS-ZERO-ARG2,
PLUS-ADD1-ARG2, CAR-NLISTP, EQUAL-OCCURRENCES-ZERO, and ADD1-EQUAL, and
unfolding the functions PLUS, NUMBERP, ZEROP, EQUAL, DIFFERENCE, LESSP,
and ADD1, to the new formula:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X 0))
(ADD1 (OCCURRENCES X (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (CDR LIST)))),
which again simplifies, rewriting with the lemmas CDR-NLISTP and
MEMBER-NON-LIST, to:
T.
Case 1.267.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))),
which again simplifies, rewriting with the lemmas CDR-NLISTP,
PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, CAR-NLISTP, EQUAL-OCCURRENCES-ZERO, and
ADD1-EQUAL, and expanding PLUS, NUMBERP, ZEROP, EQUAL, DIFFERENCE, and
ADD1, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) X 0))
(ADD1 (OCCURRENCES X (CDR LIST))))
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL X 0)))
(NOT (MEMBER X (CDR LIST)))).
But this again simplifies, rewriting with CDR-NLISTP and MEMBER-NON-LIST,
to:
T.
Case 1.266.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))).
But this again simplifies, appealing to the lemma CAR-NLISTP, and opening
up the function EQUAL, to:
T.
Case 1.265.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))),
which again simplifies, applying CAR-NLISTP, and expanding EQUAL, to:
T.
Case 1.264.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.263.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)),
which again simplifies, clearly, to:
T.
Case 1.262.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(LESSP (PLUS 0 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.261.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N 0) 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)),
which again simplifies, clearly, to:
T.
Case 1.260.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.259.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL
(ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))),
which again simplifies, trivially, to:
T.
Case 1.258.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0))
(LESSP (PLUS 0 (OCCURRENCES V (CDR LIST)))
1))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.257.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)),
which again simplifies, obviously, to:
T.
Case 1.256.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(LESSP (PLUS 0 0) 1)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.255.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N 0) 0) 1)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)),
which again simplifies, clearly, to:
T.
Case 1.254.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 (OCCURRENCES V (CDR LIST)))
1)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS 0 (OCCURRENCES V (CDR LIST)))
1)))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.253.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1)))
(EQUAL
(OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))
1)))),
which again simplifies, clearly, to:
T.
Case 1.252.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 0) 1))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS 0 0) 1)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.251.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0 0) 1))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS 0 0) 1)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.250.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N 0) 0) 1))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N 0) 0)
1)))),
which again simplifies, obviously, to:
T.
Case 1.249.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL X 0))
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST)) 1 0)
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N 0) 0) 1))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N 0) 0)
1)))).
This again simplifies, clearly, to:
T.
Case 1.248.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, obviously, to:
T.
Case 1.247.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, clearly, to:
T.
Case 1.246.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, trivially, to:
T.
Case 1.245.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, clearly, to:
T.
Case 1.244.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.243.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.242.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.241.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.240.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))),
which again simplifies, trivially, to:
T.
Case 1.239.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, obviously, to:
T.
Case 1.238.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, clearly, to:
T.
Case 1.237.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, trivially, to:
T.
Case 1.236.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))).
But this again simplifies, appealing to the lemmas CDR-NLISTP,
PLUS-DIFFERENCE-ARG2, and CAR-NLISTP, and unfolding the functions
OCCURRENCES, EQUAL, PLUS, DIFFERENCE, and LESSP, to:
T.
Case 1.235.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))),
which again simplifies, applying the lemmas CDR-NLISTP,
PLUS-DIFFERENCE-ARG2, and CAR-NLISTP, and expanding the definitions of
OCCURRENCES, EQUAL, PLUS, DIFFERENCE, and LESSP, to:
T.
Case 1.234.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))),
which again simplifies, rewriting with CDR-NLISTP, PLUS-DIFFERENCE-ARG2,
CAR-NLISTP, and PLUS-ZERO-ARG2, and unfolding OCCURRENCES, EQUAL, PLUS,
DIFFERENCE, LESSP, ZEROP, and ADD1, to the following three new goals:
Case 1.234.3.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
However this again simplifies, applying the lemma EQUAL-DIFFERENCE-0, to
the goal:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
This further simplifies, rewriting with CDR-NLISTP, EQUAL-SUB1-0, and
ADD1-SUB1, and opening up the functions LENGTH, EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 1.234.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
However this again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, to
the new conjecture:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which further simplifies, rewriting with CDR-NLISTP and EQUAL-SUB1-0,
and unfolding LENGTH, EQUAL, and LESSP, to:
T.
Case 1.234.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
However this again simplifies, applying EQUAL-DIFFERENCE-0 and
EQUAL-OCCURRENCES-ZERO, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which further simplifies, applying CDR-NLISTP and EQUAL-SUB1-0, and
opening up LENGTH, EQUAL, and LESSP, to:
T.
Case 1.233.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))).
However this again simplifies, applying CDR-NLISTP, PLUS-DIFFERENCE-ARG2,
CAR-NLISTP, and PLUS-ZERO-ARG2, and opening up the definitions of
OCCURRENCES, EQUAL, PLUS, DIFFERENCE, LESSP, ZEROP, and ADD1, to the
following three new conjectures:
Case 1.233.3.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
But this again simplifies, applying EQUAL-DIFFERENCE-0, to the new
conjecture:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)),
which further simplifies, applying CDR-NLISTP, EQUAL-SUB1-0, and
ADD1-SUB1, and opening up LENGTH, EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 1.233.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
But this again simplifies, rewriting with the lemma
EQUAL-OCCURRENCES-ZERO, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
However this further simplifies, rewriting with CDR-NLISTP and
EQUAL-SUB1-0, and unfolding the functions LENGTH, EQUAL, and LESSP, to:
T.
Case 1.233.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
This again simplifies, appealing to the lemmas EQUAL-DIFFERENCE-0 and
EQUAL-OCCURRENCES-ZERO, to the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
However this further simplifies, applying CDR-NLISTP and EQUAL-SUB1-0,
and expanding the functions LENGTH, EQUAL, and LESSP, to:
T.
Case 1.232.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 1))).
This again simplifies, obviously, to:
T.
Case 1.231.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 1))).
This again simplifies, clearly, to:
T.
Case 1.230.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 1))).
This again simplifies, clearly, to:
T.
Case 1.229.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 1))).
This again simplifies, clearly, to:
T.
Case 1.228.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
1))).
This again simplifies, clearly, to:
T.
Case 1.227.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
1))).
This again simplifies, trivially, to:
T.
Case 1.226.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
1))).
This again simplifies, obviously, to:
T.
Case 1.225.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
1))).
This again simplifies, trivially, to:
T.
Case 1.224.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
0))).
This again simplifies, trivially, to:
T.
Case 1.223.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
0))).
This again simplifies, obviously, to:
T.
Case 1.222.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
0))).
This again simplifies, obviously, to:
T.
Case 1.221.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
0))).
This again simplifies, trivially, to:
T.
Case 1.220.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))).
However this again simplifies, using linear arithmetic, appealing to the
lemmas DIFFERENCE-LEQ-ARG1, EQUAL-LENGTH-0, EQUAL-SUB1-0,
PLUS-DIFFERENCE-ARG2, EQUAL-PLUS-0, EQUAL-OCCURRENCES-ZERO, SUB1-ADD1,
PLUS-ZERO-ARG2, PLUS-ADD1-ARG1, and ADD1-EQUAL, and opening up EQUAL, PLUS,
DIFFERENCE, LESSP, ZEROP, SUB1, NUMBERP, and ADD1, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SUB1 N) 0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(OCCURRENCES 0 (CDR LIST)))).
This again simplifies, using linear arithmetic, rewriting with
EQUAL-SUB1-0, CDR-CONS, CAR-CONS, DIFFERENCE-LEQ-ARG1, PLUS-ZERO-ARG2, and
EQUAL-OCCURRENCES-ZERO, and expanding EQUAL, REPLACE-NTH, OCCURRENCES,
PLUS, ZEROP, DIFFERENCE, and NTH, to:
T.
Case 1.219.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))).
But this again simplifies, using linear arithmetic, to three new
conjectures:
Case 1.219.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.219.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.219.1.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.218.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, rewriting with the lemmas
DIFFERENCE-LEQ-ARG1, EQUAL-LENGTH-0, EQUAL-SUB1-0, PLUS-DIFFERENCE-ARG2,
EQUAL-PLUS-0, EQUAL-OCCURRENCES-ZERO, SUB1-ADD1, PLUS-ZERO-ARG2,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and BAGINT-SINGLETON, and
unfolding the definitions of EQUAL, PLUS, DIFFERENCE, LESSP, ZEROP, CONS,
LISTP, SUB1, and NUMBERP, to two new goals:
Case 1.218.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SUB1 N) 0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST)))
(NOT (MEMBER 0 (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)),
which again simplifies, using linear arithmetic, rewriting with
EQUAL-SUB1-0, CDR-CONS, CAR-CONS, DIFFERENCE-LEQ-ARG1, PLUS-ZERO-ARG2,
and EQUAL-OCCURRENCES-ZERO, and expanding EQUAL, REPLACE-NTH,
OCCURRENCES, PLUS, ZEROP, LESSP, NTH, and MEMBER, to:
T.
Case 1.218.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SUB1 N) 0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST)))
(MEMBER 0 (CDR LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(OCCURRENCES 0 (CDR LIST)))).
However this again simplifies, using linear arithmetic, rewriting with
the lemmas EQUAL-SUB1-0, CDR-CONS, CAR-CONS, DIFFERENCE-LEQ-ARG1,
PLUS-ZERO-ARG2, EQUAL-OCCURRENCES-ZERO,
LISTP-BAGINT-WITH-SINGLETON-IMPLIES-MEMBER, and BAGINT-SINGLETON, and
unfolding the functions EQUAL, REPLACE-NTH, OCCURRENCES, PLUS, ZEROP,
CONS, LISTP, DIFFERENCE, and NTH, to:
T.
Case 1.217.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to three new goals:
Case 1.217.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.217.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.217.1.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.216.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, obviously, to:
T.
Case 1.215.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, trivially, to:
T.
Case 1.214.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, obviously, to:
T.
Case 1.213.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, trivially, to:
T.
Case 1.212.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, using linear arithmetic, to four new goals:
Case 1.212.4.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.212.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.212.2.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.212.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.211.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to four new goals:
Case 1.211.4.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.211.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.211.2.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.211.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.210.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to four new conjectures:
Case 1.210.4.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.210.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.210.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.210.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.209.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to four new goals:
Case 1.209.4.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.209.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.209.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.209.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.208.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
1))),
which again simplifies, trivially, to:
T.
Case 1.207.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
1))).
This again simplifies, clearly, to:
T.
Case 1.206.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
1))).
This again simplifies, clearly, to:
T.
Case 1.205.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
1))).
This again simplifies, clearly, to:
T.
Case 1.204.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, trivially, to:
T.
Case 1.203.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, trivially, to:
T.
Case 1.202.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, obviously, to:
T.
Case 1.201.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, obviously, to:
T.
Case 1.200.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, trivially, to:
T.
Case 1.199.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, obviously, to:
T.
Case 1.198.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, trivially, to:
T.
Case 1.197.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 0))).
This again simplifies, obviously, to:
T.
Case 1.196.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.195.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.194.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.193.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.192.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))),
which again simplifies, clearly, to:
T.
Case 1.191.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, trivially, to:
T.
Case 1.190.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, clearly, to:
T.
Case 1.189.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
0))).
This again simplifies, trivially, to:
T.
Case 1.188.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))).
However this again simplifies, applying CDR-NLISTP, PLUS-DIFFERENCE-ARG2,
and CAR-NLISTP, and opening up the definitions of OCCURRENCES, EQUAL, PLUS,
DIFFERENCE, and LESSP, to:
T.
Case 1.187.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))).
This again simplifies, rewriting with the lemmas CDR-NLISTP,
PLUS-DIFFERENCE-ARG2, and CAR-NLISTP, and expanding the functions
OCCURRENCES, EQUAL, PLUS, DIFFERENCE, and LESSP, to:
T.
Case 1.186.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))),
which again simplifies, rewriting with CDR-NLISTP, PLUS-DIFFERENCE-ARG2,
CAR-NLISTP, and PLUS-ZERO-ARG2, and expanding OCCURRENCES, EQUAL, PLUS,
DIFFERENCE, LESSP, ZEROP, and ADD1, to the following three new conjectures:
Case 1.186.3.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
However this again simplifies, applying the lemma EQUAL-DIFFERENCE-0, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
This further simplifies, appealing to the lemmas CDR-NLISTP,
EQUAL-SUB1-0, and ADD1-SUB1, and expanding the definitions of LENGTH,
EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 1.186.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND
(NOT (EQUAL (PLUS 1 (LENGTH (CDR LIST)))
0))
(NUMBERP (PLUS 1 (LENGTH (CDR LIST))))
(NOT (LESSP (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 (PLUS 1 (LENGTH (CDR LIST))))))
(EQUAL
(OCCURRENCES 0
(REPLACE-NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
V
(CDR LIST)))
0)
(NOT (EQUAL 0
(NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1
(PLUS 1 (LENGTH (CDR LIST))))).
But this again simplifies, rewriting with PLUS-ADD1-ARG1, SUB1-ADD1,
CDR-NLISTP, EQUAL-LENGTH-0, MEMBER-REPLACE-NTH, EQUAL-OCCURRENCES-ZERO,
and PLUS-ZERO-ARG2, and opening up EQUAL, PLUS, MEMBER, LENGTH, LESSP,
ZEROP, NUMBERP, ADD1, SUB1, and NTH, to:
T.
Case 1.186.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
But this again simplifies, rewriting with EQUAL-DIFFERENCE-0 and
EQUAL-OCCURRENCES-ZERO, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES
(AND (NOT (EQUAL (PLUS 1 (LENGTH (CDR LIST)))
0))
(NUMBERP (PLUS 1 (LENGTH (CDR LIST))))
(NOT (LESSP (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 (PLUS 1 (LENGTH (CDR LIST))))))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
V
(CDR LIST))))
(NOT (EQUAL 0
(NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1
(PLUS 1 (LENGTH (CDR LIST))))).
However this again simplifies, rewriting with the lemmas PLUS-ADD1-ARG1,
SUB1-ADD1, CDR-NLISTP, EQUAL-LENGTH-0, MEMBER-REPLACE-NTH, and
PLUS-ZERO-ARG2, and unfolding the definitions of EQUAL, PLUS, MEMBER,
LENGTH, LESSP, ZEROP, NUMBERP, ADD1, SUB1, and NTH, to:
T.
Case 1.185.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
0))),
which again simplifies, applying CDR-NLISTP, PLUS-DIFFERENCE-ARG2,
CAR-NLISTP, and PLUS-ZERO-ARG2, and opening up OCCURRENCES, EQUAL, PLUS,
DIFFERENCE, LESSP, ZEROP, and ADD1, to the following three new formulas:
Case 1.185.3.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)).
But this again simplifies, rewriting with EQUAL-DIFFERENCE-0, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
N)),
which further simplifies, rewriting with CDR-NLISTP, EQUAL-SUB1-0, and
ADD1-SUB1, and expanding LENGTH, EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 1.185.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)).
However this again simplifies, using linear arithmetic, to the goal:
(IMPLIES
(AND
(NOT (EQUAL (PLUS 1 (LENGTH (CDR LIST)))
0))
(NUMBERP (PLUS 1 (LENGTH (CDR LIST))))
(NOT (LESSP (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 (PLUS 1 (LENGTH (CDR LIST))))))
(EQUAL
(OCCURRENCES 0
(REPLACE-NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
V
(CDR LIST)))
0)
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1
(PLUS 1 (LENGTH (CDR LIST))))).
But this again simplifies, appealing to the lemmas PLUS-ADD1-ARG1,
SUB1-ADD1, CDR-NLISTP, EQUAL-LENGTH-0, MEMBER-REPLACE-NTH,
EQUAL-OCCURRENCES-ZERO, and PLUS-ZERO-ARG2, and opening up the functions
EQUAL, PLUS, MEMBER, LENGTH, LESSP, ZEROP, NUMBERP, and ADD1, to:
T.
Case 1.185.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL (DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which again simplifies, rewriting with EQUAL-DIFFERENCE-0 and
EQUAL-OCCURRENCES-ZERO, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1 N)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES
(AND (NOT (EQUAL (PLUS 1 (LENGTH (CDR LIST)))
0))
(NUMBERP (PLUS 1 (LENGTH (CDR LIST))))
(NOT (LESSP (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
(LENGTH (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST))
(SUB1 (PLUS 1 (LENGTH (CDR LIST))))))
(NOT (MEMBER 0
(REPLACE-NTH (SUB1 (PLUS 1 (LENGTH (CDR LIST))))
V
(CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0)))
(EQUAL 1
(PLUS 1 (LENGTH (CDR LIST))))).
This again simplifies, applying PLUS-ADD1-ARG1, SUB1-ADD1, CDR-NLISTP,
EQUAL-LENGTH-0, MEMBER-REPLACE-NTH, and PLUS-ZERO-ARG2, and unfolding
the functions EQUAL, PLUS, MEMBER, LENGTH, LESSP, ZEROP, NUMBERP, and
ADD1, to:
T.
Case 1.184.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 1) 1))).
This again simplifies, clearly, to:
T.
Case 1.183.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 1) 1))).
This again simplifies, trivially, to:
T.
Case 1.182.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 0) 1))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.181.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (LESSP 0 N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 0) 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.180.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
1))),
which again simplifies, trivially, to:
T.
Case 1.179.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 1) 0))
1))).
This again simplifies, trivially, to:
T.
Case 1.178.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.177.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(LESSP 0 N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS 0 (DIFFERENCE (PLUS N 0) 0))
1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.176.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
0))),
which again simplifies, trivially, to:
T.
Case 1.175.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
0))).
This again simplifies, clearly, to:
T.
Case 1.174.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
0))).
This again simplifies, trivially, to:
T.
Case 1.173.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
0))).
This again simplifies, obviously, to:
T.
Case 1.172.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))).
This again simplifies, using linear arithmetic, to two new goals:
Case 1.172.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.172.1.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.171.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.171.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.171.1.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.170.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.170.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.170.1.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.169.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.169.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.169.1.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.168.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, trivially, to:
T.
Case 1.167.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, trivially, to:
T.
Case 1.166.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, clearly, to:
T.
Case 1.165.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, obviously, to:
T.
Case 1.164.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))).
This again simplifies, using linear arithmetic, to three new formulas:
Case 1.164.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.164.2.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.164.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.163.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to three new conjectures:
Case 1.163.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.163.2.
(IMPLIES
(AND (LESSP (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.163.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.162.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to three new formulas:
Case 1.162.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.162.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.162.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.161.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to three new conjectures:
Case 1.161.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.161.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.161.1.
(IMPLIES
(AND (LESSP (PLUS N 0)
(ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(NOT (EQUAL V 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.160.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
1)
1))),
which again simplifies, trivially, to:
T.
Case 1.159.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 1)
1))).
This again simplifies, trivially, to:
T.
Case 1.158.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
0)
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.157.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (LESSP (ADD1 (LENGTH (CDR LIST))) N))
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST)) 0)
1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.156.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
1))),
which again simplifies, clearly, to:
T.
Case 1.155.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(EQUAL V 0)
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 1)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, obviously, to:
T.
Case 1.154.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(EQUAL 0 (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(DIFFERENCE (PLUS (ADD1 (OCCURRENCES 0 (CDR LIST)))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
1))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.153.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LENGTH (CDR LIST))))
(EQUAL X 0)
(NOT (EQUAL V X))
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
0
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL 0 (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(LESSP (ADD1 (LENGTH (CDR LIST))) N)
(NOT (EQUAL V 0))
(NOT (EQUAL 0 (CAR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
(DIFFERENCE (PLUS N 0)
(ADD1 (LENGTH (CDR LIST)))))
1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.152.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.152.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL 0 (CAR LIST)))
(EQUAL 0 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES 0 (CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.152.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL 0 (CAR LIST)))
(EQUAL 0 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES 0 (CDR LIST)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(EQUAL V 0))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, using linear arithmetic, to three new goals:
Case 1.151.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(EQUAL 0 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES 0 (CDR LIST)))))),
which again simplifies, applying the lemmas ADD1-SUB1, PLUS-ADD1-ARG1,
and PLUS-DIFFERENCE-ARG2, and unfolding EQUAL, PLUS, and LESSP, to:
T.
Case 1.151.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(EQUAL 0 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES 0 (CDR LIST)))))),
which again simplifies, using linear arithmetic, applying ADD1-SUB1,
PLUS-ADD1-ARG1, DIFFERENCE-LEQ-ARG1, PLUS-DIFFERENCE-ARG2, EQUAL-PLUS-0,
EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, EQUAL-LENGTH-0,
DIFFERENCE-ADD1-ARG2, COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2,
CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and ADD1-EQUAL, and opening up the
definitions of EQUAL, PLUS, DIFFERENCE, ZEROP, NUMBERP, and FIX, to the
following six new goals:
Case 1.151.2.6.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(NOT (LESSP (LENGTH (CDR LIST)) N)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
0)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.151.2.5.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 0))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.2.4.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.2.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL 0 (SUB1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.2.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL 0 (SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.2.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (MEMBER 0 (CDR LIST)))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(EQUAL 0 (CAR LIST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.
(IMPLIES
(AND (LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(EQUAL 0 0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(OCCURRENCES 0 (CDR LIST)))))),
which again simplifies, using linear arithmetic, rewriting with
SUB1-ADD1, ADD1-SUB1, PLUS-ADD1-ARG1, DIFFERENCE-LEQ-ARG1,
PLUS-DIFFERENCE-ARG2, EQUAL-PLUS-0, EQUAL-OCCURRENCES-ZERO,
PLUS-ZERO-ARG2, EQUAL-LENGTH-0, DIFFERENCE-ADD1-ARG2,
COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, CORRECTNESS-OF-CANCEL-EQUAL-PLUS,
and ADD1-EQUAL, and opening up the definitions of LESSP, EQUAL, PLUS,
DIFFERENCE, ZEROP, NUMBERP, and FIX, to the following six new
conjectures:
Case 1.151.1.6.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(NOT (LESSP (LENGTH (CDR LIST)) N)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
0)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.5.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 0))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.4.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL 0 (SUB1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL 0 (CAR LIST)))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL 0 (SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.151.1.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (MEMBER 0 (CDR LIST)))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(EQUAL 0 (CAR LIST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.150.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))),
which again simplifies, clearly, to:
T.
Case 1.149.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0)))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0
(OCCURRENCES V (CDR LIST)))))).
This again simplifies, obviously, to:
T.
Case 1.148.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))).
This again simplifies, using linear arithmetic, to two new goals:
Case 1.148.2.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL 0 (CAR LIST))
(EQUAL 0 0))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES 0 (CDR LIST))))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.148.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL 0 (CAR LIST))
(EQUAL 0 0))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES 0 (CDR LIST))))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(EQUAL V 0))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, using linear arithmetic, to three new formulas:
Case 1.147.3.
(IMPLIES
(AND (LESSP (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(EQUAL 0 0))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES 0 (CDR LIST))))))),
which again simplifies, rewriting with ADD1-SUB1, PLUS-ADD1-ARG1, and
PLUS-DIFFERENCE-ARG2, and opening up the definitions of EQUAL, PLUS, and
LESSP, to:
T.
Case 1.147.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(EQUAL 0 0))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES 0 (CDR LIST))))))).
However this again simplifies, using linear arithmetic, applying
ADD1-SUB1, PLUS-ADD1-ARG1, DIFFERENCE-LEQ-ARG1, PLUS-DIFFERENCE-ARG2,
EQUAL-PLUS-0, EQUAL-OCCURRENCES-ZERO, PLUS-ZERO-ARG2, EQUAL-LENGTH-0,
DIFFERENCE-ADD1-ARG2, COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, ADD1-EQUAL,
and CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and expanding EQUAL, PLUS,
DIFFERENCE, ZEROP, NUMBERP, FIX, and ADD1, to the following six new
goals:
Case 1.147.2.6.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(NOT (LESSP (LENGTH (CDR LIST)) N)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
0)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.147.2.5.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 0))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.2.4.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.2.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL 0 (SUB1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.2.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL 0 (SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.2.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (MEMBER 0 (CDR LIST)))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(NOT (EQUAL 0 (CAR LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.
(IMPLIES
(AND (LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES 0 (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(EQUAL 0 0))
(EQUAL (ADD1 (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES 0 (CDR LIST))))))),
which again simplifies, using linear arithmetic, rewriting with
SUB1-ADD1, ADD1-SUB1, PLUS-ADD1-ARG1, DIFFERENCE-LEQ-ARG1,
PLUS-DIFFERENCE-ARG2, EQUAL-PLUS-0, EQUAL-OCCURRENCES-ZERO,
PLUS-ZERO-ARG2, EQUAL-LENGTH-0, DIFFERENCE-ADD1-ARG2,
COMMUTATIVITY-OF-PLUS, PLUS-ADD1-ARG2, ADD1-EQUAL, and
CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and unfolding the definitions of LESSP,
EQUAL, PLUS, DIFFERENCE, ZEROP, NUMBERP, FIX, and ADD1, to the following
six new conjectures:
Case 1.147.1.6.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(NOT (LESSP (LENGTH (CDR LIST)) N)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
0)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.5.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 0))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.4.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(MEMBER 0 (CDR LIST))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 0))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL (OCCURRENCES 0 (CDR LIST))
(ADD1 (PLUS (OCCURRENCES 0 (CDR LIST))
(SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.3.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(LISTP (CDR LIST)))
(EQUAL 0 (SUB1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.2.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
(PLUS (OCCURRENCES 0 (CDR LIST)) 1))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL 0 (CAR LIST))
(LESSP (LENGTH (CDR LIST)) N)
(NOT (LISTP (CDR LIST))))
(EQUAL 0 (SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.147.1.1.
(IMPLIES
(AND (LESSP (SUB1 N) (LENGTH (CDR LIST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (MEMBER 0 (CDR LIST)))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 (CDR LIST)))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST))
(NOT (EQUAL 0 (CAR LIST)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.146.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(LISTP LIST)
(NOT (LESSP N (ADD1 (LENGTH (CDR LIST)))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))),
which again simplifies, clearly, to:
T.
Case 1.145.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(LISTP LIST)
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))))).
This again simplifies, clearly, to:
T.
Case 1.144.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
But this again simplifies, rewriting with CDR-NLISTP, ADD1-SUB1,
PLUS-ADD1-ARG1, PLUS-DIFFERENCE-ARG2, and CAR-NLISTP, and unfolding the
functions OCCURRENCES, EQUAL, PLUS, DIFFERENCE, and LESSP, to:
T.
Case 1.143.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
This again simplifies, applying CDR-NLISTP, ADD1-SUB1, PLUS-ADD1-ARG1,
PLUS-DIFFERENCE-ARG2, and CAR-NLISTP, and unfolding the functions
OCCURRENCES, EQUAL, PLUS, and DIFFERENCE, to:
T.
Case 1.142.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))).
But this again simplifies, applying CDR-NLISTP, ADD1-SUB1, PLUS-ADD1-ARG1,
PLUS-DIFFERENCE-ARG2, CAR-NLISTP, PLUS-ZERO-ARG2, and ADD1-EQUAL, and
opening up the definitions of OCCURRENCES, EQUAL, PLUS, DIFFERENCE, LESSP,
ZEROP, ADD1, and NUMBERP, to the following three new conjectures:
Case 1.142.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE N (LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
(DIFFERENCE N (LENGTH (CDR LIST))))
(NOT (LISTP LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
N)).
This again simplifies, applying MEMBER-REPLACE-NTH and
EQUAL-OCCURRENCES-ZERO, and unfolding MEMBER and EQUAL, to the new goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
(DIFFERENCE N (LENGTH (CDR LIST))))
(NOT (LISTP LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
N)),
which further simplifies, rewriting with CDR-NLISTP and EQUAL-SUB1-0,
and expanding LENGTH, EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 1.142.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (DIFFERENCE N (LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
0))
(LISTP LIST)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.142.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
1)
(NOT (LISTP LIST)))
(EQUAL 1 N)),
which further simplifies, rewriting with the lemmas CDR-NLISTP and
EQUAL-SUB1-0, and expanding the definitions of LENGTH, EQUAL, and LESSP,
to:
T.
Case 1.141.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(EQUAL V 0)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS (DIFFERENCE N 0) 0)))),
which again simplifies, rewriting with the lemmas CDR-NLISTP, ADD1-SUB1,
PLUS-ADD1-ARG1, PLUS-DIFFERENCE-ARG2, CAR-NLISTP, PLUS-ZERO-ARG2, and
ADD1-EQUAL, and expanding the functions OCCURRENCES, EQUAL, PLUS,
DIFFERENCE, ZEROP, ADD1, and NUMBERP, to three new goals:
Case 1.141.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(NOT (EQUAL (DIFFERENCE N (LENGTH (CDR LIST)))
0))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
(DIFFERENCE N (LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
N)),
which again simplifies, rewriting with MEMBER-REPLACE-NTH and
EQUAL-OCCURRENCES-ZERO, and unfolding MEMBER and EQUAL, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
(DIFFERENCE N (LENGTH (CDR LIST))))
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
N)),
which further simplifies, applying the lemmas CDR-NLISTP and
EQUAL-SUB1-0, and opening up the functions LENGTH, EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 1.141.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LENGTH (CDR LIST)) (SUB1 N))
(EQUAL (DIFFERENCE N (LENGTH (CDR LIST)))
0)
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
0)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST)))))
(LISTP LIST)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.141.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (LENGTH (CDR LIST)) (SUB1 N)))
(EQUAL (OCCURRENCES 0
(REPLACE-NTH (SUB1 N) 0 0))
1)
(NOT (EQUAL 0 (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST)))
(EQUAL 1 N)),
which further simplifies, rewriting with CDR-NLISTP and EQUAL-SUB1-0,
and expanding LENGTH, EQUAL, and LESSP, to:
T.
Case 1.140.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))).
This again simplifies, clearly, to:
T.
Case 1.139.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(NOT (EQUAL V (CAR LIST))))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(ADD1 (PLUS 0 0)))).
This again simplifies, clearly, to:
T.
Case 1.138.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (LISTP LIST))
(NOT (LESSP N 0))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))).
This again simplifies, obviously, to:
T.
Case 1.137.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(NOT (EQUAL V (NTH (SUB1 N) (CDR LIST))))
(NOT (LISTP LIST))
(NOT (EQUAL V 0))
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (PLUS 0 0)))).
This again simplifies, trivially, to:
T.
Case 1.136.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.135.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.134.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(NOT (EQUAL V 0))
(LESSP (PLUS 0 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, clearly, to:
T.
Case 1.133.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(NOT (LISTP LIST))
(LESSP N 0)
(EQUAL V 0)
(LESSP (PLUS (DIFFERENCE N 0) 0) 1)
(EQUAL V (CAR LIST)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
0)).
This again simplifies, obviously, to:
T.
Case 1.132.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(NOT (EQUAL V 0))
(NOT (LESSP (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL (ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS 0
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))).
This again simplifies, clearly, to:
T.
Case 1.131.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(EQUAL V (CAR LIST))
(EQUAL V 0)
(NOT (LESSP (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))
(EQUAL
(ADD1 (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST))))
(ADD1 (DIFFERENCE (PLUS (DIFFERENCE N
(ADD1 (LENGTH (CDR LIST))))
(ADD1 (OCCURRENCES V (CDR LIST))))
1)))).
This again simplifies, clearly, to:
T.
Case 1.130.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL X (NTH (SUB1 N) (CDR LIST))))
(EQUAL X 0)
(EQUAL V X)
(EQUAL (OCCURRENCES X
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
(DIFFERENCE (PLUS (OCCURRENCES X (CDR LIST))
1
(DIFFERENCE (SUB1 N)
(LENGTH (CDR LIST))))
0))
(EQUAL V (NTH (SUB1 N) (CDR LIST)))
(LISTP LIST)
(LESSP N (ADD1 (LENGTH (CDR LIST))))
(NOT (EQUAL V (CAR LIST)))
(NOT (EQUAL V 0))
(LESSP (PLUS 0 (OCCURRENCES V (CDR LIST)))
1))
(EQUAL (OCCURRENCES V
(REPLACE-NTH (SUB1 N) V (CDR LIST)))
0)).
This again simplifies, trivially, to:
T.