(NOTE-LIB "mc20-2" T)
Nqthm-1992 mods: ("DEFN-SK")
Loading ./yu/mc20-2.lib
Finished loading ./yu/mc20-2.lib
Loading ./yu/mc20-2.o
Loading ./yu/0mc20-2.o
Finished loading ./yu/0mc20-2.o
Loading ./yu/1mc20-2.o
Finished loading ./yu/1mc20-2.o
Finished loading ./yu/mc20-2.o
(#./yu/mc20-2.lib #./yu/mc20-2)
(PROVE-LEMMA ILESSP-LESSP
(REWRITE)
(IMPLIES (AND (NUMBERP X) (NUMBERP Y))
(EQUAL (ILESSP X Y) (LESSP X Y)))
((ENABLE ILESSP)))
WARNING: Note that the rewrite rule ILESSP-LESSP will be stored so as to
apply only to terms with the nonrecursive function symbol ILESSP.
This conjecture simplifies, expanding the definitions of NEGP and ILESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ILESSP-LESSP
(PROVE-LEMMA IDIFFERENCE-NUMBERP
(REWRITE)
(EQUAL (NUMBERP (IDIFFERENCE X Y))
(NOT (ILESSP X Y)))
((ENABLE IDIFFERENCE IPLUS ILESSP INTEGERP)))
This formula can be simplified, using the abbreviation IDIFFERENCE, to:
(EQUAL (NUMBERP (IPLUS X (INEG Y)))
(NOT (ILESSP X Y))),
which simplifies, opening up the functions IZEROP, INTEGERP, NEGATIVE-GUTS,
NEGP, FIX-INT, INEG, ILESSP, and NOT, to 34 new formulas:
Case 34.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X)))
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (NEGATIVE-GUTS Y)))
T)),
which again simplifies, expanding NEGATIVE-GUTS, NEGP, IPLUS, and EQUAL, to:
T.
Case 33.(IMPLIES (AND (EQUAL X (MINUS 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (NEGATIVE-GUTS Y)))
T)),
which again simplifies, applying NUMBERP-INTEGERP, INTEGERP-FIX-INT, and
IPLUS-0, and expanding the functions NEGATIVE-GUTS, IZEROP, and EQUAL, to:
T.
Case 32.(IMPLIES (AND (NOT (NEGATIVEP X))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (NEGATIVE-GUTS Y)))
T)).
But this again simplifies, opening up the functions NEGATIVE-GUTS, NEGP,
IPLUS, and EQUAL, to:
T.
Case 31.(IMPLIES (AND (NOT (NEGATIVEP X))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)),
which again simplifies, trivially, to:
T.
Case 30.(IMPLIES (AND (NOT (NEGATIVEP X))
(EQUAL Y (MINUS 0))
(NOT (LESSP X Y))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
However this again simplifies, rewriting with IPLUS-0, and opening up
NUMBERP, EQUAL, LESSP, IZEROP, INTEGERP, NEGP, and FIX-INT, to:
T.
Case 29.(IMPLIES (AND (NOT (NEGATIVEP X))
(NOT (NEGATIVEP Y))
(NOT (LESSP X Y))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
However this again simplifies, applying IPLUS-0, and unfolding the
definitions of LESSP, IZEROP, INTEGERP, NEGP, FIX-INT, and EQUAL, to:
T.
Case 28.(IMPLIES (AND (NOT (NEGATIVEP X))
(NOT (LESSP X Y))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
This again simplifies, rewriting with IPLUS-0, and opening up the
definitions of EQUAL, LESSP, IZEROP, INTEGERP, NEGP, and FIX-INT, to:
T.
Case 27.(IMPLIES (AND (EQUAL X (MINUS 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
This again simplifies, clearly, to:
T.
Case 26.(IMPLIES (AND (EQUAL X (MINUS 0))
(EQUAL Y (MINUS 0))
(NOT (LESSP X Y))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
However this again simplifies, opening up the functions LESSP, NUMBERP,
IPLUS, and EQUAL, to:
T.
Case 25.(IMPLIES (AND (EQUAL X (MINUS 0))
(EQUAL Y (MINUS 0))
(NOT (LESSP X Y))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)),
which again simplifies, trivially, to:
T.
Case 24.(IMPLIES (AND (EQUAL X (MINUS 0))
(NOT (NEGATIVEP Y))
(NOT (LESSP X Y))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) T)).
But this again simplifies, opening up LESSP, IPLUS, NUMBERP, and EQUAL, to:
T.
Case 23.(IMPLIES (AND (EQUAL X (MINUS 0))
(NOT (NEGATIVEP Y))
(NOT (LESSP X Y))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)),
which again simplifies, expanding NEGATIVEP, LESSP, IPLUS, NUMBERP, and
EQUAL, to:
T.
Case 22.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X)))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) T)),
which again simplifies, trivially, to:
T.
Case 21.(IMPLIES (AND (NOT (NEGATIVEP X))
(EQUAL Y (MINUS 0))
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
T)).
This again simplifies, trivially, to:
T.
Case 20.(IMPLIES (AND (NOT (NEGATIVEP X))
(NOT (NEGATIVEP Y))
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
T)).
This again simplifies, applying NEGATIVE-GUTS-MINUS, and unfolding
NEGATIVE-GUTS, NEGP, IPLUS, and EQUAL, to:
T.
Case 19.(IMPLIES (AND (EQUAL X (MINUS 0))
(EQUAL Y (MINUS 0))
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
T)).
This again simplifies, obviously, to:
T.
Case 18.(IMPLIES (AND (EQUAL X (MINUS 0))
(NOT (NEGATIVEP Y))
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
T)).
But this again simplifies, using linear arithmetic, to:
T.
Case 17.(IMPLIES (AND (NOT (NEGATIVEP X))
(EQUAL Y (MINUS 0))
(LESSP X Y)
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, using linear arithmetic, to:
T.
Case 16.(IMPLIES (AND (EQUAL Y (MINUS 0))
(LESSP X Y)
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, trivially, to:
T.
Case 15.(IMPLIES (AND (NOT (NEGATIVEP Y))
(LESSP X Y)
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) F)).
This again simplifies, opening up the function LESSP, to:
T.
Case 14.(IMPLIES (AND (NOT (NEGATIVEP X))
(NOT (NEGATIVEP Y))
(LESSP X Y)
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, using linear arithmetic, to:
T.
Case 13.(IMPLIES (AND (EQUAL X (MINUS 0))
(EQUAL Y (MINUS 0))
(LESSP X Y)
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, using linear arithmetic, to:
T.
Case 12.(IMPLIES (AND (EQUAL X (MINUS 0))
(NOT (NEGATIVEP Y))
(LESSP X Y)
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, using linear arithmetic, to:
T.
Case 11.(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)),
which again simplifies, rewriting with NEGATIVEP-GUTS0, INTEGERP-FIX-INT,
and IPLUS-0, and unfolding NEGATIVE-GUTS, EQUAL, NEGP, INTEGERP, LESSP, and
IZEROP, to:
T.
Case 10.(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL Y (MINUS 0))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) F)).
But this again simplifies, applying INTEGERP-FIX-INT and IPLUS-0, and
opening up the definitions of NEGATIVE-GUTS, NUMBERP, IZEROP, INTEGERP, NEGP,
and EQUAL, to:
T.
Case 9. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL Y (MINUS 0))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)).
This again simplifies, trivially, to:
T.
Case 8. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (NEGATIVEP Y))
(NOT (NUMBERP Y)))
(EQUAL (NUMBERP (IPLUS X 0)) F)).
However this again simplifies, rewriting with INTEGERP-FIX-INT and IPLUS-0,
and unfolding the functions NEGATIVE-GUTS, IZEROP, INTEGERP, NEGP, and EQUAL,
to:
T.
Case 7. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (NEGATIVEP Y))
(EQUAL Y 0))
(EQUAL (NUMBERP (IPLUS X 0)) F)).
However this again simplifies, appealing to the lemmas INTEGERP-FIX-INT and
IPLUS-0, and expanding NEGATIVE-GUTS, NEGATIVEP, IZEROP, INTEGERP, NEGP, and
EQUAL, to:
T.
Case 6. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (NEGATIVEP Y))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
F)),
which again simplifies, appealing to the lemmas PLUS-COMMUTATIVITY and
NEGATIVE-GUTS-MINUS, and unfolding the functions NEGATIVE-GUTS, NEGP, IPLUS,
and EQUAL, to:
T.
Case 5. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL Y (MINUS 0))
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
F)),
which again simplifies, clearly, to:
T.
Case 4. (IMPLIES (AND (EQUAL X (MINUS 0))
(EQUAL Y (MINUS 0))
(LESSP X Y)
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
F)).
This again simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (NOT (NEGATIVEP Y))
(LESSP X Y)
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
F)).
This again simplifies, rewriting with the lemmas PLUS-COMMUTATIVITY and
NEGATIVE-GUTS-MINUS, and expanding NEGP, NEGATIVE-GUTS, IPLUS, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (NEGATIVEP X))
(EQUAL Y (MINUS 0))
(LESSP X Y)
(NUMBERP Y)
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (MINUS Y)))
F)),
which again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))
(NOT (EQUAL Y 0)))
(EQUAL (NUMBERP (IPLUS X (NEGATIVE-GUTS Y)))
F)).
But this again simplifies, expanding the functions NEGATIVE-GUTS, NEGP,
IPLUS, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.1 ]
IDIFFERENCE-NUMBERP
(PROVE-LEMMA IDIFFERENCE-EQUAL-0
(REWRITE)
(EQUAL (EQUAL (IDIFFERENCE X Y) 0)
(EQUAL (FIX-INT X) (FIX-INT Y)))
((ENABLE IDIFFERENCE IPLUS INTEGERP)))
This conjecture can be simplified, using the abbreviation IDIFFERENCE, to the
goal:
(EQUAL (EQUAL (IPLUS X (INEG Y)) 0)
(EQUAL (FIX-INT X) (FIX-INT Y))).
This simplifies, opening up the definitions of IZEROP, INTEGERP, NEGATIVE-GUTS,
NEGP, FIX-INT, and INEG, to the following 52 new goals:
Case 52.(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (EQUAL X Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
However this again simplifies, applying NUMBERP-INTEGERP, INTEGERP-FIX-INT,
and IPLUS-0, and unfolding the functions NUMBERP and IZEROP, to:
T.
Case 51.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(NOT (EQUAL 0 Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, trivially, to:
T.
Case 50.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(NOT (EQUAL 0 Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, trivially, to:
T.
Case 49.(IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, rewriting with INTEGERP-FIX-INT and IPLUS-0, and
opening up the functions NUMBERP, NEGATIVE-GUTS, IZEROP, INTEGERP, and NEGP,
to:
T.
Case 48.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NUMBERP X)
(NOT (EQUAL X 0)))
(NOT (EQUAL (IPLUS X 0) 0))).
But this again simplifies, rewriting with NUMBERP-INTEGERP, INTEGERP-FIX-INT,
and IPLUS-0, and opening up the function IZEROP, to:
T.
Case 47.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X 0)))
(NOT (EQUAL (IPLUS X 0) 0))).
But this again simplifies, applying INTEGERP-FIX-INT and IPLUS-0, and
opening up the functions NEGATIVE-GUTS, IZEROP, INTEGERP, and NEGP, to:
T.
Case 46.(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL Y (MINUS 0))
(NUMBERP X)
(NOT (EQUAL X 0)))
(NOT (EQUAL (IPLUS X 0) 0))).
But this again simplifies, applying NUMBERP-INTEGERP, INTEGERP-FIX-INT, and
IPLUS-0, and expanding the functions NUMBERP and IZEROP, to:
T.
Case 45.(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL Y (MINUS 0))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X 0)))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, applying INTEGERP-FIX-INT and IPLUS-0, and unfolding
the definitions of NUMBERP, NEGATIVE-GUTS, IZEROP, INTEGERP, and NEGP, to:
T.
Case 44.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NUMBERP X)
(NOT (EQUAL X Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, obviously, to:
T.
Case 43.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(NOT (EQUAL 0 Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, obviously, to:
T.
Case 42.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(NOT (EQUAL 0 Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, trivially, to:
T.
Case 41.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(EQUAL Y 0))
(NOT (EQUAL (IPLUS X 0) 0))).
This again simplifies, obviously, to:
T.
Case 40.(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(NOT (EQUAL (IPLUS X (NEGATIVE-GUTS Y))
0))).
This again simplifies, unfolding the definitions of NEGATIVE-GUTS, NEGP, and
IPLUS, to the goal:
(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))))
(NOT (EQUAL (DIFFERENCE (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))
0))).
This again simplifies, applying DIFFERENCE=0, and unfolding NEGATIVE-GUTS,
to the new conjecture:
(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))))
(LESSP (NEGATIVE-GUTS X)
(NEGATIVE-GUTS Y))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (EQUAL (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS X))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS X)
(NEGATIVE-GUTS X))))
(LESSP (NEGATIVE-GUTS X)
(NEGATIVE-GUTS X))).
But this again simplifies, expanding NEGATIVE-GUTS, to:
T.
Case 39.(IMPLIES (AND (NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(NOT (EQUAL (IPLUS X (NEGATIVE-GUTS Y))
0))),
which again simplifies, rewriting with NUMBERP-INTEGERP, INTEGERP-FIX-INT,
IPLUS-0, and NEGATIVEP-GUTS0, and opening up the definitions of NUMBERP,
NEGATIVE-GUTS, IZEROP, INTEGERP, and NEGP, to:
T.
Case 38.(IMPLIES (AND (NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(NOT (EQUAL (IPLUS X (NEGATIVE-GUTS Y))
0))).
This again simplifies, applying NUMBERP-INTEGERP, INTEGERP-FIX-INT, IPLUS-0,
and NEGATIVEP-GUTS0, and unfolding the functions NEGATIVE-GUTS, IZEROP,
INTEGERP, NEGP, FIX-INT, and EQUAL, to:
T.
Case 37.(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(NOT (EQUAL (IPLUS X (NEGATIVE-GUTS Y))
0))).
But this again simplifies, rewriting with NEGATIVEP-GUTS0 and PLUS-EQUAL-0,
and expanding the definitions of NEGATIVE-GUTS, NEGP, IPLUS, and INTEGERP,
to:
T.
Case 36.(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(EQUAL X Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
But this again simplifies, unfolding the definitions of NUMBERP, IPLUS, and
EQUAL, to:
T.
Case 35.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(EQUAL 0 Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, applying IPLUS-0, and unfolding the definitions of
NUMBERP, EQUAL, IZEROP, INTEGERP, NEGP, and FIX-INT, to:
T.
Case 34.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(EQUAL 0 Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
This again simplifies, opening up the functions NUMBERP, EQUAL, and IPLUS,
to:
T.
Case 33.(IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, obviously, to:
T.
Case 32.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NUMBERP X)
(EQUAL X 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
But this again simplifies, opening up NUMBERP, IPLUS, and EQUAL, to:
T.
Case 31.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NOT (NUMBERP X))
(NOT (NEGATIVEP X)))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, applying the lemma IPLUS-0, and opening up IZEROP,
INTEGERP, NEGP, FIX-INT, and EQUAL, to:
T.
Case 30.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NOT (NUMBERP X))
(EQUAL X (MINUS 0)))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, expanding NUMBERP, IPLUS, and EQUAL, to:
T.
Case 29.(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NEGATIVEP Y))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, obviously, to:
T.
Case 28.(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL Y (MINUS 0))
(NUMBERP X)
(EQUAL X 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
But this again simplifies, unfolding the functions NUMBERP, IPLUS, and EQUAL,
to:
T.
Case 27.(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL Y (MINUS 0))
(NOT (NUMBERP X))
(NOT (NEGATIVEP X)))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, rewriting with IPLUS-0, and unfolding NUMBERP,
IZEROP, INTEGERP, NEGP, FIX-INT, and EQUAL, to:
T.
Case 26.(IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL Y (MINUS 0))
(NOT (NUMBERP X))
(EQUAL X (MINUS 0)))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
However this again simplifies, expanding the functions NUMBERP, IPLUS, and
EQUAL, to:
T.
Case 25.(IMPLIES (AND (NOT (NUMBERP Y))
(NEGATIVEP Y)
(EQUAL Y (MINUS 0))
(EQUAL X 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, opening up the definitions of NUMBERP, NEGATIVEP,
IPLUS, and EQUAL, to:
T.
Case 24.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NUMBERP X)
(EQUAL X Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, clearly, to:
T.
Case 23.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(EQUAL 0 Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
This again simplifies, trivially, to:
T.
Case 22.(IMPLIES (AND (NOT (NUMBERP X))
(NEGATIVEP X)
(EQUAL X (MINUS 0))
(EQUAL 0 Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)).
This again simplifies, unfolding the definitions of NUMBERP, NEGATIVEP,
EQUAL, and IPLUS, to:
T.
Case 21.(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0)))
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X Y)
(EQUAL Y 0))
(EQUAL (EQUAL (IPLUS X 0) 0) T)),
which again simplifies, clearly, to:
T.
Case 20.(IMPLIES (AND (NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X Y)
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(EQUAL (EQUAL (IPLUS X (NEGATIVE-GUTS Y)) 0)
T)).
However this again simplifies, rewriting with NEGATIVEP-GUTS0 and
DIFFERENCE-X-X, and unfolding the definitions of NEGATIVE-GUTS, INTEGERP,
NEGP, MINUS, and IPLUS, to:
(IMPLIES (AND (NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(NOT (LESSP (NEGATIVE-GUTS Y)
(NEGATIVE-GUTS Y)))),
which again simplifies, using linear arithmetic, to:
T.
Case 19.(IMPLIES (AND (NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(EQUAL (EQUAL (IPLUS X (NEGATIVE-GUTS Y)) 0)
T)),
which again simplifies, clearly, to:
T.
Case 18.(IMPLIES (AND (NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(EQUAL (EQUAL (IPLUS X (NEGATIVE-GUTS Y)) 0)
T)).
This again simplifies, trivially, to:
T.
Case 17.(IMPLIES (AND (NUMBERP X)
(EQUAL X Y)
(NOT (EQUAL Y 0))
(NEGATIVEP Y)
(NOT (EQUAL Y (MINUS 0))))
(EQUAL (EQUAL (IPLUS X (NEGATIVE-GUTS Y)) 0)
T)).
This again simplifies, clearly, to:
T.
Case 16.(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
However this again simplifies, applying NEGATIVE-GUTS-MINUS, and unfolding
the definitions of NEGATIVE-GUTS, NEGP, and IPLUS, to:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(NOT (LESSP X Y)))
(NOT (EQUAL (DIFFERENCE X Y) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 15.(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))),
which again simplifies, trivially, to:
T.
Case 14.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
But this again simplifies, applying MINUS-INTEGERP, INTEGERP-FIX-INT, and
IPLUS-0, and expanding IZEROP, INTEGERP, NEGP, FIX-INT, and EQUAL, to:
T.
Case 13.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
This again simplifies, obviously, to:
T.
Case 12.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
But this again simplifies, rewriting with the lemmas MINUS-INTEGERP,
INTEGERP-FIX-INT, and IPLUS-0, and opening up NUMBERP and IZEROP, to:
T.
Case 11.(IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(NOT (EQUAL 0 Y))
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))),
which again simplifies, clearly, to:
T.
Case 10.(IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
However this again simplifies, applying PLUS-COMMUTATIVITY and
NEGATIVE-GUTS-MINUS, and expanding the definitions of NEGATIVE-GUTS, NEGP,
and IPLUS, to:
T.
Case 9. (IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(NOT (EQUAL X Y))
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(NOT (EQUAL (IPLUS X (MINUS Y)) 0))).
This again simplifies, clearly, to:
T.
Case 8. (IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(EQUAL X Y)
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, applying DIFFERENCE-X-X and NEGATIVE-GUTS-MINUS, and
opening up the functions MINUS, NEGATIVE-GUTS, NEGP, and IPLUS, to the new
conjecture:
(IMPLIES (AND (NUMBERP Y) (NOT (EQUAL Y 0)))
(NOT (LESSP Y Y))),
which again simplifies, using linear arithmetic, to:
T.
Case 7. (IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(EQUAL X Y)
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)),
which again simplifies, trivially, to:
T.
Case 6. (IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, trivially, to:
T.
Case 5. (IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(NOT (NEGATIVEP X))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, obviously, to:
T.
Case 4. (IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, obviously, to:
T.
Case 3. (IMPLIES (AND (NUMBERP Y)
(NOT (NUMBERP X))
(EQUAL X (MINUS 0))
(EQUAL 0 Y)
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X Y)
(NOT (EQUAL Y 0))
(NOT (NEGATIVEP Y)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NUMBERP Y)
(NEGATIVEP X)
(NOT (EQUAL X (MINUS 0)))
(EQUAL X Y)
(NOT (EQUAL Y 0))
(EQUAL Y (MINUS 0)))
(EQUAL (EQUAL (IPLUS X (MINUS Y)) 0)
T)).
This again simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.1 0.1 ]
IDIFFERENCE-EQUAL-0
(ENABLE GET-NTH-0)
[ 0.0 0.0 0.0 ]
GET-NTH-0-ON
(ENABLE PUT-NTH-0)
[ 0.0 0.0 0.0 ]
PUT-NTH-0-ON
(PROVE-LEMMA STRLEN-UB NIL
(IMPLIES (STRINGP I N LST)
(LESSP (STRLEN I N LST) N)))
This formula simplifies, expanding the function STRINGP, to the formula:
(IMPLIES (LESSP (SLEN I N LST) N)
(LESSP (STRLEN I N LST) N)).
Give the above formula the name *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 (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates four new goals:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)),
which simplifies, opening up the definitions of NULL, STRLEN, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)),
which simplifies, using linear arithmetic and rewriting with the lemma
SLEN-UBOUND, to two new goals:
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)),
which again simplifies, opening up the function LESSP, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP N)
(EQUAL (SLEN (ADD1 I) N LST) N)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP N N))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)),
which again simplifies, expanding NULL and STRLEN, to the formula:
(IMPLIES (AND (EQUAL (SLEN (ADD1 I) N LST) N)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP N N))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN (ADD1 I) N LST) N)).
This again simplifies, rewriting with SLEN-REC, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP (STRLEN (ADD1 I) N LST) N)
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)).
This simplifies, expanding the functions NULL and STRLEN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LESSP (SLEN I N LST) N))
(LESSP (STRLEN I N LST) N)).
This simplifies, using linear arithmetic and rewriting with the lemma
SLEN-LBOUND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-UB
(PROVE-LEMMA STRLEN-LB
(REWRITE)
(NOT (LESSP (STRLEN I N LST) I)))
WARNING: Note that the proposed lemma STRLEN-LB is to be stored as zero type
prescription rules, zero compound recognizer rules, one linear rule, and zero
replacement rules.
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture, both of which are unflawed. So we will choose the one
suggested by the largest number of nonprimitive recursive functions. We will
induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces the following three new
conjectures:
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (STRLEN I N LST) I))).
This simplifies, expanding the functions NULL, STRLEN, and EQUAL, to the new
goal:
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(NOT (LESSP I I))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (STRLEN (ADD1 I) N LST)
(ADD1 I))))
(NOT (LESSP (STRLEN I N LST) I))),
which simplifies, applying SUB1-ADD1 and GET-NTH-0, and unfolding the
definitions of NULL, LESSP, and STRLEN, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NUMBERP I)
(NOT (LESSP (SUB1 (STRLEN (ADD1 I) N LST))
I)))
(NOT (LESSP (STRLEN (ADD1 I) N LST) I))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(NOT (LESSP (STRLEN I N LST) I))),
which simplifies, opening up the definition of STRLEN, to:
(IMPLIES (NOT (LESSP I N))
(NOT (LESSP I I))).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-LB
(PROVE-LEMMA STRLEN-01
(REWRITE)
(AND (EQUAL (STRLEN I 0 LST) I)
(EQUAL (STRLEN I 1 LST)
(IF (AND (LESSP I 1)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
1 I))
(NOT (EQUAL (STRLEN 1 N LST) 0))))
WARNING: Note that the proposed lemma STRLEN-01 is to be stored as zero type
prescription rules, zero compound recognizer rules, zero linear rules, and
three replacement rules.
This formula can be simplified, using the abbreviations NOT and AND, to the
following three new formulas:
Case 3. (EQUAL (STRLEN I 0 LST) I).
This simplifies, expanding the functions LESSP, EQUAL, and STRLEN, to:
T.
Case 2. (EQUAL (STRLEN I 1 LST)
(IF (AND (LESSP I 1)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
1 I)).
This simplifies, applying the lemma LESSP-OF-1, and expanding NOT and AND,
to the following five new goals:
Case 2.5.
(IMPLIES (AND (EQUAL I 0)
(EQUAL (GET-NTH 0 LST) 0))
(EQUAL (STRLEN I 1 LST) I)).
This again simplifies, expanding the functions EQUAL, NULL, LESSP, and
STRLEN, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH 0 LST) 0))
(EQUAL (STRLEN I 1 LST) I)),
which again simplifies, applying the lemmas GET-NTH-0 and LESSP-OF-1, and
expanding the functions EQUAL, NULL, and STRLEN, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL I 0)) (NUMBERP I))
(EQUAL (STRLEN I 1 LST) I)),
which again simplifies, rewriting with LESSP-OF-1, and opening up the
definition of STRLEN, to:
T.
Case 2.2.
(IMPLIES (AND (EQUAL I 0)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (STRLEN I 1 LST) 1)).
But this again simplifies, opening up ADD1, NULL, LESSP, STRLEN, and EQUAL,
to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (STRLEN I 1 LST) 1)),
which again simplifies, rewriting with SUB1-TYPE-RESTRICTION, GET-NTH-0,
and LESSP-OF-1, and expanding the definitions of NULL, STRLEN, LESSP, and
EQUAL, to:
T.
Case 1. (NOT (EQUAL (STRLEN 1 N LST) 0)).
This simplifies, using linear arithmetic and rewriting with STRLEN-LB, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-01
(PROVE-LEMMA STRLEN-II
(REWRITE)
(EQUAL (STRLEN I I LST) I)
((EXPAND (STRLEN I I LST))))
This simplifies, expanding the functions STRLEN and NULL, to:
(IMPLIES (AND (LESSP I I)
(NOT (EQUAL (GET-NTH I LST) 0)))
(EQUAL (STRLEN (ADD1 I) I LST) I)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-II
(PROVE-LEMMA STRLEN-II1
(REWRITE)
(EQUAL (STRLEN I (ADD1 I) LST)
(IF (EQUAL (GET-NTH I LST) 0)
I
(ADD1 I))))
This formula simplifies, rewriting with the lemmas STRLEN-II, SUB1-ADD1, and
LESSP-SUB1, and expanding NULL, LESSP, and STRLEN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-II1
(PROVE-LEMMA STRLEN-NON0P NIL
(IMPLIES (AND (LEQ I J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))))
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p J LST I N))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p J LST (ADD1 I) N))
(p J LST I N))
(IMPLIES (NOT (LESSP I N))
(p J LST I N))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces four new formulas:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))),
which simplifies, unfolding NULL, STRLEN, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
the functions NULL, LESSP, and STRLEN, to the formula:
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NOT (EQUAL (GET-NTH 0 LST) 0))).
This again simplifies, trivially, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))).
But this again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
and LESSP-OF-1, and unfolding LESSP, NULL, STRLEN, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP I (ADD1 I))
(NOT (LESSP I I))
(LESSP I (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH I LST) 0))).
This again simplifies, opening up NULL and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))),
which simplifies, opening up the definitions of NULL and STRLEN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) 0))),
which simplifies, expanding the definition of STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRLEN-NON0P
(PROVE-LEMMA STRLEN-0P
(REWRITE)
(IMPLIES (STRINGP I N LST)
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)))
This conjecture simplifies, expanding the definition of STRINGP, to the new
conjecture:
(IMPLIES (LESSP (SLEN I N LST) N)
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)),
which we will name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, only one is unflawed. We will induct according to
the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)).
This simplifies, opening up the functions NULL, STRLEN, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)).
This simplifies, using linear arithmetic and rewriting with SLEN-UBOUND, to
two new conjectures:
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)),
which again simplifies, expanding LESSP, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP N)
(EQUAL (SLEN (ADD1 I) N LST) N)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP N N))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)),
which again simplifies, expanding the functions NULL and STRLEN, to the
goal:
(IMPLIES (AND (EQUAL (SLEN (ADD1 I) N LST) N)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP N N))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN (ADD1 I) N LST) LST)
0)).
But this again simplifies, rewriting with SLEN-REC, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (GET-NTH (STRLEN (ADD1 I) N LST) LST)
0)
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)).
This simplifies, opening up the definitions of NULL, STRLEN, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LESSP (SLEN I N LST) N))
(EQUAL (GET-NTH (STRLEN I N LST) LST)
0)).
This simplifies, using linear arithmetic and rewriting with the lemma
SLEN-LBOUND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-0P
(PROVE-LEMMA STRCPY-GET-1
(REWRITE)
(IMPLIES (LESSP J I)
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST1))))
Give the conjecture the name *1.
Let us appeal to the induction principle. The recursive terms in the
conjecture suggest three inductions. They merge into two likely candidate
inductions, both of which are unflawed. So we will choose the one suggested
by the largest number of nonprimitive recursive functions. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL)))
(p J I LST1 N2 LST2))
(IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(p J
(ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(p J I LST1 N2 LST2))
(IMPLIES (NOT (LESSP I N2))
(p J I LST1 N2 LST2))).
Linear arithmetic can be used to show that the measure (DIFFERENCE N2 I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for LST1. The
above induction scheme generates the following four new conjectures:
Case 4. (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL))
(LESSP J I))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST1))).
This simplifies, appealing to the lemmas GET-NTH-0 and GET-PUT, and
expanding the functions NULL, STRCPY, and EQUAL, to the following five new
goals:
Case 4.5.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL 0 (GET-NTH J LST1))).
This again simplifies, using linear arithmetic, to:
T.
Case 4.4.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, applying GET-NTH-0, and opening up LESSP, to:
T.
Case 4.3.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST1))).
But this again simplifies, rewriting with the lemma GET-NTH-0, and opening
up LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and opening up the
definition of LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(NOT (LESSP J (ADD1 I)))
(LESSP J I))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST1))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(EQUAL (GET-NTH J
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH J
(PUT-NTH (GET-NTH I LST2) I LST1)))
(LESSP J I))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST1))).
This simplifies, applying GET-NTH-0 and GET-PUT, and expanding the
definitions of NULL, LESSP, STRCPY, and EQUAL, to two new formulas:
Case 2.2.
(IMPLIES
(AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NUMBERP I)
(NUMBERP J)
(EQUAL I J)
(EQUAL (GET-NTH J
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH I LST2))
(LESSP I I))
(EQUAL (GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH I LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES
(AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(EQUAL (GET-NTH J
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH 0 LST1))),
which again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N2)) (LESSP J I))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST1))),
which simplifies, expanding the definition of STRCPY, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCPY-GET-1
(PROVE-LEMMA STRCPY-STRLEN
(REWRITE)
(EQUAL (STRLEN I N2 (STRCPY I LST1 N2 LST2))
(STRLEN I N2 LST2)))
Name the conjecture *1.
Let us appeal to the induction principle. The recursive terms in the
conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I (STRCPY I LST1 N2 LST2))
(NULL)))
(p I N2 LST1 LST2))
(IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N2 LST2))
(NULL)))
(p (ADD1 I)
N2
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(p I N2 LST1 LST2))
(IMPLIES (NOT (LESSP I N2))
(p I N2 LST1 LST2))).
Linear arithmetic can be used to show that the measure (DIFFERENCE N2 I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for LST1. The
above induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I (STRCPY I LST1 N2 LST2))
(NULL)))
(EQUAL (STRLEN I N2 (STRCPY I LST1 N2 LST2))
(STRLEN I N2 LST2))).
This simplifies, applying GET-PUT, and expanding the functions STRCPY, NULL,
STRLEN, and EQUAL, to:
(IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
0))
(EQUAL (STRLEN I N2
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(STRLEN (ADD1 I) N2 LST2))).
However this again simplifies, using linear arithmetic and rewriting with
the lemmas GET-PUT and STRCPY-GET-1, to:
T.
Case 2. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N2 LST2))
(NULL)))
(EQUAL (STRLEN (ADD1 I)
N2
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(STRLEN (ADD1 I) N2 LST2)))
(EQUAL (STRLEN I N2 (STRCPY I LST1 N2 LST2))
(STRLEN I N2 LST2))),
which simplifies, using linear arithmetic, applying the lemmas STRCPY-GET-1
and GET-PUT, and expanding the functions STRCPY, NULL, STRLEN, and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N2))
(EQUAL (STRLEN I N2 (STRCPY I LST1 N2 LST2))
(STRLEN I N2 LST2))),
which simplifies, expanding STRCPY and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCPY-STRLEN
(PROVE-LEMMA STRCPY-CPY
(REWRITE)
(IMPLIES (AND (STRINGP I N2 LST2)
(LEQ I J)
(LEQ J (STRLEN I N2 LST2)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2)))
((EXPAND (STRCPY 0 LST1 N2 LST2))))
This formula simplifies, expanding STRINGP, to:
(IMPLIES (AND (LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which we will name *1.
We will appeal to induction. There are six plausible inductions. They
merge into three likely candidate inductions, two of which are unflawed. So
we will choose the one suggested by the largest number of nonprimitive
recursive functions. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL)))
(p J I LST1 N2 LST2))
(IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(p J
(ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(p J I LST1 N2 LST2))
(IMPLIES (NOT (LESSP I N2))
(p J I LST1 N2 LST2))).
Linear arithmetic informs us that the measure (DIFFERENCE N2 I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for LST1. The above
induction scheme produces the following six new goals:
Case 6. (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))).
This simplifies, rewriting with GET-NTH-0 and GET-PUT, and unfolding the
definitions of NULL, STRLEN, EQUAL, and STRCPY, to seven new formulas:
Case 6.7.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NOT (NUMBERP I))
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, appealing to the lemma GET-NTH-0, and expanding
LESSP, to:
T.
Case 6.6.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 6.5.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL 0 (GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, and opening up the
functions EQUAL and LESSP, to:
T.
Case 6.4.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL 0 (GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 6.3.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST2))).
However this again simplifies, appealing to the lemma GET-NTH-0, and
unfolding the definitions of LESSP and EQUAL, to:
T.
Case 6.2.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST2))),
which again simplifies, applying GET-NTH-0, and expanding LESSP, to:
T.
Case 6.1.
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP I J))
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST2))).
However this again simplifies, expanding the function LESSP, to:
T.
Case 5. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N2 LST2) N2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which simplifies, using linear arithmetic and rewriting with the lemma
SLEN-UBOUND, to two new formulas:
Case 5.2.
(IMPLIES (AND (NOT (NUMBERP N2))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(NOT (LESSP (SLEN (ADD1 I) N2 LST2) N2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 5.1.
(IMPLIES (AND (NUMBERP N2)
(EQUAL (SLEN (ADD1 I) N2 LST2) N2)
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(NOT (LESSP N2 N2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which again simplifies, expanding the definitions of NULL, STRLEN, and
STRCPY, to:
(IMPLIES (AND (EQUAL (SLEN (ADD1 I) N2 LST2) N2)
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (LESSP N2 N2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN (ADD1 I) N2 LST2) J)))
(EQUAL (GET-NTH J
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH J LST2))).
This again simplifies, rewriting with the lemma SLEN-REC, to:
T.
Case 4. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(LESSP J (ADD1 I))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which simplifies, using linear arithmetic, to three new formulas:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(LESSP J (ADD1 I))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which again simplifies, appealing to the lemmas GET-NTH-0 and PUT-NTH-0,
and opening up NULL, LESSP, STRCPY, EQUAL, ADD1, and STRLEN, to eight new
formulas:
Case 4.3.8.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(EQUAL I 0)
(NOT (NUMBERP N2)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, expanding LESSP, to:
T.
Case 4.3.7.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(EQUAL I 0)
(EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.3.6.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(EQUAL I 0)
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 (PUT-NTH 0 0 LST1))
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 4.3.5.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(EQUAL I 0)
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH 0
(STRCPY 1
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
N2 LST2))
(GET-NTH 0 LST2))).
This again simplifies, rewriting with GET-PUT and STRCPY-GET-1, and
opening up the definitions of EQUAL, LESSP, and NUMBERP, to:
T.
Case 4.3.4.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I))
(NOT (NUMBERP N2)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, opening up the function LESSP, to:
T.
Case 4.3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I))
(EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 (PUT-NTH 0 0 LST1))
(GET-NTH 0 LST2))),
which again simplifies, applying GET-NTH-0, and opening up the
definitions of LESSP and EQUAL, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH 0
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH 0 LST2))).
But this again simplifies, using linear arithmetic, appealing to the
lemmas GET-NTH-0, GET-PUT, and STRCPY-GET-1, and unfolding the functions
LESSP, NUMBERP, and EQUAL, to the formula:
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))).
This again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(LESSP J (ADD1 I))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, applying GET-NTH-0,
SUB1-TYPE-RESTRICTION, LESSP-OF-1, GET-PUT, and STRCPY-GET-1, and opening
up the functions LESSP, NULL, STRLEN, EQUAL, STRCPY, and NUMBERP, to the
following two new formulas:
Case 4.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL J 0)
(LESSP (SLEN I N2 LST2) N2))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 4.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NUMBERP J))
(LESSP (SLEN I N2 LST2) N2))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))),
which again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(LESSP I (ADD1 I))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP I I))
(NOT (LESSP (STRLEN I N2 LST2) I)))
(EQUAL (GET-NTH I (STRCPY I LST1 N2 LST2))
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, applying the lemmas
LESSP-SUB1, SUB1-ADD1, GET-PUT, and STRCPY-GET-1, and expanding the
definitions of NULL, LESSP, STRLEN, and STRCPY, to:
T.
Case 3. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(LESSP (STRLEN (ADD1 I) N2 LST2) J)
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which simplifies, expanding the functions NULL and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(EQUAL (GET-NTH J
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(GET-NTH J LST2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which simplifies, unfolding the functions NULL, STRLEN, and STRCPY, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N2))
(LESSP (SLEN I N2 LST2) N2)
(NOT (LESSP J I))
(NOT (LESSP (STRLEN I N2 LST2) J)))
(EQUAL (GET-NTH J (STRCPY I LST1 N2 LST2))
(GET-NTH J LST2))),
which simplifies, using linear arithmetic and applying the lemma SLEN-LBOUND,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRCPY-CPY
(PROVE-LEMMA STRCPY-STRINGP
(REWRITE)
(IMPLIES (STRINGP I N2 LST2)
(STRINGP I N2
(STRCPY I LST1 N2 LST2))))
WARNING: Note that the rewrite rule STRCPY-STRINGP will be stored so as to
apply only to terms with the nonrecursive function symbol STRINGP.
This conjecture simplifies, unfolding STRINGP, to:
(IMPLIES (LESSP (SLEN I N2 LST2) N2)
(LESSP (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)).
However this again simplifies, using linear arithmetic and rewriting with the
lemmas SLEN-UBOUND and SLEN-LBOUND, to two new conjectures:
Case 2. (IMPLIES (AND (NOT (NUMBERP N2))
(LESSP (SLEN I N2 LST2) N2))
(LESSP (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)),
which again simplifies, unfolding LESSP, to:
T.
Case 1. (IMPLIES (AND (NUMBERP N2)
(EQUAL (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)
(LESSP (SLEN I N2 LST2) N2))
(LESSP N2 N2)),
which again simplifies, trivially, to:
(IMPLIES (AND (EQUAL (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)
(LESSP (SLEN I N2 LST2) N2))
(LESSP N2 N2)).
We use the above equality hypothesis by substituting:
(SLEN I N2 (STRCPY I LST1 N2 LST2))
for N2 and keeping the equality hypothesis. The result is the conjecture:
(IMPLIES (AND (EQUAL (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)
(LESSP (SLEN I
(SLEN I N2 (STRCPY I LST1 N2 LST2))
LST2)
(SLEN I N2 (STRCPY I LST1 N2 LST2))))
(LESSP (SLEN I N2 (STRCPY I LST1 N2 LST2))
(SLEN I N2 (STRCPY I LST1 N2 LST2)))).
This further simplifies, clearly, to:
(IMPLIES (AND (EQUAL (SLEN I N2 (STRCPY I LST1 N2 LST2))
N2)
(LESSP (SLEN I N2 LST2) N2))
(LESSP N2 N2)),
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 (STRINGP I N2 LST2)
(STRINGP I N2
(STRCPY I LST1 N2 LST2))),
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 (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL)))
(p I N2 LST1 LST2))
(IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(p (ADD1 I)
N2
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(p I N2 LST1 LST2))
(IMPLIES (NOT (LESSP I N2))
(p I N2 LST1 LST2))).
Linear arithmetic informs us that the measure (DIFFERENCE N2 I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for LST1. The above
induction scheme leads to four new formulas:
Case 4. (IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) (NULL))
(STRINGP I N2 LST2))
(STRINGP I N2
(STRCPY I LST1 N2 LST2))),
which simplifies, applying SLEN-PUT0, and expanding the definitions of NULL,
STRINGP, STRCPY, and EQUAL, to:
(IMPLIES (AND (LESSP I N2)
(EQUAL (GET-NTH I LST2) 0)
(LESSP (SLEN I N2 LST2) N2)
(NOT (NUMBERP I)))
(LESSP 0 N2)),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(NOT (STRINGP (ADD1 I) N2 LST2))
(STRINGP I N2 LST2))
(STRINGP I N2
(STRCPY I LST1 N2 LST2))),
which simplifies, rewriting with SLEN-REC, and unfolding NULL and STRINGP,
to:
T.
Case 2. (IMPLIES (AND (LESSP I N2)
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(STRINGP (ADD1 I)
N2
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N2 LST2))
(STRINGP I N2 LST2))
(STRINGP I N2
(STRCPY I LST1 N2 LST2))).
This simplifies, using linear arithmetic, rewriting with the lemmas SLEN-REC,
GET-PUT, and STRCPY-GET-1, and expanding the definitions of NULL, STRINGP,
and STRCPY, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N2))
(STRINGP I N2 LST2))
(STRINGP I N2
(STRCPY I LST1 N2 LST2))).
This simplifies, expanding the functions STRINGP and STRCPY, to:
(IMPLIES (AND (NOT (LESSP I N2))
(LESSP (SLEN I N2 LST2) N2))
(LESSP (SLEN I N2 LST1) N2)),
which again simplifies, using linear arithmetic and rewriting with
SLEN-LBOUND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCPY-STRINGP
(PROVE-LEMMA STRCMP-ID
(REWRITE)
(EQUAL (STRCMP I N LST LST) 0))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST))))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic can be used to establish that the measure (DIFFERENCE N I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following four new
formulas:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (STRCMP I N LST LST) 0)).
This simplifies, expanding the definitions of NULL, STRCMP, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (STRCMP (ADD1 I) N LST LST) 0))
(EQUAL (STRCMP I N LST LST) 0)).
This simplifies, opening up the functions NULL, STRCMP, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST))))
(EQUAL (STRCMP I N LST LST) 0)).
This simplifies, clearly, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(EQUAL (STRCMP I N LST LST) 0)).
This simplifies, expanding the definitions of STRCMP and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCMP-ID
(PROVE-LEMMA STRCMP-ANTISYM
(REWRITE)
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1)))
((ENABLE IDIFFERENCE IPLUS)))
This formula simplifies, expanding EQUAL and LESSP, to two new conjectures:
Case 2. (IMPLIES (NOT (EQUAL (STRCMP I N LST2 LST1) 0))
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST1)))),
which we will name *1.
Case 1. (IMPLIES (EQUAL (STRCMP I N LST2 LST1) 0)
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
F)).
This again simplifies, trivially, to the new conjecture:
(IMPLIES (EQUAL (STRCMP I N LST2 LST1) 0)
(NOT (NEGATIVEP (STRCMP I N LST1 LST2)))),
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 (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1))),
named *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 (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL)))
(p I N LST1 LST2))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(p (ADD1 I) N LST1 LST2))
(p I N LST1 LST2))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(p I N LST1 LST2))
(IMPLIES (NOT (LESSP I N))
(p I N LST1 LST2))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following four new
formulas:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL)))
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1)))).
This simplifies, appealing to the lemmas IPLUS-0, MINUS-INTEGERP,
INTEGERP-FIX-INT, and NUMBERP-INTEGERP, and unfolding the functions NULL,
STRCMP, EQUAL, INEG, IZEROP, NEGP, IDIFFERENCE, and LESSP, to the following
two new formulas:
Case 4.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (NULL) (GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (NULL) 0))
(EQUAL 0 (NULL))).
This again simplifies, obviously, to:
T.
Case 4.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (NULL) (GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (NULL) 0)))
(NOT (EQUAL 0 (NULL)))).
This again simplifies, clearly, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(EQUAL (NEGATIVEP (STRCMP (ADD1 I) N LST1 LST2))
(LESSP 0
(STRCMP (ADD1 I) N LST2 LST1))))
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1)))).
This simplifies, expanding the definitions of NULL, EQUAL, LESSP, and STRCMP,
to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1)))).
This simplifies, unfolding the definitions of STRCMP, INEG, FIX-INT, IZEROP,
NEGATIVE-GUTS, NEGP, IDIFFERENCE, EQUAL, and LESSP, to the following 50 new
goals:
Case 2.50.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
But this again simplifies, applying the lemmas INTEGERP-FIX-INT, IPLUS-0,
and MINUS-INTEGERP, and expanding the definitions of IZEROP, FIX-INT, and
EQUAL, to two new goals:
Case 2.50.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NUMBERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP 0)
(NUMBERP (GET-NTH I LST2)))),
which again simplifies, trivially, to:
T.
Case 2.50.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))
(EQUAL (NEGATIVEP (MINUS (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))).
This again simplifies, obviously, to:
T.
Case 2.49.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
However this again simplifies, unfolding the definitions of IPLUS and
EQUAL, to:
T.
Case 2.48.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))),
which again simplifies, rewriting with INTEGERP-FIX-INT, IPLUS-0, and
MINUS-INTEGERP, and unfolding the definitions of IZEROP and FIX-INT, to
the following two new goals:
Case 2.48.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NUMBERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP 0)
(NUMBERP (GET-NTH I LST2)))).
This again simplifies, clearly, to:
T.
Case 2.48.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))
(EQUAL (NEGATIVEP (MINUS (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))).
This again simplifies, obviously, to:
T.
Case 2.47.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
But this again simplifies, unfolding EQUAL and IPLUS, to:
T.
Case 2.46.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))),
which again simplifies, rewriting with the lemmas INTEGERP-FIX-INT,
IPLUS-0, NEGATIVEP-GUTS0, and NUMBERP-INTEGERP, and expanding the
definitions of IZEROP, NEGATIVE-GUTS, and EQUAL, to:
T.
Case 2.45.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))),
which again simplifies, applying INTEGERP-FIX-INT, IPLUS-0,
NEGATIVEP-GUTS0, and NUMBERP-INTEGERP, and unfolding the functions IZEROP,
NEGATIVE-GUTS, FIX-INT, and EQUAL, to:
T.
Case 2.44.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
However this again simplifies, opening up the definitions of IPLUS and
EQUAL, to:
T.
Case 2.43.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))),
which again simplifies, applying IPLUS-0, and opening up the functions
IZEROP, FIX-INT, and EQUAL, to:
T.
Case 2.42.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
This again simplifies, obviously, to:
T.
Case 2.41.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL (IPLUS (GET-NTH I LST2) 0) 0))
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2) 0)))).
This again simplifies, applying IPLUS-0, and opening up IZEROP, FIX-INT,
and EQUAL, to:
T.
Case 2.40.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)).
But this again simplifies, applying the lemmas INTEGERP-FIX-INT and
IPLUS-0, and opening up the definition of IZEROP, to:
T.
Case 2.39.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, expanding the definitions of IPLUS, EQUAL, and
INTEGERP, to:
T.
Case 2.38.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, rewriting with INTEGERP-FIX-INT and IPLUS-0, and
unfolding the definition of IZEROP, to:
T.
Case 2.37.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)).
However this again simplifies, opening up the functions EQUAL, IPLUS, and
INTEGERP, to:
T.
Case 2.36.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, rewriting with NEGATIVEP-GUTS0 and PLUS-EQUAL-0,
and opening up the definitions of NEGATIVE-GUTS, NEGP, and IPLUS, to:
T.
Case 2.35.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)).
But this again simplifies, appealing to the lemmas NEGATIVEP-GUTS0,
NUMBERP-INTEGERP, INTEGERP-FIX-INT, and IPLUS-0, and unfolding
NEGATIVE-GUTS and IZEROP, to:
T.
Case 2.34.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, opening up INTEGERP, to:
T.
Case 2.33.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, trivially, to:
T.
Case 2.32.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)).
This again simplifies, applying NEGATIVE-GUTS-MINUS, MINUS-EQUAL, and
DIFFERENCE-0, and unfolding NEGATIVE-GUTS, NUMBERP, EQUAL, NEGP, IPLUS,
PLUS, DIFFERENCE, LESSP, and MINUS, to the following two new formulas:
Case 2.32.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (NUMBERP (GET-NTH I LST1)))
(EQUAL (PLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(NOT (NUMBERP (GET-NTH I LST2)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.32.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NUMBERP (GET-NTH I LST1))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(EQUAL (DIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST1))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.31.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
F)),
which again simplifies, applying MINUS-INTEGERP and IPLUS-0, and unfolding
IZEROP, FIX-INT, and INTEGERP, to:
T.
Case 2.30.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
F)).
But this again simplifies, rewriting with MINUS-NEGATIVE-GUTS,
PLUS-COMMUTATIVITY, NEGATIVE-GUTS-MINUS, MINUS-EQUAL, and NEGATIVEP-GUTS0,
and unfolding the definitions of DIFFERENCE, LESSP, NUMBERP, EQUAL, NEGP,
NEGATIVE-GUTS, and IPLUS, to:
T.
Case 2.29.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
F)).
This again simplifies, applying the lemma NEGATIVEP-GUTS0, and unfolding
NEGATIVE-GUTS and INTEGERP, to:
T.
Case 2.28.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
F)),
which again simplifies, applying NEGATIVEP-GUTS0 and DIFFERENCE-0, and
unfolding NEGATIVE-GUTS, NEGP, IPLUS, and MINUS, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NEGATIVEP (GET-NTH I LST1))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(INTEGERP (GET-NTH I LST2))
(NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.27.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
F)),
which again simplifies, applying the lemmas INTEGERP-FIX-INT and IPLUS-0,
and opening up the function IZEROP, to:
T.
Case 2.26.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
F)),
which again simplifies, applying the lemmas INTEGERP-FIX-INT and IPLUS-0,
and opening up IZEROP, to:
T.
Case 2.25.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)),
which again simplifies, rewriting with the lemmas MINUS-INTEGERP, IPLUS-0,
and INTEGERP-FIX-INT, and expanding IZEROP, FIX-INT, and EQUAL, to:
T.
Case 2.24.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)),
which again simplifies, appealing to the lemmas MINUS-INTEGERP, IPLUS-0,
and INTEGERP-FIX-INT, and expanding the functions IZEROP, FIX-INT, and
EQUAL, to:
T.
Case 2.23.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)),
which again simplifies, opening up INTEGERP, to:
T.
Case 2.22.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0)
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)),
which again simplifies, unfolding the functions EQUAL and INTEGERP, to:
T.
Case 2.21.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)),
which again simplifies, applying NEGATIVEP-GUTS0, NUMBERP-INTEGERP,
INTEGERP-FIX-INT, and IPLUS-0, and expanding the definitions of
NEGATIVE-GUTS, IZEROP, FIX-INT, and EQUAL, to:
T.
Case 2.20.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)).
But this again simplifies, rewriting with NEGATIVEP-GUTS0,
NUMBERP-INTEGERP, INTEGERP-FIX-INT, and IPLUS-0, and opening up the
definitions of NEGATIVE-GUTS and IZEROP, to:
T.
Case 2.19.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)).
This again simplifies, rewriting with IPLUS-0, and unfolding the functions
IZEROP, FIX-INT, EQUAL, IPLUS, and NEGATIVEP, to:
T.
Case 2.18.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)).
This again simplifies, trivially, to:
T.
Case 2.17.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)).
But this again simplifies, applying IPLUS-0, and expanding the functions
IZEROP, FIX-INT, EQUAL, and NEGATIVEP, to:
T.
Case 2.16.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (INTEGERP (GET-NTH I LST1)))
(EQUAL (IPLUS (GET-NTH I LST2) 0) 0)
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
F)).
But this again simplifies, rewriting with IPLUS-0, and expanding the
functions IPLUS, EQUAL, IZEROP, FIX-INT, and NEGATIVEP, to:
T.
Case 2.15.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))))).
This again simplifies, rewriting with NEGATIVEP-GUTS0, NUMBERP-INTEGERP,
INTEGERP-FIX-INT, and IPLUS-0, and expanding the definitions of
NEGATIVE-GUTS, IZEROP, and INTEGERP, to:
T.
Case 2.14.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))))).
But this again simplifies, appealing to the lemmas NEGATIVEP-GUTS0,
PLUS-EQUAL-0, MINUS-NEGATIVE-GUTS, PLUS-COMMUTATIVITY, NEGATIVE-GUTS-MINUS,
and MINUS-EQUAL, and opening up the definitions of NEGATIVE-GUTS, NEGP,
IPLUS, DIFFERENCE, LESSP, NUMBERP, and EQUAL, to:
T.
Case 2.13.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))))),
which again simplifies, rewriting with the lemma NEGATIVEP-GUTS0, and
expanding NEGATIVE-GUTS, NEGP, and IPLUS, to three new goals:
Case 2.13.3.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2)))
0))
(INTEGERP (GET-NTH I LST2))
(NEGATIVEP (GET-NTH I LST2))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2)))))
(LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.13.2.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2)))
0))
(INTEGERP (GET-NTH I LST2))
(NEGATIVEP (GET-NTH I LST2))
(LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.13.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NEGATIVEP (GET-NTH I LST1))
(LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST2))
(NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.12.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0))
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))))),
which again simplifies, rewriting with NEGATIVEP-GUTS0, NUMBERP-INTEGERP,
INTEGERP-FIX-INT, and IPLUS-0, and unfolding the definitions of
NEGATIVE-GUTS, IZEROP, FIX-INT, and EQUAL, to:
T.
Case 2.11.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))
0))
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(NEGATIVE-GUTS (GET-NTH I LST1)))))).
However this again simplifies, applying NEGATIVEP-GUTS0, NUMBERP-INTEGERP,
INTEGERP-FIX-INT, and IPLUS-0, and expanding NEGATIVE-GUTS, IZEROP, and
EQUAL, to:
T.
Case 2.10.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))).
However this again simplifies, expanding the definition of INTEGERP, to:
T.
Case 2.9.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))),
which again simplifies, obviously, to:
T.
Case 2.8.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))).
However this again simplifies, applying the lemmas NEGATIVE-GUTS-MINUS,
MINUS-EQUAL, NEGATIVE-GUTS-TYPE-RESTRICTION, INTEGERP-FIX-INT, and IPLUS-0,
and opening up NEGATIVE-GUTS, NUMBERP, EQUAL, NEGP, IPLUS, PLUS,
DIFFERENCE, LESSP, and IZEROP, to six new conjectures:
Case 2.8.6.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NUMBERP (GET-NTH I LST1))
(NOT (EQUAL (DIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST1))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(LESSP (GET-NTH I LST2)
(GET-NTH I LST1))
(NUMBERP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.8.5.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NUMBERP (GET-NTH I LST1))
(NOT (EQUAL (DIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST1))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1))))
(LESSP (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.8.4.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NUMBERP (GET-NTH I LST1))
(NOT (EQUAL (DIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST1))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1))))
(NUMBERP (GET-NTH I LST2))),
which again simplifies, using linear arithmetic, rewriting with
NUMBERP-INTEGERP and DIFFERENCE-0, and opening up EQUAL, to:
T.
Case 2.8.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (PLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NUMBERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP 0)
(NUMBERP (GET-NTH I LST2)))).
This again simplifies, obviously, to:
T.
Case 2.8.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (PLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))
(EQUAL (NEGATIVEP (MINUS (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))).
This again simplifies, clearly, to:
T.
Case 2.8.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NUMBERP (GET-NTH I LST1))
(LESSP (GET-NTH I LST2)
(GET-NTH I LST1))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NUMBERP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))),
which again simplifies, applying MINUS-INTEGERP and IPLUS-0, and expanding
IZEROP, FIX-INT, and INTEGERP, to:
T.
Case 2.6.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))).
However this again simplifies, applying the lemmas MINUS-NEGATIVE-GUTS,
PLUS-COMMUTATIVITY, NEGATIVE-GUTS-MINUS, MINUS-EQUAL, and NEGATIVEP-GUTS0,
and unfolding the definitions of DIFFERENCE, LESSP, NUMBERP, EQUAL, NEGP,
NEGATIVE-GUTS, and IPLUS, to:
T.
Case 2.5.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(INTEGERP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))),
which again simplifies, rewriting with NEGATIVEP-GUTS0, and unfolding
NEGATIVE-GUTS and INTEGERP, to:
T.
Case 2.4.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))).
But this again simplifies, rewriting with the lemmas MINUS-INTEGERP,
IPLUS-0, and INTEGERP-FIX-INT, and opening up the definitions of IZEROP,
FIX-INT, and EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))),
which again simplifies, applying MINUS-INTEGERP, IPLUS-0, and
INTEGERP-FIX-INT, and expanding the functions IZEROP, FIX-INT, and EQUAL,
to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(NOT (INTEGERP (GET-NTH I LST2))))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))).
But this again simplifies, expanding the definition of INTEGERP, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(INTEGERP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))
0))
(EQUAL (GET-NTH I LST2) 0))
(EQUAL (NEGATIVEP (IPLUS (GET-NTH I LST1) 0))
(NUMBERP (IPLUS (GET-NTH I LST2)
(MINUS (GET-NTH I LST1)))))),
which again simplifies, expanding the definitions of EQUAL and INTEGERP,
to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(EQUAL (NEGATIVEP (STRCMP I N LST1 LST2))
(LESSP 0 (STRCMP I N LST2 LST1)))),
which simplifies, unfolding STRCMP, NEGATIVEP, LESSP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.5 0.1 ]
STRCMP-ANTISYM
(PROVE-LEMMA STRCMP-TRANS-1
(REWRITE)
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))))
WARNING: Note that STRCMP-TRANS-1 contains the free variable LST2 which will
be chosen by instantiating the hypothesis (LST-OF-CHRP LST2).
Give the conjecture the name *1.
We will try to 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 (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL)))
(p I N LST1 LST3 LST2))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(p (ADD1 I) N LST1 LST3 LST2))
(p I N LST1 LST3 LST2))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(p I N LST1 LST3 LST2))
(IMPLIES (NOT (LESSP I N))
(p I N LST1 LST3 LST2))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))),
which simplifies, unfolding the definitions of NULL, STRCMP, EQUAL, and
NUMBERP, to two new conjectures:
Case 6.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (NULL) (GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (IDIFFERENCE 0 (NULL)))
(NOT (EQUAL (NULL) (GET-NTH I LST3)))
(NUMBERP (IDIFFERENCE (NULL) (GET-NTH I LST3)))
(NOT (EQUAL 0 (GET-NTH I LST3))))
(NUMBERP (IDIFFERENCE 0 (GET-NTH I LST3)))),
which again simplifies, expanding the functions NULL, IDIFFERENCE, and
NUMBERP, to:
T.
Case 6.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (NULL) (GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(EQUAL 0 (NULL))
(NUMBERP (IDIFFERENCE (NULL) (GET-NTH I LST3)))
(NOT (EQUAL 0 (GET-NTH I LST3))))
(NUMBERP (IDIFFERENCE 0 (GET-NTH I LST3)))),
which again simplifies, obviously, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(NOT (NUMBERP (STRCMP (ADD1 I) N LST1 LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))).
This simplifies, opening up NULL and STRCMP, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(NOT (NUMBERP (STRCMP (ADD1 I) N LST2 LST3)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))).
This simplifies, unfolding NULL and STRCMP, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))).
This simplifies, expanding NULL and STRCMP, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))).
This simplifies, appealing to the lemmas GET-LST-OF-CHRP, ILESSP-LESSP, and
IDIFFERENCE-NUMBERP, and expanding STRCMP, NULL, and EQUAL, to the following
three new goals:
Case 2.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I LST3)))
(NUMBERP (IDIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST3)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))))
(NUMBERP (IDIFFERENCE (GET-NTH I LST1)
(GET-NTH I LST3)))).
But this again simplifies, applying the lemmas GET-LST-OF-CHRP,
ILESSP-LESSP, and IDIFFERENCE-NUMBERP, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I LST3)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST3)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST3)))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I LST3)))
(NUMBERP (IDIFFERENCE (GET-NTH I LST2)
(GET-NTH I LST3)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))),
which again simplifies, rewriting with GET-LST-OF-CHRP, ILESSP-LESSP, and
IDIFFERENCE-NUMBERP, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))),
which again simplifies, using linear arithmetic, to three new formulas:
Case 2.2.3.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST2)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))),
which again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.2.2.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))),
which again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.2.1.
(IMPLIES (AND (NUMBERP (GET-NTH I LST1))
(NUMBERP (GET-NTH I LST2))
(EQUAL (GET-NTH I LST2)
(GET-NTH I LST1))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST3))
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (STRCMP (ADD1 I) N LST1 LST3))),
which again simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (GET-NTH I LST2)
(GET-NTH I LST3))
(EQUAL (GET-NTH I LST2) 0)
(NOT (EQUAL (GET-NTH I LST1) 0)))
(NUMBERP (IDIFFERENCE (GET-NTH I LST1) 0))).
But this again simplifies, appealing to the lemmas GET-LST-OF-CHRP,
ILESSP-LESSP, and IDIFFERENCE-NUMBERP, and unfolding the functions EQUAL
and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LST-OF-CHRP LST3)
(NUMBERP (STRCMP I N LST1 LST2))
(NUMBERP (STRCMP I N LST2 LST3)))
(NUMBERP (STRCMP I N LST1 LST3))),
which simplifies, opening up STRCMP and NUMBERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRCMP-TRANS-1
(PROVE-LEMMA STRCMP-STRCPY
(REWRITE)
(EQUAL (STRCMP I N LST2
(STRCPY I LST1 N LST2))
0))
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 (LESSP I N)
(EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))
(EQUAL (GET-NTH I LST2) (NULL)))
(p I N LST2 LST1))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(p (ADD1 I)
N LST2
(PUT-NTH (GET-NTH I LST2) I LST1)))
(p I N LST2 LST1))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))))
(p I N LST2 LST1))
(IMPLIES (NOT (LESSP I N))
(p I N LST2 LST1))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for LST1. The
above induction scheme leads to four new goals:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))
(EQUAL (GET-NTH I LST2) (NULL)))
(EQUAL (STRCMP I N LST2
(STRCPY I LST1 N LST2))
0)),
which simplifies, applying the lemma GET-PUT, and opening up the definitions
of STRCPY, NULL, EQUAL, and STRCMP, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))
(NOT (EQUAL (GET-NTH I LST2) (NULL)))
(EQUAL (STRCMP (ADD1 I)
N LST2
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))
0))
(EQUAL (STRCMP I N LST2
(STRCPY I LST1 N LST2))
0)),
which simplifies, using linear arithmetic, rewriting with STRCPY-GET-1 and
GET-PUT, and opening up the functions STRCPY, NULL, STRCMP, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I (STRCPY I LST1 N LST2)))))
(EQUAL (STRCMP I N LST2
(STRCPY I LST1 N LST2))
0)).
This simplifies, rewriting with the lemma GET-PUT, and opening up the
functions STRCPY, NULL, EQUAL, and STRCMP, to:
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (GET-NTH I LST2)
(GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2)))))
(EQUAL (STRCMP I N LST2
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))
0)),
which again simplifies, using linear arithmetic and applying GET-PUT and
STRCPY-GET-1, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(EQUAL (STRCMP I N LST2
(STRCPY I LST1 N LST2))
0)).
This simplifies, expanding the functions STRCPY, STRCMP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCMP-STRCPY
(PROVE-LEMMA STRCMP-THM1 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(LEQ I J)
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
((ENABLE IDIFFERENCE IPLUS)))
Give the conjecture the name *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 (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL)))
(p J LST1 LST2 I N))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(p J LST1 LST2 (ADD1 I) N))
(p J LST1 LST2 I N))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(p J LST1 LST2 I N))
(IMPLIES (NOT (LESSP I N))
(p J LST1 LST2 I N))).
Linear arithmetic can be used to show that the measure (DIFFERENCE N I)
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 (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) (NULL))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, appealing to the lemmas IPLUS-0, MINUS-INTEGERP,
INTEGERP-FIX-INT, and NUMBERP-INTEGERP, and opening up NULL, STRCMP, EQUAL,
INEG, IZEROP, NEGP, IDIFFERENCE, and STRLEN, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(NOT (EQUAL (STRCMP (ADD1 I) N LST1 LST2)
0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, unfolding the functions NULL and STRCMP, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(LESSP J (ADD1 I))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(LESSP J (ADD1 I))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, and opening up the
definitions of NULL, LESSP, STRCMP, and STRLEN, to the following two new
goals:
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP (ADD1 I) N LST1 LST2)
0)
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP (ADD1 I) N LST1 LST2)
0)
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
However this again simplifies, applying GET-NTH-0, and expanding the
function LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(LESSP J (ADD1 I))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION,
and LESSP-OF-1, and unfolding the definitions of LESSP, NULL, STRCMP,
STRLEN, and EQUAL, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(LESSP I (ADD1 I))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP I I))
(LESSP I (STRLEN I N LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, obviously, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, expanding the functions NULL, STRCMP, and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, applying INTEGERP-FIX-INT, GET-LST-OF-CHRP, and
NUMBERP-INTEGERP, and expanding the definitions of STRCMP, INEG, IZEROP,
NEGATIVE-GUTS, NEGP, IDIFFERENCE, STRLEN, and NULL, to four new formulas:
Case 2.4.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-MINUS0, and unfolding the definition of EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (IPLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with PLUS-COMMUTATIVITY,
GET-LST-OF-CHRP, and NEGATIVE-GUTS-MINUS, and opening up the functions
NEGP, NEGATIVE-GUTS, IPLUS, and EQUAL, to the following two new goals:
Case 2.3.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(GET-NTH I LST2))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to the
conjecture:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST2)))
(LESSP I N)
(NOT (EQUAL (MINUS 0) (GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (LESSP (MINUS 0) (GET-NTH I LST2)))
(EQUAL (DIFFERENCE (MINUS 0)
(GET-NTH I LST2))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.3.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(GET-NTH I LST2))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, appealing to the lemma DIFFERENCE=0, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to three new goals:
Case 2.3.1.3.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST2)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 2.3.1.2.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.3.1.1.
(IMPLIES (AND (NUMBERP (GET-NTH I LST1))
(NUMBERP (GET-NTH I LST2))
(EQUAL (GET-NTH I LST2)
(GET-NTH I LST1))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, obviously, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (IPLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, unfolding the functions NEGATIVE-GUTS, NEGP,
IPLUS, and EQUAL, to three new formulas:
Case 2.2.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with DIFFERENCE=0, and opening up
NEGATIVE-GUTS, to the new conjecture:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.2.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.2.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemmas NUMBERP-INTEGERP,
GET-LST-OF-CHRP, and INTEGERP-MINUS0, and expanding NEGATIVE-GUTS, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (IPLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LESSP J (STRLEN (ADD1 I) N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP,
INTEGERP-FIX-INT, and IPLUS-0, and opening up the definition of IZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRCMP I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, opening up the definitions of STRCMP, EQUAL, and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
STRCMP-THM1
(DEFN-SK STRCMP-SK
(N1 LST1 LST2)
(EXISTS J
(AND (FORALL I
(IMPLIES (LESSP I J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(EQUAL (STRCMP 0 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))))
Adding the Skolem axiom:
(AND
(IMPLIES (AND (IMPLIES (LESSP (I J LST1 LST2) J)
(EQUAL (GET-NTH (I J LST1 LST2) LST1)
(GET-NTH (I J LST1 LST2) LST2)))
(EQUAL (STRCMP 0 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))
(STRCMP-SK N1 LST1 LST2))
(IMPLIES
(NOT (AND (IMPLIES (LESSP I (J LST1 LST2 N1))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (STRCMP 0 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (J LST1 LST2 N1) LST1)
(GET-NTH (J LST1 LST2 N1) LST2)))))
(NOT (STRCMP-SK N1 LST1 LST2)))).
As this is a DEFN-SK we can conclude that:
(OR (TRUEP (STRCMP-SK N1 LST1 LST2))
(FALSEP (STRCMP-SK N1 LST1 LST2)))
is a theorem.
[ 0.0 0.0 0.0 ]
STRCMP-SK
(DEFN STRCMP-J
(I N1 LST1 LST2)
(IF (LESSP I N1)
(IF (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(IF (EQUAL (GET-NTH I LST1) (NULL))
(FIX I)
(STRCMP-J (ADD1 I) N1 LST1 LST2))
(FIX I))
(FIX I))
((LESSP (DIFFERENCE N1 I))))
Linear arithmetic establishes that the measure (DIFFERENCE N1 I)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, STRCMP-J is accepted under the definitional principle. Observe that:
(NUMBERP (STRCMP-J I N1 LST1 LST2))
is a theorem.
[ 0.0 0.0 0.0 ]
STRCMP-J
(PROVE-LEMMA STRCMP-J-1
(REWRITE)
(IMPLIES (AND (LESSP I (STRCMP-J I1 N1 LST1 LST2))
(LEQ I1 I))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
((ENABLE GET-NTH-0)))
WARNING: Note that STRCMP-J-1 contains the free variables LST2, N1, and I1
which will be chosen by instantiating the hypothesis:
(LESSP I (STRCMP-J I1 N1 LST1 LST2)).
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) (NULL)))
(p I LST1 LST2 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(p I LST1 LST2 (ADD1 I1) N1))
(p I LST1 LST2 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))))
(p I LST1 LST2 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p I LST1 LST2 I1 N1))).
Linear arithmetic establishes that the measure (DIFFERENCE N1 I1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces five new formulas:
Case 5. (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) (NULL))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, unfolding NULL, STRCMP-J, EQUAL, and LESSP, to:
(IMPLIES (AND (LESSP I1 N1)
(EQUAL (NULL) (GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(NOT (LESSP I
(STRCMP-J (ADD1 I1) N1 LST1 LST2)))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, opening up the functions NULL and STRCMP-J, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(LESSP I (ADD1 I1))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(LESSP I (ADD1 I1))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, and
LESSP-OF-1, and expanding the functions LESSP, NULL, STRCMP-J, and EQUAL,
to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(LESSP I (ADD1 I1))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
But this again simplifies, rewriting with GET-NTH-0, and unfolding NULL,
LESSP, and STRCMP-J, to the following two new conjectures:
Case 3.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (STRCMP-J (ADD1 I1) N1 LST1 LST2)
0))
(EQUAL I1 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 3.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (STRCMP-J (ADD1 I1) N1 LST1 LST2)
0))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, applying GET-NTH-0, and expanding the
definition of LESSP, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP I1)
(LESSP I N1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) (NULL)))
(LESSP I (ADD1 I))
(LESSP I (STRCMP-J I N1 LST1 LST2))
(NOT (LESSP I I)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, clearly, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This simplifies, opening up STRCMP-J and LESSP, to:
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(LESSP I (STRCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, opening up STRCMP-J and LESSP, to the goal:
(IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCMP-J-1
(PROVE-LEMMA STRCMP-J-2
(REWRITE)
(IMPLIES (NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2))))
((ENABLE GET-NTH-0)))
Give the conjecture the name *1.
We will try to prove it by induction. Four 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 (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) (NULL)))
(p I1 N1 LST1 LST2))
(IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(p (ADD1 I1) N1 LST1 LST2))
(p I1 N1 LST1 LST2))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))))
(p I1 N1 LST1 LST2))
(IMPLIES (NOT (LESSP I1 N1))
(p I1 N1 LST1 LST2))).
Linear arithmetic informs us that the measure (DIFFERENCE N1 I1) 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 (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) (NULL))
(NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0)))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, unfolding the definitions of NULL, STRCMP, EQUAL, and
STRCMP-J, to two new conjectures:
Case 5.2.
(IMPLIES (AND (LESSP I1 N1)
(EQUAL (NULL) (GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (EQUAL 0 (NULL)))
(NOT (EQUAL (IDIFFERENCE 0 (NULL)) 0))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE 0 (NULL))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, applying GET-NTH-0, and opening up the definitions
of LESSP, NULL, and EQUAL, to:
T.
Case 5.1.
(IMPLIES (AND (LESSP I1 N1)
(EQUAL (NULL) (GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (EQUAL 0 (NULL)))
(NOT (EQUAL (IDIFFERENCE 0 (NULL)) 0))
(NUMBERP I1))
(EQUAL (IDIFFERENCE 0 (NULL))
(IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))).
However this again simplifies, expanding the functions NULL and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(EQUAL (STRCMP (ADD1 I1) N1 LST1 LST2)
0)
(NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0)))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, opening up NULL, STRCMP, and EQUAL, to:
T.
Case 3. (IMPLIES
(AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) (NULL)))
(EQUAL (STRCMP (ADD1 I1) N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J (ADD1 I1) N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J (ADD1 I1) N1 LST1 LST2)
LST2)))
(NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0)))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, opening up the definitions of NULL, STRCMP, and STRCMP-J,
to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0)))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, appealing to the lemma IDIFFERENCE-EQUAL-0, and opening up
the definitions of STRCMP, FIX-INT, and STRCMP-J, to three new conjectures:
Case 2.3.
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(NOT (EQUAL 0 (GET-NTH I1 LST2)))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
the definition of LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST1))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, applying GET-NTH-0, and unfolding the function
LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(INTEGERP (GET-NTH I1 LST1))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))).
However this again simplifies, applying GET-NTH-0, and unfolding the
function LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (EQUAL (STRCMP I1 N1 LST1 LST2) 0)))
(EQUAL (STRCMP I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, opening up the functions STRCMP and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
STRCMP-J-2
(PROVE-LEMMA STRCMP-THM2 NIL
(IMPLIES (NOT (EQUAL (STRCMP 0 N1 LST1 LST2) 0))
(STRCMP-SK N1 LST1 LST2))
((USE (STRCMP-SK (J (STRCMP-J 0 N1 LST1 LST2))))))
This simplifies, applying STRCMP-J-2, and opening up the functions IMPLIES,
AND, and NOT, to:
(IMPLIES (AND (LESSP (I (STRCMP-J 0 N1 LST1 LST2)
LST1 LST2)
(STRCMP-J 0 N1 LST1 LST2))
(NOT (EQUAL (GET-NTH (I (STRCMP-J 0 N1 LST1 LST2)
LST1 LST2)
LST1)
(GET-NTH (I (STRCMP-J 0 N1 LST1 LST2)
LST1 LST2)
LST2)))
(NOT (EQUAL (STRCMP 0 N1 LST1 LST2) 0)))
(STRCMP-SK N1 LST1 LST2)),
which again simplifies, using linear arithmetic and rewriting with STRCMP-J-1,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRCMP-THM2
(DISABLE STRCMP-J-1)
[ 0.0 0.0 0.0 ]
STRCMP-J-1-OFF
(DISABLE STRCMP-J-2)
[ 0.0 0.0 0.0 ]
STRCMP-J-2-OFF
(PROVE-LEMMA STRCPY1-GET-1
(REWRITE)
(IMPLIES (LESSP J I1)
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))))
Call the conjecture *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 (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) (NULL)))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(p J
(ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (NOT (LESSP I2 N2))
(p J I1 LST1 I2 N2 LST2))).
Linear arithmetic can be used to establish that the measure (DIFFERENCE N2 I2)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for I1 and LST1.
The above induction scheme generates four new formulas:
Case 4. (IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) (NULL))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, applying GET-NTH-0 and GET-PUT, and expanding the
functions NULL, STRCPY1, and EQUAL, to the following five new goals:
Case 4.5.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL 0 (GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 4.4.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP I1))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 4.3.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NUMBERP I1)
(NUMBERP J)
(EQUAL I1 J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NUMBERP I1)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, applying the lemma GET-NTH-0, and opening up the
definition of LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(NOT (LESSP J (ADD1 I1)))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH J
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, appealing to the lemmas GET-NTH-0 and GET-PUT, and opening
up the functions NULL, LESSP, STRCPY1, and EQUAL, to two new formulas:
Case 2.2.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(NUMBERP J)
(EQUAL I1 J)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH I2 LST2))
(LESSP I1 I1))
(EQUAL (GET-NTH I1
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH I1 LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH 0 LST1))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I2 N2)) (LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))).
This simplifies, opening up STRCPY1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.2 ]
STRCPY1-GET-1
(DEFN STRLEN1
(I N LST)
(IF (LESSP I N)
(IF (EQUAL (GET-NTH I LST) (NULL))
0
(ADD1 (STRLEN1 (ADD1 I) N LST)))
0)
((LESSP (DIFFERENCE N I))))
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
STRLEN1 is accepted under the principle of definition. Note that:
(NUMBERP (STRLEN1 I N LST))
is a theorem.
[ 0.0 0.0 0.0 ]
STRLEN1
(PROVE-LEMMA STRLEN1-STRLEN
(REWRITE)
(EQUAL (STRLEN1 I N LST)
(DIFFERENCE (STRLEN I N LST) I)))
Give the conjecture the name *1.
We will try to prove it by induction. There are three plausible
inductions. They merge into two likely candidate inductions, both of which
are unflawed. So we will choose the one suggested by the largest number of
nonprimitive recursive functions. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) 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 I N)
(EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (STRLEN1 I N LST)
(DIFFERENCE (STRLEN I N LST) I))),
which simplifies, applying DIFFERENCE-X-X, and unfolding the functions NULL,
STRLEN1, EQUAL, and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (STRLEN (ADD1 I) N LST)
(ADD1 I))))
(EQUAL (STRLEN1 I N LST)
(DIFFERENCE (STRLEN I N LST) I))).
This simplifies, using linear arithmetic, rewriting with the lemmas
SUB1-ADD1, GET-NTH-0, and DIFFERENCE-0, and expanding the functions NULL,
DIFFERENCE, STRLEN1, STRLEN, LESSP, ADD1, and EQUAL, to the following three
new formulas:
Case 2.3.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NUMBERP I)
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
I)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(DIFFERENCE (STRLEN (ADD1 I) N LST)
I))).
But this again simplifies, using linear arithmetic, to two new goals:
Case 2.3.2.
(IMPLIES (AND (LESSP (SUB1 (STRLEN (ADD1 I) N LST))
I)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NUMBERP I)
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
I)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(DIFFERENCE (STRLEN (ADD1 I) N LST)
I))),
which again simplifies, using linear arithmetic and appealing to the
lemma STRLEN-LB, to:
T.
Case 2.3.1.
(IMPLIES (AND (LESSP (STRLEN (ADD1 I) N LST) I)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NUMBERP I)
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
I)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(DIFFERENCE (STRLEN (ADD1 I) N LST)
I))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (SUB1 (STRLEN (ADD1 I) N LST))
I)
(LESSP (STRLEN (ADD1 I) N LST) I)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NUMBERP I)
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
I)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(DIFFERENCE (STRLEN (ADD1 I) N LST)
I))).
But this again simplifies, using linear arithmetic and rewriting with
STRLEN-LB, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NOT (NUMBERP I))
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(STRLEN (ADD1 I) N LST))).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (SUB1 (STRLEN (ADD1 I) N LST))
0)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0))
(NOT (NUMBERP I))
(EQUAL (STRLEN1 (ADD1 I) N LST)
(DIFFERENCE (SUB1 (STRLEN (ADD1 I) N LST))
0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) N LST))
(STRLEN (ADD1 I) N LST))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (STRLEN (ADD1 I) N LST) 0))
(NOT (EQUAL (STRLEN1 (ADD1 I) N LST) 0))),
which again simplifies, using linear arithmetic and rewriting with
STRLEN-LB, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(EQUAL (STRLEN1 I N LST)
(DIFFERENCE (STRLEN I N LST) I))).
This simplifies, rewriting with DIFFERENCE-X-X, and opening up the
definitions of STRLEN1, STRLEN, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRLEN1-STRLEN
(DISABLE STRLEN1-STRLEN)
[ 0.0 0.0 0.0 ]
STRLEN1-STRLEN-OFF
(PROVE-LEMMA STRCPY1-GET-2
(REWRITE)
(IMPLIES (LESSP (PLUS I1 (STRLEN1 I2 N2 LST2))
J)
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1)))
((INDUCT (STRCPY1 I1 LST1 I2 N2 LST2))))
This formula can be simplified, using the abbreviations IMPLIES, NOT, OR, AND,
and NULL, to the following three new conjectures:
Case 3. (IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(LESSP (PLUS I1 (STRLEN1 I2 N2 LST2))
J))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))).
This simplifies, applying the lemmas PLUS-0, PLUS-COMMUTATIVITY, PUT-NTH-0,
GET-PUT, and GET-NTH-0, and unfolding the functions EQUAL, NULL, STRLEN1,
STRCPY1, and NUMBERP, to the following five new goals:
Case 3.5.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (NUMBERP I1))
(LESSP 0 J)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.4.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (NUMBERP I1))
(LESSP 0 J)
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, unfolding the function LESSP, to:
T.
Case 3.3.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NUMBERP I1)
(LESSP I1 J)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, opening up NUMBERP and LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NUMBERP I1)
(LESSP I1 J)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, expanding the function LESSP, to:
T.
Case 3.1.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NUMBERP I1)
(LESSP I1 J)
(NUMBERP J)
(EQUAL I1 J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES
(AND
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(IMPLIES (LESSP (PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2) N2 LST2))
J)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH J
(PUT-NTH (GET-NTH I2 LST2) I1 LST1))))
(LESSP (PLUS I1 (STRLEN1 I2 N2 LST2))
J))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, rewriting with the lemmas SUB1-ADD1, GET-NTH-0, GET-PUT,
and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up PLUS, LESSP, IMPLIES,
NULL, STRLEN1, EQUAL, and STRCPY1, to three new goals:
Case 2.3.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(NOT (EQUAL 0 J))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH J LST1))
(NUMBERP J)
(LESSP (STRLEN1 (ADD1 I2) N2 LST2)
(SUB1 J)))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, applying SUB1-TYPE-RESTRICTION and PUT-NTH-0, to:
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(NOT (EQUAL 0 J))
(EQUAL (GET-NTH J
(STRCPY1 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH J LST1))
(NUMBERP J)
(LESSP (STRLEN1 (ADD1 I2) N2 LST2)
(SUB1 J)))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, applying PUT-NTH-0 and SUB1-TYPE-RESTRICTION, and
expanding NULL and STRCPY1, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(NOT (LESSP (PLUS I1 (STRLEN1 (ADD1 I2) N2 LST2))
(SUB1 J)))
(LESSP (PLUS I1
(ADD1 (STRLEN1 (ADD1 I2) N2 LST2)))
J))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH J LST1))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(NOT (LESSP (PLUS 0 (STRLEN1 (ADD1 I2) N2 LST2))
(SUB1 J)))
(NOT (EQUAL J 0))
(NUMBERP J)
(LESSP (STRLEN1 (ADD1 I2) N2 LST2)
(SUB1 J)))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I2 N2))
(LESSP (PLUS I1 (STRLEN1 I2 N2 LST2))
J))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, applying PLUS-0 and PLUS-COMMUTATIVITY, and opening up the
functions STRLEN1 and STRCPY1, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRCPY1-GET-2
(PROVE-LEMMA GET-NTH-PLUS-0
(REWRITE)
(IMPLIES (NOT (NUMBERP J))
(EQUAL (GET-NTH (PLUS I J) LST)
(GET-NTH I LST)))
((ENABLE GET-NTH)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP I) (p I J LST))
(IMPLIES (AND (NOT (ZEROP I))
(p (SUB1 I) J (CDR LST)))
(p I J LST))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, 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 LST. The above induction scheme
leads to the following two new conjectures:
Case 2. (IMPLIES (AND (ZEROP I) (NOT (NUMBERP J)))
(EQUAL (GET-NTH (PLUS I J) LST)
(GET-NTH I LST))).
This simplifies, rewriting with the lemmas PLUS-0 and GET-NTH-0, and opening
up the definitions of ZEROP, EQUAL, GET-NTH, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (GET-NTH (PLUS (SUB1 I) J) (CDR LST))
(GET-NTH (SUB1 I) (CDR LST)))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH (PLUS I J) LST)
(GET-NTH I LST))).
This simplifies, appealing to the lemma SUB1-ADD1, and expanding ZEROP, PLUS,
and GET-NTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
GET-NTH-PLUS-0
(PROVE-LEMMA PLUS-SUB1-ADD1
(REWRITE)
(EQUAL (SUB1 (PLUS X (ADD1 Y)))
(PLUS X Y)))
This conjecture simplifies, using linear arithmetic, to:
(IMPLIES (EQUAL (PLUS X (ADD1 Y)) 0)
(EQUAL (SUB1 (PLUS X (ADD1 Y)))
(PLUS X Y))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-SUB1-ADD1
(PROVE-LEMMA STRCPY1-GET-3
(REWRITE)
(IMPLIES (AND (LEQ I1 J)
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (PLUS I2 (DIFFERENCE J I1))
LST2)))
((EXPAND (STRCPY1 0 LST1 I2 N2 LST2))))
This formula simplifies, rewriting with DIFFERENCE-PLUS2, to the new formula:
(IMPLIES (AND (NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which we will name *1.
Perhaps we can prove it by induction. There are five plausible
inductions. They merge into three likely candidate inductions, all of which
are unflawed. So we will choose the one suggested by the largest number of
nonprimitive recursive functions. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) (NULL)))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(p J
(ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (NOT (LESSP I2 N2))
(p J I1 LST1 I2 N2 LST2))).
Linear arithmetic can be used to show that the measure (DIFFERENCE N2 I2)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for I1 and LST1.
The above induction scheme generates five new conjectures:
Case 5. (IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) (NULL))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which simplifies, appealing to the lemmas PLUS-0, PLUS-COMMUTATIVITY,
PUT-NTH-0, GET-PUT, and PLUS-EQUAL-0, and unfolding NULL, STRLEN1, EQUAL,
STRCPY1, NUMBERP, and DIFFERENCE, to 12 new goals:
Case 5.12.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 5.11.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 5.10.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, obviously, to:
T.
Case 5.9.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))).
This again simplifies, obviously, to:
T.
Case 5.8.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 5.7.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 5.6.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 5.5.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 5.4.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH 0 LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 5.3.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 5.2.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 5.1.
(IMPLIES (AND (LESSP I2 N2)
(EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 4. (IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This simplifies, using linear arithmetic, to the following three new
conjectures:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, using linear arithmetic, applying PLUS-0,
GET-PUT, STRCPY1-GET-1, and PLUS-EQUAL-0, and opening up NULL, LESSP,
STRLEN1, STRCPY1, ADD1, NUMBERP, EQUAL, DIFFERENCE, and PLUS, to the
following six new goals:
Case 4.3.6.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL I1 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with GET-NTH-0, and opening up
LESSP, to:
T.
Case 4.3.5.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL I1 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 4.3.4.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL I1 0)
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, rewriting with GET-NTH-PLUS-0, to:
T.
Case 4.3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with the lemma GET-NTH-0, and
unfolding the function LESSP, to:
T.
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
However this again simplifies, applying the lemma GET-NTH-PLUS-0, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, using linear arithmetic, rewriting with
SUB1-TYPE-RESTRICTION, LESSP-OF-1, GET-PUT, STRCPY1-GET-1, PLUS-0,
PLUS-COMMUTATIVITY, and PLUS-EQUAL-0, and opening up the functions NULL,
LESSP, STRLEN1, PLUS, EQUAL, STRCPY1, NUMBERP, and DIFFERENCE, to the
following five new formulas:
Case 4.2.5.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL J 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 4.2.4.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL J 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
But this again simplifies, applying GET-NTH-0, and opening up the
function LESSP, to:
T.
Case 4.2.3.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, applying GET-NTH-0, and expanding the function
LESSP, to:
T.
Case 4.2.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 4.2.1.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
However this again simplifies, rewriting with GET-NTH-PLUS-0, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(LESSP I1 (ADD1 I1))
(NOT (LESSP I1 I1))
(LESSP I1
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH I1
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 I1) I1)
LST2))).
However this again simplifies, using linear arithmetic, applying
LESSP-SUB1, SUB1-ADD1, CORRECTNESS-OF-CANCEL-LESSP-PLUS, GET-PUT,
STRCPY1-GET-1, PLUS-COMMUTATIVITY, and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and opening up the functions NULL,
LESSP, STRLEN1, FIX, ZEROP, NOT, and STRCPY1, to:
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (LESSP I1 I1))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, applying GET-NTH-0, and unfolding LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2) N2 LST2))))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This simplifies, rewriting with the lemmas SUB1-ADD1, PLUS-EQUAL-0, and
PLUS-SUB1-ADD1, and opening up the definitions of NULL, PLUS, LESSP, STRLEN1,
STRCPY1, and DIFFERENCE, to the new conjecture:
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (NUMBERP I1))
(NOT (LESSP (SUB1 J)
(PLUS 0 (STRLEN1 (ADD1 I2) N2 LST2))))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) N2 LST2)))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS (ADD1 I2) J)
(ADD1 I1))
LST2))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which simplifies, using linear arithmetic, applying PLUS-COMMUTATIVITY,
SUB1-ADD1, PLUS-SUB1-ADD1, PLUS-EQUAL-0, GET-PUT, STRCPY1-GET-1, PLUS-0, and
GET-NTH-0, and opening up the functions NULL, DIFFERENCE, LESSP, STRLEN1,
PLUS, STRCPY1, NUMBERP, and EQUAL, to the following 11 new conjectures:
Case 2.11.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(EQUAL J 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 2.10.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(EQUAL J 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, using linear arithmetic, applying GET-NTH-0,
GET-PUT, STRCPY1-GET-1, PLUS-0, and PLUS-COMMUTATIVITY, and unfolding
LESSP, NUMBERP, EQUAL, and DIFFERENCE, to:
T.
Case 2.9.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, using linear arithmetic, rewriting with
GET-NTH-0, GET-PUT, and STRCPY1-GET-1, and expanding LESSP, PLUS, and
DIFFERENCE, to:
T.
Case 2.8.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.7.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
But this again simplifies, using linear arithmetic, rewriting with GET-PUT,
STRCPY1-GET-1, PLUS-EQUAL-0, and GET-NTH-PLUS-0, and unfolding the
functions EQUAL and DIFFERENCE, to:
T.
Case 2.6.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE 0 I1) LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, GET-PUT,
STRCPY1-GET-1, PLUS-0, and PLUS-COMMUTATIVITY, and opening up the
functions LESSP, NUMBERP, EQUAL, and DIFFERENCE, to:
T.
Case 2.4.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE I2 I1) LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, applying GET-PUT, STRCPY1-GET-1, PLUS-0, and
PLUS-COMMUTATIVITY, and opening up the definitions of NUMBERP, LESSP,
EQUAL, and DIFFERENCE, to the new conjecture:
(IMPLIES (AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))
(NUMBERP I2)
(NOT (EQUAL I2 0)))
(EQUAL (GET-NTH 0 LST2)
(GET-NTH I2 LST2))),
which again simplifies, trivially, to:
T.
Case 2.2.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
But this again simplifies, using linear arithmetic and applying GET-NTH-0,
GET-PUT, and STRCPY1-GET-1, to:
T.
Case 2.1.
(IMPLIES
(AND (LESSP I2 N2)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY1 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, using linear arithmetic, applying GET-PUT,
STRCPY1-GET-1, PLUS-EQUAL-0, GET-NTH-0, PLUS-0, and GET-NTH-PLUS-0, and
expanding the definitions of NUMBERP, EQUAL, DIFFERENCE, LESSP, and PLUS,
to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1 (STRLEN1 I2 N2 LST2))))
(EQUAL (GET-NTH J
(STRCPY1 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This simplifies, rewriting with PLUS-0, PLUS-COMMUTATIVITY, and PLUS-EQUAL-0,
and opening up STRLEN1, STRCPY1, and DIFFERENCE, to six new goals:
Case 1.6.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL J 0))
(NUMBERP J))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (LESSP I2 N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.1 ]
STRCPY1-GET-3
(PROVE-LEMMA STRCAT-GET-1
(REWRITE)
(IMPLIES (LESSP J (STRLEN 0 N1 LST1))
(EQUAL (GET-NTH J (STRCAT N1 LST1 N2 LST2))
(GET-NTH J LST1))))
This simplifies, expanding NULL and STRCAT, to two new goals:
Case 2. (IMPLIES (AND (LESSP J (STRLEN 0 N1 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J
(STRCPY1 (STRLEN 1 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, applying the lemmas STRLEN-01 and STRCPY1-GET-1, and
opening up the functions ADD1, NULL, LESSP, EQUAL, and STRLEN, to two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP N1))
(LESSP J 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J (STRCPY1 1 LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL N1 0)
(LESSP J 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J (STRCPY1 1 LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP J (STRLEN 0 N1 LST1))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH J (STRCPY1 0 LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, unfolding NULL, LESSP, EQUAL, and STRLEN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRCAT-GET-1
(PROVE-LEMMA STRCAT-GET-2
(REWRITE)
(IMPLIES (AND (STRINGP 0 N1 LST1)
(LEQ (STRLEN 0 N1 LST1) J)
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2))))
(EQUAL (GET-NTH J (STRCAT N1 LST1 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2)))
((USE (STRCPY1-GET-3 (I1 (STRLEN 0 N1 LST1))
(I2 0)))
(ENABLE STRLEN1-STRLEN)))
This simplifies, rewriting with STRLEN1-STRLEN, PLUS-0, and PLUS-COMMUTATIVITY,
and unfolding the functions EQUAL, DIFFERENCE, AND, IMPLIES, STRINGP, NULL,
and STRCAT, to two new goals:
Case 2. (IMPLIES (AND (EQUAL (GET-NTH J
(STRCPY1 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (LESSP J (STRLEN 0 N1 LST1)))
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2)))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J
(STRCPY1 (STRLEN 1 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))),
which again simplifies, rewriting with the lemmas SLEN-01 and
PLUS-COMMUTATIVITY, and opening up the functions ADD1, NULL, LESSP, EQUAL,
STRLEN, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (EQUAL (GET-NTH J
(STRCPY1 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (LESSP J (STRLEN 0 N1 LST1)))
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2)))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH J (STRCPY1 0 LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))),
which again simplifies, using linear arithmetic, applying PLUS-0,
STRLEN1-STRLEN, STRCPY1-GET-3, and DIFFERENCE-0, and unfolding NULL, LESSP,
EQUAL, STRLEN, DIFFERENCE, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRCAT-GET-2
(PROVE-LEMMA STRCHR-THM1
(REWRITE)
(IMPLIES (STRCHR I N LST CH)
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH))
(p I N LST CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH I LST) 0))
(p I N LST CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(p (ADD1 I) N LST CH))
(p I N LST CH))
(IMPLIES (NOT (LESSP I N))
(p I N LST CH))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) 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
conjectures:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)).
This simplifies, opening up STRCHR, to the new formula:
(IMPLIES (AND (LESSP I N) (NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST)
(GET-NTH I LST))),
which again simplifies, applying the lemma GET-NTH-0, and unfolding LESSP,
to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH I LST) 0)
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)),
which simplifies, opening up the definitions of STRCHR and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I) N LST CH))
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)),
which simplifies, unfolding the definition of STRCHR, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH (STRCHR (ADD1 I) N LST CH)
LST)
CH)
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)),
which simplifies, opening up STRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRCHR I N LST CH) LST)
CH)),
which simplifies, opening up STRCHR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCHR-THM1
(PROVE-LEMMA STRCHR-THM2 NIL
(IMPLIES (AND (LEQ I J)
(LESSP J (STRCHR I N LST CH)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Name the conjecture *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST))
(p J I N LST))
(IMPLIES (NOT (LESSP I N))
(p J I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates the following five new
conjectures:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definition of STRCHR, to:
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I))
(NOT (NUMBERP I)))
(NOT (LESSP J 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0)
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))),
which simplifies, opening up the functions STRCHR, EQUAL, NUMBERP, and LESSP,
to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))),
which again simplifies, applying GET-NTH-0, and opening up the functions
LESSP, NUMBERP, EQUAL, and STRCHR, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))).
This again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, and
LESSP-OF-1, and opening up LESSP, STRCHR, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP I (ADD1 I))
(NOT (LESSP I I)))
(NOT (LESSP I
(STRCHR I N LST (GET-NTH I LST))))).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J
(STRCHR (ADD1 I)
N LST
(GET-NTH J LST))))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definition of STRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR I N LST (GET-NTH J LST))))).
This simplifies, opening up STRCHR, NUMBERP, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCHR-THM2
(PROVE-LEMMA STRCHR-THM3 NIL
(IMPLIES (AND (NOT (STRCHR I N LST CH))
(LEQ I J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Give the conjecture the name *1.
We will try to prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST))
(p J I N LST))
(IMPLIES (NOT (LESSP I N))
(p J I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, unfolding the definition of STRCHR, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0)
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, unfolding STRCHR, EQUAL, STRLEN, and NULL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(STRCHR (ADD1 I)
N LST
(GET-NTH J LST))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, expanding the function STRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which again simplifies, rewriting with the lemma GET-NTH-0, and unfolding
LESSP, STRLEN, and NULL, to two new conjectures:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR I N LST (GET-NTH 0 LST)))
(EQUAL I 0))
(EQUAL (STRLEN 0 N LST) 0)),
which again simplifies, trivially, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR I N LST (GET-NTH 0 LST)))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (STRLEN (ADD1 I) N LST) 0)).
But this again simplifies, rewriting with GET-NTH-0, and expanding the
function LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
But this again simplifies, applying the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and expanding the functions LESSP
and STRCHR, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP I (ADD1 I))
(NOT (STRCHR I N LST (GET-NTH I LST)))
(NOT (LESSP I I)))
(NOT (LESSP I (STRLEN I N LST)))),
which again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRCHR, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (STRCHR I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRCHR and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
STRCHR-THM3
(PROVE-LEMMA STRCHR-THM4 NIL
(IMPLIES (AND (STRINGP I N LST)
(NOT (STRCHR I N LST CH)))
(NOT (EQUAL CH 0))))
This simplifies, opening up the function STRINGP, to the goal:
(IMPLIES (LESSP (SLEN I N LST) N)
(STRCHR I N LST 0)).
Call the above conjecture *1.
We will appeal to induction. There are two plausible inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I N))
(p I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(LESSP (SLEN I N LST) N))
(STRCHR I N LST 0)).
This simplifies, unfolding the definitions of STRCHR and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(STRCHR I N LST 0)).
This simplifies, rewriting with SLEN-REC, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(STRCHR (ADD1 I) N LST 0)
(LESSP (SLEN I N LST) N))
(STRCHR I N LST 0)),
which simplifies, expanding STRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LESSP (SLEN I N LST) N))
(STRCHR I N LST 0)),
which simplifies, using linear arithmetic and rewriting with the lemma
SLEN-LBOUND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCHR-THM4
(PROVE-LEMMA STRCPY-STRCHR
(REWRITE)
(EQUAL (STRCHR I N (STRCPY I LST1 N LST2) CH)
(STRCHR I N LST2 CH)))
Call the conjecture *1.
We will try to prove it by 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 (LESSP I N)
(EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(p I N LST1 LST2 CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
0))
(p I N LST1 LST2 CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
0))
(p (ADD1 I)
N
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2 CH))
(p I N LST1 LST2 CH))
(IMPLIES (NOT (LESSP I N))
(p I N LST1 LST2 CH))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for LST1. The above
induction scheme generates four new goals:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(EQUAL (STRCHR I N (STRCPY I LST1 N LST2) CH)
(STRCHR I N LST2 CH))),
which simplifies, opening up the functions STRCPY, NULL, and STRCHR, to four
new formulas:
Case 4.4.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP I)))
(EQUAL 0
(STRCHR I N LST2
(GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))))),
which again simplifies, using linear arithmetic, rewriting with the lemmas
GET-NTH-0, GET-PUT, and STRCPY-GET-1, and expanding the function LESSP, to
the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NUMBERP I)))
(EQUAL 0
(STRCHR I N LST2 (GET-NTH I LST2)))).
But this again simplifies, applying GET-NTH-0, and unfolding LESSP, STRCHR,
and EQUAL, to:
T.
Case 4.3.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NUMBERP I))
(EQUAL I
(STRCHR I N LST2
(GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))))).
But this again simplifies, using linear arithmetic, appealing to the
lemmas GET-PUT and STRCPY-GET-1, and unfolding the function STRCHR, to:
T.
Case 4.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST2) 0)
(NOT (NUMBERP I)))
(EQUAL 0
(STRCHR I N LST2
(GET-NTH I (PUT-NTH 0 I LST1))))),
which again simplifies, rewriting with the lemmas GET-NTH-0, PUT-NTH-0,
and GET-PUT, and expanding the functions LESSP, NUMBERP, EQUAL, and STRCHR,
to:
T.
Case 4.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST2) 0)
(NUMBERP I))
(EQUAL I
(STRCHR I N LST2
(GET-NTH I (PUT-NTH 0 I LST1))))),
which again simplifies, rewriting with the lemma GET-PUT, and expanding
the definitions of EQUAL and STRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
0))
(EQUAL (STRCHR I N (STRCPY I LST1 N LST2) CH)
(STRCHR I N LST2 CH))),
which simplifies, applying GET-PUT, and expanding the definitions of STRCPY,
NULL, STRCHR, and EQUAL, to the following three new conjectures:
Case 3.3.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL 0 CH))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))
0)
(NOT (EQUAL (GET-NTH I LST2) CH)))
(EQUAL (STRCHR I N
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2)
CH)
(STRCHR (ADD1 I) N LST2 CH))).
However this again simplifies, using linear arithmetic and rewriting with
GET-PUT and STRCPY-GET-1, to:
T.
Case 3.2.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL 0 CH))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))
0)
(EQUAL (GET-NTH I LST2) CH)
(NUMBERP I))
(EQUAL (STRCHR I N
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2)
CH)
I)).
This again simplifies, using linear arithmetic and rewriting with GET-PUT
and STRCPY-GET-1, to:
T.
Case 3.1.
(IMPLIES
(AND (LESSP I N)
(NOT (EQUAL 0 CH))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2))
0)
(EQUAL (GET-NTH I LST2) CH)
(NOT (NUMBERP I)))
(EQUAL (STRCHR I N
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2)
CH)
0)).
However this again simplifies, using linear arithmetic, appealing to the
lemmas GET-NTH-0, GET-PUT, and STRCPY-GET-1, and opening up the
definitions of LESSP, EQUAL, and STRCHR, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL 0 (GET-NTH 0 LST2)))
(EQUAL (GET-NTH I LST2) 0))
(NUMBERP I)).
This again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
CH))
(NOT (EQUAL (GET-NTH I (STRCPY I LST1 N LST2))
0))
(EQUAL (STRCHR (ADD1 I)
N
(STRCPY (ADD1 I)
(PUT-NTH (GET-NTH I LST2) I LST1)
N LST2)
CH)
(STRCHR (ADD1 I) N LST2 CH)))
(EQUAL (STRCHR I N (STRCPY I LST1 N LST2) CH)
(STRCHR I N LST2 CH))).
This simplifies, using linear arithmetic, appealing to the lemmas GET-PUT
and STRCPY-GET-1, and expanding the definitions of STRCPY, NULL, STRCHR, and
EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LESSP I N))
(EQUAL (STRCHR I N (STRCPY I LST1 N LST2) CH)
(STRCHR I N LST2 CH))).
This simplifies, unfolding STRCPY, STRCHR, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRCPY-STRCHR
(PROVE-LEMMA MEMSET1-GET-1
(REWRITE)
(IMPLIES (LESSP J I)
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))))
Give the conjecture the name *1.
Let us appeal to the induction principle. 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 (EQUAL (SUB1 N) 0)
(p J I N LST CH))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p J
(ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(p J I N LST CH))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 can be used to show 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 I and LST. The above induction scheme generates the following
three new conjectures:
Case 3. (IMPLIES (AND (EQUAL (SUB1 N) 0) (LESSP J I))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))).
This simplifies, appealing to the lemmas SUB1-OF-1, GET-NTH-0, GET-PUT, and
SUB1-NNUMBERP, and expanding the functions EQUAL, SUB1, and MEMSET1, to the
following 15 new goals:
Case 3.15.
(IMPLIES (AND (EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL CH (GET-NTH J LST))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.14.
(IMPLIES (AND (EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, expanding the function LESSP, to:
T.
Case 3.13.
(IMPLIES (AND (EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, opening up the function LESSP, to:
T.
Case 3.12.
(IMPLIES (AND (EQUAL N 0)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.11.
(IMPLIES (AND (EQUAL N 0)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))),
which again simplifies, rewriting with GET-NTH-0, and opening up the
definition of LESSP, to:
T.
Case 3.10.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL CH (GET-NTH J LST))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.9.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, expanding LESSP, to:
T.
Case 3.8.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 3.7.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (NUMBERP N))
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
the definition of LESSP, to:
T.
Case 3.5.
(IMPLIES (AND (EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.4.
(IMPLIES (AND (EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, opening up the function LESSP, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, opening up the function LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (EQUAL N 1)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL N 1)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))),
which again simplifies, rewriting with GET-NTH-0, and unfolding LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J (ADD1 I)))
(LESSP J I))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH J (PUT-NTH CH I LST)))
(LESSP J I))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))).
This simplifies, rewriting with SUB1-OF-1, GET-NTH-0, and GET-PUT, and
expanding the definitions of LESSP, MEMSET1, and EQUAL, to two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NUMBERP J)
(EQUAL I J)
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
CH)
(LESSP I I))
(EQUAL (GET-NTH I
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH I LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH 0 LST)))
(EQUAL (GET-NTH 0
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH 0 LST))),
which again simplifies, applying GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
MEMSET1-GET-1
(PROVE-LEMMA MEMSET1-THM1
(REWRITE)
(IMPLIES (AND (LEQ I J) (LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH))
((INDUCT (MEMSET1 I N LST CH))))
This conjecture can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to two new conjectures:
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)),
which simplifies, using linear arithmetic, to three new goals:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)),
which again simplifies, applying the lemmas SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, LESSP-OF-1, GET-PUT, SUB1-TYPE-RESTRICTION, PLUS-ADD1,
and PUT-NTH-0, and opening up the functions LESSP, PLUS, EQUAL, SUB1,
MEMSET1, and NUMBERP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)),
which again simplifies, rewriting with SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-TYPE-RESTRICTION, PLUS-ADD1, LESSP-OF-1,
PUT-NTH-0, and GET-PUT, and unfolding the functions LESSP, EQUAL, PLUS,
SUB1, MEMSET1, and NUMBERP, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(EQUAL (SUB1 N) 0)
(NOT (LESSP I I))
(LESSP I (PLUS I N)))
(EQUAL (GET-NTH I (MEMSET1 I N LST CH))
CH)).
But this again simplifies, rewriting with SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-ADD1,
LESSP-SUB1, SUB1-ADD1, and GET-PUT, and opening up FIX, ZEROP, NOT, LESSP,
EQUAL, SUB1, and MEMSET1, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (IF (LESSP J (ADD1 I)) F T)
(LESSP J (PLUS (ADD1 I) (SUB1 N))))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
CH))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)).
This simplifies, appealing to the lemmas SUB1-ADD1, PLUS-COMMUTATIVITY,
PLUS-0, GET-NTH-0, SUB1-OF-1, GET-PUT, and MEMSET1-GET-1, and unfolding
LESSP, PLUS, AND, IMPLIES, EQUAL, and MEMSET1, to the following nine new
formulas:
Case 1.9.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)),
which we will name *1.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)).
Give the above formula the name *2.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(EQUAL I 0))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)),
which we will name *3.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)).
This again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)),
which we will name *4.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LESSP J N))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)).
However this again simplifies, expanding the definitions of EQUAL and
LESSP, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (PLUS I N))
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST) CH)),
which again simplifies, applying SUB1-NNUMBERP, and expanding the
functions EQUAL and LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (PLUS I N))
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST) CH)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LESSP J N))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP J 1)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LESSP J N))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
CH)).
But this again simplifies, rewriting with LESSP-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-OF-1, and SUB1-NNUMBERP, and unfolding the
functions SUB1, EQUAL, and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
CH)).
However this again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP J 1)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
CH)).
However this again simplifies, appealing to the lemmas LESSP-OF-1,
PLUS-COMMUTATIVITY, PLUS-EQUAL-0, SUB1-OF-1, and SUB1-NNUMBERP, and
unfolding the definitions of SUB1, EQUAL, and LESSP, to:
T.
So next consider:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)),
named *4 above. But this conjecture is subsumed by another subgoal awaiting
our attention, namely *2 above.
So let us turn our attention to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)),
which is formula *3 above. Let us appeal to the induction principle. There
is only one suggested induction. We will induct according to the following
scheme:
(AND (IMPLIES (EQUAL (SUB1 N) 0)
(p N LST CH))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p (SUB1 N) (PUT-NTH CH 0 LST) CH))
(p N LST CH))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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. Note, however, the inductive instance
chosen for LST. The above induction scheme produces the following three new
goals:
Case 3. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (SUB1 N) 1)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This simplifies, applying the lemma GET-PUT, and unfolding the definitions
of EQUAL, MEMSET1, ADD1, SUB1, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH 0
(MEMSET1 0
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
CH)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This simplifies, applying SUB1-OF-1, GET-PUT, and MEMSET1-GET-1, and
expanding the definitions of MEMSET1, ADD1, LESSP, NUMBERP, and EQUAL, to:
T.
That finishes the proof of *3.
So next consider:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)),
named *2 above. We will try to prove it by induction. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (EQUAL (SUB1 N) 0)
(p I N LST CH J))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH J))
(p I N LST CH J))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I and LST. The above induction scheme generates two new formulas:
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (MEMSET1 I N LST CH))
CH)),
which simplifies, using linear arithmetic, rewriting with SUB1-OF-1, GET-PUT,
and MEMSET1-GET-1, and opening up the functions MEMSET1, NUMBERP, and EQUAL,
to:
T.
That finishes the proof of *2.
So next consider:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)),
which is formula *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 (EQUAL (SUB1 N) 0)
(p N LST CH J))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p (SUB1 N) (PUT-NTH CH 0 LST) CH J))
(p N LST CH J))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 LST. The above induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (SUB1 N) 1)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)).
This simplifies, rewriting with GET-PUT, and expanding the functions EQUAL,
MEMSET1, ADD1, SUB1, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH 0
(MEMSET1 0
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
CH)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (MEMSET1 0 N LST CH))
CH)),
which simplifies, rewriting with SUB1-OF-1, GET-PUT, and MEMSET1-GET-1, and
expanding the definitions of MEMSET1, ADD1, LESSP, NUMBERP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
MEMSET1-THM1
(PROVE-LEMMA MEMSET1-THM2
(REWRITE)
(IMPLIES (AND (LEQ (PLUS I N) J)
(NOT (ZEROP N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST)))
((INDUCT (MEMSET1 I N LST CH))))
This conjecture can be simplified, using the abbreviations SUB1-OF-1, ZEROP,
IMPLIES, NOT, OR, and AND, to two new conjectures:
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (LESSP J (PLUS I N)))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))),
which simplifies, applying SUB1-OF-1, PLUS-ADD1, PLUS-COMMUTATIVITY,
SUB1-ADD1, PUT-NTH-0, and GET-PUT, and expanding the definitions of LESSP,
EQUAL, NUMBERP, SUB1, and MEMSET1, to:
(IMPLIES (AND (EQUAL N 1)
(NOT (EQUAL J 0))
(NUMBERP J)
(NUMBERP I)
(NOT (LESSP (SUB1 J) I))
(EQUAL I J))
(EQUAL CH (GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (IF (LESSP J (PLUS (ADD1 I) (SUB1 N)))
F T)
(NOT (ZEROP (SUB1 N))))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH J (PUT-NTH CH I LST))))
(NOT (LESSP J (PLUS I N))))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))),
which simplifies, applying SUB1-ADD1, PLUS-COMMUTATIVITY, SUB1-OF-1,
GET-NTH-0, GET-PUT, CORRECTNESS-OF-CANCEL-LESSP-PLUS, and PLUS-EQUAL-0, and
unfolding the functions PLUS, LESSP, ZEROP, NOT, AND, IMPLIES, EQUAL, FIX,
and MEMSET1, to the following three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (EQUAL 0 J))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH J LST))
(NOT (LESSP J N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))).
This again simplifies, applying SUB1-TYPE-RESTRICTION and PUT-NTH-0, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (EQUAL 0 J))
(EQUAL (GET-NTH J
(MEMSET1 1
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
(GET-NTH J LST))
(NOT (LESSP J N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))),
which again simplifies, rewriting with the lemmas PUT-NTH-0,
SUB1-TYPE-RESTRICTION, and SUB1-OF-1, and opening up the function MEMSET1,
to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) (PLUS (SUB1 N) I))
(NOT (LESSP J (PLUS I N))))
(EQUAL (GET-NTH J
(MEMSET1 (ADD1 I)
(SUB1 N)
(PUT-NTH CH I LST)
CH))
(GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) (PLUS (SUB1 N) 0))
(NOT (LESSP J N)))
(EQUAL (GET-NTH J (MEMSET1 I N LST CH))
(GET-NTH J LST))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
MEMSET1-THM2
(PROVE-LEMMA MEMSET-THM1
(REWRITE)
(IMPLIES (AND (LEQ I J) (LESSP J N))
(EQUAL (GET-NTH J (MEMSET N LST CH))
CH)))
WARNING: Note that MEMSET-THM1 contains the free variable I which will be
chosen by instantiating the hypothesis (NOT (LESSP J I)).
This conjecture simplifies, opening up MEMSET, to two new goals:
Case 2. (IMPLIES (AND (NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)),
which we will name *1.
Case 1. (IMPLIES (AND (NOT (LESSP J I))
(LESSP J N)
(EQUAL N 0))
(EQUAL (GET-NTH J LST) CH)).
This again simplifies, using linear arithmetic, to:
T.
So we now return to:
(IMPLIES (AND (NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)),
which we named *1 above. Let us appeal to the induction principle. There is
only one suggested induction. We will induct according to the following
scheme:
(AND (IMPLIES (EQUAL (SUB1 N) 0)
(p J N LST CH I))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p J
(SUB1 N)
(PUT-NTH CH 0 LST)
CH I))
(p J N LST CH I))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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. Note, however, the inductive instance
chosen for LST. The above induction scheme produces the following three new
formulas:
Case 3. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J (SUB1 N)))
(NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)).
This simplifies, using linear arithmetic, to the following two new formulas:
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J (SUB1 N)))
(NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)).
This again simplifies, rewriting with SUB1-NNUMBERP, and unfolding the
function EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP N)
(NOT (EQUAL (SUB1 (PLUS 1 J)) 0))
(NOT (LESSP J (SUB1 (PLUS 1 J))))
(NOT (LESSP J I))
(LESSP J (PLUS 1 J))
(NOT (EQUAL (PLUS 1 J) 0)))
(EQUAL (GET-NTH J
(MEMSET1 0 (PLUS 1 J) LST CH))
CH)).
But this again simplifies, using linear arithmetic, applying PLUS-ADD1,
SUB1-ADD1, LESSP-SUB1, LESSP-OF-1, and MEMSET1-THM1, and unfolding the
functions LESSP, ADD1, and MEMSET1, to:
T.
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)).
This simplifies, rewriting with SUB1-OF-1, LESSP-OF-1, and GET-PUT, and
expanding the functions LESSP, EQUAL, SUB1, MEMSET1, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH J
(MEMSET1 0
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
CH)
(NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
CH)),
which simplifies, applying the lemma SUB1-OF-1, and expanding MEMSET1 and
ADD1, to:
(IMPLIES (AND (NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL (GET-NTH J
(MEMSET1 0
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
CH)
(NOT (LESSP J I))
(LESSP J N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J
(MEMSET1 1
(SUB1 N)
(PUT-NTH CH 0 LST)
CH))
CH)).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to eliminate
(SUB1 N). We employ the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. We must thus prove:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 1))
(EQUAL (GET-NTH J
(MEMSET1 0 X (PUT-NTH CH 0 LST) CH))
CH)
(NOT (LESSP J I))
(LESSP J (ADD1 X))
(NOT (EQUAL (ADD1 X) 0)))
(EQUAL (GET-NTH J
(MEMSET1 1 X (PUT-NTH CH 0 LST) CH))
CH)).
This further simplifies, using linear arithmetic, applying ADD1-EQUAL,
SUB1-ADD1, GET-PUT, and MEMSET1-GET-1, and opening up the definitions of
NUMBERP, LESSP, and EQUAL, to the new goal:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL X 0))
(EQUAL (GET-NTH J
(MEMSET1 0 X (PUT-NTH CH 0 LST) CH))
CH)
(NOT (LESSP J I))
(LESSP (SUB1 J) X))
(EQUAL (GET-NTH J
(MEMSET1 1 X (PUT-NTH CH 0 LST) CH))
CH)).
Applying the lemma SUB1-ELIM, replace J by (ADD1 Z) to eliminate (SUB1 J).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. This produces the following three new
conjectures:
Case 1.3.
(IMPLIES (AND (EQUAL J 0)
(NUMBERP X)
(NOT (EQUAL X 0))
(EQUAL (GET-NTH J
(MEMSET1 0 X (PUT-NTH CH 0 LST) CH))
CH)
(NOT (LESSP J I))
(LESSP (SUB1 J) X))
(EQUAL (GET-NTH J
(MEMSET1 1 X (PUT-NTH CH 0 LST) CH))
CH)).
This further simplifies, using linear arithmetic, appealing to the lemmas
PLUS-0, MEMSET1-THM1, GET-PUT, and MEMSET1-GET-1, and opening up the
definitions of LESSP, EQUAL, SUB1, and NUMBERP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP J))
(NUMBERP X)
(NOT (EQUAL X 0))
(EQUAL (GET-NTH J
(MEMSET1 0 X (PUT-NTH CH 0 LST) CH))
CH)
(NOT (LESSP J I))
(LESSP (SUB1 J) X))
(EQUAL (GET-NTH J
(MEMSET1 1 X (PUT-NTH CH 0 LST) CH))
CH)),
which further simplifies, using linear arithmetic, applying the lemmas
PLUS-0, MEMSET1-THM1, SUB1-NNUMBERP, GET-PUT, and MEMSET1-GET-1, and
expanding the definitions of LESSP, EQUAL, and NUMBERP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL (ADD1 Z) 0))
(NUMBERP X)
(NOT (EQUAL X 0))
(EQUAL (GET-NTH (ADD1 Z)
(MEMSET1 0 X (PUT-NTH CH 0 LST) CH))
CH)
(NOT (LESSP (ADD1 Z) I))
(LESSP Z X))
(EQUAL (GET-NTH (ADD1 Z)
(MEMSET1 1 X (PUT-NTH CH 0 LST) CH))
CH)),
which further simplifies, using linear arithmetic, applying SUB1-ADD1,
PLUS-ADD1, and MEMSET1-THM1, and opening up LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
MEMSET-THM1
(PROVE-LEMMA MEMSET-THM2
(REWRITE)
(IMPLIES (AND (LEQ N J) (NUMBERP N))
(EQUAL (GET-NTH J (MEMSET N LST CH))
(GET-NTH J LST))))
This simplifies, expanding the definition of MEMSET, to:
(IMPLIES (AND (NOT (LESSP J N))
(NUMBERP N)
(NOT (EQUAL N 0)))
(EQUAL (GET-NTH J (MEMSET1 0 N LST CH))
(GET-NTH J LST))).
This again simplifies, using linear arithmetic and rewriting with PLUS-0 and
MEMSET1-THM2, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMSET-THM2
(PROVE-LEMMA MEMCHR1-THM1
(REWRITE)
(IMPLIES (MEMCHR1 I N LST CH)
(EQUAL (GET-NTH (MEMCHR1 I N LST CH) LST)
CH)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (EQUAL (GET-NTH I LST) CH)
(p I N LST CH))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (SUB1 N) 0))
(p I N LST CH))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I) (SUB1 N) LST CH))
(p I N LST CH))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I. The above induction scheme leads to the following four new conjectures:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST) CH)
(MEMCHR1 I N LST CH))
(EQUAL (GET-NTH (MEMCHR1 I N LST CH) LST)
CH)).
This simplifies, opening up MEMCHR1, to the new formula:
(IMPLIES (NOT (NUMBERP I))
(EQUAL (GET-NTH 0 LST)
(GET-NTH I LST))),
which again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (SUB1 N) 0)
(MEMCHR1 I N LST CH))
(EQUAL (GET-NTH (MEMCHR1 I N LST CH) LST)
CH)),
which simplifies, rewriting with SUB1-OF-1 and SUB1-NNUMBERP, and expanding
the functions EQUAL, SUB1, and MEMCHR1, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (SUB1 N) 0))
(NOT (MEMCHR1 (ADD1 I) (SUB1 N) LST CH))
(MEMCHR1 I N LST CH))
(EQUAL (GET-NTH (MEMCHR1 I N LST CH) LST)
CH)).
This simplifies, rewriting with SUB1-OF-1, and unfolding the definition of
MEMCHR1, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH (MEMCHR1 (ADD1 I) (SUB1 N) LST CH)
LST)
CH)
(MEMCHR1 I N LST CH))
(EQUAL (GET-NTH (MEMCHR1 I N LST CH) LST)
CH)),
which simplifies, rewriting with the lemma SUB1-OF-1, and opening up MEMCHR1,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCHR1-THM1
(PROVE-LEMMA MEMCHR-THM1
(REWRITE)
(IMPLIES (MEMCHR N LST CH)
(EQUAL (GET-NTH (MEMCHR N LST CH) LST)
CH)))
This formula can be simplified, using the abbreviations MEMCHR and IMPLIES, to
the new conjecture:
(IMPLIES (AND (NOT (EQUAL N 0))
(MEMCHR1 0 N LST CH))
(EQUAL (GET-NTH (MEMCHR N LST CH) LST)
CH)),
which simplifies, rewriting with MEMCHR1-THM1, and opening up MEMCHR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCHR-THM1
(PROVE-LEMMA MEMCHR1-THM2 NIL
(IMPLIES (AND (LEQ I J)
(LESSP J (MEMCHR1 I N LST CH)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Name the conjecture *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(p J I N LST))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (SUB1 N) 0))
(p J I N LST))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (SUB1 N) 0))
(p J (ADD1 I) (SUB1 N) LST))
(p J I N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I. The above induction scheme generates the following four new
conjectures:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definition of MEMCHR1, to:
(IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I))
(NOT (NUMBERP I)))
(NOT (LESSP J 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))),
which simplifies, appealing to the lemmas SUB1-OF-1 and SUB1-NNUMBERP, and
expanding the definitions of EQUAL, SUB1, MEMCHR1, NUMBERP, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (SUB1 N) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))),
which simplifies, using linear arithmetic, to three new conjectures:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (SUB1 N) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))),
which again simplifies, applying the lemmas GET-NTH-0 and SUB1-OF-1, and
expanding the functions LESSP, NUMBERP, MEMCHR1, and EQUAL, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (SUB1 N) 0))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))),
which again simplifies, rewriting with GET-NTH-0, SUB1-OF-1,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and unfolding the definitions of
LESSP, MEMCHR1, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(NOT (EQUAL (SUB1 N) 0))
(LESSP I (ADD1 I))
(NOT (LESSP I I)))
(NOT (LESSP I
(MEMCHR1 I N LST (GET-NTH I LST))))).
This again simplifies, clearly, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J
(MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH J LST))))
(NOT (LESSP J I)))
(NOT (LESSP J
(MEMCHR1 I N LST (GET-NTH J LST))))).
This simplifies, applying SUB1-OF-1, and expanding the function MEMCHR1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
MEMCHR1-THM2
(PROVE-LEMMA MEMCHR-THM2 NIL
(IMPLIES (LESSP J (MEMCHR N LST CH))
(NOT (EQUAL (GET-NTH J LST) CH)))
((USE (MEMCHR1-THM2 (I 0)))))
This conjecture simplifies, unfolding the functions EQUAL, LESSP, AND, NOT,
IMPLIES, and MEMCHR, to:
(IMPLIES (AND (NOT (LESSP J
(MEMCHR1 0 N LST (GET-NTH J LST))))
(EQUAL N 0))
(NOT (LESSP J F))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCHR-THM2
(PROVE-LEMMA MEMCHR1-THM3 NIL
(IMPLIES (AND (NOT (MEMCHR1 I N LST CH))
(LEQ I J)
(LESSP J (PLUS I N)))
(NOT (EQUAL (GET-NTH J LST) CH)))
((INDUCT (MEMCHR1 I N LST CH))))
This conjecture can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to three new conjectures:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST) CH)
(NOT (MEMCHR1 I N LST CH))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(NOT (EQUAL (GET-NTH J LST) CH))),
which simplifies, unfolding MEMCHR1, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (SUB1 N) 0)
(NOT (MEMCHR1 I N LST CH))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(NOT (EQUAL (GET-NTH J LST) CH))),
which simplifies, using linear arithmetic, to three new goals:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (SUB1 N) 0)
(NOT (MEMCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))),
which again simplifies, rewriting with GET-NTH-0, SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-NNUMBERP, LESSP-OF-1, SUB1-TYPE-RESTRICTION, and
PLUS-ADD1, and opening up the definitions of EQUAL, SUB1, MEMCHR1, LESSP,
and PLUS, to the following two new conjectures:
Case 2.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(EQUAL N 1))
(NOT (EQUAL I 0))).
This again simplifies, trivially, to:
T.
Case 2.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(EQUAL N 1))
(NUMBERP I)).
But this again simplifies, applying GET-NTH-0, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (SUB1 N) 0)
(NOT (MEMCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))).
This again simplifies, appealing to the lemmas GET-NTH-0, SUB1-OF-1,
PLUS-0, PLUS-COMMUTATIVITY, SUB1-NNUMBERP, SUB1-TYPE-RESTRICTION,
PLUS-ADD1, and LESSP-OF-1, and expanding the definitions of EQUAL, SUB1,
MEMCHR1, LESSP, and PLUS, to two new conjectures:
Case 2.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST)))
(EQUAL N 1))
(NOT (EQUAL J 0))),
which again simplifies, obviously, to:
T.
Case 2.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST)))
(EQUAL N 1))
(NUMBERP J)).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(EQUAL (SUB1 N) 0)
(NOT (MEMCHR1 I N LST (GET-NTH I LST)))
(NOT (LESSP I I)))
(NOT (LESSP I (PLUS I N)))),
which again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (NOT (MEMCHR1 (ADD1 I) (SUB1 N) LST CH))
(IF (LESSP J (ADD1 I)) F T)
(LESSP J (PLUS (ADD1 I) (SUB1 N))))
(NOT (EQUAL (GET-NTH J LST) CH)))
(NOT (MEMCHR1 I N LST CH))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(NOT (EQUAL (GET-NTH J LST) CH))).
This simplifies, rewriting with the lemmas SUB1-ADD1, PLUS-COMMUTATIVITY,
GET-NTH-0, PLUS-0, SUB1-OF-1, and SUB1-TYPE-RESTRICTION, and opening up the
definitions of NOT, LESSP, PLUS, AND, IMPLIES, EQUAL, and MEMCHR1, to the
following eight new formulas:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (MEMCHR1 I N LST (GET-NTH 0 LST))))
(NOT (EQUAL I 0))).
But this again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (MEMCHR1 I N LST (GET-NTH 0 LST))))
(NUMBERP I)),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(NOT (MEMCHR1 I N LST (GET-NTH 0 LST))))
(NOT (EQUAL I 0))).
This again simplifies, obviously, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(NOT (MEMCHR1 I N LST (GET-NTH 0 LST))))
(NUMBERP I)).
But this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(NOT (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST)))
(NOT (MEMCHR1 1
(SUB1 N)
LST
(GET-NTH J LST))))
(NOT (LESSP J N))).
However this again simplifies, applying the lemma GET-NTH-0, and unfolding
the functions EQUAL and LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))),
which again simplifies, applying GET-NTH-0 and SUB1-NNUMBERP, and
opening up the functions EQUAL and LESSP, to:
T.
Case 1.3.1.
(IMPLIES (AND (NUMBERP J)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 I) I)
(NOT (MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH I LST)))
(NOT (LESSP I I)))
(NOT (LESSP I (PLUS I N)))).
This again simplifies, clearly, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(NOT (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST)))
(NOT (MEMCHR1 1
(SUB1 N)
LST
(GET-NTH J LST))))
(NOT (LESSP J N))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(NOT (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST)))
(NOT (MEMCHR1 1
(SUB1 N)
LST
(GET-NTH J LST))))
(NOT (LESSP J N))).
This again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(NOT (MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(NOT (MEMCHR1 (ADD1 I)
(SUB1 N)
LST
(GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (PLUS I N)))).
This again simplifies, applying the lemmas LESSP-OF-1, PLUS-COMMUTATIVITY,
PLUS-EQUAL-0, SUB1-OF-1, GET-NTH-0, and SUB1-NNUMBERP, and unfolding SUB1,
EQUAL, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.1 0.1 ]
MEMCHR1-THM3
(PROVE-LEMMA MEMCHR-THM3 NIL
(IMPLIES (AND (NOT (MEMCHR N LST CH))
(LESSP J N))
(NOT (EQUAL (GET-NTH J LST) CH)))
((USE (MEMCHR1-THM3 (I 0)))))
This formula simplifies, rewriting with the lemmas PLUS-0 and SUB1-NNUMBERP,
and opening up NOT, EQUAL, LESSP, AND, IMPLIES, MEMCHR, MEMCHR1, and NUMBERP,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCHR-THM3
(PROVE-LEMMA STRRCHR-LA1
(REWRITE)
(IMPLIES (NUMBERP J)
(STRRCHR I N LST CH J)))
This conjecture simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRRCHR-LA1
(PROVE-LEMMA STRRCHR-STRCHR-LA
(REWRITE)
(IMPLIES (NOT (STRCHR I N LST CH))
(EQUAL (STRRCHR I N LST CH J) J)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(EQUAL (GET-NTH I LST) 0))
(p I N LST CH J))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(NOT (EQUAL (GET-NTH I LST) 0))
(p (ADD1 I) N LST CH (FIX I)))
(p I N LST CH J))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH I LST) 0))
(p I N LST CH J))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(p (ADD1 I) N LST CH J))
(p I N LST CH J))
(IMPLIES (NOT (LESSP I N))
(p I N LST CH J))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for J. The above
induction scheme leads to the following seven new conjectures:
Case 7. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(EQUAL (GET-NTH I LST) 0)
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)).
This simplifies, opening up EQUAL and STRCHR, to:
T.
Case 6. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(NOT (EQUAL (GET-NTH I LST) 0))
(STRCHR (ADD1 I) N LST CH)
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)).
This simplifies, unfolding the definition of STRCHR, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (STRRCHR (ADD1 I) N LST CH (FIX I))
(FIX I))
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)).
This simplifies, applying GET-NTH-0, and unfolding FIX, LESSP, STRCHR, EQUAL,
and STRRCHR, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH I LST) 0)
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)),
which simplifies, opening up the definitions of STRCHR, EQUAL, and STRRCHR,
to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(STRCHR (ADD1 I) N LST CH)
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)),
which simplifies, unfolding the definition of STRCHR, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (STRRCHR (ADD1 I) N LST CH J)
J)
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)),
which simplifies, opening up STRCHR and STRRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (STRCHR I N LST CH)))
(EQUAL (STRRCHR I N LST CH J) J)),
which simplifies, opening up STRCHR and STRRCHR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
STRRCHR-STRCHR-LA
(PROVE-LEMMA STRRCHR-LA2 NIL
(IMPLIES (STRCHR I N LST CH)
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH))
((INDUCT (STRRCHR I N LST CH J))
(EXPAND (STRRCHR I N LST (GET-NTH I LST) J))))
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to five new goals:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(EQUAL (GET-NTH I LST) 0)
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH)),
which simplifies, opening up EQUAL, STRCHR, and STRRCHR, to:
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST) 0)).
This again simplifies, rewriting with GET-NTH-0, and expanding LESSP, to:
T.
Case 4. (IMPLIES
(AND (LESSP I N)
(EQUAL (GET-NTH I LST) CH)
(NOT (EQUAL (GET-NTH I LST) 0))
(IMPLIES (STRCHR (ADD1 I) N LST CH)
(EQUAL (GET-NTH (STRRCHR (ADD1 I) N LST CH (FIX I))
LST)
CH))
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH)).
This simplifies, appealing to the lemmas STRRCHR-STRCHR-LA,
SUB1-TYPE-RESTRICTION, and GET-NTH-0, and unfolding the functions FIX,
IMPLIES, STRCHR, STRRCHR, and LESSP, to the following two new goals:
Case 4.2.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH I LST)))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH (STRRCHR 1 N LST (GET-NTH I LST) 0)
LST)
(GET-NTH I LST))).
But this again simplifies, appealing to the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and STRRCHR-STRCHR-LA, and opening up LESSP, to:
T.
Case 4.1.
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (NUMBERP I))
(EQUAL (GET-NTH (STRRCHR (ADD1 I)
N LST
(GET-NTH I LST)
0)
LST)
(GET-NTH I LST))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (GET-NTH (STRRCHR I N LST (GET-NTH 0 LST) J)
LST)
(GET-NTH 0 LST))),
which again simplifies, applying the lemmas GET-NTH-0 and
SUB1-TYPE-RESTRICTION, and opening up LESSP, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (NUMBERP I))
(EQUAL (GET-NTH (STRRCHR 1 N LST (GET-NTH 0 LST) 0)
LST)
(GET-NTH 0 LST))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (GET-NTH (STRRCHR I N LST (GET-NTH 0 LST) J)
LST)
(GET-NTH 0 LST))).
This again simplifies, applying SUB1-TYPE-RESTRICTION and GET-NTH-0, and
unfolding the functions LESSP and STRRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH I LST) 0)
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH)).
This simplifies, expanding the definitions of EQUAL and STRCHR, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (EQUAL (GET-NTH I LST) 0))
(IMPLIES (STRCHR (ADD1 I) N LST CH)
(EQUAL (GET-NTH (STRRCHR (ADD1 I) N LST CH J)
LST)
CH))
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH)).
This simplifies, unfolding the functions IMPLIES, STRCHR, and STRRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(STRCHR I N LST CH))
(EQUAL (GET-NTH (STRRCHR I N LST CH J) LST)
CH)).
This simplifies, unfolding the function STRCHR, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRRCHR-LA2
(PROVE-LEMMA STRRCHR-THM1
(REWRITE)
(IMPLIES (STRRCHR I N LST CH F)
(EQUAL (GET-NTH (STRRCHR I N LST CH F) LST)
CH))
((USE (STRRCHR-LA2 (J F)))))
This formula simplifies, applying STRRCHR-STRCHR-LA, and unfolding the
definition of IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRRCHR-THM1
(PROVE-LEMMA STRCHR-GET
(REWRITE)
(IMPLIES (AND (LEQ I J)
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))))
Call the conjecture *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 (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST J))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST J))
(p I N LST J))
(IMPLIES (NOT (LESSP I N))
(p I N LST J))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces five new goals:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))),
which simplifies, unfolding the functions NULL, STRLEN, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))),
which simplifies, using linear arithmetic, to three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))),
which again simplifies, rewriting with the lemma GET-NTH-0, and expanding
the functions NULL, LESSP, NUMBERP, EQUAL, STRCHR, and STRLEN, to three
new conjectures:
Case 4.3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NOT (EQUAL N 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NUMBERP N)),
which again simplifies, unfolding the function LESSP, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
0),
which again simplifies, trivially, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))).
However this again simplifies, rewriting with GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and unfolding LESSP, NULL, STRLEN,
EQUAL, and STRCHR, to the following two new goals:
Case 4.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(EQUAL J 0)
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
0).
This again simplifies, trivially, to:
T.
Case 4.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (NUMBERP J))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
0).
This again simplifies, trivially, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP I (ADD1 I))
(NOT (LESSP I I))
(LESSP I (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH I LST))).
However this again simplifies, applying LESSP-SUB1 and SUB1-ADD1, and
expanding the functions NULL, LESSP, STRLEN, and STRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))).
This simplifies, opening up NULL and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(STRCHR (ADD1 I)
N LST
(GET-NTH J LST))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))).
This simplifies, expanding the definitions of NULL, STRLEN, and STRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(STRCHR I N LST (GET-NTH J LST))).
This simplifies, unfolding the definition of STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCHR-GET
(PROVE-LEMMA STRRCHR-LA3 NIL
(IMPLIES (AND (STRCHR I N LST CH)
(LESSP (STRRCHR I N LST CH K) J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) CH)))
((EXPAND (STRRCHR I N LST (GET-NTH I LST) K))))
Name the conjecture *1.
We will try to prove it by 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 (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST (FIX I)))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST K))
(p J I N LST K))
(IMPLIES (NOT (LESSP I N))
(p J I N LST K))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for K. The above
induction scheme leads to nine new formulas:
Case 9. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, rewriting with GET-NTH-0, and opening up EQUAL, STRCHR,
STRRCHR, STRLEN, LESSP, and NULL, to the following five new conjectures:
Case 9.5.
(IMPLIES (AND (LESSP I N)
(EQUAL 0 (GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NOT (NUMBERP I))
(LESSP 0 J)
(EQUAL N 0))
(NOT (LESSP J I))).
But this again simplifies, using linear arithmetic, to:
T.
Case 9.4.
(IMPLIES (AND (LESSP I N)
(EQUAL 0 (GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NOT (NUMBERP I))
(LESSP 0 J)
(NOT (NUMBERP N)))
(NOT (LESSP J I))),
which again simplifies, expanding LESSP, to:
T.
Case 9.3.
(IMPLIES (AND (LESSP I N)
(EQUAL 0 (GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NOT (NUMBERP I))
(LESSP 0 J)
(EQUAL (GET-NTH 0 LST) 0))
(NOT (LESSP J I))),
which again simplifies, applying GET-NTH-0, and unfolding LESSP and EQUAL,
to:
T.
Case 9.2.
(IMPLIES (AND (LESSP I N)
(EQUAL 0 (GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NOT (NUMBERP I))
(LESSP 0 J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
However this again simplifies, appealing to the lemma GET-NTH-0, and
expanding the function LESSP, to:
T.
Case 9.1.
(IMPLIES (AND (LESSP I N)
(EQUAL 0 (GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NUMBERP I)
(LESSP I J))
(NOT (LESSP J I))),
which again simplifies, using linear arithmetic, to:
T.
Case 8. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, using linear arithmetic, applying the lemmas STRLEN-LB,
STRCHR-GET, SUB1-TYPE-RESTRICTION, and GET-NTH-0, and unfolding NULL, STRLEN,
STRRCHR, and LESSP, to five new conjectures:
Case 8.5.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL N 0))
(NOT (LESSP J I))),
which again simplifies, using linear arithmetic, to:
T.
Case 8.4.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(NOT (NUMBERP N)))
(NOT (LESSP J I))),
which again simplifies, unfolding LESSP, to:
T.
Case 8.3.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL (GET-NTH 0 LST) 0))
(NOT (LESSP J I))),
which again simplifies, applying GET-NTH-0, and expanding the functions
LESSP and EQUAL, to:
T.
Case 8.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
This again simplifies, rewriting with GET-NTH-0, and unfolding the
function LESSP, to:
(IMPLIES (AND (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH 0 LST) 0)
J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))),
which further simplifies, rewriting with SUB1-TYPE-RESTRICTION and
STRRCHR-STRCHR-LA, and expanding the definitions of EQUAL and LESSP, to
the new goal:
(IMPLIES (AND (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))
(NOT (STRCHR 1 N LST (GET-NTH 0 LST)))
(NOT (NUMBERP I))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN 1 N LST)))).
We use the above equality hypothesis by substituting (GET-NTH J LST) for
(GET-NTH 0 LST) and throwing away the equality. This generates:
(IMPLIES (AND (NOT (STRCHR 1 N LST (GET-NTH J LST)))
(NOT (NUMBERP I))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH J LST) 0)))
(NOT (LESSP J (STRLEN 1 N LST)))).
This further simplifies, using linear arithmetic and rewriting with the
lemma STRCHR-GET, to:
T.
Case 8.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NUMBERP I)
(LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH I LST)
I)
J))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))),
which further simplifies, rewriting with STRRCHR-STRCHR-LA, to:
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH I LST)))
(NUMBERP I)
(LESSP I J))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
We use the above equality hypothesis by substituting (GET-NTH J LST) for
(GET-NTH I LST) and throwing away the equality. We must thus prove:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH J LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(NUMBERP I)
(LESSP I J))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
However this further simplifies, using linear arithmetic and applying
STRCHR-GET, to:
T.
Case 7. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, using linear arithmetic, applying STRLEN-LB, STRCHR-GET,
SUB1-TYPE-RESTRICTION, and GET-NTH-0, and expanding the definitions of NULL,
STRLEN, STRRCHR, and LESSP, to five new formulas:
Case 7.5.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL N 0))
(NOT (LESSP J I))),
which again simplifies, using linear arithmetic, to:
T.
Case 7.4.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(NOT (NUMBERP N)))
(NOT (LESSP J I))),
which again simplifies, unfolding the function LESSP, to:
T.
Case 7.3.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL (GET-NTH 0 LST) 0))
(NOT (LESSP J I))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
LESSP and EQUAL, to:
T.
Case 7.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))),
which again simplifies, applying the lemma GET-NTH-0, and expanding the
definition of LESSP, to the conjecture:
(IMPLIES (AND (EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH 0 LST) 0)
J)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
However this further simplifies, rewriting with SUB1-TYPE-RESTRICTION, and
expanding the definition of FIX, to:
T.
Case 7.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
(FIX I))
J))
(NUMBERP I)
(LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH I LST)
I)
J))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))).
This further simplifies, opening up the definition of FIX, to:
T.
Case 6. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, using linear arithmetic, rewriting with STRLEN-LB,
STRCHR-GET, SUB1-TYPE-RESTRICTION, and GET-NTH-0, and expanding the
functions NULL, STRLEN, STRRCHR, and LESSP, to the following three new
formulas:
Case 6.3.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL N 0))
(NOT (LESSP J I))).
This again simplifies, using linear arithmetic, to:
T.
Case 6.2.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(NOT (NUMBERP N)))
(NOT (LESSP J I))),
which again simplifies, using linear arithmetic and applying STRLEN-LB, to:
T.
Case 6.1.
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (NUMBERP I))
(LESSP (STRRCHR 1 N LST (GET-NTH I LST) 0)
J)
(EQUAL (GET-NTH 0 LST) 0))
(NOT (LESSP J I))).
However this again simplifies, using linear arithmetic and applying
STRLEN-LB, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0)
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRCHR and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRCHR (ADD1 I)
N LST
(GET-NTH J LST)))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, opening up STRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
K)
J))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, opening up STRCHR and STRRCHR, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, using linear arithmetic, rewriting with STRLEN-LB and
STRCHR-GET, and unfolding STRRCHR, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(STRCHR I N LST (GET-NTH J LST))
(LESSP (STRRCHR I N LST (GET-NTH J LST) K)
J))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, unfolding the function STRCHR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.5 0.1 ]
STRRCHR-LA3
(PROVE-LEMMA STRRCHR-THM2 NIL
(IMPLIES (AND (STRRCHR I N LST CH F)
(LESSP (STRRCHR I N LST CH F) J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) CH)))
((USE (STRRCHR-LA3 (K F)))))
This conjecture simplifies, applying the lemma STRRCHR-STRCHR-LA, and
expanding the functions AND, NOT, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRRCHR-THM2
(PROVE-LEMMA STRRCHR-THM3 NIL
(IMPLIES (AND (NOT (STRRCHR I N LST CH K))
(LEQ I J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Call the conjecture *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 (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST (FIX I)))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0))
(p J I N LST K))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(p J (ADD1 I) N LST K))
(p J I N LST K))
(IMPLIES (NOT (LESSP I N))
(p J I N LST K))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for K. The above
induction scheme produces the following seven new conjectures:
Case 7. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(EQUAL (GET-NTH I LST) 0)
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, expanding EQUAL and STRRCHR, to:
T.
Case 6. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, appealing to the lemmas SUB1-TYPE-RESTRICTION and
STRRCHR-LA1, and expanding the definition of STRRCHR, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(EQUAL (GET-NTH I LST) 0)
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, applying STRRCHR-STRCHR-LA, and unfolding the definitions
of STRCHR, EQUAL, STRLEN, and NULL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(STRRCHR (ADD1 I)
N LST
(GET-NTH J LST)
K)
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, opening up STRRCHR, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which again simplifies, applying GET-NTH-0, and opening up the functions
LESSP, STRLEN, and NULL, to the following two new formulas:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRRCHR I N LST (GET-NTH 0 LST) K))
(EQUAL I 0))
(EQUAL (STRLEN 0 N LST) 0)).
This again simplifies, trivially, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (STRRCHR I N LST (GET-NTH 0 LST) K))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (STRLEN (ADD1 I) N LST) 0)).
But this again simplifies, appealing to the lemma GET-NTH-0, and
unfolding the function LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP J (ADD1 I))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION,
LESSP-OF-1, and STRRCHR-LA1, and unfolding the functions LESSP and STRRCHR,
to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(LESSP I (ADD1 I))
(NOT (STRRCHR I N LST (GET-NTH I LST) K))
(NOT (LESSP I I)))
(NOT (LESSP I (STRLEN I N LST)))).
This again simplifies, clearly, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRRCHR, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (STRRCHR I N LST (GET-NTH J LST) K))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, rewriting with STRRCHR-STRCHR-LA, and unfolding the
functions STRCHR and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.2 0.1 0.0 ]
STRRCHR-THM3
(PROVE-LEMMA STRRCHR-THM4 NIL
(IMPLIES (AND (STRINGP I N LST)
(NOT (STRRCHR I N LST CH K)))
(NOT (EQUAL CH 0))))
This formula simplifies, opening up the definition of STRINGP, to:
(IMPLIES (LESSP (SLEN I N LST) N)
(STRRCHR I N LST 0 K)),
which we will name *1.
We will appeal to induction. There are two plausible inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p I N LST K))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(p (ADD1 I) N LST K))
(p I N LST K))
(IMPLIES (NOT (LESSP I N))
(p I N LST K))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for K. The above
induction scheme leads to the following four new formulas:
Case 4. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(LESSP (SLEN I N LST) N))
(STRRCHR I N LST 0 K)).
This simplifies, unfolding the functions STRRCHR and EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (LESSP (SLEN (ADD1 I) N LST) N))
(LESSP (SLEN I N LST) N))
(STRRCHR I N LST 0 K)).
This simplifies, rewriting with SLEN-REC, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(STRRCHR (ADD1 I) N LST 0 K)
(LESSP (SLEN I N LST) N))
(STRRCHR I N LST 0 K)),
which simplifies, opening up STRRCHR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(LESSP (SLEN I N LST) N))
(STRRCHR I N LST 0 K)),
which simplifies, using linear arithmetic and rewriting with SLEN-LBOUND, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRRCHR-THM4
(PROVE-LEMMA MEMCMP1-ID
(REWRITE)
(EQUAL (MEMCMP1 I N LST LST) 0))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (SUB1 N) 0))
(p I N LST))
(IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I) (SUB1 N) LST))
(p I N LST))
(IMPLIES (NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(p I N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I. The above induction scheme generates the following
three new formulas:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (SUB1 N) 0))
(EQUAL (MEMCMP1 I N LST LST) 0)).
This simplifies, applying SUB1-OF-1 and SUB1-NNUMBERP, and expanding the
functions EQUAL, SUB1, and MEMCMP1, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (SUB1 N) 0))
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST LST)
0))
(EQUAL (MEMCMP1 I N LST LST) 0)),
which simplifies, appealing to the lemma SUB1-OF-1, and unfolding the
functions MEMCMP1 and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(EQUAL (MEMCMP1 I N LST LST) 0)),
which simplifies, obviously, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCMP1-ID
(PROVE-LEMMA MEMCMP-ID
(REWRITE)
(EQUAL (MEMCMP N LST LST) 0))
WARNING: Note that the rewrite rule MEMCMP-ID will be stored so as to apply
only to terms with the nonrecursive function symbol MEMCMP.
This formula simplifies, rewriting with MEMCMP1-ID, and expanding the
functions MEMCMP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCMP-ID
(PROVE-LEMMA MEMCMP1-THM1 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(LEQ I J)
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
((INDUCT (MEMCMP1 I N LST1 LST2))
(ENABLE IDIFFERENCE IPLUS)))
This formula can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to the following three new conjectures:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (SUB1 N) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (SUB1 N) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-NNUMBERP, LESSP-OF-1, GET-NTH-0,
SUB1-TYPE-RESTRICTION, and PLUS-ADD1, and unfolding EQUAL, SUB1, MEMCMP1,
LESSP, and PLUS, to the following two new conjectures:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL I 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
However this again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (SUB1 N) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying the lemmas GET-NTH-0, SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-NNUMBERP, SUB1-TYPE-RESTRICTION, PLUS-ADD1, and
LESSP-OF-1, and expanding EQUAL, SUB1, MEMCMP1, LESSP, and PLUS, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (SUB1 N) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP I I))
(LESSP I (PLUS I N)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, clearly, to:
T.
Case 2. (IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(IF (LESSP J (ADD1 I)) F T)
(LESSP J (PLUS (ADD1 I) (SUB1 N))))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, rewriting with SUB1-ADD1, PLUS-COMMUTATIVITY, SUB1-OF-1,
PLUS-0, GET-NTH-0, NUMBERP-INTEGERP, GET-LST-OF-CHRP, INTEGERP-FIX-INT, and
SUB1-TYPE-RESTRICTION, and expanding the definitions of LESSP, PLUS, AND,
IMPLIES, MEMCMP1, EQUAL, IDIFFERENCE, NEGP, NEGATIVE-GUTS, IZEROP, INEG, and
IPLUS, to 40 new formulas:
Case 2.40.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(EQUAL I 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 2.39.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.38.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(EQUAL I 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.37.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, applying GET-NTH-0, to:
T.
Case 2.36.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.35.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.34.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, to:
T.
Case 2.33.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.32.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 2.31.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 2.30.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.29.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.28.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-NTH-0, and expanding the function
NEGATIVE-GUTS, to:
T.
Case 2.27.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.26.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with GET-NTH-0, and opening up the
function EQUAL, to:
T.
Case 2.25.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 2.24.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with GET-NTH-0, and expanding the
definition of NEGATIVE-GUTS, to:
T.
Case 2.23.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.22.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.21.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(EQUAL (GET-NTH 0 LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.20.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (MEMCMP1 1 (SUB1 N) LST1 LST2)
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemma GET-NTH-0, and opening up
the functions EQUAL and LESSP, to:
T.
Case 2.19.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 2.19.2.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, appealing to the lemma SUB1-NNUMBERP, and
expanding the functions EQUAL and LESSP, to:
T.
Case 2.19.1.
(IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 I) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP I I))
(LESSP I (PLUS I N)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, trivially, to:
T.
Case 2.18.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.17.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.16.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to the formula:
(IMPLIES
(AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (MINUS 0) (GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (MINUS 0)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (MINUS 0)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with the lemmas LESSP-OF-1 and GET-NTH-0,
to:
T.
Case 2.15.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, obviously, to:
T.
Case 2.14.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.13.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (MINUS 0) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS 0) (MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying the lemmas LESSP-OF-1 and GET-NTH-0,
to:
T.
Case 2.12.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (MINUS 0) (GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (MINUS 0) (MINUS 0)) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.11.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.10.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (MINUS 0) (GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (MINUS 0)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, appealing to the lemmas LESSP-OF-1 and
GET-NTH-0, and expanding the definition of NEGATIVE-GUTS, to:
T.
Case 2.9.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.8.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (MINUS 0) 0))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (MINUS 0) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, and
unfolding the function EQUAL, to:
T.
Case 2.7.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with LESSP-OF-1 and GET-LST-OF-CHRP, to:
T.
Case 2.6.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (MINUS 0) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS 0) (MINUS 0))
(NOT (LESSP (MINUS 0)
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS 0)
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemmas LESSP-OF-1 and
GET-NTH-0, and expanding the definition of NEGATIVE-GUTS, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS 0)
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS 0)
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying the lemmas LESSP-OF-1 and GET-NTH-0,
to:
T.
Case 2.3.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(EQUAL (GET-NTH 0 LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(EQUAL (GET-NTH 0 LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with LESSP-OF-1 and GET-NTH-0, to:
T.
Case 2.2.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (MEMCMP1 1 (SUB1 N) LST1 LST2)
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (MEMCMP1 1 (SUB1 N) LST1 LST2)
0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with the lemmas LESSP-OF-1, GET-NTH-0,
PLUS-0, PLUS-COMMUTATIVITY, SUB1-OF-1, and SUB1-NNUMBERP, and opening up
the functions SUB1, EQUAL, and LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP J 1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying the lemmas LESSP-OF-1, PLUS-COMMUTATIVITY,
PLUS-EQUAL-0, SUB1-OF-1, and SUB1-NNUMBERP, and unfolding SUB1, EQUAL, and
LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which simplifies, appealing to the lemmas NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-FIX-INT, and opening up the functions IDIFFERENCE, NEGP,
NEGATIVE-GUTS, IZEROP, INEG, IPLUS, and MEMCMP1, to 16 new conjectures:
Case 1.16.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (GET-NTH I LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, unfolding the definitions of NEGATIVE-GUTS, EQUAL,
LESSP, and DIFFERENCE, to:
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (NEGATIVE-GUTS (GET-NTH I LST1))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, expanding NEGATIVE-GUTS and EQUAL, to:
T.
Case 1.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying DIFFERENCE=0, and opening up the
definition of NEGATIVE-GUTS, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (EQUAL (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, obviously, to:
T.
Case 1.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemmas GET-LST-OF-CHRP and
NEGATIVE-GUTS-MINUS, and expanding NEGATIVE-GUTS, to:
T.
Case 1.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, and opening up NEGATIVE-GUTS and EQUAL, to:
T.
Case 1.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-MINUS0, and opening up the definition of EQUAL, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with GET-LST-OF-CHRP and
PLUS-EQUAL-0, and expanding NEGATIVE-GUTS, to:
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (GET-NTH I LST1) 0)
(EQUAL (NEGATIVE-GUTS (GET-NTH I LST2))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, opening up the functions NEGATIVEP, NEGATIVE-GUTS,
and EQUAL, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-MINUS0, and unfolding the definition of NEGATIVE-GUTS, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-LST-OF-CHRP and
NEGATIVE-GUTS-MINUS, and unfolding the function NEGATIVE-GUTS, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-MINUS0, and expanding the function EQUAL, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with NUMBERP-INTEGERP,
GET-LST-OF-CHRP, and INTEGERP-MINUS0, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with the lemmas GET-LST-OF-CHRP,
NEGATIVE-GUTS-MINUS, and DIFFERENCE=0, and opening up NEGATIVE-GUTS, to
the formula:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to three new conjectures:
Case 1.4.3.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST2)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 1.4.2.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 1.4.1.
(IMPLIES (AND (NUMBERP (GET-NTH I LST1))
(NUMBERP (GET-NTH I LST2))
(EQUAL (GET-NTH I LST2)
(GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, obviously, to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.5 0.2 ]
MEMCMP1-THM1
(PROVE-LEMMA MEMCMP-THM1 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (MEMCMP N LST1 LST2) 0)
(LESSP J N))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
((USE (MEMCMP1-THM1 (I 0)))))
This simplifies, applying PLUS-0 and SUB1-NNUMBERP, and opening up the
definitions of EQUAL, LESSP, AND, IMPLIES, MEMCMP, and MEMCMP1, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCMP-THM1
(DEFN-SK MEMCMP-SK
(N LST1 LST2)
(EXISTS J
(AND (FORALL I
(IMPLIES (LESSP I J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(EQUAL (MEMCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))))
Adding the Skolem axiom:
(AND
(IMPLIES (AND (IMPLIES (LESSP (I-1 J LST1 LST2) J)
(EQUAL (GET-NTH (I-1 J LST1 LST2) LST1)
(GET-NTH (I-1 J LST1 LST2) LST2)))
(EQUAL (MEMCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))
(MEMCMP-SK N LST1 LST2))
(IMPLIES
(NOT (AND (IMPLIES (LESSP I (J-1 LST1 LST2 N))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (MEMCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH (J-1 LST1 LST2 N) LST1)
(GET-NTH (J-1 LST1 LST2 N) LST2)))))
(NOT (MEMCMP-SK N LST1 LST2)))).
As this is a DEFN-SK we can conclude that:
(OR (TRUEP (MEMCMP-SK N LST1 LST2))
(FALSEP (MEMCMP-SK N LST1 LST2)))
is a theorem.
[ 0.0 0.0 0.0 ]
MEMCMP-SK
(DEFN MEMCMP-J
(I N LST1 LST2)
(IF (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(IF (EQUAL (SUB1 N) 0)
(FIX I)
(MEMCMP-J (ADD1 I)
(SUB1 N)
LST1 LST2))
(FIX I)))
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 can be used to show
that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each recursive call. Hence, MEMCMP-J is accepted under the
definitional principle. From the definition we can conclude that:
(NUMBERP (MEMCMP-J I N LST1 LST2))
is a theorem.
[ 0.0 0.0 0.0 ]
MEMCMP-J
(PROVE-LEMMA MEMCMP-J-1
(REWRITE)
(IMPLIES (AND (LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(LEQ I1 I))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
((ENABLE GET-NTH-0)))
WARNING: Note that MEMCMP-J-1 contains the free variables LST2, N1, and I1
which will be chosen by instantiating the hypothesis:
(LESSP I (MEMCMP-J I1 N1 LST1 LST2)).
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (SUB1 N1) 0))
(p I LST1 LST2 I1 N1))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(p I LST1 LST2 (ADD1 I1) (SUB1 N1)))
(p I LST1 LST2 I1 N1))
(IMPLIES (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(p I LST1 LST2 I1 N1))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 inform us that the measure
(COUNT N1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. Note, however, the inductive instance chosen
for I1. The above induction scheme produces four new formulas:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (SUB1 N1) 0)
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, rewriting with SUB1-OF-1 and SUB1-NNUMBERP, and unfolding
EQUAL, SUB1, MEMCMP-J, and LESSP, to the following three new goals:
Case 4.3.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL N1 0)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 4.2.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (NUMBERP N1))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL N1 1)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(NOT (LESSP I
(MEMCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)))
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, rewriting with SUB1-OF-1, and expanding the definition of
MEMCMP-J, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP I1))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
However this again simplifies, rewriting with GET-NTH-0, SUB1-OF-1,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and expanding the definitions of
MEMCMP-J, EQUAL, and LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
But this again simplifies, applying SUB1-OF-1 and GET-NTH-0, and expanding
the functions LESSP and MEMCMP-J, to the following two new conjectures:
Case 2.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL N1 1))
(NOT (EQUAL (MEMCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0))
(EQUAL I1 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 2.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL N1 1))
(NOT (EQUAL (MEMCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP I1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I))
(LESSP I (MEMCMP-J I N1 LST1 LST2))
(NOT (LESSP I I)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(LESSP I (MEMCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This simplifies, expanding the functions MEMCMP-J and LESSP, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMCMP-J-1
(PROVE-LEMMA MEMCMP-J-2
(REWRITE)
(IMPLIES (NOT (EQUAL (MEMCMP1 I1 N1 LST1 LST2) 0))
(EQUAL (MEMCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST2))))
((ENABLE GET-NTH-0)))
Give the conjecture the name *1.
We will try to prove it by induction. Four 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 (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (SUB1 N1) 0))
(p I1 N1 LST1 LST2))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(p (ADD1 I1) (SUB1 N1) LST1 LST2))
(p I1 N1 LST1 LST2))
(IMPLIES (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(p I1 N1 LST1 LST2))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 establish that the measure
(COUNT N1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. Note, however, the inductive instance chosen
for I1. The above induction scheme leads to four new goals:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (SUB1 N1) 0)
(NOT (EQUAL (MEMCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (MEMCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, rewriting with SUB1-OF-1 and SUB1-NNUMBERP, and expanding
the definitions of EQUAL, SUB1, and MEMCMP1, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(EQUAL (MEMCMP1 (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0)
(NOT (EQUAL (MEMCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (MEMCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, rewriting with SUB1-OF-1, and expanding the functions
MEMCMP1 and EQUAL, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (SUB1 N1) 0))
(EQUAL (MEMCMP1 (ADD1 I1)
(SUB1 N1)
LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
LST2)))
(NOT (EQUAL (MEMCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (MEMCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, rewriting with SUB1-OF-1, and expanding the definitions of
MEMCMP1 and MEMCMP-J, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (EQUAL (MEMCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (MEMCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, appealing to the lemma IDIFFERENCE-EQUAL-0, and unfolding
MEMCMP1, FIX-INT, and MEMCMP-J, to the following three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(NOT (EQUAL 0 (GET-NTH I1 LST2)))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))).
However this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST1))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(INTEGERP (GET-NTH I1 LST1))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
MEMCMP-J-2
(PROVE-LEMMA MEMCMP-THM2 NIL
(IMPLIES (NOT (EQUAL (MEMCMP N LST1 LST2) 0))
(MEMCMP-SK N LST1 LST2))
((USE (MEMCMP-SK (J (MEMCMP-J 0 N LST1 LST2))))))
This formula simplifies, applying the lemma IDIFFERENCE-EQUAL-0, and opening
up the definitions of IMPLIES, MEMCMP, AND, NOT, EQUAL, and FIX-INT, to the
following two new conjectures:
Case 2. (IMPLIES (AND (LESSP (I-1 (MEMCMP-J 0 N LST1 LST2)
LST1 LST2)
(MEMCMP-J 0 N LST1 LST2))
(NOT (EQUAL (GET-NTH (I-1 (MEMCMP-J 0 N LST1 LST2)
LST1 LST2)
LST1)
(GET-NTH (I-1 (MEMCMP-J 0 N LST1 LST2)
LST1 LST2)
LST2)))
(NOT (EQUAL N 0))
(NOT (EQUAL (MEMCMP1 0 N LST1 LST2) 0)))
(MEMCMP-SK N LST1 LST2)).
This again simplifies, using linear arithmetic and rewriting with MEMCMP-J-1,
to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL N 0))
(NOT (EQUAL (MEMCMP1 0 N LST1 LST2)
(IDIFFERENCE (GET-NTH (MEMCMP-J 0 N LST1 LST2)
LST1)
(GET-NTH (MEMCMP-J 0 N LST1 LST2)
LST2))))
(NOT (EQUAL (MEMCMP1 0 N LST1 LST2) 0)))
(MEMCMP-SK N LST1 LST2)).
This again simplifies, applying MEMCMP-J-2, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
MEMCMP-THM2
(DISABLE MEMCMP-J-1)
[ 0.0 0.0 0.0 ]
MEMCMP-J-1-OFF
(DISABLE MEMCMP-J-2)
[ 0.0 0.0 0.0 ]
MEMCMP-J-2-OFF
(PROVE-LEMMA STRCPY2-GET-1
(REWRITE)
(IMPLIES (LESSP J I1)
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))))
Call the conjecture *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 (EQUAL (GET-NTH I2 LST2) (NULL))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(EQUAL (SUB1 N2) 0))
(p J I1 LST1 I2 N2 LST2))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(NOT (EQUAL (SUB1 N2) 0))
(p J
(ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(p J I1 LST1 I2 N2 LST2))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 and the definition of NULL
can be used to establish that the measure (COUNT N2) decreases according to
the well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for I1, LST1, and I2. The above
induction scheme generates four new formulas:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I2 LST2) (NULL))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, applying GET-NTH-0 and GET-PUT, and expanding the
functions NULL, STRCPY2, and EQUAL, to the following five new goals:
Case 4.5.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL 0 (GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 4.4.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP I1))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 4.3.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NUMBERP I1)
(NUMBERP J)
(EQUAL I1 J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(LESSP J I1)
(NUMBERP I1)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, applying the lemma GET-NTH-0, and opening up the
definition of LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(EQUAL (SUB1 N2) 0)
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))),
which simplifies, applying SUB1-OF-1, GET-PUT, GET-NTH-0, and SUB1-NNUMBERP,
and unfolding the functions NULL, EQUAL, SUB1, and STRCPY2, to the following
18 new goals:
Case 3.18.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NUMBERP I1)
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.17.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NOT (EQUAL (ADD1 I1) J))
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, expanding the function LESSP, to:
T.
Case 3.16.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NUMBERP J)
(EQUAL (ADD1 I1) J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 3.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(LESSP J I1)
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and expanding the
definition of LESSP, to:
T.
Case 3.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NUMBERP I1)
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NOT (EQUAL (ADD1 I1) J))
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 3.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NUMBERP J)
(EQUAL (ADD1 I1) J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, expanding LESSP, to:
T.
Case 3.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(LESSP J I1)
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and opening up LESSP, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NUMBERP I1)
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NOT (EQUAL (ADD1 I1) J))
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NUMBERP J)
(EQUAL (ADD1 I1) J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH J LST1))),
which again simplifies, unfolding the function LESSP, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(LESSP J I1)
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and expanding LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(NOT (EQUAL (SUB1 N2) 0))
(NOT (LESSP J (ADD1 I1)))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) (NULL)))
(NOT (EQUAL (SUB1 N2) 0))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH J
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)))
(LESSP J I1))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH J LST1))).
This simplifies, applying SUB1-OF-1, GET-NTH-0, and GET-PUT, and expanding
the functions NULL, LESSP, STRCPY2, and EQUAL, to two new formulas:
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(NUMBERP J)
(EQUAL I1 J)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH I2 LST2))
(LESSP I1 I1))
(EQUAL (GET-NTH I1
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH I1 LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST1))),
which again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRCPY2-GET-1
(PROVE-LEMMA STRLEN1-II
(REWRITE)
(EQUAL (STRLEN1 I I LST) 0)
((EXPAND (STRLEN1 I I LST))))
This formula simplifies, unfolding the definitions of STRLEN1 and NULL, to the
new conjecture:
(IMPLIES (AND (LESSP I I)
(NOT (EQUAL (GET-NTH I LST) 0)))
(EQUAL (ADD1 (STRLEN1 (ADD1 I) I LST))
0)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN1-II
(PROVE-LEMMA STRCPY2-GET-2
(REWRITE)
(IMPLIES (AND (LEQ I1 J)
(LESSP J
(PLUS I1
(STRLEN1 I2 (PLUS I2 N2) LST2))))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2)))
((INDUCT (STRCPY2 I1 LST1 I2 N2 LST2))
(EXPAND (STRCPY2 I1 LST1 I2 N2 LST2)
(STRCPY2 0 LST1 I2 N2 LST2))
(ENABLE PLUS-ADD1-1)))
This conjecture can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, AND, and NULL, to three new conjectures:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(LESSP J
(PLUS I1
(STRLEN1 I2 (PLUS I2 N2) LST2))))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-0,
PLUS-COMMUTATIVITY, PUT-NTH-0, GET-PUT, and PLUS-EQUAL-0, and opening up
EQUAL, NULL, NOT, ZEROP, FIX, STRLEN1, STRCPY2, NUMBERP, and DIFFERENCE, to
the following 12 new conjectures:
Case 3.12.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.11.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.10.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, trivially, to:
T.
Case 3.9.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))).
This again simplifies, trivially, to:
T.
Case 3.8.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 3.7.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 3.5.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 3.4.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(EQUAL 0 J))
(EQUAL 0 (GET-NTH 0 LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, clearly, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL (GET-NTH I2 LST2) 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL (SUB1 N2) 0)
(NOT (LESSP J I1))
(LESSP J
(PLUS I1
(STRLEN1 I2 (PLUS I2 N2) LST2))))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This simplifies, applying the lemmas SUB1-OF-1, PLUS-0, PLUS-COMMUTATIVITY,
GET-NTH-0, GET-PUT, CORRECTNESS-OF-CANCEL-LESSP-PLUS, SUB1-NNUMBERP,
SUB1-TYPE-RESTRICTION, PUT-NTH-0, PLUS-EQUAL-0, PLUS-ADD1, STRLEN1-II,
SUB1-ADD1, and LESSP-SUB1, and opening up the definitions of EQUAL, SUB1,
NULL, STRCPY2, PLUS, NOT, ZEROP, FIX, STRLEN1, NUMBERP, DIFFERENCE, ADD1,
and LESSP, to the following 58 new conjectures:
Case 2.58.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I2))
(LESSP J
(PLUS I1 (STRLEN1 I2 0 LST2)))
(NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH J
(PUT-NTH 0
(ADD1 I1)
(PUT-NTH (GET-NTH 0 LST2) I1 LST1)))
(GET-NTH (DIFFERENCE 0 I1) LST2))).
This again simplifies, rewriting with GET-NTH-0, PLUS-0, and
PLUS-COMMUTATIVITY, and opening up LESSP, EQUAL, STRLEN1, and PLUS, to:
T.
Case 2.57.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I2))
(LESSP J
(PLUS I1 (STRLEN1 I2 0 LST2)))
(NOT (NUMBERP J))
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH J (PUT-NTH 0 I1 LST1))
(GET-NTH (DIFFERENCE 0 I1) LST2))).
This again simplifies, rewriting with GET-NTH-0, and expanding EQUAL, to:
T.
Case 2.56.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I2))
(LESSP J
(PLUS I1 (STRLEN1 I2 0 LST2)))
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH J
(PUT-NTH 0
(ADD1 I1)
(PUT-NTH (GET-NTH 0 LST2) I1 LST1)))
(GET-NTH (DIFFERENCE J I1) LST2))).
This again simplifies, appealing to the lemmas GET-NTH-0, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-TYPE-RESTRICTION, PUT-NTH-0, and GET-PUT, and
opening up LESSP, EQUAL, STRLEN1, NUMBERP, and DIFFERENCE, to five new
conjectures:
Case 2.56.5.
(IMPLIES (AND (NOT (LESSP J I1))
(NOT (NUMBERP I2))
(NOT (NUMBERP I1))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL J 0)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 2.56.4.
(IMPLIES (AND (NOT (LESSP J I1))
(NOT (NUMBERP I2))
(NOT (NUMBERP I1))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL 1 J))
(EQUAL 0 (GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.56.3.
(IMPLIES (AND (NOT (LESSP J I1))
(NOT (NUMBERP I2))
(NOT (NUMBERP I1))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (EQUAL J 0))
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.56.2.
(IMPLIES (AND (NOT (LESSP J I1))
(NOT (NUMBERP I2))
(NOT (NUMBERP I1))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (EQUAL J 0))
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH 0 LST2)
(GET-NTH J LST2))),
which again simplifies, obviously, to:
T.
Case 2.56.1.
(IMPLIES (AND (NOT (LESSP J I1))
(NOT (NUMBERP I2))
(NOT (NUMBERP I1))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL J 0))
(NOT (EQUAL 1 J))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.55.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NOT (NUMBERP I2))
(LESSP J
(PLUS I1 (STRLEN1 I2 0 LST2)))
(NUMBERP J)
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH J (PUT-NTH 0 I1 LST1))
(GET-NTH (DIFFERENCE J I1) LST2))),
which again simplifies, applying the lemma GET-NTH-0, and opening up the
function EQUAL, to:
T.
Case 2.54.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 2.53.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NUMBERP I1)
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, rewriting with STRLEN1-II, PLUS-0, and
PLUS-COMMUTATIVITY, to:
T.
Case 2.52.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NOT (EQUAL (ADD1 I1) J))
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, applying STRLEN1-II, PLUS-0, and
PLUS-COMMUTATIVITY, and opening up LESSP, to:
T.
Case 2.51.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, rewriting with the lemmas STRLEN1-II, PLUS-0, and
PLUS-COMMUTATIVITY, and unfolding LESSP and EQUAL, to:
T.
Case 2.50.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, appealing to the lemma STRLEN1-II, and unfolding
the functions EQUAL, LESSP, and PLUS, to:
T.
Case 2.49.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NUMBERP J)
(EQUAL (ADD1 I1) J))
(EQUAL 0
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, applying SUB1-ADD1, STRLEN1-II,
SUB1-TYPE-RESTRICTION, PLUS-0, and PLUS-COMMUTATIVITY, and opening up
LESSP, ADD1, and PLUS, to:
T.
Case 2.48.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NOT (NUMBERP I1))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, applying STRLEN1-II, PLUS-0, and PLUS-COMMUTATIVITY,
and unfolding the definitions of LESSP and EQUAL, to:
T.
Case 2.47.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 0)
(NOT (LESSP J I1))
(NUMBERP I2)
(LESSP J
(PLUS I1 (STRLEN1 I2 I2 LST2)))
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NUMBERP I1)
(NOT (EQUAL I1 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, applying STRLEN1-II, PLUS-0, and
PLUS-COMMUTATIVITY, to:
T.
Case 2.46.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.45.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.44.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.43.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.42.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.41.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.40.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, trivially, to:
T.
Case 2.39.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, obviously, to:
T.
Case 2.38.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.37.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.36.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.35.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.34.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.33.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.32.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 2.31.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP N2))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 2.30.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE 0 I1) LST2))).
However this again simplifies, appealing to the lemma GET-NTH-0, and
unfolding the definitions of LESSP and DIFFERENCE, to:
T.
Case 2.29.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, using linear arithmetic, rewriting with GET-NTH-0
and DIFFERENCE-0, and opening up the definition of LESSP, to:
T.
Case 2.28.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE 0 I1) LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.27.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, expanding LESSP, EQUAL, and DIFFERENCE, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I2)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.26.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))).
This again simplifies, opening up the functions LESSP and DIFFERENCE, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NUMBERP I2)
(NOT (NUMBERP I1))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 2.25.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE I2 I1) LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.24.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, applying PLUS-EQUAL-0, and opening up the
definitions of EQUAL, LESSP, and DIFFERENCE, to the following three new
formulas:
Case 2.24.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.24.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, clearly, to:
T.
Case 2.24.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, rewriting with GET-NTH-PLUS-0, to:
T.
Case 2.23.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, rewriting with PLUS-EQUAL-0, and unfolding
LESSP and DIFFERENCE, to the following three new formulas:
Case 2.23.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, applying GET-NTH-0, to:
T.
Case 2.23.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 2.23.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
But this again simplifies, appealing to the lemma GET-NTH-PLUS-0, to:
T.
Case 2.22.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, expanding the function LESSP, to:
T.
Case 2.21.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.20.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.19.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.18.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.17.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, unfolding the definitions of LESSP and SUB1, to:
T.
Case 2.16.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (EQUAL I2 0))
(NUMBERP I2)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, rewriting with SUB1-NNUMBERP, and unfolding the
function LESSP, to:
T.
Case 2.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP I2))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, trivially, to:
T.
Case 2.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL I2 0)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, obviously, to:
T.
Case 2.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 2.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL I2 0)
(EQUAL J 0)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 2.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NOT (EQUAL 1 J))
(EQUAL 0 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, applying GET-NTH-0, and expanding the
definitions of LESSP and SUB1, to:
T.
Case 2.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, rewriting with GET-NTH-0 and SUB1-NNUMBERP,
and opening up the function LESSP, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH 0 LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(EQUAL 1 J))
(EQUAL 0 (GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP I2))
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL I2 0)
(EQUAL J 0)
(NUMBERP J)
(NOT (EQUAL 1 J))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
But this again simplifies, rewriting with SUB1-NNUMBERP, and unfolding
EQUAL, LESSP, and NUMBERP, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, applying LESSP-SUB1 and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and unfolding the function FIX, to
the new goal:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (LESSP J J))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, unfolding the definition of LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NUMBERP J)
(EQUAL (ADD1 I1) J))
(EQUAL 0
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL N2 1)
(NOT (LESSP J I1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NUMBERP J)
(NOT (EQUAL (ADD1 I1) J))
(NOT (EQUAL I1 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(IMPLIES (AND (IF (LESSP J (ADD1 I1)) F T)
(LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(PLUS (ADD1 I2) (SUB1 N2))
LST2))))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS (ADD1 I2) J)
(ADD1 I1))
LST2)))
(NOT (LESSP J I1))
(LESSP J
(PLUS I1
(STRLEN1 I2 (PLUS I2 N2) LST2))))
(EQUAL (GET-NTH J
(STRCPY2 I1 LST1 I2 N2 LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which simplifies, using linear arithmetic, applying SUB1-ADD1,
PLUS-COMMUTATIVITY, PLUS-ADD1-1, CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-0,
SUB1-OF-1, GET-PUT, STRCPY2-GET-1, SUB1-TYPE-RESTRICTION, PUT-NTH-0,
PLUS-EQUAL-0, and GET-NTH-0, and unfolding LESSP, PLUS, AND, DIFFERENCE,
IMPLIES, EQUAL, NULL, NOT, ZEROP, FIX, STRLEN1, STRCPY2, ADD1, and NUMBERP,
to the following 64 new conjectures:
Case 1.64.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(EQUAL J 0)
(EQUAL I1 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 1.63.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(EQUAL J 0)
(EQUAL I1 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 1.62.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(EQUAL J 0)
(NOT (NUMBERP I1))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 1.61.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(EQUAL J 0)
(NOT (NUMBERP I1))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
But this again simplifies, applying GET-NTH-0, to:
T.
Case 1.60.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(EQUAL I1 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.59.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(EQUAL I1 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 1.58.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(EQUAL I1 0)
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, rewriting with GET-NTH-PLUS-0, to:
T.
Case 1.57.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.56.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 1.55.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I1))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, rewriting with GET-NTH-PLUS-0, to:
T.
Case 1.54.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL J 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 1.53.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(EQUAL J 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
But this again simplifies, applying GET-NTH-0, and expanding SUB1 and
LESSP, to:
T.
Case 1.52.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP J))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
However this again simplifies, applying GET-NTH-0 and SUB1-NNUMBERP, and
opening up the definition of LESSP, to:
T.
Case 1.51.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP J))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 1.50.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP J))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
But this again simplifies, applying SUB1-NNUMBERP, and expanding LESSP, to:
T.
Case 1.49.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (EQUAL J 0))
(NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.48.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, expanding the definitions of EQUAL and LESSP, to:
T.
Case 1.47.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))),
which again simplifies, applying SUB1-NNUMBERP, and unfolding the
definition of LESSP, to:
T.
Case 1.46.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(EQUAL I2 0)
(EQUAL J 0))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))).
This again simplifies, opening up the functions SUB1 and LESSP, to:
T.
Case 1.45.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (NUMBERP I2))
(EQUAL J 0))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))),
which again simplifies, rewriting with GET-NTH-0, and unfolding the
definitions of SUB1 and LESSP, to:
T.
Case 1.44.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(LESSP (SUB1 J) 0)
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))).
This again simplifies, applying GET-NTH-0 and SUB1-NNUMBERP, and expanding
LESSP, to:
T.
Case 1.43.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE 0 I1) LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.42.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, rewriting with GET-NTH-0, and opening up the
definitions of NUMBERP, SUB1, and LESSP, to:
T.
Case 1.41.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE I2 I1) LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.40.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, expanding NUMBERP, SUB1, and LESSP, to:
T.
Case 1.39.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, applying SUB1-NNUMBERP, and opening up the
definitions of EQUAL and LESSP, to:
T.
Case 1.38.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
But this again simplifies, appealing to the lemma SUB1-NNUMBERP, and
unfolding the functions NUMBERP and LESSP, to:
T.
Case 1.37.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, rewriting with SUB1-NNUMBERP, and opening up the
definitions of NUMBERP and LESSP, to:
T.
Case 1.36.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NUMBERP J)
(EQUAL I1 J))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
But this again simplifies, applying LESSP-SUB1 and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and opening up the definition of
FIX, to the new goal:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (EQUAL J 0))
(NOT (LESSP J J))
(LESSP (SUB1 J)
(PLUS J
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NUMBERP J)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, rewriting with the lemmas GET-NTH-0 and
SUB1-TYPE-RESTRICTION, and opening up PLUS, to:
T.
Case 1.35.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, rewriting with the lemma SUB1-NNUMBERP, and
expanding EQUAL and LESSP, to:
T.
Case 1.34.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(LESSP (SUB1 J) I1)
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NUMBERP J)
(NOT (EQUAL I1 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.33.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(LESSP J
(PLUS I1 (ADD1 (STRLEN1 1 N2 LST2))))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH 0 LST2) I1 LST1)
1
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
PLUS-0, PLUS-COMMUTATIVITY, ADD1-SUB1, and SUB1-ADD1, and opening up the
definitions of PLUS and LESSP, to:
T.
Case 1.32.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(LESSP J
(PLUS I1 (ADD1 (STRLEN1 1 N2 LST2))))
(NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH 0 LST2) I1 LST1)
1
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE J I1) LST2))).
However this again simplifies, rewriting with GET-NTH-0,
SUB1-TYPE-RESTRICTION, PLUS-0, PLUS-COMMUTATIVITY, ADD1-SUB1, SUB1-ADD1,
PLUS-ADD1-1, and PUT-NTH-0, and opening up the definitions of PLUS, LESSP,
and DIFFERENCE, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (EQUAL J 0))
(NOT (NUMBERP I1))
(NOT (LESSP (SUB1 J)
(PLUS 0 (STRLEN1 1 N2 LST2))))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(LESSP (SUB1 J) (STRLEN1 1 N2 LST2))
(NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
1
(SUB1 N2)
LST2))
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.31.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL 0
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.30.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL 0
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.29.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.28.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NUMBERP J)
(NOT (NUMBERP I1))
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE J I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.27.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NUMBERP J)
(NUMBERP I1)
(NOT (EQUAL I1 J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE J I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.26.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NUMBERP J)
(NOT (NUMBERP I1))
(EQUAL 0 J))
(EQUAL 0
(GET-NTH (DIFFERENCE J I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.25.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I2))
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) 0))
LST2))))
(NOT (LESSP J I1))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J (PLUS I1 0))
(NUMBERP J)
(NUMBERP I1)
(EQUAL I1 J))
(EQUAL 0
(GET-NTH (DIFFERENCE J I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.24.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(EQUAL J 0)
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.23.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.22.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.21.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, applying the lemmas PLUS-COMMUTATIVITY and
PLUS-ADD1, and expanding LESSP, to:
T.
Case 1.20.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, rewriting with SUB1-TYPE-RESTRICTION,
PLUS-COMMUTATIVITY, and PLUS-ADD1, and unfolding the definition of LESSP,
to:
T.
Case 1.19.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NUMBERP I1)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
However this again simplifies, applying the lemmas PLUS-COMMUTATIVITY and
SUB1-ADD1, and opening up the functions PLUS and LESSP, to:
T.
Case 1.18.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP J
(PLUS (ADD1 I1)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS (SUB1 N2) I2))
LST2))))
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2))))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))),
which again simplifies, rewriting with PLUS-COMMUTATIVITY, SUB1-ADD1,
SUB1-TYPE-RESTRICTION, PUT-NTH-0, and PLUS-EQUAL-0, and unfolding the
functions PLUS, LESSP, and DIFFERENCE, to the following two new goals:
Case 1.18.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (NUMBERP I1))
(NOT (LESSP (SUB1 J)
(PLUS 0
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))).
But this again simplifies, applying the lemma PLUS-0, to the conjecture:
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (NUMBERP I1))
(NOT (LESSP (SUB1 J)
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2)))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))).
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. We must thus prove:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (EQUAL (ADD1 X) 0))
(NOT (NUMBERP I1))
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 (ADD1 X)) LST2))).
This further simplifies, rewriting with the lemma PLUS-ADD1-1, to:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (NUMBERP I1))
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))).
Appealing to the lemma SUB1-ELIM, we now replace N2 by (ADD1 Z) to
eliminate (SUB1 N2). We employ the type restriction lemma noted when
SUB1 was introduced to constrain the new variable. The result is:
(IMPLIES
(AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL (ADD1 Z) 1))
(NUMBERP I2)
(NOT (NUMBERP I1))
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 Z))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 (ADD1 Z))
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
Z LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))).
However this finally simplifies, appealing to the lemmas ADD1-EQUAL and
PLUS-ADD1-1, and opening up the function NUMBERP, to:
T.
Case 1.18.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (EQUAL J 0))
(NUMBERP J)
(NUMBERP I1)
(NOT (LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(NOT (LESSP J I1))
(LESSP (SUB1 J)
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2))))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
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. We would thus like to prove
the new goal:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (EQUAL (ADD1 X) 0))
(NUMBERP I1)
(NOT (LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(NOT (LESSP (ADD1 X) I1))
(LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2))))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 (ADD1 X)) I1)
LST2))),
which further simplifies, rewriting with SUB1-ADD1, PLUS-0, and
PLUS-ADD1-1, and expanding LESSP, ADD1, EQUAL, and DIFFERENCE, to the
following three new goals:
Case 1.18.1.3.
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NUMBERP I1)
(NOT (LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(EQUAL I1 0)
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))).
This again simplifies, applying PLUS-0, and opening up the definition
of NUMBERP, to:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))).
Applying the lemma SUB1-ELIM, replace N2 by (ADD1 Z) to eliminate
(SUB1 N2). We rely upon the type restriction lemma noted when SUB1
was introduced to restrict the new variable. This produces the new
formula:
(IMPLIES
(AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL (ADD1 Z) 1))
(NUMBERP I2)
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 Z))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 (ADD1 Z))
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
Z LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))),
which finally simplifies, appealing to the lemmas ADD1-EQUAL and
PLUS-ADD1-1, and unfolding the definition of NUMBERP, to:
T.
Case 1.18.1.2.
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NUMBERP I1)
(NOT (LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(NOT (LESSP X (SUB1 I1)))
(LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 X) (SUB1 I1))
LST2))).
Applying the lemma SUB1-ELIM, replace N2 by (ADD1 Z) to eliminate
(SUB1 N2). We rely upon the type restriction lemma noted when SUB1
was introduced to restrict the new variable. We thus obtain:
(IMPLIES
(AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL (ADD1 Z) 1))
(NUMBERP I2)
(NUMBERP I1)
(NOT (LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 Z))
LST2))))
(NOT (LESSP X (SUB1 I1)))
(LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 (ADD1 Z))
LST2)))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
Z LST2))
(GET-NTH (DIFFERENCE (PLUS I2 X) (SUB1 I1))
LST2))),
which finally simplifies, appealing to the lemmas ADD1-EQUAL and
PLUS-ADD1-1, and unfolding NUMBERP, to:
T.
Case 1.18.1.1.
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NUMBERP I1)
(NOT (LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2))))
(NOT (LESSP X (SUB1 I1)))
(LESSP X
(PLUS I1
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL I1 0))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))),
which again simplifies, applying PLUS-0, and opening up the functions
NUMBERP, SUB1, EQUAL, and LESSP, to the new formula:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I2)
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 (SUB1 N2)))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 N2)
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))).
Applying the lemma SUB1-ELIM, replace N2 by (ADD1 Z) to eliminate
(SUB1 N2). We use the type restriction lemma noted when SUB1 was
introduced to restrict the new variable. This produces:
(IMPLIES
(AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL (ADD1 Z) 1))
(NUMBERP I2)
(NOT (LESSP X
(STRLEN1 (ADD1 I2)
(ADD1 (PLUS I2 Z))
LST2)))
(LESSP X
(STRLEN1 (ADD1 I2)
(PLUS I2 (ADD1 Z))
LST2)))
(EQUAL (GET-NTH (ADD1 X)
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
Z LST2))
(GET-NTH (ADD1 (PLUS I2 X)) LST2))),
which finally simplifies, applying the lemmas ADD1-EQUAL and
PLUS-ADD1-1, and opening up NUMBERP, to:
T.
Case 1.17.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(EQUAL J 0)
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 1.16.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(EQUAL J 0)
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, rewriting with the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, PUT-NTH-0, GET-PUT, STRCPY2-GET-1, PLUS-0, and
PLUS-COMMUTATIVITY, and unfolding the definitions of LESSP, NUMBERP, EQUAL,
and DIFFERENCE, to:
T.
Case 1.15.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(NOT (NUMBERP I2)))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, rewriting with GET-NTH-0,
SUB1-TYPE-RESTRICTION, PUT-NTH-0, GET-PUT, and STRCPY2-GET-1, and
expanding the functions NUMBERP, EQUAL, PLUS, and DIFFERENCE, to:
T.
Case 1.14.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(EQUAL I2 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))).
This again simplifies, trivially, to:
T.
Case 1.13.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(NOT (NUMBERP J))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (PLUS I2 J) LST2))).
However this again simplifies, using linear arithmetic, applying the
lemmas SUB1-TYPE-RESTRICTION, PUT-NTH-0, GET-PUT, STRCPY2-GET-1,
PLUS-EQUAL-0, and GET-NTH-PLUS-0, and unfolding the definitions of NUMBERP,
EQUAL, and DIFFERENCE, to:
T.
Case 1.12.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (EQUAL J 0))
(NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, rewriting with the lemmas SUB1-TYPE-RESTRICTION,
PUT-NTH-0, and PLUS-EQUAL-0, and expanding the functions EQUAL and
DIFFERENCE, to:
T.
Case 1.11.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (EQUAL I2 0))
(NUMBERP I2))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (PLUS I2 J) LST2))),
which again simplifies, applying SUB1-TYPE-RESTRICTION, PUT-NTH-0, and
PLUS-EQUAL-0, and expanding EQUAL and DIFFERENCE, to:
T.
Case 1.10.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(EQUAL I2 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))).
This again simplifies, using linear arithmetic, rewriting with the lemmas
SUB1-TYPE-RESTRICTION, PUT-NTH-0, GET-PUT, STRCPY2-GET-1, PLUS-0, and
SUB1-NNUMBERP, and expanding the definitions of NUMBERP, EQUAL, DIFFERENCE,
and LESSP, to:
T.
Case 1.9.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(EQUAL I2 0)
(EQUAL J 0))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))),
which again simplifies, rewriting with the lemmas SUB1-TYPE-RESTRICTION,
PUT-NTH-0, GET-PUT, STRCPY2-GET-1, and PLUS-0, and expanding the functions
LESSP, NUMBERP, EQUAL, PLUS, DIFFERENCE, and SUB1, to:
T.
Case 1.8.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (NUMBERP I2))
(EQUAL J 0))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))),
which again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
PUT-NTH-0, GET-PUT, STRCPY2-GET-1, PLUS-0, and PLUS-COMMUTATIVITY, and
unfolding the functions LESSP, NUMBERP, EQUAL, DIFFERENCE, SUB1, and PLUS,
to:
T.
Case 1.7.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NOT (NUMBERP I1))
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) 0)
LST2))
(LESSP (SUB1 J)
(STRLEN1 (ADD1 I2) (PLUS I2 N2) LST2))
(NOT (NUMBERP I2))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH J
(STRCPY2 1
(PUT-NTH (GET-NTH I2 LST2) 0 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH 0 LST2))).
However this again simplifies, using linear arithmetic, applying the
lemmas GET-NTH-0, SUB1-TYPE-RESTRICTION, PUT-NTH-0, GET-PUT, STRCPY2-GET-1,
and SUB1-NNUMBERP, and expanding the functions NUMBERP, EQUAL, PLUS,
DIFFERENCE, and LESSP, to:
T.
Case 1.6.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NOT (NUMBERP I2))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE 0 I1) LST2))),
which again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
GET-PUT, STRCPY2-GET-1, PLUS-0, and PLUS-COMMUTATIVITY, and expanding the
functions NUMBERP, LESSP, EQUAL, and DIFFERENCE, to:
T.
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE I2 I1) LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(EQUAL J 0)
(NUMBERP I2)
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE I2 I1) LST2))),
which again simplifies, rewriting with the lemmas GET-PUT, STRCPY2-GET-1,
PLUS-0, and PLUS-COMMUTATIVITY, and unfolding the functions NUMBERP, LESSP,
EQUAL, and DIFFERENCE, to the goal:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH 0 LST2))
(NUMBERP I2)
(NOT (EQUAL I2 0)))
(EQUAL (GET-NTH 0 LST2)
(GET-NTH I2 LST2))).
This again simplifies, clearly, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(NOT (EQUAL I1 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, using linear arithmetic and applying GET-NTH-0,
GET-PUT, and STRCPY2-GET-1, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I2 LST2) 0))
(NOT (EQUAL N2 0))
(NUMBERP N2)
(NOT (EQUAL N2 1))
(NUMBERP I1)
(EQUAL (GET-NTH J
(STRCPY2 (ADD1 I1)
(PUT-NTH (GET-NTH I2 LST2) I1 LST1)
(ADD1 I2)
(SUB1 N2)
LST2))
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))
(NOT (LESSP J I1))
(NOT (NUMBERP J))
(EQUAL I1 0))
(EQUAL (GET-NTH I2 LST2)
(GET-NTH (DIFFERENCE (PLUS I2 J) I1)
LST2))).
This again simplifies, using linear arithmetic, applying GET-PUT,
STRCPY2-GET-1, PLUS-EQUAL-0, GET-NTH-0, PLUS-0, and GET-NTH-PLUS-0, and
expanding the functions NUMBERP, EQUAL, DIFFERENCE, LESSP, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.8 0.3 ]
STRCPY2-GET-2
(PROVE-LEMMA STRNCAT-GET-1
(REWRITE)
(IMPLIES (LESSP J (STRLEN 0 N1 LST1))
(EQUAL (GET-NTH J (STRNCAT N1 LST1 N2 LST2))
(GET-NTH J LST1))))
This simplifies, expanding NULL and STRNCAT, to two new goals:
Case 2. (IMPLIES (AND (LESSP J (STRLEN 0 N1 LST1))
(NOT (EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH J (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, opening up the definitions of NULL, LESSP, EQUAL,
and STRLEN, to:
T.
Case 1. (IMPLIES (AND (LESSP J (STRLEN 0 N1 LST1))
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 1 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, applying STRLEN-01 and STRCPY2-GET-1, and expanding
the functions ADD1, NULL, LESSP, EQUAL, and STRLEN, to the following two new
formulas:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP N1))
(LESSP J 0)
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J (STRCPY2 1 LST1 0 N2 LST2))
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (EQUAL N1 0)
(LESSP J 0)
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J (STRCPY2 1 LST1 0 N2 LST2))
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRNCAT-GET-1
(PROVE-LEMMA STRNCAT-GET-2
(REWRITE)
(IMPLIES (AND (STRINGP 0 N1 LST1)
(LEQ (STRLEN 0 N1 LST1) J)
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2))))
(EQUAL (GET-NTH J (STRNCAT N1 LST1 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2)))
((USE (STRCPY2-GET-2 (I1 (STRLEN 0 N1 LST1))
(I2 0)))
(ENABLE STRLEN1-STRLEN)))
This formula simplifies, using linear arithmetic, applying PLUS-0,
STRLEN1-STRLEN, PLUS-COMMUTATIVITY, GET-NTH-0, and DIFFERENCE-0, and expanding
the definitions of EQUAL, DIFFERENCE, AND, IMPLIES, STRINGP, LESSP, STRLEN,
NULL, and STRNCAT, to the following six new conjectures:
Case 6. (IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE 0 (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(EQUAL (STRLEN 0 N1 LST1) 0)
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(NOT (EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH 0 (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH 0 LST2))).
This again simplifies, rewriting with GET-NTH-0, and opening up the function
DIFFERENCE, to:
T.
Case 5. (IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE 0 (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(EQUAL (STRLEN 0 N1 LST1) 0)
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH 0
(STRCPY2 (STRLEN 1 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH 0 LST2))).
This again simplifies, applying the lemmas GET-NTH-0, STRLEN-01, and
STRCPY2-GET-1, and opening up the definitions of DIFFERENCE, ADD1, NULL,
LESSP, EQUAL, and STRLEN, to two new formulas:
Case 5.2.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH 0 (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH 0 LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(EQUAL N1 0)
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 5.1.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH 0 (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH 0 LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (NUMBERP N1))
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, opening up LESSP, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE 0 (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(EQUAL (STRLEN 0 N1 LST1) 0)
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, applying GET-NTH-0 and STRLEN-II, and unfolding the
definitions of ADD1, EQUAL, SUB1, NULL, STRCPY2, and DIFFERENCE, to:
T.
Case 3. (IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (LESSP J (STRLEN 0 N1 LST1)))
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2)))
(NOT (EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH J (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))).
This again simplifies, rewriting with PLUS-0, and opening up NULL, LESSP,
EQUAL, STRLEN, and DIFFERENCE, to:
(IMPLIES (AND (NUMBERP J)
(EQUAL J 0)
(EQUAL (GET-NTH J (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH 0 LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (EQUAL (STRLEN 0 N2 LST2) 0))
(NOT (EQUAL N2 0))
(EQUAL (GET-NTH 0 LST1) 0))
(EQUAL (GET-NTH 0 (STRCPY2 0 LST1 0 N2 LST2))
(GET-NTH 0 LST2))),
which again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (LESSP J (STRLEN 0 N1 LST1)))
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2)))
(NOT (EQUAL N2 0))
(NOT (EQUAL (GET-NTH 0 LST1) 0)))
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 1 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))).
However this again simplifies, rewriting with SLEN-01 and PLUS-COMMUTATIVITY,
and opening up the functions ADD1, NULL, LESSP, EQUAL, STRLEN, and NUMBERP,
to:
T.
Case 1. (IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH J
(STRCPY2 (STRLEN 0 N1 LST1)
LST1 0 N2 LST2))
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))
(LESSP (SLEN 0 N1 LST1) N1)
(NOT (LESSP J (STRLEN 0 N1 LST1)))
(LESSP J
(PLUS (STRLEN 0 N1 LST1)
(STRLEN 0 N2 LST2)))
(EQUAL N2 0))
(EQUAL (GET-NTH J LST1)
(GET-NTH (DIFFERENCE J (STRLEN 0 N1 LST1))
LST2))).
This again simplifies, applying the lemmas STRLEN-II, PLUS-0, and
PLUS-COMMUTATIVITY, and opening up the definitions of EQUAL, SUB1, NULL, and
STRCPY2, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
STRNCAT-GET-2
(PROVE-LEMMA ZERO-LIST1-LA
(REWRITE)
(IMPLIES (LESSP J I)
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
(GET-NTH J LST))))
Name 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 (EQUAL (SUB1 N) 0)
(p J I N LST))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p J
(ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(p J I N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 instances chosen
for I and LST. The above induction scheme leads to the following three new
conjectures:
Case 3. (IMPLIES (AND (EQUAL (SUB1 N) 0) (LESSP J I))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
(GET-NTH J LST))).
This simplifies, rewriting with the lemmas SUB1-OF-1 and SUB1-NNUMBERP, and
opening up the definitions of EQUAL, SUB1, and ZERO-LIST1, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J (ADD1 I)))
(LESSP J I))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
(GET-NTH J LST))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(GET-NTH J (PUT-NTH 0 I LST)))
(LESSP J I))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
(GET-NTH J LST))).
This simplifies, applying SUB1-OF-1, GET-NTH-0, and GET-PUT, and unfolding
LESSP, ZERO-LIST1, and EQUAL, to two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NUMBERP J)
(EQUAL I J)
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
0)
(LESSP I I))
(EQUAL (GET-NTH I
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(GET-NTH I LST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(GET-NTH 0 LST)))
(EQUAL (GET-NTH 0
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(GET-NTH 0 LST))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
ZERO-LIST1-LA
(PROVE-LEMMA ZERO-LIST1-GET
(REWRITE)
(IMPLIES (AND (LEQ I J)
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0))
((INDUCT (ZERO-LIST1 I N LST))))
This formula can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to the following two new formulas:
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)).
This simplifies, using linear arithmetic, to the new goal:
(IMPLIES (AND (EQUAL (PLUS I N) 0)
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP N 1)
(EQUAL (PLUS I N) 0)
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (SUB1 0)))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)).
This again simplifies, rewriting with LESSP-OF-1, PLUS-0, PLUS-COMMUTATIVITY,
PLUS-EQUAL-0, and SUB1-NNUMBERP, and unfolding the functions SUB1, EQUAL,
and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (IF (LESSP J (ADD1 I)) F T)
(LESSP J
(SUB1 (PLUS (ADD1 I) (SUB1 N)))))
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
0))
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)).
This simplifies, applying the lemmas SUB1-ADD1, PLUS-COMMUTATIVITY, PLUS-0,
SUB1-OF-1, GET-NTH-0, GET-PUT, and ZERO-LIST1-LA, and unfolding the
functions LESSP, PLUS, AND, IMPLIES, EQUAL, and ZERO-LIST1, to the following
nine new formulas:
Case 1.9.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(EQUAL I 0))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)).
This again simplifies, trivially, to the new formula:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)),
which we will name *1.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)).
This again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)),
which we will name *2.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)).
This again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)),
which we will name *3.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)).
Call the above conjecture *4.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LESSP J (SUB1 N)))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)).
However this again simplifies, unfolding the definitions of EQUAL and
LESSP, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N)))
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST) 0)),
which again simplifies, rewriting with SUB1-NNUMBERP, and expanding EQUAL
and LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N)))
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST) 0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J (PLUS (SUB1 N) 0)))
(LESSP J (SUB1 N)))
(EQUAL (GET-NTH J (ZERO-LIST1 I N LST))
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J (PLUS (SUB1 N) I)))
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
0)),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (EQUAL (PLUS I N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J (PLUS (SUB1 N) I)))
(NOT (LESSP J I))
(LESSP J (SUB1 (PLUS I N))))
(EQUAL (GET-NTH J
(ZERO-LIST1 (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
0)).
This again simplifies, using linear arithmetic, to:
T.
So let us turn our attention to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)),
which is formula *4 above. This conjecture is subsumed by another subgoal
awaiting our attention, namely *2 above.
So we now return to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)),
which is formula *3 above. Ah ha! This conjecture is subsumed by formula
*1 above.
So next consider:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)),
named *2 above. Let us appeal to the induction principle. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (EQUAL (SUB1 N) 0)
(p I N LST))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I)
(SUB1 N)
(PUT-NTH 0 I LST)))
(p I N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I and LST. The above induction scheme leads to two new conjectures:
Case 2. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 I N LST))
0)),
which simplifies, using linear arithmetic, applying the lemmas SUB1-OF-1,
GET-PUT, and ZERO-LIST1-LA, and opening up the definitions of ZERO-LIST1,
NUMBERP, and EQUAL, to:
T.
That finishes the proof of *2.
So next consider:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)),
named *1 above. Let us appeal to the induction principle. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (EQUAL (SUB1 N) 0) (p N LST))
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(p (SUB1 N) (PUT-NTH 0 0 LST)))
(p N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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. Note, however, the inductive instance
chosen for LST. The above induction scheme leads to the following three new
conjectures:
Case 3. (IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (SUB1 N) 1)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)).
This simplifies, rewriting with GET-PUT, and opening up the functions EQUAL,
ZERO-LIST1, ADD1, SUB1, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH 0
(ZERO-LIST1 0
(SUB1 N)
(PUT-NTH 0 0 LST)))
0)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(EQUAL (GET-NTH 0 (ZERO-LIST1 0 N LST))
0)),
which simplifies, applying the lemmas SUB1-OF-1, GET-PUT, and ZERO-LIST1-LA,
and unfolding the functions ZERO-LIST1, ADD1, LESSP, NUMBERP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.2 0.1 0.1 ]
ZERO-LIST1-GET
(PROVE-LEMMA ZERO-LIST-GET
(REWRITE)
(IMPLIES (AND (LEQ I J) (LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (ZERO-LIST I N LST))
0))
((USE (ZERO-LIST1-GET (I (ADD1 I))
(LST (PUT-NTH 0 I LST))))))
This simplifies, using linear arithmetic, applying SUB1-ADD1,
PLUS-COMMUTATIVITY, PLUS-SUB1-ADD1, PLUS-0, GET-PUT, ZERO-LIST1-LA, PUT-NTH-0,
SUB1-TYPE-RESTRICTION, SUB1-NNUMBERP, and GET-NTH-0, and unfolding the
functions LESSP, AND, IMPLIES, EQUAL, ADD1, ZERO-LIST, NUMBERP, PLUS, and
ZERO-LIST1, to the following four new goals:
Case 4. (IMPLIES (AND (NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(NOT (NUMBERP N))
(LESSP J 0)
(NUMBERP J)
(NOT (EQUAL 0 J)))
(EQUAL (GET-NTH J LST) 0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(NUMBERP N)
(LESSP J N))
(EQUAL (GET-NTH J
(ZERO-LIST1 1 N (PUT-NTH 0 0 LST)))
0)),
which again simplifies, expanding the functions EQUAL and LESSP, to:
T.
Case 2. (IMPLIES (AND (NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (PLUS I N))
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST) 0)),
which again simplifies, applying the lemma SUB1-NNUMBERP, and unfolding the
functions EQUAL and LESSP, to:
T.
Case 1. (IMPLIES (AND (NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J (PLUS I N))
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST) 0)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ZERO-LIST-GET
(PROVE-LEMMA STRNCPY1-GET
(REWRITE)
(IMPLIES (LESSP J I)
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST1))))
Give the conjecture the name *1.
Let us appeal to the induction principle. 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 (EQUAL (GET-NTH I LST2) 0)
(p J I N LST1 LST2))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0))
(p J I N LST1 LST2))
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (SUB1 N) 0))
(p J
(ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(p J I N LST1 LST2))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 can be used to show 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 I and LST1. The above induction scheme generates the following
four new conjectures:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST1))).
This simplifies, using linear arithmetic, appealing to the lemmas GET-NTH-0,
GET-PUT, and ZERO-LIST1-LA, and expanding the functions STRNCPY1, EQUAL, and
ZERO-LIST, to the following five new goals:
Case 4.5.
(IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL 0 (GET-NTH J LST1))).
This again simplifies, using linear arithmetic, to:
T.
Case 4.4.
(IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, applying GET-NTH-0, and opening up LESSP, to:
T.
Case 4.3.
(IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL 0 (GET-NTH J LST1))).
But this again simplifies, rewriting with the lemma GET-NTH-0, and opening
up LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL 0 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and opening up the
definition of LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(LESSP J I))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST1))).
This simplifies, rewriting with SUB1-OF-1, GET-NTH-0, GET-PUT, and
SUB1-NNUMBERP, and expanding the definitions of EQUAL, SUB1, and STRNCPY1,
to 15 new conjectures:
Case 3.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
the definition of LESSP, to:
T.
Case 3.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, applying GET-NTH-0, and expanding the function
LESSP, to:
T.
Case 3.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, applying GET-NTH-0, and expanding LESSP, to:
T.
Case 3.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and opening up LESSP, to:
T.
Case 3.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP N))
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))).
This again simplifies, rewriting with the lemma GET-NTH-0, and unfolding
LESSP, to:
T.
Case 3.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP N))
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NUMBERP N))
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and unfolding the
function LESSP, to:
T.
Case 3.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, rewriting with the lemma GET-NTH-0, and expanding
the definition of LESSP, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(LESSP J I)
(NOT (NUMBERP I))
(EQUAL 0 J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))),
which again simplifies, applying GET-NTH-0, and unfolding the function
LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(LESSP J I)
(NUMBERP I)
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST1))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(LESSP J I)
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST1))),
which again simplifies, rewriting with GET-NTH-0, and expanding the
definition of LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP J (ADD1 I)))
(LESSP J I))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST1))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (SUB1 N) 0))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH J
(PUT-NTH (GET-NTH I LST2) I LST1)))
(LESSP J I))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST1))).
This simplifies, applying SUB1-OF-1, GET-NTH-0, and GET-PUT, and unfolding
LESSP, STRNCPY1, and EQUAL, to two new goals:
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NUMBERP J)
(EQUAL I J)
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH I LST2))
(LESSP I I))
(EQUAL (GET-NTH I
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH I LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH 0 LST1))),
which again simplifies, appealing to the lemma GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRNCPY1-GET
(DISABLE ZERO-LIST)
[ 0.0 0.0 0.0 ]
ZERO-LIST-OFF
(PROVE-LEMMA STRNCPY1-STRLEN NIL
(EQUAL (STRLEN I
(PLUS I N)
(STRNCPY1 I N LST1 LST2))
(STRLEN I (PLUS I N) LST2))
((INDUCT (STRNCPY1 I N LST1 LST2))
(ENABLE PLUS-ADD1-1)))
This formula can be simplified, using the abbreviations SUB1-OF-1, NOT, OR,
and AND, to the following three new conjectures:
Case 3. (IMPLIES (EQUAL (GET-NTH I LST2) 0)
(EQUAL (STRLEN I
(PLUS I N)
(STRNCPY1 I N LST1 LST2))
(STRLEN I (PLUS I N) LST2))).
This simplifies, using linear arithmetic, applying the lemmas ZERO-LIST-GET
and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up the definitions of
EQUAL, STRNCPY1, NULL, NOT, ZEROP, FIX, and STRLEN, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0))
(EQUAL (STRLEN I
(PLUS I N)
(STRNCPY1 I N LST1 LST2))
(STRLEN I (PLUS I N) LST2))).
This simplifies, applying the lemmas SUB1-OF-1, PLUS-0, PLUS-COMMUTATIVITY,
SUB1-NNUMBERP, CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-ADD1, GET-PUT, and
STRLEN-II1, and expanding the definitions of EQUAL, SUB1, STRNCPY1, NOT,
ZEROP, FIX, and STRLEN, to the following two new goals:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (NUMBERP I)))
(EQUAL (STRLEN I 0
(PUT-NTH (GET-NTH I LST2) I LST1))
(STRLEN I 0 LST2))).
But this again simplifies, rewriting with GET-NTH-0, PUT-NTH-0, and
STRLEN-01, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NUMBERP I))
(EQUAL (STRLEN I I
(PUT-NTH (GET-NTH I LST2) I LST1))
(STRLEN I I LST2))).
However this again simplifies, rewriting with STRLEN-II, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL (STRLEN (ADD1 I)
(PLUS (ADD1 I) (SUB1 N))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(PLUS (ADD1 I) (SUB1 N))
LST2)))
(EQUAL (STRLEN I
(PLUS I N)
(STRNCPY1 I N LST1 LST2))
(STRLEN I (PLUS I N) LST2))).
This simplifies, using linear arithmetic, rewriting with the lemmas
SUB1-ADD1, PLUS-COMMUTATIVITY, SUB1-TYPE-RESTRICTION, GET-NTH-0, SUB1-OF-1,
STRNCPY1-GET, GET-PUT, and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding
PLUS, NULL, LESSP, STRLEN, STRNCPY1, NOT, ZEROP, and FIX, to the following
four new formulas:
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2))
(NOT (EQUAL (GET-NTH 0 (STRNCPY1 I N LST1 LST2))
0)))
(EQUAL (STRLEN 1 N (STRNCPY1 I N LST1 LST2))
(STRLEN 1 N LST2))).
But this again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION,
PLUS-0, PLUS-COMMUTATIVITY, ADD1-SUB1, and PUT-NTH-0, to:
(IMPLIES
(AND (NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(EQUAL (STRLEN 1 N
(STRNCPY1 1
(SUB1 N)
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
LST2))
(STRLEN 1 N LST2))
(NOT (EQUAL (GET-NTH 0 (STRNCPY1 I N LST1 LST2))
0)))
(EQUAL (STRLEN 1 N (STRNCPY1 I N LST1 LST2))
(STRLEN 1 N LST2))),
which again simplifies, applying PUT-NTH-0, SUB1-TYPE-RESTRICTION,
SUB1-OF-1, GET-NTH-0, GET-PUT, and STRNCPY1-GET, and unfolding the
definitions of STRNCPY1, LESSP, NUMBERP, and EQUAL, to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2))
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(NOT (EQUAL (GET-NTH 0 (STRNCPY1 I N LST1 LST2))
0))).
This again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, PLUS-0,
PLUS-COMMUTATIVITY, ADD1-SUB1, and PUT-NTH-0, to:
(IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(EQUAL (STRLEN 1 N
(STRNCPY1 1
(SUB1 N)
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
LST2))
(STRLEN 1 N LST2))
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(NOT (EQUAL (GET-NTH 0 (STRNCPY1 I N LST1 LST2))
0))),
which again simplifies, rewriting with the lemmas PUT-NTH-0,
SUB1-TYPE-RESTRICTION, SUB1-OF-1, GET-NTH-0, GET-PUT, and STRNCPY1-GET,
and opening up STRNCPY1, LESSP, NUMBERP, and EQUAL, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2))
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 (STRNCPY1 I N LST1 LST2))
0)),
which again simplifies, applying the lemma GET-NTH-0, and unfolding EQUAL,
to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) I))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) I))
LST2)))
(EQUAL (STRLEN (ADD1 I)
(PLUS I N)
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I) (PLUS I N) LST2))),
which again simplifies, applying the lemma PLUS-COMMUTATIVITY, to:
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS I (SUB1 N)))
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS I (SUB1 N)))
LST2)))
(EQUAL (STRLEN (ADD1 I)
(PLUS I N)
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I) (PLUS I N) LST2))).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to
eliminate (SUB1 N). We employ the type restriction lemma noted when SUB1
was introduced to constrain the new variable. We must thus prove:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL (ADD1 X) 1))
(NUMBERP I)
(EQUAL (STRLEN (ADD1 I)
(ADD1 (PLUS I X))
(STRNCPY1 (ADD1 I)
X
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(ADD1 (PLUS I X))
LST2)))
(EQUAL (STRLEN (ADD1 I)
(PLUS I (ADD1 X))
(STRNCPY1 (ADD1 I)
X
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(STRLEN (ADD1 I)
(PLUS I (ADD1 X))
LST2))).
But this further simplifies, applying ADD1-EQUAL and PLUS-ADD1-1, and
expanding NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
STRNCPY1-STRLEN
(PROVE-LEMMA STRCPY-0
(REWRITE)
(EQUAL (STRNCPY 0 LST1 LST2) LST1))
WARNING: Note that the rewrite rule STRCPY-0 will be stored so as to apply
only to terms with the nonrecursive function symbol STRNCPY.
This formula simplifies, unfolding the definitions of EQUAL and STRNCPY, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRCPY-0
(PROVE-LEMMA STRNCPY-STRLEN
(REWRITE)
(EQUAL (STRLEN 0 N (STRNCPY N LST1 LST2))
(IF (ZEROP N)
(STRLEN 0 N LST1)
(STRLEN 0 N LST2)))
((USE (STRNCPY1-STRLEN (I 0)))))
This conjecture simplifies, applying the lemmas PLUS-0 and STRLEN-II, and
expanding the definitions of STRNCPY, LESSP, STRLEN, ZEROP, and EQUAL, to:
(IMPLIES (AND (NUMBERP N)
(EQUAL (STRLEN 0 N (STRNCPY1 0 N LST1 LST2))
(STRLEN 0 N LST2))
(EQUAL N 0))
(EQUAL (STRLEN 0 N LST1) 0)),
which again simplifies, rewriting with STRLEN-II, and opening up the
definitions of NUMBERP, EQUAL, SUB1, and STRNCPY1, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCPY-STRLEN
(PROVE-LEMMA STRNCPY1-CPY
(REWRITE)
(IMPLIES (AND (LEQ I J)
(LESSP J (STRLEN I (PLUS I N) LST2)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST2)))
((INDUCT (STRNCPY1 I N LST1 LST2))
(EXPAND (STRNCPY1 I N LST1 LST2)
(STRNCPY1 0 N LST1 LST2))
(ENABLE PLUS-ADD1-1)))
This formula can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to the following three new goals:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST2)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST2))).
This simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up
the definitions of EQUAL, NULL, NOT, ZEROP, FIX, and STRLEN, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST2)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST2))),
which simplifies, rewriting with the lemmas SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, PUT-NTH-0, GET-NTH-0, GET-PUT,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-ADD1, STRLEN-II1, and SUB1-ADD1, and
unfolding the functions EQUAL, SUB1, STRNCPY1, NOT, ZEROP, FIX, STRLEN,
LESSP, and NUMBERP, to 18 new goals:
Case 2.18.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP J (STRLEN I 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH J
(PUT-NTH (GET-NTH 0 LST2) 0 LST1))
(GET-NTH J LST2))),
which again simplifies, applying the lemmas GET-NTH-0 and STRLEN-01, and
expanding LESSP, to:
T.
Case 2.17.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP J (STRLEN I 0 LST2))
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH J (ZERO-LIST I 0 LST1))
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, and unfolding the
definition of EQUAL, to:
T.
Case 2.16.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP J (STRLEN I I LST2))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))).
However this again simplifies, applying the lemma STRLEN-II, and opening
up the functions EQUAL, LESSP, and NUMBERP, to:
T.
Case 2.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP J (STRLEN I I LST2))
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))),
which again simplifies, obviously, to:
T.
Case 2.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP J (STRLEN I I LST2))
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST2))).
But this again simplifies, opening up the definition of LESSP, to:
T.
Case 2.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP J (STRLEN I I LST2))
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying the lemma STRLEN-II, to:
T.
Case 2.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(EQUAL J 0)
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))),
which again simplifies, clearly, to:
T.
Case 2.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(EQUAL J 0)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))).
This again simplifies, rewriting with the lemma GET-NTH-0, and expanding
the definition of LESSP, to:
T.
Case 2.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(EQUAL J 0)
(NUMBERP I)
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NOT (NUMBERP J))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH I LST2)
(GET-NTH 0 LST2))).
However this again simplifies, applying the lemma GET-NTH-0, and expanding
the definition of LESSP, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NOT (NUMBERP J))
(NUMBERP I)
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, opening up the function LESSP, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (GET-NTH J
(PUT-NTH (GET-NTH 0 LST2) 0 LST1))
(GET-NTH J LST2))),
which again simplifies, applying the lemma GET-NTH-0, and expanding LESSP
and EQUAL, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH J (ZERO-LIST I 1 LST1))
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, and opening up EQUAL, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))).
However this again simplifies, rewriting with SUB1-NNUMBERP, and unfolding
the functions EQUAL, LESSP, and NUMBERP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST2))).
This again simplifies, opening up the function LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (IF (LESSP J (ADD1 I)) F T)
(LESSP J
(STRLEN (ADD1 I)
(PLUS (ADD1 I) (SUB1 N))
LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH J LST2)))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST2)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
(GET-NTH J LST2))),
which simplifies, using linear arithmetic, rewriting with SUB1-ADD1,
PLUS-COMMUTATIVITY, PLUS-0, SUB1-OF-1, GET-PUT, STRNCPY1-GET,
SUB1-TYPE-RESTRICTION, GET-NTH-0, PUT-NTH-0, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the definitions of LESSP,
PLUS, AND, IMPLIES, EQUAL, ADD1, NULL, STRLEN, STRNCPY1, NUMBERP, NOT, ZEROP,
and FIX, to the following nine new goals:
Case 1.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(LESSP J (STRLEN 1 N LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 1
(SUB1 N)
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
LST2))
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, and opening up the
definitions of EQUAL and LESSP, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J I))
(EQUAL (GET-NTH J (ZERO-LIST I N LST1))
(GET-NTH J LST2))).
But this again simplifies, applying GET-NTH-0, and opening up the function
EQUAL, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2))
(NOT (NUMBERP J))
(EQUAL I 0))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))).
However this again simplifies, applying the lemma SUB1-NNUMBERP, and
expanding the functions NUMBERP and LESSP, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2))
(NUMBERP J)
(EQUAL I J))
(EQUAL (GET-NTH I LST2)
(GET-NTH J LST2))),
which again simplifies, trivially, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2))
(NOT (NUMBERP J))
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST2))).
But this again simplifies, appealing to the lemma SUB1-NNUMBERP, and
unfolding EQUAL and LESSP, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2))
(NUMBERP J)
(NOT (EQUAL I J)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(LESSP J (STRLEN 1 N LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 1
(SUB1 N)
(PUT-NTH (GET-NTH 0 LST2) 0 LST1)
LST2))
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, PLUS-0, PLUS-COMMUTATIVITY, and ADD1-SUB1, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2)))
(EQUAL (GET-NTH 0 LST2) 0)
(LESSP J I))
(EQUAL (GET-NTH J (ZERO-LIST I N LST1))
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic and rewriting with
STRLEN-LB, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) I))
LST2)))
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH J LST2))).
This again simplifies, rewriting with the lemma PLUS-COMMUTATIVITY, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I (SUB1 N)))
LST2)))
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH J LST2))).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to
eliminate (SUB1 N). 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 (GET-NTH I LST2) 0))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL (ADD1 X) 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I X))
LST2)))
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I)
(PLUS I (ADD1 X))
LST2)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
X
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
(GET-NTH J LST2))).
But this further simplifies, rewriting with ADD1-EQUAL and PLUS-ADD1-1,
and unfolding the function NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.2 0.1 ]
STRNCPY1-CPY
(PROVE-LEMMA STRNCPY-CPY
(REWRITE)
(IMPLIES (LESSP J (STRLEN 0 N LST2))
(EQUAL (GET-NTH J (STRNCPY N LST1 LST2))
(GET-NTH J LST2)))
((USE (STRNCPY1-CPY (I 0)))))
This conjecture simplifies, rewriting with PLUS-0, and unfolding the functions
EQUAL, LESSP, AND, IMPLIES, STRLEN, and STRNCPY, to the following two new
formulas:
Case 2. (IMPLIES (AND (EQUAL (GET-NTH J (STRNCPY1 0 N LST1 LST2))
(GET-NTH J LST2))
(LESSP J (STRLEN 0 N LST2))
(NOT (NUMBERP N)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with SUB1-NNUMBERP, and opening up the
definitions of EQUAL, STRNCPY1, LESSP, and STRLEN, to:
T.
Case 1. (IMPLIES (AND (EQUAL (GET-NTH J (STRNCPY1 0 N LST1 LST2))
(GET-NTH J LST2))
(LESSP J (STRLEN 0 N LST2))
(EQUAL N 0))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, appealing to the lemma STRLEN-II, and opening up the
functions EQUAL, SUB1, STRNCPY1, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCPY-CPY
(PROVE-LEMMA STRNCPY1-0S
(REWRITE)
(IMPLIES (AND (LEQ (STRLEN I (PLUS I N) LST2) J)
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0))
((INDUCT (STRNCPY1 I N LST1 LST2))
(ENABLE PLUS-ADD1-1)))
This formula can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to the following three new goals:
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST2) 0)
(NOT (LESSP J (STRLEN I (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)).
This simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS and ZERO-LIST-GET,
and opening up the definitions of EQUAL, NULL, NOT, ZEROP, FIX, STRLEN, and
STRNCPY1, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J (STRLEN I (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)),
which simplifies, using linear arithmetic and applying STRLEN-LB, to the
following three new goals:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J (STRLEN I (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)).
This again simplifies, applying SUB1-OF-1, PLUS-0, PLUS-COMMUTATIVITY,
GET-NTH-0, GET-PUT, CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-ADD1, and
STRLEN-II1, and expanding the definitions of LESSP, EQUAL, SUB1, STRNCPY1,
NOT, ZEROP, FIX, STRLEN, and PLUS, to:
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 0)
(NUMBERP I)
(EQUAL (STRLEN I I LST2) 0)
(NOT (EQUAL I 0)))
(EQUAL (GET-NTH 0 LST1) 0)),
which again simplifies, rewriting with STRLEN-II, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP J (STRLEN I (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)).
This again simplifies, appealing to the lemmas GET-NTH-0, SUB1-OF-1,
PLUS-0, PLUS-COMMUTATIVITY, STRLEN-01, SUB1-TYPE-RESTRICTION, PLUS-ADD1,
and LESSP-OF-1, and unfolding the functions LESSP, EQUAL, and PLUS, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP I (STRLEN I (PLUS I N) LST2)))
(LESSP I (PLUS I N)))
(EQUAL (GET-NTH I (STRNCPY1 I N LST1 LST2))
0)),
which again simplifies, using linear arithmetic and applying STRLEN-LB, to:
(IMPLIES (AND (EQUAL (STRLEN I (PLUS I N) LST2) I)
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (SUB1 N) 0)
(NOT (LESSP I I))
(LESSP I (PLUS I N)))
(EQUAL (GET-NTH I (STRNCPY1 I N LST1 LST2))
0)),
which again simplifies, applying SUB1-OF-1, PLUS-0, PLUS-COMMUTATIVITY,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, PLUS-ADD1, LESSP-SUB1, SUB1-ADD1, and
GET-PUT, and expanding the definitions of FIX, ZEROP, NOT, LESSP, EQUAL,
SUB1, and STRNCPY1, to:
(IMPLIES (AND (EQUAL (STRLEN I (PLUS I N) LST2) I)
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL N 1))
(LESSP I I)),
which again simplifies, applying the lemmas PLUS-ADD1, PLUS-COMMUTATIVITY,
and STRLEN-II1, to:
T.
Case 1. (IMPLIES
(AND
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (IF (LESSP J
(STRLEN (ADD1 I)
(PLUS (ADD1 I) (SUB1 N))
LST2))
F T)
(LESSP J (PLUS (ADD1 I) (SUB1 N))))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
0))
(NOT (LESSP J (STRLEN I (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)),
which simplifies, applying the lemmas SUB1-ADD1, PLUS-COMMUTATIVITY,
SUB1-TYPE-RESTRICTION, GET-NTH-0, ZERO-LIST-GET,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and SUB1-OF-1, and opening up the
definitions of PLUS, LESSP, AND, IMPLIES, NULL, STRLEN, EQUAL, STRNCPY1, NOT,
ZEROP, and FIX, to four new formulas:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST2))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (LESSP J (STRLEN 1 N LST2)))
(LESSP J N))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)),
which again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, PLUS-0,
PLUS-COMMUTATIVITY, and ADD1-SUB1, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) I))
LST2))
(NOT (LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
0)).
But this again simplifies, using linear arithmetic, appealing to the
lemmas PLUS-COMMUTATIVITY, SUB1-ADD1, STRLEN-LB, and STRNCPY1-CPY, and
expanding PLUS, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I (SUB1 N)))
LST2))
(NOT (LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J LST2) 0)).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to
eliminate (SUB1 N). We employ the type restriction lemma noted when SUB1
was introduced to constrain the new variable. This generates:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL (ADD1 X) 1))
(NUMBERP I)
(LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I X))
LST2))
(NOT (LESSP J
(STRLEN (ADD1 I)
(PLUS I (ADD1 X))
LST2)))
(LESSP J (PLUS I (ADD1 X))))
(EQUAL (GET-NTH J LST2) 0)).
But this further simplifies, applying the lemmas ADD1-EQUAL and
PLUS-ADD1-1, and unfolding the function NUMBERP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (NUMBERP I))
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (LESSP J (STRLEN 1 N LST2)))
(LESSP J N))
(EQUAL (GET-NTH J (STRNCPY1 I N LST1 LST2))
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (EQUAL J 0))
(NUMBERP J)
(NUMBERP I)
(NOT (LESSP (SUB1 J) (PLUS (SUB1 N) I)))
(NOT (LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST2)))
(LESSP J (PLUS I N)))
(EQUAL (GET-NTH J
(STRNCPY1 (ADD1 I)
(SUB1 N)
(PUT-NTH (GET-NTH I LST2) I LST1)
LST2))
0)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.1 ]
STRNCPY1-0S
(PROVE-LEMMA STRNCPY-0S
(REWRITE)
(IMPLIES (AND (LEQ (STRLEN 0 N LST2) J)
(LESSP J N))
(EQUAL (GET-NTH J (STRNCPY N LST1 LST2))
0))
((USE (STRNCPY1-0S (I 0)))))
This formula simplifies, applying the lemma PLUS-0, and expanding AND, IMPLIES,
LESSP, STRLEN, EQUAL, and STRNCPY, to the following two new conjectures:
Case 2. (IMPLIES (AND (EQUAL (GET-NTH J (STRNCPY1 0 N LST1 LST2))
0)
(NOT (LESSP J (STRLEN 0 N LST2)))
(LESSP J N)
(NOT (NUMBERP N)))
(EQUAL (GET-NTH J LST1) 0)).
This again simplifies, applying SUB1-NNUMBERP, and expanding the functions
EQUAL, STRNCPY1, LESSP, and STRLEN, to:
T.
Case 1. (IMPLIES (AND (EQUAL (GET-NTH J (STRNCPY1 0 N LST1 LST2))
0)
(NOT (LESSP J (STRLEN 0 N LST2)))
(LESSP J N)
(EQUAL N 0))
(EQUAL (GET-NTH J LST1) 0)).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCPY-0S
(PROVE-LEMMA STRNCMP1-ID
(REWRITE)
(EQUAL (STRNCMP1 I N LST LST) 0))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (GET-NTH I LST) 0))
(p I N LST))
(IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (SUB1 N) 0))
(p I N LST))
(IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I) (SUB1 N) LST))
(p I N LST))
(IMPLIES (NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(p I N LST))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I. The above induction scheme generates the following
four new formulas:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(EQUAL (GET-NTH I LST) 0))
(EQUAL (STRNCMP1 I N LST LST) 0)).
This simplifies, expanding the definitions of EQUAL and STRNCMP1, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (SUB1 N) 0))
(EQUAL (STRNCMP1 I N LST LST) 0)).
This simplifies, appealing to the lemmas SUB1-OF-1 and SUB1-NNUMBERP, and
opening up EQUAL, SUB1, and STRNCMP1, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I LST)
(GET-NTH I LST))
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (SUB1 N) 0))
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST LST)
0))
(EQUAL (STRNCMP1 I N LST LST) 0)).
This simplifies, rewriting with SUB1-OF-1, and unfolding the definitions of
STRNCMP1 and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(EQUAL (STRNCMP1 I N LST LST) 0)),
which simplifies, clearly, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP1-ID
(PROVE-LEMMA STRNCMP-ID
(REWRITE)
(EQUAL (STRNCMP N LST LST) 0))
WARNING: Note that the rewrite rule STRNCMP-ID will be stored so as to apply
only to terms with the nonrecursive function symbol STRNCMP.
This formula simplifies, rewriting with STRNCMP1-ID, and expanding the
functions STRNCMP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP-ID
(PROVE-LEMMA STRNCMP1-THM1 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 I N LST1 LST2) 0)
(LEQ I J)
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
((INDUCT (STRNCMP1 I N LST1 LST2))
(ENABLE IDIFFERENCE IPLUS PLUS-ADD1-1)))
This conjecture can be simplified, using the abbreviations SUB1-OF-1, IMPLIES,
NOT, OR, and AND, to four new goals:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which simplifies, appealing to the lemma CORRECTNESS-OF-CANCEL-LESSP-PLUS,
and opening up EQUAL, STRNCMP1, NULL, NOT, ZEROP, FIX, and STRLEN, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (SUB1 N) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which simplifies, appealing to the lemmas SUB1-OF-1, PLUS-0,
PLUS-COMMUTATIVITY, SUB1-NNUMBERP, CORRECTNESS-OF-CANCEL-LESSP-PLUS,
PLUS-ADD1, STRLEN-II1, SUB1-ADD1, and GET-NTH-0, and opening up EQUAL, SUB1,
STRNCMP1, NOT, ZEROP, FIX, STRLEN, and LESSP, to six new goals:
Case 3.6.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP J (STRLEN I 0 LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemmas GET-NTH-0 and STRLEN-01,
and opening up the definition of LESSP, to:
T.
Case 3.5.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP J (STRLEN I I LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying the lemma STRLEN-II, to:
T.
Case 3.4.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(EQUAL J 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, expanding EQUAL and LESSP, to two new formulas:
Case 3.4.2.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL I 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 3.4.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, opening up the definition of LESSP, to two new
goals:
Case 3.3.2.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL I 0)
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 3.3.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NUMBERP I))
(NOT (NUMBERP J)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, applying GET-NTH-0, to:
T.
Case 3.2.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-NTH-0, and unfolding LESSP and
EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL N 1)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to two new goals:
Case 3.1.2.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(NUMBERP I)
(LESSP (SUB1 J) I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying SUB1-NNUMBERP, and expanding the
functions LESSP and NUMBERP, to:
T.
Case 3.1.1.
(IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP I I))
(NUMBERP I)
(LESSP (SUB1 I) I))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(IF (LESSP J (ADD1 I)) F T)
(LESSP J
(STRLEN (ADD1 I)
(PLUS (ADD1 I) (SUB1 N))
LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, rewriting with SUB1-ADD1, PLUS-COMMUTATIVITY, SUB1-OF-1,
PLUS-0, SUB1-TYPE-RESTRICTION, GET-NTH-0, NUMBERP-INTEGERP, GET-LST-OF-CHRP,
INTEGERP-FIX-INT, and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the
definitions of LESSP, PLUS, AND, IMPLIES, STRNCMP1, EQUAL, ADD1, NULL,
STRLEN, IDIFFERENCE, NEGP, NEGATIVE-GUTS, IZEROP, INEG, IPLUS, NOT, ZEROP,
and FIX, to 54 new goals:
Case 2.54.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(EQUAL I 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN 1 N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))),
which again simplifies, obviously, to:
T.
Case 2.53.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(EQUAL J 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN 1 N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.52.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(EQUAL I 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN 1 N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, clearly, to:
T.
Case 2.51.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP J))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (NUMBERP I))
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN 1 N LST1) 0)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 2.50.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (STRNCMP1 1 (SUB1 N) LST1 LST2)
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemma GET-NTH-0, and expanding
EQUAL and LESSP, to:
T.
Case 2.49.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (STRNCMP1 1 (SUB1 N) LST1 LST2)
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, and unfolding the
function EQUAL, to:
T.
Case 2.48.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(EQUAL (GET-NTH 0 LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-NTH-0, to:
T.
Case 2.47.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 2.46.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying the lemma GET-NTH-0, to:
T.
Case 2.45.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with the lemma GET-NTH-0, and unfolding
NEGATIVE-GUTS, to:
T.
Case 2.44.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.43.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.42.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with GET-NTH-0, and expanding the
definition of EQUAL, to:
T.
Case 2.41.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.40.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-NTH-0, to:
T.
Case 2.39.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, and unfolding the
definition of NEGATIVE-GUTS, to:
T.
Case 2.38.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.37.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, to:
T.
Case 2.36.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (MINUS 0) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS 0) (MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.35.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with the lemma GET-NTH-0, and
unfolding the function EQUAL, to:
T.
Case 2.34.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.33.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.32.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.31.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-NTH-0, to:
T.
Case 2.30.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.29.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.28.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-NTH-0, to:
T.
Case 2.27.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(LESSP (SUB1 J) 0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, to:
T.
Case 2.26.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to two new goals:
Case 2.26.2.
(IMPLIES (AND (NOT (NUMBERP J))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 J) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with SUB1-NNUMBERP, and expanding the
definitions of EQUAL and LESSP, to:
T.
Case 2.26.1.
(IMPLIES (AND (NUMBERP J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(LESSP (SUB1 I) I)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP I I))
(LESSP I
(STRLEN (ADD1 I) (PLUS I N) LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, trivially, to:
T.
Case 2.25.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (STRNCMP1 1 (SUB1 N) LST1 LST2)
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, PLUS-0, PLUS-COMMUTATIVITY, and ADD1-SUB1, to:
T.
Case 2.24.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))
(EQUAL (STRNCMP1 1 (SUB1 N) LST1 LST2)
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic and appealing to the lemma
STRLEN-LB, to:
T.
Case 2.23.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(EQUAL (GET-NTH 0 LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 2.22.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.21.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying GET-NTH-0, to:
T.
Case 2.20.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NEGATIVEP (GET-NTH 0 LST1))
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH 0 LST2))
(NEGATIVE-GUTS (GET-NTH 0 LST1)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, appealing to the lemma GET-NTH-0, and unfolding
NEGATIVE-GUTS, to:
T.
Case 2.19.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.18.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, clearly, to:
T.
Case 2.17.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(EQUAL (GET-NTH 0 LST2) 0)
(EQUAL (PLUS (GET-NTH 0 LST1) 0) 0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemma GET-NTH-0, and opening
up the function EQUAL, to:
T.
Case 2.16.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.15.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic and applying STRLEN-LB, to:
T.
Case 2.14.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NEGATIVEP (GET-NTH 0 LST2))
(NOT (EQUAL (GET-NTH 0 LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH 0 LST1)
(NEGATIVE-GUTS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying GET-NTH-0, and expanding the
definition of NEGATIVE-GUTS, to:
T.
Case 2.13.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, obviously, to:
T.
Case 2.12.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-NTH-0, to:
T.
Case 2.11.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1) (MINUS 0)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (MINUS 0) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS 0) (MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 2.10.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic and applying STRLEN-LB, to:
T.
Case 2.9.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH 0 LST1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1) (MINUS 0))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-LST-OF-CHRP, to:
T.
Case 2.8.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH 0 LST1)
(MINUS (GET-NTH 0 LST2)))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, using linear arithmetic and applying
STRLEN-LB, to:
T.
Case 2.7.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Case 2.6.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(EQUAL (GET-NTH 0 LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 2.5.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, obviously, to:
T.
Case 2.4.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (GET-NTH 0 LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 2.3.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(LESSP J (STRLEN 1 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying GET-NTH-0, to:
T.
Case 2.2.
(IMPLIES
(AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NOT (NUMBERP I))
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) 0))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))
(NOT (NEGATIVEP (GET-NTH 0 LST1)))
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NEGATIVEP (GET-NTH 0 LST2)))
(NOT (EQUAL (MINUS (GET-NTH 0 LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2)))))
(EQUAL (DIFFERENCE (GET-NTH 0 LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH 0 LST2))))
0)
(EQUAL (GET-NTH 0 LST1) 0)
(LESSP J I))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic and appealing to the
lemma STRLEN-LB, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS (SUB1 N) I))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, applying PLUS-COMMUTATIVITY, to the new formula:
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I (SUB1 N)))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I) (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
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)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL (ADD1 X) 1))
(NUMBERP I)
(NOT (LESSP J
(STRLEN (ADD1 I)
(ADD1 (PLUS I X))
LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 (ADD1 I) X LST1 LST2)
0)
(NOT (LESSP J I))
(LESSP J
(STRLEN (ADD1 I)
(PLUS I (ADD1 X))
LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which further simplifies, applying ADD1-EQUAL and PLUS-ADD1-1, and
expanding the function NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP1 I N LST1 LST2) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This simplifies, rewriting with NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-FIX-INT, and unfolding the functions IDIFFERENCE, NEGP,
NEGATIVE-GUTS, IZEROP, INEG, IPLUS, and STRNCMP1, to 16 new goals:
Case 1.16.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (GET-NTH I LST2) 0)
(NOT (LESSP 0
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE 0
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, expanding NEGATIVE-GUTS, EQUAL, LESSP, and
DIFFERENCE, to the goal:
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (NEGATIVE-GUTS (GET-NTH I LST1))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, expanding NEGATIVE-GUTS and EQUAL, to:
T.
Case 1.15.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with DIFFERENCE=0, and expanding the
function NEGATIVE-GUTS, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST2))))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (EQUAL (NEGATIVE-GUTS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP (NEGATIVE-GUTS (GET-NTH I LST1))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, obviously, to:
T.
Case 1.14.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-LST-OF-CHRP and
NEGATIVE-GUTS-MINUS, and unfolding the function NEGATIVE-GUTS, to:
T.
Case 1.13.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NEGATIVEP (GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1) (MINUS 0)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(NOT (LESSP (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1))))
(EQUAL (DIFFERENCE (MINUS (GET-NTH I LST2))
(NEGATIVE-GUTS (GET-NTH I LST1)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, and unfolding the functions NEGATIVE-GUTS and EQUAL, to:
T.
Case 1.12.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1) 0))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying the lemma GET-LST-OF-CHRP, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(EQUAL (GET-NTH I LST2) 0)
(EQUAL (PLUS (GET-NTH I LST1) 0) 0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with NUMBERP-INTEGERP, GET-LST-OF-CHRP,
and INTEGERP-MINUS0, and unfolding EQUAL, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-LST-OF-CHRP, PLUS-EQUAL-0, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the definitions of
NEGATIVE-GUTS, EQUAL, NULL, NOT, ZEROP, FIX, and STRLEN, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NEGATIVEP (GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST2) (MINUS 0)))
(EQUAL (PLUS (GET-NTH I LST1)
(NEGATIVE-GUTS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, and opening up the function NEGATIVE-GUTS, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-LST-OF-CHRP and
NEGATIVE-GUTS-MINUS, and unfolding NEGATIVE-GUTS, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, and expanding the function EQUAL, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
But this again simplifies, rewriting with the lemmas NUMBERP-INTEGERP,
GET-LST-OF-CHRP, and INTEGERP-MINUS0, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0))
(EQUAL (PLUS (GET-NTH I LST1)
(MINUS (GET-NTH I LST2)))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, clearly, to:
T.
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
However this again simplifies, applying GET-LST-OF-CHRP,
NEGATIVE-GUTS-MINUS, and DIFFERENCE=0, and opening up NEGATIVE-GUTS, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, using linear arithmetic, to three new formulas:
Case 1.4.3.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST2)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))),
which again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 1.4.2.
(IMPLIES (AND (NOT (NUMBERP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (LESSP (GET-NTH I LST2)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, rewriting with GET-LST-OF-CHRP, to:
T.
Case 1.4.1.
(IMPLIES (AND (NUMBERP (GET-NTH I LST1))
(NUMBERP (GET-NTH I LST2))
(EQUAL (GET-NTH I LST2)
(GET-NTH I LST1))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST1)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP (GET-NTH I LST1)
(GET-NTH I LST1)))
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (NEGATIVEP (GET-NTH I LST1)))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, clearly, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(NOT (NEGATIVEP (GET-NTH I LST2)))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, applying NUMBERP-INTEGERP, GET-LST-OF-CHRP, and
INTEGERP-MINUS0, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (GET-NTH I LST1) (MINUS 0))
(NOT (EQUAL (GET-NTH I LST2) 0))
(EQUAL (GET-NTH I LST2) (MINUS 0))
(NOT (EQUAL (MINUS (GET-NTH I LST2))
(MINUS 0)))
(NOT (LESSP (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2)))))
(EQUAL (DIFFERENCE (GET-NTH I LST1)
(NEGATIVE-GUTS (MINUS (GET-NTH I LST2))))
0)
(NOT (LESSP J I))
(LESSP J (STRLEN I (PLUS I N) LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2))).
This again simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 1.3 0.2 ]
STRNCMP1-THM1
(PROVE-LEMMA STRNCMP-THM1 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(EQUAL (STRNCMP N LST1 LST2) 0)
(LESSP J (STRLEN 0 N LST1)))
(EQUAL (GET-NTH J LST1)
(GET-NTH J LST2)))
((USE (STRNCMP1-THM1 (I 0)))))
This conjecture simplifies, applying PLUS-0 and STRLEN-II, and expanding the
functions EQUAL, LESSP, AND, IMPLIES, STRNCMP, and STRLEN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP-THM1
(DEFN STRNCMP-J
(I N LST1 LST2)
(IF (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(IF (EQUAL (GET-NTH I LST1) 0)
(FIX I)
(IF (EQUAL (SUB1 N) 0)
(FIX I)
(STRNCMP-J (ADD1 I)
(SUB1 N)
LST1 LST2)))
(FIX I)))
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 can be used to
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each recursive call. Hence, STRNCMP-J is accepted under the
definitional principle. Note that (NUMBERP (STRNCMP-J I N LST1 LST2)) is a
theorem.
[ 0.0 0.0 0.0 ]
STRNCMP-J
(DEFN-SK STRNCMP-SK
(N LST1 LST2)
(EXISTS J
(AND (FORALL I
(IMPLIES (LESSP I J)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))))
(EQUAL (STRNCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))))
Adding the Skolem axiom:
(AND
(IMPLIES (AND (IMPLIES (LESSP (I-2 J LST1 LST2) J)
(EQUAL (GET-NTH (I-2 J LST1 LST2) LST1)
(GET-NTH (I-2 J LST1 LST2) LST2)))
(EQUAL (STRNCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH J LST1)
(GET-NTH J LST2))))
(STRNCMP-SK N LST1 LST2))
(IMPLIES
(NOT (AND (IMPLIES (LESSP I (J-2 LST1 LST2 N))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(EQUAL (STRNCMP N LST1 LST2)
(IDIFFERENCE (GET-NTH (J-2 LST1 LST2 N) LST1)
(GET-NTH (J-2 LST1 LST2 N) LST2)))))
(NOT (STRNCMP-SK N LST1 LST2)))).
As this is a DEFN-SK we can conclude that:
(OR (TRUEP (STRNCMP-SK N LST1 LST2))
(FALSEP (STRNCMP-SK N LST1 LST2)))
is a theorem.
[ 0.0 0.0 0.0 ]
STRNCMP-SK
(PROVE-LEMMA STRNCMP-J-1
(REWRITE)
(IMPLIES (AND (LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(LEQ I1 I))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
((ENABLE GET-NTH-0)))
WARNING: Note that STRNCMP-J-1 contains the free variables LST2, N1, and I1
which will be chosen by instantiating the hypothesis:
(LESSP I (STRNCMP-J I1 N1 LST1 LST2)).
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0))
(p I LST1 LST2 I1 N1))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (SUB1 N1) 0))
(p I LST1 LST2 I1 N1))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(p I LST1 LST2 (ADD1 I1) (SUB1 N1)))
(p I LST1 LST2 I1 N1))
(IMPLIES (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(p I LST1 LST2 I1 N1))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 inform us that the measure
(COUNT N1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. Note, however, the inductive instance chosen
for I1. The above induction scheme produces five new formulas:
Case 5. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, unfolding STRNCMP-J, EQUAL, and LESSP, to:
(IMPLIES (AND (EQUAL 0 (GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (SUB1 N1) 0)
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, appealing to the lemmas SUB1-OF-1 and SUB1-NNUMBERP, and
opening up the functions EQUAL, SUB1, STRNCMP-J, and LESSP, to three new
goals:
Case 4.3.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL N1 0)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.2.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (NUMBERP N1))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL N1 1)
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(NOT (LESSP I
(STRNCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)))
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which simplifies, rewriting with SUB1-OF-1, and unfolding STRNCMP-J, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP I1))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This again simplifies, applying the lemmas GET-NTH-0, SUB1-OF-1,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and expanding the definitions of
STRNCMP-J, EQUAL, and LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I1))
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, applying SUB1-OF-1 and GET-NTH-0, and unfolding
the definitions of LESSP and STRNCMP-J, to the following two new goals:
Case 2.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL N1 1))
(NOT (EQUAL (STRNCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0))
(EQUAL I1 0))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
This again simplifies, obviously, to:
T.
Case 2.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL N1 1))
(NOT (EQUAL (STRNCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0))
(NOT (NUMBERP I1)))
(EQUAL (GET-NTH 0 LST1)
(GET-NTH 0 LST2))).
But this again simplifies, rewriting with the lemma GET-NTH-0, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP I1)
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(LESSP I (ADD1 I))
(LESSP I (STRNCMP-J I N1 LST1 LST2))
(NOT (LESSP I I)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(LESSP I (STRNCMP-J I1 N1 LST1 LST2))
(NOT (LESSP I I1)))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))).
This simplifies, unfolding STRNCMP-J and LESSP, to:
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (NUMBERP I1))
(LESSP I 0))
(EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRNCMP-J-1
(PROVE-LEMMA STRNCMP-J-2
(REWRITE)
(IMPLIES (NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2))))
((ENABLE GET-NTH-0)))
Give the conjecture the name *1.
We will try to prove it by induction. Four 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 (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0))
(p I1 N1 LST1 LST2))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (SUB1 N1) 0))
(p I1 N1 LST1 LST2))
(IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(p (ADD1 I1) (SUB1 N1) LST1 LST2))
(p I1 N1 LST1 LST2))
(IMPLIES (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(p I1 N1 LST1 LST2))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 establish that the measure
(COUNT N1) decreases according to the well-founded relation LESSP in each
induction step of the scheme. Note, however, the inductive instance chosen
for I1. The above induction scheme leads to five new goals:
Case 5. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, unfolding the definitions of STRNCMP1 and EQUAL, to:
T.
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (SUB1 N1) 0)
(NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2)))),
which simplifies, rewriting with SUB1-OF-1 and SUB1-NNUMBERP, and unfolding
the definitions of EQUAL, SUB1, and STRNCMP1, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(EQUAL (STRNCMP1 (ADD1 I1)
(SUB1 N1)
LST1 LST2)
0)
(NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, rewriting with the lemma SUB1-OF-1, and expanding the
definitions of STRNCMP1 and EQUAL, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (EQUAL (SUB1 N1) 0))
(EQUAL (STRNCMP1 (ADD1 I1)
(SUB1 N1)
LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J (ADD1 I1)
(SUB1 N1)
LST1 LST2)
LST2)))
(NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, appealing to the lemma SUB1-OF-1, and unfolding STRNCMP1
and STRNCMP-J, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(NOT (EQUAL (STRNCMP1 I1 N1 LST1 LST2) 0)))
(EQUAL (STRNCMP1 I1 N1 LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J I1 N1 LST1 LST2)
LST2)))).
This simplifies, applying IDIFFERENCE-EQUAL-0, and unfolding the functions
STRNCMP1, FIX-INT, and STRNCMP-J, to three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(NOT (EQUAL 0 (GET-NTH I1 LST2)))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, rewriting with GET-NTH-0, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST1))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))).
But this again simplifies, appealing to the lemma GET-NTH-0, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I1 LST2)))
(INTEGERP (GET-NTH I1 LST2))
(INTEGERP (GET-NTH I1 LST1))
(NOT (NUMBERP I1)))
(EQUAL (IDIFFERENCE (GET-NTH I1 LST1)
(GET-NTH I1 LST2))
(IDIFFERENCE (GET-NTH 0 LST1)
(GET-NTH 0 LST2)))),
which again simplifies, applying GET-NTH-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRNCMP-J-2
(PROVE-LEMMA STRNCMP-THM2 NIL
(IMPLIES (NOT (EQUAL (STRNCMP N LST1 LST2) 0))
(STRNCMP-SK N LST1 LST2))
((USE (STRNCMP-SK (J (STRNCMP-J 0 N LST1 LST2))))))
This formula simplifies, applying the lemma IDIFFERENCE-EQUAL-0, and opening
up the definitions of IMPLIES, STRNCMP, AND, NOT, EQUAL, and FIX-INT, to the
following two new conjectures:
Case 2. (IMPLIES (AND (LESSP (I-2 (STRNCMP-J 0 N LST1 LST2)
LST1 LST2)
(STRNCMP-J 0 N LST1 LST2))
(NOT (EQUAL (GET-NTH (I-2 (STRNCMP-J 0 N LST1 LST2)
LST1 LST2)
LST1)
(GET-NTH (I-2 (STRNCMP-J 0 N LST1 LST2)
LST1 LST2)
LST2)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (STRNCMP1 0 N LST1 LST2) 0)))
(STRNCMP-SK N LST1 LST2)).
This again simplifies, using linear arithmetic and rewriting with
STRNCMP-J-1, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (STRNCMP1 0 N LST1 LST2)
(IDIFFERENCE (GET-NTH (STRNCMP-J 0 N LST1 LST2)
LST1)
(GET-NTH (STRNCMP-J 0 N LST1 LST2)
LST2))))
(NOT (EQUAL (STRNCMP1 0 N LST1 LST2) 0)))
(STRNCMP-SK N LST1 LST2)).
This again simplifies, applying STRNCMP-J-2, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRNCMP-THM2
(DISABLE STRNCMP-J-1)
[ 0.0 0.0 0.0 ]
STRNCMP-J-1-OFF
(DISABLE STRNCMP-J-2)
[ 0.0 0.0 0.0 ]
STRNCMP-J-2-OFF
(PROVE-LEMMA STRPBRK-THM1
(REWRITE)
(LET ((J (STRPBRK I1 N1 LST1 N2 LST2)))
(IMPLIES J
(STRCHR1 0 N2 LST2
(GET-NTH J LST1)))))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 (ADD1 I1) N1 LST1))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 I1 N1 LST1))).
Linear arithmetic can be used to establish that the measure (DIFFERENCE N1 I1)
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 (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0)
(STRPBRK I1 N1 LST1 N2 LST2))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, unfolding the functions STRPBRK and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(STRPBRK I1 N1 LST1 N2 LST2))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, opening up STRPBRK, to the conjecture:
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (NUMBERP I1)))
(STRCHR1 0 N2 LST2 (GET-NTH 0 LST1))).
But this again simplifies, applying GET-NTH-0, and unfolding LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRPBRK (ADD1 I1) N1 LST1 N2 LST2))
(STRPBRK I1 N1 LST1 N2 LST2))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK I1 N1 LST1 N2 LST2)
LST1))).
This simplifies, unfolding the function STRPBRK, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK (ADD1 I1) N1 LST1 N2 LST2)
LST1))
(STRPBRK I1 N1 LST1 N2 LST2))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK I1 N1 LST1 N2 LST2)
LST1))).
This simplifies, opening up the definition of STRPBRK, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(STRPBRK I1 N1 LST1 N2 LST2))
(STRCHR1 0 N2 LST2
(GET-NTH (STRPBRK I1 N1 LST1 N2 LST2)
LST1))).
This simplifies, opening up the function STRPBRK, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRPBRK-THM1
(PROVE-LEMMA STRPBRK-THM2 NIL
(IMPLIES (AND (LEQ I1 J)
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))))
Name the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic informs us that the measure (DIFFERENCE N1 I1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme leads to five new formulas:
Case 5. (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, unfolding the functions STRPBRK, EQUAL, NUMBERP, and LESSP,
to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, expanding STRPBRK, to the goal:
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
This again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, using linear arithmetic, to three new formulas:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which again simplifies, rewriting with GET-NTH-0, and unfolding the
functions LESSP and STRPBRK, to the new goal:
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(EQUAL I1 0)
(NOT (EQUAL (STRPBRK 0 N1 LST1 N2 LST2) 0))
(NUMBERP (STRPBRK 0 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH 0 LST1)))),
which again simplifies, obviously, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
But this again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
and LESSP-OF-1, and unfolding the functions LESSP, STRPBRK, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP I1 (ADD1 I1))
(NOT (LESSP I1 I1))
(LESSP I1
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH I1 LST1)))).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J
(STRPBRK (ADD1 I1) N1 LST1 N2 LST2)))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
This simplifies, unfolding STRPBRK, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (LESSP J I1))
(LESSP J
(STRPBRK I1 N1 LST1 N2 LST2)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
This simplifies, expanding the functions STRPBRK, NUMBERP, EQUAL, and LESSP,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRPBRK-THM2
(PROVE-LEMMA STRPBRK-THM3 NIL
(IMPLIES (AND (NOT (STRPBRK I1 N1 LST1 N2 LST2))
(LEQ I1 J)
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))))
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N1 I1)
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 (LESSP I1 N1)
(EQUAL (GET-NTH I1 LST1) 0)
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, opening up the definitions of STRPBRK, EQUAL, STRLEN, and
NULL, to:
T.
Case 5. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, unfolding STRPBRK, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(STRPBRK (ADD1 I1) N1 LST1 N2 LST2)
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, expanding STRPBRK, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which simplifies, using linear arithmetic, to three new conjectures:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))),
which again simplifies, applying GET-NTH-0, and opening up the functions
LESSP, STRPBRK, STRLEN, and NULL, to the following two new formulas:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRPBRK (ADD1 I1) N1 LST1 N2 LST2))
(EQUAL I1 0)
(NOT (EQUAL (STRLEN 0 N1 LST1) 0)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH 0 LST1)))).
This again simplifies, obviously, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRPBRK (ADD1 I1) N1 LST1 N2 LST2))
(NOT (NUMBERP I1))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN (ADD1 I1) N1 LST1) 0)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH 0 LST1)))).
This again simplifies, applying GET-NTH-0, and expanding the function
LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
But this again simplifies, rewriting with the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and opening up the definitions of
LESSP, STRPBRK, STRLEN, NULL, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP I1 (ADD1 I1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP I1 I1))
(LESSP I1 (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH I1 LST1)))),
which again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J (STRLEN (ADD1 I1) N1 LST1)))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
This simplifies, opening up STRPBRK, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (STRPBRK I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1)))).
This simplifies, opening up the functions STRPBRK and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRPBRK-THM3
(PROVE-LEMMA STRCHR1-THM1
(REWRITE)
(IMPLIES (STRCHR1 I N LST CH)
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p I N LST CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST) CH))
(p I N LST CH))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST) CH))
(p (ADD1 I) N LST CH))
(p I N LST CH))
(IMPLIES (NOT (LESSP I N))
(p I N LST CH))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) 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
conjectures:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(STRCHR1 I N LST CH))
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)).
This simplifies, opening up STRCHR1 and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST) CH)
(STRCHR1 I N LST CH))
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)).
This simplifies, unfolding the definition of STRCHR1, to the new conjecture:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (NUMBERP I)))
(EQUAL (GET-NTH 0 LST)
(GET-NTH I LST))),
which again simplifies, rewriting with GET-NTH-0, and expanding the function
LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST) CH))
(NOT (STRCHR1 (ADD1 I) N LST CH))
(STRCHR1 I N LST CH))
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)).
This simplifies, unfolding STRCHR1, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST) CH))
(EQUAL (GET-NTH (STRCHR1 (ADD1 I) N LST CH)
LST)
CH)
(STRCHR1 I N LST CH))
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)).
This simplifies, opening up the function STRCHR1, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(STRCHR1 I N LST CH))
(EQUAL (GET-NTH (STRCHR1 I N LST CH) LST)
CH)).
This simplifies, unfolding the function STRCHR1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCHR1-THM1
(PROVE-LEMMA STRCHR1-THM2 NIL
(IMPLIES (AND (LEQ I J)
(LESSP J (STRCHR1 I N LST CH)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Name the conjecture *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J (ADD1 I) N LST))
(p J I N LST))
(IMPLIES (NOT (LESSP I N))
(p J I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates the following five new
conjectures:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definitions of STRCHR1, EQUAL, NUMBERP, and
LESSP, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definition of STRCHR1, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I))
(NOT (NUMBERP I)))
(NOT (LESSP J 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which again simplifies, applying GET-NTH-0, and opening up the functions
LESSP, NUMBERP, EQUAL, and STRCHR1, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, and
LESSP-OF-1, and opening up LESSP, STRCHR1, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(LESSP I (ADD1 I))
(NOT (LESSP I I)))
(NOT (LESSP I
(STRCHR1 I N LST (GET-NTH I LST))))).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (LESSP J
(STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST))))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, unfolding the definition of STRCHR1, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, opening up STRCHR1, NUMBERP, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCHR1-THM2
(PROVE-LEMMA STRCHR1-THM3 NIL
(IMPLIES (AND (NOT (STRCHR1 I N LST CH))
(LEQ I J)
(LESSP J (STRLEN I N LST)))
(NOT (EQUAL (GET-NTH J LST) CH))))
Give the conjecture the name *1.
We will try to prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J (ADD1 I) N LST))
(p J I N LST))
(IMPLIES (NOT (LESSP I N))
(p J I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, unfolding the definitions of STRCHR1, EQUAL, STRLEN, and
NULL, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, unfolding STRCHR1, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, expanding the function STRCHR1, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which simplifies, using linear arithmetic, to three new goals:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))),
which again simplifies, rewriting with the lemma GET-NTH-0, and unfolding
LESSP, STRLEN, and NULL, to two new conjectures:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (STRCHR1 I N LST (GET-NTH 0 LST)))
(EQUAL I 0))
(EQUAL (STRLEN 0 N LST) 0)),
which again simplifies, trivially, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH 0 LST)))
(NOT (STRCHR1 I N LST (GET-NTH 0 LST)))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0)))
(EQUAL (STRLEN (ADD1 I) N LST) 0)).
But this again simplifies, rewriting with GET-NTH-0, and expanding the
function LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
But this again simplifies, applying the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and expanding the functions LESSP
and STRCHR1, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(LESSP I (ADD1 I))
(NOT (STRCHR1 I N LST (GET-NTH I LST)))
(NOT (LESSP I I)))
(NOT (LESSP I (STRLEN I N LST)))),
which again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRCHR1, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J (STRLEN I N LST)))).
This simplifies, unfolding the definitions of STRCHR1 and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCHR1-THM3
(PROVE-LEMMA STRCSPN-THM1
(REWRITE)
(LET ((J (STRCSPN I1 N1 LST1 N2 LST2)))
(IMPLIES J
(STRCHR 0 N2 LST2 (GET-NTH J LST1)))))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 (ADD1 I1) N1 LST1))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 I1 N1 LST1))).
Linear arithmetic can be used to establish that the measure (DIFFERENCE N1 I1)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme leads to four new goals:
Case 4. (IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1))
(STRCSPN I1 N1 LST1 N2 LST2))
(STRCHR 0 N2 LST2
(GET-NTH (STRCSPN I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, unfolding the function STRCSPN, to:
(IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (NUMBERP I1)))
(STRCHR 0 N2 LST2 (GET-NTH 0 LST1))).
But this again simplifies, rewriting with the lemma GET-NTH-0, and expanding
LESSP, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRCSPN (ADD1 I1) N1 LST1 N2 LST2))
(STRCSPN I1 N1 LST1 N2 LST2))
(STRCHR 0 N2 LST2
(GET-NTH (STRCSPN I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, expanding STRCSPN, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(STRCHR 0 N2 LST2
(GET-NTH (STRCSPN (ADD1 I1) N1 LST1 N2 LST2)
LST1))
(STRCSPN I1 N1 LST1 N2 LST2))
(STRCHR 0 N2 LST2
(GET-NTH (STRCSPN I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, unfolding STRCSPN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(STRCSPN I1 N1 LST1 N2 LST2))
(STRCHR 0 N2 LST2
(GET-NTH (STRCSPN I1 N1 LST1 N2 LST2)
LST1))),
which simplifies, expanding the function STRCSPN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRCSPN-THM1
(PROVE-LEMMA STRCSPN-THM2 NIL
(IMPLIES (AND (LEQ I1 J)
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))))
Name the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic informs us that the measure (DIFFERENCE N1 I1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme leads to four new formulas:
Case 4. (IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which simplifies, unfolding the function STRCSPN, to:
(IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which simplifies, using linear arithmetic, to three new formulas:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which again simplifies, rewriting with the lemma GET-NTH-0, and expanding
LESSP and STRCSPN, to:
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(EQUAL I1 0)
(NOT (EQUAL (STRCSPN 0 N1 LST1 N2 LST2) 0))
(NUMBERP (STRCSPN 0 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH 0 LST1)))).
This again simplifies, trivially, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, and
LESSP-OF-1, and opening up LESSP, STRCSPN, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP I1 (ADD1 I1))
(NOT (LESSP I1 I1))
(LESSP I1
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2
(GET-NTH I1 LST1)))).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J
(STRCSPN (ADD1 I1) N1 LST1 N2 LST2)))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This simplifies, expanding the definition of STRCSPN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (LESSP J I1))
(LESSP J
(STRCSPN I1 N1 LST1 N2 LST2)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This simplifies, unfolding STRCSPN, NUMBERP, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCSPN-THM2
(PROVE-LEMMA STRCSPN-THM3 NIL
(IMPLIES (AND (NOT (STRCSPN I1 N1 LST1 N2 LST2))
(LEQ I1 J)
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))))
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N1 I1)
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 (LESSP I1 N1)
(STRCHR 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which simplifies, opening up the definition of STRCSPN, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(STRCSPN (ADD1 I1) N1 LST1 N2 LST2)
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which simplifies, unfolding STRCSPN, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which simplifies, using linear arithmetic, to three new formulas:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))),
which again simplifies, applying GET-NTH-0, and expanding the definitions
of LESSP, STRCSPN, STRLEN, and NULL, to the following two new conjectures:
Case 3.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRCSPN (ADD1 I1) N1 LST1 N2 LST2))
(EQUAL I1 0)
(NOT (EQUAL (STRLEN 0 N1 LST1) 0)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH 0 LST1)))).
This again simplifies, obviously, to:
T.
Case 3.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRCSPN (ADD1 I1) N1 LST1 N2 LST2))
(NOT (NUMBERP I1))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN (ADD1 I1) N1 LST1) 0)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH 0 LST1)))).
This again simplifies, rewriting with GET-NTH-0, and expanding the
definition of LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP J (ADD1 I1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This again simplifies, appealing to the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and opening up the definitions of
LESSP, STRCSPN, STRLEN, NULL, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(LESSP I1 (ADD1 I1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP I1 I1))
(LESSP I1 (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2
(GET-NTH I1 LST1)))),
which again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J (STRLEN (ADD1 I1) N1 LST1)))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This simplifies, expanding STRCSPN, STRLEN, and NULL, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (STRCSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(NOT (STRCHR 0 N2 LST2 (GET-NTH J LST1)))).
This simplifies, opening up STRCSPN and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCSPN-THM3
(PROVE-LEMMA STRSPN-THM1
(REWRITE)
(LET ((J (STRSPN I1 N1 LST1 N2 LST2)))
(IMPLIES J
(NOT (STRCHR1 0 N2 LST2
(GET-NTH J LST1))))))
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(p N2 LST2 (ADD1 I1) N1 LST1))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2
(GET-NTH I1 LST1))))
(p N2 LST2 I1 N1 LST1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 I1 N1 LST1))).
Linear arithmetic informs us that the measure (DIFFERENCE N1 I1) 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 formulas:
Case 4. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRSPN (ADD1 I1) N1 LST1 N2 LST2))
(STRSPN I1 N1 LST1 N2 LST2))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH (STRSPN I1 N1 LST1 N2 LST2)
LST1)))).
This simplifies, opening up the definition of STRSPN, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH (STRSPN (ADD1 I1) N1 LST1 N2 LST2)
LST1)))
(STRSPN I1 N1 LST1 N2 LST2))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH (STRSPN I1 N1 LST1 N2 LST2)
LST1)))).
This simplifies, expanding STRSPN, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(STRSPN I1 N1 LST1 N2 LST2))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH (STRSPN I1 N1 LST1 N2 LST2)
LST1)))).
This simplifies, unfolding STRSPN, to:
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (NUMBERP I1)))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH 0 LST1)))),
which again simplifies, applying the lemma GET-NTH-0, and opening up LESSP,
to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(STRSPN I1 N1 LST1 N2 LST2))
(NOT (STRCHR1 0 N2 LST2
(GET-NTH (STRSPN I1 N1 LST1 N2 LST2)
LST1)))),
which simplifies, unfolding the function STRSPN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRSPN-THM1
(PROVE-LEMMA STRSPN-THM2 NIL
(IMPLIES (AND (LEQ I1 J)
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))))
Name the conjecture *1.
Let us appeal to the induction principle. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2
(GET-NTH I1 LST1))))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic can be used to prove that the measure (DIFFERENCE N1 I1)
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
goals:
Case 4. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
However this again simplifies, rewriting with GET-NTH-0, and opening up
the functions LESSP and STRSPN, to:
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(EQUAL I1 0)
(NOT (EQUAL (STRSPN 0 N1 LST1 N2 LST2) 0))
(NUMBERP (STRSPN 0 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH 0 LST1))),
which again simplifies, trivially, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
However this again simplifies, rewriting with the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and expanding the functions LESSP,
STRSPN, and EQUAL, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP I1 (ADD1 I1))
(NOT (LESSP I1 I1))
(LESSP I1
(STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2
(GET-NTH I1 LST1))),
which again simplifies, clearly, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J
(STRSPN (ADD1 I1) N1 LST1 N2 LST2)))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, expanding the function STRSPN, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, unfolding the definition of STRSPN, to the new conjecture:
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (LESSP J I1))
(NOT (NUMBERP I1))
(LESSP J 0))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (LESSP J I1))
(LESSP J (STRSPN I1 N1 LST1 N2 LST2)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))),
which simplifies, expanding the functions STRSPN, NUMBERP, EQUAL, and LESSP,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRSPN-THM2
(PROVE-LEMMA STRSPN-THM3 NIL
(IMPLIES (AND (NOT (STRSPN I1 N1 LST1 N2 LST2))
(LEQ I1 J)
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(p N2 LST2 J LST1 (ADD1 I1) N1))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2
(GET-NTH I1 LST1))))
(p N2 LST2 J LST1 I1 N1))
(IMPLIES (NOT (LESSP I1 N1))
(p N2 LST2 J LST1 I1 N1))).
Linear arithmetic establishes that the measure (DIFFERENCE N1 I1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces the following five new formulas:
Case 5. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(STRSPN (ADD1 I1) N1 LST1 N2 LST2)
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, expanding the definition of STRSPN, to:
T.
Case 4. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
But this again simplifies, appealing to the lemma GET-NTH-0, and unfolding
LESSP, STRSPN, STRLEN, and NULL, to two new formulas:
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRSPN (ADD1 I1) N1 LST1 N2 LST2))
(EQUAL I1 0)
(NOT (EQUAL (STRLEN 0 N1 LST1) 0)))
(STRCHR1 0 N2 LST2 (GET-NTH 0 LST1))),
which again simplifies, trivially, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (STRSPN (ADD1 I1) N1 LST1 N2 LST2))
(NOT (NUMBERP I1))
(NOT (EQUAL N1 0))
(NUMBERP N1)
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (EQUAL (STRLEN (ADD1 I1) N1 LST1) 0)))
(STRCHR1 0 N2 LST2 (GET-NTH 0 LST1))).
However this again simplifies, rewriting with GET-NTH-0, and expanding
the definition of LESSP, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I1))
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP J (ADD1 I1))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
But this again simplifies, rewriting with GET-NTH-0, SUB1-TYPE-RESTRICTION,
and LESSP-OF-1, and expanding LESSP, STRSPN, STRLEN, NULL, and EQUAL, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I1)
(NUMBERP J)
(LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(LESSP I1 (ADD1 I1))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP I1 I1))
(LESSP I1 (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2
(GET-NTH I1 LST1))).
This again simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (LESSP I1 N1)
(STRCHR1 0 N2 LST2 (GET-NTH I1 LST1))
(NOT (LESSP J (STRLEN (ADD1 I1) N1 LST1)))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, expanding the functions STRSPN, STRLEN, and NULL, to:
T.
Case 2. (IMPLIES (AND (LESSP I1 N1)
(NOT (STRCHR1 0 N2 LST2 (GET-NTH I1 LST1)))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, unfolding the function STRSPN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I1 N1))
(NOT (STRSPN I1 N1 LST1 N2 LST2))
(NOT (LESSP J I1))
(LESSP J (STRLEN I1 N1 LST1)))
(STRCHR1 0 N2 LST2 (GET-NTH J LST1))).
This simplifies, expanding STRSPN and STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRSPN-THM3
(DEFN STRNCMP2
(I N LST1 J LST2)
(IF (ZEROP N)
0
(IF (EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))
(IF (EQUAL (GET-NTH I LST1) 0)
0
(STRNCMP2 (ADD1 I)
(SUB1 N)
LST1
(ADD1 J)
LST2))
(IDIFFERENCE (GET-NTH I LST1)
(GET-NTH J LST2)))))
The lemmas LESSP-SUB1 and 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, STRNCMP2 is accepted under the
principle of definition. From the definition we can conclude that:
(OR (NUMBERP (STRNCMP2 I N LST1 J LST2))
(NEGATIVEP (STRNCMP2 I N LST1 J LST2)))
is a theorem.
[ 0.0 0.0 0.0 ]
STRNCMP2
(PROVE-LEMMA STRNCMP2-NON-NUMBERP
(REWRITE)
(IMPLIES (NOT (NUMBERP I))
(EQUAL (STRNCMP2 I N LST1 J LST2)
(STRNCMP2 0 N LST1 J LST2))))
Call the conjecture *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 I N LST1 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))
(EQUAL (GET-NTH I LST1) 0))
(p I N LST1 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(p (ADD1 I)
(SUB1 N)
LST1
(ADD1 J)
LST2))
(p I N LST1 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))))
(p I N LST1 J LST2))).
The lemmas LESSP-SUB1 and 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
instances chosen for I and J. The above induction scheme produces four new
formulas:
Case 4. (IMPLIES (AND (ZEROP N) (NOT (NUMBERP I)))
(EQUAL (STRNCMP2 I N LST1 J LST2)
(STRNCMP2 0 N LST1 J LST2))),
which simplifies, opening up the definitions of ZEROP, EQUAL, and STRNCMP2,
to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))
(EQUAL (GET-NTH I LST1) 0)
(NOT (NUMBERP I)))
(EQUAL (STRNCMP2 I N LST1 J LST2)
(STRNCMP2 0 N LST1 J LST2))),
which simplifies, applying GET-NTH-0, and expanding the definitions of ZEROP,
STRNCMP2, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I LST1)
(GET-NTH J LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (NUMBERP I)))
(EQUAL (STRNCMP2 I N LST1 J LST2)
(STRNCMP2 0 N LST1 J LST2))).
This simplifies, rewriting with GET-NTH-0, and opening up ZEROP, STRNCMP2,
and ADD1, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (GET-NTH 0 LST1)
(GET-NTH J LST2))
(NOT (EQUAL (GET-NTH 0 LST1) 0))
(NOT (NUMBERP I)))
(EQUAL (STRNCMP2 (ADD1 I)
(SUB1 N)
LST1
(ADD1 J)
LST2)
(STRNCMP2 1
(SUB1 N)
LST1
(ADD1 J)
LST2))).
This further simplifies, rewriting with SUB1-TYPE-RESTRICTION, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I LST1)
(GET-NTH J LST2)))
(NOT (NUMBERP I)))
(EQUAL (STRNCMP2 I N LST1 J LST2)
(STRNCMP2 0 N LST1 J LST2))).
This simplifies, rewriting with GET-NTH-0, and opening up ZEROP and STRNCMP2,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP2-NON-NUMBERP
(PROVE-LEMMA STRNCMP2-0
(REWRITE)
(EQUAL (STRNCMP2 I 0 LST1 J LST2) 0))
This conjecture simplifies, expanding EQUAL and STRNCMP2, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP2-0
(PROVE-LEMMA STRNCMP1-STRNCMP2
(REWRITE)
(IMPLIES (NOT (ZEROP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))),
which we will 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 (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0))
(p I N LST1 LST2))
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (SUB1 N) 0))
(p I N LST1 LST2))
(IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL (SUB1 N) 0))
(p (ADD1 I) (SUB1 N) LST1 LST2))
(p I N LST1 LST2))
(IMPLIES (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(p I N LST1 LST2))).
The lemmas LESSP-SUB1, COUNT-NUMBERP, and SUB1-OF-1 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 I. The above induction scheme produces the following four new goals:
Case 4. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(EQUAL (GET-NTH I LST1) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))).
This simplifies, expanding the functions STRNCMP1, EQUAL, and STRNCMP2, to:
T.
Case 3. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))).
This simplifies, applying SUB1-OF-1 and STRNCMP2-0, and unfolding the
definitions of EQUAL, NUMBERP, SUB1, STRNCMP1, and STRNCMP2, to:
T.
Case 2. (IMPLIES (AND (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2))
(NOT (EQUAL (GET-NTH I LST1) 0))
(NOT (EQUAL (SUB1 N) 0))
(EQUAL (STRNCMP1 (ADD1 I) (SUB1 N) LST1 LST2)
(STRNCMP2 (ADD1 I)
(SUB1 N)
LST1
(ADD1 I)
LST2))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))),
which simplifies, applying SUB1-OF-1, and expanding STRNCMP1 and STRNCMP2,
to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (GET-NTH I LST1)
(GET-NTH I LST2)))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (STRNCMP1 I N LST1 LST2)
(STRNCMP2 I N LST1 I LST2))).
This simplifies, expanding the functions STRNCMP1 and STRNCMP2, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP1-STRNCMP2
(PROVE-LEMMA STRNCMP-STRNCMP2
(REWRITE)
(EQUAL (STRNCMP N LST1 LST2)
(STRNCMP2 0 N LST1 0 LST2)))
WARNING: Note that the rewrite rule STRNCMP-STRNCMP2 will be stored so as to
apply only to terms with the nonrecursive function symbol STRNCMP.
WARNING: the newly proposed lemma, STRNCMP-STRNCMP2, could be applied
whenever the previously added lemma STRNCMP-ID could.
This formula simplifies, appealing to the lemma STRNCMP1-STRNCMP2, and
expanding the function STRNCMP, to the following two new formulas:
Case 2. (IMPLIES (NOT (NUMBERP N))
(EQUAL 0 (STRNCMP2 0 N LST1 0 LST2))).
However this again simplifies, unfolding STRNCMP2 and EQUAL, to:
T.
Case 1. (IMPLIES (EQUAL N 0)
(EQUAL 0 (STRNCMP2 0 N LST1 0 LST2))),
which again simplifies, applying STRNCMP2-0, and unfolding the definition of
EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP-STRNCMP2
(PROVE-LEMMA STRNCMP2-MCDR-1
(REWRITE)
(EQUAL (STRNCMP2 I1 N (MCDR J LST1) I2 LST2)
(STRNCMP2 (PLUS I1 J) N LST1 I2 LST2))
((ENABLE PLUS-ADD1-1)))
Call the conjecture *1.
We will appeal to induction. There are four plausible inductions. They
merge into three likely candidate inductions. However, only one is unflawed.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N)
(p I1 N J LST1 I2 LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))
(EQUAL (GET-NTH I1 (MCDR J LST1)) 0))
(p I1 N J LST1 I2 LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))
(NOT (EQUAL (GET-NTH I1 (MCDR J LST1)) 0))
(p (ADD1 I1)
(SUB1 N)
J LST1
(ADD1 I2)
LST2))
(p I1 N J LST1 I2 LST2))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))))
(p I1 N J LST1 I2 LST2))).
The lemmas LESSP-SUB1 and 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 I1 and I2. The above induction
scheme generates four new formulas:
Case 4. (IMPLIES (ZEROP N)
(EQUAL (STRNCMP2 I1 N (MCDR J LST1) I2 LST2)
(STRNCMP2 (PLUS I1 J)
N LST1 I2 LST2))),
which simplifies, applying STRNCMP2-0, and expanding the functions ZEROP,
EQUAL, and STRNCMP2, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))
(EQUAL (GET-NTH I1 (MCDR J LST1)) 0))
(EQUAL (STRNCMP2 I1 N (MCDR J LST1) I2 LST2)
(STRNCMP2 (PLUS I1 J)
N LST1 I2 LST2))).
This simplifies, applying PLUS-COMMUTATIVITY and MCDR-NTH, and unfolding the
definitions of ZEROP, STRNCMP2, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))
(NOT (EQUAL (GET-NTH I1 (MCDR J LST1)) 0))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
(MCDR J LST1)
(ADD1 I2)
LST2)
(STRNCMP2 (PLUS (ADD1 I1) J)
(SUB1 N)
LST1
(ADD1 I2)
LST2)))
(EQUAL (STRNCMP2 I1 N (MCDR J LST1) I2 LST2)
(STRNCMP2 (PLUS I1 J)
N LST1 I2 LST2))),
which simplifies, applying PLUS-COMMUTATIVITY and MCDR-NTH, and expanding
ZEROP and STRNCMP2, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (GET-NTH (PLUS I1 J) LST1)
(GET-NTH I2 LST2))
(NOT (EQUAL (GET-NTH I2 LST2) 0))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
(MCDR J LST1)
(ADD1 I2)
LST2)
(STRNCMP2 (PLUS (ADD1 I1) J)
(SUB1 N)
LST1
(ADD1 I2)
LST2)))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
(MCDR J LST1)
(ADD1 I2)
LST2)
(STRNCMP2 (ADD1 (PLUS I1 J))
(SUB1 N)
LST1
(ADD1 I2)
LST2))),
which further simplifies, rewriting with the lemmas PLUS-COMMUTATIVITY and
PLUS-ADD1-1, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I1 (MCDR J LST1))
(GET-NTH I2 LST2))))
(EQUAL (STRNCMP2 I1 N (MCDR J LST1) I2 LST2)
(STRNCMP2 (PLUS I1 J)
N LST1 I2 LST2))),
which simplifies, applying the lemmas PLUS-COMMUTATIVITY and MCDR-NTH, and
opening up the definitions of ZEROP and STRNCMP2, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP2-MCDR-1
(PROVE-LEMMA STRNCMP2-MCDR-2
(REWRITE)
(EQUAL (STRNCMP2 I1 N LST1 I2 (MCDR J LST2))
(STRNCMP2 I1 N LST1 (PLUS I2 J) LST2))
((ENABLE PLUS-ADD1-1)))
Call the conjecture *1.
We will appeal to induction. There are four plausible inductions. They
merge into three likely candidate inductions. However, only one is unflawed.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N)
(p I1 N LST1 I2 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))
(EQUAL (GET-NTH I1 LST1) 0))
(p I1 N LST1 I2 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(p (ADD1 I1)
(SUB1 N)
LST1
(ADD1 I2)
J LST2))
(p I1 N LST1 I2 J LST2))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))))
(p I1 N LST1 I2 J LST2))).
The lemmas LESSP-SUB1 and 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 I1 and I2. The above induction
scheme generates four new formulas:
Case 4. (IMPLIES (ZEROP N)
(EQUAL (STRNCMP2 I1 N LST1 I2 (MCDR J LST2))
(STRNCMP2 I1 N LST1
(PLUS I2 J)
LST2))),
which simplifies, applying STRNCMP2-0, and expanding the functions ZEROP,
EQUAL, and STRNCMP2, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))
(EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (STRNCMP2 I1 N LST1 I2 (MCDR J LST2))
(STRNCMP2 I1 N LST1
(PLUS I2 J)
LST2))).
This simplifies, applying PLUS-COMMUTATIVITY and MCDR-NTH, and unfolding the
definitions of ZEROP, STRNCMP2, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(ADD1 I2)
(MCDR J LST2))
(STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(PLUS (ADD1 I2) J)
LST2)))
(EQUAL (STRNCMP2 I1 N LST1 I2 (MCDR J LST2))
(STRNCMP2 I1 N LST1
(PLUS I2 J)
LST2))),
which simplifies, applying PLUS-COMMUTATIVITY and MCDR-NTH, and expanding
ZEROP and STRNCMP2, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (GET-NTH I1 LST1)
(GET-NTH (PLUS I2 J) LST2))
(NOT (EQUAL (GET-NTH I1 LST1) 0))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(ADD1 I2)
(MCDR J LST2))
(STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(PLUS (ADD1 I2) J)
LST2)))
(EQUAL (STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(ADD1 I2)
(MCDR J LST2))
(STRNCMP2 (ADD1 I1)
(SUB1 N)
LST1
(ADD1 (PLUS I2 J))
LST2))),
which further simplifies, rewriting with the lemmas PLUS-COMMUTATIVITY and
PLUS-ADD1-1, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (EQUAL (GET-NTH I1 LST1)
(GET-NTH I2 (MCDR J LST2)))))
(EQUAL (STRNCMP2 I1 N LST1 I2 (MCDR J LST2))
(STRNCMP2 I1 N LST1
(PLUS I2 J)
LST2))),
which simplifies, applying the lemmas PLUS-COMMUTATIVITY and MCDR-NTH, and
opening up the definitions of ZEROP and STRNCMP2, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
STRNCMP2-MCDR-2
(PROVE-LEMMA STRLEN-CDR
(REWRITE)
(IMPLIES (NUMBERP I)
(EQUAL (STRLEN I (SUB1 N) (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))))
This conjecture simplifies, applying MCDR-NTH and PLUS-ADD1, and opening up
the definitions of NULL and STRLEN, to three new formulas:
Case 3. (IMPLIES (AND (NUMBERP I)
(EQUAL (GET-NTH (ADD1 I) LST) 0))
(EQUAL I
(SUB1 (STRLEN (ADD1 I) N LST)))),
which again simplifies, applying SUB1-ADD1, and opening up the definitions
of EQUAL, NULL, LESSP, and STRLEN, to:
T.
Case 2. (IMPLIES (AND (NUMBERP I)
(NOT (LESSP I (SUB1 N))))
(EQUAL I
(SUB1 (STRLEN (ADD1 I) N LST)))).
But this again simplifies, rewriting with SUB1-ADD1, and unfolding LESSP and
STRLEN, to:
T.
Case 1. (IMPLIES (AND (NUMBERP I)
(LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0)))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to eliminate
(SUB1 N). We rely upon the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. We must thus prove three new
conjectures:
Case 1.3.
(IMPLIES (AND (EQUAL N 0)
(NUMBERP I)
(LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0)))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))),
which further simplifies, opening up the functions SUB1, EQUAL, and LESSP,
to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NUMBERP I)
(LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0)))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))),
which further simplifies, applying SUB1-NNUMBERP, and unfolding the
definitions of EQUAL and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(NUMBERP I)
(LESSP I X)
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0)))
(EQUAL (STRLEN (ADD1 I) X (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) (ADD1 X) LST)))).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP I)
(LESSP I X)
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0)))
(EQUAL (STRLEN (ADD1 I) X (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) (ADD1 X) LST)))),
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 (NUMBERP I)
(EQUAL (STRLEN I (SUB1 N) (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))).
We named this *1. We will try to prove it by induction. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LESSP I (SUB1 N))
(EQUAL (GET-NTH I (MCDR 1 LST))
(NULL)))
(p I N LST))
(IMPLIES (AND (LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH I (MCDR 1 LST))
(NULL)))
(p (ADD1 I) N LST))
(p I N LST))
(IMPLIES (NOT (LESSP I (SUB1 N)))
(p I N LST))).
Linear arithmetic informs us that the measure (DIFFERENCE (SUB1 N) I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces three new formulas:
Case 3. (IMPLIES (AND (LESSP I (SUB1 N))
(EQUAL (GET-NTH I (MCDR 1 LST))
(NULL))
(NUMBERP I))
(EQUAL (STRLEN I (SUB1 N) (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))),
which simplifies, appealing to the lemmas PLUS-ADD1, MCDR-NTH, and SUB1-ADD1,
and unfolding the definitions of NULL, STRLEN, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH I (MCDR 1 LST))
(NULL)))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 (ADD1 I)) N LST)))
(NUMBERP I))
(EQUAL (STRLEN I (SUB1 N) (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))),
which simplifies, rewriting with PLUS-ADD1, MCDR-NTH, and SUB1-ADD1, and
opening up NULL, STRLEN, and LESSP, to the following two new conjectures:
Case 2.2.
(IMPLIES (AND (LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 (ADD1 I)) N LST)))
(NUMBERP I)
(NOT (NUMBERP N)))
(EQUAL (SUB1 (STRLEN (ADD1 (ADD1 I)) N LST))
(SUB1 (ADD1 I)))).
But this again simplifies, applying SUB1-NNUMBERP, and unfolding the
definitions of EQUAL and LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP I (SUB1 N))
(NOT (EQUAL (GET-NTH (ADD1 I) LST) 0))
(EQUAL (STRLEN (ADD1 I)
(SUB1 N)
(MCDR 1 LST))
(SUB1 (STRLEN (ADD1 (ADD1 I)) N LST)))
(NUMBERP I)
(EQUAL N 0))
(EQUAL (SUB1 (STRLEN (ADD1 (ADD1 I)) N LST))
(SUB1 (ADD1 I)))).
However this again simplifies, expanding SUB1, EQUAL, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I (SUB1 N)))
(NUMBERP I))
(EQUAL (STRLEN I (SUB1 N) (MCDR 1 LST))
(SUB1 (STRLEN (ADD1 I) N LST)))),
which simplifies, applying SUB1-ADD1, and expanding STRLEN and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
STRLEN-CDR
(PROVE-LEMMA STRLEN-MCDR
(REWRITE)
(IMPLIES (NUMBERP I)
(EQUAL (STRLEN I N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS I K) (PLUS K N) LST)
K)))
((ENABLE PLUS-ADD1-1)))
WARNING: the newly proposed lemma, STRLEN-MCDR, could be applied whenever the
previously added lemma STRLEN-CDR could.
Give the conjecture the name *1.
Let us appeal to the induction principle. There are five plausible
inductions. They merge into three likely candidate inductions, two of which
are unflawed. So we will choose the one suggested by the largest number of
nonprimitive recursive functions. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I (MCDR K LST))
(NULL)))
(p I N K LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (MCDR K LST))
(NULL)))
(p (ADD1 I) N K LST))
(p I N K LST))
(IMPLIES (NOT (LESSP I N))
(p I N K LST))).
Linear arithmetic informs us that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces three new goals:
Case 3. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I (MCDR K LST))
(NULL))
(NUMBERP I))
(EQUAL (STRLEN I N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS I K) (PLUS K N) LST)
K))),
which simplifies, rewriting with the lemmas PLUS-COMMUTATIVITY, MCDR-NTH,
PLUS-LESSP-CANCEL-2, and CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
unfolding the functions NULL, STRLEN, EQUAL, and FIX, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I (MCDR K LST))
(NULL)))
(EQUAL (STRLEN (ADD1 I) N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS (ADD1 I) K)
(PLUS K N)
LST)
K))
(NUMBERP I))
(EQUAL (STRLEN I N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS I K) (PLUS K N) LST)
K))),
which simplifies, appealing to the lemmas PLUS-COMMUTATIVITY, MCDR-NTH, and
PLUS-ADD1-1, and unfolding the definitions of NULL and STRLEN, to the
formula:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH (PLUS I K) LST) 0))
(EQUAL (STRLEN (ADD1 I) N (MCDR K LST))
(DIFFERENCE (STRLEN (ADD1 (PLUS I K))
(PLUS K N)
LST)
K))
(NUMBERP I))
(EQUAL (STRLEN (ADD1 I) N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS I K) (PLUS K N) LST)
K))).
However this again simplifies, applying the lemma PLUS-LESSP-CANCEL-2, and
unfolding the functions NULL and STRLEN, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N)) (NUMBERP I))
(EQUAL (STRLEN I N (MCDR K LST))
(DIFFERENCE (STRLEN (PLUS I K) (PLUS K N) LST)
K))),
which simplifies, rewriting with PLUS-LESSP-CANCEL-2 and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and expanding the functions STRLEN
and FIX, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRLEN-MCDR
(PROVE-LEMMA STRSTR1-THM1
(REWRITE)
(LET ((J (STRSTR1 I N1 LST1 N2 LST2 LEN)))
(IMPLIES (AND (NUMBERP J) (EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 J N LST1 0 LST2) 0)))
((DISABLE STRCHR1 STRNCMP MCDR)))
This simplifies, applying SUB1-ADD1, and unfolding the functions ADD1 and
STRNCMP2, to the following three new conjectures:
Case 3. (IMPLIES (AND (NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(NOT (EQUAL (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)
(GET-NTH 0 LST2))))
(EQUAL (IDIFFERENCE (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)
(GET-NTH 0 LST2))
0)).
This again simplifies, rewriting with IDIFFERENCE-EQUAL-0, and unfolding the
function FIX-INT, to the following three new goals:
Case 3.3.
(IMPLIES (AND (NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(NOT (EQUAL (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)
(GET-NTH 0 LST2)))
(INTEGERP (GET-NTH 0 LST2)))
(EQUAL 0 (GET-NTH 0 LST2))).
Give the above formula the name *1.
Case 3.2.
(IMPLIES (AND (NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(NOT (EQUAL (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)
(GET-NTH 0 LST2)))
(INTEGERP (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)))
(EQUAL (GET-NTH (STRSTR1 I N1 LST1 N2 LST2 LEN)
LST1)
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 (NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)),
which we named *1 above. We will appeal to induction. Three inductions are
suggested by terms in the conjecture. They merge into two likely candidate
inductions, both of which are unflawed. So we will choose the one suggested
by the largest number of nonprimitive recursive functions. We will induct
according to the following scheme:
(AND
(IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP LEN
(MCDR (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LST1)
(MCDR 1 LST2))
0))
(p I N1 LST1 N2 LST2 LEN N))
(IMPLIES
(AND
(LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(NOT (EQUAL (STRNCMP LEN
(MCDR (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LST1)
(MCDR 1 LST2))
0))
(p (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
N1 LST1 N2 LST2 LEN N))
(p I N1 LST1 N2 LST2 LEN N))
(IMPLIES (AND (LESSP I N1)
(NOT (NUMBERP (STRCHR1 I N1 LST1
(GET-NTH 0 LST2)))))
(p I N1 LST1 N2 LST2 LEN N))
(IMPLIES (NOT (LESSP I N1))
(p I N1 LST1 N2 LST2 LEN N))).
Linear arithmetic, the lemmas STRCHR1-BOUNDS, LESSP-OF-1, DIFFERENCE=0,
DIFFERENCE-0, SUB1-ADD1, and LESSP-SUB1, and the definitions of ADD1, STRCHR1,
LESSP, EQUAL, STRNCMP, and MCDR establish that the measure (DIFFERENCE N1 I)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces the following five new
conjectures:
Case 5. (IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP LEN
(MCDR (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LST1)
(MCDR 1 LST2))
0)
(NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)).
This simplifies, applying PLUS-0, STRNCMP2-MCDR-1, STRNCMP2-MCDR-2,
STRNCMP-STRNCMP2, SUB1-ADD1, and STRCHR1-THM1, and opening up the functions
PLUS, STRSTR1, EQUAL, ADD1, and STRNCMP2, to the conjecture:
(IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP2 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LEN LST1 1 LST2)
0)
(NOT (EQUAL (GET-NTH 0 LST2) 0))
(NOT (NUMBERP LEN)))
(EQUAL (STRNCMP2 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
0 LST1 1 LST2)
0)).
This again simplifies, applying STRNCMP2-0, and expanding the functions
STRNCMP2 and EQUAL, to:
T.
Case 4. (IMPLIES
(AND
(LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(NOT
(EQUAL (STRNCMP LEN
(MCDR (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LST1)
(MCDR 1 LST2))
0))
(NOT (NUMBERP (STRSTR1 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
N1 LST1 N2 LST2 LEN)))
(NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)).
This simplifies, applying PLUS-0, STRNCMP2-MCDR-1, STRNCMP2-MCDR-2, and
STRNCMP-STRNCMP2, and unfolding the functions PLUS, STRSTR1, and NUMBERP, to:
T.
Case 3. (IMPLIES
(AND
(LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(NOT
(EQUAL (STRNCMP LEN
(MCDR (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LST1)
(MCDR 1 LST2))
0))
(EQUAL (STRNCMP2 (STRSTR1 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)
(NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)),
which simplifies, appealing to the lemmas PLUS-0, STRNCMP2-MCDR-1,
STRNCMP2-MCDR-2, STRNCMP-STRNCMP2, SUB1-ADD1, SUB1-TYPE-RESTRICTION,
STRNCMP2-0, STRCHR1-THM1, and STRCHR1-FALSE-0, and expanding PLUS, ADD1,
STRNCMP2, STRSTR1, EQUAL, SUB1, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (LESSP I N1)
(NOT (NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2))))
(NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)),
which simplifies, unfolding STRSTR1 and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N1))
(NUMBERP (STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(EQUAL (STRNCMP2 (STRSTR1 I N1 LST1 N2 LST2 LEN)
N LST1 0 LST2)
0)),
which simplifies, opening up the definitions of STRSTR1 and NUMBERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRSTR1-THM1
(PROVE-LEMMA STRSTR-THM1
(REWRITE)
(LET ((J (STRSTR N1 LST1 N2 LST2)))
(IMPLIES (NUMBERP J)
(EQUAL (STRNCMP (STRLEN 0 N2 LST2)
(MCDR J LST1)
LST2)
0))))
WARNING: Note that the rewrite rule STRSTR-THM1 will be stored so as to apply
only to terms with the nonrecursive function symbol STRNCMP.
WARNING: the previously added lemma, STRNCMP-STRNCMP2, could be applied
whenever the newly proposed STRSTR-THM1 could!
This formula can be simplified, using the abbreviations IMPLIES,
STRNCMP2-MCDR-1, and STRNCMP-STRNCMP2, to:
(IMPLIES (NUMBERP (STRSTR N1 LST1 N2 LST2))
(EQUAL (STRNCMP2 (PLUS 0 (STRSTR N1 LST1 N2 LST2))
(STRLEN 0 N2 LST2)
LST1 0 LST2)
0)),
which simplifies, applying STRLEN-MCDR, DIFFERENCE-SUB1, PLUS-ADD1, ADD1-SUB1,
SUB1-ADD1, PLUS-0, STRNCMP2-0, STRNCMP2-MCDR-1, STRNCMP2-MCDR-2,
STRNCMP-STRNCMP2, STRLEN-II, and SUB1-NNUMBERP, and opening up the definitions
of PLUS, STRSTR, STRSTR1, EQUAL, LESSP, MCDR, DIFFERENCE, SUB1, STRLEN, and
NULL, to the following two new formulas:
Case 2. (IMPLIES (AND (NUMBERP N2)
(NOT (EQUAL N2 0))
(NUMBERP (STRSTR1 0 N1 LST1 N2 LST2
(SUB1 (STRLEN 1 N2 LST2))))
(NOT (EQUAL (GET-NTH 0 LST2) 0)))
(EQUAL (STRNCMP2 (STRSTR1 0 N1 LST1 N2 LST2
(SUB1 (STRLEN 1 N2 LST2)))
(STRLEN 0 N2 LST2)
LST1 0 LST2)
0)).
This again simplifies, rewriting with the lemmas ADD1-SUB1, STRLEN-01, and
STRSTR1-THM1, and expanding the definitions of ADD1, NULL, LESSP, EQUAL, and
STRLEN, to:
T.
Case 1. (IMPLIES (AND (NUMBERP N2)
(NOT (EQUAL N2 0))
(NUMBERP (STRSTR1 0 N1 LST1 N2 LST2
(SUB1 (STRLEN 1 N2 LST2))))
(EQUAL (GET-NTH 0 LST2) 0))
(EQUAL (STRNCMP2 0
(STRLEN 0 N2 LST2)
LST1 0 LST2)
0)),
which again simplifies, applying STRCHR1-FALSE-0, and expanding NUMBERP,
LESSP, EQUAL, and STRSTR1, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
STRSTR-THM1
(PROVE-LEMMA STRCHR1-NTH
(REWRITE)
(IMPLIES (AND (LEQ I J)
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))))
Give the conjecture the name *1.
We will try to prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST J))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST J))
(p I N LST J))
(IMPLIES (NOT (LESSP I N))
(p I N LST J))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces five new formulas:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which simplifies, unfolding NULL, STRLEN, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which simplifies, using linear arithmetic, to three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which again simplifies, appealing to the lemma GET-NTH-0, and opening up
the functions NULL, LESSP, NUMBERP, EQUAL, STRCHR1, and STRLEN, to three
new goals:
Case 4.3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NOT (EQUAL N 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NUMBERP N)),
which again simplifies, opening up LESSP, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(NOT (EQUAL (GET-NTH 0 LST) 0))),
which again simplifies, obviously, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))).
However this again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION,
and LESSP-OF-1, and expanding the functions LESSP, NULL, STRLEN, EQUAL,
STRCHR1, and NUMBERP, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP I (ADD1 I))
(NOT (LESSP I I))
(LESSP I (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH I LST)))).
This again simplifies, applying the lemmas LESSP-SUB1 and SUB1-ADD1, and
expanding the definitions of NULL, LESSP, STRLEN, and STRCHR1, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which simplifies, expanding NULL and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NUMBERP (STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST)))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which simplifies, opening up the functions NULL, STRLEN, and STRCHR1, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))),
which simplifies, unfolding the function STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
STRCHR1-NTH
(PROVE-LEMMA STRLEN-STRCHR1-NTH
(REWRITE)
(IMPLIES (AND (LEQ I J)
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))))
Give the conjecture the name *1.
We will appeal to 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 (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL)))
(p I N LST J))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(p (ADD1 I) N LST J))
(p I N LST J))
(IMPLIES (NOT (LESSP I N))
(p I N LST J))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces the following five new formulas:
Case 5. (IMPLIES (AND (LESSP I N)
(EQUAL (GET-NTH I LST) (NULL))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
This simplifies, expanding the definitions of NULL, STRLEN, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
But this again simplifies, appealing to the lemma GET-NTH-0, and unfolding
NULL, LESSP, NUMBERP, EQUAL, STRCHR1, STRLEN, and ADD1, to two new
formulas:
Case 4.3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL I 0)
(NOT (EQUAL (STRLEN 0 N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN 0 N LST))),
which again simplifies, rewriting with the lemma STRLEN-01, and
unfolding the functions EQUAL, LESSP, ADD1, NULL, and STRLEN, to:
T.
Case 4.3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which again simplifies, applying GET-NTH-0, and opening up the function
LESSP, to:
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which further simplifies, rewriting with SUB1-TYPE-RESTRICTION and
STRLEN-01, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP J (ADD1 I))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
However this again simplifies, rewriting with the lemmas GET-NTH-0,
SUB1-TYPE-RESTRICTION, and LESSP-OF-1, and unfolding the definitions of
LESSP, NULL, STRLEN, EQUAL, STRCHR1, and ADD1, to two new goals:
Case 4.2.2.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(EQUAL J 0)
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which again simplifies, trivially, to:
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which further simplifies, rewriting with SUB1-TYPE-RESTRICTION and
STRLEN-01, to:
T.
Case 4.2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(NOT (NUMBERP J))
(NOT (EQUAL (STRLEN (ADD1 I) N LST) 0)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))).
But this further simplifies, applying SUB1-TYPE-RESTRICTION and
STRLEN-01, to:
T.
Case 4.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(LESSP I (ADD1 I))
(NOT (LESSP I I))
(LESSP I (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH I LST)))
N LST)
(STRLEN I N LST))).
However this again simplifies, applying LESSP-SUB1 and SUB1-ADD1, and
expanding NULL, LESSP, STRLEN, and STRCHR1, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(NOT (LESSP J (STRLEN (ADD1 I) N LST)))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
This simplifies, expanding the functions NULL and STRLEN, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) (NULL)))
(EQUAL (STRLEN (ADD1 (STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST)))
N LST)
(STRLEN (ADD1 I) N LST))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))).
This simplifies, expanding the functions NULL, STRLEN, and STRCHR1, to:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (STRLEN (ADD1 (STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST)))
N LST)
(STRLEN (ADD1 I) N LST))
(NOT (LESSP J I))
(LESSP J (STRLEN (ADD1 I) N LST))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (NUMBERP I)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which again simplifies, applying GET-NTH-0, and opening up the function
LESSP, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (GET-NTH 0 LST) 0))
(EQUAL (STRLEN (ADD1 (STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST)))
N LST)
(STRLEN (ADD1 I) N LST))
(LESSP J (STRLEN (ADD1 I) N LST))
(EQUAL (GET-NTH 0 LST)
(GET-NTH J LST))
(NOT (NUMBERP I)))
(EQUAL (STRLEN 1 N LST)
(STRLEN (ADD1 I) N LST))),
which further simplifies, rewriting with the lemma SUB1-TYPE-RESTRICTION, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NOT (LESSP J I))
(LESSP J (STRLEN I N LST)))
(EQUAL (STRLEN (ADD1 (STRCHR1 I N LST (GET-NTH J LST)))
N LST)
(STRLEN I N LST))),
which simplifies, opening up the definition of STRLEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
STRLEN-STRCHR1-NTH
(PROVE-LEMMA STRLEN-STRCHR1
(REWRITE)
(IMPLIES (NUMBERP (STRCHR1 I N LST 0))
(NOT (LESSP (STRCHR1 I N LST 0)
(STRLEN I N LST)))))
WARNING: Note that the proposed lemma STRLEN-STRCHR1 is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This formula simplifies, rewriting with STRCHR1-FALSE-0, and opening up the
definition of NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRLEN-STRCHR1
(PROVE-LEMMA STRCHR1-CH0
(REWRITE)
(NOT (STRCHR1 I N LST 0)))
WARNING: the previously added lemma, STRCHR1-FALSE-0, could be applied
whenever the newly proposed STRCHR1-CH0 could!
This formula simplifies, rewriting with STRCHR1-FALSE-0, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
STRCHR1-CH0
(PROVE-LEMMA STRCHR1-NTH-FIRST
(REWRITE)
(IMPLIES (AND (NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(LEQ I J))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))))
WARNING: Note that the proposed lemma STRCHR1-NTH-FIRST is to be stored as
zero type prescription rules, zero compound recognizer rules, one linear rule,
and zero replacement rules.
Call 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 (LESSP I N)
(EQUAL (GET-NTH I LST) 0))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J I N LST))
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(p J (ADD1 I) N LST))
(p J I N LST))
(IMPLIES (NOT (LESSP I N))
(p J I N LST))).
Linear arithmetic establishes that the measure (DIFFERENCE N I) 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 (LESSP I N)
(EQUAL (GET-NTH I LST) 0)
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which simplifies, unfolding STRCHR1, EQUAL, and NUMBERP, to:
T.
Case 5. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which simplifies, opening up STRCHR1, to the conjecture:
(IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(EQUAL (GET-NTH I LST)
(GET-NTH J LST))
(NOT (LESSP J I))
(NOT (NUMBERP I)))
(NOT (LESSP J 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (NUMBERP (STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST))))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which simplifies, opening up STRCHR1 and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which simplifies, using linear arithmetic, to three new conjectures:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP J))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which again simplifies, appealing to the lemma GET-NTH-0, and expanding
the functions LESSP, NUMBERP, EQUAL, and STRCHR1, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP I))
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(LESSP J (ADD1 I))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))),
which again simplifies, applying GET-NTH-0, SUB1-TYPE-RESTRICTION, and
LESSP-OF-1, and expanding the functions LESSP, STRCHR1, NUMBERP, and EQUAL,
to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP I)
(NUMBERP J)
(LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH I LST)))
(LESSP I (ADD1 I))
(NUMBERP (STRCHR1 I N LST (GET-NTH I LST)))
(NOT (LESSP I I)))
(NOT (LESSP I
(STRCHR1 I N LST (GET-NTH I LST))))).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (LESSP I N)
(NOT (EQUAL (GET-NTH I LST) 0))
(NOT (EQUAL (GET-NTH I LST)
(GET-NTH J LST)))
(NOT (LESSP J
(STRCHR1 (ADD1 I)
N LST
(GET-NTH J LST))))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, opening up the function STRCHR1, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP I N))
(NUMBERP (STRCHR1 I N LST (GET-NTH J LST)))
(NOT (LESSP J I)))
(NOT (LESSP J
(STRCHR1 I N LST (GET-NTH J LST))))).
This simplifies, unfolding the functions STRCHR1 and NUMBERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
STRCHR1-NTH-FIRST
(PROVE-LEMMA STRSTR1-THM2 NIL
(IMPLIES (AND (LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(LEQ I J)
(LESSP J
(STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(NOT (EQUAL (STRNCMP2 J N LST1 0 LST2) 0)))
((INDUCT (STRSTR1 I N1 LST1 N2 LST2 LEN))
(DISABLE STRNCMP MCDR)))
This formula can be simplified, using the abbreviations IMPLIES, NOT, OR, AND,
STRNCMP2-MCDR-1, STRNCMP2-MCDR-2, and STRNCMP-STRNCMP2, to the following four
new conjectures:
Case 4. (IMPLIES
(AND
(LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP2 (PLUS 0
(ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2))))
LEN LST1
(PLUS 0 1)
LST2)
0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(LESSP J
(STRSTR1 I N1 LST1 N2 LST2 LEN))
(EQUAL N (ADD1 LEN)))
(NOT (EQUAL (STRNCMP2 J N LST1 0 LST2)
0))).
This simplifies, applying PLUS-0, STRNCMP-STRNCMP2, STRNCMP2-MCDR-2,
STRNCMP2-MCDR-1, and SUB1-ADD1, and unfolding PLUS, EQUAL, STRSTR1, ADD1,
and STRNCMP2, to four new goals:
Case 4.4.
(IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP2 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LEN LST1 1 LST2)
0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(LESSP J
(STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))
(NUMBERP LEN))
(NOT (EQUAL (STRNCMP2 (ADD1 J) LEN LST1 1 LST2)
0))).
We use the second equality hypothesis by substituting (GET-NTH J LST1) for
(GET-NTH 0 LST2) and throwing away the equality. We must thus prove the
formula:
(IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH J LST1)))
(EQUAL (STRNCMP2 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH J LST1)))
LEN LST1 1 LST2)
0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(LESSP J
(STRCHR1 I N1 LST1 (GET-NTH J LST1)))
(NUMBERP LEN))
(NOT (EQUAL (STRNCMP2 (ADD1 J) LEN LST1 1 LST2)
0))).
However this further simplifies, using linear arithmetic and rewriting
with STRCHR1-NTH-FIRST, to:
T.
Case 4.3.
(IMPLIES
(AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (STRNCMP2 (ADD1 (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
LEN LST1 1 LST2)
0)
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(LESSP J
(STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2))
(NOT (NUMBERP LEN)))
(NOT (EQUAL (STRNCMP2 (ADD1 J) 0 LST1 1 LST2)
0))).
This again simplifies, rewriting with STRNCMP2-0, and opening up the
functions STRNCMP2 and EQUAL, to:
(IMPLIES (AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(LST-OF-CHRP LST1)
(LST-OF-CHRP LST2)
(NOT (LESSP J I))
(LESSP J
(STRCHR1 I N1 LST1 (GET-NTH 0 LST2)))
(EQUAL (GET-NTH J LST1)
(GET-NTH 0 LST2)))
(NUMBERP LEN)).
We use the above equality hypothesis by substituting (GET-NTH J LST1) for
(GET-NTH 0 LST2) and throwing away the equality. The result is the
formula:
(IMPLIES (AND (LESSP I N1)
(NUMBERP (STRCHR1 I N1 LST1 (GET-NTH J LST1)))