ACL2 !>(certify-book "notes-version-1")
CERTIFICATION ATTEMPT FOR
"/Users/moore/courses/cs389r/spring-06/notes-version-1.lisp"
ACL2 Version 2.9
* Step 1: Read "/Users/moore/courses/cs389r/spring-06/notes-version-1.lisp"
and compute its check sum.
* Step 2: There were 329 forms in the file. The check sum is 132297991.
We now attempt to establish that each form, whether local or non-local,
is indeed an admissible embedded event form in the context of the previously
admitted ones. Note that proof-tree output is inhibited during this
check; see :DOC proof-tree.
ACL2 >>(DEFMACRO
THEOREM
(NAME FORM &KEY
(RULE-CLASSES ':REWRITE
RULE-CLASSES-SUPPLIEDP)
HINTS)
(LET
((OLD-HINTS HINTS)
(HINTS
(COND ((NULL HINTS)
'(("Goal" :DO-NOT-INDUCT T)))
((AND (TRUE-LISTP HINTS)
(EQUAL (LENGTH HINTS) 1)
(EQUAL (CAR (CAR HINTS)) "Goal"))
(CONS (CONS '"Goal"
(CONS ':DO-NOT-INDUCT
(CONS 'T
(APPEND (CDR (CAR HINTS)) 'NIL))))
'NIL))
(T NIL))))
(COND
((NULL HINTS)
(CONS
'ER
(CONS
'SOFT
(CONS
(CONS 'QUOTE (CONS 'THEOREM 'NIL))
(CONS
'"The :hints value ~x0 is not allowed ~
by this macro."
(CONS (CONS 'QUOTE (CONS OLD-HINTS 'NIL))
'NIL))))))
((AND RULE-CLASSES-SUPPLIEDP
(EQUAL RULE-CLASSES NIL))
(CONS
'DEFTHM
(CONS NAME
(CONS FORM
(CONS ':RULE-CLASSES
(CONS 'NIL
(CONS ':HINTS (CONS HINTS 'NIL))))))))
(T
(CONS
'PROGN
(CONS
(CONS 'DEFTHM
(CONS NAME
(CONS FORM
(APPEND (IF RULE-CLASSES-SUPPLIEDP
(CONS ':RULE-CLASSES
(CONS RULE-CLASSES 'NIL))
NIL)
(CONS ':HINTS (CONS HINTS 'NIL))))))
(CONS (CONS 'IN-THEORY
(CONS (CONS 'DISABLE (CONS NAME 'NIL))
'NIL))
(CONS (CONS 'VALUE-TRIPLE
(CONS (CONS 'QUOTE (CONS NAME 'NIL))
'NIL))
'NIL))))))))
Summary
Form: ( DEFMACRO THEOREM ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
THEOREM
ACL2 >>(DEFUN
ADD-LABEL-TO-BUCKET
(LABEL CONST BUCKETS)
(IF (ENDP BUCKETS)
(LIST (LIST CONST (LIST LABEL)))
(IF (EQUAL CONST (CAR (CAR BUCKETS)))
(CONS (LIST CONST
(APPEND (CADR (CAR BUCKETS))
(LIST LABEL)))
(CDR BUCKETS))
(CONS (CAR BUCKETS)
(ADD-LABEL-TO-BUCKET LABEL CONST (CDR BUCKETS))))))
The admission of ADD-LABEL-TO-BUCKET is trivial, using the relation
O< (which is known to be well-founded on the domain recognized by O-
P) and the measure (ACL2-COUNT BUCKETS). We observe that the type
of ADD-LABEL-TO-BUCKET is described by the theorem
(CONSP (ADD-LABEL-TO-BUCKET LABEL CONST BUCKETS)). We used primitive
type reasoning.
Summary
Form: ( DEFUN ADD-LABEL-TO-BUCKET ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.06 seconds (prove: 0.00, print: 0.02, other: 0.04)
ADD-LABEL-TO-BUCKET
ACL2 >>(DEFUN MAKE-EQUIV-CLASSES (ALIST BUCKETS)
(IF (ENDP ALIST)
BUCKETS
(MAKE-EQUIV-CLASSES (CDR ALIST)
(ADD-LABEL-TO-BUCKET (CAAR ALIST)
(CADR (CAR ALIST))
BUCKETS))))
The admission of MAKE-EQUIV-CLASSES is trivial, using the relation
O< (which is known to be well-founded on the domain recognized by O-
P) and the measure (ACL2-COUNT ALIST). We observe that the type of
MAKE-EQUIV-CLASSES is described by the theorem
(OR (CONSP (MAKE-EQUIV-CLASSES ALIST BUCKETS))
(EQUAL (MAKE-EQUIV-CLASSES ALIST BUCKETS)
BUCKETS)).
We used the :type-prescription rule ADD-LABEL-TO-BUCKET.
Summary
Form: ( DEFUN MAKE-EQUIV-CLASSES ...)
Rules: ((:TYPE-PRESCRIPTION ADD-LABEL-TO-BUCKET))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.02, other: 0.02)
MAKE-EQUIV-CLASSES
ACL2 >>(THEOREM PROBLEM-2
(EQUAL (MAKE-EQUIV-CLASSES '((1 (1 2 3))
(2 (NIL NIL NIL))
(3 ((NIL NIL)))
(4 (1 (2 . 3) 4))
(5 (NIL NIL))
(6 (1 (2 . 3) 4))
(7 (HELLOWORLD !))
(8 (1 (2 3) 4))
(9 ((A . T) (B) (C)))
(10 (NIL NIL))
(11 (1 2 3))
(12 (NIL NIL))
(13 (A B C))
(14 (A B C))
(15 (HELLO WORLD !))
(16 ((A . T) (B) (C))))
NIL)
'(((1 2 3) (1 11))
((NIL NIL NIL) (2))
(((NIL NIL)) (3))
((1 (2 . 3) 4) (4 6))
((NIL NIL) (5 10 12))
((HELLOWORLD !) (7))
((1 (2 3) 4) (8))
(((A . T) (B) (C)) (9 16))
((A B C) (13 14))
((HELLO WORLD !) (15))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the :executable-counterparts
of EQUAL and MAKE-EQUIV-CLASSES.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-2 ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART MAKE-EQUIV-CLASSES))
Warnings: None
Time: 0.01 seconds (prove: 0.01, print: 0.00, other: 0.00)
PROBLEM-2
ACL2 >>(THEOREM PROBLEM-4
(AND (EQUAL '((1 . 2) 3 . 4)
(CONS (CONS '1 '2) (CONS '3 '4)))
(EQUAL '(1 2 3)
(CONS '1 (CONS '2 (CONS '3 'NIL))))
(EQUAL '((1 . T) (2) (3 . T))
(CONS (CONS '1 'T)
(CONS (CONS '2 'NIL)
(CONS (CONS '3 'T) 'NIL))))
(EQUAL '((A . 1) (B . 2))
(CONS (CONS 'A '1)
(CONS (CONS 'B '2) 'NIL))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by case analysis.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-4 ...)
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-4
ACL2 >>(THEOREM PROBLEM-5
(AND (EQUAL (CONS (CONS '1 '2)
(CONS (CONS '3 '4) 'NIL))
'((1 . 2) (3 . 4)))
(EQUAL (CONS '1 (CONS '2 '3))
'(1 2 . 3))
(EQUAL (CONS 'NIL (CONS (CONS 'NIL 'NIL) 'NIL))
'(NIL (NIL)))
(EQUAL (IF 'NIL '1 '2) '2)
(EQUAL (IF '1 '2 '3) '2)
(EQUAL (EQUAL 'NIL (CONS 'NIL 'NIL))
'NIL)
(EQUAL (EQUAL 'HELLO 'HELLO) 'T)
(EQUAL (EQUAL (CONS '1 '2) (CONS '1 'TWO))
'NIL))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by case analysis.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-5 ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
PROBLEM-5
ACL2 >>(DEFUN APP (X Y)
(IF (CONSP X)
(CONS (CAR X) (APP (CDR X) Y))
Y))
The admission of APP is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of APP is described by the
theorem (OR (CONSP (APP X Y)) (EQUAL (APP X Y) Y)). We used primitive
type reasoning.
Summary
Form: ( DEFUN APP ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
APP
ACL2 >>(DEFUN REV (X)
(IF (CONSP X)
(APP (REV (CDR X)) (CONS (CAR X) NIL))
NIL))
The admission of REV is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of REV is described by the
theorem (OR (CONSP (REV X)) (EQUAL (REV X) NIL)). We used primitive
type reasoning and the :type-prescription rule APP.
Summary
Form: ( DEFUN REV ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
REV
ACL2 >>(DEFUN MAPNIL (X)
(IF (CONSP X)
(CONS NIL (MAPNIL (CDR X)))
NIL))
The admission of MAPNIL is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of MAPNIL is described by
the theorem (TRUE-LISTP (MAPNIL X)). We used primitive type reasoning.
Summary
Form: ( DEFUN MAPNIL ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
MAPNIL
ACL2 >>(DEFUN SWAP-TREE (X)
(IF (CONSP X)
(CONS (SWAP-TREE (CDR X))
(SWAP-TREE (CAR X)))
X))
The admission of SWAP-TREE is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We could deduce no constraints on the type
of SWAP-TREE. However, in normalizing the definition we used primitive
type reasoning.
Summary
Form: ( DEFUN SWAP-TREE ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
SWAP-TREE
ACL2 >>(DEFUN MEM (E X)
(IF (CONSP X)
(IF (EQUAL E (CAR X)) T (MEM E (CDR X)))
NIL))
The admission of MEM is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of MEM is described by the
theorem (OR (EQUAL (MEM E X) T) (EQUAL (MEM E X) NIL)).
Summary
Form: ( DEFUN MEM ...)
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
MEM
ACL2 >>(DEFUN SUB (X Y)
(IF (CONSP X)
(IF (MEM (CAR X) Y) (SUB (CDR X) Y) NIL)
T))
The admission of SUB is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of SUB is described by the
theorem (OR (EQUAL (SUB X Y) T) (EQUAL (SUB X Y) NIL)).
Summary
Form: ( DEFUN SUB ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
SUB
ACL2 >>(DEFUN INT (X Y)
(IF (CONSP X)
(IF (MEM (CAR X) Y)
(CONS (CAR X) (INT (CDR X) Y))
(INT (CDR X) Y))
NIL))
The admission of INT is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of INT is described by the
theorem (TRUE-LISTP (INT X Y)). We used primitive type reasoning.
Summary
Form: ( DEFUN INT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
INT
ACL2 >>(DEFUN TIP (E X)
(IF (CONSP X)
(OR (TIP E (CAR X)) (TIP E (CDR X)))
(EQUAL E X)))
The admission of TIP is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of TIP is described by the
theorem (OR (EQUAL (TIP E X) T) (EQUAL (TIP E X) NIL)). We used primitive
type reasoning.
Summary
Form: ( DEFUN TIP ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
TIP
ACL2 >>(DEFUN FLATTEN (X)
(IF (CONSP X)
(APP (FLATTEN (CAR X))
(FLATTEN (CDR X)))
(CONS X NIL)))
The admission of FLATTEN is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of FLATTEN is described by
the theorem (CONSP (FLATTEN X)). We used primitive type reasoning
and the :type-prescription rule APP.
Summary
Form: ( DEFUN FLATTEN ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
FLATTEN
ACL2 >>(DEFUN EVENLEN (X)
(IF (CONSP X)
(IF (CONSP (CDR X))
(EVENLEN (CDR (CDR X)))
NIL)
T))
For the admission of EVENLEN we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). The non-trivial part of the measure conjecture is
Goal
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (ACL2-COUNT (CDDR X))
(ACL2-COUNT X))).
This simplifies, using the :definitions O-FINP and O< and the :type-
prescription rule ACL2-COUNT, to
Goal'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (ACL2-COUNT (CDDR X))
(ACL2-COUNT X))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2. (2) Use CAR-CDR-ELIM, again, to replace X2
by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These steps
produce the following goal.
Goal''
(IMPLIES (AND (CONSP (CONS X3 X4))
(CONSP (LIST* X1 X3 X4)))
(< (ACL2-COUNT X4)
(ACL2-COUNT (LIST* X1 X3 X4)))).
This simplifies, using the :definition ACL2-COUNT, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Goal'''
(< (ACL2-COUNT X4)
(+ 1 (ACL2-COUNT X1)
1 (ACL2-COUNT X3)
(ACL2-COUNT X4))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule ACL2-COUNT.
Q.E.D.
That completes the proof of the measure theorem for EVENLEN. Thus,
we admit this function under the principle of definition. We observe
that the type of EVENLEN is described by the theorem
(OR (EQUAL (EVENLEN X) T) (EQUAL (EVENLEN X) NIL)).
Summary
Form: ( DEFUN EVENLEN ...)
Rules: ((:DEFINITION ACL2-COUNT)
(:DEFINITION NOT)
(:DEFINITION O-FINP)
(:DEFINITION O<)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings: None
Time: 0.05 seconds (prove: 0.02, print: 0.02, other: 0.01)
EVENLEN
ACL2 >>(THEOREM PROBLEM-40
(EQUAL (APP (APP A B) C)
(APP A (APP B C)))
:HINTS (("Goal" :INDUCT (APP A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B C))
(IMPLIES (AND (CONSP A) (:P (CDR A) B C))
(:P A B C))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (APP (APP A B) C)
(APP A (APP B C)))).
But simplification reduces this to T, using the :definition APP and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (APP (APP (CDR A) B) C)
(APP (CDR A) (APP B C))))
(EQUAL (APP (APP A B) C)
(APP A (APP B C)))).
But simplification reduces this to T, using the :definition APP, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-40 ...)
Rules: ((:DEFINITION APP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-40
ACL2 >>(THEOREM PROBLEM-41-COUNTEREXAMPLE
(NOT (EQUAL (APP '(1 2 3 . 4) NIL)
'(1 2 3 . 4)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the :executable-counterparts
of APP and EQUAL.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-41-COUNTEREXAMPLE ...)
Rules: ((:EXECUTABLE-COUNTERPART APP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-41-COUNTEREXAMPLE
ACL2 >>(DEFUN PROPER (X)
(IF (CONSP X)
(PROPER (CDR X))
(EQUAL X NIL)))
The admission of PROPER is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of PROPER is described by
the theorem (OR (EQUAL (PROPER X) T) (EQUAL (PROPER X) NIL)). We used
primitive type reasoning.
Summary
Form: ( DEFUN PROPER ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
PROPER
ACL2 >>(THEOREM PROBLEM-41
(IMPLIES (PROPER X)
(EQUAL (APP X NIL) X))
:HINTS (("Goal" :INDUCT (APP X NIL))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP X 'NIL). This
suggestion was produced using the :induction rule APP. If we let (:P X)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(IMPLIES (PROPER X)
(EQUAL (APP X NIL) X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X)) (PROPER X))
(EQUAL (APP X NIL) X)).
But simplification reduces this to T, using the :definition PROPER,
the :executable-counterparts of APP, CONSP and EQUAL and primitive
type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(IMPLIES (PROPER (CDR X))
(EQUAL (APP (CDR X) NIL) (CDR X))))
(IMPLIES (PROPER X)
(EQUAL (APP X NIL) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(IMPLIES (PROPER (CDR X))
(EQUAL (APP (CDR X) NIL) (CDR X)))
(PROPER X))
(EQUAL (APP X NIL) X)).
But simplification reduces this to T, using the :definitions APP and
PROPER, primitive type reasoning and the :rewrite rule CAR-CDR-ELIM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-41 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION NOT)
(:DEFINITION PROPER)
(:EXECUTABLE-COUNTERPART APP)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CDR-ELIM))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-41
ACL2 >>(THEOREM PROBLEM-42
(EQUAL (MAPNIL (APP A B))
(APP (MAPNIL A) (MAPNIL B)))
:HINTS (("Goal" :INDUCT (APP A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (MAPNIL (APP A B))
(APP (MAPNIL A) (MAPNIL B)))).
But simplification reduces this to T, using the :definitions APP and
MAPNIL, the :executable-counterpart of CONSP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL (APP (CDR A) B))
(APP (MAPNIL (CDR A)) (MAPNIL B))))
(EQUAL (MAPNIL (APP A B))
(APP (MAPNIL A) (MAPNIL B)))).
But simplification reduces this to T, using the :definitions APP and
MAPNIL, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-
CONS and the :type-prescription rule MAPNIL.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-42 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MAPNIL)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MAPNIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-42
ACL2 >>(THEOREM PROBLEM-43
(EQUAL (REV (MAPNIL X))
(MAPNIL (REV X)))
:HINTS
(("Goal" :INDUCT (REV X)
:IN-THEORY (ENABLE PROBLEM-42))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REV X). This suggestion
was produced using the :induction rule REV. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit REV,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (REV (MAPNIL X))
(MAPNIL (REV X)))).
But simplification reduces this to T, using the :definitions MAPNIL
and REV and the :executable-counterparts of EQUAL, MAPNIL and REV.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (REV (MAPNIL (CDR X)))
(MAPNIL (REV (CDR X)))))
(EQUAL (REV (MAPNIL X))
(MAPNIL (REV X)))).
But simplification reduces this to T, using the :definitions MAPNIL
and REV, the :executable-counterparts of CONS and MAPNIL, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS and PROBLEM-42
and the :type-prescription rule MAPNIL.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-43 ...)
Rules: ((:DEFINITION MAPNIL)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART MAPNIL)
(:EXECUTABLE-COUNTERPART REV)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION REV)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-42)
(:TYPE-PRESCRIPTION MAPNIL))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-43
ACL2 >>(THEOREM PROBLEM-44-COUNTEREXAMPLE
(NOT (EQUAL (REV (REV '(1 2 3 . 4)))
'(1 2 3 . 4)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the :executable-counterparts
of EQUAL and REV.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-44-COUNTEREXAMPLE ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART REV))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-44-COUNTEREXAMPLE
ACL2 >>(THEOREM PROBLEM-44C
(EQUAL (PROPER (APP A B)) (PROPER B))
:HINTS (("Goal" :INDUCT (APP A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (PROPER (APP A B)) (PROPER B))).
But simplification reduces this to T, using the :definition APP and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (PROPER (APP (CDR A) B))
(PROPER B)))
(EQUAL (PROPER (APP A B)) (PROPER B))).
But simplification reduces this to T, using the :definitions APP and
PROPER, primitive type reasoning and the :rewrite rule CDR-CONS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-44C ...)
Rules: ((:DEFINITION APP)
(:DEFINITION PROPER)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-44C
ACL2 >>(THEOREM PROBLEM-44B (PROPER (REV X))
:HINTS
(("Goal" :INDUCT (REV X)
:IN-THEORY (ENABLE PROBLEM-44C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REV X). This suggestion
was produced using the :induction rule REV. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit REV,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(PROPER (REV X))).
But simplification reduces this to T, using the :definition REV and
the :executable-counterpart of PROPER.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (PROPER (REV (CDR X))))
(PROPER (REV X))).
But simplification reduces this to T, using the :definitions PROPER
and REV, the :executable-counterpart of PROPER, primitive type reasoning
and the :rewrite rules CDR-CONS and PROBLEM-44C.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-44B depends upon the :type-prescription rule
PROPER.
Summary
Form: ( DEFTHM PROBLEM-44B ...)
Rules: ((:DEFINITION PROPER)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART PROPER)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION REV)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-44C)
(:TYPE-PRESCRIPTION PROPER))
Warnings: None
Time: 0.04 seconds (prove: 0.02, print: 0.01, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-44B
ACL2 >>(THEOREM PROBLEM-44A
(EQUAL (REV (APP A B))
(APP (REV B) (REV A)))
:HINTS
(("Goal" :INDUCT (APP A B)
:IN-THEORY
(ENABLE PROBLEM-40 PROBLEM-41 PROBLEM-44B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (REV (APP A B))
(APP (REV B) (REV A)))).
But simplification reduces this to T, using the :definitions APP and
REV, primitive type reasoning and the :rewrite rules PROBLEM-41 and
PROBLEM-44B.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (REV (APP (CDR A) B))
(APP (REV B) (REV (CDR A)))))
(EQUAL (REV (APP A B))
(APP (REV B) (REV A)))).
This simplifies, using the :definitions APP and REV, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(EQUAL (REV (APP (CDR A) B))
(APP (REV B) (REV (CDR A)))))
(EQUAL (APP (REV (APP (CDR A) B))
(LIST (CAR A)))
(APP (REV B)
(APP (REV (CDR A)) (LIST (CAR A)))))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (AND (CONSP (CONS A1 A2))
(EQUAL (REV (APP A2 B))
(APP (REV B) (REV A2))))
(EQUAL (APP (REV (APP A2 B)) (LIST A1))
(APP (REV B)
(APP (REV A2) (LIST A1))))).
This simplifies, using primitive type reasoning, to
Subgoal *1/1'''
(IMPLIES (EQUAL (REV (APP A2 B))
(APP (REV B) (REV A2)))
(EQUAL (APP (REV (APP A2 B)) (LIST A1))
(APP (REV B)
(APP (REV A2) (LIST A1))))).
We now use the hypothesis by substituting (APP (REV B) (REV A2)) for
(REV (APP A2 B)) and throwing away the hypothesis. This produces
Subgoal *1/1'4'
(EQUAL (APP (APP (REV B) (REV A2)) (LIST A1))
(APP (REV B) (APP (REV A2) (LIST A1)))).
But we reduce the conjecture to T, by the simple :rewrite rule PROBLEM-
40.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-44A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION REV)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-40)
(:REWRITE PROBLEM-41)
(:REWRITE PROBLEM-44B))
Warnings: None
Time: 0.12 seconds (prove: 0.04, print: 0.07, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-44A
ACL2 >>(THEOREM PROBLEM-44
(IMPLIES (PROPER X)
(EQUAL (REV (REV X)) X))
:HINTS
(("Goal" :INDUCT (REV X)
:IN-THEORY (ENABLE PROBLEM-44A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REV X). This suggestion
was produced using the :induction rule REV. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit REV,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(IMPLIES (PROPER X)
(EQUAL (REV (REV X)) X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X)) (PROPER X))
(EQUAL (REV (REV X)) X)).
But simplification reduces this to T, using the :definition PROPER,
the :executable-counterparts of CONSP, EQUAL and REV and primitive
type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(IMPLIES (PROPER (CDR X))
(EQUAL (REV (REV (CDR X))) (CDR X))))
(IMPLIES (PROPER X)
(EQUAL (REV (REV X)) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(IMPLIES (PROPER (CDR X))
(EQUAL (REV (REV (CDR X))) (CDR X)))
(PROPER X))
(EQUAL (REV (REV X)) X)).
But simplification reduces this to T, using the :definitions APP, PROPER
and REV, the :executable-counterparts of CONSP and REV, primitive type
reasoning and the :rewrite rules CAR-CDR-ELIM, CAR-CONS, CDR-CONS and
PROBLEM-44A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-44 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION NOT)
(:DEFINITION PROPER)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART REV)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION REV)
(:REWRITE CAR-CDR-ELIM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-44A))
Warnings: None
Time: 0.06 seconds (prove: 0.02, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-44
ACL2 >>(THEOREM PROBLEM-45
(EQUAL (SWAP-TREE (SWAP-TREE X)) X)
:HINTS (("Goal" :INDUCT (SWAP-TREE X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SWAP-TREE X). This
suggestion was produced using the :induction rule SWAP-TREE. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X)
(:P (CDR X))
(:P (CAR X)))
(:P X))).
This induction is justified by the same argument used to admit SWAP-
TREE, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (SWAP-TREE (SWAP-TREE X)) X)).
But simplification reduces this to T, using the :definition SWAP-TREE
and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (SWAP-TREE (SWAP-TREE (CDR X)))
(CDR X))
(EQUAL (SWAP-TREE (SWAP-TREE (CAR X)))
(CAR X)))
(EQUAL (SWAP-TREE (SWAP-TREE X)) X)).
But simplification reduces this to T, using the :definition SWAP-TREE,
primitive type reasoning and the :rewrite rules CAR-CDR-ELIM, CAR-CONS
and CDR-CONS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-45 ...)
Rules: ((:DEFINITION SWAP-TREE)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SWAP-TREE)
(:REWRITE CAR-CDR-ELIM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-45
ACL2 >>(THEOREM PROBLEM-46
(EQUAL (MEM E (APP A B))
(OR (MEM E A) (MEM E B)))
:HINTS (("Goal" :INDUCT (MEM E A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM E A). This
suggestion was produced using the :induction rule MEM. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(:P (CDR A) B E))
(:P A B E))
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(:P A B E))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(EQUAL (MEM E (APP A B))
(OR (MEM E A) (MEM E B)))).
But simplification reduces this to T, using the :definitions APP and
MEM and primitive type reasoning.
Subgoal *1/2
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(EQUAL (MEM E (APP (CDR A) B))
(OR (MEM E (CDR A)) (MEM E B))))
(EQUAL (MEM E (APP A B))
(OR (MEM E A) (MEM E B)))).
But simplification reduces this to T, using the :definitions APP and
MEM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(EQUAL (MEM E (APP A B))
(OR (MEM E A) (MEM E B)))).
This simplifies, using the :definition MEM, primitive type reasoning
and the :type-prescription rule MEM, to
Subgoal *1/1'
(IMPLIES (CONSP A)
(MEM (CAR A) (APP A B))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (CONSP (CONS A1 A2))
(MEM A1 (APP (CONS A1 A2) B))).
But simplification reduces this to T, using the :definitions APP and
MEM, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-
CONS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-46 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.03 seconds (prove: 0.01, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-46
ACL2 >>(THEOREM PROBLEM-47A
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT A B))))
:HINTS (("Goal" :INDUCT (INT A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (INT A B). This
suggestion was produced using the :induction rule INT. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(:P (CDR A) B E))
(:P A B E))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) B E))
(:P A B E))).
This induction is justified by the same argument used to admit INT,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT A B))))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A)) (NOT (MEM E B)))
(NOT (MEM E (INT A B)))).
But simplification reduces this to T, using the :definitions INT and
MEM and the :executable-counterpart of CONSP.
Subgoal *1/2
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT (CDR A) B)))))
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT A B))))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT (CDR A) B))))
(NOT (MEM E B)))
(NOT (MEM E (INT A B)))).
But simplification reduces this to T, using the :definitions INT and
NOT and the :executable-counterpart of NOT.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT (CDR A) B)))))
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT A B))))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (NOT (MEM E B))
(NOT (MEM E (INT (CDR A) B))))
(NOT (MEM E B)))
(NOT (MEM E (INT A B)))).
This simplifies, using the :definitions INT, MEM and NOT, the :executable-
counterpart of NOT, primitive type reasoning, the :rewrite rules CAR-
CONS and CDR-CONS and the :type-prescription rules INT and MEM, to
Subgoal *1/1''
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(NOT (MEM E (INT (CDR A) B)))
(NOT (MEM E B)))
(NOT (EQUAL E (CAR A)))).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-47A ...)
Rules: ((:DEFINITION INT)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION INT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION INT)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.08 seconds (prove: 0.03, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-47A
ACL2 >>(THEOREM PROBLEM-47
(EQUAL (MEM E (INT A B))
(AND (MEM E A) (MEM E B)))
:HINTS
(("Goal" :INDUCT (MEM E A)
:IN-THEORY (ENABLE PROBLEM-47A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM E A). This
suggestion was produced using the :induction rule MEM. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(:P (CDR A) B E))
(:P A B E))
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(:P A B E))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(EQUAL (MEM E (INT A B))
(AND (MEM E A) (MEM E B)))).
But simplification reduces this to T, using the :definitions INT and
MEM and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(EQUAL (MEM E (INT (CDR A) B))
(AND (MEM E (CDR A)) (MEM E B))))
(EQUAL (MEM E (INT A B))
(AND (MEM E A) (MEM E B)))).
This simplifies, using the :definitions INT and MEM, the :executable-
counterpart of NOT, primitive type reasoning and the :type-prescription
rule MEM, to the following two conjectures.
Subgoal *1/2.2
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(MEM E (CDR A))
(EQUAL (MEM E (INT (CDR A) B))
(MEM E B))
(MEM (CAR A) B))
(EQUAL (MEM E (CONS (CAR A) (INT (CDR A) B)))
(MEM E B))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule INT.
Subgoal *1/2.1
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(NOT (MEM E (CDR A)))
(EQUAL (MEM E (INT (CDR A) B)) NIL)
(MEM (CAR A) B))
(NOT (MEM E (CONS (CAR A) (INT (CDR A) B))))).
By case analysis we reduce the conjecture to
Subgoal *1/2.1'
(IMPLIES (AND (CONSP A)
(NOT (EQUAL E (CAR A)))
(NOT (MEM E (CDR A)))
(NOT (MEM E (INT (CDR A) B)))
(MEM (CAR A) B))
(NOT (MEM E (CONS (CAR A) (INT (CDR A) B))))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule INT.
Subgoal *1/1
(IMPLIES (AND (CONSP A) (EQUAL E (CAR A)))
(EQUAL (MEM E (INT A B))
(AND (MEM E A) (MEM E B)))).
This simplifies, using the :definition MEM and primitive type reasoning,
to
Subgoal *1/1'
(IMPLIES (CONSP A)
(EQUAL (MEM (CAR A) (INT A B))
(MEM (CAR A) B))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (CONSP (CONS A1 A2))
(EQUAL (MEM A1 (INT (CONS A1 A2) B))
(MEM A1 B))).
This simplifies, using the :definition INT, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/1.2
(IMPLIES (MEM A1 B)
(EQUAL (MEM A1 (CONS A1 (INT A2 B)))
(MEM A1 B))).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rule CAR-CONS and the :type-prescription rules INT and MEM.
Subgoal *1/1.1
(IMPLIES (NOT (MEM A1 B))
(EQUAL (MEM A1 (INT A2 B)) (MEM A1 B))).
But simplification reduces this to T, using the :executable-counterpart
of EQUAL and the :rewrite rule PROBLEM-47A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-47 ...)
Rules: ((:DEFINITION INT)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-47A)
(:TYPE-PRESCRIPTION INT)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.04, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-47
ACL2 >>(THEOREM PROBLEM-48A
(IMPLIES (SUB X (CDR Y)) (SUB X Y))
:HINTS (("Goal" :INDUCT (SUB X Y))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB X Y). This
suggestion was produced using the :induction rule SUB. If we let (:P X Y)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P (CDR X) Y))
(:P X Y))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (SUB X (CDR Y)) (SUB X Y))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (SUB X (CDR Y)))
(SUB X Y)).
But simplification reduces this to T, using the :definition SUB.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (SUB X (CDR Y)) (SUB X Y))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(SUB X (CDR Y)))
(SUB X Y)).
But simplification reduces this to T, using the :definitions MEM and
SUB, the :executable-counterpart of CONSP and the :rewrite rule DEFAULT-
CDR.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (SUB (CDR X) (CDR Y))
(SUB (CDR X) Y)))
(IMPLIES (SUB X (CDR Y)) (SUB X Y))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (SUB (CDR X) (CDR Y))
(SUB (CDR X) Y))
(SUB X (CDR Y)))
(SUB X Y)).
But simplification reduces this to T, using the :definitions MEM and
SUB, primitive type reasoning and the :type-prescription rules MEM
and SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-48A depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-48A ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION SUB)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:REWRITE DEFAULT-CDR)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-48A
ACL2 >>(THEOREM PROBLEM-48 (SUB X X)
:HINTS
(("Goal" :INDUCT (SUB X X)
:IN-THEORY (ENABLE PROBLEM-48A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB X X). This
suggestion was produced using the :induction rule SUB. If we let (:P X)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) X)))
(:P X))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) X)
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X)) (SUB X X)).
But simplification reduces this to T, using the :definition SUB, the
:executable-counterpart of CDR and the :rewrite rules DEFAULT-CDR and
PROBLEM-48A.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) X)))
(SUB X X)).
But simplification reduces this to T, using the :definition MEM and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) X)
(SUB (CDR X) (CDR X)))
(SUB X X)).
But simplification reduces this to T, using the :definitions MEM and
SUB, primitive type reasoning, the :rewrite rule PROBLEM-48A and the
:type-prescription rule SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-48 depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-48 ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION SUB)
(:EXECUTABLE-COUNTERPART CDR)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:REWRITE DEFAULT-CDR)
(:REWRITE PROBLEM-48A)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.10 seconds (prove: 0.01, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-48
ACL2 >>(THEOREM PROBLEM-49A
(IMPLIES (AND (MEM E A) (SUB A B))
(MEM E B))
:HINTS (("Goal" :INDUCT (SUB A B))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-49A ...): The :REWRITE rule
generated from PROBLEM-49A contains the free variable A. This variable
will be chosen by searching for an instance of (MEM E A) among the
hypotheses of the conjecture being rewritten. This is generally a
severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB A B). This
suggestion was produced using the :induction rule SUB. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(:P A B E))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) B E))
(:P A B E))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (AND (MEM E A) (SUB A B))
(MEM E B))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A))
(MEM E A)
(SUB A B))
(MEM E B)).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(IMPLIES (AND (MEM E A) (SUB A B))
(MEM E B))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(MEM E A)
(SUB A B))
(MEM E B)).
But simplification reduces this to T, using the :definition SUB.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (AND (MEM E (CDR A)) (SUB (CDR A) B))
(MEM E B)))
(IMPLIES (AND (MEM E A) (SUB A B))
(MEM E B))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (AND (MEM E (CDR A)) (SUB (CDR A) B))
(MEM E B))
(MEM E A)
(SUB A B))
(MEM E B)).
But simplification reduces this to T, using the :definitions MEM and
SUB, primitive type reasoning and the :type-prescription rule MEM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-49A depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-49A ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION SUB)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:TYPE-PRESCRIPTION MEM))
Warnings: Free
Time: 0.07 seconds (prove: 0.02, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-49A
ACL2 >>(THEOREM PROBLEM-49
(IMPLIES (AND (SUB A B) (SUB B C))
(SUB A C))
:HINTS
(("Goal" :INDUCT (SUB A C)
:IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-49A))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-49 ...): The :REWRITE rule
generated from PROBLEM-49 contains the free variable B. This variable
will be chosen by searching for an instance of (SUB A B) among the
hypotheses of the conjecture being rewritten. This is generally a
severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB A C). This
suggestion was produced using the :induction rule SUB. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B C))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) C)))
(:P A B C))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) C)
(:P (CDR A) B C))
(:P A B C))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (AND (SUB A B) (SUB B C))
(SUB A C))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A))
(SUB A B)
(SUB B C))
(SUB A C)).
But simplification reduces this to T, using the :definition SUB and
the :rewrite rule PROBLEM-48A.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) C)))
(IMPLIES (AND (SUB A B) (SUB B C))
(SUB A C))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) C))
(SUB A B)
(SUB B C))
(SUB A C)).
This simplifies, using the :definition SUB, to
Subgoal *1/2''
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) C))
(SUB A B))
(NOT (SUB B C))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/2'''
(IMPLIES (AND (CONSP (CONS A1 A2))
(NOT (MEM A1 C))
(SUB (CONS A1 A2) B))
(NOT (SUB B C))).
This simplifies, using the :definition SUB, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/2'4'
(IMPLIES (AND (NOT (MEM A1 C))
(MEM A1 B)
(SUB A2 B))
(NOT (SUB B C))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
49A and the :type-prescription rules MEM and SUB.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) C)
(IMPLIES (AND (SUB (CDR A) B) (SUB B C))
(SUB (CDR A) C)))
(IMPLIES (AND (SUB A B) (SUB B C))
(SUB A C))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) C)
(IMPLIES (AND (SUB (CDR A) B) (SUB B C))
(SUB (CDR A) C))
(SUB A B)
(SUB B C))
(SUB A C)).
But simplification reduces this to T, using the :definition SUB, the
:rewrite rule PROBLEM-49A and the :type-prescription rules MEM and
SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-49 depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-49 ...)
Rules: ((:DEFINITION NOT)
(:DEFINITION SUB)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48A)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: Free
Time: 0.10 seconds (prove: 0.03, print: 0.06, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-49
ACL2 >>(THEOREM PROBLEM-50A
(EQUAL (SUB (APP A B) C)
(AND (SUB A C) (SUB B C)))
:HINTS
(("Goal" :INDUCT (SUB A C)
:IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-48 PROBLEM-49A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB A C). This
suggestion was produced using the :induction rule SUB. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B C))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) C)))
(:P A B C))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) C)
(:P (CDR A) B C))
(:P A B C))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(EQUAL (SUB (APP A B) C)
(AND (SUB A C) (SUB B C)))).
But simplification reduces this to T, using the :definitions APP and
SUB, primitive type reasoning and the :rewrite rule PROBLEM-48A.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) C)))
(EQUAL (SUB (APP A B) C)
(AND (SUB A C) (SUB B C)))).
This simplifies, using the :definition SUB and primitive type reasoning,
to
Subgoal *1/2'
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) C)))
(NOT (SUB (APP A B) C))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/2''
(IMPLIES (AND (CONSP (CONS A1 A2))
(NOT (MEM A1 C)))
(NOT (SUB (APP (CONS A1 A2) B) C))).
But simplification reduces this to T, using the :definitions APP and
SUB, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-
CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) C)
(EQUAL (SUB (APP (CDR A) B) C)
(AND (SUB (CDR A) C) (SUB B C))))
(EQUAL (SUB (APP A B) C)
(AND (SUB A C) (SUB B C)))).
But simplification reduces this to T, using the :definitions APP and
SUB, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and PROBLEM-49A and
the :type-prescription rules MEM and SUB.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-50A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION SUB)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-48A)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.08 seconds (prove: 0.03, print: 0.03, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-50A
ACL2 >>(THEOREM PROBLEM-50 (SUB (APP A A) A)
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-50A)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the :executable-counterpart of
IF and the simple :rewrite rules PROBLEM-48 and PROBLEM-50A.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-50 ...)
Rules: ((:EXECUTABLE-COUNTERPART IF)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-50A))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.00, other: 0.01)
PROBLEM-50
ACL2 >>(DEFUN MAPNIL1 (X A)
(IF (CONSP X)
(MAPNIL1 (CDR X) (CONS NIL A))
A))
The admission of MAPNIL1 is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of MAPNIL1 is described by
the theorem (OR (CONSP (MAPNIL1 X A)) (EQUAL (MAPNIL1 X A) A)). We
used primitive type reasoning.
Summary
Form: ( DEFUN MAPNIL1 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.02, other: 0.01)
MAPNIL1
ACL2 >>(DEFUN NILS (X)
(IF (CONSP X)
(AND (EQUAL (CAR X) NIL) (NILS (CDR X)))
(EQUAL X NIL)))
The admission of NILS is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of NILS is described by the
theorem (OR (EQUAL (NILS X) T) (EQUAL (NILS X) NIL)). We used primitive
type reasoning.
Summary
Form: ( DEFUN NILS ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.02, other: 0.01)
NILS
ACL2 >>(THEOREM PROBLEM-51A
(EQUAL (MAPNIL1 A (CONS NIL B))
(CONS NIL (MAPNIL1 A B)))
:HINTS (("Goal" :INDUCT (MAPNIL1 A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL1 A B). This
suggestion was produced using the :induction rule MAPNIL1. If we let
(:P A B) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A)
(:P (CDR A) (CONS NIL B)))
(:P A B))).
This induction is justified by the same argument used to admit MAPNIL1,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (MAPNIL1 A (CONS NIL B))
(CONS NIL (MAPNIL1 A B)))).
But simplification reduces this to T, using the :definition MAPNIL1
and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) (LIST* NIL NIL B))
(CONS NIL (MAPNIL1 (CDR A) (CONS NIL B)))))
(EQUAL (MAPNIL1 A (CONS NIL B))
(CONS NIL (MAPNIL1 A B)))).
But simplification reduces this to T, using the :definition MAPNIL1
and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-51A ...)
Rules: ((:DEFINITION MAPNIL1)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL1))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-51A
ACL2 >>(THEOREM PROBLEM-51B
(IMPLIES (NILS X)
(EQUAL (MAPNIL1 X NIL) X))
:HINTS
(("Goal" :INDUCT (NILS X)
:IN-THEORY (ENABLE PROBLEM-51A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NILS X). This suggestion
was produced using the :induction rule NILS. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (CAR X)) (:P X))
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit NILS,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (NILS X)
(EQUAL (MAPNIL1 X NIL) X))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (NILS X))
(EQUAL (MAPNIL1 X NIL) X)).
But simplification reduces this to T, using the :definition NILS, the
:executable-counterparts of CONSP, EQUAL and MAPNIL1 and primitive
type reasoning.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (CAR X))
(IMPLIES (NILS X)
(EQUAL (MAPNIL1 X NIL) X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X) (CAR X) (NILS X))
(EQUAL (MAPNIL1 X NIL) X)).
But simplification reduces this to T, using the :definition NILS and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(IMPLIES (NILS (CDR X))
(EQUAL (MAPNIL1 (CDR X) NIL) (CDR X))))
(IMPLIES (NILS X)
(EQUAL (MAPNIL1 X NIL) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(IMPLIES (NILS (CDR X))
(EQUAL (MAPNIL1 (CDR X) NIL) (CDR X)))
(NILS X))
(EQUAL (MAPNIL1 X NIL) X)).
This simplifies, using the :definition NILS and the :executable-counterpart
of EQUAL, to
Subgoal *1/1''
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(EQUAL (MAPNIL1 (CDR X) NIL) (CDR X))
(NILS (CDR X)))
(EQUAL (MAPNIL1 X NIL) X)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/1'''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT X1)
(EQUAL (MAPNIL1 X2 NIL) X2)
(NILS X2))
(EQUAL (MAPNIL1 (CONS X1 X2) NIL)
(CONS X1 X2))).
But simplification reduces this to T, using the :definition MAPNIL1,
the :executable-counterpart of CONS, primitive type reasoning and the
:rewrite rules CDR-CONS and PROBLEM-51A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-51B ...)
Rules: ((:DEFINITION MAPNIL1)
(:DEFINITION NILS)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART MAPNIL1)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION NILS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-51A))
Warnings: None
Time: 0.14 seconds (prove: 0.02, print: 0.11, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-51B
ACL2 >>(THEOREM PROBLEM-51
(IMPLIES (AND (NILS A) (NILS B))
(EQUAL (MAPNIL1 A B) (MAPNIL1 B A)))
:HINTS
(("Goal" :INDUCT (MAPNIL1 A B)
:IN-THEORY
(ENABLE PROBLEM-51A PROBLEM-51B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL1 A B). This
suggestion was produced using the :induction rule MAPNIL1. If we let
(:P A B) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A)
(:P (CDR A) (CONS NIL B)))
(:P A B))).
This induction is justified by the same argument used to admit MAPNIL1,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(IMPLIES (AND (NILS A) (NILS B))
(EQUAL (MAPNIL1 A B) (MAPNIL1 B A)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP A)) (NILS A) (NILS B))
(EQUAL (MAPNIL1 A B) (MAPNIL1 B A))).
But simplification reduces this to T, using the :definitions MAPNIL1
and NILS, the :executable-counterpart of CONSP, primitive type reasoning,
the :rewrite rule PROBLEM-51B and the :type-prescription rule NILS.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(IMPLIES (AND (NILS (CDR A)) (NILS (CONS NIL B)))
(EQUAL (MAPNIL1 (CDR A) (CONS NIL B))
(MAPNIL1 (CONS NIL B) (CDR A)))))
(IMPLIES (AND (NILS A) (NILS B))
(EQUAL (MAPNIL1 A B) (MAPNIL1 B A)))).
By the simple :rewrite rule PROBLEM-51A we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(IMPLIES (AND (NILS (CDR A)) (NILS (CONS NIL B)))
(EQUAL (CONS NIL (MAPNIL1 (CDR A) B))
(MAPNIL1 (CONS NIL B) (CDR A))))
(NILS A)
(NILS B))
(EQUAL (MAPNIL1 A B) (MAPNIL1 B A))).
This simplifies, using the :definitions MAPNIL1 and NILS, the :executable-
counterpart of EQUAL, primitive type reasoning, the :rewrite rules
CAR-CONS, CDR-CONS, CONS-EQUAL and PROBLEM-51A and the :type-prescription
rule NILS, to
Subgoal *1/1''
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) B)
(MAPNIL1 B (CDR A)))
(NOT (CAR A))
(NILS (CDR A))
(NILS B))
(EQUAL (MAPNIL1 (CDR A) (CONS NIL B))
(MAPNIL1 B A))).
By the simple :rewrite rule PROBLEM-51A we reduce the conjecture to
Subgoal *1/1'''
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) B)
(MAPNIL1 B (CDR A)))
(NOT (CAR A))
(NILS (CDR A))
(NILS B))
(EQUAL (CONS NIL (MAPNIL1 (CDR A) B))
(MAPNIL1 B A))).
This simplifies, using trivial observations, to
Subgoal *1/1'4'
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) B)
(MAPNIL1 B (CDR A)))
(NOT (CAR A))
(NILS (CDR A))
(NILS B))
(EQUAL (CONS NIL (MAPNIL1 B (CDR A)))
(MAPNIL1 B A))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/1'5'
(IMPLIES (AND (CONSP (CONS A1 A2))
(EQUAL (MAPNIL1 A2 B) (MAPNIL1 B A2))
(NOT A1)
(NILS A2)
(NILS B))
(EQUAL (CONS NIL (MAPNIL1 B A2))
(MAPNIL1 B (CONS A1 A2)))).
But simplification reduces this to T, using primitive type reasoning
and the :rewrite rule PROBLEM-51A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-51 ...)
Rules: ((:DEFINITION MAPNIL1)
(:DEFINITION NILS)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL1)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE CONS-EQUAL)
(:REWRITE PROBLEM-51A)
(:REWRITE PROBLEM-51B)
(:TYPE-PRESCRIPTION NILS))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-51
ACL2 >>(DEFUN RM (X Y)
(IF (CONSP Y)
(IF (EQUAL X (CAR Y))
(CDR Y)
(CONS (CAR Y) (RM X (CDR Y))))
Y))
The admission of RM is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT Y). We could deduce no constraints on the type of RM.
Summary
Form: ( DEFUN RM ...)
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
RM
ACL2 >>(DEFUN PERM (X Y)
(IF (CONSP X)
(AND (MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y)))
(NOT (CONSP Y))))
The admission of PERM is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of PERM is described by the
theorem (OR (EQUAL (PERM X Y) T) (EQUAL (PERM X Y) NIL)).
Summary
Form: ( DEFUN PERM ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
PERM
ACL2 >>(THEOREM PROBLEM-53 (PERM X X)
:HINTS (("Goal" :INDUCT (PERM X X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X X). This
suggestion was produced using the :induction rule PERM. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) X)))
(:P X))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) X)
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X)) (PERM X X)).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) X)))
(PERM X X)).
But simplification reduces this to T, using the :definition MEM and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) X)
(PERM (CDR X) (CDR X)))
(PERM X X)).
But simplification reduces this to T, using the :definitions MEM, PERM
and RM, primitive type reasoning and the :type-prescription rule PERM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-53 depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-53 ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION PERM)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:TYPE-PRESCRIPTION PERM))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-53
ACL2 >>(THEOREM PROBLEM-54A
(IMPLIES (MEM A X)
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y)))
:HINTS (("Goal" :INDUCT (PERM X Y))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P A X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P A X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P A (CDR X) (RM (CAR X) Y)))
(:P A X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (MEM A X)
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (MEM A X))
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y))).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (MEM A X)
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(MEM A X))
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/2''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (MEM X1 Y))
(MEM A (CONS X1 X2)))
(EQUAL (PERM (CONS X1 X2) (CONS A Y))
(PERM (RM A (CONS X1 X2)) Y))).
This simplifies, using the :definitions MEM, PERM and RM, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/2'''
(IMPLIES (AND (NOT (MEM X1 Y))
(MEM A X2)
(NOT (EQUAL X1 A)))
(EQUAL NIL (PERM (CONS X1 (RM A X2)) Y))).
But simplification reduces this to T, using the :definition PERM, the
:executable-counterpart of EQUAL, primitive type reasoning and the
:rewrite rule CAR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (MEM A (CDR X))
(EQUAL (PERM (CDR X) (CONS A (RM (CAR X) Y)))
(PERM (RM A (CDR X)) (RM (CAR X) Y)))))
(IMPLIES (MEM A X)
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (MEM A (CDR X))
(EQUAL (PERM (CDR X) (CONS A (RM (CAR X) Y)))
(PERM (RM A (CDR X)) (RM (CAR X) Y))))
(MEM A X))
(EQUAL (PERM X (CONS A Y))
(PERM (RM A X) Y))).
This simplifies, using the :definitions MEM, PERM and RM, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the
following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(EQUAL (PERM (CDR X) (CONS A (RM (CAR X) Y)))
(PERM (RM A (CDR X)) (RM (CAR X) Y)))
(MEM A (CDR X))
(EQUAL A (CAR X)))
(EQUAL (PERM X (CONS A Y))
(PERM (CDR X) Y))).
But simplification reduces this to T, using the :definitions MEM, PERM
and RM, primitive type reasoning and the :rewrite rules CAR-CONS and
CDR-CONS.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(EQUAL (PERM (CDR X) (CONS A (RM (CAR X) Y)))
(PERM (RM A (CDR X)) (RM (CAR X) Y)))
(MEM A (CDR X))
(NOT (EQUAL A (CAR X))))
(EQUAL (PERM X (CONS A Y))
(PERM (CONS (CAR X) (RM A (CDR X)))
Y))).
But simplification reduces this to T, using the :definitions MEM, PERM
and RM, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-
CONS and the :type-prescription rule MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-54A ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.12 seconds (prove: 0.07, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-54A
ACL2 >>(THEOREM PROBLEM-54
(IMPLIES (PERM X Y) (PERM Y X))
:HINTS
(("Goal" :INDUCT (PERM X Y)
:IN-THEORY (ENABLE PROBLEM-54A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P (CDR X) (RM (CAR X) Y)))
(:P X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (PERM X Y) (PERM Y X))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (PERM X Y))
(PERM Y X)).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (PERM X Y) (PERM Y X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(PERM X Y))
(PERM Y X)).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM (CAR X) Y) (CDR X))))
(IMPLIES (PERM X Y) (PERM Y X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM (CAR X) Y) (CDR X)))
(PERM X Y))
(PERM Y X)).
This simplifies, using the :definition PERM and the :type-prescription
rule MEM, to
Subgoal *1/1''
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(PERM (RM (CAR X) Y) (CDR X))
(PERM (CDR X) (RM (CAR X) Y)))
(PERM Y X)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/1'''
(IMPLIES (AND (CONSP (CONS X1 X2))
(MEM X1 Y)
(PERM (RM X1 Y) X2)
(PERM X2 (RM X1 Y)))
(PERM Y (CONS X1 X2))).
But simplification reduces this to T, using primitive type reasoning,
the :rewrite rule PROBLEM-54A and the :type-prescription rules MEM
and PERM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-54 depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-54 ...)
Rules: ((:DEFINITION NOT)
(:DEFINITION PERM)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-54A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION PERM))
Warnings: None
Time: 0.11 seconds (prove: 0.02, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-54
ACL2 >>(THEOREM PROBLEM-55A
(IMPLIES (MEM A (RM B X)) (MEM A X))
:HINTS (("Goal" :INDUCT (MEM A X))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-55A ...): The :REWRITE rule
generated from PROBLEM-55A contains the free variable B. This variable
will be chosen by searching for an instance of (MEM A (RM B X)) among
the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM A X). This
suggestion was produced using the :induction rule MEM. If we let
(:P A B X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A B X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(:P A B (CDR X)))
(:P A B X))
(IMPLIES (AND (CONSP X) (EQUAL A (CAR X)))
(:P A B X))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (MEM A (RM B X)) (MEM A X))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (MEM A (RM B X)))
(MEM A X)).
But simplification reduces this to T, using the :definitions MEM and
RM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(IMPLIES (MEM A (RM B (CDR X)))
(MEM A (CDR X))))
(IMPLIES (MEM A (RM B X)) (MEM A X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(IMPLIES (MEM A (RM B (CDR X)))
(MEM A (CDR X)))
(MEM A (RM B X)))
(MEM A X)).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :type-prescription rule MEM, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(NOT (MEM A (RM B (CDR X))))
(NOT (EQUAL B (CAR X)))
(MEM A (CONS (CAR X) (RM B (CDR X)))))
(MEM A (CDR X))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL A (CAR X)))
(IMPLIES (MEM A (RM B X)) (MEM A X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL A (CAR X))
(MEM A (RM B X)))
(MEM A X)).
But simplification reduces this to T, using the :definition MEM and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-55A depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-55A ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MEM))
Warnings: Free
Time: 0.06 seconds (prove: 0.03, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-55A
ACL2 >>(THEOREM PROBLEM-55B
(IMPLIES (AND (PERM X Y) (MEM A X))
(MEM A Y))
:HINTS
(("Goal" :INDUCT (PERM X Y)
:IN-THEORY (ENABLE PROBLEM-55A))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-55B ...): The :REWRITE rule
generated from PROBLEM-55B contains the free variable X. This variable
will be chosen by searching for an instance of (PERM X Y) among the
hypotheses of the conjecture being rewritten. This is generally a
severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P A X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P A X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P A (CDR X) (RM (CAR X) Y)))
(:P A X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (PERM X Y) (MEM A X))
(MEM A Y))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(PERM X Y)
(MEM A X))
(MEM A Y)).
But simplification reduces this to T, using the :definitions MEM and
PERM.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (AND (PERM X Y) (MEM A X))
(MEM A Y))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(PERM X Y)
(MEM A X))
(MEM A Y)).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (AND (PERM (CDR X) (RM (CAR X) Y))
(MEM A (CDR X)))
(MEM A (RM (CAR X) Y))))
(IMPLIES (AND (PERM X Y) (MEM A X))
(MEM A Y))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (AND (PERM (CDR X) (RM (CAR X) Y))
(MEM A (CDR X)))
(MEM A (RM (CAR X) Y)))
(PERM X Y)
(MEM A X))
(MEM A Y)).
This simplifies, using the :definitions MEM and PERM, primitive type
reasoning, the :rewrite rule PROBLEM-55A and the :type-prescription
rule MEM, to
Subgoal *1/1''
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(NOT (MEM A (CDR X)))
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL A (CAR X)))
(MEM A Y)).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-55B depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-55B ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-55A)
(:TYPE-PRESCRIPTION MEM))
Warnings: Free
Time: 0.15 seconds (prove: 0.01, print: 0.13, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-55B
ACL2 >>(THEOREM PROBLEM-55C
(EQUAL (RM A (RM B X)) (RM B (RM A X)))
:HINTS (("Goal" :INDUCT (RM A X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM A X). This suggestion
was produced using the :induction rule RM. If we let (:P A B X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A B X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(:P A B (CDR X)))
(:P A B X))
(IMPLIES (AND (CONSP X) (EQUAL A (CAR X)))
(:P A B X))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(EQUAL (RM A (RM B X))
(RM B (RM A X)))).
But simplification reduces this to T, using the :definition RM and
primitive type reasoning.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(EQUAL (RM A (RM B (CDR X)))
(RM B (RM A (CDR X)))))
(EQUAL (RM A (RM B X))
(RM B (RM A X)))).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL A (CAR X)))
(EQUAL (RM A (RM B (CDR X)))
(RM B (RM A (CDR X))))
(NOT (EQUAL B (CAR X))))
(EQUAL (RM A (CONS (CAR X) (RM B (CDR X))))
(CONS (CAR X) (RM A (RM B (CDR X)))))).
But simplification reduces this to T, using the :definition RM, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL A (CAR X)))
(EQUAL (RM A (RM B X))
(RM B (RM A X)))).
This simplifies, using the :definition RM and primitive type reasoning,
to
Subgoal *1/1'
(IMPLIES (CONSP X)
(EQUAL (RM (CAR X) (RM B X))
(RM B (CDR X)))).
This simplifies, using the :definition RM, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X) (EQUAL B (CAR X)))
(EQUAL (RM (CAR X) (CDR X))
(RM B (CDR X)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X) (NOT (EQUAL B (CAR X))))
(EQUAL (RM (CAR X)
(CONS (CAR X) (RM B (CDR X))))
(RM B (CDR X)))).
But simplification reduces this to T, using the :definition RM, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-55C ...)
Rules: ((:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-55C
ACL2 >>(THEOREM PROBLEM-55D
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E X))
(MEM E (RM D X)))
:HINTS
(("Goal" :INDUCT (RM D X)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM D X). This suggestion
was produced using the :induction rule RM. If we let (:P D E X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P D E X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(:P D E (CDR X)))
(:P D E X))
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(:P D E X))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E X))
(MEM E (RM D X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(NOT (EQUAL E D))
(MEM E X))
(MEM E (RM D X))).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E (CDR X)))
(MEM E (RM D (CDR X)))))
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E X))
(MEM E (RM D X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E (CDR X)))
(MEM E (RM D (CDR X))))
(NOT (EQUAL E D))
(MEM E X))
(MEM E (RM D X))).
But simplification reduces this to T, using the :definitions MEM and
RM, the :executable-counterpart of NOT, primitive type reasoning, the
:rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and PROBLEM-49A and the
:type-prescription rule MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(IMPLIES (AND (NOT (EQUAL E D)) (MEM E X))
(MEM E (RM D X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL D (CAR X))
(NOT (EQUAL E D))
(MEM E X))
(MEM E (RM D X))).
This simplifies, using the :definition RM and primitive type reasoning,
to
Subgoal *1/1''
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(MEM E X))
(MEM E (CDR X))).
But simplification reduces this to T, using the :definition MEM and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-55D depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-55D ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.01, print: 0.10, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-55D
ACL2 >>(THEOREM PROBLEM-55E
(IMPLIES (PERM X Y)
(PERM (RM A X) (RM A Y)))
:HINTS
(("Goal" :INDUCT (PERM X Y)
:IN-THEORY
(ENABLE PROBLEM-54A
PROBLEM-54 PROBLEM-55C PROBLEM-55D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P A X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P A X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P A (CDR X) (RM (CAR X) Y)))
(:P A X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (PERM X Y)
(PERM (RM A X) (RM A Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (PERM X Y))
(PERM (RM A X) (RM A Y))).
But simplification reduces this to T, using the :definitions PERM and
RM and the :rewrite rule PROBLEM-54.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (PERM X Y)
(PERM (RM A X) (RM A Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(PERM X Y))
(PERM (RM A X) (RM A Y))).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM A (CDR X))
(RM A (RM (CAR X) Y)))))
(IMPLIES (PERM X Y)
(PERM (RM A X) (RM A Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM A (CDR X))
(RM A (RM (CAR X) Y))))
(PERM X Y))
(PERM (RM A X) (RM A Y))).
This simplifies, using the :definitions PERM and RM and the :type-
prescription rule MEM, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(PERM (RM A (CDR X))
(RM A (RM (CAR X) Y)))
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL A (CAR X)))
(PERM (CDR X) (RM A Y))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(PERM (RM A (CDR X))
(RM A (RM (CAR X) Y)))
(PERM (CDR X) (RM (CAR X) Y))
(NOT (EQUAL A (CAR X))))
(PERM (CONS (CAR X) (RM A (CDR X)))
(RM A Y))).
But simplification reduces this to T, using primitive type reasoning,
the :rewrite rules PROBLEM-54, PROBLEM-54A, PROBLEM-55C and PROBLEM-
55D and the :type-prescription rules MEM and PERM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-55E depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-55E ...)
Rules: ((:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55C)
(:REWRITE PROBLEM-55D)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION PERM))
Warnings: None
Time: 0.20 seconds (prove: 0.04, print: 0.15, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-55E
ACL2 >>(THEOREM PROBLEM-55
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z))
:HINTS
(("Goal" :INDUCT (LIST (PERM X Y) (PERM X Z))
:IN-THEORY
(ENABLE PROBLEM-54 PROBLEM-55B PROBLEM-55E))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-55 ...): The :REWRITE rule
generated from PROBLEM-55 contains the free variable Y. This variable
will be chosen by searching for an instance of (PERM X Y) among the
hypotheses of the conjecture being rewritten. This is generally a
severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (PERM X Z), but modified
to accommodate (PERM X Y). These suggestions were produced using the
:induction rule PERM. If we let (:P X Y Z) denote *1 above then the
induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y Z))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Z)))
(:P X Y Z))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Z)
(:P (CDR X)
(RM (CAR X) Y)
(RM (CAR X) Z)))
(:P X Y Z))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variables Y and Z are being
instantiated. When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(PERM X Y)
(PERM Y Z))
(PERM X Z)).
But simplification reduces this to T, using the :definition PERM and
the :rewrite rule PROBLEM-54.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Z)))
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Z))
(PERM X Y)
(PERM Y Z))
(PERM X Z)).
This simplifies, using the :definition PERM, the :rewrite rule PROBLEM-
55B and the :type-prescription rules MEM and PERM, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Z))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(PERM Y Z))
(PERM (CDR X) (RM (CAR X) Z))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
55B and the :type-prescription rules MEM and PERM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Z)
(IMPLIES (AND (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM (CAR X) Y) (RM (CAR X) Z)))
(PERM (CDR X) (RM (CAR X) Z))))
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Z)
(IMPLIES (AND (PERM (CDR X) (RM (CAR X) Y))
(PERM (RM (CAR X) Y) (RM (CAR X) Z)))
(PERM (CDR X) (RM (CAR X) Z)))
(PERM X Y)
(PERM Y Z))
(PERM X Z)).
But simplification reduces this to T, using the :definition PERM, the
:rewrite rules PROBLEM-55B and PROBLEM-55E and the :type-prescription
rules MEM and PERM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-55 depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-55 ...)
Rules: ((:DEFINITION NOT)
(:DEFINITION PERM)
(:INDUCTION PERM)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-55B)
(:REWRITE PROBLEM-55E)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION PERM))
Warnings: Free
Time: 0.12 seconds (prove: 0.02, print: 0.06, other: 0.04)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-55
ACL2 >>(DEFUN <<= (X Y) (LEXORDER X Y))
Since <<= is non-recursive, its admission is trivial. We observe that
the type of <<= is described by the theorem
(OR (EQUAL (<<= X Y) T) (EQUAL (<<= X Y) NIL)). We used the :type-
prescription rule LEXORDER.
Summary
Form: ( DEFUN <<= ...)
Rules: ((:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
<<=
ACL2 >>(THEOREM <<=-NON-STRICT-TOTAL-ORDER
(AND (<<= X X)
(IMPLIES (AND (<<= X Y) (<<= Y X))
(EQUAL X Y))
(IMPLIES (AND (<<= X Y) (<<= Y Z))
(<<= X Z))
(OR (<<= X Y) (<<= Y X)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definition <<= and the simple :rewrite rule LEXORDER-
REFLEXIVE we reduce the conjecture to the following three conjectures.
Subgoal 3
(IMPLIES (AND (LEXORDER X Y) (LEXORDER Y X))
(EQUAL X Y)).
But we reduce the conjecture to T, by primitive type reasoning, the
:forward-chaining rule LEXORDER-ANTI-SYMMETRIC and the :type-prescription
rule LEXORDER.
Subgoal 2
(IMPLIES (AND (LEXORDER X Y) (LEXORDER Y Z))
(LEXORDER X Z)).
But simplification reduces this to T, using the :rewrite rule LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal 1
(OR (LEXORDER X Y) (LEXORDER Y X)).
But we reduce the conjecture to T, by primitive type reasoning, the
:forward-chaining rule LEXORDER-TOTAL and the :type-prescription rule
LEXORDER.
Q.E.D.
Summary
Form: ( DEFTHM <<=-NON-STRICT-TOTAL-ORDER ...)
Rules: ((:DEFINITION <<=)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-ANTI-SYMMETRIC)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.03, other: 0.00)
<<=-NON-STRICT-TOTAL-ORDER
ACL2 >>(DEFUN ORDERED (X)
(IF (CONSP X)
(IF (CONSP (CDR X))
(AND (<<= (CAR X) (CADR X))
(ORDERED (CDR X)))
T)
T))
The admission of ORDERED is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of ORDERED is described by
the theorem (OR (EQUAL (ORDERED X) T) (EQUAL (ORDERED X) NIL)).
Summary
Form: ( DEFUN ORDERED ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
ORDERED
ACL2 >>(DEFUN INSERT (E X)
(IF (CONSP X)
(IF (<<= E (CAR X))
(CONS E X)
(CONS (CAR X) (INSERT E (CDR X))))
(CONS E NIL)))
The admission of INSERT is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of INSERT is described by
the theorem (CONSP (INSERT E X)). We used primitive type reasoning.
Summary
Form: ( DEFUN INSERT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
INSERT
ACL2 >>(DEFUN ISORT (X)
(IF (CONSP X)
(INSERT (CAR X) (ISORT (CDR X)))
NIL))
The admission of ISORT is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of ISORT is described by
the theorem (OR (CONSP (ISORT X)) (EQUAL (ISORT X) NIL)). We used
the :type-prescription rule INSERT.
Summary
Form: ( DEFUN ISORT ...)
Rules: ((:TYPE-PRESCRIPTION INSERT))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
ISORT
ACL2 >>(THEOREM PROBLEM-58A
(IMPLIES (ORDERED X)
(ORDERED (INSERT E X)))
:HINTS (("Goal" :INDUCT (INSERT E X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (INSERT E X). This
suggestion was produced using the :induction rule INSERT. If we let
(:P E X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(:P E X))).
This induction is justified by the same argument used to admit INSERT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (ORDERED X)
(ORDERED (INSERT E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (ORDERED X))
(ORDERED (INSERT E X))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, the :executable-counterpart of CONSP, primitive type reasoning
and the :rewrite rule CDR-CONS.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(IMPLIES (ORDERED (CDR X))
(ORDERED (INSERT E (CDR X)))))
(IMPLIES (ORDERED X)
(ORDERED (INSERT E X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(IMPLIES (ORDERED (CDR X))
(ORDERED (INSERT E (CDR X))))
(ORDERED X))
(ORDERED (INSERT E X))).
This simplifies, using the :definitions <<=, INSERT and ORDERED, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rules INSERT, LEXORDER and ORDERED, to the following four
conjectures.
Subgoal *1/2.4
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(NOT (ORDERED (CDR X)))
(NOT (CONSP (CDR X))))
(LEXORDER (CAR X)
(CAR (INSERT E (CDR X))))).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1/2.3
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(NOT (ORDERED (CDR X)))
(NOT (CONSP (CDR X))))
(ORDERED (INSERT E (CDR X)))).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(ORDERED (INSERT E (CDR X)))
(NOT (CONSP (CDR X))))
(LEXORDER (CAR X)
(CAR (INSERT E (CDR X))))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, the :executable-counterpart of CONSP, primitive type reasoning,
the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(ORDERED (INSERT E (CDR X)))
(LEXORDER (CAR X) (CADR X))
(ORDERED (CDR X)))
(LEXORDER (CAR X)
(CAR (INSERT E (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2. (2) Use CAR-CDR-ELIM, again, to replace X2
by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These steps
produce the following two goals.
Subgoal *1/2.1.2
(IMPLIES (AND (NOT (CONSP X2))
(CONSP (CONS X1 X2))
(NOT (LEXORDER E X1))
(ORDERED (INSERT E X2))
(LEXORDER X1 (CAR X2))
(ORDERED X2))
(LEXORDER X1 (CAR (INSERT E X2)))).
But simplification reduces this to T, using the :definitions INSERT
and ORDERED, the :executable-counterpart of CONSP, primitive type reasoning,
the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS,
CDR-CONS, DEFAULT-CAR, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and
the :type-prescription rule LEXORDER.
Subgoal *1/2.1.1
(IMPLIES (AND (CONSP (CONS X3 X4))
(CONSP (LIST* X1 X3 X4))
(NOT (LEXORDER E X1))
(ORDERED (INSERT E (CONS X3 X4)))
(LEXORDER X1 X3)
(ORDERED (CONS X3 X4)))
(LEXORDER X1 (CAR (INSERT E (CONS X3 X4))))).
But simplification reduces this to T, using the :definitions <<=, INSERT
and ORDERED, primitive type reasoning, the :forward-chaining rule LEXORDER-
TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and
LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(IMPLIES (ORDERED X)
(ORDERED (INSERT E X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(ORDERED X))
(ORDERED (INSERT E X))).
But simplification reduces this to T, using the :definitions <<=, INSERT
and ORDERED, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rules LEXORDER and ORDERED.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-58A depends upon the :type-prescription rule
ORDERED.
Summary
Form: ( DEFTHM PROBLEM-58A ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION INSERT)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CAR)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION INSERT)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION ORDERED))
Warnings: None
Time: 0.10 seconds (prove: 0.02, print: 0.07, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-58A
ACL2 >>(THEOREM PROBLEM-58 (ORDERED (ISORT X))
:HINTS
(("Goal" :INDUCT (ISORT X)
:IN-THEORY (ENABLE PROBLEM-58A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ISORT X). This
suggestion was produced using the :induction rule ISORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit ISORT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(ORDERED (ISORT X))).
But simplification reduces this to T, using the :definition ISORT and
the :executable-counterpart of ORDERED.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(ORDERED (ISORT (CDR X))))
(ORDERED (ISORT X))).
But simplification reduces this to T, using the :definition ISORT,
the :rewrite rule PROBLEM-58A and the :type-prescription rule ORDERED.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-58 depends upon the :type-prescription rule
ORDERED.
Summary
Form: ( DEFTHM PROBLEM-58 ...)
Rules: ((:DEFINITION ISORT)
(:EXECUTABLE-COUNTERPART ORDERED)
(:INDUCTION ISORT)
(:REWRITE PROBLEM-58A)
(:TYPE-PRESCRIPTION ORDERED))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-58
ACL2 >>(THEOREM PROBLEM-59A
(IMPLIES (PERM A B)
(PERM (INSERT E A) (CONS E B)))
:HINTS
(("Goal" :INDUCT (PERM A B)
:IN-THEORY
(ENABLE PROBLEM-48
PROBLEM-49A PROBLEM-54A PROBLEM-54))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM A B). This
suggestion was produced using the :induction rule PERM. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(:P A B E))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) (RM (CAR A) B) E))
(:P A B E))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (PERM A B)
(PERM (INSERT E A) (CONS E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A)) (PERM A B))
(PERM (INSERT E A) (CONS E B))).
But simplification reduces this to T, using the :definitions INSERT,
MEM, PERM and RM, the :executable-counterpart of CONSP, primitive type
reasoning and the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-54 and
PROBLEM-54A.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(IMPLIES (PERM A B)
(PERM (INSERT E A) (CONS E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(PERM A B))
(PERM (INSERT E A) (CONS E B))).
But simplification reduces this to T, using the :definition PERM.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(PERM (INSERT E (CDR A))
(CONS E (RM (CAR A) B)))))
(IMPLIES (PERM A B)
(PERM (INSERT E A) (CONS E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(PERM (INSERT E (CDR A))
(CONS E (RM (CAR A) B))))
(PERM A B))
(PERM (INSERT E A) (CONS E B))).
This simplifies, using the :definitions <<=, INSERT and PERM, the :rewrite
rules PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM,
to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(PERM (INSERT E (CDR A))
(CONS E (RM (CAR A) B)))
(PERM (CDR A) (RM (CAR A) B))
(LEXORDER E (CAR A)))
(PERM (CONS E A) (CONS E B))).
But simplification reduces this to T, using the :definitions MEM, PERM
and RM, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-
CONS, PROBLEM-48, PROBLEM-49A, PROBLEM-54 and PROBLEM-54A and the :type-
prescription rules MEM and PERM.
Subgoal *1/1.1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(PERM (INSERT E (CDR A))
(CONS E (RM (CAR A) B)))
(PERM (CDR A) (RM (CAR A) B))
(NOT (LEXORDER E (CAR A))))
(PERM (CONS (CAR A) (INSERT E (CDR A)))
(CONS E B))).
This simplifies, using the :definitions MEM, PERM and RM, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and
PROBLEM-49A and the :type-prescription rule MEM, to
Subgoal *1/1.1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(PERM (INSERT E (CDR A))
(CONS E (RM (CAR A) B)))
(PERM (CDR A) (RM (CAR A) B))
(NOT (LEXORDER E (CAR A)))
(EQUAL (CAR A) E))
(PERM (INSERT E (CDR A)) B)).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-59A depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-59A ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION INSERT)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION RM)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION PERM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION PERM))
Warnings: None
Time: 0.13 seconds (prove: 0.06, print: 0.07, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-59A
ACL2 >>(THEOREM PROBLEM-59 (PERM (ISORT X) X)
:HINTS
(("Goal" :INDUCT (ISORT X)
:IN-THEORY
(ENABLE PROBLEM-54 PROBLEM-59A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ISORT X). This
suggestion was produced using the :induction rule ISORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit ISORT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(PERM (ISORT X) X)).
But simplification reduces this to T, using the :definitions ISORT
and PERM, the :executable-counterpart of CONSP and the :rewrite rule
PROBLEM-54.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(PERM (ISORT (CDR X)) (CDR X)))
(PERM (ISORT X) X)).
This simplifies, using the :definition ISORT, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(PERM (ISORT (CDR X)) (CDR X)))
(PERM (INSERT (CAR X) (ISORT (CDR X)))
X)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (AND (CONSP (CONS X1 X2))
(PERM (ISORT X2) X2))
(PERM (INSERT X1 (ISORT X2))
(CONS X1 X2))).
But simplification reduces this to T, using primitive type reasoning,
the :rewrite rule PROBLEM-59A and the :type-prescription rule PERM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-59 depends upon the :type-prescription rule
PERM.
Summary
Form: ( DEFTHM PROBLEM-59 ...)
Rules: ((:DEFINITION ISORT)
(:DEFINITION PERM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ISORT)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-59A)
(:TYPE-PRESCRIPTION PERM))
Warnings: None
Time: 0.20 seconds (prove: 0.03, print: 0.17, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-59
ACL2 >>(THEOREM PROBLEM-60A
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))
:HINTS (("Goal" :INDUCT (INSERT E X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (INSERT E X). This
suggestion was produced using the :induction rule INSERT. If we let
(:P D E X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P D E X))
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(:P D E (CDR X)))
(:P D E X))
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(:P D E X))).
This induction is justified by the same argument used to admit INSERT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))).
This simplifies, using the :definitions <<= and INSERT, the :executable-
counterpart of CONSP, primitive type reasoning and the :rewrite rules
CAR-CONS and CDR-CONS, to the following two conjectures.
Subgoal *1/3.2
(IMPLIES (AND (NOT (CONSP X))
(LEXORDER E D)
(LEXORDER D E))
(EQUAL (LIST E D) (LIST D E))).
But simplification reduces this to T, using primitive type reasoning,
the :forward-chaining rule LEXORDER-ANTI-SYMMETRIC and the :type-prescription
rule LEXORDER.
Subgoal *1/3.1
(IMPLIES (AND (NOT (CONSP X))
(NOT (LEXORDER E D))
(NOT (LEXORDER D E)))
(EQUAL (LIST D E) (LIST E D))).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(EQUAL (INSERT E (INSERT D (CDR X)))
(INSERT D (INSERT E (CDR X)))))
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(EQUAL (INSERT E (INSERT D (CDR X)))
(INSERT D (INSERT E (CDR X)))))
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))).
This simplifies, using the :definitions <<= and INSERT, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
two conjectures.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(EQUAL (INSERT E (INSERT D (CDR X)))
(INSERT D (INSERT E (CDR X))))
(LEXORDER D (CAR X)))
(EQUAL (INSERT E (CONS D X))
(LIST* D (CAR X) (INSERT E (CDR X))))).
This simplifies, using the :definitions <<= and INSERT, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/2.2'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(EQUAL (INSERT E (INSERT D (CDR X)))
(INSERT D (INSERT E (CDR X))))
(LEXORDER D (CAR X))
(LEXORDER E D))
(EQUAL (LIST* E D X)
(LIST* D (CAR X) (INSERT E (CDR X))))).
But simplification reduces this to T, using the :rewrite rule LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(EQUAL (INSERT E (INSERT D (CDR X)))
(INSERT D (INSERT E (CDR X))))
(NOT (LEXORDER D (CAR X))))
(EQUAL (INSERT E (CONS (CAR X) (INSERT D (CDR X))))
(CONS (CAR X)
(INSERT D (INSERT E (CDR X)))))).
But simplification reduces this to T, using the :definitions <<= and
INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and
CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X) (LEXORDER E (CAR X)))
(EQUAL (INSERT E (INSERT D X))
(INSERT D (INSERT E X)))).
This simplifies, using the :definitions <<= and INSERT, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to
the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(LEXORDER D E))
(EQUAL (INSERT E (INSERT D X))
(LIST* D E X))).
This simplifies, using the :definitions <<= and INSERT, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to
Subgoal *1/1.2'
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(LEXORDER D E)
(LEXORDER E D))
(EQUAL (LIST* E D X) (LIST* D E X))).
But simplification reduces this to T, using primitive type reasoning,
the :forward-chaining rule LEXORDER-ANTI-SYMMETRIC and the :type-prescription
rule LEXORDER.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(NOT (LEXORDER D E)))
(EQUAL (INSERT E (INSERT D X))
(CONS E (INSERT D X)))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/1.1'
(IMPLIES (AND (CONSP (CONS X1 X2))
(LEXORDER E X1)
(NOT (LEXORDER D E)))
(EQUAL (INSERT E (INSERT D (CONS X1 X2)))
(CONS E (INSERT D (CONS X1 X2))))).
This simplifies, using the :definitions <<= and INSERT, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
two conjectures.
Subgoal *1/1.1.2
(IMPLIES (AND (LEXORDER E X1)
(NOT (LEXORDER D E))
(LEXORDER D X1))
(EQUAL (INSERT E (LIST* D X1 X2))
(LIST* E D X1 X2))).
But simplification reduces this to T, using the :definitions <<= and
INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-
TOTAL, the :rewrite rules CAR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/1.1.1
(IMPLIES (AND (LEXORDER E X1)
(NOT (LEXORDER D E))
(NOT (LEXORDER D X1)))
(EQUAL (INSERT E (CONS X1 (INSERT D X2)))
(LIST* E X1 (INSERT D X2)))).
But simplification reduces this to T, using the :definitions <<= and
INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, LEXORDER-
REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60A ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION INSERT)
(:DEFINITION NOT)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-ANTI-SYMMETRIC)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION INSERT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.13 seconds (prove: 0.04, print: 0.09, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-60A
ACL2 >>(THEOREM PROBLEM-60B
(EQUAL (ISORT (APP X (LIST E)))
(INSERT E (ISORT X)))
:HINTS
(("Goal" :INDUCT (ISORT X)
:IN-THEORY (ENABLE PROBLEM-60A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ISORT X). This
suggestion was produced using the :induction rule ISORT. If we let
(:P E X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X) (:P E (CDR X)))
(:P E X))).
This induction is justified by the same argument used to admit ISORT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (ISORT (APP X (LIST E)))
(INSERT E (ISORT X)))).
But simplification reduces this to T, using the :definitions APP, INSERT
and ISORT, the :executable-counterparts of CONSP and ISORT, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (ISORT (APP (CDR X) (LIST E)))
(INSERT E (ISORT (CDR X)))))
(EQUAL (ISORT (APP X (LIST E)))
(INSERT E (ISORT X)))).
But simplification reduces this to T, using the :definitions APP and
ISORT, primitive type reasoning and the :rewrite rules CAR-CONS, CDR-
CONS and PROBLEM-60A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60B ...)
Rules: ((:DEFINITION APP)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART ISORT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ISORT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-60A))
Warnings: None
Time: 0.05 seconds (prove: 0.02, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-60B
ACL2 >>(THEOREM PROBLEM-60C
(EQUAL (ISORT (REV X)) (ISORT X))
:HINTS
(("Goal" :INDUCT (ISORT X)
:IN-THEORY (ENABLE PROBLEM-60B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ISORT X). This
suggestion was produced using the :induction rule ISORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit ISORT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (ISORT (REV X)) (ISORT X))).
But simplification reduces this to T, using the :definitions ISORT
and REV and the :executable-counterparts of EQUAL and ISORT.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (ISORT (REV (CDR X)))
(ISORT (CDR X))))
(EQUAL (ISORT (REV X)) (ISORT X))).
But simplification reduces this to T, using the :definitions ISORT
and REV, primitive type reasoning and the :rewrite rule PROBLEM-60B.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60C ...)
Rules: ((:DEFINITION ISORT)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART ISORT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ISORT)
(:REWRITE PROBLEM-60B))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-60C
ACL2 >>(THEOREM PROBLEM-60D
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))
:HINTS
(("Goal" :INDUCT (INSERT E X)
:IN-THEORY (ENABLE PROBLEM-60A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (INSERT E X). This
suggestion was produced using the :induction rule INSERT. If we let
(:P E X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(:P E X))).
This induction is justified by the same argument used to admit INSERT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))).
But simplification reduces this to T, using the :definitions INSERT
and ISORT, the :executable-counterparts of CONSP and ISORT, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (<<= E (CAR X)))
(EQUAL (ISORT (INSERT E (CDR X)))
(INSERT E (ISORT (CDR X)))))
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(EQUAL (ISORT (INSERT E (CDR X)))
(INSERT E (ISORT (CDR X)))))
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))).
But simplification reduces this to T, using the :definitions <<=, INSERT
and ISORT, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and PROBLEM-60A.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (<<= E (CAR X)))
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))).
By the simple :definition <<= we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X) (LEXORDER E (CAR X)))
(EQUAL (ISORT (INSERT E X))
(INSERT E (ISORT X)))).
But simplification reduces this to T, using the :definitions <<=, INSERT
and ISORT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-
CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription
rule LEXORDER.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60D ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION INSERT)
(:DEFINITION ISORT)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART ISORT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION INSERT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-60A)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.09 seconds (prove: 0.04, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-60D
ACL2 >>(THEOREM PROBLEM-60E
(EQUAL (ISORT (ISORT X)) (ISORT X))
:HINTS
(("Goal" :INDUCT (ISORT X)
:IN-THEORY (ENABLE PROBLEM-60D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ISORT X). This
suggestion was produced using the :induction rule ISORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit ISORT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (ISORT (ISORT X)) (ISORT X))).
But simplification reduces this to T, using the :definition ISORT and
the :executable-counterparts of EQUAL and ISORT.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (ISORT (ISORT (CDR X)))
(ISORT (CDR X))))
(EQUAL (ISORT (ISORT X)) (ISORT X))).
But simplification reduces this to T, using the :definition ISORT,
primitive type reasoning and the :rewrite rule PROBLEM-60D.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60E ...)
Rules: ((:DEFINITION ISORT)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART ISORT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ISORT)
(:REWRITE PROBLEM-60D))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-60E
ACL2 >>(THEOREM PROBLEM-60
(EQUAL (ISORT (REV (ISORT L)))
(ISORT L))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-60C PROBLEM-60E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the simple :rewrite rules PROBLEM-
60C and PROBLEM-60E.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-60 ...)
Rules: ((:REWRITE PROBLEM-60C)
(:REWRITE PROBLEM-60E))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-60
ACL2 >>(DEFUN REV1 (X A)
(IF (CONSP X)
(REV1 (CDR X) (CONS (CAR X) A))
A))
The admission of REV1 is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of REV1 is described by the
theorem (OR (CONSP (REV1 X A)) (EQUAL (REV1 X A) A)). We used primitive
type reasoning.
Summary
Form: ( DEFUN REV1 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
REV1
ACL2 >>(THEOREM PROBLEM-61A
(EQUAL (REV1 X A) (APP (REV X) A))
:HINTS
(("Goal" :INDUCT (REV1 X A)
:IN-THEORY (ENABLE PROBLEM-40))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REV1 X A). This
suggestion was produced using the :induction rule REV1. If we let
(:P A X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X))
(IMPLIES (AND (CONSP X)
(:P (CONS (CAR X) A) (CDR X)))
(:P A X))).
This induction is justified by the same argument used to admit REV1,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable A is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (REV1 X A) (APP (REV X) A))).
But simplification reduces this to T, using the :definitions APP, REV
and REV1, the :executable-counterpart of CONSP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (REV1 (CDR X) (CONS (CAR X) A))
(APP (REV (CDR X)) (CONS (CAR X) A))))
(EQUAL (REV1 X A) (APP (REV X) A))).
But simplification reduces this to T, using the :definitions APP, REV
and REV1, the :executable-counterpart of CONSP, primitive type reasoning
and the :rewrite rules CAR-CONS, CDR-CONS and PROBLEM-40.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-61A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION REV)
(:DEFINITION REV1)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION REV1)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-40))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-61A
ACL2 >>(THEOREM PROBLEM-61 (EQUAL (REV1 X NIL) (REV X))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-41 PROBLEM-44B PROBLEM-61A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :rewrite rule PROBLEM-61A we reduce the conjecture to
Goal'
(EQUAL (APP (REV X) NIL) (REV X)).
But simplification reduces this to T, using primitive type reasoning
and the :rewrite rules PROBLEM-41 and PROBLEM-44B.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-61 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE PROBLEM-41)
(:REWRITE PROBLEM-44B)
(:REWRITE PROBLEM-61A))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-61
ACL2 >>(THEOREM PROBLEM-62-DIRECT
(EQUAL (MAPNIL1 A NIL) (MAPNIL A))
:HINTS
(("Goal" :INDUCT (MAPNIL A)
:IN-THEORY (ENABLE PROBLEM-51A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL A). This
suggestion was produced using the :induction rule MAPNIL. If we let
(:P A) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A))
(IMPLIES (AND (CONSP A) (:P (CDR A)))
(:P A))).
This induction is justified by the same argument used to admit MAPNIL,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (MAPNIL1 A NIL) (MAPNIL A))).
But simplification reduces this to T, using the :definitions MAPNIL
and MAPNIL1 and the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) NIL)
(MAPNIL (CDR A))))
(EQUAL (MAPNIL1 A NIL) (MAPNIL A))).
This simplifies, using the :definition MAPNIL, to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) NIL)
(MAPNIL (CDR A))))
(EQUAL (MAPNIL1 A NIL)
(CONS NIL (MAPNIL (CDR A))))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (AND (CONSP (CONS A1 A2))
(EQUAL (MAPNIL1 A2 NIL) (MAPNIL A2)))
(EQUAL (MAPNIL1 (CONS A1 A2) NIL)
(CONS NIL (MAPNIL A2)))).
But simplification reduces this to T, using the :definition MAPNIL1,
the :executable-counterpart of CONS, primitive type reasoning and the
:rewrite rules CDR-CONS and PROBLEM-51A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-62-DIRECT ...)
Rules: ((:DEFINITION MAPNIL)
(:DEFINITION MAPNIL1)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-51A))
Warnings: None
Time: 0.08 seconds (prove: 0.00, print: 0.07, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-62-DIRECT
ACL2 >>(THEOREM PROBLEM-62A
(IMPLIES (NILS A)
(EQUAL (APP A (CONS NIL B))
(CONS NIL (APP A B))))
:HINTS (("Goal" :INDUCT (APP A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(IMPLIES (NILS A)
(EQUAL (APP A (CONS NIL B))
(CONS NIL (APP A B))))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP A)) (NILS A))
(EQUAL (APP A (CONS NIL B))
(CONS NIL (APP A B)))).
But simplification reduces this to T, using the :definitions APP and
NILS, the :executable-counterpart of CONSP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(IMPLIES (NILS (CDR A))
(EQUAL (APP (CDR A) (CONS NIL B))
(CONS NIL (APP (CDR A) B)))))
(IMPLIES (NILS A)
(EQUAL (APP A (CONS NIL B))
(CONS NIL (APP A B))))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(IMPLIES (NILS (CDR A))
(EQUAL (APP (CDR A) (CONS NIL B))
(CONS NIL (APP (CDR A) B))))
(NILS A))
(EQUAL (APP A (CONS NIL B))
(CONS NIL (APP A B)))).
But simplification reduces this to T, using the :definitions APP and
NILS and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-62A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION NILS)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP))
Warnings: None
Time: 0.07 seconds (prove: 0.01, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-62A
ACL2 >>(THEOREM PROBLEM-62B (NILS (MAPNIL A))
:HINTS (("Goal" :INDUCT (MAPNIL A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL A). This
suggestion was produced using the :induction rule MAPNIL. If we let
(:P A) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A))
(IMPLIES (AND (CONSP A) (:P (CDR A)))
(:P A))).
This induction is justified by the same argument used to admit MAPNIL,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(NILS (MAPNIL A))).
But simplification reduces this to T, using the :definition MAPNIL
and the :executable-counterpart of NILS.
Subgoal *1/1
(IMPLIES (AND (CONSP A) (NILS (MAPNIL (CDR A))))
(NILS (MAPNIL A))).
But simplification reduces this to T, using the :definitions MAPNIL
and NILS, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rules MAPNIL and NILS.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-62B depends upon the :type-prescription rule
NILS.
Summary
Form: ( DEFTHM PROBLEM-62B ...)
Rules: ((:DEFINITION MAPNIL)
(:DEFINITION NILS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NILS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MAPNIL)
(:TYPE-PRESCRIPTION NILS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-62B
ACL2 >>(THEOREM PROBLEM-62C
(EQUAL (MAPNIL1 A B) (APP (MAPNIL A) B))
:HINTS
(("Goal" :INDUCT (MAPNIL1 A B)
:IN-THEORY
(ENABLE PROBLEM-62A PROBLEM-62B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL1 A B). This
suggestion was produced using the :induction rule MAPNIL1. If we let
(:P A B) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A)
(:P (CDR A) (CONS NIL B)))
(:P A B))).
This induction is justified by the same argument used to admit MAPNIL1,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (MAPNIL1 A B)
(APP (MAPNIL A) B))).
But simplification reduces this to T, using the :definitions APP, MAPNIL
and MAPNIL1, the :executable-counterpart of CONSP and primitive type
reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (MAPNIL1 (CDR A) (CONS NIL B))
(APP (MAPNIL (CDR A)) (CONS NIL B))))
(EQUAL (MAPNIL1 A B)
(APP (MAPNIL A) B))).
But simplification reduces this to T, using the :definitions APP, MAPNIL
and MAPNIL1, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, PROBLEM-62A and PROBLEM-62B and the :type-prescription rule
MAPNIL.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-62C ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MAPNIL)
(:DEFINITION MAPNIL1)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL1)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-62A)
(:REWRITE PROBLEM-62B)
(:TYPE-PRESCRIPTION MAPNIL))
Warnings: None
Time: 0.06 seconds (prove: 0.01, print: 0.03, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-62C
ACL2 >>(THEOREM PROBLEM-62D (PROPER (MAPNIL A))
:HINTS (("Goal" :INDUCT (MAPNIL A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MAPNIL A). This
suggestion was produced using the :induction rule MAPNIL. If we let
(:P A) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A))
(IMPLIES (AND (CONSP A) (:P (CDR A)))
(:P A))).
This induction is justified by the same argument used to admit MAPNIL,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(PROPER (MAPNIL A))).
But simplification reduces this to T, using the :definition MAPNIL
and the :executable-counterpart of PROPER.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(PROPER (MAPNIL (CDR A))))
(PROPER (MAPNIL A))).
But simplification reduces this to T, using the :definitions MAPNIL
and PROPER, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rules MAPNIL and PROPER.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-62D depends upon the :type-prescription rule
PROPER.
Summary
Form: ( DEFTHM PROBLEM-62D ...)
Rules: ((:DEFINITION MAPNIL)
(:DEFINITION PROPER)
(:EXECUTABLE-COUNTERPART PROPER)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MAPNIL)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION MAPNIL)
(:TYPE-PRESCRIPTION PROPER))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.04, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-62D
ACL2 >>(THEOREM PROBLEM-62
(EQUAL (MAPNIL1 A NIL) (MAPNIL A))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-41 PROBLEM-62C PROBLEM-62D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :rewrite rule PROBLEM-62C we reduce the conjecture to
Goal'
(EQUAL (APP (MAPNIL A) NIL) (MAPNIL A)).
But simplification reduces this to T, using primitive type reasoning
and the :rewrite rules PROBLEM-41 and PROBLEM-62D.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-62 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE PROBLEM-41)
(:REWRITE PROBLEM-62C)
(:REWRITE PROBLEM-62D))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-62
ACL2 >>(DEFUN MCFLATTEN (X A)
(IF (CONSP X)
(MCFLATTEN (CAR X)
(MCFLATTEN (CDR X) A))
(CONS X A)))
The admission of MCFLATTEN is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We observe that the type of MCFLATTEN is described
by the theorem (CONSP (MCFLATTEN X A)). We used primitive type reasoning.
Summary
Form: ( DEFUN MCFLATTEN ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
MCFLATTEN
ACL2 >>(THEOREM PROBLEM-64A
(EQUAL (MCFLATTEN X A)
(APP (FLATTEN X) A))
:HINTS
(("Goal" :INDUCT (MCFLATTEN X A)
:IN-THEORY (ENABLE PROBLEM-40))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MCFLATTEN X A).
This suggestion was produced using the :induction rule MCFLATTEN.
If we let (:P A X) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X))
(IMPLIES (AND (CONSP X)
(:P (MCFLATTEN (CDR X) A) (CAR X))
(:P A (CDR X)))
(:P A X))).
This induction is justified by the same argument used to admit MCFLATTEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable A is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (MCFLATTEN X A)
(APP (FLATTEN X) A))).
But simplification reduces this to T, using the :definitions APP, FLATTEN
and MCFLATTEN, the :executable-counterpart of CONSP, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (MCFLATTEN (CAR X)
(MCFLATTEN (CDR X) A))
(APP (FLATTEN (CAR X))
(MCFLATTEN (CDR X) A)))
(EQUAL (MCFLATTEN (CDR X) A)
(APP (FLATTEN (CDR X)) A)))
(EQUAL (MCFLATTEN X A)
(APP (FLATTEN X) A))).
But simplification reduces this to T, using the :definitions FLATTEN
and MCFLATTEN, primitive type reasoning and the :rewrite rule PROBLEM-
40.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-64A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION FLATTEN)
(:DEFINITION MCFLATTEN)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MCFLATTEN)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-40))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.01, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-64A
ACL2 >>(THEOREM PROBLEM-64B (PROPER (FLATTEN X))
:HINTS
(("Goal" :INDUCT (FLATTEN X)
:IN-THEORY (ENABLE PROBLEM-44C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FLATTEN X). This
suggestion was produced using the :induction rule FLATTEN. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X)
(:P (CAR X))
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit FLATTEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(PROPER (FLATTEN X))).
But simplification reduces this to T, using the :definitions FLATTEN
and PROPER, the :executable-counterpart of PROPER, primitive type reasoning
and the :rewrite rule CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(PROPER (FLATTEN (CAR X)))
(PROPER (FLATTEN (CDR X))))
(PROPER (FLATTEN X))).
But simplification reduces this to T, using the :definition FLATTEN,
the :rewrite rule PROBLEM-44C and the :type-prescription rule PROPER.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-64B depends upon the :type-prescription rule
PROPER.
Summary
Form: ( DEFTHM PROBLEM-64B ...)
Rules: ((:DEFINITION FLATTEN)
(:DEFINITION PROPER)
(:EXECUTABLE-COUNTERPART PROPER)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FLATTEN)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-44C)
(:TYPE-PRESCRIPTION PROPER))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-64B
ACL2 >>(THEOREM PROBLEM-64
(EQUAL (MCFLATTEN X NIL) (FLATTEN X))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-41 PROBLEM-64A PROBLEM-64B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :rewrite rule PROBLEM-64A we reduce the conjecture to
Goal'
(EQUAL (APP (FLATTEN X) NIL)
(FLATTEN X)).
But simplification reduces this to T, using primitive type reasoning
and the :rewrite rules PROBLEM-41 and PROBLEM-64B.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-64 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE PROBLEM-41)
(:REWRITE PROBLEM-64A)
(:REWRITE PROBLEM-64B))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-64
ACL2 >>(DEFUN NAT (X)
(IF (CONSP X)
(AND (EQUAL (CAR X) NIL) (NAT (CDR X)))
(EQUAL X NIL)))
The admission of NAT is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of NAT is described by the
theorem (OR (EQUAL (NAT X) T) (EQUAL (NAT X) NIL)). We used primitive
type reasoning.
Summary
Form: ( DEFUN NAT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
NAT
ACL2 >>(DEFUN FIX-NAT (X)
(IF (CONSP X)
(CONS NIL (FIX-NAT (CDR X)))
NIL))
The admission of FIX-NAT is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of FIX-NAT is described by
the theorem (TRUE-LISTP (FIX-NAT X)). We used primitive type reasoning.
Summary
Form: ( DEFUN FIX-NAT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
FIX-NAT
ACL2 >>(THEOREM PROBLEM-66A (NAT (FIX-NAT X))
:HINTS (("Goal" :INDUCT (FIX-NAT X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FIX-NAT X). This
suggestion was produced using the :induction rule FIX-NAT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit FIX-
NAT, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(NAT (FIX-NAT X))).
But simplification reduces this to T, using the :definition FIX-NAT
and the :executable-counterpart of NAT.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (NAT (FIX-NAT (CDR X))))
(NAT (FIX-NAT X))).
But simplification reduces this to T, using the :definitions FIX-NAT
and NAT, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rules FIX-NAT and NAT.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-66A depends upon the :type-prescription rule
NAT.
Summary
Form: ( DEFTHM PROBLEM-66A ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION NAT)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NAT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FIX-NAT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT)
(:TYPE-PRESCRIPTION NAT))
Warnings: None
Time: 0.12 seconds (prove: 0.01, print: 0.10, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-66A
ACL2 >>(THEOREM PROBLEM-66B
(IMPLIES (NAT X) (EQUAL (FIX-NAT X) X))
:HINTS (("Goal" :INDUCT (NAT X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NAT X). This suggestion
was produced using the :induction rule NAT. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (CAR X)) (:P X))
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit NAT,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (NAT X)
(EQUAL (FIX-NAT X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (NAT X))
(EQUAL (FIX-NAT X) X)).
But simplification reduces this to T, using the :definition NAT, the
:executable-counterparts of CONSP, EQUAL and FIX-NAT and primitive
type reasoning.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (CAR X))
(IMPLIES (NAT X)
(EQUAL (FIX-NAT X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X) (CAR X) (NAT X))
(EQUAL (FIX-NAT X) X)).
But simplification reduces this to T, using the :definition NAT and
primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(IMPLIES (NAT (CDR X))
(EQUAL (FIX-NAT (CDR X)) (CDR X))))
(IMPLIES (NAT X)
(EQUAL (FIX-NAT X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(IMPLIES (NAT (CDR X))
(EQUAL (FIX-NAT (CDR X)) (CDR X)))
(NAT X))
(EQUAL (FIX-NAT X) X)).
But simplification reduces this to T, using the :definitions FIX-NAT
and NAT, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-66B ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION NAT)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIX-NAT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION NAT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-66B
ACL2 >>(DEFUN PLUS (X Y)
(IF (CONSP X)
(CONS NIL (PLUS (CDR X) Y))
(FIX-NAT Y)))
The admission of PLUS is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of PLUS is described by the
theorem (TRUE-LISTP (PLUS X Y)). We used primitive type reasoning
and the :type-prescription rule FIX-NAT.
Summary
Form: ( DEFUN PLUS ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PLUS
ACL2 >>(THEOREM PROBLEM-66C (NAT (PLUS X Y))
:HINTS
(("Goal" :INDUCT (PLUS X Y)
:IN-THEORY (ENABLE PROBLEM-66A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS X Y). This
suggestion was produced using the :induction rule PLUS. If we let
(:P X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X) (:P (CDR X) Y))
(:P X Y))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(NAT (PLUS X Y))).
But simplification reduces this to T, using the :definition PLUS and
the :rewrite rule PROBLEM-66A.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (NAT (PLUS (CDR X) Y)))
(NAT (PLUS X Y))).
But simplification reduces this to T, using the :definitions NAT and
PLUS, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rules NAT and PLUS.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-66C depends upon the :type-prescription rule
NAT.
Summary
Form: ( DEFTHM PROBLEM-66C ...)
Rules: ((:DEFINITION NAT)
(:DEFINITION PLUS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-66A)
(:TYPE-PRESCRIPTION NAT)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-66C
ACL2 >>(THEOREM PROBLEM-66D
(EQUAL (PLUS (FIX-NAT I) J) (PLUS I J))
:HINTS (("Goal" :INDUCT (PLUS I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I J). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (PLUS (FIX-NAT I) J)
(PLUS I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and PLUS, the :executable-counterpart of CONSP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (FIX-NAT (CDR I)) J)
(PLUS (CDR I) J)))
(EQUAL (PLUS (FIX-NAT I) J)
(PLUS I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and PLUS, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-66D ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION PLUS)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.04, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-66D
ACL2 >>(THEOREM PROBLEM-66E
(EQUAL (PLUS I (FIX-NAT J)) (PLUS I J))
:HINTS
(("Goal" :INDUCT (PLUS I J)
:IN-THEORY
(ENABLE PROBLEM-66A PROBLEM-66B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I J). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (PLUS I (FIX-NAT J))
(PLUS I J))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rules PROBLEM-66A and PROBLEM-66B.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (CDR I) (FIX-NAT J))
(PLUS (CDR I) J)))
(EQUAL (PLUS I (FIX-NAT J))
(PLUS I J))).
But simplification reduces this to T, using the :definition PLUS and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-66E ...)
Rules: ((:DEFINITION PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE PROBLEM-66A)
(:REWRITE PROBLEM-66B))
Warnings: None
Time: 0.06 seconds (prove: 0.01, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-66E
ACL2 >>(DEFUN TIMES (X Y)
(IF (CONSP X)
(PLUS Y (TIMES (CDR X) Y))
NIL))
The admission of TIMES is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of TIMES is described by
the theorem (TRUE-LISTP (TIMES X Y)). We used the :type-prescription
rule PLUS.
Summary
Form: ( DEFUN TIMES ...)
Rules: ((:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
TIMES
ACL2 >>(THEOREM PROBLEM-67A (NAT (TIMES X Y))
:HINTS
(("Goal" :INDUCT (TIMES X Y)
:IN-THEORY (ENABLE PROBLEM-66C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES X Y). This
suggestion was produced using the :induction rule TIMES. If we let
(:P X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X) (:P (CDR X) Y))
(:P X Y))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(NAT (TIMES X Y))).
But simplification reduces this to T, using the :definition TIMES and
the :executable-counterpart of NAT.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (NAT (TIMES (CDR X) Y)))
(NAT (TIMES X Y))).
But simplification reduces this to T, using the :definition TIMES and
the :rewrite rule PROBLEM-66C.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-67A depends upon the :type-prescription rule
NAT.
Summary
Form: ( DEFTHM PROBLEM-67A ...)
Rules: ((:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART NAT)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-66C)
(:TYPE-PRESCRIPTION NAT))
Warnings: None
Time: 0.07 seconds (prove: 0.03, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-67A
ACL2 >>(THEOREM PROBLEM-67B
(EQUAL (TIMES (FIX-NAT I) J)
(TIMES I J))
:HINTS (("Goal" :INDUCT (TIMES I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES (FIX-NAT I) J)
(TIMES I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and TIMES and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (FIX-NAT (CDR I)) J)
(TIMES (CDR I) J)))
(EQUAL (TIMES (FIX-NAT I) J)
(TIMES I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and TIMES, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-67B ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-67B
ACL2 >>(THEOREM PROBLEM-67C
(EQUAL (TIMES I (FIX-NAT J))
(TIMES I J))
:HINTS
(("Goal" :INDUCT (TIMES I J)
:IN-THEORY (ENABLE PROBLEM-66D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES I (FIX-NAT J))
(TIMES I J))).
But simplification reduces this to T, using the :definition TIMES and
the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) (FIX-NAT J))
(TIMES (CDR I) J)))
(EQUAL (TIMES I (FIX-NAT J))
(TIMES I J))).
But simplification reduces this to T, using the :definition TIMES,
primitive type reasoning and the :rewrite rule PROBLEM-66D.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-67C ...)
Rules: ((:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-66D))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-67C
ACL2 >>(DEFUN POWER (X Y)
(IF (CONSP Y)
(TIMES X (POWER X (CDR Y)))
'(NIL)))
The admission of POWER is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT Y). We observe that the type of POWER is described by
the theorem (TRUE-LISTP (POWER X Y)). We used the :type-prescription
rule TIMES.
Summary
Form: ( DEFUN POWER ...)
Rules: ((:TYPE-PRESCRIPTION TIMES))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
POWER
ACL2 >>(THEOREM PROBLEM-68A (NAT (POWER X Y))
:HINTS
(("Goal" :INDUCT (POWER X Y)
:IN-THEORY (ENABLE PROBLEM-67A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER X Y). This
suggestion was produced using the :induction rule POWER. If we let
(:P X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP Y)) (:P X Y))
(IMPLIES (AND (CONSP Y) (:P X (CDR Y)))
(:P X Y))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT Y) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP Y))
(NAT (POWER X Y))).
But simplification reduces this to T, using the :definition POWER and
the :executable-counterpart of NAT.
Subgoal *1/1
(IMPLIES (AND (CONSP Y) (NAT (POWER X (CDR Y))))
(NAT (POWER X Y))).
But simplification reduces this to T, using the :definition POWER and
the :rewrite rule PROBLEM-67A.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-68A depends upon the :type-prescription rule
NAT.
Summary
Form: ( DEFTHM PROBLEM-68A ...)
Rules: ((:DEFINITION POWER)
(:EXECUTABLE-COUNTERPART NAT)
(:INDUCTION POWER)
(:REWRITE PROBLEM-67A)
(:TYPE-PRESCRIPTION NAT))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.02, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-68A
ACL2 >>(THEOREM PROBLEM-68B
(EQUAL (POWER (FIX-NAT I) J)
(POWER I J))
:HINTS
(("Goal" :INDUCT (POWER I J)
:IN-THEORY (ENABLE PROBLEM-67B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER I J). This
suggestion was produced using the :induction rule POWER. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP J)) (:P I J))
(IMPLIES (AND (CONSP J) (:P I (CDR J)))
(:P I J))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT J) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP J))
(EQUAL (POWER (FIX-NAT I) J)
(POWER I J))).
But simplification reduces this to T, using the :definition POWER and
the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP J)
(EQUAL (POWER (FIX-NAT I) (CDR J))
(POWER I (CDR J))))
(EQUAL (POWER (FIX-NAT I) J)
(POWER I J))).
But simplification reduces this to T, using the :definition POWER,
primitive type reasoning and the :rewrite rule PROBLEM-67B.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-68B ...)
Rules: ((:DEFINITION POWER)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION POWER)
(:REWRITE PROBLEM-67B))
Warnings: None
Time: 0.06 seconds (prove: 0.03, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-68B
ACL2 >>(THEOREM PROBLEM-68C
(EQUAL (POWER I (FIX-NAT J))
(POWER I J))
:HINTS (("Goal" :INDUCT (POWER I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER I J). This
suggestion was produced using the :induction rule POWER. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP J)) (:P I J))
(IMPLIES (AND (CONSP J) (:P I (CDR J)))
(:P I J))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT J) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP J))
(EQUAL (POWER I (FIX-NAT J))
(POWER I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and POWER and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP J)
(EQUAL (POWER I (FIX-NAT (CDR J)))
(POWER I (CDR J))))
(EQUAL (POWER I (FIX-NAT J))
(POWER I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and POWER, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-68C ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION POWER)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION POWER)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-68C
ACL2 >>(DEFUN LESSEQP (X Y)
(IF (CONSP X)
(IF (CONSP Y)
(LESSEQP (CDR X) (CDR Y))
NIL)
T))
The admission of LESSEQP is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of LESSEQP is described by
the theorem (OR (EQUAL (LESSEQP X Y) T) (EQUAL (LESSEQP X Y) NIL)).
Summary
Form: ( DEFUN LESSEQP ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
LESSEQP
ACL2 >>(THEOREM PROBLEM-69A
(EQUAL (LESSEQP (FIX-NAT I) J)
(LESSEQP I J))
:HINTS
(("Goal" :INDUCT
(LIST (FIX-NAT I) (LESSEQP I J)))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. Subsumption reduces that number to one.
We will induct according to a scheme suggested by (LESSEQP I J). This
suggestion was produced using the :induction rules FIX-NAT and LESSEQP.
If we let (:P I J) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (NOT (CONSP J)))
(:P I J))
(IMPLIES (AND (CONSP I)
(CONSP J)
(:P (CDR I) (CDR J)))
(:P I J))).
This induction is justified by the same argument used to admit LESSEQP,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable J is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP I))
(EQUAL (LESSEQP (FIX-NAT I) J)
(LESSEQP I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and LESSEQP and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP I) (NOT (CONSP J)))
(EQUAL (LESSEQP (FIX-NAT I) J)
(LESSEQP I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and LESSEQP, the :executable-counterpart of EQUAL, primitive type reasoning
and the :type-prescription rule FIX-NAT.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP J)
(EQUAL (LESSEQP (FIX-NAT (CDR I)) (CDR J))
(LESSEQP (CDR I) (CDR J))))
(EQUAL (LESSEQP (FIX-NAT I) J)
(LESSEQP I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and LESSEQP, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-69A ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION LESSEQP)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FIX-NAT)
(:INDUCTION LESSEQP)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.09 seconds (prove: 0.00, print: 0.09, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-69A
ACL2 >>(THEOREM PROBLEM-69B
(EQUAL (LESSEQP I (FIX-NAT J))
(LESSEQP I J))
:HINTS (("Goal" :INDUCT (LESSEQP I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LESSEQP I J). This
suggestion was produced using the :induction rule LESSEQP. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (NOT (CONSP J)))
(:P I J))
(IMPLIES (AND (CONSP I)
(CONSP J)
(:P (CDR I) (CDR J)))
(:P I J))).
This induction is justified by the same argument used to admit LESSEQP,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable J is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP I))
(EQUAL (LESSEQP I (FIX-NAT J))
(LESSEQP I J))).
But simplification reduces this to T, using the :definition LESSEQP
and the :executable-counterpart of EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP I) (NOT (CONSP J)))
(EQUAL (LESSEQP I (FIX-NAT J))
(LESSEQP I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and LESSEQP and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP J)
(EQUAL (LESSEQP (CDR I) (FIX-NAT (CDR J)))
(LESSEQP (CDR I) (CDR J))))
(EQUAL (LESSEQP I (FIX-NAT J))
(LESSEQP I J))).
But simplification reduces this to T, using the :definitions FIX-NAT
and LESSEQP, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-69B ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION LESSEQP)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LESSEQP)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-69B
ACL2 >>(DEFUN EVENNAT (X)
(IF (CONSP X)
(IF (CONSP (CDR X))
(EVENNAT (CDR (CDR X)))
NIL)
T))
For the admission of EVENNAT we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). The non-trivial part of the measure conjecture is
Goal
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (ACL2-COUNT (CDDR X))
(ACL2-COUNT X))).
This simplifies, using the :definitions O-FINP and O< and the :type-
prescription rule ACL2-COUNT, to
Goal'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (ACL2-COUNT (CDDR X))
(ACL2-COUNT X))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2. (2) Use CAR-CDR-ELIM, again, to replace X2
by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These steps
produce the following goal.
Goal''
(IMPLIES (AND (CONSP (CONS X3 X4))
(CONSP (LIST* X1 X3 X4)))
(< (ACL2-COUNT X4)
(ACL2-COUNT (LIST* X1 X3 X4)))).
This simplifies, using the :definition ACL2-COUNT, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Goal'''
(< (ACL2-COUNT X4)
(+ 1 (ACL2-COUNT X1)
1 (ACL2-COUNT X3)
(ACL2-COUNT X4))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule ACL2-COUNT.
Q.E.D.
That completes the proof of the measure theorem for EVENNAT. Thus,
we admit this function under the principle of definition. We observe
that the type of EVENNAT is described by the theorem
(OR (EQUAL (EVENNAT X) T) (EQUAL (EVENNAT X) NIL)).
Summary
Form: ( DEFUN EVENNAT ...)
Rules: ((:DEFINITION ACL2-COUNT)
(:DEFINITION NOT)
(:DEFINITION O-FINP)
(:DEFINITION O<)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings: None
Time: 0.03 seconds (prove: 0.02, print: 0.00, other: 0.01)
EVENNAT
ACL2 >>(THEOREM PROBLEM-70A
(EQUAL (EVENNAT (FIX-NAT I))
(EVENNAT I))
:HINTS (("Goal" :INDUCT (EVENNAT I))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (EVENNAT I). This
suggestion was produced using the :induction rule EVENNAT. If we let
(:P I) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I))
(IMPLIES (AND (CONSP I) (NOT (CONSP (CDR I))))
(:P I))
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(:P (CDDR I)))
(:P I))).
This induction is justified by the same argument used to admit EVENNAT,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP I))
(EQUAL (EVENNAT (FIX-NAT I))
(EVENNAT I))).
But simplification reduces this to T, using the :definitions EVENNAT
and FIX-NAT and the :executable-counterparts of EQUAL and EVENNAT.
Subgoal *1/2
(IMPLIES (AND (CONSP I) (NOT (CONSP (CDR I))))
(EQUAL (EVENNAT (FIX-NAT I))
(EVENNAT I))).
But simplification reduces this to T, using the :definitions EVENNAT
and FIX-NAT and the :executable-counterparts of CONS, EQUAL and EVENNAT.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(EQUAL (EVENNAT (FIX-NAT (CDDR I)))
(EVENNAT (CDDR I))))
(EQUAL (EVENNAT (FIX-NAT I))
(EVENNAT I))).
But simplification reduces this to T, using the :definitions EVENNAT
and FIX-NAT, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule FIX-NAT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-70A ...)
Rules: ((:DEFINITION EVENNAT)
(:DEFINITION FIX-NAT)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART EVENNAT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION EVENNAT)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION FIX-NAT))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.00, other: 0.05)
PROBLEM-70A
ACL2 >>(THEOREM PROBLEM-71A
(IMPLIES (NOT (CONSP Z))
(EQUAL (PLUS I Z) (FIX-NAT I)))
:HINTS (("Goal" :INDUCT (PLUS I Z))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I Z). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I Z) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I Z))
(IMPLIES (AND (CONSP I) (:P (CDR I) Z))
(:P I Z))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(IMPLIES (NOT (CONSP Z))
(EQUAL (PLUS I Z) (FIX-NAT I)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP I)) (NOT (CONSP Z)))
(EQUAL (PLUS I Z) (FIX-NAT I))).
But simplification reduces this to T, using the :definitions FIX-NAT
and PLUS and the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(IMPLIES (NOT (CONSP Z))
(EQUAL (PLUS (CDR I) Z)
(FIX-NAT (CDR I)))))
(IMPLIES (NOT (CONSP Z))
(EQUAL (PLUS I Z) (FIX-NAT I)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(IMPLIES (NOT (CONSP Z))
(EQUAL (PLUS (CDR I) Z)
(FIX-NAT (CDR I))))
(NOT (CONSP Z)))
(EQUAL (PLUS I Z) (FIX-NAT I))).
But simplification reduces this to T, using the :definitions FIX-NAT
and PLUS, the :executable-counterpart of NOT and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-71A ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION NOT)
(:DEFINITION PLUS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-71A
ACL2 >>(THEOREM PROBLEM-71
(IMPLIES (NAT I) (EQUAL (PLUS I NIL) I))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-66B PROBLEM-71A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using primitive type reasoning,
the :rewrite rules PROBLEM-66B and PROBLEM-71A and the :type-prescription
rule NAT.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-71 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE PROBLEM-66B)
(:REWRITE PROBLEM-71A)
(:TYPE-PRESCRIPTION NAT))
Warnings: None
Time: 0.03 seconds (prove: 0.02, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-71
ACL2 >>(THEOREM PROBLEM-72
(EQUAL (PLUS (PLUS I J) K)
(PLUS I (PLUS J K)))
:HINTS
(("Goal" :INDUCT (PLUS I J)
:IN-THEORY
(ENABLE PROBLEM-66B PROBLEM-66C PROBLEM-66D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I J). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (:P (CDR I) J K))
(:P I J K))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (PLUS (PLUS I J) K)
(PLUS I (PLUS J K)))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rules PROBLEM-66B, PROBLEM-66C and
PROBLEM-66D.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (PLUS (CDR I) J) K)
(PLUS (CDR I) (PLUS J K))))
(EQUAL (PLUS (PLUS I J) K)
(PLUS I (PLUS J K)))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning, the :rewrite rule CDR-CONS and the :type-prescription
rule PLUS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-72 ...)
Rules: ((:DEFINITION PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-66B)
(:REWRITE PROBLEM-66C)
(:REWRITE PROBLEM-66D)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.06 seconds (prove: 0.03, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-72
ACL2 >>(THEOREM PROBLEM-73A
(EQUAL (PLUS I (CONS X J))
(CONS NIL (PLUS I J)))
:HINTS (("Goal" :INDUCT (PLUS I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I J). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J X))
(IMPLIES (AND (CONSP I) (:P (CDR I) J X))
(:P I J X))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (PLUS I (CONS X J))
(CONS NIL (PLUS I J)))).
But simplification reduces this to T, using the :definitions FIX-NAT
and PLUS, primitive type reasoning and the :rewrite rule CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (CDR I) (CONS X J))
(CONS NIL (PLUS (CDR I) J))))
(EQUAL (PLUS I (CONS X J))
(CONS NIL (PLUS I J)))).
But simplification reduces this to T, using the :definition PLUS and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-73A ...)
Rules: ((:DEFINITION FIX-NAT)
(:DEFINITION PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.03 seconds (prove: 0.01, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-73A
ACL2 >>(THEOREM PROBLEM-73 (EQUAL (PLUS I J) (PLUS J I))
:HINTS
(("Goal" :INDUCT (PLUS I J)
:IN-THEORY
(ENABLE PROBLEM-71A PROBLEM-73A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I J). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (PLUS I J) (PLUS J I))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rule PROBLEM-71A.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (CDR I) J)
(PLUS J (CDR I))))
(EQUAL (PLUS I J) (PLUS J I))).
This simplifies, using the :definition PLUS, to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(EQUAL (PLUS (CDR I) J)
(PLUS J (CDR I))))
(EQUAL (CONS NIL (PLUS J (CDR I)))
(PLUS J I))).
The destructor terms (CAR I) and (CDR I) can be eliminated by using
CAR-CDR-ELIM to replace I by (CONS I1 I2), (CAR I) by I1 and (CDR I)
by I2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (AND (CONSP (CONS I1 I2))
(EQUAL (PLUS I2 J) (PLUS J I2)))
(EQUAL (CONS NIL (PLUS J I2))
(PLUS J (CONS I1 I2)))).
But we reduce the conjecture to T, by the simple :rewrite rule PROBLEM-
73A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-73 ...)
Rules: ((:DEFINITION PLUS)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE PROBLEM-71A)
(:REWRITE PROBLEM-73A))
Warnings: None
Time: 0.04 seconds (prove: 0.02, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-73
ACL2 >>(THEOREM PROBLEM-74A
(EQUAL (PLUS I (PLUS J K))
(PLUS J (PLUS I K)))
:HINTS
(("Goal" :INDUCT (PLUS J K)
:IN-THEORY
(ENABLE PROBLEM-66B
PROBLEM-66C PROBLEM-66E PROBLEM-73A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS J K). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP J)) (:P I J K))
(IMPLIES (AND (CONSP J) (:P I (CDR J) K))
(:P I J K))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT J) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP J))
(EQUAL (PLUS I (PLUS J K))
(PLUS J (PLUS I K)))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rules PROBLEM-66B, PROBLEM-66C and
PROBLEM-66E.
Subgoal *1/1
(IMPLIES (AND (CONSP J)
(EQUAL (PLUS I (PLUS (CDR J) K))
(PLUS (CDR J) (PLUS I K))))
(EQUAL (PLUS I (PLUS J K))
(PLUS J (PLUS I K)))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rule PROBLEM-73A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-74A ...)
Rules: ((:DEFINITION PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE PROBLEM-66B)
(:REWRITE PROBLEM-66C)
(:REWRITE PROBLEM-66E)
(:REWRITE PROBLEM-73A))
Warnings: None
Time: 0.04 seconds (prove: 0.03, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-74A
ACL2 >>(THEOREM PROBLEM-74B
(EQUAL (TIMES (PLUS I J) K)
(PLUS (TIMES I K) (TIMES J K)))
:HINTS
(("Goal" :INDUCT (TIMES I K)
:IN-THEORY
(ENABLE PROBLEM-66B PROBLEM-67A
PROBLEM-67B PROBLEM-73 PROBLEM-74A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I K). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (:P (CDR I) J K))
(:P I J K))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES (PLUS I J) K)
(PLUS (TIMES I K) (TIMES J K)))).
But simplification reduces this to T, using the :definitions PLUS and
TIMES, the :executable-counterpart of CONSP, primitive type reasoning
and the :rewrite rules PROBLEM-66B, PROBLEM-67A and PROBLEM-67B.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (PLUS (CDR I) J) K)
(PLUS (TIMES (CDR I) K) (TIMES J K))))
(EQUAL (TIMES (PLUS I J) K)
(PLUS (TIMES I K) (TIMES J K)))).
But simplification reduces this to T, using the :definitions PLUS and
TIMES, primitive type reasoning, the :rewrite rules CDR-CONS, PROBLEM-
73 and PROBLEM-74A and the :type-prescription rule PLUS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-74B ...)
Rules: ((:DEFINITION PLUS)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-66B)
(:REWRITE PROBLEM-67A)
(:REWRITE PROBLEM-67B)
(:REWRITE PROBLEM-73)
(:REWRITE PROBLEM-74A)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-74B
ACL2 >>(THEOREM PROBLEM-74
(EQUAL (TIMES (TIMES I J) K)
(TIMES I (TIMES J K)))
:HINTS
(("Goal" :INDUCT (TIMES I J)
:IN-THEORY (ENABLE PROBLEM-74B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (:P (CDR I) J K))
(:P I J K))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES (TIMES I J) K)
(TIMES I (TIMES J K)))).
But simplification reduces this to T, using the :definition TIMES and
the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (TIMES (CDR I) J) K)
(TIMES (CDR I) (TIMES J K))))
(EQUAL (TIMES (TIMES I J) K)
(TIMES I (TIMES J K)))).
But simplification reduces this to T, using the :definition TIMES,
primitive type reasoning and the :rewrite rule PROBLEM-74B.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-74 ...)
Rules: ((:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-74B))
Warnings: None
Time: 0.06 seconds (prove: 0.02, print: 0.02, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-74
ACL2 >>(THEOREM PROBLEM-75A
(IMPLIES (NOT (CONSP Z))
(EQUAL (TIMES I Z) NIL))
:HINTS
(("Goal" :INDUCT (TIMES I Z)
:IN-THEORY
(ENABLE PROBLEM-71A PROBLEM-73))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I Z). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I Z) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I Z))
(IMPLIES (AND (CONSP I) (:P (CDR I) Z))
(:P I Z))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(IMPLIES (NOT (CONSP Z))
(EQUAL (TIMES I Z) NIL))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP I)) (NOT (CONSP Z)))
(EQUAL (TIMES I Z) NIL)).
But simplification reduces this to T, using the :definition TIMES and
the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(IMPLIES (NOT (CONSP Z))
(EQUAL (TIMES (CDR I) Z) NIL)))
(IMPLIES (NOT (CONSP Z))
(EQUAL (TIMES I Z) NIL))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(IMPLIES (NOT (CONSP Z))
(EQUAL (TIMES (CDR I) Z) NIL))
(NOT (CONSP Z)))
(EQUAL (TIMES I Z) NIL)).
But simplification reduces this to T, using the :definition TIMES,
the :executable-counterparts of EQUAL, FIX-NAT and NOT, primitive type
reasoning and the :rewrite rules PROBLEM-71A and PROBLEM-73.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-75A ...)
Rules: ((:DEFINITION NOT)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIX-NAT)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-71A)
(:REWRITE PROBLEM-73))
Warnings: None
Time: 0.07 seconds (prove: 0.01, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-75A
ACL2 >>(THEOREM PROBLEM-75B
(EQUAL (TIMES I (CONS X J))
(PLUS I (TIMES I J)))
:HINTS
(("Goal" :INDUCT (TIMES I J)
:IN-THEORY
(ENABLE PROBLEM-71A PROBLEM-73 PROBLEM-74A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J X))
(IMPLIES (AND (CONSP I) (:P (CDR I) J X))
(:P I J X))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES I (CONS X J))
(PLUS I (TIMES I J)))).
But simplification reduces this to T, using the :definition TIMES,
the :executable-counterparts of EQUAL and FIX-NAT and the :rewrite
rules PROBLEM-71A and PROBLEM-73.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) (CONS X J))
(PLUS (CDR I) (TIMES (CDR I) J))))
(EQUAL (TIMES I (CONS X J))
(PLUS I (TIMES I J)))).
This simplifies, using the :definitions PLUS and TIMES, primitive type
reasoning and the :rewrite rule CDR-CONS, to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) (CONS X J))
(PLUS (CDR I) (TIMES (CDR I) J))))
(EQUAL (CONS NIL (PLUS J (TIMES (CDR I) (CONS X J))))
(PLUS I (PLUS J (TIMES (CDR I) J))))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rule PROBLEM-74A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-75B ...)
Rules: ((:DEFINITION PLUS)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIX-NAT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-71A)
(:REWRITE PROBLEM-73)
(:REWRITE PROBLEM-74A))
Warnings: None
Time: 0.15 seconds (prove: 0.01, print: 0.13, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-75B
ACL2 >>(THEOREM PROBLEM-75
(EQUAL (TIMES I J) (TIMES J I))
:HINTS
(("Goal" :INDUCT (TIMES I J)
:IN-THEORY
(ENABLE PROBLEM-75A PROBLEM-75B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (:P (CDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES I J) (TIMES J I))).
But simplification reduces this to T, using the :definition TIMES,
the :executable-counterpart of EQUAL and the :rewrite rule PROBLEM-
75A.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) J)
(TIMES J (CDR I))))
(EQUAL (TIMES I J) (TIMES J I))).
This simplifies, using the :definition TIMES, to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) J)
(TIMES J (CDR I))))
(EQUAL (PLUS J (TIMES J (CDR I)))
(TIMES J I))).
The destructor terms (CAR I) and (CDR I) can be eliminated by using
CAR-CDR-ELIM to replace I by (CONS I1 I2), (CAR I) by I1 and (CDR I)
by I2. This produces the following goal.
Subgoal *1/1''
(IMPLIES (AND (CONSP (CONS I1 I2))
(EQUAL (TIMES I2 J) (TIMES J I2)))
(EQUAL (PLUS J (TIMES J I2))
(TIMES J (CONS I1 I2)))).
But we reduce the conjecture to T, by the simple :rewrite rule PROBLEM-
75B.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-75 ...)
Rules: ((:DEFINITION TIMES)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-75A)
(:REWRITE PROBLEM-75B))
Warnings: None
Time: 0.08 seconds (prove: 0.03, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-75
ACL2 >>(THEOREM PROBLEM-76A
(EQUAL (TIMES I (PLUS J K))
(PLUS (TIMES I J) (TIMES I K)))
:HINTS
(("Goal" :INDUCT (TIMES I K)
:IN-THEORY
(ENABLE PROBLEM-72 PROBLEM-73 PROBLEM-74A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I K). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (:P (CDR I) J K))
(:P I J K))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (TIMES I (PLUS J K))
(PLUS (TIMES I J) (TIMES I K)))).
But simplification reduces this to T, using the :definition TIMES and
the :executable-counterparts of EQUAL and PLUS.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (TIMES (CDR I) (PLUS J K))
(PLUS (TIMES (CDR I) J)
(TIMES (CDR I) K))))
(EQUAL (TIMES I (PLUS J K))
(PLUS (TIMES I J) (TIMES I K)))).
But simplification reduces this to T, using the :definition TIMES,
primitive type reasoning and the :rewrite rules PROBLEM-72, PROBLEM-
73 and PROBLEM-74A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-76A ...)
Rules: ((:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-72)
(:REWRITE PROBLEM-73)
(:REWRITE PROBLEM-74A))
Warnings: None
Time: 0.07 seconds (prove: 0.00, print: 0.06, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-76A
ACL2 >>(THEOREM PROBLEM-76B
(EQUAL (TIMES I (TIMES J K))
(TIMES J (TIMES I K)))
:HINTS
(("Goal" :INDUCT (TIMES J K)
:IN-THEORY
(ENABLE PROBLEM-75 PROBLEM-76A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES J K). This
suggestion was produced using the :induction rule TIMES. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP J)) (:P I J K))
(IMPLIES (AND (CONSP J) (:P I (CDR J) K))
(:P I J K))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT J) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP J))
(EQUAL (TIMES I (TIMES J K))
(TIMES J (TIMES I K)))).
But simplification reduces this to T, using the :definition TIMES,
the :executable-counterparts of CONSP and EQUAL and the :rewrite rule
PROBLEM-75.
Subgoal *1/1
(IMPLIES (AND (CONSP J)
(EQUAL (TIMES I (TIMES (CDR J) K))
(TIMES (CDR J) (TIMES I K))))
(EQUAL (TIMES I (TIMES J K))
(TIMES J (TIMES I K)))).
But simplification reduces this to T, using the :definition TIMES,
primitive type reasoning and the :rewrite rule PROBLEM-76A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-76B ...)
Rules: ((:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-75)
(:REWRITE PROBLEM-76A))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-76B
ACL2 >>(THEOREM PROBLEM-76
(EQUAL (POWER B (PLUS I J))
(TIMES (POWER B I) (POWER B J)))
:HINTS
(("Goal" :INDUCT (POWER B I)
:IN-THEORY
(ENABLE PROBLEM-66B PROBLEM-68A PROBLEM-68C
PROBLEM-73 PROBLEM-75 PROBLEM-76B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER B I). This
suggestion was produced using the :induction rule POWER. If we let
(:P B I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P B I J))
(IMPLIES (AND (CONSP I) (:P B (CDR I) J))
(:P B I J))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (POWER B (PLUS I J))
(TIMES (POWER B I) (POWER B J)))).
But simplification reduces this to T, using the :definitions PLUS,
POWER and TIMES, the :executable-counterparts of CDR and CONSP, primitive
type reasoning and the :rewrite rules PROBLEM-66B, PROBLEM-68A, PROBLEM-
68C and PROBLEM-73.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (POWER B (PLUS (CDR I) J))
(TIMES (POWER B (CDR I)) (POWER B J))))
(EQUAL (POWER B (PLUS I J))
(TIMES (POWER B I) (POWER B J)))).
But simplification reduces this to T, using the :definitions PLUS and
POWER, primitive type reasoning, the :rewrite rules CDR-CONS, PROBLEM-
73, PROBLEM-75 and PROBLEM-76B and the :type-prescription rule PLUS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-76 ...)
Rules: ((:DEFINITION PLUS)
(:DEFINITION POWER)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION POWER)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-66B)
(:REWRITE PROBLEM-68A)
(:REWRITE PROBLEM-68C)
(:REWRITE PROBLEM-73)
(:REWRITE PROBLEM-75)
(:REWRITE PROBLEM-76B)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.07 seconds (prove: 0.01, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-76
ACL2 >>(THEOREM PROBLEM-77A
(EQUAL (POWER (TIMES A B) I)
(TIMES (POWER A I) (POWER B I)))
:HINTS
(("Goal" :INDUCT (POWER B I)
:IN-THEORY
(ENABLE PROBLEM-74 PROBLEM-75 PROBLEM-76B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER B I). This
suggestion was produced using the :induction rule POWER. If we let
(:P A B I) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P A B I))
(IMPLIES (AND (CONSP I) (:P A B (CDR I)))
(:P A B I))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (POWER (TIMES A B) I)
(TIMES (POWER A I) (POWER B I)))).
But simplification reduces this to T, using the :definition POWER and
the :executable-counterparts of EQUAL and TIMES.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (POWER (TIMES A B) (CDR I))
(TIMES (POWER A (CDR I))
(POWER B (CDR I)))))
(EQUAL (POWER (TIMES A B) I)
(TIMES (POWER A I) (POWER B I)))).
But simplification reduces this to T, using the :definition POWER,
primitive type reasoning and the :rewrite rules PROBLEM-74, PROBLEM-
75 and PROBLEM-76B.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-77A ...)
Rules: ((:DEFINITION POWER)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART TIMES)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION POWER)
(:REWRITE PROBLEM-74)
(:REWRITE PROBLEM-75)
(:REWRITE PROBLEM-76B))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-77A
ACL2 >>(THEOREM PROBLEM-77B
(EQUAL (POWER '(NIL) I) '(NIL))
:HINTS
(("Goal" :INDUCT (POWER '(NIL) I))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (POWER '(NIL) I).
This suggestion was produced using the :induction rule POWER. If we
let (:P I) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I))
(IMPLIES (AND (CONSP I) (:P (CDR I)))
(:P I))).
This induction is justified by the same argument used to admit POWER,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (POWER '(NIL) I) '(NIL))).
But simplification reduces this to T, using the :definition POWER and
the :executable-counterpart of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (POWER '(NIL) (CDR I)) '(NIL)))
(EQUAL (POWER '(NIL) I) '(NIL))).
But simplification reduces this to T, using the :definition POWER and
the :executable-counterparts of EQUAL and TIMES.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-77B ...)
Rules: ((:DEFINITION POWER)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART TIMES)
(:INDUCTION POWER))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-77B
ACL2 >>(THEOREM PROBLEM-77
(EQUAL (POWER (POWER B I) J)
(POWER B (TIMES I J)))
:HINTS
(("Goal" :INDUCT (TIMES I J)
:IN-THEORY
(ENABLE PROBLEM-76 PROBLEM-77A PROBLEM-77B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TIMES I J). This
suggestion was produced using the :induction rule TIMES. If we let
(:P B I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P B I J))
(IMPLIES (AND (CONSP I) (:P B (CDR I) J))
(:P B I J))).
This induction is justified by the same argument used to admit TIMES,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (POWER (POWER B I) J)
(POWER B (TIMES I J)))).
But simplification reduces this to T, using the :definitions POWER
and TIMES, the :executable-counterparts of CONSP and EQUAL and the
:rewrite rule PROBLEM-77B.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (POWER (POWER B (CDR I)) J)
(POWER B (TIMES (CDR I) J))))
(EQUAL (POWER (POWER B I) J)
(POWER B (TIMES I J)))).
But simplification reduces this to T, using the :definitions POWER
and TIMES, primitive type reasoning and the :rewrite rules PROBLEM-
76 and PROBLEM-77A.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-77 ...)
Rules: ((:DEFINITION POWER)
(:DEFINITION TIMES)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TIMES)
(:REWRITE PROBLEM-76)
(:REWRITE PROBLEM-77A)
(:REWRITE PROBLEM-77B))
Warnings: None
Time: 0.06 seconds (prove: 0.03, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-77
ACL2 >>(THEOREM PROBLEM-78 (LESSEQP I I)
:HINTS (("Goal" :INDUCT (LESSEQP I I))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LESSEQP I I). This
suggestion was produced using the :induction rule LESSEQP. If we let
(:P I) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I))
(IMPLIES (AND (CONSP I) (CONSP I) (:P (CDR I)))
(:P I))).
This induction is justified by the same argument used to admit LESSEQP,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I)) (LESSEQP I I)).
But simplification reduces this to T, using the :definition LESSEQP.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP I)
(LESSEQP (CDR I) (CDR I)))
(LESSEQP I I)).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(LESSEQP (CDR I) (CDR I)))
(LESSEQP I I)).
But simplification reduces this to T, using the :definition LESSEQP
and the :type-prescription rule LESSEQP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-78 depends upon the :type-prescription rule
LESSEQP.
Summary
Form: ( DEFTHM PROBLEM-78 ...)
Rules: ((:DEFINITION LESSEQP)
(:DEFINITION NOT)
(:INDUCTION LESSEQP)
(:TYPE-PRESCRIPTION LESSEQP))
Warnings: None
Time: 0.03 seconds (prove: 0.01, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-78
ACL2 >>(THEOREM PROBLEM-79
(IMPLIES (AND (LESSEQP I J) (LESSEQP J K))
(LESSEQP I K))
:HINTS
(("Goal" :INDUCT
(LIST (LESSEQP I J) (LESSEQP I K)))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-79 ...): The :REWRITE rule
generated from PROBLEM-79 contains the free variable J. This variable
will be chosen by searching for an instance of (LESSEQP I J) among
the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (LESSEQP I K), but
modified to accommodate (LESSEQP I J). These suggestions were produced
using the :induction rule LESSEQP. If we let (:P I J K) denote *1
above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (NOT (CONSP K)))
(:P I J K))
(IMPLIES (AND (CONSP I)
(CONSP K)
(:P (CDR I) (CDR J) (CDR K)))
(:P I J K))).
This induction is justified by the same argument used to admit LESSEQP,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variables J and K are being
instantiated. When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP I))
(IMPLIES (AND (LESSEQP I J) (LESSEQP J K))
(LESSEQP I K))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP I))
(LESSEQP I J)
(LESSEQP J K))
(LESSEQP I K)).
But simplification reduces this to T, using the :definition LESSEQP.
Subgoal *1/2
(IMPLIES (AND (CONSP I) (NOT (CONSP K)))
(IMPLIES (AND (LESSEQP I J) (LESSEQP J K))
(LESSEQP I K))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP I)
(NOT (CONSP K))
(LESSEQP I J)
(LESSEQP J K))
(LESSEQP I K)).
But simplification reduces this to T, using the :definition LESSEQP.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP K)
(IMPLIES (AND (LESSEQP (CDR I) (CDR J))
(LESSEQP (CDR J) (CDR K)))
(LESSEQP (CDR I) (CDR K))))
(IMPLIES (AND (LESSEQP I J) (LESSEQP J K))
(LESSEQP I K))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(CONSP K)
(IMPLIES (AND (LESSEQP (CDR I) (CDR J))
(LESSEQP (CDR J) (CDR K)))
(LESSEQP (CDR I) (CDR K)))
(LESSEQP I J)
(LESSEQP J K))
(LESSEQP I K)).
But simplification reduces this to T, using the :definition LESSEQP
and the :type-prescription rule LESSEQP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-79 depends upon the :type-prescription rule
LESSEQP.
Summary
Form: ( DEFTHM PROBLEM-79 ...)
Rules: ((:DEFINITION LESSEQP)
(:DEFINITION NOT)
(:INDUCTION LESSEQP)
(:TYPE-PRESCRIPTION LESSEQP))
Warnings: Free
Time: 0.11 seconds (prove: 0.04, print: 0.04, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-79
ACL2 >>(THEOREM PROBLEM-80
(EQUAL (LESSEQP (PLUS I J) (PLUS I K))
(LESSEQP J K))
:HINTS
(("Goal" :INDUCT (PLUS I K)
:IN-THEORY
(ENABLE PROBLEM-69A PROBLEM-69B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PLUS I K). This
suggestion was produced using the :induction rule PLUS. If we let
(:P I J K) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J K))
(IMPLIES (AND (CONSP I) (:P (CDR I) J K))
(:P I J K))).
This induction is justified by the same argument used to admit PLUS,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP I))
(EQUAL (LESSEQP (PLUS I J) (PLUS I K))
(LESSEQP J K))).
But simplification reduces this to T, using the :definition PLUS, primitive
type reasoning and the :rewrite rules PROBLEM-69A and PROBLEM-69B.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(EQUAL (LESSEQP (PLUS (CDR I) J)
(PLUS (CDR I) K))
(LESSEQP J K)))
(EQUAL (LESSEQP (PLUS I J) (PLUS I K))
(LESSEQP J K))).
But simplification reduces this to T, using the :definitions LESSEQP
and PLUS, primitive type reasoning, the :rewrite rule CDR-CONS and
the :type-prescription rule PLUS.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-80 ...)
Rules: ((:DEFINITION LESSEQP)
(:DEFINITION PLUS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PLUS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-69A)
(:REWRITE PROBLEM-69B)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.06 seconds (prove: 0.00, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-80
ACL2 >>(THEOREM PROBLEM-81
(IMPLIES (AND (EVENNAT I) (EVENNAT J))
(EVENNAT (PLUS I J)))
:HINTS
(("Goal" :INDUCT (EVENNAT I)
:IN-THEORY
(ENABLE PROBLEM-70A PROBLEM-73 PROBLEM-73A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (EVENNAT I). This
suggestion was produced using the :induction rule EVENNAT. If we let
(:P I J) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP I)) (:P I J))
(IMPLIES (AND (CONSP I) (NOT (CONSP (CDR I))))
(:P I J))
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(:P (CDDR I) J))
(:P I J))).
This induction is justified by the same argument used to admit EVENNAT,
namely, the measure (ACL2-COUNT I) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP I))
(IMPLIES (AND (EVENNAT I) (EVENNAT J))
(EVENNAT (PLUS I J)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP I))
(EVENNAT I)
(EVENNAT J))
(EVENNAT (PLUS I J))).
But simplification reduces this to T, using the :definitions EVENNAT
and PLUS, the :rewrite rule PROBLEM-70A and the :type-prescription
rule EVENNAT.
Subgoal *1/2
(IMPLIES (AND (CONSP I) (NOT (CONSP (CDR I))))
(IMPLIES (AND (EVENNAT I) (EVENNAT J))
(EVENNAT (PLUS I J)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP I)
(NOT (CONSP (CDR I)))
(EVENNAT I)
(EVENNAT J))
(EVENNAT (PLUS I J))).
But simplification reduces this to T, using the :definition EVENNAT.
Subgoal *1/1
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(IMPLIES (AND (EVENNAT (CDDR I)) (EVENNAT J))
(EVENNAT (PLUS (CDDR I) J))))
(IMPLIES (AND (EVENNAT I) (EVENNAT J))
(EVENNAT (PLUS I J)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(IMPLIES (AND (EVENNAT (CDDR I)) (EVENNAT J))
(EVENNAT (PLUS (CDDR I) J)))
(EVENNAT I)
(EVENNAT J))
(EVENNAT (PLUS I J))).
This simplifies, using the :definitions EVENNAT and PLUS, the :rewrite
rule PROBLEM-73 and the :type-prescription rule EVENNAT, to
Subgoal *1/1''
(IMPLIES (AND (CONSP I)
(CONSP (CDR I))
(EVENNAT (PLUS J (CDDR I)))
(EVENNAT (CDDR I))
(EVENNAT J))
(EVENNAT (CONS NIL (PLUS J (CDR I))))).
The destructor terms (CAR I) and (CDR I) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace I by (CONS I1 I2), (CAR I)
by I1 and (CDR I) by I2. (2) Use CAR-CDR-ELIM, again, to replace I2
by (CONS I3 I4), (CAR I2) by I3 and (CDR I2) by I4. These steps
produce the following goal.
Subgoal *1/1'''
(IMPLIES (AND (CONSP (CONS I3 I4))
(CONSP (LIST* I1 I3 I4))
(EVENNAT (PLUS J I4))
(EVENNAT I4)
(EVENNAT J))
(EVENNAT (CONS NIL (PLUS J (CONS I3 I4))))).
By the simple :rewrite rule PROBLEM-73A we reduce the conjecture to
Subgoal *1/1'4'
(IMPLIES (AND (CONSP (CONS I3 I4))
(CONSP (LIST* I1 I3 I4))
(EVENNAT (PLUS J I4))
(EVENNAT I4)
(EVENNAT J))
(EVENNAT (LIST* NIL NIL (PLUS J I4)))).
But simplification reduces this to T, using the :definition EVENNAT,
primitive type reasoning, the :rewrite rules CDR-CONS and PROBLEM-73
and the :type-prescription rules EVENNAT and PLUS.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-81 depends upon the :type-prescription rule
EVENNAT.
Summary
Form: ( DEFTHM PROBLEM-81 ...)
Rules: ((:DEFINITION EVENNAT)
(:DEFINITION NOT)
(:DEFINITION PLUS)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION EVENNAT)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-70A)
(:REWRITE PROBLEM-73)
(:REWRITE PROBLEM-73A)
(:TYPE-PRESCRIPTION EVENNAT)
(:TYPE-PRESCRIPTION PLUS))
Warnings: None
Time: 0.12 seconds (prove: 0.03, print: 0.07, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-81
ACL2 >>(DEFUN CC (X)
(IF (CONSP X)
(+ 1 (+ (CC (CAR X)) (CC (CDR X))))
0))
The admission of CC is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of CC is described by the
theorem (AND (INTEGERP (CC X)) (<= 0 (CC X))). We used primitive type
reasoning.
Summary
Form: ( DEFUN CC ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
CC
ACL2 >>(THEOREM PROBLEM-85
(AND (IMPLIES (CONSP X)
(< (CC (CAR X)) (CC X)))
(IMPLIES (CONSP X)
(< (CC (CDR X)) (CC X))))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By case analysis we reduce the conjecture to the following two conjectures.
Subgoal 2
(IMPLIES (CONSP X)
(< (CC (CAR X)) (CC X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 2'
(IMPLIES (CONSP (CONS X1 X2))
(< (CC X1) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal 2''
(< (CC X1) (+ 1 (CC X1) (CC X2))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal 1
(IMPLIES (CONSP X)
(< (CC (CDR X)) (CC X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 1'
(IMPLIES (CONSP (CONS X1 X2))
(< (CC X2) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal 1''
(< (CC X2) (+ 1 (CC X1) (CC X2))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-85 ...)
Rules: ((:DEFINITION CC)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.11 seconds (prove: 0.00, print: 0.11, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-85
ACL2 >>(THEOREM PROBLEM-87A
(IMPLIES (MEM E X)
(< (CC (RM E X)) (CC X)))
:HINTS (("Goal" :INDUCT (CC X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (CC X). This suggestion
was produced using the :induction rule CC. If we let (:P E X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X)
(:P E (CAR X))
(:P E (CDR X)))
(:P E X))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(IMPLIES (MEM E X)
(< (CC (RM E X)) (CC X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X)) (MEM E X))
(< (CC (RM E X)) (CC X))).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(IMPLIES (MEM E (CAR X))
(< (CC (RM E (CAR X))) (CC (CAR X))))
(IMPLIES (MEM E (CDR X))
(< (CC (RM E (CDR X))) (CC (CDR X)))))
(IMPLIES (MEM E X)
(< (CC (RM E X)) (CC X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(IMPLIES (MEM E (CAR X))
(< (CC (RM E (CAR X))) (CC (CAR X))))
(IMPLIES (MEM E (CDR X))
(< (CC (RM E (CDR X))) (CC (CDR X))))
(MEM E X))
(< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions CC, MEM and RM and primitive
type reasoning, to the following eight conjectures.
Subgoal *1/1.8
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(NOT (MEM E (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.7
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.6
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.5
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (CC (CONS (CAR X) (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/1.5'
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (+ 1 (CC (CAR X)) (CC (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.4
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(NOT (MEM E (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.3
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (CC (CONS (CAR X) (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/1.1'
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (+ 1 (CC (CAR X)) (CC (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-87A ...)
Rules: ((:DEFINITION CC)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.14 seconds (prove: 0.04, print: 0.10, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-87A
ACL2 >>(DEFUN F23 (E X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (MEM E X) (F23 E (RM E X)) 23))
For the admission of F23 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (MEM E X)
(O< (CC (RM E X)) (CC X)))).
By case analysis we reduce the conjecture to the following two conjectures.
Subgoal 2
(O-P (CC X)).
But simplification reduces this to T, using the :definitions NATP,
O-FINP and O-P, primitive type reasoning and the :type-prescription
rule CC.
Subgoal 1
(IMPLIES (MEM E X)
(O< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions O-FINP and O< and the :type-
prescription rule CC, to
Subgoal 1'
(IMPLIES (MEM E X)
(< (CC (RM E X)) (CC X))).
Name the formula above *1.
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. Subsumption reduces that number to two.
These merge into one derived induction scheme.
We will induct according to a scheme suggested by (CC X), but modified
to accommodate (RM E X). These suggestions were produced using the
:induction rules CC, MEM and RM. If we let (:P E X) denote *1 above
then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X)
(:P E (CAR X))
(:P E (CDR X)))
(:P E X))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following five nontautological subgoals.
Subgoal *1/5
(IMPLIES (AND (NOT (CONSP X)) (MEM E X))
(< (CC (RM E X)) (CC X))).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/4
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E X))
(< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions CC, MEM and RM and primitive
type reasoning, to the following three conjectures.
Subgoal *1/4.3
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/4.2
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/4.1
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (CC (CONS (CAR X) (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/4.1'
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (+ 1 (CC (CAR X)) (CC (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/3
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E X))
(< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions CC, MEM and RM and primitive
type reasoning, to the following three conjectures.
Subgoal *1/3.3
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (CC (CONS (CAR X) (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
This simplifies, using the :definition CC, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/3.1'
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(< (CC (RM E (CDR X))) (CC (CDR X)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(< (+ 1 (CC (CAR X)) (CC (RM E (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(NOT (MEM E (CDR X)))
(MEM E X))
(< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions CC, MEM and RM and primitive
type reasoning, to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(< (CC (RM E (CAR X))) (CC (CAR X)))
(NOT (MEM E (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(NOT (MEM E (CDR X)))
(MEM E X))
(< (CC (RM E X)) (CC X))).
This simplifies, using the :definitions CC, MEM and RM and primitive
type reasoning, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(NOT (MEM E (CAR X)))
(NOT (MEM E (CDR X)))
(EQUAL E (CAR X)))
(< (CC (CDR X))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
That completes the proof of the measure theorem for F23. Thus, we
admit this function under the principle of definition. We observe that
the type of F23 is described by the theorem
(AND (INTEGERP (F23 E X)) (< 0 (F23 E X))).
Summary
Form: ( DEFUN F23 ...)
Rules: ((:DEFINITION CC)
(:DEFINITION MEM)
(:DEFINITION NATP)
(:DEFINITION NOT)
(:DEFINITION O-FINP)
(:DEFINITION O-P)
(:DEFINITION O<)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:INDUCTION MEM)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.19 seconds (prove: 0.04, print: 0.14, other: 0.01)
F23
ACL2 >>(INCLUDE-BOOK "ordinals/ordinals" :DIR :SYSTEM)
Summary
Form: ( INCLUDE-BOOK "ordinals/ordinals" ...)
Rules: NIL
Warnings: None
Time: 3.58 seconds (prove: 0.00, print: 0.00, other: 3.58)
"/v/filer3/v0q004/acl2/v2-9/acl2-sources/books/ordinals/ordinals.lisp"
ACL2 >>(DEFUN CHECK-ROW (ROW)
(LET ((A (CAR ROW)) (B (CADR ROW)))
(IF (AND (O-P A) (O-P B))
(IF (O< A B)
'A**>(DEFUN CHECK-ALL-ROWS (TAB I)
(IF (ENDP TAB)
NIL
(CONS (LIST I (CAR (CAR TAB))
(CADR (CAR TAB))
(CHECK-ROW (CAR TAB)))
(CHECK-ALL-ROWS (CDR TAB) (+ 1 I)))))
The admission of CHECK-ALL-ROWS is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT TAB). We observe that the type of CHECK-ALL-ROWS
is described by the theorem (TRUE-LISTP (CHECK-ALL-ROWS TAB I)). We
used primitive type reasoning.
Summary
Form: ( DEFUN CHECK-ALL-ROWS ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
CHECK-ALL-ROWS
ACL2 >>(THEOREM
PROBLEM-90
(EQUAL
(CHECK-ALL-ROWS (LIST (LIST 23 100)
(LIST 1000000 (OMEGA))
(LIST (O^ (OMEGA) 2) (O* (OMEGA) 2))
(LIST (O+ (O* (O^ (OMEGA) 3) 5)
(O* (O^ (OMEGA) 1) 25)
7)
(O+ (O* (O^ (OMEGA) 3) 5)
(O* (O^ (OMEGA) 2) 1)
3))
(LIST (O+ (O* (O^ (OMEGA) (O^ (OMEGA) 2)) 5)
3)
(O+ (O* (O^ (OMEGA) (OMEGA)) 5)
(O* (O^ (OMEGA) 1) 25)
7)))
1)
'((1 23 100 A****>(DEFUN M2 (I J)
(CONS (CONS 1 (+ 1 I)) J))
Since M2 is non-recursive, its admission is trivial. We observe that
the type of M2 is described by the theorem (CONSP (M2 I J)). We used
primitive type reasoning.
Summary
Form: ( DEFUN M2 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
M2
ACL2 >>(IN-THEORY (ENABLE O< O+ O* OMEGA (OMEGA)
O-FIRST-COEFF
O-FIRST-EXPT O-RST O-FINP O-P))
Summary
Form: (IN-THEORY (ENABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
2479
ACL2 >>(THEOREM PROBLEM-91
(IMPLIES (AND (NATP I1)
(NATP J1)
(NATP I2)
(NATP J2))
(AND (O-P (M2 I1 J1))
(IFF (O< (M2 I1 J1) (M2 I2 J2))
(IF (EQUAL I1 I2)
(< J1 J2)
(< I1 I2)))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definition M2 we reduce the conjecture to
Goal'
(IMPLIES (AND (NATP I1)
(NATP J1)
(NATP I2)
(NATP J2))
(AND (O-P (CONS (CONS 1 (+ 1 I1)) J1))
(COND ((O< (CONS (CONS 1 (+ 1 I1)) J1)
(CONS (CONS 1 (+ 1 I2)) J2))
(IF (EQUAL I1 I2) (< J1 J2) (< I1 I2)))
((IF (EQUAL I1 I2) (< J1 J2) (< I1 I2))
NIL)
(T T)))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions FIX, O-FIRST-
COEFF, O-FIRST-EXPT, O-P, O-RST and O<, the :executable-counterparts
of EQUAL, O-P and O<, primitive type reasoning, the :forward-chaining
rules NATP-FC-1 and NATP-FC-2, the :meta rules CANCEL_PLUS-EQUAL-CORRECT
and CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-CONS, CDR-
CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-91 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:DEFINITION FIX)
(:DEFINITION IFF)
(:DEFINITION M2)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:META CANCEL_PLUS-EQUAL-CORRECT)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1))
Warnings: None
Time: 0.02 seconds (prove: 0.02, print: 0.00, other: 0.00)
PROBLEM-91
ACL2 >>(THEOREM PROBLEM-95
(AND (O-P (CC X))
(IMPLIES (NOT (ATOM X))
(O< (CC (FIRST X)) (CC X)))
(IMPLIES (NOT (ATOM X))
(O< (CC (REST X)) (CC X))))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-85)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definition ATOM we reduce the conjecture to the following
three conjectures.
Subgoal 3
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 2
(IMPLIES (CONSP X)
(O< (CC (CAR X)) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, linear arithmetic, the :linear rule PROBLEM-85, the
:rewrite rule O-FINP-< and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (CONSP X)
(O< (CC (CDR X)) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, linear arithmetic, the :linear rule PROBLEM-85, the
:rewrite rule O-FINP-< and the :type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-95 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION ATOM)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:LINEAR PROBLEM-85)
(:REWRITE O-FINP-<)
(:REWRITE O-P-DEF-O-FINP-1)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.09 seconds (prove: 0.07, print: 0.01, other: 0.01)
PROBLEM-95
ACL2 >>(DEFUN ACK (X Y)
(DECLARE (XARGS :MEASURE (M2 (NFIX Y) (NFIX X))))
(IF (ZP X)
1
(IF (ZP Y)
(IF (EQUAL X 1) 2 (+ X 2))
(ACK (ACK (- X 1) Y) (- Y 1)))))
For the admission of ACK we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(M2 (NFIX Y) (NFIX X)). The non-trivial part of the measure conjecture
is
Goal
(AND (O-P (M2 (NFIX Y) (NFIX X)))
(IMPLIES (AND (NOT (ZP X)) (NOT (ZP Y)))
(O< (M2 (NFIX Y) (NFIX (+ -1 X)))
(M2 (NFIX Y) (NFIX X))))
(IMPLIES (AND (NOT (ZP X)) (NOT (ZP Y)))
(O< (M2 (NFIX (+ -1 Y))
(NFIX (ACK (+ -1 X) Y)))
(M2 (NFIX Y) (NFIX X))))).
By the simple :definition M2 we reduce the conjecture to the following
three conjectures.
Subgoal 3
(O-P (CONS (CONS 1 (+ 1 (NFIX Y)))
(NFIX X))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions NFIX, O-FIRST-
COEFF, O-FIRST-EXPT, O-P and O-RST, the :executable-counterparts of
EQUAL, O-P and O<, primitive type reasoning and the :rewrite rules
CAR-CONS, CDR-CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1.
Subgoal 2
(IMPLIES (AND (NOT (ZP X)) (NOT (ZP Y)))
(O< (CONS (CONS 1 (+ 1 (NFIX Y)))
(NFIX (+ -1 X)))
(CONS (CONS 1 (+ 1 (NFIX Y)))
(NFIX X)))).
But simplification reduces this to T, using the :compound-recognizer
rules O-FINP-CR and ZP-COMPOUND-RECOGNIZER, the :definitions NFIX,
O-FIRST-COEFF, O-FIRST-EXPT, O-RST and O<, the :executable-counterpart
of EQUAL, linear arithmetic, primitive type reasoning and the :rewrite
rules <-+-NEGATIVE-0-1, CAR-CONS, CDR-CONS and O-FINP-<.
Subgoal 1
(IMPLIES (AND (NOT (ZP X)) (NOT (ZP Y)))
(O< (CONS (CONS 1 (+ 1 (NFIX (+ -1 Y))))
(NFIX (ACK (+ -1 X) Y)))
(CONS (CONS 1 (+ 1 (NFIX Y)))
(NFIX X)))).
But simplification reduces this to T, using the :compound-recognizer
rules O-FINP-CR and ZP-COMPOUND-RECOGNIZER, the :definitions FIX, NFIX,
O-FIRST-COEFF, O-FIRST-EXPT and SYNP, the :executable-counterparts
of BINARY-+ and EQUAL, linear arithmetic, primitive type reasoning
and the :rewrite rules <-+-NEGATIVE-0-1, CAR-CONS, CDR-CONS, FOLD-CONSTS-
IN-+, O-FIRST-COEFF-< and UNICITY-OF-0.
Q.E.D.
That completes the proof of the measure theorem for ACK. Thus, we
admit this function under the principle of definition. We observe that
the type of ACK is described by the theorem
(AND (INTEGERP (ACK X Y)) (< 0 (ACK X Y))). We used the :compound-
recognizer rule ZP-COMPOUND-RECOGNIZER and primitive type reasoning.
Summary
Form: ( DEFUN ACK ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FIX)
(:DEFINITION M2)
(:DEFINITION NFIX)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE <-+-NEGATIVE-0-1)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-FINP-<)
(:REWRITE O-FIRST-COEFF-<)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0))
Warnings: None
Time: 0.10 seconds (prove: 0.01, print: 0.05, other: 0.04)
ACK
ACL2 >>(DEFUN F1 (I J)
(DECLARE (XARGS :MEASURE
(IF (AND (NATP I) (NATP J) (< I J))
(- J I)
0)))
(IF (AND (NATP I) (NATP J) (< I J))
(F1 (+ 1 I) J)
1))
For the admission of F1 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(IF (AND (NATP I) (NATP J) (< I J)) (+ J (- I)) 0). The non-trivial
part of the measure conjecture is
Goal
(AND (O-P (IF (AND (NATP I) (NATP J) (< I J))
(+ J (- I))
0))
(IMPLIES (AND (NATP I) (NATP J) (< I J))
(O< (IF (AND (NATP (+ 1 I))
(NATP J)
(< (+ 1 I) J))
(+ J (- (+ 1 I)))
0)
(IF (AND (NATP I) (NATP J) (< I J))
(+ J (- I))
0)))).
By the :executable-counterpart of UNARY-- and the simple :rewrite rule
DISTRIBUTIVITY-OF-MINUS-OVER-+ we reduce the conjecture to the following
two conjectures.
Subgoal 2
(O-P (IF (AND (NATP I) (NATP J) (< I J))
(+ J (- I))
0)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rules COMMUTATIVITY-OF-+
and O-P-DEF-O-FINP-1 and the :type-prescription rule |x < y => 0
< -x+y|.
Subgoal 1
(IMPLIES (AND (NATP I) (NATP J) (< I J))
(O< (IF (AND (NATP (+ 1 I))
(NATP J)
(< (+ 1 I) J))
(+ J -1 (- I))
0)
(IF (AND (NATP I) (NATP J) (< I J))
(+ J (- I))
0))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definition O<, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules COMMUTATIVITY-
2-OF-+ and COMMUTATIVITY-OF-+ and the :type-prescription rule |x <
y => 0 < -x+y|, to the following two conjectures.
Subgoal 1.2
(IMPLIES (AND (NATP I)
(NATP J)
(< I J)
(< (+ 1 I) J))
(< (+ -1 (- I) J) (+ (- I) J))).
But simplification reduces this to T, using linear arithmetic.
Subgoal 1.1
(IMPLIES (AND (NATP I)
(NATP J)
(< I J)
(<= J (+ 1 I)))
(< 0 (+ (- I) J))).
But we reduce the conjecture to T, by the simple :rewrite rule <-0-
+-NEGATIVE-1.
Q.E.D.
That completes the proof of the measure theorem for F1. Thus, we admit
this function under the principle of definition. We observe that the
type of F1 is described by the theorem
(AND (INTEGERP (F1 I J)) (< 0 (F1 I J))).
Summary
Form: ( DEFUN F1 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION NOT)
(:DEFINITION O<)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:REWRITE <-0-+-NEGATIVE-1)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))
Warnings: None
Time: 0.08 seconds (prove: 0.01, print: 0.06, other: 0.01)
F1
ACL2 >>(DEFUN F2 (X)
(DECLARE (XARGS :MEASURE
(IF (EQUAL X NIL) 0 (+ 1 (CC X)))))
(IF (EQUAL X NIL)
2 (AND (F2 (CAR X)) (F2 (CDR X)))))
For the admission of F2 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(IF (EQUAL X NIL) 0 (+ 1 (CC X))). The non-trivial part of the measure
conjecture is
Goal
(AND (O-P (IF (EQUAL X NIL) 0 (+ 1 (CC X))))
(IMPLIES X
(O< (IF (EQUAL (CAR X) NIL)
0 (+ 1 (CC (CAR X))))
(IF (EQUAL X NIL) 0 (+ 1 (CC X)))))
(IMPLIES (AND X (F2 (CAR X)))
(O< (IF (EQUAL (CDR X) NIL)
0 (+ 1 (CC (CDR X))))
(IF (EQUAL X NIL) 0 (+ 1 (CC X)))))).
By case analysis we reduce the conjecture to the following three conjectures.
Subgoal 3
(O-P (IF (EQUAL X NIL) 0 (+ 1 (CC X)))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, primitive type reasoning, the :rewrite
rule O-P-DEF-O-FINP-1 and the :type-prescription rule CC.
Subgoal 2
(IMPLIES X
(O< (IF (EQUAL (CAR X) NIL)
0 (+ 1 (CC (CAR X))))
(IF (EQUAL X NIL) 0 (+ 1 (CC X))))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definition O<, primitive type reasoning and the :type-prescription
rule CC, to the following two conjectures.
Subgoal 2.2
(IMPLIES (AND X (CAR X))
(< (+ 1 (CC (CAR X))) (+ 1 (CC X)))).
This simplifies, using the :meta rule CANCEL_PLUS-LESSP-CORRECT, to
Subgoal 2.2'
(IMPLIES (CAR X)
(< (CC (CAR X)) (CC X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following two goals.
Subgoal 2.2.2
(IMPLIES (AND (NOT (CONSP X)) (CAR X))
(< (CC (CAR X)) (CC X))).
But we reduce the conjecture to T, by case analysis.
Subgoal 2.2.1
(IMPLIES (AND (CONSP (CONS X1 X2)) X1)
(< (CC X1) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS and CDR-CONS, to
Subgoal 2.2.1'
(IMPLIES X1 (< 0 (+ 1 (CC X2)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.1
(IMPLIES (AND X (NOT (CAR X)))
(< 0 (+ 1 (CC X)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND X (F2 (CAR X)))
(O< (IF (EQUAL (CDR X) NIL)
0 (+ 1 (CC (CDR X))))
(IF (EQUAL X NIL) 0 (+ 1 (CC X))))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC and O<, primitive type reasoning and the :type-prescription
rule CC, to the following three conjectures.
Subgoal 1.3
(IMPLIES (AND X (F2 (CAR X)) (CDR X) (CONSP X))
(< (+ 1 (CC (CDR X)))
(+ 1 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal 1.2
(IMPLIES (AND X (F2 (CAR X))
(NOT (CDR X))
(CONSP X))
(< 0 (+ 1 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1
(IMPLIES (AND X (F2 (CAR X))
(CDR X)
(NOT (CONSP X)))
(< (+ 1 (CC (CDR X))) 1)).
But simplification reduces this to T, using primitive type reasoning.
Q.E.D.
That completes the proof of the measure theorem for F2. Thus, we admit
this function under the principle of definition. We observe that the
type of F2 is described by the theorem (AND (INTEGERP (F2 X)) (< 0 (F2 X))).
Summary
Form: ( DEFUN F2 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION CC)
(:DEFINITION NOT)
(:DEFINITION O<)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE O-P-DEF-O-FINP-1)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.26 seconds (prove: 0.15, print: 0.09, other: 0.02)
F2
ACL2 >>(DEFUN F3 (X Y)
(DECLARE (XARGS :MEASURE (+ (CC X) (CC Y))))
(IF (AND (ENDP X) (ENDP Y))
3 (F3 (CDR X) (CDR Y))))
For the admission of F3 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(+ (CC X) (CC Y)). The non-trivial part of the measure conjecture
is
Goal
(AND (O-P (+ (CC X) (CC Y)))
(IMPLIES (NOT (AND (ENDP X) (ENDP Y)))
(O< (+ (CC (CDR X)) (CC (CDR Y)))
(+ (CC X) (CC Y))))).
By case analysis we reduce the conjecture to the following two conjectures.
Subgoal 2
(O-P (+ (CC X) (CC Y))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, primitive type reasoning, the :rewrite
rule O-P-DEF-O-FINP-1 and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (NOT (AND (ENDP X) (ENDP Y)))
(O< (+ (CC (CDR X)) (CC (CDR Y)))
(+ (CC X) (CC Y)))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions ENDP and O<, primitive type reasoning and the :type-prescription
rule CC, to the following two conjectures.
Subgoal 1.2
(IMPLIES (CONSP X)
(< (+ (CC (CDR X)) (CC (CDR Y)))
(+ (CC X) (CC Y)))).
The destructor terms (CAR Y) and (CDR Y) can be eliminated by using
CAR-CDR-ELIM to replace Y by (CONS Y1 Y2), (CAR Y) by Y1 and (CDR Y)
by Y2. This produces the following two goals.
Subgoal 1.2.2
(IMPLIES (AND (NOT (CONSP Y)) (CONSP X))
(< (+ (CC (CDR X)) (CC (CDR Y)))
(+ (CC X) (CC Y)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterpart of CC, the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CDR
and UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal 1.2.2'
(IMPLIES (AND (NOT (CONSP Y)) (CONSP X))
(< (CC (CDR X)) (CC X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 1.2.2''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (CONSP Y)))
(< (CC X2) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS and CDR-CONS, to
Subgoal 1.2.2'''
(IMPLIES (NOT (CONSP Y))
(< 0 (+ 1 (CC X1)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2.1
(IMPLIES (AND (CONSP (CONS Y1 Y2)) (CONSP X))
(< (+ (CC (CDR X)) (CC Y2))
(+ (CC X) (CC (CONS Y1 Y2))))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and COMMUTATIVITY-OF-+, to
Subgoal 1.2.1'
(IMPLIES (CONSP X)
(< (CC (CDR X)) (+ 1 (CC X) (CC Y1)))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 1.2.1''
(IMPLIES (CONSP (CONS X1 X2))
(< (CC X2)
(+ 1 (CC (CONS X1 X2)) (CC Y1)))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterpart of BINARY-+, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT and the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
2-OF-+, COMMUTATIVITY-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 1.2.1'''
(< 0 (+ 2 (CC X1) (CC Y1))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1
(IMPLIES (CONSP Y)
(< (+ (CC (CDR X)) (CC (CDR Y)))
(+ (CC X) (CC Y)))).
The destructor terms (CAR Y) and (CDR Y) can be eliminated by using
CAR-CDR-ELIM to replace Y by (CONS Y1 Y2), (CAR Y) by Y1 and (CDR Y)
by Y2. This produces the following goal.
Subgoal 1.1'
(IMPLIES (CONSP (CONS Y1 Y2))
(< (+ (CC (CDR X)) (CC Y2))
(+ (CC X) (CC (CONS Y1 Y2))))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and COMMUTATIVITY-OF-+, to
Subgoal 1.1''
(< (CC (CDR X)) (+ 1 (CC X) (CC Y1))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following two goals.
Subgoal 1.1.2
(IMPLIES (NOT (CONSP X))
(< (CC (CDR X)) (+ 1 (CC X) (CC Y1)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterpart of CC, the :rewrite rules DEFAULT-CDR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 1.1.2'
(IMPLIES (NOT (CONSP X))
(< 0 (+ 1 (CC Y1)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1.1
(IMPLIES (CONSP (CONS X1 X2))
(< (CC X2)
(+ 1 (CC (CONS X1 X2)) (CC Y1)))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterpart of BINARY-+, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT and the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
2-OF-+, COMMUTATIVITY-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 1.1.1'
(< 0 (+ 2 (CC X1) (CC Y1))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for F3. Thus, we admit
this function under the principle of definition. We observe that the
type of F3 is described by the theorem
(AND (INTEGERP (F3 X Y)) (< 0 (F3 X Y))). We used primitive type reasoning.
Summary
Form: ( DEFUN F3 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION CC)
(:DEFINITION ENDP)
(:DEFINITION FIX)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CC)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DEFAULT-CDR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.29 seconds (prove: 0.04, print: 0.24, other: 0.01)
F3
ACL2 >>(ENCAPSULATE ((P (X) T)
(DN (X) T)
(UP (X) T)
(M (X) T))
(LOCAL (DEFUN P (X) (NOT (ZP X))))
(LOCAL (DEFUN DN (X) (- X 1)))
(LOCAL (DEFUN UP (X) X))
(LOCAL (DEFUN M (X) (ACL2-COUNT X)))
(THEOREM PROBLEM-101A
(AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X))))))
To verify that the five encapsulated events correctly extend the current
theory we will evaluate them. The theory thus constructed is only
ephemeral.
Encapsulated Events:
ACL2 >>(LOCAL (DEFUN P (X) (NOT (ZP X))))
Since P is non-recursive, its admission is trivial. We observe that
the type of P is described by the theorem
(OR (EQUAL (P X) T) (EQUAL (P X) NIL)).
Summary
Form: ( DEFUN P ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
P
ACL2 >>(LOCAL (DEFUN DN (X) (- X 1)))
Since DN is non-recursive, its admission is trivial. We observe that
the type of DN is described by the theorem (ACL2-NUMBERP (DN X)).
We used primitive type reasoning.
Summary
Form: ( DEFUN DN ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
DN
ACL2 >>(LOCAL (DEFUN UP (X) X))
Since UP is non-recursive, its admission is trivial. We observe that
the type of UP is described by the theorem (EQUAL (UP X) X).
Summary
Form: ( DEFUN UP ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
UP
ACL2 >>(LOCAL (DEFUN M (X) (ACL2-COUNT X)))
Since M is non-recursive, its admission is trivial. We observe that
the type of M is described by the theorem
(AND (INTEGERP (M X)) (<= 0 (M X))). We used the :type-prescription
rule ACL2-COUNT.
Summary
Form: ( DEFUN M ...)
Rules: ((:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
M
ACL2 >>(THEOREM PROBLEM-101A
(AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X)))))
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-101A ...): The :REWRITE
rule generated from PROBLEM-101A will be triggered only by terms containing
the non-recursive function symbol M. Unless this function is disabled,
PROBLEM-101A is unlikely ever to be used.
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-101A ...): The :REWRITE
rule generated from PROBLEM-101A will be triggered only by terms containing
the non-recursive function symbols DN and M. Unless these functions
are disabled, PROBLEM-101A is unlikely ever to be used.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions DN, M and P we reduce the conjecture to
the following two conjectures.
Subgoal 2
(O-P (ACL2-COUNT X)).
But we reduce the conjecture to T, by case analysis.
Subgoal 1
(IMPLIES (NOT (ZP X))
(O< (ACL2-COUNT (+ -1 X))
(ACL2-COUNT X))).
But we reduce the conjecture to T, by case analysis.
Q.E.D.
The storage of PROBLEM-101A depends upon the :type-prescription rules
O-P and O<.
Summary
Form: ( DEFTHM PROBLEM-101A ...)
Rules: ((:DEFINITION DN)
(:DEFINITION M)
(:DEFINITION P)
(:TYPE-PRESCRIPTION O-P)
(:TYPE-PRESCRIPTION O<))
Warnings: Non-rec
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-101A
End of Encapsulated Events.
Having verified that the encapsulated events validate the signatures
of the ENCAPSULATE event, we discard the ephemeral theory and extend
the original theory as directed by the signatures and the non-LOCAL
events.
The following constraint is associated with every one of the functions
P, DN, UP and M:
(AND (O-P (M X)) (IMPLIES (P X) (O< (M (DN X)) (M X))))
Summary
Form: ( ENCAPSULATE ((P ...) ...) ...)
Rules: NIL
Warnings: Non-rec
Time: 0.09 seconds (prove: 0.00, print: 0.02, other: 0.07)
T
ACL2 >>(THEOREM PROBLEM-101B
(IMPLIES (P X) (NOT (EQUAL (M X) 0)))
:HINTS
(("Goal" :USE
((:INSTANCE PROBLEM-101A (X X))
(:INSTANCE PROBLEM-101A (X (DN X)))))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now augment the goal above by adding the hypotheses indicated by
the :USE hint. These hypotheses can be derived from PROBLEM-101A via
instantiation. The augmented goal is shown below.
Goal'
(IMPLIES (AND (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X))))
(AND (O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X))))))
(IMPLIES (P X) (NOT (EQUAL (M X) 0)))).
By case analysis we reduce the conjecture to
Goal''
(IMPLIES (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X)))
(O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X))))
(P X))
(NOT (EQUAL (M X) 0))).
But simplification reduces this to T, using the :executable-counterparts
of NOT and O-P, the :rewrite rule |~(a<0)| and the :type-prescription
rule O-P.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-101B ...)
Rules: ((:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART O-P)
(:REWRITE |~(a<0)|)
(:TYPE-PRESCRIPTION O-P))
Warnings: None
Time: 0.04 seconds (prove: 0.03, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-101B
ACL2 >>(THEOREM PROBLEM-101C
(OR (CONSP (M X))
(AND (INTEGERP (M X)) (<= 0 (M X))))
:RULE-CLASSES :TYPE-PRESCRIPTION :HINTS
(("Goal" :USE
((:INSTANCE PROBLEM-101A (X X))
(:INSTANCE PROBLEM-101A (X (DN X)))))))
ACL2 Observation in ( DEFTHM PROBLEM-101C ...): Our heuristics choose
(M X) as the :TYPED-TERM.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now augment the goal above by adding the hypotheses indicated by
the :USE hint. These hypotheses can be derived from PROBLEM-101A via
instantiation. The augmented goal is shown below.
Goal'
(IMPLIES (AND (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X))))
(AND (O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X))))))
(OR (CONSP (M X))
(AND (INTEGERP (M X)) (<= 0 (M X))))).
By case analysis we reduce the conjecture to
Goal''
(IMPLIES (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X)))
(O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X)))))
(OR (CONSP (M X))
(AND (INTEGERP (M X)) (<= 0 (M X))))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, primitive type reasoning and the :rewrite rule O-P-DEF-
O-FINP-1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-101C ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE O-P-DEF-O-FINP-1))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-101C
ACL2 >>(THEOREM PROBLEM-101D
(IMPLIES (P X)
(NOT (EQUAL (M (DN X)) (M X))))
:HINTS
(("Goal" :USE
((:INSTANCE PROBLEM-101A (X X))
(:INSTANCE PROBLEM-101A (X (DN X)))))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now augment the goal above by adding the hypotheses indicated by
the :USE hint. These hypotheses can be derived from PROBLEM-101A via
instantiation. The augmented goal is shown below.
Goal'
(IMPLIES (AND (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X))))
(AND (O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X))))))
(IMPLIES (P X)
(NOT (EQUAL (M (DN X)) (M X))))).
By case analysis we reduce the conjecture to
Goal''
(IMPLIES (AND (O-P (M X))
(IMPLIES (P X) (O< (M (DN X)) (M X)))
(O-P (M (DN X)))
(IMPLIES (P (DN X))
(O< (M (DN (DN X))) (M (DN X))))
(P X))
(NOT (EQUAL (M (DN X)) (M X)))).
But simplification reduces this to T, using primitive type reasoning,
the :forward-chaining rules |a <= b => (a < b <=> ~(a = b))|, |a
<= b / b <= c => a <= c| and |a = b => (a <= b)| and the :type-
prescription rules O-P and O<.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-101D ...)
Rules: ((:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING |a <= b => (a < b <=> ~(a = b))|)
(:FORWARD-CHAINING |a <= b / b <= c => a <= c|)
(:FORWARD-CHAINING |a = b => (a <= b)|)
(:TYPE-PRESCRIPTION O-P)
(:TYPE-PRESCRIPTION O<))
Warnings: None
Time: 0.10 seconds (prove: 0.09, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-101D
ACL2 >>(DEFUN F4 (X Y Q)
(DECLARE (XARGS :MEASURE
(IF Q
(IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1))
(IF (EQUAL (M Y) 0)
2 (MAKE-ORD (M Y) 1 2)))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-101A PROBLEM-101B)))))
(IF (P X)
(IF Q (F4 Y (DN X) (NOT Q))
(F4 Y (UP X) (NOT Q)))
4))
For the admission of F4 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2))).
The non-trivial part of the measure conjecture is
Goal
(AND (O-P (COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2))))
(IMPLIES (AND (P X) (NOT Q))
(O< (COND ((NOT Q)
(IF (EQUAL (M Y) 0)
1 (MAKE-ORD (M Y) 1 1)))
((EQUAL (M (UP X)) 0) 2)
(T (MAKE-ORD (M (UP X)) 1 2)))
(COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2)))))
(IMPLIES (AND (P X) Q)
(O< (COND ((NOT Q)
(IF (EQUAL (M Y) 0)
1 (MAKE-ORD (M Y) 1 1)))
((EQUAL (M (DN X)) 0) 2)
(T (MAKE-ORD (M (DN X)) 1 2)))
(COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2)))))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By case analysis we reduce the conjecture to the following three conjectures.
Subgoal 3
(O-P (COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2)))).
This simplifies, using trivial observations, to the following four
conjectures.
Subgoal 3.4
(IMPLIES (AND Q (EQUAL (M X) 0))
(O-P 1)).
But we reduce the conjecture to T, by the :executable-counterpart of
O-P.
Subgoal 3.3
(IMPLIES (AND Q (NOT (EQUAL (M X) 0)))
(O-P (MAKE-ORD (M X) 1 1))).
But simplification reduces this to T, using the :executable-counterparts
of NOT, O-FIRST-EXPT, O-P and POSP, primitive type reasoning and the
:rewrite rules |0 < a = ~(a = 0)|, MAKE-ORD-O-P and PROBLEM-101A.
Subgoal 3.2
(IMPLIES (AND (NOT Q) (EQUAL (M Y) 0))
(O-P 2)).
But we reduce the conjecture to T, by the :executable-counterpart of
O-P.
Subgoal 3.1
(IMPLIES (AND (NOT Q) (NOT (EQUAL (M Y) 0)))
(O-P (MAKE-ORD (M Y) 1 2))).
But simplification reduces this to T, using the :executable-counterparts
of NOT, O-FIRST-EXPT, O-P and POSP, primitive type reasoning and the
:rewrite rules |0 < a = ~(a = 0)|, MAKE-ORD-O-P and PROBLEM-101A.
Subgoal 2
(IMPLIES (AND (P X) (NOT Q))
(O< (COND ((NOT Q)
(IF (EQUAL (M Y) 0)
1 (MAKE-ORD (M Y) 1 1)))
((EQUAL (M (UP X)) 0) 2)
(T (MAKE-ORD (M (UP X)) 1 2)))
(COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2))))).
This simplifies, using the :executable-counterpart of NOT, to the following
two conjectures.
Subgoal 2.2
(IMPLIES (AND (P X) (EQUAL (M Y) 0))
(O< 1 2)).
But we reduce the conjecture to T, by the :executable-counterpart of
O<.
Subgoal 2.1
(IMPLIES (AND (P X) (NOT (EQUAL (M Y) 0)))
(O< (MAKE-ORD (M Y) 1 1)
(MAKE-ORD (M Y) 1 2))).
But simplification reduces this to T, using the :executable-counterpart
of O< and the :rewrite rule O-RST-<.
Subgoal 1
(IMPLIES (AND (P X) Q)
(O< (COND ((NOT Q)
(IF (EQUAL (M Y) 0)
1 (MAKE-ORD (M Y) 1 1)))
((EQUAL (M (DN X)) 0) 2)
(T (MAKE-ORD (M (DN X)) 1 2)))
(COND (Q (IF (EQUAL (M X) 0)
1 (MAKE-ORD (M X) 1 1)))
((EQUAL (M Y) 0) 2)
(T (MAKE-ORD (M Y) 1 2))))).
This simplifies, using the :congruence rule IFF-IMPLIES-EQUAL-NOT,
the :executable-counterpart of NOT and the :rewrite rule PROBLEM-101B,
to the following two conjectures.
Subgoal 1.2
(IMPLIES (AND (P X) (EQUAL (M (DN X)) 0))
(O< 2 (MAKE-ORD (M X) 1 1))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, primitive type reasoning, the :rewrite rule AC-< and
the :type-prescription rule MAKE-ORD.
Subgoal 1.1
(IMPLIES (AND (P X) (NOT (EQUAL (M (DN X)) 0)))
(O< (MAKE-ORD (M (DN X)) 1 2)
(MAKE-ORD (M X) 1 1))).
But simplification reduces this to T, using the :executable-counterparts
of NOT, O-FIRST-EXPT, O-P and POSP, primitive type reasoning and the
:rewrite rules |0 < a = ~(a = 0)|, MAKE-ORD-O-FIRST-EXPT, MAKE-ORD-
O-P, O-FIRST-EXPT-< and PROBLEM-101A.
Q.E.D.
That completes the proof of the measure theorem for F4. Thus, we admit
this function under the principle of definition. We observe that the
type of F4 is described by the theorem
(AND (INTEGERP (F4 X Y Q)) (< 0 (F4 X Y Q))).
Summary
Form: ( DEFUN F4 ...)
Rules: ((:COMPOUND-RECOGNIZER O-FINP-CR)
(:CONGRUENCE IFF-IMPLIES-EQUAL-NOT)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART O-FIRST-EXPT)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:EXECUTABLE-COUNTERPART POSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE |0 < a = ~(a = 0)|)
(:REWRITE AC-<)
(:REWRITE MAKE-ORD-O-FIRST-EXPT)
(:REWRITE MAKE-ORD-O-P)
(:REWRITE O-FIRST-EXPT-<)
(:REWRITE O-RST-<)
(:REWRITE PROBLEM-101A)
(:REWRITE PROBLEM-101B)
(:TYPE-PRESCRIPTION MAKE-ORD))
Warnings: None
Time: 0.51 seconds (prove: 0.42, print: 0.06, other: 0.03)
F4
ACL2 >>(THEOREM PROBLEM-102 (EQUAL (F1 I J) 1)
:HINTS (("Goal" :INDUCT (F1 I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (F1 I J). This suggestion
was produced using the :induction rule F1. If we let (:P I J) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (AND (NATP I) (NATP J) (< I J)))
(:P I J))
(IMPLIES (AND (AND (NATP I) (NATP J) (< I J))
(:P (+ 1 I) J))
(:P I J))).
This induction is justified by the same argument used to admit F1,
namely, the measure
(IF (IF (NATP I)
(IF (NATP J) (< I J) 'NIL)
'NIL)
(BINARY-+ J (UNARY-- I))
'0)
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following two nontautological
subgoals.
Subgoal *1/2
(IMPLIES (NOT (AND (NATP I) (NATP J) (< I J)))
(EQUAL (F1 I J) 1)).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition F1 and the :executable-counterpart of
EQUAL.
Subgoal *1/1
(IMPLIES (AND (AND (NATP I) (NATP J) (< I J))
(EQUAL (F1 (+ 1 I) J) 1))
(EQUAL (F1 I J) 1)).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NATP I)
(NATP J)
(< I J)
(EQUAL (F1 (+ 1 I) J) 1))
(EQUAL (F1 I J) 1)).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition F1, the :executable-counterpart of EQUAL
and the :forward-chaining rules NATP-FC-1 and NATP-FC-2.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-102 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION F1)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION F1))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-102
ACL2 >>(THEOREM PROBLEM-103 (EQUAL (F2 X) 2)
:HINTS (("Goal" :INDUCT (F2 X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (F2 X). This suggestion
was produced using the :induction rule F2. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (AND X (NOT (F2 (CAR X))) (:P (CAR X)))
(:P X))
(IMPLIES (AND X (F2 (CAR X))
(:P (CAR X))
(:P (CDR X)))
(:P X))
(IMPLIES (NOT X) (:P X))).
This induction is justified by the same argument used to admit F2,
namely, the measure (IF (EQUAL X 'NIL) '0 (BINARY-+ '1 (CC X))) is
decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following three nontautologica\
l subgoals.
Subgoal *1/3
(IMPLIES (AND X (NOT (F2 (CAR X)))
(EQUAL (F2 (CAR X)) 2))
(EQUAL (F2 X) 2)).
But we reduce the conjecture to T, by the :type-prescription rule F2.
Subgoal *1/2
(IMPLIES (AND X (F2 (CAR X))
(EQUAL (F2 (CAR X)) 2)
(EQUAL (F2 (CDR X)) 2))
(EQUAL (F2 X) 2)).
But simplification reduces this to T, using the :definition F2, the
:executable-counterparts of EQUAL and NOT and primitive type reasoning.
Subgoal *1/1
(IMPLIES (NOT X) (EQUAL (F2 X) 2)).
But simplification reduces this to T, using the :executable-counterparts
of EQUAL and F2.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-103 ...)
Rules: ((:DEFINITION F2)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART F2)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION F2)
(:TYPE-PRESCRIPTION F2))
Warnings: None
Time: 0.09 seconds (prove: 0.02, print: 0.07, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-103
ACL2 >>(THEOREM PROBLEM-104 (EQUAL (F3 X Y) 3)
:HINTS (("Goal" :INDUCT (F3 X Y))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (F3 X Y). This suggestion
was produced using the :induction rule F3. If we let (:P X Y) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (AND (ENDP X) (ENDP Y)))
(:P (CDR X) (CDR Y)))
(:P X Y))
(IMPLIES (AND (ENDP X) (ENDP Y))
(:P X Y))).
This induction is justified by the same argument used to admit F3,
namely, the measure (BINARY-+ (CC X) (CC Y)) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (AND (ENDP X) (ENDP Y)))
(EQUAL (F3 (CDR X) (CDR Y)) 3))
(EQUAL (F3 X Y) 3)).
This simplifies, using the :definitions ENDP and F3 and the :executable-
counterpart of EQUAL, to
Subgoal *1/2'
(IMPLIES (AND (CONSP Y)
(EQUAL (F3 (CDR X) (CDR Y)) 3)
(NOT (CONSP X)))
(EQUAL (F3 NIL (CDR Y)) 3)).
But simplification reduces this to T, using the :rewrite rule DEFAULT-
CDR.
Subgoal *1/1
(IMPLIES (AND (ENDP X) (ENDP Y))
(EQUAL (F3 X Y) 3)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP X)) (NOT (CONSP Y)))
(EQUAL (F3 X Y) 3)).
But simplification reduces this to T, using the :definition F3 and
the :executable-counterpart of EQUAL.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-104 ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION F3)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART EQUAL)
(:INDUCTION F3)
(:REWRITE DEFAULT-CDR))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-104
ACL2 >>(THEOREM PROBLEM-105 (EQUAL (F4 X Y Q) 4)
:HINTS (("Goal" :INDUCT (F4 X Y Q))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (F4 X Y Q). This
suggestion was produced using the :induction rule F4. If we let (:P Q X Y)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (P X)) (:P Q X Y))
(IMPLIES (AND (P X)
(NOT Q)
(:P (NOT Q) Y (UP X)))
(:P Q X Y))
(IMPLIES (AND (P X) Q (:P (NOT Q) Y (DN X)))
(:P Q X Y))).
This induction is justified by the same argument used to admit F4,
namely, the measure
(IF Q
(IF (EQUAL (M X) '0)
'1
(MAKE-ORD (M X) '1 '1))
(IF (EQUAL (M Y) '0)
'2
(MAKE-ORD (M Y) '1 '2)))
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following three nontautologica\
l subgoals.
Subgoal *1/3
(IMPLIES (NOT (P X))
(EQUAL (F4 X Y Q) 4)).
But simplification reduces this to T, using the :definition F4 and
the :executable-counterpart of EQUAL.
Subgoal *1/2
(IMPLIES (AND (P X)
(NOT Q)
(EQUAL (F4 Y (UP X) (NOT Q)) 4))
(EQUAL (F4 X Y Q) 4)).
But simplification reduces this to T, using the :definition F4 and
the :executable-counterparts of EQUAL and NOT.
Subgoal *1/1
(IMPLIES (AND (P X)
Q (EQUAL (F4 Y (DN X) (NOT Q)) 4))
(EQUAL (F4 X Y Q) 4)).
But simplification reduces this to T, using the :congruence rule IFF-
IMPLIES-EQUAL-NOT, the :definition F4 and the :executable-counterparts
of EQUAL and NOT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-105 ...)
Rules: ((:CONGRUENCE IFF-IMPLIES-EQUAL-NOT)
(:DEFINITION F4)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:INDUCTION F4))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.04, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-105
ACL2 >>(DEFUN FLATTEN! (X)
(DECLARE (XARGS :MEASURE (M2 (CC X) (CC (CAR X)))))
(IF (ATOM X)
(CONS X NIL)
(IF (ATOM (CAR X))
(CONS (CAR X) (FLATTEN! (CDR X)))
(FLATTEN! (CONS (CAAR X)
(CONS (CDAR X) (CDR X)))))))
For the admission of FLATTEN! we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(M2 (CC X) (CC (CAR X))). The non-trivial part of the measure conjecture
is
Goal
(AND (O-P (M2 (CC X) (CC (CAR X))))
(IMPLIES (AND (NOT (ATOM X))
(NOT (ATOM (CAR X))))
(O< (M2 (CC (LIST* (CAAR X) (CDAR X) (CDR X)))
(CC (CAR (LIST* (CAAR X) (CDAR X) (CDR X)))))
(M2 (CC X) (CC (CAR X)))))
(IMPLIES (AND (NOT (ATOM X)) (ATOM (CAR X)))
(O< (M2 (CC (CDR X)) (CC (CADR X)))
(M2 (CC X) (CC (CAR X)))))).
By the simple :definitions ATOM and M2 and the simple :rewrite rule
CAR-CONS we reduce the conjecture to the following three conjectures.
Subgoal 3
(O-P (CONS (CONS 1 (+ 1 (CC X)))
(CC (CAR X)))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions O-FIRST-COEFF,
O-FIRST-EXPT, O-P and O-RST, the :executable-counterparts of EQUAL,
O-P and O<, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1 and the :type-
prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X) (CONSP (CAR X)))
(O< (CONS (CONS 1
(+ 1
(CC (LIST* (CAAR X) (CDAR X) (CDR X)))))
(CC (CAAR X)))
(CONS (CONS 1 (+ 1 (CC X)))
(CC (CAR X))))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :definitions CC, O-FIRST-COEFF, O-FIRST-EXPT, O-
RST, O< and SYNP, the :executable-counterparts of BINARY-+ and EQUAL,
linear arithmetic, primitive type reasoning, the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+, FOLD-CONSTS-
IN-+ and O-FINP-< and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X) (NOT (CONSP (CAR X))))
(O< (CONS (CONS 1 (+ 1 (CC (CDR X))))
(CC (CADR X)))
(CONS (CONS 1 (+ 1 (CC X)))
(CC (CAR X))))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :definitions CC, FIX, O-FIRST-COEFF, O-FIRST-EXPT
and SYNP, the :executable-counterparts of BINARY-+ and EQUAL, linear
arithmetic, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, FOLD-CONSTS-IN-+, O-FIRST-COEFF-< and UNICITY-OF-0 and the
:type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for FLATTEN!. Thus,
we admit this function under the principle of definition. We observe
that the type of FLATTEN! is described by the theorem
(AND (CONSP (FLATTEN! X)) (TRUE-LISTP (FLATTEN! X))). We used primitive
type reasoning.
Summary
Form: ( DEFUN FLATTEN! ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:DEFINITION ATOM)
(:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION M2)
(:DEFINITION NOT)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-FINP-<)
(:REWRITE O-FIRST-COEFF-<)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.38 seconds (prove: 0.33, print: 0.03, other: 0.02)
FLATTEN!
ACL2 >>(THEOREM PROBLEM-107
(EQUAL (FLATTEN! X) (FLATTEN X))
:HINTS
(("Goal" :INDUCT (FLATTEN! X)
:IN-THEORY (ENABLE PROBLEM-40))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FLATTEN! X). This
suggestion was produced using the :induction rule FLATTEN!. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ATOM X))
(NOT (ATOM (CAR X)))
(:P (LIST* (CAAR X) (CDAR X) (CDR X))))
(:P X))
(IMPLIES (AND (NOT (ATOM X))
(ATOM (CAR X))
(:P (CDR X)))
(:P X))
(IMPLIES (ATOM X) (:P X))).
This induction is justified by the same argument used to admit FLATTEN!,
namely, the measure (M2 (CC X) (CC (CAR X))) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ATOM X))
(NOT (ATOM (CAR X)))
(EQUAL (FLATTEN! (LIST* (CAAR X) (CDAR X) (CDR X)))
(FLATTEN (LIST* (CAAR X) (CDAR X) (CDR X)))))
(EQUAL (FLATTEN! X) (FLATTEN X))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(CONSP (CAR X))
(EQUAL (FLATTEN! (LIST* (CAAR X) (CDAR X) (CDR X)))
(FLATTEN (LIST* (CAAR X) (CDAR X) (CDR X)))))
(EQUAL (FLATTEN! X) (FLATTEN X))).
But simplification reduces this to T, using the :definitions FLATTEN
and FLATTEN!, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and PROBLEM-40.
Subgoal *1/2
(IMPLIES (AND (NOT (ATOM X))
(ATOM (CAR X))
(EQUAL (FLATTEN! (CDR X))
(FLATTEN (CDR X))))
(EQUAL (FLATTEN! X) (FLATTEN X))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (CONSP (CAR X)))
(EQUAL (FLATTEN! (CDR X))
(FLATTEN (CDR X))))
(EQUAL (FLATTEN! X) (FLATTEN X))).
But simplification reduces this to T, using the :definitions APP, FLATTEN
and FLATTEN!, the :executable-counterpart of CONSP, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (ATOM X)
(EQUAL (FLATTEN! X) (FLATTEN X))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(EQUAL (FLATTEN! X) (FLATTEN X))).
But simplification reduces this to T, using the :definitions FLATTEN
and FLATTEN! and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-107 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION ATOM)
(:DEFINITION FLATTEN)
(:DEFINITION FLATTEN!)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FLATTEN!)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-40))
Warnings: None
Time: 0.28 seconds (prove: 0.22, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-107
ACL2 >>(DEFUN GOPHER (X)
(DECLARE (XARGS :MEASURE (CC (CAR X))))
(IF (OR (ATOM X) (ATOM (CAR X)))
X
(GOPHER (CONS (CAR (CAR X))
(CONS (CDR (CAR X)) (CDR X))))))
For the admission of GOPHER we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC (CAR X)). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC (CAR X)))
(IMPLIES (NOT (OR (ATOM X) (ATOM (CAR X))))
(O< (CC (CAR (LIST* (CAAR X) (CDAR X) (CDR X))))
(CC (CAR X))))).
By the simple :rewrite rule CAR-CONS we reduce the conjecture to the
following two conjectures.
Subgoal 2
(O-P (CC (CAR X))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 1
(IMPLIES (NOT (OR (ATOM X) (ATOM (CAR X))))
(O< (CC (CAAR X)) (CC (CAR X)))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions ATOM and O< and the :type-prescription rule CC, to
Subgoal 1'
(IMPLIES (AND (CONSP X) (CONSP (CAR X)))
(< (CC (CAAR X)) (CC (CAR X)))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2. (2) Use CAR-CDR-ELIM, again, to replace X1
by (CONS X3 X4), (CAR X1) by X3 and (CDR X1) by X4. These steps
produce the following goal.
Subgoal 1''
(IMPLIES (AND (CONSP (CONS X3 X4))
(CONSP (CONS (CONS X3 X4) X2)))
(< (CC X3) (CC (CONS X3 X4)))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS and CDR-CONS, to
Subgoal 1'''
(< 0 (+ 1 (CC X4))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for GOPHER. Thus,
we admit this function under the principle of definition. We could
deduce no constraints on the type of GOPHER.
Summary
Form: ( DEFUN GOPHER ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION ATOM)
(:DEFINITION CC)
(:DEFINITION O<)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE O-P-DEF-O-FINP-1)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.21 seconds (prove: 0.16, print: 0.04, other: 0.01)
GOPHER
ACL2 >>(THEOREM PROBLEM-108A (<= (CC (GOPHER X)) (CC X))
:HINTS (("Goal" :INDUCT (GOPHER X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (GOPHER X). This
suggestion was produced using the :induction rule GOPHER. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(:P (LIST* (CAAR X) (CDAR X) (CDR X))))
(:P X))
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(:P X))).
This induction is justified by the same argument used to admit GOPHER,
namely, the measure (CC (CAR X)) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(<= (CC (GOPHER (LIST* (CAAR X) (CDAR X) (CDR X))))
(CC (LIST* (CAAR X) (CDAR X) (CDR X)))))
(<= (CC (GOPHER X)) (CC X))).
But simplification reduces this to T, using the :definitions ATOM,
CC, GOPHER and SYNP, the :executable-counterpart of BINARY-+, primitive
type reasoning and the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
2-OF-+, COMMUTATIVITY-OF-+ and FOLD-CONSTS-IN-+.
Subgoal *1/1
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(<= (CC (GOPHER X)) (CC X))).
This simplifies, using the :definitions ATOM, CC and GOPHER and the
:executable-counterpart of <, to
Subgoal *1/1'
(IMPLIES (NOT (CONSP (CAR X)))
(<= (CC X) (CC X))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-108A ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION CC)
(:DEFINITION GOPHER)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION GOPHER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE FOLD-CONSTS-IN-+)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.36 seconds (prove: 0.19, print: 0.16, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-108A
ACL2 >>(THEOREM PROBLEM-108B
(EQUAL (CONSP (GOPHER X)) (CONSP X))
:HINTS (("Goal" :INDUCT (GOPHER X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (GOPHER X). This
suggestion was produced using the :induction rule GOPHER. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(:P (LIST* (CAAR X) (CDAR X) (CDR X))))
(:P X))
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(:P X))).
This induction is justified by the same argument used to admit GOPHER,
namely, the measure (CC (CAR X)) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(EQUAL (CONSP (GOPHER (LIST* (CAAR X) (CDAR X) (CDR X))))
(CONSP (LIST* (CAAR X) (CDAR X) (CDR X)))))
(EQUAL (CONSP (GOPHER X)) (CONSP X))).
But simplification reduces this to T, using the :definitions ATOM and
GOPHER, the :executable-counterpart of EQUAL and primitive type reasoning.
Subgoal *1/1
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(EQUAL (CONSP (GOPHER X)) (CONSP X))).
But simplification reduces this to T, using the :definitions ATOM and
GOPHER, the :executable-counterpart of EQUAL and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-108B ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION GOPHER)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION GOPHER))
Warnings: None
Time: 0.18 seconds (prove: 0.13, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-108B
ACL2 >>(THEOREM PROBLEM-108C
(IMPLIES (CONSP X)
(< (CC (CDR X)) (CC X)))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-85)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-85 and the :type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-108C ...)
Rules: ((:FAKE-RUNE-FOR-LINEAR NIL)
(:LINEAR PROBLEM-85)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.03 seconds (prove: 0.01, print: 0.01, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-108C
ACL2 >>(THEOREM PROBLEM-108D
(IMPLIES (CONSP X)
(< (CC (CDR (GOPHER X))) (CC X)))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-108A
PROBLEM-108B PROBLEM-108C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using linear arithmetic, the
:linear rules PROBLEM-108A and PROBLEM-108C, the :rewrite rule PROBLEM-
108B and the :type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-108D ...)
Rules: ((:FAKE-RUNE-FOR-LINEAR NIL)
(:LINEAR PROBLEM-108A)
(:LINEAR PROBLEM-108C)
(:REWRITE PROBLEM-108B)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.07 seconds (prove: 0.04, print: 0.00, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-108D
ACL2 >>(DEFUN SAMEFRINGE (X Y)
(DECLARE (XARGS :MEASURE (CC X)
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-108D)))))
(IF (OR (ATOM X) (ATOM Y))
(EQUAL X Y)
(AND (EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y)))
(SAMEFRINGE (CDR (GOPHER X))
(CDR (GOPHER Y))))))
For the admission of SAMEFRINGE we will use the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y))))
(O< (CC (CDR (GOPHER X))) (CC X)))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By case analysis we reduce the conjecture to the following two conjectures.
Subgoal 2
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y))))
(O< (CC (CDR (GOPHER X))) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :definition ATOM, the :rewrite rules O-FINP-< and
PROBLEM-108D and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for SAMEFRINGE. Thus,
we admit this function under the principle of definition. We observe
that the type of SAMEFRINGE is described by the theorem
(OR (EQUAL (SAMEFRINGE X Y) T) (EQUAL (SAMEFRINGE X Y) NIL)). We used
primitive type reasoning.
Summary
Form: ( DEFUN SAMEFRINGE ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION ATOM)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE O-FINP-<)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE PROBLEM-108D)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.15 seconds (prove: 0.09, print: 0.02, other: 0.04)
SAMEFRINGE
ACL2 >>(THEOREM PROBLEM-109A
(EQUAL (CAR (GOPHER X))
(IF (CONSP X) (CAR (FLATTEN X)) NIL))
:HINTS
(("Goal" :INDUCT (GOPHER X)
:IN-THEORY (ENABLE PROBLEM-40))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (GOPHER X). This
suggestion was produced using the :induction rule GOPHER. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(:P (LIST* (CAAR X) (CDAR X) (CDR X))))
(:P X))
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(:P X))).
This induction is justified by the same argument used to admit GOPHER,
namely, the measure (CC (CAR X)) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES
(AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(EQUAL (CAR (GOPHER (LIST* (CAAR X) (CDAR X) (CDR X))))
(AND (CONSP (LIST* (CAAR X) (CDAR X) (CDR X)))
(CAR (FLATTEN (LIST* (CAAR X) (CDAR X) (CDR X)))))))
(EQUAL (CAR (GOPHER X))
(AND (CONSP X) (CAR (FLATTEN X))))).
But simplification reduces this to T, using the :definitions ATOM,
FLATTEN and GOPHER, primitive type reasoning and the :rewrite rules
CAR-CONS, CDR-CONS and PROBLEM-40.
Subgoal *1/1
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(EQUAL (CAR (GOPHER X))
(AND (CONSP X) (CAR (FLATTEN X))))).
This simplifies, using the :definitions ATOM and GOPHER, the :executable-
counterpart of EQUAL and the :rewrite rule DEFAULT-CAR, to the following
two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (NOT (CONSP (CAR X))) (CONSP X))
(EQUAL (CAR X) (CAR (FLATTEN X)))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/1.2'
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (CONSP X1)))
(EQUAL X1 (CAR (FLATTEN (CONS X1 X2))))).
But simplification reduces this to T, using the :definitions APP and
FLATTEN, the :executable-counterpart of CONSP, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1.1
(IMPLIES (AND (NOT (CONSP (CAR X)))
(NOT (CONSP X)))
(EQUAL (CAR X) NIL)).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-109A ...)
Rules: ((:DEFINITION APP)
(:DEFINITION ATOM)
(:DEFINITION FLATTEN)
(:DEFINITION GOPHER)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION GOPHER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CAR)
(:REWRITE PROBLEM-40))
Warnings: None
Time: 0.31 seconds (prove: 0.27, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-109A
ACL2 >>(THEOREM PROBLEM-109B
(EQUAL (FLATTEN (CDR (GOPHER X)))
(IF (CONSP X)
(CDR (FLATTEN X))
(CONS NIL NIL)))
:HINTS
(("Goal" :INDUCT (GOPHER X)
:IN-THEORY (ENABLE PROBLEM-40))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (GOPHER X). This
suggestion was produced using the :induction rule GOPHER. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(:P (LIST* (CAAR X) (CDAR X) (CDR X))))
(:P X))
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(:P X))).
This induction is justified by the same argument used to admit GOPHER,
namely, the measure (CC (CAR X)) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES
(AND (NOT (OR (ATOM X) (ATOM (CAR X))))
(EQUAL (FLATTEN (CDR (GOPHER (LIST* (CAAR X) (CDAR X) (CDR X)))))
(IF (CONSP (LIST* (CAAR X) (CDAR X) (CDR X)))
(CDR (FLATTEN (LIST* (CAAR X) (CDAR X) (CDR X))))
'(NIL))))
(EQUAL (FLATTEN (CDR (GOPHER X)))
(IF (CONSP X)
(CDR (FLATTEN X))
'(NIL)))).
But simplification reduces this to T, using the :definitions ATOM,
FLATTEN and GOPHER, primitive type reasoning and the :rewrite rules
CAR-CONS, CDR-CONS and PROBLEM-40.
Subgoal *1/1
(IMPLIES (OR (ATOM X) (ATOM (CAR X)))
(EQUAL (FLATTEN (CDR (GOPHER X)))
(IF (CONSP X)
(CDR (FLATTEN X))
'(NIL)))).
This simplifies, using the :definitions ATOM and GOPHER, the :executable-
counterparts of EQUAL and FLATTEN and the :rewrite rule DEFAULT-CDR,
to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (NOT (CONSP (CAR X))) (CONSP X))
(EQUAL (FLATTEN (CDR X))
(CDR (FLATTEN X)))).
But simplification reduces this to T, using the :definitions APP and
FLATTEN, the :executable-counterpart of CONSP, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1.1
(IMPLIES (AND (NOT (CONSP (CAR X)))
(NOT (CONSP X)))
(EQUAL (FLATTEN (CDR X)) '(NIL))).
But simplification reduces this to T, using the :executable-counterparts
of CONSP, EQUAL and FLATTEN and the :rewrite rules DEFAULT-CAR and
DEFAULT-CDR.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-109B ...)
Rules: ((:DEFINITION APP)
(:DEFINITION ATOM)
(:DEFINITION FLATTEN)
(:DEFINITION GOPHER)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FLATTEN)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION GOPHER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CAR)
(:REWRITE DEFAULT-CDR)
(:REWRITE PROBLEM-40))
Warnings: None
Time: 0.46 seconds (prove: 0.23, print: 0.22, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-109B
ACL2 >>(THEOREM PROBLEM-109C
(EQUAL (EQUAL (CONS E NIL) (APP X Y))
(IF (CONSP X)
(AND (EQUAL (CAR X) E)
(ATOM (CDR X))
(EQUAL Y NIL))
(EQUAL Y (CONS E NIL))))
:HINTS (("Goal" :INDUCT (APP X Y))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP X Y). This
suggestion was produced using the :induction rule APP. If we let
(:P E X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X Y))
(IMPLIES (AND (CONSP X) (:P E (CDR X) Y))
(:P E X Y))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (EQUAL (LIST E) (APP X Y))
(IF (CONSP X)
(AND (EQUAL (CAR X) E)
(ATOM (CDR X))
(EQUAL Y NIL))
(EQUAL Y (LIST E))))).
This simplifies, using the :definition APP and primitive type reasoning,
to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X)) (EQUAL (LIST E) Y))
(EQUAL (EQUAL Y (LIST E)) T)).
But simplification reduces this to T, using the :executable-counterpart
of EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (EQUAL (LIST E) (APP (CDR X) Y))
(IF (CONSP (CDR X))
(AND (EQUAL (CADR X) E)
(ATOM (CDDR X))
(EQUAL Y NIL))
(EQUAL Y (LIST E)))))
(EQUAL (EQUAL (LIST E) (APP X Y))
(IF (CONSP X)
(AND (EQUAL (CAR X) E)
(ATOM (CDR X))
(EQUAL Y NIL))
(EQUAL Y (LIST E))))).
This simplifies, using the :definitions APP and ATOM, the :executable-
counterpart of EQUAL, primitive type reasoning, the :rewrite rules
CDR-CONS and CONS-EQUAL and the :type-prescription rule APP, to the
following four conjectures.
Subgoal *1/1.4
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LIST E) (APP (CDR X) Y)))
(CONSP (CDR X))
(CONSP (CDDR X))
(EQUAL E (CAR X)))
(APP (CDR X) Y)).
This simplifies, using the :definition APP, primitive type reasoning
and the :rewrite rule CONS-EQUAL, to the following two conjectures.
Subgoal *1/1.4.2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (CAR X) (CADR X)))
(CONSP (CDR X))
(CONSP (CDDR X)))
(CONS (CADR X) (APP (CDDR X) Y))).
But simplification reduces this to T, using primitive type reasoning.
Subgoal *1/1.4.1
(IMPLIES (AND (CONSP X)
(APP (CDDR X) Y)
(CONSP (CDR X))
(CONSP (CDDR X)))
(CONS (CADR X) (APP (CDDR X) Y))).
But simplification reduces this to T, using primitive type reasoning.
Subgoal *1/1.3
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LIST E) (APP (CDR X) Y)))
(NOT (CONSP (CDR X)))
(NOT (EQUAL Y (LIST E)))
(EQUAL E (CAR X))
(NOT (APP (CDR X) Y)))
(NOT Y)).
But simplification reduces this to T, using the :type-prescription
rule APP.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LIST E) (APP (CDR X) NIL)))
(NOT (CONSP (CDR X)))
(LIST E)
(EQUAL E (CAR X))
(APP (CDR X) NIL))
Y).
But simplification reduces this to T, using the :definition APP and
primitive type reasoning.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LIST E) (APP (CDR X) Y)))
(CONSP (CDR X))
(NOT (EQUAL (CADR X) E))
(EQUAL E (CAR X)))
(APP (CDR X) Y)).
This simplifies, using primitive type reasoning, to
Subgoal *1/1.1'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(NOT (EQUAL (CADR X) (CAR X))))
(APP (CDR X) Y)).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2. (2) Use CAR-CDR-ELIM, again, to replace X2
by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These steps
produce the following goal.
Subgoal *1/1.1''
(IMPLIES (AND (CONSP (CONS X3 X4))
(CONSP (LIST* X1 X3 X4))
(NOT (EQUAL X3 X1)))
(APP (CONS X3 X4) Y)).
This simplifies, using the :definition APP, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/1.1'''
(IMPLIES (NOT (EQUAL X3 X1))
(CONS X3 (APP X4 Y))).
But simplification reduces this to T, using primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-109C ...)
Rules: ((:DEFINITION APP)
(:DEFINITION ATOM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE CONS-EQUAL)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.17 seconds (prove: 0.05, print: 0.12, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-109C
ACL2 >>(THEOREM PROBLEM-109D
(EQUAL (EQUAL (FLATTEN X) (CONS A NIL))
(AND (ATOM X) (EQUAL X A)))
:HINTS
(("Goal" :INDUCT (FLATTEN X)
:IN-THEORY
(ENABLE PROBLEM-40 PROBLEM-109C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FLATTEN X). This
suggestion was produced using the :induction rule FLATTEN. If we let
(:P A X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P A X))
(IMPLIES (AND (CONSP X)
(:P A (CAR X))
(:P A (CDR X)))
(:P A X))).
This induction is justified by the same argument used to admit FLATTEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (EQUAL (FLATTEN X) (LIST A))
(AND (ATOM X) (EQUAL X A)))).
But simplification reduces this to T, using the :definition FLATTEN,
the :executable-counterpart of EQUAL, primitive type reasoning and
the :rewrite rule CONS-EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (EQUAL (FLATTEN (CAR X)) (LIST A))
(AND (ATOM (CAR X)) (EQUAL (CAR X) A)))
(EQUAL (EQUAL (FLATTEN (CDR X)) (LIST A))
(AND (ATOM (CDR X)) (EQUAL (CDR X) A))))
(EQUAL (EQUAL (FLATTEN X) (LIST A))
(AND (ATOM X) (EQUAL X A)))).
But simplification reduces this to T, using the :definitions ATOM and
FLATTEN, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules PROBLEM-109C and PROBLEM-40 and the :type-prescription
rules APP and FLATTEN.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-109D ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION FLATTEN)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FLATTEN)
(:REWRITE CONS-EQUAL)
(:REWRITE PROBLEM-109C)
(:REWRITE PROBLEM-40)
(:TYPE-PRESCRIPTION APP)
(:TYPE-PRESCRIPTION FLATTEN))
Warnings: None
Time: 0.10 seconds (prove: 0.06, print: 0.02, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-109D
ACL2 >>(THEOREM PROBLEM-109
(EQUAL (SAMEFRINGE X Y)
(EQUAL (FLATTEN X) (FLATTEN Y)))
:HINTS
(("Goal" :INDUCT (SAMEFRINGE X Y)
:IN-THEORY
(ENABLE PROBLEM-109A
PROBLEM-109B PROBLEM-109D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SAMEFRINGE X Y).
This suggestion was produced using the :induction rule SAMEFRINGE.
If we let (:P X Y) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(NOT (EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y)))))
(:P X Y))
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y)))
(:P (CDR (GOPHER X)) (CDR (GOPHER Y))))
(:P X Y))
(IMPLIES (OR (ATOM X) (ATOM Y))
(:P X Y))).
This induction is justified by the same argument used to admit SAMEFRINGE,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(NOT (EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y)))))
(EQUAL (SAMEFRINGE X Y)
(EQUAL (FLATTEN X) (FLATTEN Y)))).
But simplification reduces this to T, using the :definitions ATOM and
SAMEFRINGE, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rule PROBLEM-109A and the :type-prescription rule FLATTEN.
Subgoal *1/2
(IMPLIES (AND (NOT (OR (ATOM X) (ATOM Y)))
(EQUAL (CAR (GOPHER X))
(CAR (GOPHER Y)))
(EQUAL (SAMEFRINGE (CDR (GOPHER X))
(CDR (GOPHER Y)))
(EQUAL (FLATTEN (CDR (GOPHER X)))
(FLATTEN (CDR (GOPHER Y))))))
(EQUAL (SAMEFRINGE X Y)
(EQUAL (FLATTEN X) (FLATTEN Y)))).
But simplification reduces this to T, using the :definitions ATOM and
SAMEFRINGE, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules PROBLEM-109A and PROBLEM-109B and the :type-prescription
rule FLATTEN.
Subgoal *1/1
(IMPLIES (OR (ATOM X) (ATOM Y))
(EQUAL (SAMEFRINGE X Y)
(EQUAL (FLATTEN X) (FLATTEN Y)))).
This simplifies, using the :definitions ATOM, FLATTEN and SAMEFRINGE,
primitive type reasoning and the :rewrite rule PROBLEM-109D, to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP X)) (EQUAL X Y))
(NOT (CONSP Y))).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-109 ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION FLATTEN)
(:DEFINITION SAMEFRINGE)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SAMEFRINGE)
(:REWRITE PROBLEM-109A)
(:REWRITE PROBLEM-109B)
(:REWRITE PROBLEM-109D)
(:TYPE-PRESCRIPTION FLATTEN))
Warnings: None
Time: 0.41 seconds (prove: 0.35, print: 0.05, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-109
ACL2 >>(DEFUN REL (FN X Y)
(IF (EQUAL FN '<<=)
(<<= X Y)
(IF (EQUAL FN '>>=)
(<<= Y X)
(IF (EQUAL FN '<<)
(AND (<<= X Y) (NOT (EQUAL X Y)))
(AND (<<= Y X) (NOT (EQUAL X Y)))))))
Since REL is non-recursive, its admission is trivial. We observe that
the type of REL is described by the theorem
(OR (EQUAL (REL FN X Y) T) (EQUAL (REL FN X Y) NIL)). We used the
:type-prescription rule <<=.
Summary
Form: ( DEFUN REL ...)
Rules: ((:TYPE-PRESCRIPTION <<=))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
REL
ACL2 >>(DEFUN FILTER (FN X E)
(COND ((ENDP X) NIL)
((REL FN (CAR X) E)
(CONS (CAR X) (FILTER FN (CDR X) E)))
(T (FILTER FN (CDR X) E))))
The admission of FILTER is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of FILTER is described by
the theorem (TRUE-LISTP (FILTER FN X E)). We used primitive type reasoning.
Summary
Form: ( DEFUN FILTER ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
FILTER
ACL2 >>(THEOREM PROBLEM-111A
(<= (CC (FILTER FN X E)) (CC X))
:HINTS (("Goal" :INDUCT (CC X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (CC X). This suggestion
was produced using the :induction rule CC. If we let (:P E FN X)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E FN X))
(IMPLIES (AND (CONSP X)
(:P E FN (CAR X))
(:P E FN (CDR X)))
(:P E FN X))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(<= (CC (FILTER FN X E)) (CC X))).
But simplification reduces this to T, using the :definitions CC and
FILTER and the :executable-counterparts of < and CC.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER FN (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER FN (CDR X) E))
(CC (CDR X))))
(<= (CC (FILTER FN X E)) (CC X))).
This simplifies, using the :definitions <<=, CC, FILTER and REL and
the :executable-counterpart of EQUAL, to the following ten conjectures.
Subgoal *1/1.10
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '<<= (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '<<= (CDR X) E))
(CC (CDR X)))
(EQUAL FN '<<=)
(LEXORDER (CAR X) E))
(<= (CC (CONS (CAR X) (FILTER '<<= (CDR X) E)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using the :definition CC, primitive
type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.9
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '<<= (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '<<= (CDR X) E))
(CC (CDR X)))
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E)))
(<= (CC (FILTER '<<= (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.8
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER FN (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER FN (CDR X) E))
(CC (CDR X)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER E (CAR X))
(EQUAL (CAR X) E))
(<= (CC (FILTER FN (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.7
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '>>= (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '>>= (CDR X) E))
(CC (CDR X)))
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X))))
(<= (CC (FILTER '>>= (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.6
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '>>= (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '>>= (CDR X) E))
(CC (CDR X)))
(EQUAL FN '>>=)
(LEXORDER E (CAR X)))
(<= (CC (CONS (CAR X) (FILTER '>>= (CDR X) E)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using the :definition CC, primitive
type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.5
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '<< (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '<< (CDR X) E))
(CC (CDR X)))
(EQUAL FN '<<)
(EQUAL (CAR X) E))
(<= (CC (FILTER '<< (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.4
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER FN (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER FN (CDR X) E))
(CC (CDR X)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X))))
(<= (CC (FILTER FN (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.3
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER FN (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER FN (CDR X) E))
(CC (CDR X)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(<= (CC (CONS (CAR X) (FILTER FN (CDR X) E)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using the :definition CC, primitive
type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '<< (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '<< (CDR X) E))
(CC (CDR X)))
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E)))
(<= (CC (FILTER '<< (CDR X) E))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(<= (CC (FILTER '<< (CAR X) E))
(CC (CAR X)))
(<= (CC (FILTER '<< (CDR X) E))
(CC (CDR X)))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(<= (CC (CONS (CAR X) (FILTER '<< (CDR X) E)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using the :definition CC, primitive
type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111A ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION CC)
(:DEFINITION FILTER)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION CC)
(:TYPE-PRESCRIPTION FILTER))
Warnings: None
Time: 0.73 seconds (prove: 0.55, print: 0.17, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111A
ACL2 >>(DEFUN QSORT (X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (ENDP X)
NIL
(IF (ENDP (CDR X))
X
(APP (QSORT (FILTER '<< (CDR X) (CAR X)))
(CONS (CAR X)
(QSORT (FILTER '>>= (CDR X) (CAR X))))))))
For the admission of QSORT we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X))))
(O< (CC (FILTER '>>= (CDR X) (CAR X)))
(CC X)))
(IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X))))
(O< (CC (FILTER '<< (CDR X) (CAR X)))
(CC X)))).
By the simple :definition ENDP we reduce the conjecture to the following
three conjectures.
Subgoal 3
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (FILTER '>>= (CDR X) (CAR X)))
(CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC and O<, primitive type reasoning and the :type-prescription
rule CC, to
Subgoal 2'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (CC (FILTER '>>= (CDR X) (CAR X)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 2''
(IMPLIES (AND (CONSP (CONS X1 X2)) (CONSP X2))
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using primitive type reasoning, to
Subgoal 2'''
(IMPLIES (CONSP X2)
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
Name the formula above *1.
Subgoal 1
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (FILTER '<< (CDR X) (CAR X)))
(CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC and O<, primitive type reasoning and the :type-prescription
rule CC, to
Subgoal 1'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (CC (FILTER '<< (CDR X) (CAR X)))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 1''
(IMPLIES (AND (CONSP (CONS X1 X2)) (CONSP X2))
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using primitive type reasoning, to
Subgoal 1'''
(IMPLIES (CONSP X2)
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
Name the formula above *2.
Perhaps we can prove *2 by induction. Three induction schemes are
suggested by this conjecture. These merge into two derived induction
schemes. However, one of these is flawed and so we are left with one
viable candidate.
We will induct according to a scheme suggested by (CC X2), but modified
to accommodate (FILTER '<< X2 X1). These suggestions were produced
using the :induction rules CC and FILTER. If we let (:P X1 X2) denote
*2 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X2)) (:P X1 X2))
(IMPLIES (AND (CONSP X2)
(:P X1 (CAR X2))
(:P X1 (CDR X2)))
(:P X1 X2))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X2) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following four nontautological subgoals.
Subgoal *2/4
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2)))))
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following three
conjectures.
Subgoal *2/4.3
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(NOT (LEXORDER (CAR X2) X1)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/4.2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (CC (CONS (CAR X2)
(FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS
and CDR-CONS and the :type-prescription rule FILTER, to
Subgoal *2/4.2'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (+ 1 (CC (FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1) (CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/4.1
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(EQUAL (CAR X2) X1))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/3
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2)))))
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following three
conjectures.
Subgoal *2/3.3
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(NOT (LEXORDER (CAR X2) X1)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/3.2
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (CC (CONS (CAR X2)
(FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC and FIX, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS and UNICITY-OF-0 and
the :type-prescription rules CC and FILTER, to
Subgoal *2/3.2'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (+ 1 (CC (FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1) (CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/3.1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(EQUAL (CAR X2) X1))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *2/2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2))))
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following three
conjectures.
Subgoal *2/2.3
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER (CAR X2) X1)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterpart of CC, the :rewrite rules COMMUTATIVITY-OF-+ and UNICITY-
OF-0 and the :type-prescription rule CC, to
Subgoal *2/2.3'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER (CAR X2) X1)))
(< 0 (+ 2 (CC X1) (CC (CAR X2))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *2/2.2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (CC (CONS (CAR X2)
(FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterpart of CC, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
OF-+ and UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal *2/2.2'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< 1 (+ 2 (CC X1)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *2/2.1
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(EQUAL (CAR X2) X1))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterpart of CC, the :rewrite rules COMMUTATIVITY-OF-+ and UNICITY-
OF-0 and the :type-prescription rule CC, to
Subgoal *2/2.1'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '<< (CAR X2) (CAR X2)))
(+ 1 (CC (CAR X2)) (CC (CAR X2))))
(NOT (CONSP (CDR X2))))
(< 0 (+ 2 (CC (CAR X2)) (CC (CAR X2))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *2/1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2))))
(< (CC (FILTER '<< X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following three
conjectures.
Subgoal *2/1.3
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER (CAR X2) X1)))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterparts of BINARY-+ and CC, the :rewrite rules COMMUTATIVITY-OF-
+ and UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal *2/1.3'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER (CAR X2) X1)))
(< 0 (+ 2 (CC X1)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *2/1.2
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< (CC (CONS (CAR X2)
(FILTER '<< (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterparts of BINARY-+ and CC, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the
:type-prescription rule CC, to
Subgoal *2/1.2'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(LEXORDER (CAR X2) X1)
(NOT (EQUAL (CAR X2) X1)))
(< 1 (+ 2 (CC X1)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *2/1.1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(EQUAL (CAR X2) X1))
(< (CC (FILTER '<< (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using the :definitions CC and
FILTER and the :executable-counterparts of <, BINARY-+ and CC.
That completes the proof of *2.
We therefore turn our attention to *1, which is
(IMPLIES (CONSP X2)
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
Perhaps we can prove *1 by induction. Three induction schemes are
suggested by this conjecture. These merge into two derived induction
schemes. However, one of these is flawed and so we are left with one
viable candidate.
We will induct according to a scheme suggested by (CC X2), but modified
to accommodate (FILTER '>>= X2 X1). These suggestions were produced
using the :induction rules CC and FILTER. If we let (:P X1 X2) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X2)) (:P X1 X2))
(IMPLIES (AND (CONSP X2)
(:P X1 (CAR X2))
(:P X1 (CDR X2)))
(:P X1 X2))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X2) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following four nontautological subgoals.
Subgoal *1/4
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2)))))
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following two
conjectures.
Subgoal *1/4.2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER X1 (CAR X2)))
(< (CC (CONS (CAR X2)
(FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS
and CDR-CONS and the :type-prescription rule FILTER, to
Subgoal *1/4.2'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER X1 (CAR X2)))
(< (+ 1 (CC (FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1) (CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/4.1
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(NOT (LEXORDER X1 (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/3
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2)))))
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following two
conjectures.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER X1 (CAR X2)))
(< (CC (CONS (CAR X2)
(FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC and FIX, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS and UNICITY-OF-0 and
the :type-prescription rules CC and FILTER, to
Subgoal *1/3.2'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(LEXORDER X1 (CAR X2)))
(< (+ 1 (CC (FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1) (CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 1 (CC X1) (CC (CDR X2))))
(NOT (LEXORDER X1 (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2))))
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following two
conjectures.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(LEXORDER X1 (CAR X2)))
(< (CC (CONS (CAR X2)
(FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterpart of CC, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
OF-+ and UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal *1/2.2'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(LEXORDER X1 (CAR X2)))
(< 1 (+ 2 (CC X1)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER X1 (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterpart of CC, the :rewrite rules COMMUTATIVITY-OF-+ and UNICITY-
OF-0 and the :type-prescription rule CC, to
Subgoal *1/2.1'
(IMPLIES (AND (CONSP X2)
(< (CC (FILTER '>>= (CAR X2) X1))
(+ 1 (CC X1) (CC (CAR X2))))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER X1 (CAR X2))))
(< 0 (+ 2 (CC X1) (CC (CAR X2))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *1/1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2))))
(< (CC (FILTER '>>= X2 X1))
(+ 1 (CC X1) (CC X2)))).
This simplifies, using the :definitions <<=, CC, FILTER, REL and SYNP,
the :executable-counterparts of BINARY-+ and EQUAL and the :rewrite
rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to the following two
conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(LEXORDER X1 (CAR X2)))
(< (CC (CONS (CAR X2)
(FILTER '>>= (CDR X2) X1)))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterparts of BINARY-+ and CC, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the
:type-prescription rule CC, to
Subgoal *1/1.2'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(LEXORDER X1 (CAR X2)))
(< 1 (+ 2 (CC X1)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER X1 (CAR X2))))
(< (CC (FILTER '>>= (CDR X2) X1))
(+ 2 (CC X1)
(CC (CAR X2))
(CC (CDR X2))))).
This simplifies, using the :definitions CC, FILTER and FIX, the :executable-
counterparts of BINARY-+ and CC, the :rewrite rules COMMUTATIVITY-OF-
+ and UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal *1/1.1'
(IMPLIES (AND (CONSP X2)
(NOT (CONSP (CAR X2)))
(NOT (CONSP (CDR X2)))
(NOT (LEXORDER X1 (CAR X2))))
(< 0 (+ 2 (CC X1)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
That completes the proof of the measure theorem for QSORT. Thus, we
admit this function under the principle of definition. We observe that
the type of QSORT is described by the theorem
(OR (CONSP (QSORT X)) (EQUAL (QSORT X) NIL)). We used primitive type
reasoning and the :type-prescription rule APP.
Summary
Form: ( DEFUN QSORT ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION <<=)
(:DEFINITION CC)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION FIX)
(:DEFINITION O<)
(:DEFINITION REL)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:INDUCTION FILTER)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION APP)
(:TYPE-PRESCRIPTION CC)
(:TYPE-PRESCRIPTION FILTER))
Warnings: None
Time: 1.22 seconds (prove: 0.67, print: 0.53, other: 0.02)
QSORT
ACL2 >>(THEOREM PROBLEM-111B
(AND (BOOLEANP (PERM X Y))
(PERM X X)
(IMPLIES (PERM X Y) (PERM Y X))
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z)))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-53 PROBLEM-54 PROBLEM-55)))
:RULE-CLASSES (:EQUIVALENCE))
ACL2 Warning [Equiv] in ( DEFTHM PROBLEM-111B ...): Any lemma about
(PERM X Y), proved before PERM is marked as an equivalence relation,
is stored so as to rewrite (PERM X Y) to T. After PERM is known to
be an equivalence relation, such a rule would rewrite the left-hand
side to the right-hand side, preserving PERM. You have previously
proved three possibly problematic rules about PERM, namely PROBLEM-
59, PROBLEM-59A and PROBLEM-55E. After PERM is marked as an equivalence
relation you should reconsider each problematic rule. If the rule
is merely in support of establishing that PERM is an equivalence relation,
it may be appropriate to disable it permanently hereafter. If the
rule is now intended to rewrite left to right, you must prove the lemma
again after PERM is known to be an equivalence relation.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :rewrite rule PROBLEM-53 we reduce the conjecture to
the following three conjectures.
Subgoal 3
(BOOLEANP (PERM X Y)).
But we reduce the conjecture to T, by the :compound-recognizer rule
BOOLEANP-COMPOUND-RECOGNIZER and the :type-prescription rule PERM.
Subgoal 2
(IMPLIES (PERM X Y) (PERM Y X)).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
54 and the :type-prescription rule PERM.
Subgoal 1
(IMPLIES (AND (PERM X Y) (PERM Y Z))
(PERM X Z)).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
55 and the :type-prescription rule PERM.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111B ...)
Rules: ((:COMPOUND-RECOGNIZER BOOLEANP-COMPOUND-RECOGNIZER)
(:REWRITE PROBLEM-53)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-55)
(:TYPE-PRESCRIPTION PERM))
Warnings: Equiv
Time: 0.05 seconds (prove: 0.02, print: 0.01, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
PROBLEM-111B
ACL2 >>(THEOREM PROBLEM-111C
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E)))
:HINTS
(("Goal" :INDUCT (FILTER FN Y E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FILTER FN Y E).
This suggestion was produced using the :induction rule FILTER. If
we let (:P D E FN Y) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP Y))
(NOT (REL FN (CAR Y) E))
(:P D E FN (CDR Y)))
(:P D E FN Y))
(IMPLIES (AND (NOT (ENDP Y))
(REL FN (CAR Y) E)
(:P D E FN (CDR Y)))
(:P D E FN Y))
(IMPLIES (ENDP Y) (:P D E FN Y))).
This induction is justified by the same argument used to admit FILTER,
namely, the measure (ACL2-COUNT Y) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP Y))
(NOT (REL FN (CAR Y) E))
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))))
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP Y)
(NOT (REL FN (CAR Y) E))
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E)))
(NOT (REL FN D E)))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E))).
This simplifies, using the :definitions <<=, FILTER, NOT, REL and RM,
the :executable-counterpart of EQUAL, primitive type reasoning, the
:rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rule LEXORDER, to the following 18 conjectures.
Subgoal *1/3.18
(IMPLIES (AND (CONSP Y)
(LEXORDER (CAR Y) E)
(EQUAL (CAR Y) E)
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(EQUAL FN '<<)
(EQUAL D E))
(EQUAL (FILTER '<< (CDR Y) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.17
(IMPLIES (AND (CONSP Y)
(LEXORDER (CAR Y) E)
(EQUAL (CAR Y) E)
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(EQUAL FN '<<)
(NOT (EQUAL D E)))
(EQUAL (FILTER '<< (CONS E (RM D (CDR Y))) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.16
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR Y) E)
(EQUAL (CAR Y) E)
(NOT (LEXORDER D E))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D E)))
(EQUAL (FILTER FN (CONS E (RM D (CDR Y))) E)
(FILTER FN (CDR Y) E))).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1/3.15
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR Y) E)
(EQUAL (CAR Y) E)
(NOT (EQUAL FN '<<))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D E)))
(EQUAL (FILTER FN (CONS E (RM D (CDR Y))) E)
(FILTER FN (CDR Y) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.14
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR Y) E))
(EQUAL (FILTER '<<= (RM D (CDR Y)) E)
(FILTER '<<= (CDR Y) E))
(NOT (LEXORDER D E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '<<= (CDR Y) E)
(FILTER '<<= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL and primitive type reasoning.
Subgoal *1/3.13
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR Y) E))
(EQUAL (FILTER '<<= (RM D (CDR Y)) E)
(FILTER '<<= (CDR Y) E))
(NOT (LEXORDER D E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '<<=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '<<= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.12
(IMPLIES (AND (CONSP Y)
(NOT (LEXORDER E (CAR Y)))
(EQUAL FN '>>=)
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '>>= (CDR Y) E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL and primitive type reasoning.
Subgoal *1/3.11
(IMPLIES (AND (CONSP Y)
(NOT (LEXORDER E (CAR Y)))
(EQUAL FN '>>=)
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '>>=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.10
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR Y)))
(EQUAL D E)
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL D (CAR Y)))
(LEXORDER D (CAR Y)))
(EQUAL (FILTER FN (CONS (CAR Y) (RM D (CDR Y)))
D)
(CONS (CAR Y) (FILTER FN (CDR Y) D)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.9
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR Y)))
(EQUAL D E)
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL D (CAR Y)))
(NOT (LEXORDER D (CAR Y))))
(EQUAL (FILTER FN (CONS (CAR Y) (RM D (CDR Y)))
D)
(FILTER FN (CDR Y) D))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS and
CDR-CONS.
Subgoal *1/3.8
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR Y)))
(NOT (LEXORDER E D))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER FN (CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER FN (CDR Y) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS and
CDR-CONS.
Subgoal *1/3.7
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR Y) E)
(NOT (LEXORDER E D))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL D E)))
(EQUAL (FILTER FN (CONS E (RM D (CDR Y))) E)
(FILTER FN (CDR Y) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.6
(IMPLIES (AND (CONSP Y)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR Y)))
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '>>= (CDR Y) E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL and primitive type reasoning.
Subgoal *1/3.5
(IMPLIES (AND (CONSP Y)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR Y)))
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '>>=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.4
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR Y) E))
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '<< (CDR Y) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL and primitive type reasoning.
Subgoal *1/3.3
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR Y) E))
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '<<
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.2
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR Y) E))
(EQUAL D E)
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '<< (CDR Y) D)
(FILTER '<< Y D))).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1/3.1
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR Y) E))
(EQUAL D E)
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '<<
(CONS (CAR Y) (RM D (CDR Y)))
D)
(FILTER '<< Y D))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP Y))
(REL FN (CAR Y) E)
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))))
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP Y)
(REL FN (CAR Y) E)
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E)))
(NOT (REL FN D E)))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E))).
This simplifies, using the :definitions <<=, FILTER, NOT, REL and RM,
the :executable-counterpart of EQUAL, primitive type reasoning, the
:rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER, to the following
thirteen conjectures.
Subgoal *1/2.13
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<=)
(LEXORDER (CAR Y) E)
(EQUAL (FILTER '<<= (RM D (CDR Y)) E)
(FILTER '<<= (CDR Y) E))
(NOT (LEXORDER D E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '<<= (CDR Y) E)
(FILTER '<<= Y E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.12
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<=)
(LEXORDER (CAR Y) E)
(EQUAL (FILTER '<<= (RM D (CDR Y)) E)
(FILTER '<<= (CDR Y) E))
(NOT (LEXORDER D E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '<<=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '<<= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.11
(IMPLIES (AND (CONSP Y)
(EQUAL FN '>>=)
(LEXORDER E (CAR Y))
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '>>= (CDR Y) E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.10
(IMPLIES (AND (CONSP Y)
(EQUAL FN '>>=)
(LEXORDER E (CAR Y))
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '>>=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.9
(IMPLIES (AND (CONSP Y)
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(EQUAL FN '>>=)
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '>>= (CDR Y) E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.8
(IMPLIES (AND (CONSP Y)
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(EQUAL FN '>>=)
(EQUAL (FILTER '>>= (RM D (CDR Y)) E)
(FILTER '>>= (CDR Y) E))
(NOT (LEXORDER E D))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '>>=
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.7
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(EQUAL D E)
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL FN '>>=))
(LEXORDER D (CAR Y)))
(EQUAL (CONS (CAR Y)
(FILTER FN (RM D (CDR Y)) D))
(CONS (CAR Y) (FILTER FN (CDR Y) D)))).
But simplification reduces this to T, using primitive type reasoning.
Subgoal *1/2.6
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(EQUAL D E)
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL FN '>>=))
(NOT (LEXORDER D (CAR Y))))
(EQUAL (FILTER FN (RM D (CDR Y)) D)
(FILTER FN (CDR Y) D))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.5
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(NOT (LEXORDER E D))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER FN (CDR Y) E)
(CONS (CAR Y) (FILTER FN (CDR Y) E)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.4
(IMPLIES (AND (CONSP Y)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR Y))
(NOT (EQUAL (CAR Y) E))
(NOT (LEXORDER E D))
(EQUAL (FILTER FN (RM D (CDR Y)) E)
(FILTER FN (CDR Y) E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER FN (CONS (CAR Y) (RM D (CDR Y)))
E)
(CONS (CAR Y) (FILTER FN (CDR Y) E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-
CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription
rule LEXORDER.
Subgoal *1/2.3
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(LEXORDER (CAR Y) E)
(NOT (EQUAL (CAR Y) E))
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(EQUAL D (CAR Y)))
(EQUAL (FILTER '<< (CDR Y) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/2.2
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(LEXORDER (CAR Y) E)
(NOT (EQUAL (CAR Y) E))
(NOT (LEXORDER D E))
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E))
(NOT (EQUAL D (CAR Y))))
(EQUAL (FILTER '<<
(CONS (CAR Y) (RM D (CDR Y)))
E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP Y)
(EQUAL FN '<<)
(LEXORDER (CAR Y) E)
(NOT (EQUAL (CAR Y) E))
(EQUAL D E)
(EQUAL (FILTER '<< (RM D (CDR Y)) E)
(FILTER '<< (CDR Y) E)))
(EQUAL (CONS (CAR Y)
(FILTER '<< (RM D (CDR Y)) D))
(FILTER '<< Y D))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP Y)
(IMPLIES (NOT (REL FN D E))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP Y)) (NOT (REL FN D E)))
(EQUAL (FILTER FN (RM D Y) E)
(FILTER FN Y E))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL and primitive type
reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111C ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION NOT)
(:DEFINITION REL)
(:DEFINITION RM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION FILTER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.74 seconds (prove: 0.33, print: 0.41, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111C
ACL2 >>(THEOREM PROBLEM-111D
(EQUAL (MEM D (FILTER FN X E))
(AND (MEM D X) (REL FN D E)))
:HINTS
(("Goal" :INDUCT (LEN X)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN X). This suggestion
was produced using the :induction rule LEN. If we let (:P D E FN X)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P D E FN X))
(IMPLIES (AND (CONSP X) (:P D E FN (CDR X)))
(:P D E FN X))).
This induction is justified by the same argument used to admit LEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (MEM D (FILTER FN X E))
(AND (MEM D X) (REL FN D E)))).
But simplification reduces this to T, using the :definitions FILTER
and MEM and the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (MEM D (FILTER FN (CDR X) E))
(AND (MEM D (CDR X)) (REL FN D E))))
(EQUAL (MEM D (FILTER FN X E))
(AND (MEM D X) (REL FN D E)))).
This simplifies, using the :definitions <<=, FILTER, MEM and REL, the
:executable-counterparts of EQUAL and NOT, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE, LEXORDER-TRANSITIVE, PROBLEM-
48 and PROBLEM-49A and the :type-prescription rules LEXORDER and MEM,
to the following 29 conjectures.
Subgoal *1/1.29
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
NIL)
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(EQUAL D (CAR X)))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '<<= (CDR X) E)))
(LEXORDER D E))).
By case analysis we reduce the conjecture to
Subgoal *1/1.29'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<<= (CDR X) E)))
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(EQUAL D (CAR X)))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '<<= (CDR X) E)))
(LEXORDER D E))).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rules FILTER and LEXORDER.
Subgoal *1/1.28
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
NIL)
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '<<= (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.28'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<<= (CDR X) E)))
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '<<= (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.27
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
NIL)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E))
(EQUAL D (CAR X)))
(EQUAL NIL (LEXORDER D E))).
By case analysis we reduce the conjecture to
Subgoal *1/1.27'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<<= (CDR X) E)))
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E))
(EQUAL D (CAR X)))
(EQUAL NIL (LEXORDER D E))).
But simplification reduces this to T, using primitive type reasoning.
Subgoal *1/1.26
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER D E))
(EQUAL D E)).
By case analysis we reduce the conjecture to
Subgoal *1/1.26'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER D E))
(EQUAL D E)).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.25
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER D E)
(NOT (EQUAL D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
T)).
By case analysis we reduce the conjecture to
Subgoal *1/1.25'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER D E)
(NOT (EQUAL D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
T)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rule CAR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.24
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL D E))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.24'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL D E))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.23
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.23'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.23''
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER D E)))
(NOT (EQUAL D (CAR X)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.22
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
NIL)
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(EQUAL D (CAR X)))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '>>= (CDR X) E)))
(LEXORDER E D))).
By case analysis we reduce the conjecture to
Subgoal *1/1.22'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '>>= (CDR X) E)))
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(EQUAL D (CAR X)))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '>>= (CDR X) E)))
(LEXORDER E D))).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rules FILTER and LEXORDER.
Subgoal *1/1.21
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
NIL)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X)))
(EQUAL D (CAR X)))
(EQUAL NIL (LEXORDER E D))).
By case analysis we reduce the conjecture to
Subgoal *1/1.21'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '>>= (CDR X) E)))
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X)))
(EQUAL D (CAR X)))
(EQUAL NIL (LEXORDER E D))).
But simplification reduces this to T, using primitive type reasoning.
Subgoal *1/1.20
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
NIL)
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '>>= (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.20'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '>>= (CDR X) E)))
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '>>= (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.19
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X)))
(EQUAL D (CAR X))
(LEXORDER E D))
(EQUAL D E)).
By case analysis we reduce the conjecture to
Subgoal *1/1.19'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X)))
(EQUAL D (CAR X))
(LEXORDER E D))
(EQUAL D E)).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.18
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER E D)
(NOT (EQUAL D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
T)).
By case analysis we reduce the conjecture to
Subgoal *1/1.18'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(EQUAL D (CAR X))
(LEXORDER E D)
(NOT (EQUAL D E)))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
T)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rule CAR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.17
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER E D)))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.17'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER E D)))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.17''
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (LEXORDER E D)))
(NOT (EQUAL D (CAR X)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.16
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(EQUAL D E))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.16'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(EQUAL D E))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.15
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR X) E)
(EQUAL D (CAR X))
(LEXORDER E D))
(EQUAL D E)).
By case analysis we reduce the conjecture to
Subgoal *1/1.15'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR X) E)
(EQUAL D (CAR X))
(LEXORDER E D))
(EQUAL D E)).
But we reduce the conjecture to T, by primitive type reasoning.
Subgoal *1/1.14
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(EQUAL (CAR X) E)
(EQUAL D (CAR X))
(LEXORDER D E))
(EQUAL D E)).
By case analysis we reduce the conjecture to
Subgoal *1/1.14'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(EQUAL (CAR X) E)
(EQUAL D (CAR X))
(LEXORDER D E))
(EQUAL D E)).
But we reduce the conjecture to T, by primitive type reasoning.
Subgoal *1/1.13
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.13'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D (CONS (CAR X) (FILTER FN (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.12
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
By case analysis we reduce the conjecture to
Subgoal *1/1.12'
(IMPLIES (AND (CONSP X)
(NOT (MEM D (CDR X)))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (EQUAL D (CAR X))))
(EQUAL (MEM D (CONS (CAR X) (FILTER '<< (CDR X) E)))
NIL)).
But simplification reduces this to T, using the :definition MEM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS and CDR-CONS and the :type-prescription rule FILTER.
Subgoal *1/1.11
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL FN '<<=)
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
(LEXORDER D E)))
(EQUAL (MEM D (FILTER '<<= X E))
(LEXORDER D E))).
This simplifies, using the :definitions <<=, FILTER and REL and the
:executable-counterpart of EQUAL, to
Subgoal *1/1.11'
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
(LEXORDER D E))
(LEXORDER (CAR X) E))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '<<= (CDR X) E)))
(LEXORDER D E))).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.11''
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL (MEM D (FILTER '<<= (CDR X) E))
(LEXORDER D E))
(LEXORDER (CAR X) E)
(EQUAL D (CAR X)))
(EQUAL T (LEXORDER D E))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule LEXORDER.
Subgoal *1/1.10
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL FN '>>=)
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
(LEXORDER E D)))
(EQUAL (MEM D (FILTER '>>= X E))
(LEXORDER E D))).
This simplifies, using the :definitions <<=, FILTER and REL and the
:executable-counterpart of EQUAL, to
Subgoal *1/1.10'
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
(LEXORDER E D))
(LEXORDER E (CAR X)))
(EQUAL (MEM D
(CONS (CAR X) (FILTER '>>= (CDR X) E)))
(LEXORDER E D))).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.10''
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL (MEM D (FILTER '>>= (CDR X) E))
(LEXORDER E D))
(LEXORDER E (CAR X))
(EQUAL D (CAR X)))
(EQUAL T (LEXORDER E D))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule LEXORDER.
Subgoal *1/1.9
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(EQUAL FN '<<)
(LEXORDER D E)
(NOT (EQUAL D E))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
T))
(MEM D (FILTER '<< X E))).
This simplifies, using the :definitions <<=, FILTER and REL, the :executable-
counterpart of EQUAL, primitive type reasoning and the :type-prescription
rule MEM, to
Subgoal *1/1.9'
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D (FILTER '<< (CDR X) E))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(MEM D
(CONS (CAR X) (FILTER '<< (CDR X) E)))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and
PROBLEM-49A and the :type-prescription rules FILTER and MEM.
Subgoal *1/1.8
(IMPLIES (AND (CONSP X)
(MEM D (CDR X))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER E D)
(NOT (EQUAL D E))
(EQUAL (MEM D (FILTER FN (CDR X) E)) T)
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(MEM D
(CONS (CAR X) (FILTER FN (CDR X) E)))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and
PROBLEM-49A and the :type-prescription rules FILTER and MEM.
Subgoal *1/1.7
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(EQUAL (CAR X) D))
(NOT (MEM D (FILTER FN (CDR X) D)))).
By case analysis we reduce the conjecture to
Subgoal *1/1.7'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(NOT (MEM D (FILTER FN (CDR X) E)))
(EQUAL (CAR X) D))
(NOT (MEM D (FILTER FN (CDR X) D)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.6
(IMPLIES (AND (CONSP X)
(EQUAL D E)
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(LEXORDER (CAR X) D)
(NOT (EQUAL (CAR X) D)))
(NOT (MEM D
(CONS (CAR X)
(FILTER '<< (CDR X) D))))).
By case analysis we reduce the conjecture to
Subgoal *1/1.6'
(IMPLIES (AND (CONSP X)
(EQUAL D E)
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(LEXORDER (CAR X) D)
(NOT (EQUAL (CAR X) D)))
(NOT (MEM D
(CONS (CAR X)
(FILTER '<< (CDR X) D))))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule FILTER.
Subgoal *1/1.5
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<))
(LEXORDER D (CAR X))
(NOT (EQUAL (CAR X) D)))
(NOT (MEM D
(CONS (CAR X) (FILTER FN (CDR X) D))))).
By case analysis we reduce the conjecture to
Subgoal *1/1.5'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<))
(LEXORDER D (CAR X))
(NOT (EQUAL (CAR X) D)))
(NOT (MEM D
(CONS (CAR X) (FILTER FN (CDR X) D))))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule FILTER.
Subgoal *1/1.4
(IMPLIES (AND (CONSP X)
(EQUAL D E)
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) D)))
(NOT (MEM D (FILTER '<< (CDR X) D)))).
By case analysis we reduce the conjecture to
Subgoal *1/1.4'
(IMPLIES (AND (CONSP X)
(EQUAL D E)
(NOT (MEM D (FILTER '<< (CDR X) E)))
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) D)))
(NOT (MEM D (FILTER '<< (CDR X) D)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.3
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(NOT (EQUAL FN '<<))
(NOT (LEXORDER D (CAR X))))
(NOT (MEM D (FILTER FN (CDR X) D)))).
By case analysis we reduce the conjecture to
Subgoal *1/1.3'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(EQUAL D E)
(NOT (MEM D (FILTER FN (CDR X) E)))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER D (CAR X))))
(NOT (MEM D (FILTER FN (CDR X) D)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(NOT (LEXORDER D E))
(EQUAL (MEM D (FILTER '<< (CDR X) E))
NIL))
(NOT (MEM D (FILTER '<< X E)))).
By case analysis we reduce the conjecture to
Subgoal *1/1.2'
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(NOT (LEXORDER D E))
(NOT (MEM D (FILTER '<< (CDR X) E))))
(NOT (MEM D (FILTER '<< X E)))).
This simplifies, using the :definitions <<=, FILTER and REL and the
:executable-counterpart of EQUAL, to
Subgoal *1/1.2''
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER D E))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(NOT (MEM D
(CONS (CAR X)
(FILTER '<< (CDR X) E))))).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.2'''
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER D E))
(NOT (MEM D (FILTER '<< (CDR X) E)))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(NOT (EQUAL D (CAR X)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E D))
(EQUAL (MEM D (FILTER FN (CDR X) E))
NIL)
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(NOT (MEM D
(CONS (CAR X) (FILTER FN (CDR X) E))))).
By case analysis we reduce the conjecture to
Subgoal *1/1.1'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E D))
(NOT (MEM D (FILTER FN (CDR X) E)))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(NOT (MEM D
(CONS (CAR X) (FILTER FN (CDR X) E))))).
This simplifies, using the :definition MEM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule FILTER, to
Subgoal *1/1.1''
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E D))
(NOT (MEM D (FILTER FN (CDR X) E)))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(NOT (EQUAL D (CAR X)))).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111D ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION FILTER)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION FILTER)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.97 seconds (prove: 0.39, print: 0.57, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111D
ACL2 >>(THEOREM PROBLEM-111E
(IMPLIES (NOT (MEM D X))
(EQUAL (RM D X) X))
:HINTS (("Goal" :INDUCT (RM D X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM D X). This suggestion
was produced using the :induction rule RM. If we let (:P D X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P D X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(:P D (CDR X)))
(:P D X))
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(:P D X))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (NOT (MEM D X))
(EQUAL (RM D X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (NOT (MEM D X)))
(EQUAL (RM D X) X)).
But simplification reduces this to T, using the :definitions MEM and
RM and primitive type reasoning.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (NOT (MEM D (CDR X)))
(EQUAL (RM D (CDR X)) (CDR X))))
(IMPLIES (NOT (MEM D X))
(EQUAL (RM D X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (NOT (MEM D (CDR X)))
(EQUAL (RM D (CDR X)) (CDR X)))
(NOT (MEM D X)))
(EQUAL (RM D X) X)).
But simplification reduces this to T, using the :definitions MEM, NOT
and RM, primitive type reasoning, the :rewrite rule CAR-CDR-ELIM and
the :type-prescription rule MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(IMPLIES (NOT (MEM D X))
(EQUAL (RM D X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL D (CAR X))
(NOT (MEM D X)))
(EQUAL (RM D X) X)).
But simplification reduces this to T, using the :definition MEM and
primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111E ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CDR-ELIM)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-111E
ACL2 >>(THEOREM PROBLEM-111F
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))
:HINTS
(("Goal" :INDUCT (FILTER FN X E)
:IN-THEORY
(ENABLE PROBLEM-111C
PROBLEM-111D PROBLEM-111E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FILTER FN X E).
This suggestion was produced using the :induction rule FILTER. If
we let (:P D E FN X) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (REL FN (CAR X) E))
(:P D E FN (CDR X)))
(:P D E FN X))
(IMPLIES (AND (NOT (ENDP X))
(REL FN (CAR X) E)
(:P D E FN (CDR X)))
(:P D E FN X))
(IMPLIES (ENDP X) (:P D E FN X))).
This induction is justified by the same argument used to admit FILTER,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (REL FN (CAR X) E))
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E))))
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (REL FN (CAR X) E))
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E))))
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
This simplifies, using the :definitions <<=, FILTER, REL and RM, the
:executable-counterpart of EQUAL, primitive type reasoning and the
:rewrite rule LEXORDER-REFLEXIVE, to the following twelve conjectures.
Subgoal *1/3.12
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR X) E)
(EQUAL (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(EQUAL D E))
(EQUAL (FILTER FN (CDR X) E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<= and
REL, primitive type reasoning and the :rewrite rules LEXORDER-REFLEXIVE,
PROBLEM-111C, PROBLEM-111D and PROBLEM-111E.
Subgoal *1/3.11
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR X) E)
(EQUAL (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(NOT (EQUAL D E)))
(EQUAL (FILTER FN (CONS E (RM D (CDR X))) E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.10
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E))
(EQUAL (FILTER '<<= (RM D (CDR X)) E)
(RM D (FILTER '<<= (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '<<= (CDR X) E)
(RM D (FILTER '<<= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules PROBLEM-111C, PROBLEM-111D and PROBLEM-111E and
the :type-prescription rule LEXORDER.
Subgoal *1/3.9
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E))
(EQUAL (FILTER '<<= (RM D (CDR X)) E)
(RM D (FILTER '<<= (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '<<=
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '<<= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.8
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X)))
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER FN (CDR X) E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<= and
REL, primitive type reasoning, the :rewrite rules PROBLEM-111C, PROBLEM-
111D and PROBLEM-111E and the :type-prescription rule LEXORDER.
Subgoal *1/3.7
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X)))
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER FN (CONS (CAR X) (RM D (CDR X)))
E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS and
CDR-CONS.
Subgoal *1/3.6
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(EQUAL D E))
(EQUAL (FILTER FN (CDR X) E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<= and
REL, primitive type reasoning and the :rewrite rules LEXORDER-REFLEXIVE,
PROBLEM-111C, PROBLEM-111D and PROBLEM-111E.
Subgoal *1/3.5
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(NOT (EQUAL D E)))
(EQUAL (FILTER FN (CONS E (RM D (CDR X))) E)
(FILTER FN (RM D (CDR X)) E))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.4
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X)))
(EQUAL (FILTER '>>= (RM D (CDR X)) E)
(RM D (FILTER '>>= (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '>>= (CDR X) E)
(RM D (FILTER '>>= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules PROBLEM-111C, PROBLEM-111D and PROBLEM-111E and
the :type-prescription rule LEXORDER.
Subgoal *1/3.3
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X)))
(EQUAL (FILTER '>>= (RM D (CDR X)) E)
(RM D (FILTER '>>= (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '>>=
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '>>= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E))
(EQUAL (FILTER '<< (RM D (CDR X)) E)
(RM D (FILTER '<< (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '<< (CDR X) E)
(RM D (FILTER '<< X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules PROBLEM-111C, PROBLEM-111D and PROBLEM-111E.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E))
(EQUAL (FILTER '<< (RM D (CDR X)) E)
(RM D (FILTER '<< (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '<<
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '<< X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(REL FN (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E))))
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(REL FN (CAR X) E)
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E))))
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
This simplifies, using the :definitions <<=, FILTER, REL and RM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE
and the :type-prescription rules FILTER and LEXORDER, to the following
seven conjectures.
Subgoal *1/2.7
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(EQUAL (FILTER '<<= (RM D (CDR X)) E)
(RM D (FILTER '<<= (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '<<= (CDR X) E)
(RM D (FILTER '<<= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/2.6
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(EQUAL (FILTER '<<= (RM D (CDR X)) E)
(RM D (FILTER '<<= (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '<<=
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '<<= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/2.5
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(EQUAL (FILTER '>>= (RM D (CDR X)) E)
(RM D (FILTER '>>= (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '>>= (CDR X) E)
(RM D (FILTER '>>= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/2.4
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(EQUAL (FILTER '>>= (RM D (CDR X)) E)
(RM D (FILTER '>>= (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '>>=
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '>>= X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/2.3
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(EQUAL (FILTER FN (RM D (CDR X)) E)
(RM D (FILTER FN (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER FN (CONS (CAR X) (RM D (CDR X)))
E)
(CONS (CAR X)
(FILTER FN (RM D (CDR X)) E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-
CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription
rule LEXORDER.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL (FILTER '<< (RM D (CDR X)) E)
(RM D (FILTER '<< (CDR X) E)))
(EQUAL D (CAR X)))
(EQUAL (FILTER '<< (CDR X) E)
(RM D (FILTER '<< X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(EQUAL (FILTER '<< (RM D (CDR X)) E)
(RM D (FILTER '<< (CDR X) E)))
(NOT (EQUAL D (CAR X))))
(EQUAL (FILTER '<<
(CONS (CAR X) (RM D (CDR X)))
E)
(RM D (FILTER '<< X E)))).
But simplification reduces this to T, using the :definitions <<=, FILTER,
REL and RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP X)
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(EQUAL (FILTER FN (RM D X) E)
(RM D (FILTER FN X E)))).
But simplification reduces this to T, using the :definitions FILTER
and MEM, the :executable-counterparts of CONSP and EQUAL and the :rewrite
rule PROBLEM-111E.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111F ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION REL)
(:DEFINITION RM)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FILTER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-111C)
(:REWRITE PROBLEM-111D)
(:REWRITE PROBLEM-111E)
(:TYPE-PRESCRIPTION FILTER)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.72 seconds (prove: 0.37, print: 0.33, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111F
ACL2 >>(THEOREM PROBLEM-111G
(IMPLIES (PERM X Y)
(PERM (FILTER FN X E) (FILTER FN Y E)))
:HINTS
(("Goal" :INDUCT (PERM X Y)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A
PROBLEM-54A PROBLEM-54 PROBLEM-55B
PROBLEM-55 PROBLEM-111B PROBLEM-111D
PROBLEM-111E PROBLEM-111F)))
:RULE-CLASSES :CONGRUENCE)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P E FN X Y) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (CONSP X)) (:P E FN X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P E FN X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P E FN (CDR X) (RM (CAR X) Y)))
(:P E FN X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (PERM X Y)
(PERM (FILTER FN X E)
(FILTER FN Y E)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (PERM X Y))
(PERM (FILTER FN X E) (FILTER FN Y E))).
But simplification reduces this to T, using the :definitions FILTER
and PERM and the :executable-counterpart of PERM.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (PERM X Y)
(PERM (FILTER FN X E)
(FILTER FN Y E)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(PERM X Y))
(PERM (FILTER FN X E) (FILTER FN Y E))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning and the :rewrite rule PROBLEM-55B.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (FILTER FN (CDR X) E)
(FILTER FN (RM (CAR X) Y) E))))
(IMPLIES (PERM X Y)
(PERM (FILTER FN X E)
(FILTER FN Y E)))).
By the simple :rewrite rule PROBLEM-111F we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (PERM (CDR X) (RM (CAR X) Y))
(PERM (FILTER FN (CDR X) E)
(RM (CAR X) (FILTER FN Y E))))
(PERM X Y))
(PERM (FILTER FN X E) (FILTER FN Y E))).
This simplifies, using the :definitions <<=, FILTER, MEM, PERM and
REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule PROBLEM-55B, to the following ten conjectures.
Subgoal *1/1.10
(IMPLIES (AND (CONSP X)
(PERM (FILTER '<<= (CDR X) E)
(RM (CAR X) (FILTER '<<= Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '<<=)
(LEXORDER (CAR X) E))
(PERM (CONS (CAR X) (FILTER '<<= (CDR X) E))
(FILTER '<<= Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :equivalence rule PROBLEM-111B, the :executable-counterpart
of EQUAL, primitive type reasoning, the :rewrite rules LEXORDER-REFLEXIVE,
LEXORDER-TRANSITIVE, PROBLEM-111D, PROBLEM-48, PROBLEM-49A, PROBLEM-
54, PROBLEM-54A and PROBLEM-55 and the :type-prescription rules LEXORDER
and MEM.
Subgoal *1/1.9
(IMPLIES (AND (CONSP X)
(PERM (FILTER '<<= (CDR X) E)
(RM (CAR X) (FILTER '<<= Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E)))
(PERM (FILTER '<<= (CDR X) E)
(FILTER '<<= Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :executable-counterpart of EQUAL, the :rewrite rules PROBLEM-
111D, PROBLEM-111E, PROBLEM-48 and PROBLEM-49A and the :type-prescription
rules LEXORDER and MEM.
Subgoal *1/1.8
(IMPLIES (AND (CONSP X)
(PERM (FILTER FN (CDR X) E)
(RM (CAR X) (FILTER FN Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER E (CAR X))
(EQUAL (CAR X) E))
(PERM (FILTER FN (CDR X) E)
(FILTER FN Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, primitive type reasoning, the :rewrite rules LEXORDER-TRANSITIVE,
PROBLEM-111D, PROBLEM-111E, PROBLEM-48 and PROBLEM-49A and the :type-
prescription rules LEXORDER and MEM.
Subgoal *1/1.7
(IMPLIES (AND (CONSP X)
(PERM (FILTER '>>= (CDR X) E)
(RM (CAR X) (FILTER '>>= Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X))))
(PERM (FILTER '>>= (CDR X) E)
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :executable-counterpart of EQUAL, the :rewrite rules PROBLEM-
111D, PROBLEM-111E, PROBLEM-48 and PROBLEM-49A and the :type-prescription
rules LEXORDER and MEM.
Subgoal *1/1.6
(IMPLIES (AND (CONSP X)
(PERM (FILTER '>>= (CDR X) E)
(RM (CAR X) (FILTER '>>= Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '>>=)
(LEXORDER E (CAR X)))
(PERM (CONS (CAR X) (FILTER '>>= (CDR X) E))
(FILTER '>>= Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :equivalence rule PROBLEM-111B, the :executable-counterpart
of EQUAL, primitive type reasoning, the :rewrite rules LEXORDER-REFLEXIVE,
LEXORDER-TRANSITIVE, PROBLEM-111D, PROBLEM-48, PROBLEM-49A, PROBLEM-
54, PROBLEM-54A and PROBLEM-55 and the :type-prescription rules LEXORDER
and MEM.
Subgoal *1/1.5
(IMPLIES (AND (CONSP X)
(PERM (FILTER '<< (CDR X) E)
(RM (CAR X) (FILTER '<< Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '<<)
(EQUAL (CAR X) E))
(PERM (FILTER '<< (CDR X) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE, PROBLEM-111D, PROBLEM-111E,
PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/1.4
(IMPLIES (AND (CONSP X)
(PERM (FILTER FN (CDR X) E)
(RM (CAR X) (FILTER FN Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X))))
(PERM (FILTER FN (CDR X) E)
(FILTER FN Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :rewrite rules PROBLEM-111D, PROBLEM-111E, PROBLEM-48 and
PROBLEM-49A and the :type-prescription rules LEXORDER and MEM.
Subgoal *1/1.3
(IMPLIES (AND (CONSP X)
(PERM (FILTER FN (CDR X) E)
(RM (CAR X) (FILTER FN Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E)))
(PERM (CONS (CAR X) (FILTER FN (CDR X) E))
(FILTER FN Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :equivalence rule PROBLEM-111B, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE, LEXORDER-TRANSITIVE, PROBLEM-
111D, PROBLEM-48, PROBLEM-49A, PROBLEM-54, PROBLEM-54A and PROBLEM-
55 and the :type-prescription rules LEXORDER and MEM.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(PERM (FILTER '<< (CDR X) E)
(RM (CAR X) (FILTER '<< Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E)))
(PERM (FILTER '<< (CDR X) E)
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :executable-counterpart of EQUAL, the :rewrite rules PROBLEM-
111D, PROBLEM-111E, PROBLEM-48 and PROBLEM-49A and the :type-prescription
rule MEM.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(PERM (FILTER '<< (CDR X) E)
(RM (CAR X) (FILTER '<< Y E)))
(MEM (CAR X) Y)
(PERM (CDR X) (RM (CAR X) Y))
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(PERM (CONS (CAR X) (FILTER '<< (CDR X) E))
(FILTER '<< Y E))).
But simplification reduces this to T, using the :definitions <<= and
REL, the :equivalence rule PROBLEM-111B, the :executable-counterpart
of EQUAL, primitive type reasoning, the :rewrite rules LEXORDER-REFLEXIVE,
LEXORDER-TRANSITIVE, PROBLEM-111D, PROBLEM-48, PROBLEM-49A, PROBLEM-
54, PROBLEM-54A and PROBLEM-55 and the :type-prescription rules LEXORDER
and MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111G ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION FILTER)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION REL)
(:EQUIVALENCE PROBLEM-111B)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART PERM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-111D)
(:REWRITE PROBLEM-111E)
(:REWRITE PROBLEM-111F)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55)
(:REWRITE PROBLEM-55B)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.38 seconds (prove: 0.16, print: 0.19, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.00, other: 0.05)
PROBLEM-111G
ACL2 >>(THEOREM PROBLEM-111H
(PERM (APP A (CONS E B))
(CONS E (APP A B)))
:HINTS
(("Goal" :INDUCT (APP A B)
:IN-THEORY
(ENABLE PROBLEM-46 PROBLEM-54A
PROBLEM-54 PROBLEM-55 PROBLEM-111B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A) (:P (CDR A) B E))
(:P A B E))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(PERM (APP A (CONS E B))
(CONS E (APP A B)))).
But simplification reduces this to T, using the :definition APP, primitive
type reasoning and the :rewrite rule PROBLEM-54.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(PERM (APP (CDR A) (CONS E B))
(CONS E (APP (CDR A) B))))
(PERM (APP A (CONS E B))
(CONS E (APP A B)))).
But simplification reduces this to T, using the :definitions APP, MEM
and RM, the :equivalence rule PROBLEM-111B, primitive type reasoning
and the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-46, PROBLEM-54,
PROBLEM-54A and PROBLEM-55.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111H ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION RM)
(:EQUIVALENCE PROBLEM-111B)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-46)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111H
ACL2 >>(THEOREM PROBLEM-111I
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)
:HINTS
(("Goal" :INDUCT (FILTER '>>= X E)
:IN-THEORY
(ENABLE PROBLEM-54A PROBLEM-54
PROBLEM-55 PROBLEM-111B PROBLEM-111H))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FILTER '>>= X E).
This suggestion was produced using the :induction rule FILTER. If
we let (:P E X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (REL '>>= (CAR X) E))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (NOT (ENDP X))
(REL '>>= (CAR X) E)
(:P E (CDR X)))
(:P E X))
(IMPLIES (ENDP X) (:P E X))).
This induction is justified by the same argument used to admit FILTER,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (REL '>>= (CAR X) E))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X)))
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (REL '>>= (CAR X) E))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X)))
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
This simplifies, using the :definitions <<=, FILTER and REL and the
:executable-counterpart of EQUAL, to the following three conjectures.
Subgoal *1/3.3
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X))
(NOT (LEXORDER (CAR X) E)))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
X)).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(PERM (APP (CONS (CAR X) (FILTER '<< (CDR X) E))
(FILTER '>>= (CDR X) E))
X)).
But simplification reduces this to T, using the :definitions APP, MEM
and RM, the :equivalence rule PROBLEM-111B, primitive type reasoning,
the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE, LEXORDER-TRANSITIVE, PROBLEM-54, PROBLEM-
54A and PROBLEM-55 and the :type-prescription rules FILTER and LEXORDER.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X))
(EQUAL (CAR X) E))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
X)).
But simplification reduces this to T, using primitive type reasoning
and the :forward-chaining rule LEXORDER-TOTAL.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(REL '>>= (CAR X) E)
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X)))
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(REL '>>= (CAR X) E)
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X)))
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
This simplifies, using the :definitions <<=, FILTER, MEM, PERM, REL
and RM, the :equivalence rule PROBLEM-111B, the :executable-counterpart
of EQUAL, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-
CONS, LEXORDER-REFLEXIVE, LEXORDER-TRANSITIVE and PROBLEM-111H and
the :type-prescription rule LEXORDER, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(PERM (APP (FILTER '<< (CDR X) E)
(FILTER '>>= (CDR X) E))
(CDR X))
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E)))
(PERM (APP (CONS (CAR X) (FILTER '<< (CDR X) E))
(FILTER '>>= (CDR X) E))
(CDR X))).
But simplification reduces this to T, using the :forward-chaining rule
LEXORDER-ANTI-SYMMETRIC and the :type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP X)
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(PERM (APP (FILTER '<< X E) (FILTER '>>= X E))
X)).
But simplification reduces this to T, using the :definitions FILTER
and PERM, the :executable-counterparts of APP and CONSP and the :rewrite
rule PROBLEM-54.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111I ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION APP)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION REL)
(:DEFINITION RM)
(:EQUIVALENCE PROBLEM-111B)
(:EXECUTABLE-COUNTERPART APP)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING LEXORDER-ANTI-SYMMETRIC)
(:FORWARD-CHAINING LEXORDER-TOTAL)
(:INDUCTION FILTER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-111H)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55)
(:TYPE-PRESCRIPTION FILTER)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.15 seconds (prove: 0.04, print: 0.10, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111I
ACL2 >>(THEOREM PROBLEM-111J
(IMPLIES (MEM E X)
(PERM (APP (RM E X) Y)
(RM E (APP X Y))))
:HINTS
(("Goal" :INDUCT (APP X Y)
:IN-THEORY
(ENABLE PROBLEM-53 PROBLEM-54
PROBLEM-54A PROBLEM-55 PROBLEM-111B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP X Y). This
suggestion was produced using the :induction rule APP. If we let
(:P E X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X Y))
(IMPLIES (AND (CONSP X) (:P E (CDR X) Y))
(:P E X Y))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(IMPLIES (MEM E X)
(PERM (APP (RM E X) Y)
(RM E (APP X Y))))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X)) (MEM E X))
(PERM (APP (RM E X) Y)
(RM E (APP X Y)))).
But simplification reduces this to T, using the :definition MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(IMPLIES (MEM E (CDR X))
(PERM (APP (RM E (CDR X)) Y)
(RM E (APP (CDR X) Y)))))
(IMPLIES (MEM E X)
(PERM (APP (RM E X) Y)
(RM E (APP X Y))))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(IMPLIES (MEM E (CDR X))
(PERM (APP (RM E (CDR X)) Y)
(RM E (APP (CDR X) Y))))
(MEM E X))
(PERM (APP (RM E X) Y)
(RM E (APP X Y)))).
This simplifies, using the :definitions APP, MEM and RM, primitive
type reasoning and the :rewrite rules CAR-CONS, CDR-CONS and PROBLEM-
54, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(PERM (APP (RM E (CDR X)) Y)
(RM E (APP (CDR X) Y)))
(MEM E (CDR X))
(EQUAL E (CAR X)))
(PERM (APP (CDR X) Y) (APP (CDR X) Y))).
But we reduce the conjecture to T, by the simple :rewrite rule PROBLEM-
53.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(PERM (APP (RM E (CDR X)) Y)
(RM E (APP (CDR X) Y)))
(MEM E (CDR X))
(NOT (EQUAL E (CAR X))))
(PERM (APP (CONS (CAR X) (RM E (CDR X))) Y)
(CONS (CAR X) (RM E (APP (CDR X) Y))))).
But simplification reduces this to T, using the :definitions APP, MEM
and RM, the :equivalence rule PROBLEM-111B, primitive type reasoning
and the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-54, PROBLEM-54A
and PROBLEM-55.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111J ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:EQUIVALENCE PROBLEM-111B)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-53)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55))
Warnings: None
Time: 0.08 seconds (prove: 0.01, print: 0.04, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111J
ACL2 >>(THEOREM PROBLEM-111K
(IMPLIES (PERM A B)
(PERM (APP A C) (APP B C)))
:HINTS
(("Goal" :INDUCT (PERM A B)
:IN-THEORY
(ENABLE PROBLEM-46 PROBLEM-48 PROBLEM-49A
PROBLEM-54A PROBLEM-54 PROBLEM-55B
PROBLEM-55 PROBLEM-111B PROBLEM-111J)))
:RULE-CLASSES :CONGRUENCE)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM A B). This
suggestion was produced using the :induction rule PERM. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B C))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(:P A B C))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) (RM (CAR A) B) C))
(:P A B C))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (PERM A B)
(PERM (APP A C) (APP B C)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A)) (PERM A B))
(PERM (APP A C) (APP B C))).
But simplification reduces this to T, using the :definitions APP and
PERM, primitive type reasoning and the :rewrite rule PROBLEM-54.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(IMPLIES (PERM A B)
(PERM (APP A C) (APP B C)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(PERM A B))
(PERM (APP A C) (APP B C))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning and the :rewrite rule PROBLEM-55B.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(PERM (APP (CDR A) C)
(APP (RM (CAR A) B) C))))
(IMPLIES (PERM A B)
(PERM (APP A C) (APP B C)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(PERM (APP (CDR A) C)
(APP (RM (CAR A) B) C)))
(PERM A B))
(PERM (APP A C) (APP B C))).
But simplification reduces this to T, using the :definitions APP, MEM
and PERM, the :equivalence rule PROBLEM-111B, primitive type reasoning,
the :rewrite rules PROBLEM-111J, PROBLEM-46, PROBLEM-48, PROBLEM-49A,
PROBLEM-54, PROBLEM-54A, PROBLEM-55 and PROBLEM-55B and the :type-
prescription rule MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111K ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:EQUIVALENCE PROBLEM-111B)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-111J)
(:REWRITE PROBLEM-46)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55)
(:REWRITE PROBLEM-55B)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.19 seconds (prove: 0.02, print: 0.15, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111K
ACL2 >>(THEOREM PROBLEM-111L
(IMPLIES (PERM A B)
(PERM (APP C A) (APP C B)))
:HINTS
(("Goal" :INDUCT (APP C B)
:IN-THEORY
(ENABLE PROBLEM-54A
PROBLEM-54 PROBLEM-55 PROBLEM-111B)))
:RULE-CLASSES :CONGRUENCE)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP C B). This
suggestion was produced using the :induction rule APP. If we let
(:P A B C) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP C)) (:P A B C))
(IMPLIES (AND (CONSP C) (:P A B (CDR C)))
(:P A B C))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT C) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP C))
(IMPLIES (PERM A B)
(PERM (APP C A) (APP C B)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP C)) (PERM A B))
(PERM (APP C A) (APP C B))).
But simplification reduces this to T, using the :definition APP, the
:equivalence rule PROBLEM-111B, primitive type reasoning and the :rewrite
rule PROBLEM-55.
Subgoal *1/1
(IMPLIES (AND (CONSP C)
(IMPLIES (PERM A B)
(PERM (APP (CDR C) A) (APP (CDR C) B))))
(IMPLIES (PERM A B)
(PERM (APP C A) (APP C B)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP C)
(IMPLIES (PERM A B)
(PERM (APP (CDR C) A) (APP (CDR C) B)))
(PERM A B))
(PERM (APP C A) (APP C B))).
But simplification reduces this to T, using the :definitions APP, MEM
and RM, the :equivalence rule PROBLEM-111B, primitive type reasoning
and the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-54, PROBLEM-54A
and PROBLEM-55.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111L ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:EQUIVALENCE PROBLEM-111B)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-54)
(:REWRITE PROBLEM-54A)
(:REWRITE PROBLEM-55))
Warnings: None
Time: 0.06 seconds (prove: 0.01, print: 0.03, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-111L
ACL2 >>(THEOREM PROBLEM-111-A (PERM (QSORT X) X)
:HINTS
(("Goal" :INDUCT (QSORT X)
:IN-THEORY
(ENABLE PROBLEM-54
PROBLEM-111B PROBLEM-111H PROBLEM-111I
PROBLEM-111K PROBLEM-111L))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (QSORT X). This
suggestion was produced using the :induction rule QSORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(:P (FILTER '<< (CDR X) (CAR X)))
(:P (FILTER '>>= (CDR X) (CAR X))))
(:P X))
(IMPLIES (AND (NOT (ENDP X)) (ENDP (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit QSORT,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(PERM (QSORT (FILTER '<< (CDR X) (CAR X)))
(FILTER '<< (CDR X) (CAR X)))
(PERM (QSORT (FILTER '>>= (CDR X) (CAR X)))
(FILTER '>>= (CDR X) (CAR X))))
(PERM (QSORT X) X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(PERM (QSORT (FILTER '<< (CDR X) (CAR X)))
(FILTER '<< (CDR X) (CAR X)))
(PERM (QSORT (FILTER '>>= (CDR X) (CAR X)))
(FILTER '>>= (CDR X) (CAR X))))
(PERM (QSORT X) X)).
But simplification reduces this to T, using the :congruence rules PROBLEM-
111K and PROBLEM-111L, the :definitions MEM, PERM, QSORT and RM, the
:equivalence rule PROBLEM-111B, primitive type reasoning and the :rewrite
rules CAR-CONS, CDR-CONS, PROBLEM-111H, PROBLEM-111I and PROBLEM-54.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X)) (ENDP (CDR X)))
(PERM (QSORT X) X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(PERM (QSORT X) X)).
But simplification reduces this to T, using the :definition QSORT,
primitive type reasoning and the :rewrite rule PROBLEM-54.
Subgoal *1/1
(IMPLIES (ENDP X) (PERM (QSORT X) X)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(PERM (QSORT X) X)).
But simplification reduces this to T, using the :definitions PERM and
QSORT, the :executable-counterpart of CONSP and the :rewrite rule PROBLEM-
54.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111-A ...)
Rules: ((:CONGRUENCE PROBLEM-111K)
(:CONGRUENCE PROBLEM-111L)
(:DEFINITION ENDP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:DEFINITION QSORT)
(:DEFINITION RM)
(:EQUIVALENCE PROBLEM-111B)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION QSORT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-111H)
(:REWRITE PROBLEM-111I)
(:REWRITE PROBLEM-54))
Warnings: None
Time: 0.09 seconds (prove: 0.02, print: 0.06, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111-A
ACL2 >>(DEFUN ALL-REL (FN X E)
(COND ((ENDP X) T)
((REL FN (CAR X) E)
(ALL-REL FN (CDR X) E))
(T NIL)))
The admission of ALL-REL is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of ALL-REL is described by
the theorem (OR (EQUAL (ALL-REL FN X E) T) (EQUAL (ALL-REL FN X E) NIL)).
Summary
Form: ( DEFUN ALL-REL ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
ALL-REL
ACL2 >>(THEOREM PROBLEM-111M
(EQUAL (CAR (APP A B))
(IF (CONSP A) (CAR A) (CAR B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
This simplifies, using trivial observations, to the following two conjectures.
Subgoal 2
(IMPLIES (CONSP A)
(EQUAL (CAR (APP A B)) (CAR A))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal 2'
(IMPLIES (CONSP (CONS A1 A2))
(EQUAL (CAR (APP (CONS A1 A2) B)) A1)).
But simplification reduces this to T, using the :definition APP, primitive
type reasoning and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal 1
(IMPLIES (NOT (CONSP A))
(EQUAL (CAR (APP A B)) (CAR B))).
But simplification reduces this to T, using the :definition APP and
primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111M ...)
Rules: ((:DEFINITION APP)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS))
Warnings: None
Time: 0.03 seconds (prove: 0.01, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111M
ACL2 >>(THEOREM PROBLEM-111N
(IMPLIES (AND (LEXORDER E (CAR A)) (ORDERED A))
(ALL-REL '>>= A E))
:HINTS
(("Goal" :INDUCT (ALL-REL '>>= A E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ALL-REL '>>= A E).
This suggestion was produced using the :induction rule ALL-REL. If
we let (:P A E) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP A))
(NOT (REL '>>= (CAR A) E)))
(:P A E))
(IMPLIES (AND (NOT (ENDP A))
(REL '>>= (CAR A) E)
(:P (CDR A) E))
(:P A E))
(IMPLIES (ENDP A) (:P A E))).
This induction is justified by the same argument used to admit ALL-
REL, namely, the measure (ACL2-COUNT A) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP A))
(NOT (REL '>>= (CAR A) E)))
(IMPLIES (AND (LEXORDER E (CAR A)) (ORDERED A))
(ALL-REL '>>= A E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP A)
(NOT (REL '>>= (CAR A) E))
(LEXORDER E (CAR A))
(ORDERED A))
(ALL-REL '>>= A E)).
But simplification reduces this to T, using the :definitions <<= and
REL, the :executable-counterpart of EQUAL, the :rewrite rules LEXORDER-
REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP A))
(REL '>>= (CAR A) E)
(IMPLIES (AND (LEXORDER E (CADR A))
(ORDERED (CDR A)))
(ALL-REL '>>= (CDR A) E)))
(IMPLIES (AND (LEXORDER E (CAR A)) (ORDERED A))
(ALL-REL '>>= A E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(REL '>>= (CAR A) E)
(IMPLIES (AND (LEXORDER E (CADR A))
(ORDERED (CDR A)))
(ALL-REL '>>= (CDR A) E))
(LEXORDER E (CAR A))
(ORDERED A))
(ALL-REL '>>= A E)).
This simplifies, using the :definitions <<=, ALL-REL, ORDERED and REL,
the :executable-counterpart of EQUAL, the :rewrite rules LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rules ALL-REL and
LEXORDER, to the following three conjectures.
Subgoal *1/2.3
(IMPLIES (AND (CONSP A)
(NOT (LEXORDER E (CADR A)))
(LEXORDER E (CAR A))
(NOT (CONSP (CDR A))))
(ALL-REL '>>= (CDR A) E)).
But simplification reduces this to T, using the :definition ALL-REL
and the :rewrite rule DEFAULT-CAR.
Subgoal *1/2.2
(IMPLIES (AND (CONSP A)
(NOT (LEXORDER E (CADR A)))
(LEXORDER E (CAR A))
(LEXORDER (CAR A) (CADR A))
(ORDERED (CDR A)))
(ALL-REL '>>= (CDR A) E)).
But simplification reduces this to T, using the :rewrite rule LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP A)
(NOT (ORDERED (CDR A)))
(LEXORDER E (CAR A))
(NOT (CONSP (CDR A))))
(ALL-REL '>>= (CDR A) E)).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1/1
(IMPLIES (ENDP A)
(IMPLIES (AND (LEXORDER E (CAR A)) (ORDERED A))
(ALL-REL '>>= A E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP A))
(LEXORDER E (CAR A))
(ORDERED A))
(ALL-REL '>>= A E)).
But simplification reduces this to T, using the :definitions ALL-REL
and ORDERED and the :rewrite rule DEFAULT-CAR.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111N depends upon the :type-prescription rule
ALL-REL.
Summary
Form: ( DEFTHM PROBLEM-111N ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION ENDP)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART EQUAL)
(:INDUCTION ALL-REL)
(:REWRITE DEFAULT-CAR)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.10 seconds (prove: 0.04, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111N
ACL2 >>(THEOREM PROBLEM-111O
(IMPLIES (AND (LEXORDER D (CAR A))
(CONSP A)
(ORDERED (APP A (CONS E B))))
(LEXORDER D E))
:HINTS
(("Goal" :INDUCT (APP A (CONS E B))
:IN-THEORY (ENABLE PROBLEM-111M))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-111O ...): The :REWRITE rule
generated from PROBLEM-111O contains the free variables B and A. These
variables will be chosen by searching for instances of (LEXORDER D (CAR A))
and (ORDERED (APP A (CONS E B))) among the hypotheses of the conjecture
being rewritten. This is generally a severe restriction on the applicability
of the :REWRITE rule. See :DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A (CONS E B)).
This suggestion was produced using the :induction rule APP. If we
let (:P A B D E) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (CONSP A)) (:P A B D E))
(IMPLIES (AND (CONSP A) (:P (CDR A) B D E))
(:P A B D E))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
one nontautological subgoal.
Subgoal *1/
(IMPLIES (AND (CONSP A)
(IMPLIES (AND (LEXORDER D (CADR A))
(CONSP (CDR A))
(ORDERED (APP (CDR A) (CONS E B))))
(LEXORDER D E)))
(IMPLIES (AND (LEXORDER D (CAR A))
(CONSP A)
(ORDERED (APP A (CONS E B))))
(LEXORDER D E))).
By case analysis we reduce the conjecture to
Subgoal *1/'
(IMPLIES (AND (CONSP A)
(IMPLIES (AND (LEXORDER D (CADR A))
(CONSP (CDR A))
(ORDERED (APP (CDR A) (CONS E B))))
(LEXORDER D E))
(LEXORDER D (CAR A))
(ORDERED (APP A (CONS E B))))
(LEXORDER D E)).
This simplifies, using the :definitions <<=, APP and ORDERED, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-TRANSITIVE
and PROBLEM-111M and the :type-prescription rules APP and LEXORDER,
to
Subgoal *1/''
(IMPLIES (AND (CONSP A)
(NOT (LEXORDER D (CADR A)))
(LEXORDER D (CAR A))
(CONSP (CDR A))
(LEXORDER (CAR A) (CADR A))
(ORDERED (APP (CDR A) (CONS E B))))
(LEXORDER D E)).
But simplification reduces this to T, using the :rewrite rule LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111O depends upon the :type-prescription rule
LEXORDER.
Summary
Form: ( DEFTHM PROBLEM-111O ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION APP)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-111M)
(:TYPE-PRESCRIPTION APP)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: Free
Time: 0.07 seconds (prove: 0.01, print: 0.03, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111O
ACL2 >>(THEOREM PROBLEM-111P
(IFF (ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))
:HINTS
(("Goal" :INDUCT (ALL-REL '<<= A E)
:IN-THEORY
(ENABLE PROBLEM-111M
PROBLEM-111N PROBLEM-111O))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ALL-REL '<<= A E).
This suggestion was produced using the :induction rule ALL-REL. If
we let (:P A B E) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP A))
(NOT (REL '<<= (CAR A) E)))
(:P A B E))
(IMPLIES (AND (NOT (ENDP A))
(REL '<<= (CAR A) E)
(:P (CDR A) B E))
(:P A B E))
(IMPLIES (ENDP A) (:P A B E))).
This induction is justified by the same argument used to admit ALL-
REL, namely, the measure (ACL2-COUNT A) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP A))
(NOT (REL '<<= (CAR A) E)))
(IFF (ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP A)
(NOT (REL '<<= (CAR A) E)))
(COND ((ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))
((AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E))
NIL)
(T T))).
This simplifies, using the :definitions <<=, ALL-REL and REL and the
:executable-counterpart of EQUAL, to
Subgoal *1/3''
(IMPLIES (AND (CONSP A)
(NOT (LEXORDER (CAR A) E)))
(NOT (ORDERED (APP A (CONS E B))))).
The destructor terms (CAR A) and (CDR A) can be eliminated by using
CAR-CDR-ELIM to replace A by (CONS A1 A2), (CAR A) by A1 and (CDR A)
by A2. This produces the following goal.
Subgoal *1/3'''
(IMPLIES (AND (CONSP (CONS A1 A2))
(NOT (LEXORDER A1 E)))
(NOT (ORDERED (APP (CONS A1 A2) (CONS E B))))).
This simplifies, using the :definitions <<=, APP and ORDERED, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS and PROBLEM-111M
and the :type-prescription rule APP, to
Subgoal *1/3'4'
(IMPLIES (AND (NOT (LEXORDER A1 E))
(CONSP A2)
(LEXORDER A1 (CAR A2)))
(NOT (ORDERED (APP A2 (CONS E B))))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
111O and the :type-prescription rules LEXORDER and ORDERED.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP A))
(REL '<<= (CAR A) E)
(IFF (ORDERED (APP (CDR A) (CONS E B)))
(AND (ORDERED (CDR A))
(ORDERED B)
(ALL-REL '<<= (CDR A) E)
(ALL-REL '>>= B E))))
(IFF (ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(REL '<<= (CAR A) E)
(COND ((ORDERED (APP (CDR A) (CONS E B)))
(AND (ORDERED (CDR A))
(ORDERED B)
(ALL-REL '<<= (CDR A) E)
(ALL-REL '>>= B E)))
((AND (ORDERED (CDR A))
(ORDERED B)
(ALL-REL '<<= (CDR A) E)
(ALL-REL '>>= B E))
NIL)
(T T)))
(COND ((ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))
((AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E))
NIL)
(T T))).
This simplifies, using the :definitions <<=, ALL-REL, APP, ORDERED
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE, LEXORDER-
TRANSITIVE and PROBLEM-111M and the :type-prescription rules ALL-REL,
APP, LEXORDER and ORDERED, to
Subgoal *1/2''
(IMPLIES (AND (CONSP A)
(LEXORDER (CAR A) E)
(NOT (ORDERED (APP (CDR A) (CONS E B))))
(NOT (ORDERED (CDR A)))
(NOT (CONSP (CDR A)))
(ORDERED B)
(ALL-REL '<<= (CDR A) E))
(NOT (ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, APP
and ORDERED, primitive type reasoning, the :rewrite rules CAR-CONS
and CDR-CONS and the :type-prescription rules LEXORDER and ORDERED.
Subgoal *1/1
(IMPLIES (ENDP A)
(IFF (ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP A))
(COND ((ORDERED (APP A (CONS E B)))
(AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E)))
((AND (ORDERED A)
(ORDERED B)
(ALL-REL '<<= A E)
(ALL-REL '>>= B E))
NIL)
(T T))).
This simplifies, using the :definitions <<=, ALL-REL, APP and ORDERED,
primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS,
to the following four conjectures.
Subgoal *1/1.4
(IMPLIES (AND (NOT (CONSP A))
(CONSP B)
(NOT (LEXORDER E (CAR B)))
(ORDERED B))
(NOT (ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL and the :executable-counterpart of EQUAL.
Subgoal *1/1.3
(IMPLIES (AND (NOT (CONSP A)) (NOT (CONSP B)))
(ALL-REL '>>= B E)).
But simplification reduces this to T, using the :definition ALL-REL.
Subgoal *1/1.2
(IMPLIES (AND (NOT (CONSP A)) (NOT (CONSP B)))
(ORDERED B)).
But simplification reduces this to T, using the :definition ORDERED.
Subgoal *1/1.1
(IMPLIES (AND (NOT (CONSP A))
(LEXORDER E (CAR B))
(ORDERED B))
(ALL-REL '>>= B E)).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
111N and the :type-prescription rules LEXORDER and ORDERED.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111P depends upon the :type-prescription rules
ALL-REL and ORDERED.
Summary
Form: ( DEFTHM PROBLEM-111P ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION APP)
(:DEFINITION ENDP)
(:DEFINITION IFF)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:DEFINITION REL)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ALL-REL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:REWRITE PROBLEM-111M)
(:REWRITE PROBLEM-111N)
(:REWRITE PROBLEM-111O)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION APP)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION ORDERED))
Warnings: None
Time: 0.17 seconds (prove: 0.07, print: 0.07, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111P
ACL2 >>(THEOREM PROBLEM-111Q
(ALL-REL '<<= (FILTER '<< X E) E)
:HINTS
(("Goal" :INDUCT (FILTER '<< X E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FILTER '<< X E).
This suggestion was produced using the :induction rule FILTER. If
we let (:P E X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (REL '<< (CAR X) E))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (NOT (ENDP X))
(REL '<< (CAR X) E)
(:P E (CDR X)))
(:P E X))
(IMPLIES (ENDP X) (:P E X))).
This induction is justified by the same argument used to admit FILTER,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (REL '<< (CAR X) E))
(ALL-REL '<<= (FILTER '<< (CDR X) E) E))
(ALL-REL '<<= (FILTER '<< X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (REL '<< (CAR X) E))
(ALL-REL '<<= (FILTER '<< (CDR X) E) E))
(ALL-REL '<<= (FILTER '<< X E) E)).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rule LEXORDER-REFLEXIVE and the :type-prescription rule
ALL-REL.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(REL '<< (CAR X) E)
(ALL-REL '<<= (FILTER '<< (CDR X) E) E))
(ALL-REL '<<= (FILTER '<< X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(REL '<< (CAR X) E)
(ALL-REL '<<= (FILTER '<< (CDR X) E) E))
(ALL-REL '<<= (FILTER '<< X E) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, FILTER and REL, the :executable-counterpart of EQUAL, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rules ALL-REL, FILTER
and LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP X)
(ALL-REL '<<= (FILTER '<< X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(ALL-REL '<<= (FILTER '<< X E) E)).
But simplification reduces this to T, using the :definitions ALL-REL
and FILTER and the :executable-counterpart of CONSP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111Q depends upon the :type-prescription rule
ALL-REL.
Summary
Form: ( DEFTHM PROBLEM-111Q ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION NOT)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FILTER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION FILTER)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111Q
ACL2 >>(THEOREM PROBLEM-111R
(ALL-REL '>>= (FILTER '>>= X E) E)
:HINTS
(("Goal" :INDUCT (FILTER '>>= X E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FILTER '>>= X E).
This suggestion was produced using the :induction rule FILTER. If
we let (:P E X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (REL '>>= (CAR X) E))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (NOT (ENDP X))
(REL '>>= (CAR X) E)
(:P E (CDR X)))
(:P E X))
(IMPLIES (ENDP X) (:P E X))).
This induction is justified by the same argument used to admit FILTER,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (REL '>>= (CAR X) E))
(ALL-REL '>>=
(FILTER '>>= (CDR X) E)
E))
(ALL-REL '>>= (FILTER '>>= X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (REL '>>= (CAR X) E))
(ALL-REL '>>=
(FILTER '>>= (CDR X) E)
E))
(ALL-REL '>>= (FILTER '>>= X E) E)).
But simplification reduces this to T, using the :definitions <<=, FILTER
and REL, the :executable-counterpart of EQUAL and the :type-prescription
rule ALL-REL.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(REL '>>= (CAR X) E)
(ALL-REL '>>=
(FILTER '>>= (CDR X) E)
E))
(ALL-REL '>>= (FILTER '>>= X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(REL '>>= (CAR X) E)
(ALL-REL '>>=
(FILTER '>>= (CDR X) E)
E))
(ALL-REL '>>= (FILTER '>>= X E) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, FILTER and REL, the :executable-counterpart of EQUAL, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rules ALL-REL, FILTER
and LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP X)
(ALL-REL '>>= (FILTER '>>= X E) E)).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(ALL-REL '>>= (FILTER '>>= X E) E)).
But simplification reduces this to T, using the :definitions ALL-REL
and FILTER and the :executable-counterpart of CONSP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111R depends upon the :type-prescription rule
ALL-REL.
Summary
Form: ( DEFTHM PROBLEM-111R ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION ENDP)
(:DEFINITION FILTER)
(:DEFINITION NOT)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION FILTER)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION FILTER)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.17 seconds (prove: 0.02, print: 0.15, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111R
ACL2 >>(THEOREM PROBLEM-111S
(IMPLIES (ALL-REL FN X E)
(ALL-REL FN (RM D X) E))
:HINTS (("Goal" :INDUCT (RM D X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM D X). This suggestion
was produced using the :induction rule RM. If we let (:P D E FN X)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P D E FN X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(:P D E FN (CDR X)))
(:P D E FN X))
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(:P D E FN X))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (ALL-REL FN X E)
(ALL-REL FN (RM D X) E))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (ALL-REL FN X E))
(ALL-REL FN (RM D X) E)).
But simplification reduces this to T, using the :definitions ALL-REL
and RM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (ALL-REL FN (CDR X) E)
(ALL-REL FN (RM D (CDR X)) E)))
(IMPLIES (ALL-REL FN X E)
(ALL-REL FN (RM D X) E))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL D (CAR X)))
(IMPLIES (ALL-REL FN (CDR X) E)
(ALL-REL FN (RM D (CDR X)) E))
(ALL-REL FN X E))
(ALL-REL FN (RM D X) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, REL and RM, the :executable-counterpart of EQUAL, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE
and LEXORDER-TRANSITIVE and the :type-prescription rules ALL-REL and
LEXORDER.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL D (CAR X)))
(IMPLIES (ALL-REL FN X E)
(ALL-REL FN (RM D X) E))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL D (CAR X))
(ALL-REL FN X E))
(ALL-REL FN (RM D X) E)).
This simplifies, using the :definition RM and primitive type reasoning,
to
Subgoal *1/1''
(IMPLIES (AND (CONSP X) (ALL-REL FN X E))
(ALL-REL FN (CDR X) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111S depends upon the :type-prescription rule
ALL-REL.
Summary
Form: ( DEFTHM PROBLEM-111S ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION NOT)
(:DEFINITION REL)
(:DEFINITION RM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-111S
ACL2 >>(THEOREM PROBLEM-111T
(IMPLIES (AND (ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E))
:HINTS
(("Goal" :INDUCT (ALL-REL FN X E))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-111T ...): The :REWRITE rule
generated from PROBLEM-111T contains the free variable D. This variable
will be chosen by searching for an instance of (ALL-REL FN (RM D X) E)
among the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ALL-REL FN X E).
This suggestion was produced using the :induction rule ALL-REL. If
we let (:P D E FN X) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (REL FN (CAR X) E)))
(:P D E FN X))
(IMPLIES (AND (NOT (ENDP X))
(REL FN (CAR X) E)
(:P D E FN (CDR X)))
(:P D E FN X))
(IMPLIES (ENDP X) (:P D E FN X))).
This induction is justified by the same argument used to admit ALL-
REL, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (REL FN (CAR X) E)))
(IMPLIES (AND (ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (REL FN (CAR X) E))
(ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E)).
This simplifies, using the :definitions <<=, ALL-REL and REL, the :executable-
counterpart of EQUAL, primitive type reasoning and the :rewrite rule
LEXORDER-REFLEXIVE, to the following eight conjectures.
Subgoal *1/3.8
(IMPLIES (AND (CONSP X)
(LEXORDER (CAR X) E)
(EQUAL (CAR X) E)
(ALL-REL '<< (RM D X) E)
(EQUAL FN '<<)
(LEXORDER D E))
(EQUAL D E)).
This simplifies, using the :rewrite rule LEXORDER-REFLEXIVE, to
Subgoal *1/3.8'
(IMPLIES (AND (CONSP X)
(ALL-REL '<< (RM D X) (CAR X))
(LEXORDER D (CAR X)))
(EQUAL D (CAR X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.8''
(IMPLIES (AND (CONSP (CONS X1 X2))
(ALL-REL '<< (RM D (CONS X1 X2)) X1)
(LEXORDER D X1))
(EQUAL D X1)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, REL and RM, the :executable-counterpart of EQUAL, primitive type
reasoning and the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.7
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR X) E)
(EQUAL (CAR X) E)
(ALL-REL FN (RM D X) E)
(NOT (EQUAL FN '<<))
(LEXORDER E D))
(EQUAL D E)).
This simplifies, using the :rewrite rule LEXORDER-REFLEXIVE, to
Subgoal *1/3.7'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(ALL-REL FN (RM D X) (CAR X))
(NOT (EQUAL FN '<<))
(LEXORDER (CAR X) D))
(EQUAL D (CAR X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.7''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(ALL-REL FN (RM D (CONS X1 X2)) X1)
(NOT (EQUAL FN '<<))
(LEXORDER X1 D))
(EQUAL D X1)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, REL and RM, primitive type reasoning and the :rewrite rules CAR-
CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.6
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR X) E))
(ALL-REL '<<= (RM D X) E))
(NOT (LEXORDER D E))).
This simplifies, using trivial observations, to
Subgoal *1/3.6'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER (CAR X) E))
(ALL-REL '<<= (RM D X) E))
(NOT (LEXORDER D E))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.6''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (LEXORDER X1 E))
(ALL-REL '<<= (RM D (CONS X1 X2)) E))
(NOT (LEXORDER D E))).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/3.6.2
(IMPLIES (AND (NOT (LEXORDER X1 E))
(EQUAL D X1)
(ALL-REL '<<= X2 E))
(NOT (LEXORDER D E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.6.1
(IMPLIES (AND (NOT (LEXORDER X1 E))
(NOT (EQUAL D X1))
(ALL-REL '<<= (CONS X1 (RM D X2)) E))
(NOT (LEXORDER D E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.5
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(ALL-REL '>>= (RM D X) E)
(EQUAL FN '>>=))
(NOT (LEXORDER E D))).
This simplifies, using trivial observations, to
Subgoal *1/3.5'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(ALL-REL '>>= (RM D X) E))
(NOT (LEXORDER E D))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.5''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (LEXORDER E X1))
(ALL-REL '>>= (RM D (CONS X1 X2)) E))
(NOT (LEXORDER E D))).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/3.5.2
(IMPLIES (AND (NOT (LEXORDER E X1))
(EQUAL D X1)
(ALL-REL '>>= X2 E))
(NOT (LEXORDER E D))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.5.1
(IMPLIES (AND (NOT (LEXORDER E X1))
(NOT (EQUAL D X1))
(ALL-REL '>>= (CONS X1 (RM D X2)) E))
(NOT (LEXORDER E D))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.4
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR X)))
(ALL-REL FN (RM D X) E)
(LEXORDER E D))
(EQUAL D E)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.4'
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E X1))
(ALL-REL FN (RM D (CONS X1 X2)) E)
(LEXORDER E D))
(EQUAL D E)).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/3.4.2
(IMPLIES (AND (NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E X1))
(EQUAL D X1)
(ALL-REL FN X2 E)
(LEXORDER E D))
(EQUAL D E)).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.4.1
(IMPLIES (AND (NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E X1))
(NOT (EQUAL D X1))
(ALL-REL FN (CONS X1 (RM D X2)) E)
(LEXORDER E D))
(EQUAL D E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning and the :rewrite rule CAR-CONS.
Subgoal *1/3.3
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR X) E)
(ALL-REL FN (RM D X) E)
(LEXORDER E D))
(EQUAL D E)).
This simplifies, using trivial observations, to
Subgoal *1/3.3'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(ALL-REL FN (RM D X) (CAR X))
(LEXORDER (CAR X) D))
(EQUAL D (CAR X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.3''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(ALL-REL FN (RM D (CONS X1 X2)) X1)
(LEXORDER X1 D))
(EQUAL D X1)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, REL and RM, primitive type reasoning and the :rewrite rules CAR-
CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR X)))
(ALL-REL '>>= (RM D X) E))
(NOT (LEXORDER E D))).
This simplifies, using trivial observations, to
Subgoal *1/3.2'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER E (CAR X)))
(ALL-REL '>>= (RM D X) E))
(NOT (LEXORDER E D))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.2''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (LEXORDER E X1))
(ALL-REL '>>= (RM D (CONS X1 X2)) E))
(NOT (LEXORDER E D))).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/3.2.2
(IMPLIES (AND (NOT (LEXORDER E X1))
(EQUAL D X1)
(ALL-REL '>>= X2 E))
(NOT (LEXORDER E D))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.2.1
(IMPLIES (AND (NOT (LEXORDER E X1))
(NOT (EQUAL D X1))
(ALL-REL '>>= (CONS X1 (RM D X2)) E))
(NOT (LEXORDER E D))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR X) E))
(ALL-REL '<< (RM D X) E)
(LEXORDER D E))
(EQUAL D E)).
This simplifies, using trivial observations, to
Subgoal *1/3.1'
(IMPLIES (AND (CONSP X)
(NOT (LEXORDER (CAR X) E))
(ALL-REL '<< (RM D X) E)
(LEXORDER D E))
(EQUAL D E)).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal *1/3.1''
(IMPLIES (AND (CONSP (CONS X1 X2))
(NOT (LEXORDER X1 E))
(ALL-REL '<< (RM D (CONS X1 X2)) E)
(LEXORDER D E))
(EQUAL D E)).
This simplifies, using the :definition RM, primitive type reasoning
and the :rewrite rules CAR-CONS and CDR-CONS, to the following two
conjectures.
Subgoal *1/3.1.2
(IMPLIES (AND (NOT (LEXORDER X1 E))
(EQUAL D X1)
(ALL-REL '<< X2 E)
(LEXORDER D E))
(EQUAL D E)).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.1.1
(IMPLIES (AND (NOT (LEXORDER X1 E))
(NOT (EQUAL D X1))
(ALL-REL '<< (CONS X1 (RM D X2)) E)
(LEXORDER D E))
(EQUAL D E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(REL FN (CAR X) E)
(IMPLIES (AND (ALL-REL FN (RM D (CDR X)) E)
(REL FN D E))
(ALL-REL FN (CDR X) E)))
(IMPLIES (AND (ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(REL FN (CAR X) E)
(IMPLIES (AND (ALL-REL FN (RM D (CDR X)) E)
(REL FN D E))
(ALL-REL FN (CDR X) E))
(ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E)).
This simplifies, using the :definitions <<=, ALL-REL, REL and RM, the
:executable-counterpart of EQUAL, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE
and the :type-prescription rules ALL-REL and LEXORDER, to the following
five conjectures.
Subgoal *1/2.5
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<=)
(LEXORDER (CAR X) E)
(NOT (ALL-REL '<<= (RM D (CDR X)) E))
(NOT (EQUAL D (CAR X)))
(ALL-REL '<<=
(CONS (CAR X) (RM D (CDR X)))
E)
(LEXORDER D E))
(ALL-REL '<<= X E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.4
(IMPLIES (AND (CONSP X)
(EQUAL FN '>>=)
(LEXORDER E (CAR X))
(NOT (ALL-REL '>>= (RM D (CDR X)) E))
(NOT (EQUAL D (CAR X)))
(ALL-REL '>>=
(CONS (CAR X) (RM D (CDR X)))
E)
(LEXORDER E D))
(ALL-REL '>>= X E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.3
(IMPLIES (AND (CONSP X)
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (ALL-REL '>>= (RM D (CDR X)) E))
(NOT (EQUAL D (CAR X)))
(ALL-REL '>>=
(CONS (CAR X) (RM D (CDR X)))
E)
(EQUAL FN '>>=)
(LEXORDER E D))
(ALL-REL '>>= X E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR X))
(NOT (EQUAL (CAR X) E))
(NOT (ALL-REL FN (RM D (CDR X)) E))
(NOT (EQUAL D (CAR X)))
(ALL-REL FN (CONS (CAR X) (RM D (CDR X)))
E)
(LEXORDER E D)
(NOT (EQUAL D E)))
(ALL-REL FN (CDR X) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(EQUAL FN '<<)
(LEXORDER (CAR X) E)
(NOT (EQUAL (CAR X) E))
(NOT (ALL-REL '<< (RM D (CDR X)) E))
(NOT (EQUAL D (CAR X)))
(ALL-REL '<<
(CONS (CAR X) (RM D (CDR X)))
E)
(LEXORDER D E)
(NOT (EQUAL D E)))
(ALL-REL '<< X E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP X)
(IMPLIES (AND (ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP X))
(ALL-REL FN (RM D X) E)
(REL FN D E))
(ALL-REL FN X E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, REL and RM and the :executable-counterpart of EQUAL.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111T depends upon the :type-prescription rule
ALL-REL.
Summary
Form: ( DEFTHM PROBLEM-111T ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION ENDP)
(:DEFINITION NOT)
(:DEFINITION REL)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ALL-REL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: Free
Time: 0.62 seconds (prove: 0.26, print: 0.34, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111T
ACL2 >>(THEOREM PROBLEM-111U
(IMPLIES (AND (ALL-REL FN B E) (MEM D B))
(REL FN D E))
:HINTS (("Goal" :INDUCT (MEM D B))))
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-111U ...): The :REWRITE
rule generated from PROBLEM-111U will be triggered only by terms containing
the non-recursive function symbol REL. Unless this function is disabled,
PROBLEM-111U is unlikely ever to be used.
ACL2 Warning [Free] in ( DEFTHM PROBLEM-111U ...): The :REWRITE rule
generated from PROBLEM-111U contains the free variable B. This variable
will be chosen by searching for an instance of (ALL-REL FN B E) among
the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM D B). This
suggestion was produced using the :induction rule MEM. If we let
(:P B D E FN) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP B)) (:P B D E FN))
(IMPLIES (AND (CONSP B)
(NOT (EQUAL D (CAR B)))
(:P (CDR B) D E FN))
(:P B D E FN))
(IMPLIES (AND (CONSP B) (EQUAL D (CAR B)))
(:P B D E FN))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT B) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP B))
(IMPLIES (AND (ALL-REL FN B E) (MEM D B))
(REL FN D E))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP B))
(ALL-REL FN B E)
(MEM D B))
(REL FN D E)).
But simplification reduces this to T, using the :definitions ALL-REL
and MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP B)
(NOT (EQUAL D (CAR B)))
(IMPLIES (AND (ALL-REL FN (CDR B) E)
(MEM D (CDR B)))
(REL FN D E)))
(IMPLIES (AND (ALL-REL FN B E) (MEM D B))
(REL FN D E))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP B)
(NOT (EQUAL D (CAR B)))
(IMPLIES (AND (ALL-REL FN (CDR B) E)
(MEM D (CDR B)))
(REL FN D E))
(ALL-REL FN B E)
(MEM D B))
(REL FN D E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, MEM and REL, the :executable-counterpart of EQUAL, primitive type
reasoning, the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE
and the :type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (AND (CONSP B) (EQUAL D (CAR B)))
(IMPLIES (AND (ALL-REL FN B E) (MEM D B))
(REL FN D E))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP B)
(EQUAL D (CAR B))
(ALL-REL FN B E)
(MEM D B))
(REL FN D E)).
This simplifies, using the :definitions <<=, MEM and REL, the :executable-
counterpart of EQUAL and primitive type reasoning, to the following
six conjectures.
Subgoal *1/1.6
(IMPLIES (AND (CONSP B)
(ALL-REL FN B E)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR B) E))
(NOT (EQUAL (CAR B) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning, the :rewrite rule LEXORDER-TRANSITIVE
and the :type-prescription rule LEXORDER.
Subgoal *1/1.5
(IMPLIES (AND (CONSP B)
(ALL-REL '<<= B E)
(EQUAL FN '<<=))
(LEXORDER (CAR B) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL and the :executable-counterpart of EQUAL.
Subgoal *1/1.4
(IMPLIES (AND (CONSP B)
(ALL-REL FN B E)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<)))
(LEXORDER E (CAR B))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL.
Subgoal *1/1.3
(IMPLIES (AND (CONSP B)
(ALL-REL FN B E)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<)))
(NOT (EQUAL (CAR B) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning and the :rewrite rule LEXORDER-
REFLEXIVE.
Subgoal *1/1.2
(IMPLIES (AND (CONSP B)
(ALL-REL '>>= B E)
(EQUAL FN '>>=))
(LEXORDER E (CAR B))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL and the :executable-counterpart of EQUAL.
Subgoal *1/1.1
(IMPLIES (AND (CONSP B)
(ALL-REL '<< B E)
(EQUAL FN '<<))
(LEXORDER (CAR B) E)).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL and the :executable-counterpart of EQUAL.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111U depends upon the :type-prescription rule
REL.
Summary
Form: ( DEFTHM PROBLEM-111U ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION REL)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER)
(:TYPE-PRESCRIPTION REL))
Warnings: Free and Non-rec
Time: 0.17 seconds (prove: 0.04, print: 0.11, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111U
ACL2 >>(THEOREM PROBLEM-111V
(IMPLIES (AND (REL FN D E) (MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E)))
:HINTS
(("Goal" :INDUCT (ALL-REL FN B E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ALL-REL FN B E).
This suggestion was produced using the :induction rule ALL-REL. If
we let (:P B D E FN) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP B))
(NOT (REL FN (CAR B) E)))
(:P B D E FN))
(IMPLIES (AND (NOT (ENDP B))
(REL FN (CAR B) E)
(:P (CDR B) D E FN))
(:P B D E FN))
(IMPLIES (ENDP B) (:P B D E FN))).
This induction is justified by the same argument used to admit ALL-
REL, namely, the measure (ACL2-COUNT B) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP B))
(NOT (REL FN (CAR B) E)))
(IMPLIES (AND (REL FN D E) (MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP B)
(NOT (REL FN (CAR B) E))
(REL FN D E)
(MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E))).
This simplifies, using the :definitions <<=, ALL-REL and REL, the :executable-
counterpart of EQUAL, primitive type reasoning and the :rewrite rule
LEXORDER-REFLEXIVE, to the following eight conjectures.
Subgoal *1/3.8
(IMPLIES (AND (CONSP B)
(LEXORDER (CAR B) E)
(EQUAL (CAR B) E)
(EQUAL FN '<<)
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL '<< (RM D B) E))).
This simplifies, using the :rewrite rule LEXORDER-REFLEXIVE, to
Subgoal *1/3.8'
(IMPLIES (AND (CONSP B)
(LEXORDER D (CAR B))
(NOT (EQUAL D (CAR B)))
(MEM D B))
(NOT (ALL-REL '<< (RM D B) (CAR B)))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.8''
(IMPLIES (AND (CONSP (CONS B1 B2))
(LEXORDER D B1)
(NOT (EQUAL D B1))
(MEM D (CONS B1 B2)))
(NOT (ALL-REL '<< (RM D (CONS B1 B2)) B1))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, MEM, REL and RM, the :executable-counterpart of EQUAL, primitive
type reasoning and the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-
REFLEXIVE.
Subgoal *1/3.7
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(LEXORDER (CAR B) E)
(EQUAL (CAR B) E)
(NOT (EQUAL FN '<<))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL FN (RM D B) E))).
This simplifies, using the :rewrite rule LEXORDER-REFLEXIVE, to
Subgoal *1/3.7'
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER (CAR B) D)
(NOT (EQUAL D (CAR B)))
(MEM D B))
(NOT (ALL-REL FN (RM D B) (CAR B)))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.7''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER B1 D)
(NOT (EQUAL D B1))
(MEM D (CONS B1 B2)))
(NOT (ALL-REL FN (RM D (CONS B1 B2)) B1))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, MEM, REL and RM, primitive type reasoning and the :rewrite rules
CAR-CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.6
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<=)
(NOT (LEXORDER (CAR B) E))
(LEXORDER D E)
(MEM D B))
(NOT (ALL-REL '<<= (RM D B) E))).
This simplifies, using trivial observations, to
Subgoal *1/3.6'
(IMPLIES (AND (CONSP B)
(NOT (LEXORDER (CAR B) E))
(LEXORDER D E)
(MEM D B))
(NOT (ALL-REL '<<= (RM D B) E))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.6''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (LEXORDER B1 E))
(LEXORDER D E)
(MEM D (CONS B1 B2)))
(NOT (ALL-REL '<<= (RM D (CONS B1 B2)) E))).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
three conjectures.
Subgoal *1/3.6.3
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(EQUAL D B1))
(NOT (ALL-REL '<<= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.6.2
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(MEM D B2)
(EQUAL D B1))
(NOT (ALL-REL '<<= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.6.1
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(MEM D B2)
(NOT (EQUAL D B1)))
(NOT (ALL-REL '<<= (CONS B1 (RM D B2)) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.5
(IMPLIES (AND (CONSP B)
(NOT (LEXORDER E (CAR B)))
(EQUAL FN '>>=)
(LEXORDER E D)
(MEM D B))
(NOT (ALL-REL '>>= (RM D B) E))).
This simplifies, using trivial observations, to
Subgoal *1/3.5'
(IMPLIES (AND (CONSP B)
(NOT (LEXORDER E (CAR B)))
(LEXORDER E D)
(MEM D B))
(NOT (ALL-REL '>>= (RM D B) E))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.5''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D (CONS B1 B2)))
(NOT (ALL-REL '>>= (RM D (CONS B1 B2)) E))).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
three conjectures.
Subgoal *1/3.5.3
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(EQUAL D B1))
(NOT (ALL-REL '>>= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.5.2
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D B2)
(EQUAL D B1))
(NOT (ALL-REL '>>= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.5.1
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D B2)
(NOT (EQUAL D B1)))
(NOT (ALL-REL '>>= (CONS B1 (RM D B2)) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.4
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E (CAR B)))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL FN (RM D B) E))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.4'
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D (CONS B1 B2)))
(NOT (ALL-REL FN (RM D (CONS B1 B2)) E))).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
three conjectures.
Subgoal *1/3.4.3
(IMPLIES (AND (NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(NOT (EQUAL D E))
(EQUAL D B1))
(NOT (ALL-REL FN B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.4.2
(IMPLIES (AND (NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D B2)
(EQUAL D B1))
(NOT (ALL-REL FN B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.4.1
(IMPLIES (AND (NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D B2)
(NOT (EQUAL D B1)))
(NOT (ALL-REL FN (CONS B1 (RM D B2)) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning and the :rewrite rule CAR-CONS.
Subgoal *1/3.3
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(EQUAL (CAR B) E)
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL FN (RM D B) E))).
This simplifies, using trivial observations, to
Subgoal *1/3.3'
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER (CAR B) D)
(NOT (EQUAL D (CAR B)))
(MEM D B))
(NOT (ALL-REL FN (RM D B) (CAR B)))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.3''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '>>=))
(NOT (EQUAL FN '<<))
(LEXORDER B1 D)
(NOT (EQUAL D B1))
(MEM D (CONS B1 B2)))
(NOT (ALL-REL FN (RM D (CONS B1 B2)) B1))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL, MEM, REL and RM, primitive type reasoning and the :rewrite rules
CAR-CONS, CDR-CONS and LEXORDER-REFLEXIVE.
Subgoal *1/3.2
(IMPLIES (AND (CONSP B)
(EQUAL FN '>>=)
(NOT (LEXORDER E (CAR B)))
(LEXORDER E D)
(MEM D B))
(NOT (ALL-REL '>>= (RM D B) E))).
This simplifies, using trivial observations, to
Subgoal *1/3.2'
(IMPLIES (AND (CONSP B)
(NOT (LEXORDER E (CAR B)))
(LEXORDER E D)
(MEM D B))
(NOT (ALL-REL '>>= (RM D B) E))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.2''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D (CONS B1 B2)))
(NOT (ALL-REL '>>= (RM D (CONS B1 B2)) E))).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
three conjectures.
Subgoal *1/3.2.3
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(EQUAL D B1))
(NOT (ALL-REL '>>= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.2.2
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D B2)
(EQUAL D B1))
(NOT (ALL-REL '>>= B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.2.1
(IMPLIES (AND (NOT (LEXORDER E B1))
(LEXORDER E D)
(MEM D B2)
(NOT (EQUAL D B1)))
(NOT (ALL-REL '>>= (CONS B1 (RM D B2)) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/3.1
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<)
(NOT (LEXORDER (CAR B) E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL '<< (RM D B) E))).
This simplifies, using trivial observations, to
Subgoal *1/3.1'
(IMPLIES (AND (CONSP B)
(NOT (LEXORDER (CAR B) E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D B))
(NOT (ALL-REL '<< (RM D B) E))).
The destructor terms (CAR B) and (CDR B) can be eliminated by using
CAR-CDR-ELIM to replace B by (CONS B1 B2), (CAR B) by B1 and (CDR B)
by B2. This produces the following goal.
Subgoal *1/3.1''
(IMPLIES (AND (CONSP (CONS B1 B2))
(NOT (LEXORDER B1 E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D (CONS B1 B2)))
(NOT (ALL-REL '<< (RM D (CONS B1 B2)) E))).
This simplifies, using the :definitions MEM and RM, primitive type
reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following
three conjectures.
Subgoal *1/3.1.3
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(NOT (EQUAL D E))
(EQUAL D B1))
(NOT (ALL-REL '<< B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.1.2
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D B2)
(EQUAL D B1))
(NOT (ALL-REL '<< B2 E))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/3.1.1
(IMPLIES (AND (NOT (LEXORDER B1 E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D B2)
(NOT (EQUAL D B1)))
(NOT (ALL-REL '<< (CONS B1 (RM D B2)) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning
and the :rewrite rule CAR-CONS.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP B))
(REL FN (CAR B) E)
(IMPLIES (AND (REL FN D E) (MEM D (CDR B)))
(EQUAL (ALL-REL FN (RM D (CDR B)) E)
(ALL-REL FN (CDR B) E))))
(IMPLIES (AND (REL FN D E) (MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP B)
(REL FN (CAR B) E)
(IMPLIES (AND (REL FN D E) (MEM D (CDR B)))
(EQUAL (ALL-REL FN (RM D (CDR B)) E)
(ALL-REL FN (CDR B) E)))
(REL FN D E)
(MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E))).
This simplifies, using the :definitions <<=, ALL-REL, MEM, REL and
RM, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER, to the following 17 conjectures.
Subgoal *1/2.17
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<=)
(LEXORDER (CAR B) E)
(EQUAL (ALL-REL '<<= (RM D (CDR B)) E)
(ALL-REL '<<= (CDR B) E))
(LEXORDER D E)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<<= (CDR B) E)
(ALL-REL '<<= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.16
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<=)
(LEXORDER (CAR B) E)
(EQUAL (ALL-REL '<<= (RM D (CDR B)) E)
(ALL-REL '<<= (CDR B) E))
(LEXORDER D E)
(MEM D (CDR B))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<<= (CDR B) E)
(ALL-REL '<<= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.15
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<=)
(LEXORDER (CAR B) E)
(EQUAL (ALL-REL '<<= (RM D (CDR B)) E)
(ALL-REL '<<= (CDR B) E))
(LEXORDER D E)
(MEM D (CDR B))
(NOT (EQUAL D (CAR B))))
(EQUAL (ALL-REL '<<=
(CONS (CAR B) (RM D (CDR B)))
E)
(ALL-REL '<<= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.14
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<=)
(LEXORDER (CAR B) E)
(NOT (MEM D (CDR B)))
(LEXORDER D E)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<<= (CDR B) E)
(ALL-REL '<<= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.13
(IMPLIES (AND (CONSP B)
(EQUAL FN '>>=)
(LEXORDER E (CAR B))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(LEXORDER E D)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.12
(IMPLIES (AND (CONSP B)
(EQUAL FN '>>=)
(LEXORDER E (CAR B))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(LEXORDER E D)
(MEM D (CDR B))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.11
(IMPLIES (AND (CONSP B)
(EQUAL FN '>>=)
(LEXORDER E (CAR B))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(LEXORDER E D)
(MEM D (CDR B))
(NOT (EQUAL D (CAR B))))
(EQUAL (ALL-REL '>>=
(CONS (CAR B) (RM D (CDR B)))
E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.10
(IMPLIES (AND (CONSP B)
(EQUAL FN '>>=)
(LEXORDER E (CAR B))
(NOT (MEM D (CDR B)))
(LEXORDER E D)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.9
(IMPLIES (AND (CONSP B)
(LEXORDER E (CAR B))
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(EQUAL FN '>>=)
(LEXORDER E D)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.8
(IMPLIES (AND (CONSP B)
(LEXORDER E (CAR B))
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(EQUAL FN '>>=)
(LEXORDER E D)
(MEM D (CDR B))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.7
(IMPLIES (AND (CONSP B)
(LEXORDER E (CAR B))
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '>>= (RM D (CDR B)) E)
(ALL-REL '>>= (CDR B) E))
(EQUAL FN '>>=)
(LEXORDER E D)
(MEM D (CDR B))
(NOT (EQUAL D (CAR B))))
(EQUAL (ALL-REL '>>=
(CONS (CAR B) (RM D (CDR B)))
E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/2.6
(IMPLIES (AND (CONSP B)
(NOT (EQUAL FN '<<=))
(NOT (EQUAL FN '<<))
(LEXORDER E (CAR B))
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL FN (RM D (CDR B)) E)
(ALL-REL FN (CDR B) E))
(LEXORDER E D)
(NOT (EQUAL D E))
(MEM D (CDR B))
(NOT (EQUAL D (CAR B))))
(EQUAL (ALL-REL FN (CONS (CAR B) (RM D (CDR B)))
E)
(ALL-REL FN (CDR B) E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-
prescription rule LEXORDER.
Subgoal *1/2.5
(IMPLIES (AND (CONSP B)
(LEXORDER E (CAR B))
(NOT (EQUAL (CAR B) E))
(NOT (MEM D (CDR B)))
(EQUAL FN '>>=)
(LEXORDER E D)
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '>>= (CDR B) E)
(ALL-REL '>>= B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.4
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<)
(LEXORDER (CAR B) E)
(NOT (EQUAL (CAR B) E))
(NOT (MEM D (CDR B)))
(LEXORDER D E)
(NOT (EQUAL D E))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<< (CDR B) E)
(ALL-REL '<< B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.3
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<)
(LEXORDER (CAR B) E)
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '<< (RM D (CDR B)) E)
(ALL-REL '<< (CDR B) E))
(LEXORDER D E)
(NOT (EQUAL D E))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<< (CDR B) E)
(ALL-REL '<< B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.2
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<)
(LEXORDER (CAR B) E)
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '<< (RM D (CDR B)) E)
(ALL-REL '<< (CDR B) E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D (CDR B))
(EQUAL D (CAR B)))
(EQUAL (ALL-REL '<< (CDR B) E)
(ALL-REL '<< B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the
:type-prescription rule LEXORDER.
Subgoal *1/2.1
(IMPLIES (AND (CONSP B)
(EQUAL FN '<<)
(LEXORDER (CAR B) E)
(NOT (EQUAL (CAR B) E))
(EQUAL (ALL-REL '<< (RM D (CDR B)) E)
(ALL-REL '<< (CDR B) E))
(LEXORDER D E)
(NOT (EQUAL D E))
(MEM D (CDR B))
(NOT (EQUAL D (CAR B))))
(EQUAL (ALL-REL '<<
(CONS (CAR B) (RM D (CDR B)))
E)
(ALL-REL '<< B E))).
But simplification reduces this to T, using the :definitions <<=, ALL-
REL and REL, the :executable-counterpart of EQUAL, primitive type reasoning,
the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-
TRANSITIVE and the :type-prescription rule LEXORDER.
Subgoal *1/1
(IMPLIES (ENDP B)
(IMPLIES (AND (REL FN D E) (MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP B))
(REL FN D E)
(MEM D B))
(EQUAL (ALL-REL FN (RM D B) E)
(ALL-REL FN B E))).
But simplification reduces this to T, using the :definitions <<=, MEM
and REL and the :executable-counterpart of EQUAL.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111V ...)
Rules: ((:DEFINITION <<=)
(:DEFINITION ALL-REL)
(:DEFINITION ENDP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION REL)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ALL-REL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE LEXORDER-REFLEXIVE)
(:REWRITE LEXORDER-TRANSITIVE)
(:TYPE-PRESCRIPTION LEXORDER))
Warnings: None
Time: 0.87 seconds (prove: 0.38, print: 0.48, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
PROBLEM-111V
ACL2 >>(THEOREM PROBLEM-111W
(IMPLIES (PERM A B)
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E)))
:HINTS
(("Goal" :INDUCT (PERM A B)
:IN-THEORY
(E/D (PROBLEM-55B PROBLEM-111U PROBLEM-111V)
(REL))))
:RULE-CLASSES :CONGRUENCE)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM A B). This
suggestion was produced using the :induction rule PERM. If we let
(:P A B E FN) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E FN))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(:P A B E FN))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) (RM (CAR A) B) E FN))
(:P A B E FN))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable B is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (PERM A B)
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A)) (PERM A B))
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E))).
But simplification reduces this to T, using the :definitions ALL-REL
and PERM and the :executable-counterpart of EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(IMPLIES (PERM A B)
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(PERM A B))
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E))).
But simplification reduces this to T, using the :definition MEM, primitive
type reasoning and the :rewrite rule PROBLEM-55B.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(EQUAL (ALL-REL FN (CDR A) E)
(ALL-REL FN (RM (CAR A) B) E))))
(IMPLIES (PERM A B)
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (PERM (CDR A) (RM (CAR A) B))
(EQUAL (ALL-REL FN (CDR A) E)
(ALL-REL FN (RM (CAR A) B) E)))
(PERM A B))
(EQUAL (ALL-REL FN A E)
(ALL-REL FN B E))).
This simplifies, using the :definitions ALL-REL, MEM and PERM, primitive
type reasoning and the :rewrite rule PROBLEM-55B, to the following
two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP A)
(EQUAL (ALL-REL FN (CDR A) E)
(ALL-REL FN (RM (CAR A) B) E))
(MEM (CAR A) B)
(PERM (CDR A) (RM (CAR A) B))
(REL FN (CAR A) E))
(EQUAL (ALL-REL FN (CDR A) E)
(ALL-REL FN B E))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
111V and the :type-prescription rules MEM and REL.
Subgoal *1/1.1
(IMPLIES (AND (CONSP A)
(EQUAL (ALL-REL FN (CDR A) E)
(ALL-REL FN (RM (CAR A) B) E))
(MEM (CAR A) B)
(PERM (CDR A) (RM (CAR A) B))
(NOT (REL FN (CAR A) E)))
(EQUAL NIL (ALL-REL FN B E))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
111U and the :type-prescription rules ALL-REL and MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-111W ...)
Rules: ((:DEFINITION ALL-REL)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PERM)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-111U)
(:REWRITE PROBLEM-111V)
(:REWRITE PROBLEM-55B)
(:TYPE-PRESCRIPTION ALL-REL)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION REL))
Warnings: None
Time: 0.10 seconds (prove: 0.04, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-111W
ACL2 >>(THEOREM PROBLEM-111-B (ORDERED (QSORT X))
:HINTS
(("Goal" :INDUCT (QSORT X)
:IN-THEORY
(ENABLE PROBLEM-111P PROBLEM-111Q PROBLEM-111R
PROBLEM-111W PROBLEM-111-A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (QSORT X). This
suggestion was produced using the :induction rule QSORT. If we let
(:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(:P (FILTER '<< (CDR X) (CAR X)))
(:P (FILTER '>>= (CDR X) (CAR X))))
(:P X))
(IMPLIES (AND (NOT (ENDP X)) (ENDP (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit QSORT,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (ENDP (CDR X)))
(ORDERED (QSORT (FILTER '<< (CDR X) (CAR X))))
(ORDERED (QSORT (FILTER '>>= (CDR X) (CAR X)))))
(ORDERED (QSORT X))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(ORDERED (QSORT (FILTER '<< (CDR X) (CAR X))))
(ORDERED (QSORT (FILTER '>>= (CDR X) (CAR X)))))
(ORDERED (QSORT X))).
This simplifies, using the :definition QSORT, the :rewrite rule PROBLEM-
111P and the :type-prescription rule ORDERED, to the following two
conjectures.
Subgoal *1/3.2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(ORDERED (QSORT (FILTER '<< (CDR X) (CAR X))))
(ORDERED (QSORT (FILTER '>>= (CDR X) (CAR X)))))
(ALL-REL '<<=
(QSORT (FILTER '<< (CDR X) (CAR X)))
(CAR X))).
But we reduce the conjecture to T, by the :congruence rule PROBLEM-
111W and the simple :rewrite rules PROBLEM-111-A and PROBLEM-111Q.
Subgoal *1/3.1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(ORDERED (QSORT (FILTER '<< (CDR X) (CAR X))))
(ORDERED (QSORT (FILTER '>>= (CDR X) (CAR X)))))
(ALL-REL '>>=
(QSORT (FILTER '>>= (CDR X) (CAR X)))
(CAR X))).
But we reduce the conjecture to T, by the :congruence rule PROBLEM-
111W and the simple :rewrite rules PROBLEM-111-A and PROBLEM-111R.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X)) (ENDP (CDR X)))
(ORDERED (QSORT X))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(ORDERED (QSORT X))).
But simplification reduces this to T, using the :definitions ORDERED
and QSORT.
Subgoal *1/1
(IMPLIES (ENDP X) (ORDERED (QSORT X))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (NOT (CONSP X))
(ORDERED (QSORT X))).
But simplification reduces this to T, using the :definition QSORT and
the :executable-counterpart of ORDERED.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-111-B depends upon the :type-prescription rule
ORDERED.
Summary
Form: ( DEFTHM PROBLEM-111-B ...)
Rules: ((:CONGRUENCE PROBLEM-111W)
(:DEFINITION ENDP)
(:DEFINITION NOT)
(:DEFINITION ORDERED)
(:DEFINITION QSORT)
(:EXECUTABLE-COUNTERPART ORDERED)
(:INDUCTION QSORT)
(:REWRITE PROBLEM-111-A)
(:REWRITE PROBLEM-111P)
(:REWRITE PROBLEM-111Q)
(:REWRITE PROBLEM-111R)
(:TYPE-PRESCRIPTION ORDERED))
Warnings: None
Time: 0.11 seconds (prove: 0.01, print: 0.08, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
PROBLEM-111-B
ACL2 >>(DEFUN NO-DUPS (X)
(IF (ENDP X)
T
(IF (MEM (CAR X) (CDR X))
NIL (NO-DUPS (CDR X)))))
The admission of NO-DUPS is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of NO-DUPS is described by
the theorem (OR (EQUAL (NO-DUPS X) T) (EQUAL (NO-DUPS X) NIL)).
Summary
Form: ( DEFUN NO-DUPS ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
NO-DUPS
ACL2 >>(DEFUN LIST-OF-NATSP (LST)
(COND ((ENDP LST) T)
(T (AND (NATP (CAR LST))
(LIST-OF-NATSP (CDR LST))))))
The admission of LIST-OF-NATSP is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT LST). We observe that the type of LIST-OF-NATSP
is described by the theorem
(OR (EQUAL (LIST-OF-NATSP LST) T) (EQUAL (LIST-OF-NATSP LST) NIL)).
Summary
Form: ( DEFUN LIST-OF-NATSP ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
LIST-OF-NATSP
ACL2 >>(DEFUN MAXIMAL (LST)
(COND ((ENDP LST) -1)
(T (MAX (CAR LST) (MAXIMAL (CDR LST))))))
The admission of MAXIMAL is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT LST). We could deduce no constraints on the type of MAXIMAL.
Summary
Form: ( DEFUN MAXIMAL ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
MAXIMAL
ACL2 >>(THEOREM PROBLEM-112A
(IMPLIES (LIST-OF-NATSP LST)
(IFF (MEM (MAXIMAL LST) LST)
(CONSP LST)))
:HINTS
(("Goal" :INDUCT (MEM (MAXIMAL LST) LST))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (MEM (MAXIMAL LST) LST).
This suggestion was produced using the :induction rules MAXIMAL and
MEM. If we let (:P LST) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP LST)) (:P LST))
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(:P (CDR LST)))
(:P LST))
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST)))
(:P LST))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT LST) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP LST))
(IMPLIES (LIST-OF-NATSP LST)
(IFF (MEM (MAXIMAL LST) LST)
(CONSP LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP LST))
(LIST-OF-NATSP LST))
(COND ((MEM (MAXIMAL LST) LST) (CONSP LST))
((CONSP LST) NIL)
(T T))).
But simplification reduces this to T, using the :definitions LIST-OF-
NATSP, MAXIMAL and MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(IFF (MEM (MAXIMAL (CDR LST)) (CDR LST))
(CONSP (CDR LST)))))
(IMPLIES (LIST-OF-NATSP LST)
(IFF (MEM (MAXIMAL LST) LST)
(CONSP LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(COND ((MEM (MAXIMAL (CDR LST)) (CDR LST))
(CONSP (CDR LST)))
((CONSP (CDR LST)) NIL)
(T T)))
(LIST-OF-NATSP LST))
(COND ((MEM (MAXIMAL LST) LST) (CONSP LST))
((CONSP LST) NIL)
(T T))).
This simplifies, using the :compound-recognizer rule NATP-CR, the :definitions
LIST-OF-NATSP, MAX, MAXIMAL and MEM and the :type-prescription rules
MEM and NATP, to
Subgoal *1/2''
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(NOT (MEM (MAXIMAL (CDR LST)) (CDR LST)))
(NOT (CONSP (CDR LST))))
(NOT (NATP (CAR LST)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition MAXIMAL, primitive type reasoning and
the :forward-chaining rules NATP-FC-1 and NATP-FC-2.
Subgoal *1/1
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (LIST-OF-NATSP LST)
(IFF (MEM (MAXIMAL LST) LST)
(CONSP LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST))
(LIST-OF-NATSP LST))
(COND ((MEM (MAXIMAL LST) LST) (CONSP LST))
((CONSP LST) NIL)
(T T))).
But simplification reduces this to T, using the :definitions MAX, MAXIMAL
and MEM and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-112A depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-112A ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION IFF)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MAX)
(:DEFINITION MAXIMAL)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION MAXIMAL)
(:INDUCTION MEM)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION NATP))
Warnings: None
Time: 0.08 seconds (prove: 0.03, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-112A
ACL2 >>(THEOREM PROBLEM-112B
(IMPLIES (LIST-OF-NATSP LST)
(LIST-OF-NATSP (DEL E LST)))
:HINTS (("Goal" :INDUCT (DEL E LST))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (DEL E LST). This
suggestion was produced using the :induction rule DEL. If we let
(:P E LST) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP LST)) (:P E LST))
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(:P E (CDR LST)))
(:P E LST))
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(:P E LST))).
This induction is justified by the same argument used to admit DEL,
namely, the measure (ACL2-COUNT LST) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP LST))
(IMPLIES (LIST-OF-NATSP LST)
(LIST-OF-NATSP (DEL E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP LST))
(LIST-OF-NATSP LST))
(LIST-OF-NATSP (DEL E LST))).
But simplification reduces this to T, using the :definitions DEL and
LIST-OF-NATSP.
Subgoal *1/2
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(LIST-OF-NATSP (DEL E (CDR LST)))))
(IMPLIES (LIST-OF-NATSP LST)
(LIST-OF-NATSP (DEL E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(LIST-OF-NATSP (DEL E (CDR LST))))
(LIST-OF-NATSP LST))
(LIST-OF-NATSP (DEL E LST))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions DEL and LIST-OF-NATSP, primitive type
reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule LIST-OF-NATSP.
Subgoal *1/1
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(IMPLIES (LIST-OF-NATSP LST)
(LIST-OF-NATSP (DEL E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP LST)
(EQUAL E (CAR LST))
(LIST-OF-NATSP LST))
(LIST-OF-NATSP (DEL E LST))).
This simplifies, using the :definition DEL and primitive type reasoning,
to
Subgoal *1/1''
(IMPLIES (AND (CONSP LST) (LIST-OF-NATSP LST))
(LIST-OF-NATSP (CDR LST))).
But simplification reduces this to T, using the :definition LIST-OF-
NATSP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-112B depends upon the :type-prescription rule
LIST-OF-NATSP.
Summary
Form: ( DEFTHM PROBLEM-112B ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION DEL)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION DEL)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:TYPE-PRESCRIPTION LIST-OF-NATSP))
Warnings: None
Time: 0.06 seconds (prove: 0.00, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112B
ACL2 >>(THEOREM PROBLEM-112C
(IMPLIES (NO-DUPS LST)
(NO-DUPS (RM E LST)))
:HINTS
(("Goal" :INDUCT (RM E LST)
:IN-THEORY
(ENABLE PROBLEM-55A PROBLEM-111E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM E LST). This
suggestion was produced using the :induction rule RM. If we let (:P E LST)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP LST)) (:P E LST))
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(:P E (CDR LST)))
(:P E LST))
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(:P E LST))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT LST) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP LST))
(IMPLIES (NO-DUPS LST)
(NO-DUPS (RM E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP LST)) (NO-DUPS LST))
(NO-DUPS (RM E LST))).
But simplification reduces this to T, using the :definitions MEM and
NO-DUPS and the :rewrite rule PROBLEM-111E.
Subgoal *1/2
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(IMPLIES (NO-DUPS (CDR LST))
(NO-DUPS (RM E (CDR LST)))))
(IMPLIES (NO-DUPS LST)
(NO-DUPS (RM E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(IMPLIES (NO-DUPS (CDR LST))
(NO-DUPS (RM E (CDR LST))))
(NO-DUPS LST))
(NO-DUPS (RM E LST))).
This simplifies, using the :definitions NO-DUPS and RM, primitive type
reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule NO-DUPS, to
Subgoal *1/2''
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(NO-DUPS (RM E (CDR LST)))
(NOT (MEM (CAR LST) (CDR LST)))
(NO-DUPS (CDR LST)))
(NOT (MEM (CAR LST) (RM E (CDR LST))))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
55A and the :type-prescription rule MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(IMPLIES (NO-DUPS LST)
(NO-DUPS (RM E LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP LST)
(EQUAL E (CAR LST))
(NO-DUPS LST))
(NO-DUPS (RM E LST))).
This simplifies, using the :definition RM and primitive type reasoning,
to
Subgoal *1/1''
(IMPLIES (AND (CONSP LST) (NO-DUPS LST))
(NO-DUPS (CDR LST))).
But simplification reduces this to T, using the :definition NO-DUPS.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-112C depends upon the :type-prescription rule
NO-DUPS.
Summary
Form: ( DEFTHM PROBLEM-112C ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NO-DUPS)
(:DEFINITION NOT)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-111E)
(:REWRITE PROBLEM-55A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION NO-DUPS))
Warnings: None
Time: 0.13 seconds (prove: 0.07, print: 0.05, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112C
ACL2 >>(THEOREM PROBLEM-112D
(IMPLIES (LIST-OF-NATSP LST)
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST))))
:HINTS
(("Goal" :INDUCT (LIST-OF-NATSP LST)))
:RULE-CLASSES :FORWARD-CHAINING)
ACL2 Observation in ( DEFTHM PROBLEM-112D ...): The :TRIGGER-TERMS
for the :FORWARD-CHAINING rule PROBLEM-112D will consist of the list
containing (LIST-OF-NATSP LST).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LIST-OF-NATSP LST).
This suggestion was produced using the :induction rule LIST-OF-NATSP.
If we let (:P LST) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ENDP LST))
(NOT (NATP (CAR LST))))
(:P LST))
(IMPLIES (AND (NOT (ENDP LST))
(NATP (CAR LST))
(:P (CDR LST)))
(:P LST))
(IMPLIES (ENDP LST) (:P LST))).
This induction is justified by the same argument used to admit LIST-
OF-NATSP, namely, the measure (ACL2-COUNT LST) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP LST))
(NOT (NATP (CAR LST))))
(IMPLIES (LIST-OF-NATSP LST)
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST))))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP LST)
(NOT (NATP (CAR LST)))
(LIST-OF-NATSP LST))
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR and the :definition LIST-OF-NATSP.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP LST))
(NATP (CAR LST))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(AND (INTEGERP (MAXIMAL (CDR LST)))
(<= -1 (MAXIMAL (CDR LST))))))
(IMPLIES (LIST-OF-NATSP LST)
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST))))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP LST)
(NATP (CAR LST))
(IMPLIES (LIST-OF-NATSP (CDR LST))
(AND (INTEGERP (MAXIMAL (CDR LST)))
(<= -1 (MAXIMAL (CDR LST)))))
(LIST-OF-NATSP LST))
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions LIST-OF-NATSP, MAX, MAXIMAL and NOT,
primitive type reasoning and the :forward-chaining rules NATP-FC-1
and NATP-FC-2.
Subgoal *1/1
(IMPLIES (ENDP LST)
(IMPLIES (LIST-OF-NATSP LST)
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST))))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP LST))
(LIST-OF-NATSP LST))
(AND (INTEGERP (MAXIMAL LST))
(<= -1 (MAXIMAL LST)))).
But simplification reduces this to T, using the :definitions LIST-OF-
NATSP and MAXIMAL and the :executable-counterparts of <, INTEGERP and
NOT.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112D ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ENDP)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MAX)
(:DEFINITION MAXIMAL)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION LIST-OF-NATSP))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.04, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112D
ACL2 >>(THEOREM PROBLEM-112E
(IMPLIES (AND (LIST-OF-NATSP LST)
(NO-DUPS LST)
(CONSP LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(MAXIMAL LST)))
:HINTS
(("Goal" :INDUCT (RM (MAXIMAL LST) LST)
:IN-THEORY
(ENABLE PROBLEM-112A PROBLEM-112D)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (RM (MAXIMAL LST) LST).
This suggestion was produced using the :induction rules MAXIMAL and
RM. If we let (:P LST) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP LST)) (:P LST))
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(:P (CDR LST)))
(:P LST))
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST)))
(:P LST))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT LST) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (AND (LIST-OF-NATSP (CDR LST))
(NO-DUPS (CDR LST))
(CONSP (CDR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(MAXIMAL (CDR LST)))))
(IMPLIES (AND (LIST-OF-NATSP LST)
(NO-DUPS LST)
(CONSP LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(MAXIMAL LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (AND (LIST-OF-NATSP (CDR LST))
(NO-DUPS (CDR LST))
(CONSP (CDR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(MAXIMAL (CDR LST))))
(LIST-OF-NATSP LST)
(NO-DUPS LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(MAXIMAL LST))).
This simplifies, using the :compound-recognizer rule NATP-CR, the :definitions
LIST-OF-NATSP, MAX, MAXIMAL, MEM, NO-DUPS and RM, primitive type reasoning,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule NATP, to the following three conjectures.
Subgoal *1/2.3
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(NOT (CONSP (CDR LST)))
(NATP (CAR LST))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(CAR LST)))
(< (CAR LST) (MAXIMAL (CDR LST)))).
But forced simplification reduces this to T, using linear arithmetic.
Subgoal *1/2.2
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(NOT (CONSP (CDR LST)))
(NATP (CAR LST))
(<= (CAR LST)
(MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(MAXIMAL (CDR LST)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition MAXIMAL, primitive type reasoning and
the :forward-chaining rules NATP-FC-1 and NATP-FC-2.
Subgoal *1/2.1
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(MAXIMAL (CDR LST)))
(NATP (CAR LST))
(LIST-OF-NATSP (CDR LST))
(NOT (MEM (CAR LST) (CDR LST)))
(NO-DUPS (CDR LST))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(CAR LST)))
(< (CAR LST) (MAXIMAL (CDR LST)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, linear arithmetic, the :forward-chaining rule PROBLEM-
112D and the :type-prescription rule LIST-OF-NATSP.
Subgoal *1/1
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST)))
(IMPLIES (AND (LIST-OF-NATSP LST)
(NO-DUPS LST)
(CONSP LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(MAXIMAL LST)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL LST) (CAR LST))
(LIST-OF-NATSP LST)
(NO-DUPS LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(MAXIMAL LST))).
This simplifies, using the :definitions MAX, MAXIMAL and RM and primitive
type reasoning, to
Subgoal *1/1''
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL (CDR LST)) (CAR LST))
(LIST-OF-NATSP LST)
(NO-DUPS LST))
(< (CAR LST) (CAR LST))).
This simplifies, using the :definitions LIST-OF-NATSP and NO-DUPS,
to
Subgoal *1/1'''
(IMPLIES (AND (CONSP LST)
(EQUAL (MAXIMAL (CDR LST)) (CAR LST))
(NATP (CAR LST))
(LIST-OF-NATSP (CDR LST))
(NOT (MEM (CAR LST) (CDR LST)))
(NO-DUPS (CDR LST)))
(< (CAR LST) (CAR LST))).
The destructor terms (CAR LST) and (CDR LST) can be eliminated by using
CAR-CDR-ELIM to replace LST by (CONS LST1 LST2), (CAR LST) by LST1
and (CDR LST) by LST2 and restrict the type of the new variable LST1
to be that of the term it replaces, as established by the :compound-
recognizer rule NATP-CR. This produces the following goal.
Subgoal *1/1'4'
(IMPLIES (AND (INTEGERP LST1)
(<= 0 LST1)
(CONSP (CONS LST1 LST2))
(EQUAL (MAXIMAL LST2) LST1)
(NATP LST1)
(LIST-OF-NATSP LST2)
(NOT (MEM LST1 LST2))
(NO-DUPS LST2))
(< LST1 LST1)).
By case analysis we reduce the conjecture to
Subgoal *1/1'5'
(IMPLIES (AND (INTEGERP LST1)
(<= 0 LST1)
(CONSP (CONS LST1 LST2))
(EQUAL (MAXIMAL LST2) LST1)
(NATP LST1)
(LIST-OF-NATSP LST2)
(NOT (MEM LST1 LST2))
(NO-DUPS LST2))
(< LST1 LST1)).
This simplifies, using the :compound-recognizer rule NATP-CR, the :definitions
MAXIMAL and NO-DUPS, the :executable-counterpart of <, primitive type
reasoning, the :forward-chaining rule PROBLEM-112D, the :rewrite rule
PROBLEM-112A and the :type-prescription rule LIST-OF-NATSP, to
Subgoal *1/1'6'
(IMPLIES (AND (<= 0 (MAXIMAL LST2))
(LIST-OF-NATSP LST2))
(CONSP LST2)).
But simplification reduces this to T, using the :definition MAXIMAL
and the :executable-counterpart of <.
That completes the proof of *1.
q.e.d. (given one forced hypothesis)
Modulo the following forced goal, that completes the proof of the input
Goal. See :DOC forcing-round.
[1]Goal, below, will focus on
(ACL2-NUMBERP (MAXIMAL (CDR LST))),
which was forced in
Subgoal *1/2.3, above,
by the linearization of
(EQUAL (MAXIMAL (CDR LST)) (CAR LST)).
We now undertake Forcing Round 1.
[1]Goal
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(NOT (CONSP (CDR LST)))
(AND (INTEGERP (CAR LST))
(<= 0 (CAR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(CAR LST))
(<= (MAXIMAL (CDR LST)) (CAR LST)))
(ACL2-NUMBERP (MAXIMAL (CDR LST)))).
By case analysis we reduce the conjecture to
[1]Goal'
(IMPLIES (AND (CONSP LST)
(<= (CAR LST) (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) (CAR LST)))
(NOT (CONSP (CDR LST)))
(INTEGERP (CAR LST))
(<= 0 (CAR LST))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
(CAR LST))
(<= (MAXIMAL (CDR LST)) (CAR LST)))
(ACL2-NUMBERP (MAXIMAL (CDR LST)))).
This simplifies, using the :executable-counterparts of <, INTEGERP
and NOT and linear arithmetic, to
[1]Goal''
(IMPLIES (AND (EQUAL 0 (CAR LST))
(CONSP LST)
(<= 0 (MAXIMAL (CDR LST)))
(NOT (EQUAL (MAXIMAL (CDR LST)) 0))
(NOT (CONSP (CDR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
0)
(<= (MAXIMAL (CDR LST)) 0))
(ACL2-NUMBERP (MAXIMAL (CDR LST)))).
This simplifies, using the :executable-counterpart of <, primitive
type reasoning and the :rewrite rules DEFAULT-<-1 and DEFAULT-<-2,
to
[1]Goal'''
(IMPLIES (AND (EQUAL 0 (CAR LST))
(CONSP LST)
(NOT (CONSP (CDR LST)))
(< (MAXIMAL (RM (MAXIMAL (CDR LST)) (CDR LST)))
0))
(ACL2-NUMBERP (MAXIMAL (CDR LST)))).
But simplification reduces this to T, using the :definitions MAXIMAL
and RM and the :executable-counterparts of < and ACL2-NUMBERP.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112E ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MAX)
(:DEFINITION MAXIMAL)
(:DEFINITION MEM)
(:DEFINITION NO-DUPS)
(:DEFINITION NOT)
(:DEFINITION RM)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART ACL2-NUMBERP)
(:EXECUTABLE-COUNTERPART INTEGERP)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING PROBLEM-112D)
(:INDUCTION MAXIMAL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-<-1)
(:REWRITE DEFAULT-<-2)
(:REWRITE PROBLEM-112A)
(:TYPE-PRESCRIPTION LIST-OF-NATSP)
(:TYPE-PRESCRIPTION NATP))
Warnings: None
Time: 0.51 seconds (prove: 0.20, print: 0.28, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112E
ACL2 >>(THEOREM PROBLEM-112F
(EQUAL (LEN (RM E LST))
(IF (MEM E LST)
(- (LEN LST) 1)
(LEN LST)))
:HINTS
(("Goal" :INDUCT (RM E LST)
:IN-THEORY (ENABLE PROBLEM-111E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM E LST). This
suggestion was produced using the :induction rule RM. If we let (:P E LST)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP LST)) (:P E LST))
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(:P E (CDR LST)))
(:P E LST))
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(:P E LST))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT LST) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP LST))
(EQUAL (LEN (RM E LST))
(IF (MEM E LST)
(+ -1 (LEN LST))
(LEN LST)))).
But simplification reduces this to T, using the :definitions LEN and
MEM, the :executable-counterpart of EQUAL and the :rewrite rule PROBLEM-
111E.
Subgoal *1/2
(IMPLIES (AND (CONSP LST)
(NOT (EQUAL E (CAR LST)))
(EQUAL (LEN (RM E (CDR LST)))
(IF (MEM E (CDR LST))
(+ -1 (LEN (CDR LST)))
(LEN (CDR LST)))))
(EQUAL (LEN (RM E LST))
(IF (MEM E LST)
(+ -1 (LEN LST))
(LEN LST)))).
But simplification reduces this to T, using the :definitions FIX, LEN,
MEM, RM and SYNP, the :executable-counterpart of BINARY-+, primitive
type reasoning, the :rewrite rules CDR-CONS, FOLD-CONSTS-IN-+, PROBLEM-
111E and UNICITY-OF-0 and the :type-prescription rules LEN and MEM.
Subgoal *1/1
(IMPLIES (AND (CONSP LST) (EQUAL E (CAR LST)))
(EQUAL (LEN (RM E LST))
(IF (MEM E LST)
(+ -1 (LEN LST))
(LEN LST)))).
This simplifies, using the :definitions MEM and RM and primitive type
reasoning, to
Subgoal *1/1'
(IMPLIES (CONSP LST)
(EQUAL (LEN (CDR LST))
(+ -1 (LEN LST)))).
But simplification reduces this to T, using the :definitions FIX, LEN
and SYNP, the :executable-counterpart of BINARY-+, primitive type reasoning,
the :rewrite rules FOLD-CONSTS-IN-+ and UNICITY-OF-0 and the :type-
prescription rule LEN.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112F ...)
Rules: ((:DEFINITION FIX)
(:DEFINITION LEN)
(:DEFINITION MEM)
(:DEFINITION RM)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CDR-CONS)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE PROBLEM-111E)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.08 seconds (prove: 0.01, print: 0.06, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112F
ACL2 >>(DEFUN INDUCTION-HINT (LST N)
(DECLARE (XARGS :MEASURE (ACL2-COUNT N)))
(COND ((ZP N) (LIST LST N))
((ENDP LST) (LIST LST N))
(T (INDUCTION-HINT (RM (MAXIMAL LST) LST)
(- N 1)))))
The admission of INDUCTION-HINT is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT N). We observe that the type of INDUCTION-HINT
is described by the theorem
(AND (CONSP (INDUCTION-HINT LST N)) (TRUE-LISTP (INDUCTION-HINT LST N))).
We used primitive type reasoning.
Summary
Form: ( DEFUN INDUCTION-HINT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
INDUCTION-HINT
ACL2 >>(THEOREM PROBLEM-112G
(IMPLIES (LIST-OF-NATSP X)
(LIST-OF-NATSP (RM E X)))
:HINTS
(("Goal" :INDUCT (RM E X)
:IN-THEORY (ENABLE PROBLEM-111E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RM E X). This suggestion
was produced using the :induction rule RM. If we let (:P E X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(:P E (CDR X)))
(:P E X))
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(:P E X))).
This induction is justified by the same argument used to admit RM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (LIST-OF-NATSP X)
(LIST-OF-NATSP (RM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (LIST-OF-NATSP X))
(LIST-OF-NATSP (RM E X))).
But simplification reduces this to T, using the :definitions LIST-OF-
NATSP and MEM and the :rewrite rule PROBLEM-111E.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (LIST-OF-NATSP (CDR X))
(LIST-OF-NATSP (RM E (CDR X)))))
(IMPLIES (LIST-OF-NATSP X)
(LIST-OF-NATSP (RM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (LIST-OF-NATSP (CDR X))
(LIST-OF-NATSP (RM E (CDR X))))
(LIST-OF-NATSP X))
(LIST-OF-NATSP (RM E X))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions LIST-OF-NATSP and RM, primitive type
reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rule LIST-OF-NATSP.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(IMPLIES (LIST-OF-NATSP X)
(LIST-OF-NATSP (RM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL E (CAR X))
(LIST-OF-NATSP X))
(LIST-OF-NATSP (RM E X))).
This simplifies, using the :definition RM and primitive type reasoning,
to
Subgoal *1/1''
(IMPLIES (AND (CONSP X) (LIST-OF-NATSP X))
(LIST-OF-NATSP (CDR X))).
But simplification reduces this to T, using the :definition LIST-OF-
NATSP.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-112G depends upon the :type-prescription rule
LIST-OF-NATSP.
Summary
Form: ( DEFTHM PROBLEM-112G ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION RM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-111E)
(:TYPE-PRESCRIPTION LIST-OF-NATSP))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112G
ACL2 >>(THEOREM PROBLEM-112H
(IMPLIES (AND (CONSP X) (LIST-OF-NATSP X))
(<= 0 (MAXIMAL X)))
:HINTS
(("Goal" :INDUCT (LIST-OF-NATSP X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LIST-OF-NATSP X).
This suggestion was produced using the :induction rule LIST-OF-NATSP.
If we let (:P X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (AND (NOT (ENDP X))
(NOT (NATP (CAR X))))
(:P X))
(IMPLIES (AND (NOT (ENDP X))
(NATP (CAR X))
(:P (CDR X)))
(:P X))
(IMPLIES (ENDP X) (:P X))).
This induction is justified by the same argument used to admit LIST-
OF-NATSP, namely, the measure (ACL2-COUNT X) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP X))
(NOT (NATP (CAR X))))
(IMPLIES (AND (CONSP X) (LIST-OF-NATSP X))
(<= 0 (MAXIMAL X)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(NOT (NATP (CAR X)))
(LIST-OF-NATSP X))
(<= 0 (MAXIMAL X))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR and the :definition LIST-OF-NATSP.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(NATP (CAR X))
(IMPLIES (AND (CONSP (CDR X))
(LIST-OF-NATSP (CDR X)))
(<= 0 (MAXIMAL (CDR X)))))
(IMPLIES (AND (CONSP X) (LIST-OF-NATSP X))
(<= 0 (MAXIMAL X)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NATP (CAR X))
(IMPLIES (AND (CONSP (CDR X))
(LIST-OF-NATSP (CDR X)))
(<= 0 (MAXIMAL (CDR X))))
(LIST-OF-NATSP X))
(<= 0 (MAXIMAL X))).
This simplifies, using the :compound-recognizer rule NATP-CR, the :definitions
LIST-OF-NATSP, MAX, MAXIMAL and NOT, primitive type reasoning and the
:forward-chaining rules NATP-FC-1 and NATP-FC-2, to
Subgoal *1/2''
(IMPLIES (AND (CONSP X)
(NATP (CAR X))
(<= 0 (MAXIMAL (CDR X)))
(LIST-OF-NATSP (CDR X))
(< (MAXIMAL (CDR X)) (CAR X)))
(<= 0 (CAR X))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR and primitive type reasoning.
Subgoal *1/1
(IMPLIES (ENDP X)
(IMPLIES (AND (CONSP X) (LIST-OF-NATSP X))
(<= 0 (MAXIMAL X)))).
But we reduce the conjecture to T, by case analysis.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112H ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ENDP)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MAX)
(:DEFINITION MAXIMAL)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION LIST-OF-NATSP))
Warnings: None
Time: 0.05 seconds (prove: 0.02, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112H
ACL2 >>(THEOREM PROBLEM-112I
(EQUAL (< 0 (LEN X)) (CONSP X))
:HINTS (("Goal" :INDUCT (LEN X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN X). This suggestion
was produced using the :induction rule LEN. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit LEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (< 0 (LEN X)) (CONSP X))).
But simplification reduces this to T, using the :definition LEN and
the :executable-counterparts of < and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (< 0 (LEN (CDR X)))
(CONSP (CDR X))))
(EQUAL (< 0 (LEN X)) (CONSP X))).
This simplifies, using the :definition LEN, primitive type reasoning
and the :type-prescription rule LEN, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL (< 0 (LEN (CDR X)))
(CONSP (CDR X))))
(< 0 (+ 1 (LEN (CDR X))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule LEN.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112I ...)
Rules: ((:DEFINITION LEN)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN)
(:TYPE-PRESCRIPTION LEN))
Warnings: None
Time: 0.05 seconds (prove: 0.02, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112I
ACL2 >>(THEOREM PROBLEM-112J
(IMPLIES (AND (NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N))
:HINTS
(("Goal" :INDUCT (INDUCTION-HINT LST N)
:IN-THEORY
(ENABLE PROBLEM-112A PROBLEM-112C PROBLEM-112D
PROBLEM-112E PROBLEM-112F PROBLEM-112G
PROBLEM-112H PROBLEM-112I))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (INDUCTION-HINT LST N).
This suggestion was produced using the :induction rule INDUCTION-HINT.
If we let (:P LST N) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (ZP N))
(NOT (ENDP LST))
(:P (RM (MAXIMAL LST) LST) (+ -1 N)))
(:P LST N))
(IMPLIES (AND (NOT (ZP N)) (ENDP LST))
(:P LST N))
(IMPLIES (ZP N) (:P LST N))).
This induction is justified by the same argument used to admit INDUCTION-
HINT, namely, the measure (ACL2-COUNT N) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable LST is being
instantiated. When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ZP N))
(NOT (ENDP LST))
(IMPLIES (AND (NATP (+ -1 N))
(LIST-OF-NATSP (RM (MAXIMAL LST) LST))
(NO-DUPS (RM (MAXIMAL LST) LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(+ -1 N)))
(<= (LEN (RM (MAXIMAL LST) LST))
(+ -1 N))))
(IMPLIES (AND (NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N))).
By the simple :definition ENDP and the simple :rewrite rule NATP-POSP-
-1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (ZP N))
(CONSP LST)
(IMPLIES (AND (POSP N)
(LIST-OF-NATSP (RM (MAXIMAL LST) LST))
(NO-DUPS (RM (MAXIMAL LST) LST))
(< (MAXIMAL (RM (MAXIMAL LST) LST))
(+ -1 N)))
(<= (LEN (RM (MAXIMAL LST) LST))
(+ -1 N)))
(NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N)).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :executable-counterpart of NOT,
the :forward-chaining rules POSP-FC-1 and POSP-FC-2, the :meta rule
CANCEL_PLUS-LESSP-CORRECT, the :rewrite rules PROBLEM-112A, PROBLEM-
112C, PROBLEM-112F and PROBLEM-112G and the :type-prescription rules
LIST-OF-NATSP and NO-DUPS, to
Subgoal *1/3''
(IMPLIES (AND (NOT (ZP N))
(CONSP LST)
(<= (+ -1 N)
(MAXIMAL (RM (MAXIMAL LST) LST)))
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N)).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, the :forward-chaining
rule PROBLEM-112D, the :linear rule PROBLEM-112E and the :type-prescription
rules LIST-OF-NATSP and NO-DUPS.
Subgoal *1/2
(IMPLIES (AND (NOT (ZP N)) (ENDP LST))
(IMPLIES (AND (NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (ZP N))
(NOT (CONSP LST))
(NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and ZP-COMPOUND-RECOGNIZER, the :definitions LEN, LIST-
OF-NATSP, MAXIMAL and NO-DUPS and the :forward-chaining rules NATP-
FC-1 and NATP-FC-2.
Subgoal *1/1
(IMPLIES (ZP N)
(IMPLIES (AND (NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (ZP N)
(NATP N)
(LIST-OF-NATSP LST)
(NO-DUPS LST)
(< (MAXIMAL LST) N))
(<= (LEN LST) N)).
This simplifies, using the :compound-recognizer rules NATP-CR and ZP-
COMPOUND-RECOGNIZER, the :executable-counterparts of <, NATP, NOT and
ZP, linear arithmetic, the :forward-chaining rules NATP-FC-1 and PROBLEM-
112D and the :type-prescription rule LIST-OF-NATSP, to
Subgoal *1/1''
(IMPLIES (AND (EQUAL (MAXIMAL LST) -1)
(LIST-OF-NATSP LST)
(NO-DUPS LST))
(<= (LEN LST) 0)).
By the simple :rewrite rule PROBLEM-112I we reduce the conjecture to
Subgoal *1/1'''
(IMPLIES (AND (EQUAL (MAXIMAL LST) -1)
(LIST-OF-NATSP LST)
(NO-DUPS LST))
(NOT (CONSP LST))).
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-112H and the :type-prescription rule LIST-OF-NATSP.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112J ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ENDP)
(:DEFINITION LEN)
(:DEFINITION LIST-OF-NATSP)
(:DEFINITION MAXIMAL)
(:DEFINITION NO-DUPS)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:FORWARD-CHAINING PROBLEM-112D)
(:INDUCTION INDUCTION-HINT)
(:LINEAR PROBLEM-112E)
(:LINEAR PROBLEM-112H)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE NATP-POSP--1)
(:REWRITE PROBLEM-112A)
(:REWRITE PROBLEM-112C)
(:REWRITE PROBLEM-112F)
(:REWRITE PROBLEM-112G)
(:REWRITE PROBLEM-112I)
(:TYPE-PRESCRIPTION LIST-OF-NATSP)
(:TYPE-PRESCRIPTION NO-DUPS))
Warnings: None
Time: 0.13 seconds (prove: 0.04, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-112J
ACL2 >>(THEOREM PROBLEM-112
(IMPLIES (AND (LIST-OF-NATSP LST) (NO-DUPS LST))
(<= (LEN LST) (+ 1 (MAXIMAL LST))))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-112D PROBLEM-112J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :forward-chaining rule PROBLEM-112D, the :rewrite
rules NATP-RW and PROBLEM-112J and the :type-prescription rules LIST-
OF-NATSP and NO-DUPS.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-112 ...)
Rules: ((:DEFINITION NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING PROBLEM-112D)
(:REWRITE NATP-RW)
(:REWRITE PROBLEM-112J)
(:TYPE-PRESCRIPTION LIST-OF-NATSP)
(:TYPE-PRESCRIPTION NO-DUPS))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.01, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-112
ACL2 >>(DEFUN ADDRESSP (PTR M)
(AND (NATP PTR) (< PTR (LEN M))))
Since ADDRESSP is non-recursive, its admission is trivial. We observe
that the type of ADDRESSP is described by the theorem
(OR (EQUAL (ADDRESSP PTR M) T) (EQUAL (ADDRESSP PTR M) NIL)).
Summary
Form: ( DEFUN ADDRESSP ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
ADDRESSP
ACL2 >>(DEFUN INC (X)
(IF (INTEGERP X) (+ 1 X) 'INFINITE))
Since INC is non-recursive, its admission is trivial. We observe that
the type of INC is described by the theorem
(OR (INTEGERP (INC X))
(AND (SYMBOLP (INC X))
(NOT (EQUAL (INC X) T))
(NOT (EQUAL (INC X) NIL)))).
We used primitive type reasoning.
Summary
Form: ( DEFUN INC ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
INC
ACL2 >>(DEFUN LEN-DIFF (MEM SEEN)
(IF (CONSP MEM)
(IF (MEM (CAR MEM) SEEN)
(LEN-DIFF (CDR MEM) SEEN)
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))
0))
The admission of LEN-DIFF is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT MEM). We observe that the type of LEN-DIFF is
described by the theorem
(AND (INTEGERP (LEN-DIFF MEM SEEN)) (<= 0 (LEN-DIFF MEM SEEN))). We
used primitive type reasoning.
Summary
Form: ( DEFUN LEN-DIFF ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
LEN-DIFF
ACL2 >>(THEOREM PROBLEM-113A
(IMPLIES (AND (NATP N) (< N (LEN M)))
(MEM (NTH N M) M))
:HINTS
(("Goal" :INDUCT (NTH N M)
:IN-THEORY (ENABLE PROBLEM-112I))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NTH N M). This
suggestion was produced using the :induction rule NTH. If we let (:P M N)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP M))
(NOT (ZP N))
(:P (CDR M) (+ -1 N)))
(:P M N))
(IMPLIES (AND (NOT (ENDP M)) (ZP N))
(:P M N))
(IMPLIES (ENDP M) (:P M N))).
This induction is justified by the same argument used to admit NTH,
namely, the measure (ACL2-COUNT N) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable M is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP M))
(NOT (ZP N))
(IMPLIES (AND (NATP (+ -1 N))
(< (+ -1 N) (LEN (CDR M))))
(MEM (NTH (+ -1 N) (CDR M)) (CDR M))))
(IMPLIES (AND (NATP N) (< N (LEN M)))
(MEM (NTH N M) M))).
By the simple :definition ENDP and the simple :rewrite rule NATP-POSP-
-1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP M)
(NOT (ZP N))
(IMPLIES (AND (POSP N)
(< (+ -1 N) (LEN (CDR M))))
(MEM (NTH (+ -1 N) (CDR M)) (CDR M)))
(NATP N)
(< N (LEN M)))
(MEM (NTH N M) M)).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions LEN, MEM and NTH, the
:forward-chaining rules POSP-FC-1 and POSP-FC-2 and the :type-prescription
rule MEM, to
Subgoal *1/3''
(IMPLIES (AND (CONSP M)
(NOT (ZP N))
(<= (LEN (CDR M)) (+ -1 N))
(< N (+ 1 (LEN (CDR M))))
(NOT (EQUAL (NTH (+ -1 N) (CDR M)) (CAR M))))
(MEM (NTH (+ -1 N) (CDR M)) (CDR M))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP M)) (ZP N))
(IMPLIES (AND (NATP N) (< N (LEN M)))
(MEM (NTH N M) M))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP M)
(ZP N)
(NATP N)
(< N (LEN M)))
(MEM (NTH N M) M)).
This simplifies, using the :compound-recognizer rules NATP-CR and ZP-
COMPOUND-RECOGNIZER, the :executable-counterparts of NATP, NOT and
ZP, linear arithmetic and the :forward-chaining rule NATP-FC-1, to
Subgoal *1/2''
(IMPLIES (AND (CONSP M) (< 0 (LEN M)))
(MEM (NTH 0 M) M)).
By the simple :rewrite rule PROBLEM-112I we reduce the conjecture to
Subgoal *1/2'''
(IMPLIES (CONSP M) (MEM (NTH 0 M) M)).
But simplification reduces this to T, using the :definitions MEM and
NTH, the :executable-counterpart of ZP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (ENDP M)
(IMPLIES (AND (NATP N) (< N (LEN M)))
(MEM (NTH N M) M))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP M))
(NATP N)
(< N (LEN M)))
(MEM (NTH N M) M)).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition LEN and the :forward-chaining rules NATP-
FC-1 and NATP-FC-2.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-113A depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-113A ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ENDP)
(:DEFINITION LEN)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION NTH)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:INDUCTION NTH)
(:REWRITE NATP-POSP--1)
(:REWRITE PROBLEM-112I)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.04, print: 0.06, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-113A
ACL2 >>(THEOREM PROBLEM-113B
(<= (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))
:HINTS
(("Goal" :INDUCT (LEN-DIFF MEM (CONS PTR SEEN))
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by
(LEN-DIFF MEM (CONS PTR SEEN)). This suggestion was produced using
the :induction rule LEN-DIFF. If we let (:P MEM PTR SEEN) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP MEM))
(:P MEM PTR SEEN))
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) (CONS PTR SEEN)))
(:P (CDR MEM) PTR SEEN))
(:P MEM PTR SEEN))
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) (CONS PTR SEEN))
(:P (CDR MEM) PTR SEEN))
(:P MEM PTR SEEN))).
This induction is justified by the same argument used to admit LEN-
DIFF, namely, the measure (ACL2-COUNT MEM) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP MEM))
(<= (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using the :definition LEN-DIFF
and the :executable-counterpart of <.
Subgoal *1/2
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) (CONS PTR SEEN)))
(<= (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN)))
(<= (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using the :definitions LEN-DIFF
and MEM, primitive type reasoning, the :meta rule CANCEL_PLUS-LESSP-
CORRECT and the :rewrite rules CAR-CONS and CDR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) (CONS PTR SEEN))
(<= (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN)))
(<= (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
This simplifies, using the :definitions LEN-DIFF and MEM, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and
PROBLEM-49A and the :type-prescription rule MEM, to
Subgoal *1/1'
(IMPLIES (AND (CONSP MEM)
(EQUAL (CAR MEM) PTR)
(<= (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))
(NOT (MEM PTR SEEN)))
(<= (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-113B ...)
Rules: ((:DEFINITION LEN-DIFF)
(:DEFINITION MEM)
(:EXECUTABLE-COUNTERPART <)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN-DIFF)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.02, print: 0.10, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-113B
ACL2 >>(THEOREM PROBLEM-113C
(IMPLIES (AND (MEM PTR MEM) (NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN)))
:HINTS
(("Goal" :INDUCT (LEN-DIFF MEM SEEN)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A PROBLEM-113B)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN-DIFF MEM SEEN).
This suggestion was produced using the :induction rule LEN-DIFF. If
we let (:P MEM PTR SEEN) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP MEM))
(:P MEM PTR SEEN))
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(:P (CDR MEM) PTR SEEN))
(:P MEM PTR SEEN))
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) SEEN)
(:P (CDR MEM) PTR SEEN))
(:P MEM PTR SEEN))).
This induction is justified by the same argument used to admit LEN-
DIFF, namely, the measure (ACL2-COUNT MEM) is decreasing according
to the relation O< (which is known to be well-founded on the domain
recognized by O-P). When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP MEM))
(IMPLIES (AND (MEM PTR MEM) (NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP MEM))
(MEM PTR MEM)
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
This simplifies, using linear arithmetic, the :linear rule PROBLEM-
113B and the :type-prescription rule LEN-DIFF, to
Subgoal *1/3''
(IMPLIES (AND (EQUAL (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))
(NOT (CONSP MEM))
(MEM PTR MEM)
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using the :definitions LEN-DIFF
and MEM and the :executable-counterpart of EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(IMPLIES (AND (MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))))
(IMPLIES (AND (MEM PTR MEM) (NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(IMPLIES (AND (MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN)))
(MEM PTR MEM)
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
This simplifies, using the :definitions LEN-DIFF and MEM, the :executable-
counterpart of NOT, primitive type reasoning, the :rewrite rules CAR-
CONS and CDR-CONS and the :type-prescription rule MEM, to the following
four conjectures.
Subgoal *1/2.4
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(NOT (MEM PTR (CDR MEM)))
(EQUAL PTR (CAR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using linear arithmetic and the
:linear rule PROBLEM-113B.
Subgoal *1/2.3
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))
(EQUAL PTR (CAR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
Subgoal *1/2.2
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))
(MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN))
(EQUAL (CAR MEM) PTR))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
Subgoal *1/2.1
(IMPLIES (AND (CONSP MEM)
(NOT (MEM (CAR MEM) SEEN))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))
(MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN))
(NOT (EQUAL (CAR MEM) PTR)))
(< (+ 1 (LEN-DIFF (CDR MEM) (CONS PTR SEEN)))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule LEN-DIFF.
Subgoal *1/1
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) SEEN)
(IMPLIES (AND (MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))))
(IMPLIES (AND (MEM PTR MEM) (NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) SEEN)
(IMPLIES (AND (MEM PTR (CDR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN)))
(MEM PTR MEM)
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
This simplifies, using the :definitions LEN-DIFF and MEM, the :executable-
counterpart of NOT, primitive type reasoning, the :rewrite rules CAR-
CONS, CDR-CONS, PROBLEM-48 and PROBLEM-49A and the :type-prescription
rule MEM, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) SEEN)
(NOT (MEM PTR (CDR MEM)))
(EQUAL PTR (CAR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.1
(IMPLIES (AND (CONSP MEM)
(MEM (CAR MEM) SEEN)
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(LEN-DIFF (CDR MEM) SEEN))
(EQUAL PTR (CAR MEM))
(NOT (MEM PTR SEEN)))
(< (LEN-DIFF (CDR MEM) (CONS PTR SEEN))
(+ 1 (LEN-DIFF (CDR MEM) SEEN)))).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-113C ...)
Rules: ((:DEFINITION LEN-DIFF)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN-DIFF)
(:LINEAR PROBLEM-113B)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.05, print: 0.06, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-113C
ACL2 >>(DEFUN DEREF-CNT (PTR MEM SEEN)
(DECLARE (XARGS :MEASURE
(M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-113A PROBLEM-113C)))))
(IF (ADDRESSP PTR MEM)
(IF (MEM PTR SEEN)
'INFINITE
(INC (DEREF-CNT (NTH PTR MEM)
MEM (CONS PTR SEEN))))
0))
For the admission of DEREF-CNT we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(M2 (IF (MEM PTR MEM) 1 2) (LEN-DIFF MEM SEEN)). The non-trivial part
of the measure conjecture is
Goal
(AND (O-P (M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN)))
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN)))
(O< (M2 (IF (MEM (NTH PTR MEM) MEM) 1 2)
(LEN-DIFF MEM (CONS PTR SEEN)))
(M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN))))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions ADDRESSP and M2 we reduce the conjecture
to the following two conjectures.
Subgoal 2
(O-P (CONS (CONS 1 (+ 1 (IF (MEM PTR MEM) 1 2)))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions O-FIRST-COEFF,
O-FIRST-EXPT, O-P and O-RST, the :executable-counterparts of EQUAL,
O-P and O<, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1 and the :type-
prescription rule LEN-DIFF.
Subgoal 1
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN)))
(O< (CONS (CONS 1
(+ 1 (IF (MEM (NTH PTR MEM) MEM) 1 2)))
(LEN-DIFF MEM (CONS PTR SEEN)))
(CONS (CONS 1 (+ 1 (IF (MEM PTR MEM) 1 2)))
(LEN-DIFF MEM SEEN)))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definitions O-FIRST-COEFF, O-FIRST-EXPT, O-RST, O< and
SYNP, the :executable-counterparts of ACL2-NUMBERP, BINARY-+, CAR,
CDR, CONS, EQUAL and UNARY--, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules CAR-CONS,
CDR-CONS, EQUAL-CONSTANT-+ and PROBLEM-113A and the :type-prescription
rule LEN-DIFF, to
Subgoal 1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(MEM PTR MEM))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-113C and the :type-prescription rules LEN-DIFF
and MEM.
Q.E.D.
That completes the proof of the measure theorem for DEREF-CNT. Thus,
we admit this function under the principle of definition. We observe
that the type of DEREF-CNT is described by the theorem
(OR (INTEGERP (DEREF-CNT PTR MEM SEEN))
(AND (SYMBOLP (DEREF-CNT PTR MEM SEEN))
(NOT (EQUAL (DEREF-CNT PTR MEM SEEN) T))
(NOT (EQUAL (DEREF-CNT PTR MEM SEEN) NIL)))).
We used the :type-prescription rule INC.
Summary
Form: ( DEFUN DEREF-CNT ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION M2)
(:DEFINITION NOT)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART ACL2-NUMBERP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:LINEAR PROBLEM-113C)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE EQUAL-CONSTANT-+)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE PROBLEM-113A)
(:TYPE-PRESCRIPTION INC)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.02, other: 0.03)
DEREF-CNT
ACL2 >>(DEFUN PATH (PTR MEM SEEN)
(DECLARE (XARGS :MEASURE
(M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-113A PROBLEM-113C)))))
(IF (ADDRESSP PTR MEM)
(IF (MEM PTR SEEN)
'INFINITE
(PATH (NTH PTR MEM)
MEM (CONS PTR SEEN)))
(CONS PTR SEEN)))
For the admission of PATH we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(M2 (IF (MEM PTR MEM) 1 2) (LEN-DIFF MEM SEEN)). The non-trivial part
of the measure conjecture is
Goal
(AND (O-P (M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN)))
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN)))
(O< (M2 (IF (MEM (NTH PTR MEM) MEM) 1 2)
(LEN-DIFF MEM (CONS PTR SEEN)))
(M2 (IF (MEM PTR MEM) 1 2)
(LEN-DIFF MEM SEEN))))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions ADDRESSP and M2 we reduce the conjecture
to the following two conjectures.
Subgoal 2
(O-P (CONS (CONS 1 (+ 1 (IF (MEM PTR MEM) 1 2)))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions O-FIRST-COEFF,
O-FIRST-EXPT, O-P and O-RST, the :executable-counterparts of EQUAL,
O-P and O<, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1 and the :type-
prescription rule LEN-DIFF.
Subgoal 1
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN)))
(O< (CONS (CONS 1
(+ 1 (IF (MEM (NTH PTR MEM) MEM) 1 2)))
(LEN-DIFF MEM (CONS PTR SEEN)))
(CONS (CONS 1 (+ 1 (IF (MEM PTR MEM) 1 2)))
(LEN-DIFF MEM SEEN)))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definitions O-FIRST-COEFF, O-FIRST-EXPT, O-RST, O< and
SYNP, the :executable-counterparts of ACL2-NUMBERP, BINARY-+, CAR,
CDR, CONS, EQUAL and UNARY--, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules CAR-CONS,
CDR-CONS, EQUAL-CONSTANT-+ and PROBLEM-113A and the :type-prescription
rule LEN-DIFF, to
Subgoal 1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(MEM PTR MEM))
(< (LEN-DIFF MEM (CONS PTR SEEN))
(LEN-DIFF MEM SEEN))).
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-113C and the :type-prescription rules LEN-DIFF
and MEM.
Q.E.D.
That completes the proof of the measure theorem for PATH. Thus, we
admit this function under the principle of definition. We observe that
the type of PATH is described by the theorem
(OR (CONSP (PATH PTR MEM SEEN))
(AND (SYMBOLP (PATH PTR MEM SEEN))
(NOT (EQUAL (PATH PTR MEM SEEN) T))
(NOT (EQUAL (PATH PTR MEM SEEN) NIL)))).
We used primitive type reasoning.
Summary
Form: ( DEFUN PATH ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION M2)
(:DEFINITION NOT)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART ACL2-NUMBERP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:LINEAR PROBLEM-113C)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE EQUAL-CONSTANT-+)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE PROBLEM-113A)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.13 seconds (prove: 0.03, print: 0.07, other: 0.03)
PATH
ACL2 >>(THEOREM PROBLEM-114A
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(- (LEN (PATH PTR MEM SEEN))
(+ 1 (LEN SEEN)))))
:HINTS
(("Goal" :INDUCT (PATH PTR MEM SEEN)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PATH PTR MEM SEEN).
This suggestion was produced using the :induction rule PATH. If we
let (:P MEM PTR SEEN) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (ADDRESSP PTR MEM))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(:P MEM (NTH PTR MEM) (CONS PTR SEEN)))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(:P MEM PTR SEEN))).
This induction is justified by the same argument used to admit PATH,
namely, the measure (M2 (IF (MEM PTR MEM) '1 '2) (LEN-DIFF MEM SEEN))
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following three nontautologica\
l subgoals.
Subgoal *1/3
(IMPLIES (NOT (ADDRESSP PTR MEM))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
(- (+ 1 (LEN SEEN))))))).
By the :executable-counterpart of UNARY-- and the simple :rewrite rule
DISTRIBUTIVITY-OF-MINUS-OVER-+ we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (NOT (ADDRESSP PTR MEM))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
-1 (- (LEN SEEN)))))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, DEREF-CNT, LEN and PATH, the
:executable-counterparts of BINARY-+ and EQUAL, primitive type reasoning
and the :rewrite rules CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-
OF-+ and INVERSE-OF-+.
Subgoal *1/2
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(EQUAL (DEREF-CNT (NTH PTR MEM)
MEM (CONS PTR SEEN))
(IF (EQUAL (PATH (NTH PTR MEM) MEM (CONS PTR SEEN))
'INFINITE)
'INFINITE
(+ (LEN (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN)))
(- (+ 1 (LEN (CONS PTR SEEN))))))))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
(- (+ 1 (LEN SEEN))))))).
By the simple :definition ADDRESSP, the :executable-counterpart of
UNARY-- and the simple :rewrite rule DISTRIBUTIVITY-OF-MINUS-OVER-+
we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(EQUAL (DEREF-CNT (NTH PTR MEM)
MEM (CONS PTR SEEN))
(IF (EQUAL (PATH (NTH PTR MEM) MEM (CONS PTR SEEN))
'INFINITE)
'INFINITE
(+ (LEN (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN)))
-1 (- (LEN (CONS PTR SEEN)))))))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
-1 (- (LEN SEEN)))))).
This simplifies, using the :compound-recognizer rule NATP-CR, the :definitions
ADDRESSP, DEREF-CNT, INC, LEN, PATH and SYNP, the :executable-counterparts
of BINARY-+, EQUAL, INC and UNARY--, primitive type reasoning, the
:forward-chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules
CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+, DISTRIBUTIVITY-
OF-MINUS-OVER-+ and FOLD-CONSTS-IN-+ and the :type-prescription rules
DEREF-CNT and LEN, to
Subgoal *1/2''
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(NOT (EQUAL (PATH (NTH PTR MEM) MEM (CONS PTR SEEN))
'INFINITE))
(EQUAL (DEREF-CNT (NTH PTR MEM)
MEM (CONS PTR SEEN))
(+ -2 (- (LEN SEEN))
(LEN (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN))))))
(EQUAL (+ 1
(DEREF-CNT (NTH PTR MEM)
MEM (CONS PTR SEEN)))
(+ -1 (- (LEN SEEN))
(LEN (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rules DEREF-CNT and LEN.
Subgoal *1/1
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
(- (+ 1 (LEN SEEN))))))).
By the simple :definition ADDRESSP, the :executable-counterpart of
UNARY-- and the simple :rewrite rule DISTRIBUTIVITY-OF-MINUS-OVER-+
we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(MEM PTR SEEN))
(EQUAL (DEREF-CNT PTR MEM SEEN)
(IF (EQUAL (PATH PTR MEM SEEN) 'INFINITE)
'INFINITE
(+ (LEN (PATH PTR MEM SEEN))
-1 (- (LEN SEEN)))))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, DEREF-CNT and PATH, the :executable-
counterpart of EQUAL, the :forward-chaining rules NATP-FC-1 and NATP-
FC-2, the :rewrite rules PROBLEM-48 and PROBLEM-49A and the :type-
prescription rule MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114A ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION DEREF-CNT)
(:DEFINITION INC)
(:DEFINITION LEN)
(:DEFINITION NOT)
(:DEFINITION PATH)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART INC)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION PATH)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE INVERSE-OF-+)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION DEREF-CNT)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.12 seconds (prove: 0.05, print: 0.06, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114A
ACL2 >>(DEFUN ADDRESSESP (X MEM)
(IF (ENDP X)
T
(AND (ADDRESSP (CAR X) MEM)
(ADDRESSESP (CDR X) MEM))))
The admission of ADDRESSESP is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We observe that the type of ADDRESSESP is
described by the theorem
(OR (EQUAL (ADDRESSESP X MEM) T) (EQUAL (ADDRESSESP X MEM) NIL)).
Summary
Form: ( DEFUN ADDRESSESP ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
ADDRESSESP
ACL2 >>(THEOREM PROBLEM-114B
(IMPLIES (AND (ADDRESSESP X MEM) (NOT (NATP E)))
(NOT (MEM E X)))
:HINTS (("Goal" :INDUCT (MEM E X))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-114B ...): The :REWRITE rule
generated from PROBLEM-114B contains the free variable MEM. This variable
will be chosen by searching for an instance of (ADDRESSESP X MEM) among
the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM E X). This
suggestion was produced using the :induction rule MEM. If we let
(:P E MEM X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E MEM X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(:P E MEM (CDR X)))
(:P E MEM X))
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(:P E MEM X))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (ADDRESSESP X MEM) (NOT (NATP E)))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(ADDRESSESP X MEM)
(NOT (NATP E)))
(NOT (MEM E X))).
But simplification reduces this to T, using the :definitions ADDRESSESP
and MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP (CDR X) MEM)
(NOT (NATP E)))
(NOT (MEM E (CDR X)))))
(IMPLIES (AND (ADDRESSESP X MEM) (NOT (NATP E)))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP (CDR X) MEM)
(NOT (NATP E)))
(NOT (MEM E (CDR X))))
(ADDRESSESP X MEM)
(NOT (NATP E)))
(NOT (MEM E X))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSESP, ADDRESSP, MEM and NOT, the
:executable-counterpart of NOT, primitive type reasoning and the :type-
prescription rule ADDRESSESP.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP X MEM) (NOT (NATP E)))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL E (CAR X))
(ADDRESSESP X MEM)
(NOT (NATP E)))
(NOT (MEM E X))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR and the :definitions ADDRESSESP and ADDRESSP.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114B ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ADDRESSESP)
(:DEFINITION ADDRESSP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:TYPE-PRESCRIPTION ADDRESSESP))
Warnings: Free
Time: 0.05 seconds (prove: 0.01, print: 0.04, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-114B
ACL2 >>(THEOREM PROBLEM-114C
(IMPLIES (AND (ADDRESSESP X MEM)
(>= E (LEN MEM)))
(NOT (MEM E X)))
:HINTS (("Goal" :INDUCT (MEM E X))))
ACL2 Warning [Free] in ( DEFTHM PROBLEM-114C ...): The :REWRITE rule
generated from PROBLEM-114C contains the free variable MEM. This variable
will be chosen by searching for an instance of (ADDRESSESP X MEM) among
the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :REWRITE rule. See
:DOC free-variables.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (MEM E X). This
suggestion was produced using the :induction rule MEM. If we let
(:P E MEM X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P E MEM X))
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(:P E MEM (CDR X)))
(:P E MEM X))
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(:P E MEM X))).
This induction is justified by the same argument used to admit MEM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X))).
But simplification reduces this to T, using the :definitions ADDRESSESP
and MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP (CDR X) MEM)
(<= (LEN MEM) E))
(NOT (MEM E (CDR X)))))
(IMPLIES (AND (ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP (CDR X) MEM)
(<= (LEN MEM) E))
(NOT (MEM E (CDR X))))
(ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X))).
But simplification reduces this to T, using the :definitions ADDRESSESP,
ADDRESSP, MEM and NOT, the :executable-counterpart of NOT, primitive
type reasoning and the :type-prescription rule ADDRESSESP.
Subgoal *1/1
(IMPLIES (AND (CONSP X) (EQUAL E (CAR X)))
(IMPLIES (AND (ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL E (CAR X))
(ADDRESSESP X MEM)
(<= (LEN MEM) E))
(NOT (MEM E X))).
But simplification reduces this to T, using the :definitions ADDRESSESP
and ADDRESSP.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114C ...)
Rules: ((:DEFINITION ADDRESSESP)
(:DEFINITION ADDRESSP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION MEM)
(:TYPE-PRESCRIPTION ADDRESSESP))
Warnings: Free
Time: 0.10 seconds (prove: 0.04, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-114C
ACL2 >>(THEOREM PROBLEM-114D
(IMPLIES (AND (NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN)))
:HINTS
(("Goal" :INDUCT (PATH PTR MEM SEEN)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A
PROBLEM-114B PROBLEM-114C))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PATH PTR MEM SEEN).
This suggestion was produced using the :induction rule PATH. If we
let (:P MEM PTR SEEN) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (ADDRESSP PTR MEM))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(:P MEM (NTH PTR MEM) (CONS PTR SEEN)))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(:P MEM PTR SEEN))).
This induction is justified by the same argument used to admit PATH,
namely, the measure (M2 (IF (MEM PTR MEM) '1 '2) (LEN-DIFF MEM SEEN))
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following three nontautologica\
l subgoals.
Subgoal *1/3
(IMPLIES (NOT (ADDRESSP PTR MEM))
(IMPLIES (AND (NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (ADDRESSP PTR MEM))
(NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, NO-DUPS and PATH, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-114B
and PROBLEM-114C and the :type-prescription rules ADDRESSESP and NO-
DUPS.
Subgoal *1/2
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(IMPLIES (AND (NO-DUPS (CONS PTR SEEN))
(ADDRESSESP (CONS PTR SEEN) MEM))
(NO-DUPS (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN)))))
(IMPLIES (AND (NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN)))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(IMPLIES (AND (NO-DUPS (CONS PTR SEEN))
(ADDRESSESP (CONS PTR SEEN) MEM))
(NO-DUPS (PATH (NTH PTR MEM)
MEM (CONS PTR SEEN))))
(NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSESP, ADDRESSP, NO-DUPS and PATH,
primitive type reasoning, the :forward-chaining rules NATP-FC-1 and
NATP-FC-2, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rules ADDRESSESP and NO-DUPS.
Subgoal *1/1
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(IMPLIES (AND (NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN)))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(MEM PTR SEEN)
(NO-DUPS SEEN)
(ADDRESSESP SEEN MEM))
(NO-DUPS (PATH PTR MEM SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP and PATH, the :executable-
counterpart of NO-DUPS, the :forward-chaining rules NATP-FC-1 and NATP-
FC-2, the :rewrite rules PROBLEM-48 and PROBLEM-49A and the :type-
prescription rule MEM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-114D depends upon the :type-prescription rule
NO-DUPS.
Summary
Form: ( DEFTHM PROBLEM-114D ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ADDRESSESP)
(:DEFINITION ADDRESSP)
(:DEFINITION NO-DUPS)
(:DEFINITION NOT)
(:DEFINITION PATH)
(:EXECUTABLE-COUNTERPART NO-DUPS)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION PATH)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-114B)
(:REWRITE PROBLEM-114C)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION ADDRESSESP)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION NO-DUPS))
Warnings: None
Time: 0.09 seconds (prove: 0.03, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114D
ACL2 >>(THEOREM PROBLEM-114E
(IMPLIES (SUB A B) (SUB A (CONS E B)))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-48 PROBLEM-49))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using the :rewrite rules CDR-
CONS, PROBLEM-48, PROBLEM-48A and PROBLEM-49 and the :type-prescription
rule SUB.
Q.E.D.
The storage of PROBLEM-114E depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-114E ...)
Rules: ((:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-48A)
(:REWRITE PROBLEM-49)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.04 seconds (prove: 0.02, print: 0.00, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114E
ACL2 >>(THEOREM PROBLEM-114F (SUB A (APP A B))
:HINTS
(("Goal" :INDUCT (SUB A (APP A B))
:IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-114E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. Two induction schemes are suggested
by the induction hint. These merge into one derived induction scheme.
We will induct according to a scheme suggested by (SUB A (APP A B)),
but modified to accommodate (APP A B). These suggestions were produced
using the :induction rules APP and SUB. If we let (:P A B) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) (APP A B))))
(:P A B))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) (APP A B))
(:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(SUB A (APP A B))).
But simplification reduces this to T, using the :definitions APP and
SUB and the :rewrite rule PROBLEM-48A.
Subgoal *1/2
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) (APP A B))))
(SUB A (APP A B))).
But simplification reduces this to T, using the :definitions APP and
MEM, primitive type reasoning and the :rewrite rule CAR-CONS.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) (APP A B))
(SUB (CDR A) (APP (CDR A) B)))
(SUB A (APP A B))).
But simplification reduces this to T, using the :definitions APP, MEM
and SUB, primitive type reasoning, the :rewrite rules CAR-CONS and
PROBLEM-114E and the :type-prescription rule SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-114F depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-114F ...)
Rules: ((:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION SUB)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:INDUCTION SUB)
(:REWRITE CAR-CONS)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-48A)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.04 seconds (prove: 0.01, print: 0.02, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114F
ACL2 >>(THEOREM PROBLEM-114G (SUB B (APP A B))
:HINTS
(("Goal" :INDUCT (APP A B)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-114E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(SUB B (APP A B))).
But simplification reduces this to T, using the :definition APP and
the :rewrite rule PROBLEM-48.
Subgoal *1/1
(IMPLIES (AND (CONSP A) (SUB B (APP (CDR A) B)))
(SUB B (APP A B))).
But simplification reduces this to T, using the :definition APP, the
:rewrite rule PROBLEM-114E and the :type-prescription rule SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-114G depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-114G ...)
Rules: ((:DEFINITION APP)
(:INDUCTION APP)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-48)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114G
ACL2 >>(THEOREM PROBLEM-114H
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))
:HINTS
(("Goal" :INDUCT (PATH PTR MEM SEEN)
:IN-THEORY
(ENABLE PROBLEM-46 PROBLEM-48
PROBLEM-49 PROBLEM-49A PROBLEM-113A
PROBLEM-114E PROBLEM-114F))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PATH PTR MEM SEEN).
This suggestion was produced using the :induction rule PATH. If we
let (:P MEM PTR SEEN) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (NOT (ADDRESSP PTR MEM))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(:P MEM (NTH PTR MEM) (CONS PTR SEEN)))
(:P MEM PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(:P MEM PTR SEEN))).
This induction is justified by the same argument used to admit PATH,
namely, the measure (M2 (IF (MEM PTR MEM) '1 '2) (LEN-DIFF MEM SEEN))
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following three nontautologica\
l subgoals.
Subgoal *1/3
(IMPLIES (NOT (ADDRESSP PTR MEM))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, MEM, PATH and SUB, primitive
type reasoning and the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-114E
and PROBLEM-114F.
Subgoal *1/2
(IMPLIES (AND (ADDRESSP PTR MEM)
(NOT (MEM PTR SEEN))
(SUB (PATH (NTH PTR MEM) MEM (CONS PTR SEEN))
(CONS (NTH PTR MEM)
(APP (CONS PTR SEEN) MEM))))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(NOT (MEM PTR SEEN))
(SUB (PATH (NTH PTR MEM) MEM (CONS PTR SEEN))
(CONS (NTH PTR MEM)
(APP (CONS PTR SEEN) MEM))))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, APP, MEM, PATH and SUB, primitive
type reasoning, the :forward-chaining rules NATP-FC-1 and NATP-FC-2,
the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-113A, PROBLEM-46, PROBLEM-
48 and PROBLEM-49 and the :type-prescription rule SUB.
Subgoal *1/1
(IMPLIES (AND (ADDRESSP PTR MEM) (MEM PTR SEEN))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN MEM))
(MEM PTR SEEN))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, PATH and SUB, the :executable-
counterpart of CONSP, the :forward-chaining rules NATP-FC-1 and NATP-
FC-2, the :rewrite rules PROBLEM-114E, PROBLEM-48 and PROBLEM-49A and
the :type-prescription rule MEM.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-114H depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-114H ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION APP)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION PATH)
(:DEFINITION SUB)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION PATH)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-113A)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-114F)
(:REWRITE PROBLEM-46)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.11 seconds (prove: 0.04, print: 0.04, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114H
ACL2 >>(THEOREM PROBLEM-114I
(IMPLIES (AND (NOT (MEM E A)) (SUB A B))
(SUB A (RM E B)))
:HINTS
(("Goal" :INDUCT (SUB A B)
:IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-55A PROBLEM-55D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SUB A B). This
suggestion was produced using the :induction rule SUB. If we let
(:P A B E) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B E))
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(:P A B E))
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(:P (CDR A) B E))
(:P A B E))).
This induction is justified by the same argument used to admit SUB,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP A))
(IMPLIES (AND (NOT (MEM E A)) (SUB A B))
(SUB A (RM E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP A))
(NOT (MEM E A))
(SUB A B))
(SUB A (RM E B))).
But simplification reduces this to T, using the :definitions MEM and
SUB and the :rewrite rule PROBLEM-48A.
Subgoal *1/2
(IMPLIES (AND (CONSP A) (NOT (MEM (CAR A) B)))
(IMPLIES (AND (NOT (MEM E A)) (SUB A B))
(SUB A (RM E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP A)
(NOT (MEM (CAR A) B))
(NOT (MEM E A))
(SUB A B))
(SUB A (RM E B))).
But simplification reduces this to T, using the :definition SUB.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (AND (NOT (MEM E (CDR A)))
(SUB (CDR A) B))
(SUB (CDR A) (RM E B))))
(IMPLIES (AND (NOT (MEM E A)) (SUB A B))
(SUB A (RM E B)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP A)
(MEM (CAR A) B)
(IMPLIES (AND (NOT (MEM E (CDR A)))
(SUB (CDR A) B))
(SUB (CDR A) (RM E B)))
(NOT (MEM E A))
(SUB A B))
(SUB A (RM E B))).
But simplification reduces this to T, using the :definitions MEM, NOT
and SUB, primitive type reasoning, the :rewrite rule PROBLEM-55D and
the :type-prescription rules MEM and SUB.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-114I depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-114I ...)
Rules: ((:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION SUB)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SUB)
(:REWRITE PROBLEM-48A)
(:REWRITE PROBLEM-55D)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.10 seconds (prove: 0.02, print: 0.07, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114I
ACL2 >>(THEOREM PROBLEM-114J
(IMPLIES (AND (NO-DUPS X) (SUB X Y))
(<= (LEN X) (LEN Y)))
:HINTS
(("Goal" :INDUCT (PERM X Y)
:IN-THEORY
(ENABLE PROBLEM-48A PROBLEM-48
PROBLEM-49A PROBLEM-112F PROBLEM-114I)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (PERM X Y). This
suggestion was produced using the :induction rule PERM. If we let
(:P X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(:P X Y))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(:P (CDR X) (RM (CAR X) Y)))
(:P X Y))).
This induction is justified by the same argument used to admit PERM,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (NO-DUPS X) (SUB X Y))
(<= (LEN X) (LEN Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(NO-DUPS X)
(SUB X Y))
(<= (LEN X) (LEN Y))).
This simplifies, using the :definitions LEN, NO-DUPS and SUB and the
:rewrite rule PROBLEM-48A, to
Subgoal *1/3''
(IMPLIES (NOT (CONSP X))
(<= 0 (LEN Y))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (MEM (CAR X) Y)))
(IMPLIES (AND (NO-DUPS X) (SUB X Y))
(<= (LEN X) (LEN Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) Y))
(NO-DUPS X)
(SUB X Y))
(<= (LEN X) (LEN Y))).
But simplification reduces this to T, using the :definition SUB.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (AND (NO-DUPS (CDR X))
(SUB (CDR X) (RM (CAR X) Y)))
(<= (LEN (CDR X))
(LEN (RM (CAR X) Y)))))
(IMPLIES (AND (NO-DUPS X) (SUB X Y))
(<= (LEN X) (LEN Y)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(IMPLIES (AND (NO-DUPS (CDR X))
(SUB (CDR X) (RM (CAR X) Y)))
(<= (LEN (CDR X)) (LEN (RM (CAR X) Y))))
(NO-DUPS X)
(SUB X Y))
(<= (LEN X) (LEN Y))).
This simplifies, using the :definitions LEN, NO-DUPS, NOT and SUB,
the :rewrite rules PROBLEM-112F, PROBLEM-48 and PROBLEM-49A and the
:type-prescription rule MEM, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(<= (LEN (CDR X)) (+ -1 (LEN Y)))
(NOT (MEM (CAR X) (CDR X)))
(NO-DUPS (CDR X))
(SUB (CDR X) Y))
(<= (+ 1 (LEN (CDR X))) (LEN Y))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) Y)
(NOT (SUB (CDR X) (RM (CAR X) Y)))
(NOT (MEM (CAR X) (CDR X)))
(NO-DUPS (CDR X))
(SUB (CDR X) Y))
(<= (+ 1 (LEN (CDR X))) (LEN Y))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
114I and the :type-prescription rule SUB.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114J ...)
Rules: ((:DEFINITION LEN)
(:DEFINITION NO-DUPS)
(:DEFINITION NOT)
(:DEFINITION SUB)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION PERM)
(:REWRITE PROBLEM-112F)
(:REWRITE PROBLEM-114I)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-48A)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.16 seconds (prove: 0.06, print: 0.09, other: 0.01)
PROBLEM-114J
ACL2 >>(THEOREM PROBLEM-114K
(EQUAL (LEN (APP A B))
(+ (LEN A) (LEN B)))
:HINTS (("Goal" :INDUCT (APP A B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (APP A B). This
suggestion was produced using the :induction rule APP. If we let (:P A B)
denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A) (:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit APP,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(EQUAL (LEN (APP A B))
(+ (LEN A) (LEN B)))).
But simplification reduces this to T, using the :definitions APP, FIX
and LEN, primitive type reasoning, the :rewrite rule UNICITY-OF-0 and
the :type-prescription rule LEN.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(EQUAL (LEN (APP (CDR A) B))
(+ (LEN (CDR A)) (LEN B))))
(EQUAL (LEN (APP A B))
(+ (LEN A) (LEN B)))).
But simplification reduces this to T, using the :definitions APP and
LEN, primitive type reasoning and the :rewrite rules CDR-CONS, COMMUTATIVITY-
2-OF-+ and COMMUTATIVITY-OF-+.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114K ...)
Rules: ((:DEFINITION APP)
(:DEFINITION FIX)
(:DEFINITION LEN)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION APP)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION LEN))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.02, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114K
ACL2 >>(THEOREM PROBLEM-114L
(IMPLIES (AND (ADDRESSESP SEEN MEM)
(NO-DUPS SEEN))
(<= (LEN (PATH PTR MEM SEEN))
(+ 1 (LEN SEEN) (LEN MEM))))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-114D PROBLEM-114H PROBLEM-114K)
:USE
(:INSTANCE PROBLEM-114J (X (PATH PTR MEM SEEN))
(Y (CONS PTR (APP SEEN MEM))))))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now augment the goal above by adding the hypothesis indicated by
the :USE hint. The hypothesis can be derived from PROBLEM-114J via
instantiation. The augmented goal is shown below.
Goal'
(IMPLIES (IMPLIES (AND (NO-DUPS (PATH PTR MEM SEEN))
(SUB (PATH PTR MEM SEEN)
(CONS PTR (APP SEEN MEM))))
(<= (LEN (PATH PTR MEM SEEN))
(LEN (CONS PTR (APP SEEN MEM)))))
(IMPLIES (AND (ADDRESSESP SEEN MEM)
(NO-DUPS SEEN))
(<= (LEN (PATH PTR MEM SEEN))
(+ 1 (LEN SEEN) (LEN MEM))))).
By the simple :rewrite rule PROBLEM-114H we reduce the conjecture to
Goal''
(IMPLIES (AND (IMPLIES (NO-DUPS (PATH PTR MEM SEEN))
(<= (LEN (PATH PTR MEM SEEN))
(LEN (CONS PTR (APP SEEN MEM)))))
(ADDRESSESP SEEN MEM)
(NO-DUPS SEEN))
(<= (LEN (PATH PTR MEM SEEN))
(+ 1 (LEN SEEN) (LEN MEM)))).
But simplification reduces this to T, using the :definitions LEN and
NOT, primitive type reasoning, the :rewrite rules CDR-CONS, COMMUTATIVITY-
OF-+, PROBLEM-114D and PROBLEM-114K and the :type-prescription rules
ADDRESSESP, LEN and NO-DUPS.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114L ...)
Rules: ((:DEFINITION LEN)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE PROBLEM-114D)
(:REWRITE PROBLEM-114H)
(:REWRITE PROBLEM-114K)
(:TYPE-PRESCRIPTION ADDRESSESP)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION NO-DUPS))
Warnings: None
Time: 0.06 seconds (prove: 0.02, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114L
ACL2 >>(THEOREM PROBLEM-114
(<= (DEREF-CNT PTR MEM NIL)
(+ 1 (LEN MEM)))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-114A PROBLEM-114L))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
This simplifies, using the :executable-counterparts of BINARY-+, LEN
and UNARY-- and the :rewrite rules COMMUTATIVITY-OF-+ and PROBLEM-114A,
to the following two conjectures.
Subgoal 2
(IMPLIES (EQUAL (PATH PTR MEM NIL) 'INFINITE)
(<= 'INFINITE (+ 1 (LEN MEM)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule LEN.
Subgoal 1
(IMPLIES (NOT (EQUAL (PATH PTR MEM NIL) 'INFINITE))
(<= (+ -1 (LEN (PATH PTR MEM NIL)))
(+ 1 (LEN MEM)))).
But simplification reduces this to T, using the :definitions ADDRESSESP
and FIX, the :executable-counterparts of CONSP, LEN and NO-DUPS, linear
arithmetic, primitive type reasoning, the :linear rule PROBLEM-114L,
the :rewrite rule UNICITY-OF-0 and the :type-prescription rule LEN.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-114 ...)
Rules: ((:DEFINITION ADDRESSESP)
(:DEFINITION FIX)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART LEN)
(:EXECUTABLE-COUNTERPART NO-DUPS)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:LINEAR PROBLEM-114L)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE PROBLEM-114A)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION LEN))
Warnings: None
Time: 0.04 seconds (prove: 0.03, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-114
ACL2 >>(DEFUN FIB (I)
(IF (ZP I)
0
(IF (EQUAL I 1)
1 (+ (FIB (- I 1)) (FIB (- I 2))))))
For the admission of FIB we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT I). The non-trivial part of the measure conjecture is
Goal
(IMPLIES (AND (NOT (ZP I)) (NOT (EQUAL I 1)))
(O< (ACL2-COUNT (+ -2 I))
(ACL2-COUNT I))).
This simplifies, using the :compound-recognizer rules O-FINP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions ACL2-COUNT, INTEGER-
ABS and O<, the :executable-counterpart of UNARY--, primitive type
reasoning, the :forward-chaining rule POSP-<-1 and the :rewrite rules
<-+-NEGATIVE-0-1 and DISTRIBUTIVITY-OF-MINUS-OVER-+, to the following
two conjectures.
Subgoal 2
(IMPLIES (AND (NOT (ZP I))
(NOT (EQUAL I 1))
(< I 2))
(< (+ 2 (- I)) I)).
But simplification reduces this to T, using the :compound-recognizer
rules POSP-CR and ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive
type reasoning and the :forward-chaining rule POSP-<-1.
Subgoal 1
(IMPLIES (AND (NOT (ZP I))
(NOT (EQUAL I 1))
(<= 2 I))
(< (+ -2 I) I)).
But simplification reduces this to T, using linear arithmetic.
Q.E.D.
That completes the proof of the measure theorem for FIB. Thus, we
admit this function under the principle of definition. We observe that
the type of FIB is described by the theorem
(AND (INTEGERP (FIB I)) (<= 0 (FIB I))). We used primitive type reasoning.
Summary
Form: ( DEFUN FIB ...)
Rules: ((:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ACL2-COUNT)
(:DEFINITION INTEGER-ABS)
(:DEFINITION O<)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING POSP-<-1)
(:REWRITE <-+-NEGATIVE-0-1)
(:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+))
Warnings: None
Time: 0.06 seconds (prove: 0.01, print: 0.04, other: 0.01)
FIB
ACL2 >>(DEFUN FFIB (I J K)
(IF (ZP I)
J
(IF (EQUAL I 1)
K (FFIB (- I 1) K (+ J K)))))
The admission of FFIB is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT I). We observe that the type of FFIB is described by the
theorem
(OR (ACL2-NUMBERP (FFIB I J K))
(EQUAL (FFIB I J K) J)
(EQUAL (FFIB I J K) K)).
We used primitive type reasoning.
Summary
Form: ( DEFUN FFIB ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
FFIB
ACL2 >>(THEOREM PROBLEM-115A
(EQUAL (FFIB 2 I J) (+ I J))
:HINTS (("Goal" :EXPAND (FFIB 2 I J))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using the :definition FFIB, the
:executable-counterparts of BINARY-+, EQUAL and ZP and primitive type
reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-115A ...)
Rules: ((:DEFINITION FFIB)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-115A
ACL2 >>(THEOREM PROBLEM-115B
(IMPLIES (AND (NATP N) (< 0 N) (NATP I) (NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (- N 1)) I) (* (FIB N) J))))
:HINTS
(("Goal" :INDUCT (FFIB N I J)
:IN-THEORY (ENABLE PROBLEM-115A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (FFIB N I J). This
suggestion was produced using the :induction rule FFIB. If we let
(:P I J N) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ZP N))
(NOT (EQUAL N 1))
(:P J (+ I J) (+ -1 N)))
(:P I J N))
(IMPLIES (AND (NOT (ZP N)) (EQUAL N 1))
(:P I J N))
(IMPLIES (ZP N) (:P I J N))).
This induction is justified by the same argument used to admit FFIB,
namely, the measure (ACL2-COUNT N) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variables I and J are being
instantiated. When applied to the goal at hand the above induction
scheme produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ZP N))
(NOT (EQUAL N 1))
(IMPLIES (AND (NATP (+ -1 N))
(< 0 (+ -1 N))
(NATP J)
(NATP (+ I J)))
(EQUAL (FFIB (+ -1 N) J (+ I J))
(+ (* (FIB (+ -1 -1 N)) J)
(* (FIB (+ -1 N)) (+ I J))))))
(IMPLIES (AND (NATP N) (< 0 N) (NATP I) (NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (+ -1 N)) I)
(* (FIB N) J))))).
By the simple :rewrite rules <-0-+-NEGATIVE-1 and NATP-POSP--1 we reduce
the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (ZP N))
(NOT (EQUAL N 1))
(IMPLIES (AND (POSP N)
(< 1 N)
(NATP J)
(NATP (+ I J)))
(EQUAL (FFIB (+ -1 N) J (+ I J))
(+ (* (FIB (+ -1 -1 N)) J)
(* (FIB (+ -1 N)) (+ I J)))))
(NATP N)
(< 0 N)
(NATP I)
(NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (+ -1 N)) I)
(* (FIB N) J)))).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions FFIB, FIB, FIX and
SYNP, the :executable-counterparts of BINARY-+ and NOT, primitive type
reasoning, the :forward-chaining rules NATP-FC-1 and NATP-FC-2, the
:rewrite rules <-0-+-NEGATIVE-1, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-
OF-*, COMMUTATIVITY-OF-+, DISTRIBUTIVITY, FOLD-CONSTS-IN-+, TIMES-ZERO,
UNICITY-OF-0 and ZP-OPEN and the :type-prescription rule FIB, to the
following two conjectures.
Subgoal *1/3.2
(IMPLIES (AND (NOT (EQUAL N 1))
(<= N 1)
(NATP N)
(< 0 N)
(NATP I)
(NATP J))
(EQUAL (FFIB (+ -1 N) J (+ I J))
(* J (FIB N)))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and POSP-CR, primitive type reasoning and the :forward-
chaining rule POSP-<-1.
Subgoal *1/3.1
(IMPLIES (AND (NOT (EQUAL N 1))
(EQUAL (FFIB (+ -1 N) J (+ I J))
(+ (* I (FIB (+ -1 N)))
(* J (FIB (+ -1 N)))
(* J (FIB (+ -2 N)))))
(NATP N)
(< 0 N)
(NATP I)
(NATP J))
(EQUAL (FFIB (+ -1 N) J (+ I J))
(+ (* J (FIB N))
(* I (FIB (+ -1 N)))))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, POSP-CR and ZP-COMPOUND-RECOGNIZER, the :definition
FIB, primitive type reasoning, the :forward-chaining rules NATP-FC-
2 and POSP-<-1 and the :rewrite rules COMMUTATIVITY-OF-+ and DISTRIBUTIVITY.
Subgoal *1/2
(IMPLIES (AND (NOT (ZP N)) (EQUAL N 1))
(IMPLIES (AND (NATP N) (< 0 N) (NATP I) (NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (+ -1 N)) I)
(* (FIB N) J))))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (ZP N))
(EQUAL N 1)
(NATP N)
(< 0 N)
(NATP I)
(NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (+ -1 N)) I)
(* (FIB N) J)))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions FFIB and FIX, the :executable-counterparts
of <, BINARY-+, EQUAL, FIB, NATP, NOT and ZP, primitive type reasoning,
the :forward-chaining rules NATP-FC-1 and NATP-FC-2 and the :rewrite
rules TIMES-ZERO, UNICITY-OF-0 and UNICITY-OF-1.
Subgoal *1/1
(IMPLIES (ZP N)
(IMPLIES (AND (NATP N) (< 0 N) (NATP I) (NATP J))
(EQUAL (FFIB N I J)
(+ (* (FIB (+ -1 N)) I)
(* (FIB N) J))))).
But we reduce the conjecture to T, by the :compound-recognizer rules
NATP-CR and ZP-COMPOUND-RECOGNIZER and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-115B ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FFIB)
(:DEFINITION FIB)
(:DEFINITION FIX)
(:DEFINITION NOT)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART FIB)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-<-1)
(:INDUCTION FFIB)
(:REWRITE <-0-+-NEGATIVE-1)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-*)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DISTRIBUTIVITY)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE NATP-POSP--1)
(:REWRITE TIMES-ZERO)
(:REWRITE UNICITY-OF-0)
(:REWRITE UNICITY-OF-1)
(:REWRITE ZP-OPEN)
(:TYPE-PRESCRIPTION FIB))
Warnings: None
Time: 0.13 seconds (prove: 0.06, print: 0.05, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-115B
ACL2 >>(THEOREM PROBLEM-115 (EQUAL (FFIB N 0 1) (FIB N))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-115B)
:CASES ((ZP N)))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now split on the term supplied in the hint to produce two new non-
trivial goals.
Subgoal 2
(IMPLIES (NOT (ZP N))
(EQUAL (FFIB N 0 1) (FIB N))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and ZP-COMPOUND-RECOGNIZER, the :definition FIX, primitive
type reasoning, the :rewrite rules COMMUTATIVITY-OF-*, PROBLEM-115B,
TIMES-ZERO, UNICITY-OF-0 and UNICITY-OF-1 and the :type-prescription
rule FIB.
Subgoal 1
(IMPLIES (ZP N)
(EQUAL (FFIB N 0 1) (FIB N))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, the :definitions FFIB and FIB and the
:executable-counterpart of EQUAL.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-115 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION FFIB)
(:DEFINITION FIB)
(:DEFINITION FIX)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE COMMUTATIVITY-OF-*)
(:REWRITE PROBLEM-115B)
(:REWRITE TIMES-ZERO)
(:REWRITE UNICITY-OF-0)
(:REWRITE UNICITY-OF-1)
(:TYPE-PRESCRIPTION FIB))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-115
ACL2 >>(DEFUN ROT (X)
(IF (ENDP X)
NIL (APP (CDR X) (LIST (CAR X)))))
Since ROT is non-recursive, its admission is trivial. We observe that
the type of ROT is described by the theorem
(OR (CONSP (ROT X)) (EQUAL (ROT X) NIL)). We used primitive type reasoning
and the :type-prescription rule APP.
Summary
Form: ( DEFUN ROT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
ROT
ACL2 >>(DEFUN ROTN (N X)
(IF (ZP N) X (ROTN (- N 1) (ROT X))))
The admission of ROTN is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT N). We observe that the type of ROTN is described by the
theorem
(OR (OR (CONSP (ROTN N X)) (EQUAL (ROTN N X) NIL)) (EQUAL (ROTN N X) X)).
We used the :type-prescription rule ROT.
Summary
Form: ( DEFUN ROTN ...)
Rules: ((:TYPE-PRESCRIPTION ROT))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
ROTN
ACL2 >>(THEOREM PROBLEM-116-COUNTEREXAMPLE
(NOT (EQUAL (ROTN (LEN '(1 2 3 . 4)) '(1 2 3 . 4))
'(1 2 3 . 4)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we reduce the conjecture to T, by the :executable-counterparts
of EQUAL, LEN and ROTN.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-116-COUNTEREXAMPLE ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART LEN)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ROTN))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-116-COUNTEREXAMPLE
ACL2 >>(DEFUN ROT-HINT (X Y)
(IF (CONSP X)
(ROT-HINT (CDR X)
(APP Y (CONS (CAR X) NIL)))
Y))
The admission of ROT-HINT is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We observe that the type of ROT-HINT is described
by the theorem (OR (CONSP (ROT-HINT X Y)) (EQUAL (ROT-HINT X Y) Y)).
We used primitive type reasoning and the :type-prescription rule APP.
Summary
Form: ( DEFUN ROT-HINT ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
ROT-HINT
ACL2 >>(THEOREM PROBLEM-116A
(IMPLIES (AND (PROPER X) (PROPER Y))
(EQUAL (ROTN (LEN X) (APP X Y))
(APP Y X)))
:HINTS
(("Goal" :INDUCT (ROT-HINT X Y)
:IN-THEORY
(ENABLE PROBLEM-40 PROBLEM-41 PROBLEM-44C)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (ROT-HINT X Y).
This suggestion was produced using the :induction rule ROT-HINT. If
we let (:P X Y) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (CONSP X)) (:P X Y))
(IMPLIES (AND (CONSP X)
(:P (CDR X) (APP Y (LIST (CAR X)))))
(:P X Y))).
This induction is justified by the same argument used to admit ROT-
HINT, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable Y is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (PROPER X) (PROPER Y))
(EQUAL (ROTN (LEN X) (APP X Y))
(APP Y X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (CONSP X))
(PROPER X)
(PROPER Y))
(EQUAL (ROTN (LEN X) (APP X Y))
(APP Y X))).
But simplification reduces this to T, using the :definitions APP, PROPER
and ROTN, the :executable-counterparts of CONSP, LEN and ZP, primitive
type reasoning, the :rewrite rule PROBLEM-41 and the :type-prescription
rule PROPER.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(IMPLIES (AND (PROPER (CDR X))
(PROPER (APP Y (LIST (CAR X)))))
(EQUAL (ROTN (LEN (CDR X))
(APP (CDR X) (APP Y (LIST (CAR X)))))
(APP (APP Y (LIST (CAR X))) (CDR X)))))
(IMPLIES (AND (PROPER X) (PROPER Y))
(EQUAL (ROTN (LEN X) (APP X Y))
(APP Y X)))).
By the simple :rewrite rules PROBLEM-40 and PROBLEM-44C we reduce the
conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(IMPLIES (AND (PROPER (CDR X))
(PROPER (LIST (CAR X))))
(EQUAL (ROTN (LEN (CDR X))
(APP (CDR X) (APP Y (LIST (CAR X)))))
(APP Y (APP (LIST (CAR X)) (CDR X)))))
(PROPER X)
(PROPER Y))
(EQUAL (ROTN (LEN X) (APP X Y))
(APP Y X))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, the :definitions APP, FIX, LEN, PROPER,
ROT, ROTN and SYNP, the :executable-counterparts of BINARY-+, CONSP
and PROPER, primitive type reasoning, the :rewrite rules CAR-CDR-ELIM,
CAR-CONS, CDR-CONS, FOLD-CONSTS-IN-+, PROBLEM-40 and UNICITY-OF-0 and
the :type-prescription rules LEN and PROPER.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-116A ...)
Rules: ((:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION APP)
(:DEFINITION FIX)
(:DEFINITION LEN)
(:DEFINITION NOT)
(:DEFINITION PROPER)
(:DEFINITION ROT)
(:DEFINITION ROTN)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART LEN)
(:EXECUTABLE-COUNTERPART PROPER)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION ROT-HINT)
(:REWRITE CAR-CDR-ELIM)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE PROBLEM-40)
(:REWRITE PROBLEM-41)
(:REWRITE PROBLEM-44C)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION PROPER))
Warnings: None
Time: 0.09 seconds (prove: 0.03, print: 0.05, other: 0.01)
PROBLEM-116A
ACL2 >>(THEOREM PROBLEM-116
(IMPLIES (PROPER X)
(EQUAL (ROTN (LEN X) X) X))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-41)
:USE
(:INSTANCE PROBLEM-116A (X X)
(Y NIL)))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
We now augment the goal above by adding the hypothesis indicated by
the :USE hint. The hypothesis can be derived from PROBLEM-116A via
instantiation. The augmented goal is shown below.
Goal'
(IMPLIES (IMPLIES (AND (PROPER X) (PROPER NIL))
(EQUAL (ROTN (LEN X) (APP X NIL))
(APP NIL X)))
(IMPLIES (PROPER X)
(EQUAL (ROTN (LEN X) X) X))).
By the :executable-counterpart of PROPER we reduce the conjecture to
Goal''
(IMPLIES (AND (IMPLIES (PROPER X)
(EQUAL (ROTN (LEN X) (APP X NIL))
(APP NIL X)))
(PROPER X))
(EQUAL (ROTN (LEN X) X) X)).
But simplification reduces this to T, using the :definition APP, the
:executable-counterpart of CONSP, the :rewrite rule PROBLEM-41 and
the :type-prescription rule PROPER.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-116 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART PROPER)
(:REWRITE PROBLEM-41)
(:TYPE-PRESCRIPTION PROPER))
Warnings: None
Time: 0.05 seconds (prove: 0.01, print: 0.03, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-116
ACL2 >>(DEFUN N (V)
(COND ((ENDP V) 0)
((CAR V) (+ 1 (* 2 (N (CDR V)))))
(T (* 2 (N (CDR V))))))
The admission of N is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT V). We observe that the type of N is described by the
theorem (AND (INTEGERP (N V)) (<= 0 (N V))). We used primitive type
reasoning.
Summary
Form: ( DEFUN N ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
N
ACL2 >>(DEFUN BAND (P Q)
(IF P (IF Q T NIL) NIL))
Since BAND is non-recursive, its admission is trivial. We observe
that the type of BAND is described by the theorem
(OR (EQUAL (BAND P Q) T) (EQUAL (BAND P Q) NIL)).
Summary
Form: ( DEFUN BAND ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
BAND
ACL2 >>(DEFUN BNOT (P) (IF P NIL T))
Since BNOT is non-recursive, its admission is trivial. We observe
that the type of BNOT is described by the theorem
(OR (EQUAL (BNOT P) T) (EQUAL (BNOT P) NIL)).
Summary
Form: ( DEFUN BNOT ...)
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
BNOT
ACL2 >>(DEFUN BOR (P Q) (IF P T (IF Q T NIL)))
Since BOR is non-recursive, its admission is trivial. We observe that
the type of BOR is described by the theorem
(OR (EQUAL (BOR P Q) T) (EQUAL (BOR P Q) NIL)).
Summary
Form: ( DEFUN BOR ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
BOR
ACL2 >>(DEFUN BXOR (P Q)
(IF P (IF Q NIL T) (IF Q T NIL)))
Since BXOR is non-recursive, its admission is trivial. We observe
that the type of BXOR is described by the theorem
(OR (EQUAL (BXOR P Q) T) (EQUAL (BXOR P Q) NIL)).
Summary
Form: ( DEFUN BXOR ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
BXOR
ACL2 >>(DEFUN BMAJ (P Q C)
(BOR (BAND P Q)
(BOR (BAND P C) (BAND Q C))))
Since BMAJ is non-recursive, its admission is trivial. We observe
that the type of BMAJ is described by the theorem
(OR (EQUAL (BMAJ P Q C) T) (EQUAL (BMAJ P Q C) NIL)). We used the
:type-prescription rule BOR.
Summary
Form: ( DEFUN BMAJ ...)
Rules: ((:TYPE-PRESCRIPTION BOR))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
BMAJ
ACL2 >>(DEFUN VADD1 (X Y C)
(IF (ENDP X)
(CONS C NIL)
(CONS (BXOR (CAR X) (BXOR (CAR Y) C))
(VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))))
The admission of VADD1 is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of VADD1 is described by
the theorem (AND (CONSP (VADD1 X Y C)) (TRUE-LISTP (VADD1 X Y C))).
We used primitive type reasoning.
Summary
Form: ( DEFUN VADD1 ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
VADD1
ACL2 >>(THEOREM PROBLEM-117A
(EQUAL (EQUAL (LEN X) 0)
(NOT (CONSP X)))
:HINTS (("Goal" :INDUCT (LEN X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN X). This suggestion
was produced using the :induction rule LEN. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit LEN,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (EQUAL (LEN X) 0)
(NOT (CONSP X)))).
But simplification reduces this to T, using the :definition LEN and
the :executable-counterparts of EQUAL and NOT.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (EQUAL (LEN (CDR X)) 0)
(NOT (CONSP (CDR X)))))
(EQUAL (EQUAL (LEN X) 0)
(NOT (CONSP X)))).
But simplification reduces this to T, using the :definitions LEN and
NOT, the :executable-counterparts of BINARY-+, EQUAL and NOT, primitive
type reasoning and the :type-prescription rule LEN.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-117A ...)
Rules: ((:DEFINITION LEN)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN)
(:TYPE-PRESCRIPTION LEN))
Warnings: None
Time: 0.07 seconds (prove: 0.02, print: 0.05, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-117A
ACL2 >>(THEOREM PROBLEM-117B
(IMPLIES (EQUAL (LEN X) (LEN Y))
(EQUAL (N (VADD1 X Y C))
(+ (N X) (N Y) (IF C 1 0))))
:HINTS
(("Goal" :INDUCT (VADD1 X Y C)
:IN-THEORY (ENABLE PROBLEM-117A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (VADD1 X Y C). This
suggestion was produced using the :induction rule VADD1. If we let
(:P C X Y) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP X))
(:P (BMAJ (CAR X) (CAR Y) C)
(CDR X)
(CDR Y)))
(:P C X Y))
(IMPLIES (ENDP X) (:P C X Y))).
This induction is justified by the same argument used to admit VADD1,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). Note, however, that the unmeasured variables Y and C are being
instantiated. When applied to the goal at hand the above induction
scheme produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP X))
(IMPLIES (EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X))
(N (CDR Y))
(IF (BMAJ (CAR X) (CAR Y) C) 1 0)))))
(IMPLIES (EQUAL (LEN X) (LEN Y))
(EQUAL (N (VADD1 X Y C))
(+ (N X) (N Y) (IF C 1 0))))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(IMPLIES (EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X))
(N (CDR Y))
(IF (BMAJ (CAR X) (CAR Y) C) 1 0))))
(EQUAL (LEN X) (LEN Y)))
(EQUAL (N (VADD1 X Y C))
(+ (N X) (N Y) (IF C 1 0)))).
This simplifies, using the :definitions BAND, BMAJ, BOR, BXOR, FIX,
LEN, N, SYNP and VADD1, the :executable-counterparts of BINARY-* and
BINARY-+, primitive type reasoning, the :rewrite rules ASSOCIATIVITY-
OF-+, CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+,
DISTRIBUTIVITY, FOLD-CONSTS-IN-+ and UNICITY-OF-0 and the :type-prescription
rules LEN, N and VADD1, to the following 18 conjectures.
Subgoal *1/2.18
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X)
(CAR Y)
C)
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))))
(+ 1 (+ 1 (* 2 (N (CDR X))))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rules ASSOCIATIVITY-OF-+ and LEFT-CANCELLATION-
FOR-+ we reduce the conjecture to
Subgoal *1/2.18'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X)
(CAR Y)
C)
(EQUAL (FIX (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))))
(FIX (+ 1 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.17
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X))
(CAR Y)
C)
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C))))
(+ 1 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.17'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X))
(CAR Y)
C)
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C))))
(+ 1 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.16
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X)
(NOT (CAR Y))
C)
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C))))
(+ 1 (+ 1 (* 2 (N (CDR X))))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rules ASSOCIATIVITY-OF-+ and LEFT-CANCELLATION-
FOR-+ we reduce the conjecture to
Subgoal *1/2.16'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X)
(NOT (CAR Y))
C)
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C))))
(+ 1 1 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.15
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X))
(NOT (CAR Y))
C)
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))))
(+ 1 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.15'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X))
(NOT (CAR Y))
C)
(EQUAL (FIX (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))))
(FIX (+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.14
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X)
(CAR Y)
(NOT C))
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL))))
(+ 0 (+ 1 (* 2 (N (CDR X))))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rules ASSOCIATIVITY-OF-+, LEFT-CANCELLATION-
FOR-+ and UNICITY-OF-0 we reduce the conjecture to
Subgoal *1/2.14'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X)
(CAR Y)
(NOT C))
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL))))
(FIX (+ 1 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.13
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X))
(CAR Y)
(NOT C))
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))))
(+ 0 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rules LEFT-CANCELLATION-FOR-+ and UNICITY-OF-
0 we reduce the conjecture to
Subgoal *1/2.13'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X))
(CAR Y)
(NOT C))
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))))
(FIX (+ (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.12
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X)
(NOT (CAR Y))
(NOT C))
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))))
(+ 0 (+ 1 (* 2 (N (CDR X))))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rules ASSOCIATIVITY-OF-+, LEFT-CANCELLATION-
FOR-+ and UNICITY-OF-0 we reduce the conjecture to
Subgoal *1/2.12'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X)
(NOT (CAR Y))
(NOT C))
(EQUAL (+ 1
(* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))))
(FIX (+ 1 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.11
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X))
(NOT (CAR Y))
(NOT C))
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL))))
(+ 0 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rules LEFT-CANCELLATION-FOR-+ and UNICITY-OF-
0 we reduce the conjecture to
Subgoal *1/2.11'
(IMPLIES (AND (CONSP X)
(NOT (EQUAL (LEN (CDR X)) (LEN (CDR Y))))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X))
(NOT (CAR Y))
(NOT C))
(EQUAL (* 2
(N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL))))
(FIX (+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning and the :type-prescription rule LEN.
Subgoal *1/2.10
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR Y))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.10'
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR Y))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
This simplifies, using the :definitions BAND, BMAJ, BXOR, FIX, N and
VADD1, the :executable-counterparts of BAND, BOR and BXOR, primitive
type reasoning, the :meta rule CANCEL_PLUS-EQUAL-CORRECT, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rules LEN, N and VADD1,
to
Subgoal *1/2.10''
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(EQUAL (N (VADD1 (CDR X) (CDR Y) NIL))
(+ (N (CDR X)) (N (CDR Y))))
(CONSP Y)
(EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(CAR Y))
(EQUAL (* 2 (N (VADD1 (CDR X) (CDR Y) NIL)))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.9
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR Y)))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.9'
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR Y)))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
This simplifies, using the :definitions FIX, N and VADD1, the :executable-
counterparts of BMAJ and BXOR, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the
:type-prescription rules LEN, N and VADD1, to
Subgoal *1/2.9''
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(EQUAL (N (VADD1 (CDR X) (CDR Y) NIL))
(+ (N (CDR X)) (N (CDR Y))))
(CONSP Y)
(EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(NOT (CAR Y)))
(EQUAL (* 2 (N (VADD1 (CDR X) (CDR Y) NIL)))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.8
(IMPLIES (AND (CONSP X)
(CAR X)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR Y))
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.8'
(IMPLIES (AND (CONSP X)
(CAR X)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR Y))
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 (* 2 (N (CDR X)))
1 (* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.7
(IMPLIES (AND (CONSP X)
(CAR X)
(CAR Y)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
C)
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 1 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.7'
(IMPLIES (AND (CONSP X)
(CAR X)
(CAR Y)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
C)
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 1 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.6
(IMPLIES (AND (CONSP X)
(CAR X)
(CAR Y)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT C))
(EQUAL (+ 2 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 0 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rules LEFT-CANCELLATION-FOR-+ and UNICITY-OF-
0 we reduce the conjecture to
Subgoal *1/2.6'
(IMPLIES (AND (CONSP X)
(CAR X)
(CAR Y)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT C))
(EQUAL (FIX (+ (* 2 (N (CDR X))) (* 2 (N (CDR Y)))))
(FIX (FIX (+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))))).
But simplification reduces this to T, using the :definitions BAND,
BMAJ and FIX, the :executable-counterpart of BOR, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-2-OF-+ and COMMUTATIVITY-OF-+ and
the :type-prescription rules LEN and N.
Subgoal *1/2.5
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT (CAR Y))
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT C))
(EQUAL (+ (* 2 (N (CDR X))) (* 2 (N (CDR Y))))
(+ 0 (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
By the simple :rewrite rules LEFT-CANCELLATION-FOR-+ and UNICITY-OF-
0 we reduce the conjecture to
Subgoal *1/2.5'
(IMPLIES (AND (CONSP X)
(NOT (CAR X))
(NOT (CAR Y))
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT C))
(EQUAL (+ (* 2 (N (CDR X))) (* 2 (N (CDR Y))))
(FIX (+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))))).
But simplification reduces this to T, using the :definition FIX, the
:executable-counterpart of BMAJ, primitive type reasoning, the :rewrite
rules COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the :type-prescription
rules LEN and N.
Subgoal *1/2.4
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR Y)))
1 (* 2 (N (CDR X)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.4'
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR Y)))
1 (* 2 (N (CDR X)))))).
This simplifies, using the :definitions BAND, BMAJ, BXOR, FIX, N and
VADD1, the :executable-counterparts of BAND, BOR and BXOR, primitive
type reasoning, the :meta rule CANCEL_PLUS-EQUAL-CORRECT, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rules LEN, N and VADD1,
to
Subgoal *1/2.4''
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(EQUAL (N (VADD1 (CDR X) (CDR Y) NIL))
(+ (N (CDR X)) (N (CDR Y))))
(CONSP Y)
(EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(CAR X))
(EQUAL (* 2 (N (VADD1 (CDR X) (CDR Y) NIL)))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.3
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X)))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR Y)))
(* 2 (N (CDR X)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.3'
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(NOT C)
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) NIL)))
(+ (N (CDR X)) (N (CDR Y)) 0))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X)))
(EQUAL (N (VADD1 X Y NIL))
(+ (* 2 (N (CDR Y)))
(* 2 (N (CDR X)))))).
This simplifies, using the :definitions FIX, N and VADD1, the :executable-
counterparts of BMAJ and BXOR, primitive type reasoning, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the
:type-prescription rules LEN, N and VADD1, to
Subgoal *1/2.3''
(IMPLIES (AND (CONSP X)
(NOT (CAR Y))
(EQUAL (N (VADD1 (CDR X) (CDR Y) NIL))
(+ (N (CDR X)) (N (CDR Y))))
(CONSP Y)
(EQUAL (LEN (CDR X)) (LEN (CDR Y)))
(NOT (CAR X)))
(EQUAL (* 2 (N (VADD1 (CDR X) (CDR Y) NIL)))
(+ (* 2 (N (CDR X)))
(* 2 (N (CDR Y)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(CAR Y)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(CAR X))
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 (* 2 (N (CDR Y)))
1 (* 2 (N (CDR X)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.2'
(IMPLIES (AND (CONSP X)
(CAR Y)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(CAR X))
(EQUAL (+ 3 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 (* 2 (N (CDR Y)))
1 (* 2 (N (CDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule N.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(CAR Y)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (+ 1 (LEN (CDR X)))
(+ 1 (LEN (CDR Y))))
(NOT (CAR X)))
(EQUAL (+ 2 (* 2 (N (CDR X)))
(* 2 (N (CDR Y))))
(+ 2 (* 2 (N (CDR Y)))
(* 2 (N (CDR X)))))).
By the simple :rewrite rule LEFT-CANCELLATION-FOR-+ we reduce the conjecture
to
Subgoal *1/2.1'
(IMPLIES (AND (CONSP X)
(CAR Y)
C
(EQUAL (N (VADD1 (CDR X)
(CDR Y)
(BMAJ (CAR X) (CAR Y) C)))
(+ (N (CDR X)) (N (CDR Y)) 1))
(CONSP Y)
(EQUAL (FIX (LEN (CDR X)))
(FIX (LEN (CDR Y))))
(NOT (CAR X)))
(EQUAL (FIX (+ (* 2 (N (CDR X))) (* 2 (N (CDR Y)))))
(FIX (+ (* 2 (N (CDR Y)))
(* 2 (N (CDR X))))))).
But simplification reduces this to T, using the :definitions BAND,
BMAJ and FIX, the :executable-counterpart of BOR, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-2-OF-+ and COMMUTATIVITY-OF-+ and
the :type-prescription rules LEN and N.
Subgoal *1/1
(IMPLIES (ENDP X)
(IMPLIES (EQUAL (LEN X) (LEN Y))
(EQUAL (N (VADD1 X Y C))
(+ (N X) (N Y) (IF C 1 0))))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP X))
(EQUAL (LEN X) (LEN Y)))
(EQUAL (N (VADD1 X Y C))
(+ (N X) (N Y) (IF C 1 0)))).
But simplification reduces this to T, using the :definitions FIX, LEN,
N, NOT and VADD1, the :executable-counterparts of BINARY-*, BINARY-
+ and N, primitive type reasoning and the :rewrite rules CAR-CONS,
CDR-CONS, PROBLEM-117A and UNICITY-OF-0.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-117B ...)
Rules: ((:DEFINITION BAND)
(:DEFINITION BMAJ)
(:DEFINITION BOR)
(:DEFINITION BXOR)
(:DEFINITION ENDP)
(:DEFINITION FIX)
(:DEFINITION LEN)
(:DEFINITION N)
(:DEFINITION NOT)
(:DEFINITION SYNP)
(:DEFINITION VADD1)
(:EXECUTABLE-COUNTERPART BAND)
(:EXECUTABLE-COUNTERPART BINARY-*)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART BMAJ)
(:EXECUTABLE-COUNTERPART BOR)
(:EXECUTABLE-COUNTERPART BXOR)
(:EXECUTABLE-COUNTERPART N)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION VADD1)
(:META CANCEL_PLUS-EQUAL-CORRECT)
(:REWRITE ASSOCIATIVITY-OF-+)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DISTRIBUTIVITY)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE LEFT-CANCELLATION-FOR-+)
(:REWRITE PROBLEM-117A)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION N)
(:TYPE-PRESCRIPTION VADD1))
Warnings: None
Time: 0.74 seconds (prove: 0.29, print: 0.43, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-117B
ACL2 >>(DEFUN VADD (X Y) (VADD1 X Y NIL))
Since VADD is non-recursive, its admission is trivial. We observe
that the type of VADD is described by the theorem
(AND (CONSP (VADD X Y)) (TRUE-LISTP (VADD X Y))). We used the :type-
prescription rule VADD1.
Summary
Form: ( DEFUN VADD ...)
Rules: ((:TYPE-PRESCRIPTION VADD1))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.01, other: 0.03)
VADD
ACL2 >>(THEOREM PROBLEM-117
(IMPLIES (EQUAL (LEN X) (LEN Y))
(EQUAL (N (VADD X Y)) (+ (N X) (N Y))))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-117B))))
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-117 ...): The :REWRITE
rule generated from PROBLEM-117 will be triggered only by terms containing
the non-recursive function symbol VADD. Unless this function is disabled,
PROBLEM-117 is unlikely ever to be used.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definition VADD we reduce the conjecture to
Goal'
(IMPLIES (EQUAL (LEN X) (LEN Y))
(EQUAL (N (VADD1 X Y NIL))
(+ (N X) (N Y)))).
But simplification reduces this to T, using the :definition FIX, primitive
type reasoning, the :rewrite rules COMMUTATIVITY-OF-+, PROBLEM-117B
and UNICITY-OF-0 and the :type-prescription rule N.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-117 ...)
Rules: ((:DEFINITION FIX)
(:DEFINITION VADD)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE PROBLEM-117B)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION N))
Warnings: Non-rec
Time: 0.05 seconds (prove: 0.00, print: 0.02, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-117
ACL2 >>(MUTUAL-RECURSION (DEFUN FX (X)
(IF (CONSP X)
(CONS (FX (CAR X)) (GX (CDR X)))
X))
(DEFUN GX (X)
(IF (CONSP X)
(CONS (GX (CAR X)) (FX (CDR X)))
X)))
The admission of FX and GX are trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X) for FX and (ACL2-COUNT X) for GX. We could
deduce no constraints on the type of any of the functions in the clique.
However, in normalizing the definitions we used primitive type reasoning.
Summary
Form: ( MUTUAL-RECURSION ( DEFUN FX ...) ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.01, other: 0.03)
(FX GX)
ACL2 >>(DEFUN TREE-COPY (X)
(IF (CONSP X)
(CONS (TREE-COPY (CAR X))
(TREE-COPY (CDR X)))
X))
The admission of TREE-COPY is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We could deduce no constraints on the type
of TREE-COPY. However, in normalizing the definition we used primitive
type reasoning.
Summary
Form: ( DEFUN TREE-COPY ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
TREE-COPY
ACL2 >>(THEOREM PROBLEM-118
(AND (EQUAL (FX X) X) (EQUAL (GX X) X))
:HINTS (("Goal" :INDUCT (TREE-COPY X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (TREE-COPY X). This
suggestion was produced using the :induction rule TREE-COPY. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X)
(:P (CAR X))
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit TREE-
COPY, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(AND (EQUAL (FX X) X)
(EQUAL (GX X) X))).
But simplification reduces this to T, using the :definitions FX and
GX and primitive type reasoning.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(AND (EQUAL (FX (CAR X)) (CAR X))
(EQUAL (GX (CAR X)) (CAR X)))
(AND (EQUAL (FX (CDR X)) (CDR X))
(EQUAL (GX (CDR X)) (CDR X))))
(AND (EQUAL (FX X) X)
(EQUAL (GX X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(EQUAL (FX (CAR X)) (CAR X))
(EQUAL (GX (CAR X)) (CAR X))
(EQUAL (FX (CDR X)) (CDR X))
(EQUAL (GX (CDR X)) (CDR X)))
(AND (EQUAL (FX X) X)
(EQUAL (GX X) X))).
But simplification reduces this to T, using the :definitions FX and
GX, primitive type reasoning and the :rewrite rule CAR-CDR-ELIM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-118 ...)
Rules: ((:DEFINITION FX)
(:DEFINITION GX)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION TREE-COPY)
(:REWRITE CAR-CDR-ELIM))
Warnings: None
Time: 0.15 seconds (prove: 0.13, print: 0.01, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.06 seconds (prove: 0.00, print: 0.00, other: 0.06)
PROBLEM-118
ACL2 >>(DEFUN FZGZ (FN X)
(IF (EQUAL FN 'FZ)
(IF (CONSP X)
(CONS (FZGZ 'FZ (CAR X))
(FZGZ 'GZ (CDR X)))
X)
(IF (CONSP X)
(CONS (FZGZ 'GZ (CAR X))
(FZGZ 'FZ (CDR X)))
X)))
The admission of FZGZ is trivial, using the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We could deduce no constraints on the type of FZGZ.
However, in normalizing the definition we used primitive type reasoning.
Summary
Form: ( DEFUN FZGZ ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.01, other: 0.03)
FZGZ
ACL2 >>(DEFUN FZ (X) (FZGZ 'FZ X))
Since FZ is non-recursive, its admission is trivial. We could deduce
no constraints on the type of FZ.
Summary
Form: ( DEFUN FZ ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
FZ
ACL2 >>(DEFUN GZ (X) (FZGZ 'GZ X))
Since GZ is non-recursive, its admission is trivial. We could deduce
no constraints on the type of GZ.
Summary
Form: ( DEFUN GZ ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
GZ
ACL2 >>(THEOREM PROBLEM-119-A
(EQUAL (FZ X)
(IF (CONSP X)
(CONS (FZ (CAR X)) (GZ (CDR X)))
X))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions FZ and GZ we reduce the conjecture to
Goal'
(EQUAL (FZGZ 'FZ X)
(IF (CONSP X)
(CONS (FZGZ 'FZ (CAR X))
(FZGZ 'GZ (CDR X)))
X)).
But simplification reduces this to T, using the :definition FZGZ, the
:executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-119-A ...)
Rules: ((:DEFINITION FZ)
(:DEFINITION FZGZ)
(:DEFINITION GZ)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.11 seconds (prove: 0.10, print: 0.01, other: 0.00)
PROBLEM-119-A
ACL2 >>(THEOREM PROBLEM-119-B
(EQUAL (GZ X)
(IF (CONSP X)
(CONS (GZ (CAR X)) (FZ (CDR X)))
X))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions FZ and GZ we reduce the conjecture to
Goal'
(EQUAL (FZGZ 'GZ X)
(IF (CONSP X)
(CONS (FZGZ 'GZ (CAR X))
(FZGZ 'FZ (CDR X)))
X)).
But simplification reduces this to T, using the :definition FZGZ, the
:executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-119-B ...)
Rules: ((:DEFINITION FZ)
(:DEFINITION FZGZ)
(:DEFINITION GZ)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.07 seconds (prove: 0.05, print: 0.02, other: 0.00)
PROBLEM-119-B
ACL2 >>(DEFUN EXPR-FN (FN X)
(IF (EQUAL FN 'EXPR)
(IF (ATOM X)
(SYMBOLP X)
(AND (SYMBOLP (CAR X))
(EXPR-FN 'LIST (CDR X))))
(IF (ATOM X)
(EQUAL X NIL)
(AND (EXPR-FN 'EXPR (CAR X))
(EXPR-FN 'LIST (CDR X))))))
The admission of EXPR-FN is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X). We observe that the type of EXPR-FN is described by
the theorem (OR (EQUAL (EXPR-FN FN X) T) (EQUAL (EXPR-FN FN X) NIL)).
We used primitive type reasoning.
Summary
Form: ( DEFUN EXPR-FN ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
EXPR-FN
ACL2 >>(DEFUN EXPR (X) (EXPR-FN 'EXPR X))
Since EXPR is non-recursive, its admission is trivial. We observe
that the type of EXPR is described by the theorem
(OR (EQUAL (EXPR X) T) (EQUAL (EXPR X) NIL)). We used the :type-prescription
rule EXPR-FN.
Summary
Form: ( DEFUN EXPR ...)
Rules: ((:TYPE-PRESCRIPTION EXPR-FN))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
EXPR
ACL2 >>(DEFUN EXPR-LIST (X) (EXPR-FN 'LIST X))
Since EXPR-LIST is non-recursive, its admission is trivial. We observe
that the type of EXPR-LIST is described by the theorem
(OR (EQUAL (EXPR-LIST X) T) (EQUAL (EXPR-LIST X) NIL)). We used the
:type-prescription rule EXPR-FN.
Summary
Form: ( DEFUN EXPR-LIST ...)
Rules: ((:TYPE-PRESCRIPTION EXPR-FN))
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
EXPR-LIST
ACL2 >>(THEOREM PROBLEM-120-A
(EQUAL (EXPR X)
(IF (ATOM X)
(SYMBOLP X)
(AND (SYMBOLP (CAR X))
(EXPR-LIST (CDR X)))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions EXPR and EXPR-LIST we reduce the conjecture
to
Goal'
(EQUAL (EXPR-FN 'EXPR X)
(COND ((ATOM X) (SYMBOLP X))
((SYMBOLP (CAR X))
(EXPR-FN 'LIST (CDR X)))
(T NIL))).
But simplification reduces this to T, using the :definitions ATOM and
EXPR-FN, the :executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-120-A ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION EXPR)
(:DEFINITION EXPR-FN)
(:DEFINITION EXPR-LIST)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.01, other: 0.00)
PROBLEM-120-A
ACL2 >>(THEOREM PROBLEM-120-B
(EQUAL (EXPR-LIST X)
(IF (ATOM X)
(EQUAL X NIL)
(AND (EXPR (CAR X))
(EXPR-LIST (CDR X)))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions EXPR and EXPR-LIST we reduce the conjecture
to
Goal'
(EQUAL (EXPR-FN 'LIST X)
(COND ((ATOM X) (EQUAL X NIL))
((EXPR-FN 'EXPR (CAR X))
(EXPR-FN 'LIST (CDR X)))
(T NIL))).
But simplification reduces this to T, using the :definitions ATOM and
EXPR-FN, the :executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-120-B ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION EXPR)
(:DEFINITION EXPR-FN)
(:DEFINITION EXPR-LIST)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.07 seconds (prove: 0.07, print: 0.00, other: 0.00)
PROBLEM-120-B
ACL2 >>(DEFUN SUBSTITUTION (S)
(IF (ENDP S)
(EQUAL S NIL)
(AND (TRUE-LISTP (CAR S))
(EQUAL (LEN (CAR S)) 2)
(SYMBOLP (CAR (CAR S)))
(EXPR (CAR (CDR (CAR S))))
(SUBSTITUTION (CDR S)))))
The admission of SUBSTITUTION is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT S). We observe that the type of SUBSTITUTION is
described by the theorem
(OR (EQUAL (SUBSTITUTION S) T) (EQUAL (SUBSTITUTION S) NIL)). We used
primitive type reasoning.
Summary
Form: ( DEFUN SUBSTITUTION ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
SUBSTITUTION
ACL2 >>(DEFUN LOOKUP (VAR ALIST)
(IF (ENDP ALIST)
VAR
(IF (EQUAL VAR (CAR (CAR ALIST)))
(CAR (CDR (CAR ALIST)))
(LOOKUP VAR (CDR ALIST)))))
The admission of LOOKUP is trivial, using the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT ALIST). We could deduce no constraints on the type of
LOOKUP.
Summary
Form: ( DEFUN LOOKUP ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
LOOKUP
ACL2 >>(DEFUN SLASH-FN (FN X S)
(IF (EQUAL FN 'EXPR)
(IF (ATOM X)
(LOOKUP X S)
(CONS (CAR X)
(SLASH-FN 'LIST (CDR X) S)))
(IF (ATOM X)
NIL
(CONS (SLASH-FN 'EXPR (CAR X) S)
(SLASH-FN 'LIST (CDR X) S)))))
The admission of SLASH-FN is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We could deduce no constraints on the type
of SLASH-FN.
Summary
Form: ( DEFUN SLASH-FN ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
SLASH-FN
ACL2 >>(DEFUN SLASH (X S) (SLASH-FN 'EXPR X S))
Since SLASH is non-recursive, its admission is trivial. We could deduce
no constraints on the type of SLASH.
Summary
Form: ( DEFUN SLASH ...)
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
SLASH
ACL2 >>(DEFUN SLASH-LIST (LST S)
(SLASH-FN 'LIST LST S))
Since SLASH-LIST is non-recursive, its admission is trivial. We could
deduce no constraints on the type of SLASH-LIST.
Summary
Form: ( DEFUN SLASH-LIST ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
SLASH-LIST
ACL2 >>(THEOREM PROBLEM-122-A
(EQUAL (SLASH X S)
(IF (ATOM X)
(LOOKUP X S)
(CONS (CAR X) (SLASH-LIST (CDR X) S))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions SLASH and SLASH-LIST we reduce the conjecture
to
Goal'
(EQUAL (SLASH-FN 'EXPR X S)
(IF (ATOM X)
(LOOKUP X S)
(CONS (CAR X)
(SLASH-FN 'LIST (CDR X) S)))).
But simplification reduces this to T, using the :definitions ATOM and
SLASH-FN, the :executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-122-A ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION SLASH)
(:DEFINITION SLASH-FN)
(:DEFINITION SLASH-LIST)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.08 seconds (prove: 0.07, print: 0.01, other: 0.00)
PROBLEM-122-A
ACL2 >>(THEOREM PROBLEM-122-B
(EQUAL (SLASH-LIST LST S)
(IF (ATOM LST)
NIL
(CONS (SLASH (CAR LST) S)
(SLASH-LIST (CDR LST) S))))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions SLASH and SLASH-LIST we reduce the conjecture
to
Goal'
(EQUAL (SLASH-FN 'LIST LST S)
(AND (NOT (ATOM LST))
(CONS (SLASH-FN 'EXPR (CAR LST) S)
(SLASH-FN 'LIST (CDR LST) S)))).
But simplification reduces this to T, using the :definitions ATOM and
SLASH-FN, the :executable-counterpart of EQUAL and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-122-B ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION SLASH)
(:DEFINITION SLASH-FN)
(:DEFINITION SLASH-LIST)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.14 seconds (prove: 0.12, print: 0.01, other: 0.01)
PROBLEM-122-B
ACL2 >>(THEOREM PROBLEM-123A
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S)))
:HINTS (("Goal" :INDUCT (LOOKUP X S))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LOOKUP X S). This
suggestion was produced using the :induction rule LOOKUP. If we let
(:P S X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP S))
(NOT (EQUAL X (CAAR S)))
(:P (CDR S) X))
(:P S X))
(IMPLIES (AND (NOT (ENDP S)) (EQUAL X (CAAR S)))
(:P S X))
(IMPLIES (ENDP S) (:P S X))).
This induction is justified by the same argument used to admit LOOKUP,
namely, the measure (ACL2-COUNT S) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP S))
(NOT (EQUAL X (CAAR S)))
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION (CDR S)))
(EXPR-FN 'EXPR (LOOKUP X (CDR S)))))
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP S)
(NOT (EQUAL X (CAAR S)))
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION (CDR S)))
(EXPR-FN 'EXPR (LOOKUP X (CDR S))))
(SYMBOLP X)
(SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S))).
But simplification reduces this to T, using the :definitions EXPR,
LOOKUP and SUBSTITUTION, primitive type reasoning and the :type-prescription
rule EXPR-FN.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP S)) (EQUAL X (CAAR S)))
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP S)
(EQUAL X (CAAR S))
(SYMBOLP X)
(SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S))).
This simplifies, using the :definition LOOKUP and primitive type reasoning,
to
Subgoal *1/2''
(IMPLIES (AND (CONSP S)
(SYMBOLP (CAAR S))
(SUBSTITUTION S))
(EXPR-FN 'EXPR (CADAR S))).
But simplification reduces this to T, using the :definitions EXPR,
LEN, SUBSTITUTION and TRUE-LISTP and primitive type reasoning.
Subgoal *1/1
(IMPLIES (ENDP S)
(IMPLIES (AND (SYMBOLP X) (SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP S))
(SYMBOLP X)
(SUBSTITUTION S))
(EXPR-FN 'EXPR (LOOKUP X S))).
But simplification reduces this to T, using the :definitions EXPR-FN,
LOOKUP and SUBSTITUTION, the :executable-counterparts of CONSP and
EQUAL and primitive type reasoning.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-123A depends upon the :type-prescription rule
EXPR-FN.
Summary
Form: ( DEFTHM PROBLEM-123A ...)
Rules: ((:DEFINITION ENDP)
(:DEFINITION EXPR)
(:DEFINITION EXPR-FN)
(:DEFINITION LEN)
(:DEFINITION LOOKUP)
(:DEFINITION NOT)
(:DEFINITION SUBSTITUTION)
(:DEFINITION TRUE-LISTP)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LOOKUP)
(:TYPE-PRESCRIPTION EXPR-FN))
Warnings: None
Time: 0.83 seconds (prove: 0.77, print: 0.06, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-123A
ACL2 >>(THEOREM PROBLEM-123B
(IMPLIES (AND (EXPR-FN FN X) (SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S)))
:HINTS
(("Goal" :INDUCT (SLASH-FN FN X S)
:IN-THEORY (ENABLE PROBLEM-123A))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (SLASH-FN FN X S).
This suggestion was produced using the :induction rule SLASH-FN. If
we let (:P FN S X) denote *1 above then the induction scheme we'll
use is
(AND (IMPLIES (AND (NOT (EQUAL FN 'EXPR))
(NOT (ATOM X))
(:P 'EXPR S (CAR X))
(:P 'LIST S (CDR X)))
(:P FN S X))
(IMPLIES (AND (NOT (EQUAL FN 'EXPR)) (ATOM X))
(:P FN S X))
(IMPLIES (AND (EQUAL FN 'EXPR)
(NOT (ATOM X))
(:P 'LIST S (CDR X)))
(:P FN S X))
(IMPLIES (AND (EQUAL FN 'EXPR) (ATOM X))
(:P FN S X))).
This induction is justified by the same argument used to admit SLASH-
FN, namely, the measure (ACL2-COUNT X) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable FN is being instantiated\
. When applied to the goal at hand the above induction scheme produces
the following four nontautological subgoals.
Subgoal *1/4
(IMPLIES (AND (NOT (EQUAL FN 'EXPR))
(NOT (ATOM X))
(IMPLIES (AND (EXPR-FN 'EXPR (CAR X))
(SUBSTITUTION S))
(EXPR-FN 'EXPR
(SLASH-FN 'EXPR (CAR X) S)))
(IMPLIES (AND (EXPR-FN 'LIST (CDR X))
(SUBSTITUTION S))
(EXPR-FN 'LIST
(SLASH-FN 'LIST (CDR X) S))))
(IMPLIES (AND (EXPR-FN FN X) (SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S)))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/4'
(IMPLIES (AND (NOT (EQUAL FN 'EXPR))
(CONSP X)
(IMPLIES (AND (EXPR-FN 'EXPR (CAR X))
(SUBSTITUTION S))
(EXPR-FN 'EXPR
(SLASH-FN 'EXPR (CAR X) S)))
(IMPLIES (AND (EXPR-FN 'LIST (CDR X))
(SUBSTITUTION S))
(EXPR-FN 'LIST
(SLASH-FN 'LIST (CDR X) S)))
(EXPR-FN FN X)
(SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S))).
But simplification reduces this to T, using the :definitions EXPR-FN
and SLASH-FN, primitive type reasoning, the :rewrite rules CAR-CONS
and CDR-CONS and the :type-prescription rules EXPR-FN and SUBSTITUTION.
Subgoal *1/3
(IMPLIES (AND (NOT (EQUAL FN 'EXPR)) (ATOM X))
(IMPLIES (AND (EXPR-FN FN X) (SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S)))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (EQUAL FN 'EXPR))
(NOT (CONSP X))
(EXPR-FN FN X)
(SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S))).
But simplification reduces this to T, using the :definitions EXPR-FN
and SLASH-FN, the :executable-counterparts of CONSP and EQUAL and primitive
type reasoning.
Subgoal *1/2
(IMPLIES (AND (EQUAL FN 'EXPR)
(NOT (ATOM X))
(IMPLIES (AND (EXPR-FN 'LIST (CDR X))
(SUBSTITUTION S))
(EXPR-FN 'LIST
(SLASH-FN 'LIST (CDR X) S))))
(IMPLIES (AND (EXPR-FN FN X) (SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S)))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (EQUAL FN 'EXPR)
(CONSP X)
(IMPLIES (AND (EXPR-FN 'LIST (CDR X))
(SUBSTITUTION S))
(EXPR-FN 'LIST
(SLASH-FN 'LIST (CDR X) S)))
(EXPR-FN FN X)
(SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S))).
But simplification reduces this to T, using the :definitions EXPR-FN
and SLASH-FN, the :executable-counterpart of EQUAL, primitive type
reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-
prescription rules EXPR-FN and SUBSTITUTION.
Subgoal *1/1
(IMPLIES (AND (EQUAL FN 'EXPR) (ATOM X))
(IMPLIES (AND (EXPR-FN FN X) (SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S)))).
By the simple :definition ATOM we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (EQUAL FN 'EXPR)
(NOT (CONSP X))
(EXPR-FN FN X)
(SUBSTITUTION S))
(EXPR-FN FN (SLASH-FN FN X S))).
But simplification reduces this to T, using the :definitions EXPR-FN
and SLASH-FN, the :executable-counterpart of EQUAL, the :rewrite rule
PROBLEM-123A and the :type-prescription rule SUBSTITUTION.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-123B depends upon the :type-prescription rule
EXPR-FN.
Summary
Form: ( DEFTHM PROBLEM-123B ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION EXPR-FN)
(:DEFINITION NOT)
(:DEFINITION SLASH-FN)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION SLASH-FN)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-123A)
(:TYPE-PRESCRIPTION EXPR-FN)
(:TYPE-PRESCRIPTION SUBSTITUTION))
Warnings: None
Time: 0.86 seconds (prove: 0.61, print: 0.23, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-123B
ACL2 >>(THEOREM PROBLEM-123
(IMPLIES (AND (EXPR X) (SUBSTITUTION S))
(EXPR (SLASH X S)))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-123B))))
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-123 ...): The :REWRITE
rule generated from PROBLEM-123 will be triggered only by terms containing
the non-recursive function symbols EXPR and SLASH. Unless these functions
are disabled, PROBLEM-123 is unlikely ever to be used.
ACL2 Warning [Subsume] in ( DEFTHM PROBLEM-123 ...): The previously
added rule EXPR subsumes the newly proposed :REWRITE rule PROBLEM-123,
in the sense that the old rule rewrites a more general target. Because
the new rule will be tried first, it may nonetheless find application.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions EXPR and SLASH we reduce the conjecture
to
Goal'
(IMPLIES (AND (EXPR-FN 'EXPR X) (SUBSTITUTION S))
(EXPR-FN 'EXPR (SLASH-FN 'EXPR X S))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
123B and the :type-prescription rules EXPR-FN and SUBSTITUTION.
Q.E.D.
The storage of PROBLEM-123 depends upon the :type-prescription rule
EXPR.
Summary
Form: ( DEFTHM PROBLEM-123 ...)
Rules: ((:DEFINITION EXPR)
(:DEFINITION SLASH)
(:REWRITE PROBLEM-123B)
(:TYPE-PRESCRIPTION EXPR)
(:TYPE-PRESCRIPTION EXPR-FN)
(:TYPE-PRESCRIPTION SUBSTITUTION))
Warnings: Subsume and Non-rec
Time: 0.11 seconds (prove: 0.09, print: 0.00, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-123
ACL2 >>(DEFUN F5 (X)
(DECLARE (XARGS :MEASURE (NFIX X)))
(IF (ZP X)
0
(IF (< (NFIX (F5 (- X 1))) (NFIX X))
(+ 1 (F5 (F5 (- X 1))))
'UNDEF)))
For the admission of F5 we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(NFIX X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (NFIX X))
(IMPLIES (NOT (ZP X))
(O< (NFIX (+ -1 X)) (NFIX X)))
(IMPLIES (AND (NOT (ZP X))
(< (NFIX (F5 (+ -1 X))) (NFIX X)))
(O< (NFIX (F5 (+ -1 X))) (NFIX X)))).
By case analysis we reduce the conjecture to the following three conjectures.
Subgoal 3
(O-P (NFIX X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :definition NFIX and the :rewrite
rule O-P-DEF-O-FINP-1.
Subgoal 2
(IMPLIES (NOT (ZP X))
(O< (NFIX (+ -1 X)) (NFIX X))).
But simplification reduces this to T, using the :compound-recognizer
rules O-FINP-CR and ZP-COMPOUND-RECOGNIZER, the :definition NFIX, linear
arithmetic, primitive type reasoning and the :rewrite rules <-+-NEGATIVE-
0-1 and O-FINP-<.
Subgoal 1
(IMPLIES (AND (NOT (ZP X))
(< (NFIX (F5 (+ -1 X))) (NFIX X)))
(O< (NFIX (F5 (+ -1 X))) (NFIX X))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and ZP-COMPOUND-RECOGNIZER, the :definition NFIX, the
:executable-counterpart of NOT, primitive type reasoning and the :rewrite
rules |0 < a = ~(a = 0)|, O-FINP-< and O-P-DEF-O-FINP-1.
Q.E.D.
That completes the proof of the measure theorem for F5. Thus, we admit
this function under the principle of definition. We observe that the
type of F5 is described by the theorem
(OR (AND (INTEGERP (F5 X)) (<= 0 (F5 X)))
(AND (SYMBOLP (F5 X))
(NOT (EQUAL (F5 X) T))
(NOT (EQUAL (F5 X) NIL)))).
We used primitive type reasoning.
Summary
Form: ( DEFUN F5 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION NFIX)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE |0 < a = ~(a = 0)|)
(:REWRITE <-+-NEGATIVE-0-1)
(:REWRITE O-FINP-<)
(:REWRITE O-P-DEF-O-FINP-1))
Warnings: None
Time: 0.14 seconds (prove: 0.01, print: 0.11, other: 0.02)
F5
ACL2 >>(THEOREM PROBLEM-127
(IMPLIES (NATP X) (<= (F5 X) X))
:HINTS (("Goal" :INDUCT (F5 X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (F5 X). This suggestion
was produced using the :induction rule F5. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ZP X))
(<= (NFIX X) (NFIX (F5 (+ -1 X))))
(:P (+ -1 X)))
(:P X))
(IMPLIES (AND (NOT (ZP X))
(< (NFIX (F5 (+ -1 X))) (NFIX X))
(:P (+ -1 X))
(:P (F5 (+ -1 X))))
(:P X))
(IMPLIES (ZP X) (:P X))).
This induction is justified by the same argument used to admit F5,
namely, the measure (NFIX X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ZP X))
(<= (NFIX X) (NFIX (F5 (+ -1 X))))
(IMPLIES (NATP (+ -1 X))
(<= (F5 (+ -1 X)) (+ -1 X))))
(IMPLIES (NATP X) (<= (F5 X) X))).
By the simple :rewrite rule NATP-POSP--1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (ZP X))
(<= (NFIX X) (NFIX (F5 (+ -1 X))))
(IMPLIES (POSP X)
(<= (F5 (+ -1 X)) (+ -1 X)))
(NATP X))
(<= (F5 X) X)).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions F5, NFIX and NOT, primitive
type reasoning, the :forward-chaining rules POSP-FC-1 and POSP-FC-2,
the :rewrite rule DEFAULT-<-2 and the :type-prescription rule F5, to
Subgoal *1/3''
(IMPLIES (AND (NOT (ZP X))
(INTEGERP (F5 (+ -1 X)))
(<= X (F5 (+ -1 X)))
(<= (F5 (+ -1 X)) (+ -1 X)))
(<= 0 X)).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER and primitive type reasoning.
Subgoal *1/2
(IMPLIES (AND (NOT (ZP X))
(< (NFIX (F5 (+ -1 X))) (NFIX X))
(IMPLIES (NATP (+ -1 X))
(<= (F5 (+ -1 X)) (+ -1 X)))
(IMPLIES (NATP (F5 (+ -1 X)))
(<= (F5 (F5 (+ -1 X))) (F5 (+ -1 X)))))
(IMPLIES (NATP X) (<= (F5 X) X))).
By the simple :rewrite rule NATP-POSP--1 we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NOT (ZP X))
(< (NFIX (F5 (+ -1 X))) (NFIX X))
(IMPLIES (POSP X)
(<= (F5 (+ -1 X)) (+ -1 X)))
(IMPLIES (NATP (F5 (+ -1 X)))
(<= (F5 (F5 (+ -1 X))) (F5 (+ -1 X))))
(NATP X))
(<= (F5 X) X)).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions F5, NFIX and NOT, primitive
type reasoning, the :forward-chaining rules POSP-FC-1 and POSP-FC-2,
the :rewrite rules <-+-NEGATIVE-0-1, DEFAULT-<-1 and DEFAULT-<-2 and
the :type-prescription rule F5, to the following two conjectures.
Subgoal *1/2.2
(IMPLIES (AND (NOT (ZP X))
(INTEGERP (F5 (+ -1 X)))
(< (F5 (+ -1 X)) X)
(<= (F5 (+ -1 X)) (+ -1 X))
(<= (F5 (F5 (+ -1 X))) (F5 (+ -1 X))))
(<= (+ 1 (F5 (F5 (+ -1 X)))) X)).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule F5.
Subgoal *1/2.1
(IMPLIES (AND (NOT (ZP X))
(NOT (INTEGERP (F5 (+ -1 X))))
(< 0 X))
(<= (+ 1 (F5 (F5 (+ -1 X)))) X)).
This simplifies, using the :compound-recognizer rule ZP-COMPOUND-RECOGNIZER,
the :definition F5, the :executable-counterpart of BINARY-+ and the
:type-prescription rule F5, to
Subgoal *1/2.1'
(IMPLIES (AND (NOT (ZP X))
(NOT (INTEGERP (F5 (+ -1 X))))
(< 0 X))
(<= 1 X)).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER and primitive type reasoning.
Subgoal *1/1
(IMPLIES (ZP X)
(IMPLIES (NATP X) (<= (F5 X) X))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (ZP X) (NATP X))
(<= (F5 X) X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and ZP-COMPOUND-RECOGNIZER, the :executable-counterparts
of <, F5, NATP, NOT and ZP, linear arithmetic and the :forward-chaining
rule NATP-FC-1.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-127 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION F5)
(:DEFINITION NFIX)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART F5)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:INDUCTION F5)
(:REWRITE <-+-NEGATIVE-0-1)
(:REWRITE DEFAULT-<-1)
(:REWRITE DEFAULT-<-2)
(:REWRITE NATP-POSP--1)
(:TYPE-PRESCRIPTION F5))
Warnings: None
Time: 0.14 seconds (prove: 0.05, print: 0.09, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-127
ACL2 >>(THEOREM PROBLEM-128
(EQUAL (F5 X)
(IF (ZP X) 0 (+ 1 (F5 (F5 (- X 1))))))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-127)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
This simplifies, using the :compound-recognizer rule ZP-COMPOUND-RECOGNIZER,
the :definitions F5 and NFIX, primitive type reasoning and the :type-
prescription rule F5, to the following two conjectures.
Subgoal 2
(IMPLIES (AND (NOT (ZP X))
(INTEGERP (F5 (+ -1 X)))
(<= X (F5 (+ -1 X))))
(EQUAL 'UNDEF
(+ 1 (F5 (F5 (+ -1 X)))))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive
type reasoning and the :linear rule PROBLEM-127.
Subgoal 1
(IMPLIES (AND (NOT (ZP X))
(NOT (INTEGERP (F5 (+ -1 X))))
(<= X 0))
(EQUAL 'UNDEF
(+ 1 (F5 (F5 (+ -1 X)))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER and primitive type reasoning.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-128 ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION F5)
(:DEFINITION NFIX)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:LINEAR PROBLEM-127)
(:TYPE-PRESCRIPTION F5))
Warnings: None
Time: 0.05 seconds (prove: 0.02, print: 0.01, other: 0.02)
PROBLEM-128
ACL2 >>(DEFUN FLATTEN-M (X)
(IF (CONSP X)
(IF (CONSP (CAR X))
(CONS (CAR (CAR X))
(CONS (CDR (CAR X))
(FLATTEN-M (CDR X))))
(CONS (CAR X) (FLATTEN-M (CDR X))))
NIL))
The admission of FLATTEN-M is trivial, using the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X). We observe that the type of FLATTEN-M is described
by the theorem (TRUE-LISTP (FLATTEN-M X)). We used primitive type
reasoning.
Summary
Form: ( DEFUN FLATTEN-M ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.01, other: 0.02)
FLATTEN-M
ACL2 >>(THEOREM PROBLEM-129A
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G)))
:HINTS
(("Goal" :INDUCT (NTH PTR G)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A
PROBLEM-112I PROBLEM-114E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NTH PTR G). This
suggestion was produced using the :induction rule NTH. If we let
(:P G PTR) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(:P (CDR G) (+ -1 PTR)))
(:P G PTR))
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(:P G PTR))
(IMPLIES (ENDP G) (:P G PTR))).
This induction is justified by the same argument used to admit NTH,
namely, the measure (ACL2-COUNT PTR) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable G is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(IMPLIES (AND (NATP (+ -1 PTR))
(< (+ -1 PTR) (LEN (CDR G)))
(CONSP (NTH (+ -1 PTR) (CDR G))))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP and the simple :rewrite rule NATP-POSP-
-1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(IMPLIES (AND (POSP PTR)
(< (+ -1 PTR) (LEN (CDR G)))
(CONSP (NTH (+ -1 PTR) (CDR G))))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G))))
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions FLATTEN-M, LEN and
NTH and the :forward-chaining rules POSP-FC-1 and POSP-FC-2, to the
following four conjectures.
Subgoal *1/3.4
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(CONSP (CAR G)))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.3
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(NOT (CONSP (CAR G))))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.2
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(CONSP (CAR G)))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/3.1
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(NOT (CONSP (CAR G))))
(MEM (CAR (NTH (+ -1 PTR) (CDR G)))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP G)
(ZP PTR)
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR and ZP-
COMPOUND-RECOGNIZER, the :executable-counterparts of NATP, NOT and
ZP, linear arithmetic and the :forward-chaining rule NATP-FC-1, to
Subgoal *1/2''
(IMPLIES (AND (CONSP G)
(< 0 (LEN G))
(CONSP (NTH 0 G)))
(MEM (CAR (NTH 0 G)) (FLATTEN-M G))).
By the simple :rewrite rule PROBLEM-112I we reduce the conjecture to
Subgoal *1/2'''
(IMPLIES (AND (CONSP G) (CONSP (NTH 0 G)))
(MEM (CAR (NTH 0 G)) (FLATTEN-M G))).
This simplifies, using the :definition NTH and the :executable-counterpart
of ZP, to
Subgoal *1/2'4'
(IMPLIES (AND (CONSP G) (CONSP (CAR G)))
(MEM (CAAR G) (FLATTEN-M G))).
The destructor terms (CAR G) and (CDR G) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace G by (CONS G1 G2), (CAR G)
by G1 and (CDR G) by G2. (2) Use CAR-CDR-ELIM, again, to replace G1
by (CONS G3 G4), (CAR G1) by G3 and (CDR G1) by G4. These steps
produce the following goal.
Subgoal *1/2'5'
(IMPLIES (AND (CONSP (CONS G3 G4))
(CONSP (CONS (CONS G3 G4) G2)))
(MEM G3 (FLATTEN-M (CONS (CONS G3 G4) G2)))).
But simplification reduces this to T, using the :definitions FLATTEN-
M and MEM, primitive type reasoning, the :rewrite rules CAR-CONS and
CDR-CONS and the :type-prescription rule FLATTEN-M.
Subgoal *1/1
(IMPLIES (ENDP G)
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP G))
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CAR (NTH PTR G)) (FLATTEN-M G))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition LEN and the :forward-chaining rules NATP-
FC-1 and NATP-FC-2.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-129A depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-129A ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ENDP)
(:DEFINITION FLATTEN-M)
(:DEFINITION LEN)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION NTH)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:INDUCTION NTH)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE NATP-POSP--1)
(:REWRITE PROBLEM-112I)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION FLATTEN-M)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.71 seconds (prove: 0.61, print: 0.09, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-129A
ACL2 >>(THEOREM PROBLEM-129B
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G)))
:HINTS
(("Goal" :INDUCT (NTH PTR G)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A
PROBLEM-112I PROBLEM-114E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NTH PTR G). This
suggestion was produced using the :induction rule NTH. If we let
(:P G PTR) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(:P (CDR G) (+ -1 PTR)))
(:P G PTR))
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(:P G PTR))
(IMPLIES (ENDP G) (:P G PTR))).
This induction is justified by the same argument used to admit NTH,
namely, the measure (ACL2-COUNT PTR) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable G is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(IMPLIES (AND (NATP (+ -1 PTR))
(< (+ -1 PTR) (LEN (CDR G)))
(CONSP (NTH (+ -1 PTR) (CDR G))))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP and the simple :rewrite rule NATP-POSP-
-1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(IMPLIES (AND (POSP PTR)
(< (+ -1 PTR) (LEN (CDR G)))
(CONSP (NTH (+ -1 PTR) (CDR G))))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G))))
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions FLATTEN-M, LEN and
NTH and the :forward-chaining rules POSP-FC-1 and POSP-FC-2, to the
following four conjectures.
Subgoal *1/3.4
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(CONSP (CAR G)))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.3
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(NOT (CONSP (CAR G))))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.2
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(CONSP (CAR G)))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/3.1
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(CONSP (NTH (+ -1 PTR) (CDR G)))
(NOT (CONSP (CAR G))))
(MEM (CDR (NTH (+ -1 PTR) (CDR G)))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP G)
(ZP PTR)
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR and ZP-
COMPOUND-RECOGNIZER, the :executable-counterparts of NATP, NOT and
ZP, linear arithmetic and the :forward-chaining rule NATP-FC-1, to
Subgoal *1/2''
(IMPLIES (AND (CONSP G)
(< 0 (LEN G))
(CONSP (NTH 0 G)))
(MEM (CDR (NTH 0 G)) (FLATTEN-M G))).
By the simple :rewrite rule PROBLEM-112I we reduce the conjecture to
Subgoal *1/2'''
(IMPLIES (AND (CONSP G) (CONSP (NTH 0 G)))
(MEM (CDR (NTH 0 G)) (FLATTEN-M G))).
This simplifies, using the :definition NTH and the :executable-counterpart
of ZP, to
Subgoal *1/2'4'
(IMPLIES (AND (CONSP G) (CONSP (CAR G)))
(MEM (CDAR G) (FLATTEN-M G))).
The destructor terms (CAR G) and (CDR G) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace G by (CONS G1 G2), (CAR G)
by G1 and (CDR G) by G2. (2) Use CAR-CDR-ELIM, again, to replace G1
by (CONS G3 G4), (CAR G1) by G3 and (CDR G1) by G4. These steps
produce the following goal.
Subgoal *1/2'5'
(IMPLIES (AND (CONSP (CONS G3 G4))
(CONSP (CONS (CONS G3 G4) G2)))
(MEM G4 (FLATTEN-M (CONS (CONS G3 G4) G2)))).
But simplification reduces this to T, using the :definitions FLATTEN-
M and MEM, primitive type reasoning, the :rewrite rules CAR-CONS and
CDR-CONS and the :type-prescription rule FLATTEN-M.
Subgoal *1/1
(IMPLIES (ENDP G)
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP G))
(NATP PTR)
(< PTR (LEN G))
(CONSP (NTH PTR G)))
(MEM (CDR (NTH PTR G)) (FLATTEN-M G))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition LEN and the :forward-chaining rules NATP-
FC-1 and NATP-FC-2.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-129B depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-129B ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ENDP)
(:DEFINITION FLATTEN-M)
(:DEFINITION LEN)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION NTH)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:INDUCTION NTH)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE NATP-POSP--1)
(:REWRITE PROBLEM-112I)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION FLATTEN-M)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.80 seconds (prove: 0.65, print: 0.12, other: 0.03)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-129B
ACL2 >>(THEOREM PROBLEM-129C
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G)))
:HINTS
(("Goal" :INDUCT (NTH PTR G)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A
PROBLEM-112I PROBLEM-114E))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (NTH PTR G). This
suggestion was produced using the :induction rule NTH. If we let
(:P G PTR) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(:P (CDR G) (+ -1 PTR)))
(:P G PTR))
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(:P G PTR))
(IMPLIES (ENDP G) (:P G PTR))).
This induction is justified by the same argument used to admit NTH,
namely, the measure (ACL2-COUNT PTR) is decreasing according to the
relation O< (which is known to be well-founded on the domain recognized
by O-P). Note, however, that the unmeasured variable G is being instantiated.
When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (AND (NOT (ENDP G))
(NOT (ZP PTR))
(IMPLIES (AND (NATP (+ -1 PTR))
(< (+ -1 PTR) (LEN (CDR G)))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G)))))
(MEM (NTH (+ -1 PTR) (CDR G))
(FLATTEN-M (CDR G)))))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G)))).
By the simple :definition ENDP and the simple :rewrite rule NATP-POSP-
-1 we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(IMPLIES (AND (POSP PTR)
(< (+ -1 PTR) (LEN (CDR G)))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G)))))
(MEM (NTH (+ -1 PTR) (CDR G))
(FLATTEN-M (CDR G))))
(NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR, POSP-
CR and ZP-COMPOUND-RECOGNIZER, the :definitions FLATTEN-M, LEN, NOT
and NTH and the :forward-chaining rules POSP-FC-1 and POSP-FC-2, to
the following four conjectures.
Subgoal *1/3.4
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G))))
(CONSP (CAR G)))
(MEM (NTH (+ -1 PTR) (CDR G))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.3
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(<= (LEN (CDR G)) (+ -1 PTR))
(< PTR (+ 1 (LEN (CDR G))))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G))))
(NOT (CONSP (CAR G))))
(MEM (NTH (+ -1 PTR) (CDR G))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :compound-recognizer
rule ZP-COMPOUND-RECOGNIZER, linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN.
Subgoal *1/3.2
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (NTH (+ -1 PTR) (CDR G))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G))))
(CONSP (CAR G)))
(MEM (NTH (+ -1 PTR) (CDR G))
(LIST* (CAAR G)
(CDAR G)
(FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/3.1
(IMPLIES (AND (CONSP G)
(NOT (ZP PTR))
(MEM (NTH (+ -1 PTR) (CDR G))
(FLATTEN-M (CDR G)))
(< PTR (+ 1 (LEN (CDR G))))
(NOT (CONSP (NTH (+ -1 PTR) (CDR G))))
(NOT (CONSP (CAR G))))
(MEM (NTH (+ -1 PTR) (CDR G))
(CONS (CAR G) (FLATTEN-M (CDR G))))).
But simplification reduces this to T, using the :rewrite rules PROBLEM-
114E, PROBLEM-48 and PROBLEM-49A and the :type-prescription rule MEM.
Subgoal *1/2
(IMPLIES (AND (NOT (ENDP G)) (ZP PTR))
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP G)
(ZP PTR)
(NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G))).
This simplifies, using the :compound-recognizer rules NATP-CR and ZP-
COMPOUND-RECOGNIZER, the :executable-counterparts of NATP, NOT and
ZP, linear arithmetic and the :forward-chaining rule NATP-FC-1, to
Subgoal *1/2''
(IMPLIES (AND (CONSP G)
(< 0 (LEN G))
(NOT (CONSP (NTH 0 G))))
(MEM (NTH 0 G) (FLATTEN-M G))).
By the simple :rewrite rule PROBLEM-112I we reduce the conjecture to
Subgoal *1/2'''
(IMPLIES (AND (CONSP G) (NOT (CONSP (NTH 0 G))))
(MEM (NTH 0 G) (FLATTEN-M G))).
This simplifies, using the :definition NTH and the :executable-counterpart
of ZP, to
Subgoal *1/2'4'
(IMPLIES (AND (CONSP G) (NOT (CONSP (CAR G))))
(MEM (CAR G) (FLATTEN-M G))).
The destructor terms (CAR G) and (CDR G) can be eliminated by using
CAR-CDR-ELIM to replace G by (CONS G1 G2), (CAR G) by G1 and (CDR G)
by G2. This produces the following goal.
Subgoal *1/2'5'
(IMPLIES (AND (CONSP (CONS G1 G2))
(NOT (CONSP G1)))
(MEM G1 (FLATTEN-M (CONS G1 G2)))).
But simplification reduces this to T, using the :definitions FLATTEN-
M and MEM, primitive type reasoning, the :rewrite rules CAR-CONS and
CDR-CONS and the :type-prescription rule FLATTEN-M.
Subgoal *1/1
(IMPLIES (ENDP G)
(IMPLIES (AND (NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G)))).
By the simple :definition ENDP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NOT (CONSP G))
(NATP PTR)
(< PTR (LEN G))
(NOT (CONSP (NTH PTR G))))
(MEM (NTH PTR G) (FLATTEN-M G))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definition LEN and the :forward-chaining rules NATP-
FC-1 and NATP-FC-2.
That completes the proof of *1.
Q.E.D.
The storage of PROBLEM-129C depends upon the :type-prescription rule
MEM.
Summary
Form: ( DEFTHM PROBLEM-129C ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:COMPOUND-RECOGNIZER ZP-COMPOUND-RECOGNIZER)
(:DEFINITION ENDP)
(:DEFINITION FLATTEN-M)
(:DEFINITION LEN)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION NTH)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART NATP)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART ZP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:FORWARD-CHAINING POSP-FC-1)
(:FORWARD-CHAINING POSP-FC-2)
(:INDUCTION NTH)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE NATP-POSP--1)
(:REWRITE PROBLEM-112I)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION FLATTEN-M)
(:TYPE-PRESCRIPTION LEN)
(:TYPE-PRESCRIPTION MEM))
Warnings: None
Time: 0.75 seconds (prove: 0.64, print: 0.09, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-129C
ACL2 >>(THEOREM PROBLEM-129D
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))
:HINTS
(("Goal" :INDUCT (LEN-DIFF X SEEN2)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49A)))
:RULE-CLASSES :LINEAR)
ACL2 Warning [Free] in ( DEFTHM PROBLEM-129D ...): The :LINEAR rule
generated from PROBLEM-129D will be triggered by the terms
(LEN-DIFF X SEEN2) and (LEN-DIFF X SEEN1). When PROBLEM-129D is triggered
by (LEN-DIFF X SEEN2) the variable SEEN1 will be chosen by searching
for an instance of (SUB SEEN1 SEEN2) among the hypotheses of the conjecture
being rewritten. When PROBLEM-129D is triggered by (LEN-DIFF X SEEN1)
the variable SEEN2 will be chosen by searching for an instance of
(SUB SEEN1 SEEN2) among the hypotheses of the conjecture being rewritten.
This is generally a severe restriction on the applicability of the
:LINEAR rule.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN-DIFF X SEEN2).
This suggestion was produced using the :induction rule LEN-DIFF. If
we let (:P SEEN1 SEEN2 X) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP X))
(:P SEEN1 SEEN2 X))
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN2))
(:P SEEN1 SEEN2 (CDR X)))
(:P SEEN1 SEEN2 X))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN2)
(:P SEEN1 SEEN2 (CDR X)))
(:P SEEN1 SEEN2 X))).
This induction is justified by the same argument used to admit LEN-
DIFF, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X)) (SUB SEEN1 SEEN2))
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
But simplification reduces this to T, using the :definition LEN-DIFF
and the :executable-counterpart of <.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN2))
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))))
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN2))
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1)))
(SUB SEEN1 SEEN2))
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
This simplifies, using the :definitions LEN-DIFF and NOT and the :type-
prescription rule SUB, to the following two conjectures.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN2))
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(SUB SEEN1 SEEN2)
(MEM (CAR X) SEEN1))
(<= (+ 1 (LEN-DIFF (CDR X) SEEN2))
(LEN-DIFF (CDR X) SEEN1))).
This simplifies, using linear arithmetic, primitive type reasoning
and the :type-prescription rule LEN-DIFF, to
Subgoal *1/2.2'
(IMPLIES (AND (EQUAL (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(CONSP X)
(NOT (MEM (CAR X) SEEN2))
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(SUB SEEN1 SEEN2)
(MEM (CAR X) SEEN1))
(<= (+ 1 (LEN-DIFF (CDR X) SEEN2))
(LEN-DIFF (CDR X) SEEN1))).
But simplification reduces this to T, using the :rewrite rule PROBLEM-
49A and the :type-prescription rules MEM and SUB.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN2))
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(SUB SEEN1 SEEN2)
(NOT (MEM (CAR X) SEEN1)))
(<= (+ 1 (LEN-DIFF (CDR X) SEEN2))
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN2)
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))))
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN2)
(IMPLIES (SUB SEEN1 SEEN2)
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1)))
(SUB SEEN1 SEEN2))
(<= (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
This simplifies, using the :definitions LEN-DIFF and NOT, the :rewrite
rules PROBLEM-48 and PROBLEM-49A and the :type-prescription rules MEM
and SUB, to
Subgoal *1/1''
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN2)
(<= (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(SUB SEEN1 SEEN2)
(NOT (MEM (CAR X) SEEN1)))
(<= (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-129D ...)
Rules: ((:DEFINITION LEN-DIFF)
(:DEFINITION NOT)
(:EXECUTABLE-COUNTERPART <)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN-DIFF)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: Free
Time: 0.12 seconds (prove: 0.03, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-129D
ACL2 >>(THEOREM PROBLEM-129E
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))
:HINTS
(("Goal" :INDUCT (LEN-DIFF X SEEN1)
:IN-THEORY
(ENABLE PROBLEM-48
PROBLEM-49 PROBLEM-49A PROBLEM-129D)))
:RULE-CLASSES :LINEAR)
ACL2 Warning [Free] in ( DEFTHM PROBLEM-129E ...): The :LINEAR rule
generated from PROBLEM-129E will be triggered by the terms
(LEN-DIFF X SEEN2) and (LEN-DIFF X SEEN1). When PROBLEM-129E is triggered
by (LEN-DIFF X SEEN2) the variables SEEN1 and PTR will be chosen by
searching for an instance of (NOT (MEM PTR SEEN1)) among the hypotheses
of the conjecture being rewritten. When PROBLEM-129E is triggered
by (LEN-DIFF X SEEN1) the variables SEEN2 and PTR will be chosen by
searching for instances of (NOT (MEM PTR SEEN1)) and (MEM PTR SEEN2)
among the hypotheses of the conjecture being rewritten. This is generally
a severe restriction on the applicability of the :LINEAR rule.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (LEN-DIFF X SEEN1).
This suggestion was produced using the :induction rule LEN-DIFF. If
we let (:P PTR SEEN1 SEEN2 X) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (CONSP X))
(:P PTR SEEN1 SEEN2 X))
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(:P PTR SEEN1 SEEN2 (CDR X)))
(:P PTR SEEN1 SEEN2 X))
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN1)
(:P PTR SEEN1 SEEN2 (CDR X)))
(:P PTR SEEN1 SEEN2 X))).
This induction is justified by the same argument used to admit LEN-
DIFF, namely, the measure (ACL2-COUNT X) is decreasing according to
the relation O< (which is known to be well-founded on the domain recognized
by O-P). When applied to the goal at hand the above induction scheme
produces the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NOT (CONSP X))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
This simplifies, using linear arithmetic, the :linear rule PROBLEM-
129D and the :type-prescription rules LEN-DIFF and SUB, to
Subgoal *1/3''
(IMPLIES (AND (EQUAL (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))
(NOT (CONSP X))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
But simplification reduces this to T, using the :definitions LEN-DIFF
and SUB, the :executable-counterpart of EQUAL, the :rewrite rule PROBLEM-
49A and the :type-prescription rule MEM.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))))
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1)))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
This simplifies, using the :definitions LEN-DIFF and MEM, the :executable-
counterpart of NOT, primitive type reasoning, the :rewrite rules PROBLEM-
48, PROBLEM-49 and PROBLEM-49A and the :type-prescription rules MEM
and SUB, to the following four conjectures.
Subgoal *1/2.4
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(NOT (MEM PTR (CDR X)))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(EQUAL PTR (CAR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-129D and the :type-prescription rule SUB.
Subgoal *1/2.3
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(EQUAL PTR (CAR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X))
(MEM (CAR X) SEEN2))
(< (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule LEN-DIFF.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(NOT (MEM (CAR X) SEEN1))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X))
(NOT (MEM (CAR X) SEEN2)))
(< (+ 1 (LEN-DIFF (CDR X) SEEN2))
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule LEN-DIFF.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN1)
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))))
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN1)
(IMPLIES (AND (NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR (CDR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1)))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(MEM PTR X))
(< (LEN-DIFF X SEEN2)
(LEN-DIFF X SEEN1))).
This simplifies, using the :definitions LEN-DIFF and MEM, the :executable-
counterpart of NOT, primitive type reasoning, the :rewrite rules PROBLEM-
48, PROBLEM-49 and PROBLEM-49A and the :type-prescription rules MEM
and SUB, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN1)
(NOT (MEM PTR (CDR X)))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(EQUAL PTR (CAR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using trivial observations.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(MEM (CAR X) SEEN1)
(< (LEN-DIFF (CDR X) SEEN2)
(LEN-DIFF (CDR X) SEEN1))
(NOT (MEM PTR SEEN1))
(MEM PTR SEEN2)
(SUB SEEN1 SEEN2)
(EQUAL PTR (CAR X)))
(< (LEN-DIFF (CDR X) SEEN2)
(+ 1 (LEN-DIFF (CDR X) SEEN1)))).
But simplification reduces this to T, using trivial observations.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-129E ...)
Rules: ((:DEFINITION LEN-DIFF)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION SUB)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION LEN-DIFF)
(:LINEAR PROBLEM-129D)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: Free
Time: 0.23 seconds (prove: 0.12, print: 0.09, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-129E
ACL2 >>(DEFUN
REACHABLES (PTR M SEEN)
(DECLARE
(XARGS :MEASURE
(M2 (IF (MEM PTR (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M) SEEN))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-48
PROBLEM-114E PROBLEM-129A PROBLEM-129B
PROBLEM-129C PROBLEM-129E)))))
(IF (ADDRESSP PTR M)
(IF (MEM PTR SEEN)
SEEN
(IF (CONSP (NTH PTR M))
(IF (SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(REACHABLES (CAR (NTH PTR M))
M
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
'UNDEF)
(REACHABLES (NTH PTR M)
M (CONS PTR SEEN))))
SEEN))
For the admission of REACHABLES we will use the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (M2 (IF (MEM PTR (FLATTEN-M M)) 1 2) (LEN-DIFF (FLATTEN-M M) SEEN)).
The non-trivial part of the measure conjecture is
Goal
(AND (O-P (M2 (IF (MEM PTR (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M) SEEN)))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M))))
(O< (M2 (IF (MEM (NTH PTR M) (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M)
(CONS PTR SEEN)))
(M2 (IF (MEM PTR (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M) SEEN))))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M)))
(O< (M2 (IF (MEM (CDR (NTH PTR M)) (FLATTEN-M M))
1 2)
(LEN-DIFF (FLATTEN-M M)
(CONS PTR SEEN)))
(M2 (IF (MEM PTR (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M) SEEN))))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(O< (M2 (IF (MEM (CAR (NTH PTR M)) (FLATTEN-M M))
1 2)
(LEN-DIFF (FLATTEN-M M)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(M2 (IF (MEM PTR (FLATTEN-M M)) 1 2)
(LEN-DIFF (FLATTEN-M M) SEEN))))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By the simple :definitions ADDRESSP and M2 we reduce the conjecture
to the following four conjectures.
Subgoal 4
(O-P (CONS (CONS 1
(+ 1 (IF (MEM PTR (FLATTEN-M M)) 1 2)))
(LEN-DIFF (FLATTEN-M M) SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR, O-FINP-CR and POSP-CR, the :definitions O-FIRST-COEFF,
O-FIRST-EXPT, O-P and O-RST, the :executable-counterparts of EQUAL,
O-P and O<, primitive type reasoning, the :rewrite rules CAR-CONS,
CDR-CONS, O-FIRST-EXPT-DEF-O-FINP and O-P-DEF-O-FINP-1 and the :type-
prescription rule LEN-DIFF.
Subgoal 3
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M))))
(O< (CONS (CONS 1
(+ 1
(IF (MEM (NTH PTR M) (FLATTEN-M M))
1 2)))
(LEN-DIFF (FLATTEN-M M)
(CONS PTR SEEN)))
(CONS (CONS 1
(+ 1 (IF (MEM PTR (FLATTEN-M M)) 1 2)))
(LEN-DIFF (FLATTEN-M M) SEEN)))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definitions O-FIRST-COEFF, O-FIRST-EXPT, O-RST, O< and
SYNP, the :executable-counterparts of ACL2-NUMBERP, BINARY-+, CAR,
CDR, CONS, EQUAL and UNARY--, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules CAR-CONS,
CDR-CONS, EQUAL-CONSTANT-+ and PROBLEM-129C and the :type-prescription
rule LEN-DIFF, to
Subgoal 3'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M)))
(MEM PTR (FLATTEN-M M)))
(< (LEN-DIFF (FLATTEN-M M) (CONS PTR SEEN))
(LEN-DIFF (FLATTEN-M M) SEEN))).
But simplification reduces this to T, using the :definition MEM, linear
arithmetic, primitive type reasoning, the :linear rule PROBLEM-129E,
the :rewrite rules CAR-CONS, PROBLEM-114E and PROBLEM-48 and the :type-
prescription rules LEN-DIFF and MEM.
Subgoal 2
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M)))
(O< (CONS (CONS 1
(+ 1
(IF (MEM (CDR (NTH PTR M)) (FLATTEN-M M))
1 2)))
(LEN-DIFF (FLATTEN-M M)
(CONS PTR SEEN)))
(CONS (CONS 1
(+ 1 (IF (MEM PTR (FLATTEN-M M)) 1 2)))
(LEN-DIFF (FLATTEN-M M) SEEN)))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definitions O-FIRST-COEFF, O-FIRST-EXPT, O-RST, O< and
SYNP, the :executable-counterparts of ACL2-NUMBERP, BINARY-+, CAR,
CDR, CONS, EQUAL and UNARY--, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules CAR-CONS,
CDR-CONS, EQUAL-CONSTANT-+ and PROBLEM-129B and the :type-prescription
rule LEN-DIFF, to
Subgoal 2'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(MEM PTR (FLATTEN-M M)))
(< (LEN-DIFF (FLATTEN-M M) (CONS PTR SEEN))
(LEN-DIFF (FLATTEN-M M) SEEN))).
But simplification reduces this to T, using the :definition MEM, linear
arithmetic, primitive type reasoning, the :linear rule PROBLEM-129E,
the :rewrite rules CAR-CONS, PROBLEM-114E and PROBLEM-48 and the :type-
prescription rules LEN-DIFF and MEM.
Subgoal 1
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(O< (CONS (CONS 1
(+ 1
(IF (MEM (CAR (NTH PTR M)) (FLATTEN-M M))
1 2)))
(LEN-DIFF (FLATTEN-M M)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(CONS (CONS 1
(+ 1 (IF (MEM PTR (FLATTEN-M M)) 1 2)))
(LEN-DIFF (FLATTEN-M M) SEEN)))).
This simplifies, using the :compound-recognizer rules NATP-CR and O-
FINP-CR, the :definitions O-FIRST-COEFF, O-FIRST-EXPT, O-RST, O<, SUB
and SYNP, the :executable-counterparts of ACL2-NUMBERP, BINARY-+, CAR,
CDR, CONS, EQUAL and UNARY--, primitive type reasoning, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules CAR-CONS,
CDR-CONS, EQUAL-CONSTANT-+ and PROBLEM-129A and the :type-prescription
rule LEN-DIFF, to
Subgoal 1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(MEM PTR
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(SUB SEEN
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(MEM PTR (FLATTEN-M M)))
(< (LEN-DIFF (FLATTEN-M M)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(LEN-DIFF (FLATTEN-M M) SEEN))).
But simplification reduces this to T, using linear arithmetic, the
:linear rule PROBLEM-129E and the :type-prescription rules LEN-DIFF,
MEM and SUB.
Q.E.D.
That completes the proof of the measure theorem for REACHABLES. Thus,
we admit this function under the principle of definition. We observe
that the type of REACHABLES is described by the theorem
(OR (OR (CONSP (REACHABLES PTR M SEEN))
(AND (SYMBOLP (REACHABLES PTR M SEEN))
(NOT (EQUAL (REACHABLES PTR M SEEN) T))
(NOT (EQUAL (REACHABLES PTR M SEEN) NIL))))
(EQUAL (REACHABLES PTR M SEEN) SEEN)).
We used primitive type reasoning.
Summary
Form: ( DEFUN REACHABLES ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:COMPOUND-RECOGNIZER POSP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION M2)
(:DEFINITION MEM)
(:DEFINITION NOT)
(:DEFINITION O-FIRST-COEFF)
(:DEFINITION O-FIRST-EXPT)
(:DEFINITION O-P)
(:DEFINITION O-RST)
(:DEFINITION O<)
(:DEFINITION SUB)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART ACL2-NUMBERP)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONS)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART O-P)
(:EXECUTABLE-COUNTERPART O<)
(:EXECUTABLE-COUNTERPART UNARY--)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:LINEAR PROBLEM-129E)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE EQUAL-CONSTANT-+)
(:REWRITE O-FIRST-EXPT-DEF-O-FINP)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE PROBLEM-114E)
(:REWRITE PROBLEM-129A)
(:REWRITE PROBLEM-129B)
(:REWRITE PROBLEM-129C)
(:REWRITE PROBLEM-48)
(:TYPE-PRESCRIPTION LEN-DIFF)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 1.34 seconds (prove: 1.23, print: 0.08, other: 0.03)
REACHABLES
ACL2 >>(THEOREM PROBLEM-129F
(SUB SEEN (REACHABLES PTR M SEEN))
:HINTS
(("Goal" :INDUCT (REACHABLES PTR M SEEN)
:IN-THEORY
(ENABLE PROBLEM-48 PROBLEM-49 PROBLEM-49A)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REACHABLES PTR M SEEN).
This suggestion was produced using the :induction rule REACHABLES.
If we let (:P M PTR SEEN) denote *1 above then the induction scheme
we'll use is
(AND (IMPLIES (NOT (ADDRESSP PTR M))
(:P M PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M)))
(:P M (NTH PTR M) (CONS PTR SEEN)))
(:P M PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(NOT (SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(:P M (CDR (NTH PTR M))
(CONS PTR SEEN)))
(:P M PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(:P M (CDR (NTH PTR M)) (CONS PTR SEEN))
(:P M (CAR (NTH PTR M))
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))))
(:P M PTR SEEN))
(IMPLIES (AND (ADDRESSP PTR M) (MEM PTR SEEN))
(:P M PTR SEEN))).
This induction is justified by the same argument used to admit REACHABLES,
namely, the measure
(M2 (IF (MEM PTR (FLATTEN-M M)) '1 '2) (LEN-DIFF (FLATTEN-M M) SEEN))
is decreasing according to the relation O< (which is known to be well-
founded on the domain recognized by O-P). When applied to the goal
at hand the above induction scheme produces the following four nontautological
subgoals.
Subgoal *1/4
(IMPLIES (NOT (ADDRESSP PTR M))
(SUB SEEN (REACHABLES PTR M SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP and REACHABLES and the :rewrite
rule PROBLEM-48.
Subgoal *1/3
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M)))
(SUB (CONS PTR SEEN)
(REACHABLES (NTH PTR M)
M (CONS PTR SEEN))))
(SUB SEEN (REACHABLES PTR M SEEN))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(NOT (CONSP (NTH PTR M)))
(SUB (CONS PTR SEEN)
(REACHABLES (NTH PTR M)
M (CONS PTR SEEN))))
(SUB SEEN (REACHABLES PTR M SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, REACHABLES and SUB, primitive
type reasoning, the :forward-chaining rules NATP-FC-1 and NATP-FC-2,
the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48 and PROBLEM-49 and
the :type-prescription rule SUB.
Subgoal *1/2
(IMPLIES (AND (ADDRESSP PTR M)
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(SUB (REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))
(REACHABLES (CAR (NTH PTR M))
M
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))))
(SUB SEEN (REACHABLES PTR M SEEN))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(NOT (MEM PTR SEEN))
(CONSP (NTH PTR M))
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(SUB (REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN))
(REACHABLES (CAR (NTH PTR M))
M
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))))
(SUB SEEN (REACHABLES PTR M SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP, REACHABLES and SUB, primitive
type reasoning, the :forward-chaining rules NATP-FC-1 and NATP-FC-2,
the :rewrite rules CAR-CONS, CDR-CONS, PROBLEM-48, PROBLEM-49 and PROBLEM-
49A and the :type-prescription rules MEM and SUB.
Subgoal *1/1
(IMPLIES (AND (ADDRESSP PTR M) (MEM PTR SEEN))
(SUB SEEN (REACHABLES PTR M SEEN))).
By the simple :definition ADDRESSP we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (NATP PTR)
(< PTR (LEN M))
(MEM PTR SEEN))
(SUB SEEN (REACHABLES PTR M SEEN))).
But simplification reduces this to T, using the :compound-recognizer
rule NATP-CR, the :definitions ADDRESSP and REACHABLES, the :forward-
chaining rules NATP-FC-1 and NATP-FC-2, the :rewrite rules PROBLEM-
48 and PROBLEM-49A and the :type-prescription rule MEM.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-129F ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:DEFINITION ADDRESSP)
(:DEFINITION NOT)
(:DEFINITION REACHABLES)
(:DEFINITION SUB)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:FORWARD-CHAINING NATP-FC-1)
(:FORWARD-CHAINING NATP-FC-2)
(:INDUCTION REACHABLES)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-48)
(:REWRITE PROBLEM-49)
(:REWRITE PROBLEM-49A)
(:TYPE-PRESCRIPTION MEM)
(:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.14 seconds (prove: 0.03, print: 0.09, other: 0.02)
PROBLEM-129F
ACL2 >>(THEOREM PROBLEM-129G
(SUB (CONS PTR SEEN)
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
:HINTS
(("Goal" :USE
(:INSTANCE PROBLEM-129F (PTR (CDR (NTH PTR M)))
(M M)
(SEEN (CONS PTR SEEN))))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But we now augment the goal above by adding the hypothesis indicated
by the :USE hint. This produces a propositional tautology. The hypothesis
can be derived from PROBLEM-129F via instantiation. Therefore, this
goal has been established.
Q.E.D.
The storage of PROBLEM-129G depends upon the :type-prescription rule
SUB.
Summary
Form: ( DEFTHM PROBLEM-129G ...)
Rules: ((:TYPE-PRESCRIPTION SUB))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
PROBLEM-129G
ACL2 >>(THEOREM
PROBLEM-129
(EQUAL (REACHABLES PTR M SEEN)
(IF (ADDRESSP PTR M)
(IF (MEM PTR SEEN)
SEEN
(IF (CONSP (NTH PTR M))
(REACHABLES (CAR (NTH PTR M))
M
(REACHABLES (CDR (NTH PTR M))
M (CONS PTR SEEN)))
(REACHABLES (NTH PTR M)
M (CONS PTR SEEN))))
SEEN))
:HINTS
(("Goal" :IN-THEORY (ENABLE PROBLEM-129G)))
:RULE-CLASSES NIL)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using the :definitions ADDRESSP
and REACHABLES, primitive type reasoning and the :rewrite rule PROBLEM-
129G.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-129 ...)
Rules: ((:DEFINITION ADDRESSP)
(:DEFINITION REACHABLES)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE PROBLEM-129G))
Warnings: None
Time: 0.05 seconds (prove: 0.03, print: 0.01, other: 0.01)
PROBLEM-129
ACL2 >>(DEFUN RMB (X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (CONSP X)
(IF (CONSP (CDR X))
(IF (< (CC (CDR (RMB (CDR X)))) (CC X))
(IF (< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(CONS (CAR (RMB (CDR X)))
(RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
'UNDEF)
'UNDEF)
(CONS (CAR X) NIL))
NIL))
For the admission of RMB we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR X)) (CC X)))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X)))
(O< (CC (CDR (RMB (CDR X)))) (CC X)))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X)))
(O< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X)))).
By case analysis we reduce the conjecture to the following four conjectures.
Subgoal 4
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 3
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definition O< and the :type-prescription rule CC, to
Subgoal 3'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (CC (CDR X)) (CC X))).
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following goal.
Subgoal 3''
(IMPLIES (AND (CONSP (CONS X1 X2)) (CONSP X2))
(< (CC X2) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS and CDR-CONS, to
Subgoal 3'''
(IMPLIES (CONSP X2)
(< 0 (+ 1 (CC X1)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X)))
(O< (CC (CDR (RMB (CDR X)))) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :rewrite rule O-FINP-< and the :type-prescription
rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X)))
(O< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :definition CC, primitive type reasoning, the :meta
rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS, CDR-CONS
and O-FINP-< and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for RMB. Thus, we
admit this function under the principle of definition. We observe that
the type of RMB is described by the theorem
(OR (CONSP (RMB X))
(AND (SYMBOLP (RMB X))
(NOT (EQUAL (RMB X) T))
(NOT (EQUAL (RMB X) NIL)))
(EQUAL (RMB X) NIL)).
We used primitive type reasoning.
Summary
Form: ( DEFUN RMB ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION CC)
(:DEFINITION NOT)
(:DEFINITION O<)
(:ELIM CAR-CDR-ELIM)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE O-FINP-<)
(:REWRITE O-P-DEF-O-FINP-1)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.27 seconds (prove: 0.16, print: 0.07, other: 0.04)
RMB
ACL2 >>(THEOREM PROBLEM-130A (<= (CC (CDR X)) (CC X))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
The destructor terms (CAR X) and (CDR X) can be eliminated by using
CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X)
by X2. This produces the following two goals.
Subgoal 2
(IMPLIES (NOT (CONSP X))
(<= (CC (CDR X)) (CC X))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of < and CC and the :rewrite rule DEFAULT-
CDR.
Subgoal 1
(IMPLIES (CONSP (CONS X1 X2))
(<= (CC X2) (CC (CONS X1 X2)))).
This simplifies, using the :definition CC, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS and CDR-CONS, to
Subgoal 1'
(<= 0 (+ 1 (CC X1))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-130A ...)
Rules: ((:DEFINITION CC)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART CC)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CDR)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-130A
ACL2 >>(THEOREM PROBLEM-130B (<= (CC (RMB X)) (CC X))
:HINTS (("Goal" :INDUCT (RMB X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RMB X). This suggestion
was produced using the :induction rule RMB. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(:P (CDR X)))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(<= (CC X)
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(:P (CDR X))
(:P (CDR (RMB (CDR X)))))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(:P (CDR X))
(:P (CDR (RMB (CDR X))))
(:P (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(:P X))).
This induction is justified by the same argument used to admit RMB,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following five nontautological subgoals.
Subgoal *1/5
(IMPLIES (NOT (CONSP X))
(<= (CC (RMB X)) (CC X))).
But simplification reduces this to T, using the :definitions CC and
RMB and the :executable-counterparts of < and CC.
Subgoal *1/4
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(<= (CC (RMB X)) (CC X))).
This simplifies, using the :definitions CC, FIX and RMB, the :executable-
counterpart of CC, primitive type reasoning, the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the :type-
prescription rule CC, to
Subgoal *1/4'
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(<= (+ 1 (CC (CAR X))) (CC X))).
But simplification reduces this to T, using the :definitions CC and
FIX, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite rules COMMUTATIVIT\
Y-OF-+ and UNICITY-OF-0 and the :type-prescription rule CC.
Subgoal *1/3
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(<= (CC (RMB (CDR X))) (CC (CDR X))))
(<= (CC (RMB X)) (CC X))).
This simplifies, using the :definition RMB and the :executable-counterpart
of CC, to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(<= (CC (RMB (CDR X))) (CC (CDR X))))
(<= 0 (CC X))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(<= (CC X)
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(<= (CC (RMB (CDR X))) (CC (CDR X)))
(<= (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR (RMB (CDR X))))))
(<= (CC (RMB X)) (CC X))).
This simplifies, using the :definitions CC and RMB, the :executable-
counterpart of CC, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT and the :rewrite rules CAR-CONS and CDR-CONS, to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(<= (CC (CDR X))
(CC (RMB (CDR (RMB (CDR X))))))
(<= (CC (RMB (CDR X))) (CC (CDR X)))
(<= (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR (RMB (CDR X))))))
(<= 0 (+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(<= (CC (RMB (CDR X))) (CC (CDR X)))
(<= (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR (RMB (CDR X)))))
(<= (CC (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))))
(<= (CC (RMB X)) (CC X))).
This simplifies, using the :definitions CC and RMB, primitive type
reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite
rules CAR-CONS and CDR-CONS, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(< (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR X)))
(<= (CC (RMB (CDR X))) (CC (CDR X)))
(<= (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR (RMB (CDR X)))))
(<= (CC (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(+ 1 (CC (CAR X))
(CC (RMB (CDR (RMB (CDR X))))))))
(<= (+ (CC (CAR (RMB (CDR X))))
(CC (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))))
(+ (CC (CAR X)) (CC (CDR X))))).
This simplifies, using the :definitions CC, FIX, RMB and SYNP, the
:executable-counterparts of <, BINARY-+, CC, CONSP and RMB, primitive
type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT, the :rewrite
rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-+, DEFAULT-CAR, DEFAULT-
CDR, FOLD-CONSTS-IN-+ and UNICITY-OF-0 and the :type-prescription rules
CC and RMB, to the following two conjectures.
Subgoal *1/1.2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(< (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR X)))
(CONSP (RMB (CDR X)))
(<= (+ 1 (CC (CAR (RMB (CDR X))))
(CC (CDR (RMB (CDR X)))))
(CC (CDR X)))
(<= (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR (RMB (CDR X)))))
(<= (CC (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(+ 1 (CC (CAR X))
(CC (RMB (CDR (RMB (CDR X))))))))
(<= (+ (CC (CAR (RMB (CDR X))))
(CC (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))))
(+ (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule CC.
Subgoal *1/1.1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(< (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR X)))
(NOT (CONSP (RMB (CDR X))))
(<= 0 (CC (CDR X))))
(<= 1 (CC (CDR X)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-130B ...)
Rules: ((:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION RMB)
(:DEFINITION SYNP)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART RMB)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RMB)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DEFAULT-CAR)
(:REWRITE DEFAULT-CDR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC)
(:TYPE-PRESCRIPTION RMB))
Warnings: None
Time: 1.92 seconds (prove: 1.72, print: 0.19, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-130B
ACL2 >>(THEOREM PROBLEM-130C
(IMPLIES (CONSP X) (CONSP (RMB X)))
:HINTS
(("Goal" :INDUCT (RMB X)
:IN-THEORY
(ENABLE PROBLEM-108C
PROBLEM-130A PROBLEM-130B))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RMB X). This suggestion
was produced using the :induction rule RMB. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(:P (CDR X)))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(<= (CC X)
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(:P (CDR X))
(:P (CDR (RMB (CDR X)))))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(:P (CDR X))
(:P (CDR (RMB (CDR X))))
(:P (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(:P X))).
This induction is justified by the same argument used to admit RMB,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following four nontautological subgoals.
Subgoal *1/4
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(IMPLIES (CONSP X) (CONSP (RMB X)))).
By case analysis we reduce the conjecture to
Subgoal *1/4'
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(CONSP (RMB X))).
But simplification reduces this to T, using the :definition RMB and
primitive type reasoning.
Subgoal *1/3
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X)))))
(IMPLIES (CONSP X) (CONSP (RMB X)))).
By case analysis we reduce the conjecture to
Subgoal *1/3'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC X) (CC (CDR (RMB (CDR X)))))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X)))))
(CONSP (RMB X))).
But simplification reduces this to T, using linear arithmetic, the
:linear rules PROBLEM-108C, PROBLEM-130A and PROBLEM-130B and the :type-
prescription rules CC and RMB.
Subgoal *1/2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(<= (CC X)
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X))))
(IMPLIES (CONSP (CDR (RMB (CDR X))))
(CONSP (RMB (CDR (RMB (CDR X)))))))
(IMPLIES (CONSP X) (CONSP (RMB X)))).
By case analysis we reduce the conjecture to
Subgoal *1/2'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(<= (CC X)
(CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X))))
(IMPLIES (CONSP (CDR (RMB (CDR X))))
(CONSP (RMB (CDR (RMB (CDR X)))))))
(CONSP (RMB X))).
This simplifies, using the :definitions CC and RMB, the :executable-
counterpart of CONSP, primitive type reasoning, the :meta rule CANCEL_-
PLUS-LESSP-CORRECT, the :rewrite rules CAR-CONS and CDR-CONS and the
:type-prescription rule CC, to the following two conjectures.
Subgoal *1/2.2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(<= (CC (CDR X))
(CC (RMB (CDR (RMB (CDR X))))))
(CONSP (RMB (CDR X))))
(CONSP (CDR (RMB (CDR X))))).
This simplifies, using the :definitions CC and RMB, the :executable-
counterparts of CC and CONSP, primitive type reasoning, the :rewrite
rule CDR-CONS and the :type-prescription rule CC, to
Subgoal *1/2.2'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< 0 (+ 1 (CC (CAR X)) (CC (CDR X))))
(<= (CC (CDR X)) 0)
(NOT (CONSP (CDDR X))))
(NOT (CONSP (LIST (CADR X))))).
This simplifies, using the :executable-counterpart of <, linear arithmetic
and the :type-prescription rule CC, to
Subgoal *1/2.2''
(IMPLIES (AND (EQUAL (CC (CDR X)) 0)
(CONSP X)
(CONSP (CDR X))
(< 0 (+ 1 (CC (CAR X)) 0))
(NOT (CONSP (CDDR X))))
(NOT (CONSP (LIST (CADR X))))).
But simplification reduces this to T, using the :definitions CC and
FIX, primitive type reasoning, the :rewrite rules COMMUTATIVITY-OF-
+ and UNICITY-OF-0 and the :type-prescription rule CC.
Subgoal *1/2.1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))
(<= (CC (CDR X))
(CC (RMB (CDR (RMB (CDR X))))))
(CONSP (RMB (CDR X))))
(NOT (CONSP (RMB (CDR (RMB (CDR X))))))).
But simplification reduces this to T, using linear arithmetic, the
:linear rules PROBLEM-108C and PROBLEM-130B and the :type-prescription
rules CC and RMB.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X))))
(IMPLIES (CONSP (CDR (RMB (CDR X))))
(CONSP (RMB (CDR (RMB (CDR X))))))
(IMPLIES (CONSP (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CONSP (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))))
(IMPLIES (CONSP X) (CONSP (RMB X)))).
By case analysis we reduce the conjecture to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(< (CC (CDR (RMB (CDR X)))) (CC X))
(< (CC (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CC X))
(IMPLIES (CONSP (CDR X))
(CONSP (RMB (CDR X))))
(IMPLIES (CONSP (CDR (RMB (CDR X))))
(CONSP (RMB (CDR (RMB (CDR X))))))
(IMPLIES (CONSP (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))
(CONSP (RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))))
(CONSP (RMB X))).
But simplification reduces this to T, using the :definitions CC and
RMB, primitive type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT,
the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription
rule CC.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-130C ...)
Rules: ((:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION NOT)
(:DEFINITION RMB)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART CONSP)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RMB)
(:LINEAR PROBLEM-108C)
(:LINEAR PROBLEM-130A)
(:LINEAR PROBLEM-130B)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC)
(:TYPE-PRESCRIPTION RMB))
Warnings: None
Time: 1.16 seconds (prove: 1.07, print: 0.08, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.04 seconds (prove: 0.00, print: 0.00, other: 0.04)
PROBLEM-130C
ACL2 >>(THEOREM PROBLEM-130
(EQUAL (RMB X)
(IF (CONSP X)
(IF (CONSP (CDR X))
(CONS (CAR (RMB (CDR X)))
(RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X)))))))
(CONS (CAR X) NIL))
NIL))
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-108C
PROBLEM-130B PROBLEM-130C)))
:RULE-CLASSES
((:DEFINITION :CONTROLLER-ALIST ((RMB T)))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
This simplifies, using the :definitions CC and RMB, primitive type
reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite
rules CAR-CONS and CDR-CONS, to the following two conjectures.
Subgoal 2
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (+ 1 (CC (CAR X)) (CC (CDR X)))
(CC (CDR (RMB (CDR X))))))
(EQUAL 'UNDEF
(CONS (CAR (RMB (CDR X)))
(RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))))).
This simplifies, using primitive type reasoning, to
Subgoal 2'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (CC (CDR (RMB (CDR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rules PROBLEM-108C and PROBLEM-130B, the
:rewrite rule PROBLEM-130C and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(<= (CC (CDR X))
(CC (RMB (CDR (RMB (CDR X)))))))
(EQUAL 'UNDEF
(CONS (CAR (RMB (CDR X)))
(RMB (CONS (CAR X)
(RMB (CDR (RMB (CDR X))))))))).
This simplifies, using primitive type reasoning, to
Subgoal 1'
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(< (CC (RMB (CDR (RMB (CDR X)))))
(CC (CDR X)))).
But simplification reduces this to T, using linear arithmetic, the
:linear rules PROBLEM-108C and PROBLEM-130B, the :rewrite rule PROBLEM-
130C and the :type-prescription rule CC.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-130 ...)
Rules: ((:DEFINITION CC)
(:DEFINITION RMB)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:LINEAR PROBLEM-108C)
(:LINEAR PROBLEM-130B)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-130C)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 1.38 seconds (prove: 1.34, print: 0.02, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-130
ACL2 >>(THEOREM PROBLEM-131A
(EQUAL (PROPER (CDR X))
(OR (ATOM X) (PROPER X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
This simplifies, using the :definitions ATOM and PROPER, to
Goal'
(IMPLIES (NOT (CONSP X))
(EQUAL (PROPER (CDR X)) T)).
But simplification reduces this to T, using the :executable-counterparts
of EQUAL and PROPER and the :rewrite rule DEFAULT-CDR.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-131A ...)
Rules: ((:DEFINITION ATOM)
(:DEFINITION PROPER)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART PROPER)
(:REWRITE DEFAULT-CDR))
Warnings: None
Time: 0.02 seconds (prove: 0.01, print: 0.00, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-131A
ACL2 >>(THEOREM PROBLEM-131B
(<= (CC (APP A B)) (+ (CC A) (CC B)))
:HINTS (("Goal" :INDUCT (CC A)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (CC A). This suggestion
was produced using the :induction rule CC. If we let (:P A B) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP A)) (:P A B))
(IMPLIES (AND (CONSP A)
(:P (CAR A) B)
(:P (CDR A) B))
(:P A B))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT A) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP A))
(<= (CC (APP A B)) (+ (CC A) (CC B)))).
This simplifies, using the :definitions APP, CC and FIX, the :rewrite
rule UNICITY-OF-0 and the :type-prescription rule CC, to
Subgoal *1/2'
(IMPLIES (NOT (CONSP A))
(<= (CC B) (CC B))).
But simplification reduces this to T, using linear arithmetic and the
:type-prescription rule CC.
Subgoal *1/1
(IMPLIES (AND (CONSP A)
(<= (CC (APP (CAR A) B))
(+ (CC (CAR A)) (CC B)))
(<= (CC (APP (CDR A) B))
(+ (CC (CDR A)) (CC B))))
(<= (CC (APP A B)) (+ (CC A) (CC B)))).
But simplification reduces this to T, using the :definitions APP and
CC, primitive type reasoning, the :meta rule CANCEL_PLUS-LESSP-CORRECT
and the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and
COMMUTATIVITY-OF-+.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-131B ...)
Rules: ((:DEFINITION APP)
(:DEFINITION CC)
(:DEFINITION FIX)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.07 seconds (prove: 0.04, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03)
PROBLEM-131B
ACL2 >>(THEOREM PROBLEM-131C (<= (CC (REV X)) (CC X))
:HINTS
(("Goal" :INDUCT (CC X)
:IN-THEORY (ENABLE PROBLEM-131B)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (CC X). This suggestion
was produced using the :induction rule CC. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X)
(:P (CAR X))
(:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit CC,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(<= (CC (REV X)) (CC X))).
But simplification reduces this to T, using the :definitions CC and
REV and the :executable-counterparts of < and CC.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(<= (CC (REV (CAR X))) (CC (CAR X)))
(<= (CC (REV (CDR X))) (CC (CDR X))))
(<= (CC (REV X)) (CC X))).
This simplifies, using the :definitions CC and REV, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(<= (CC (REV (CAR X))) (CC (CAR X)))
(<= (CC (REV (CDR X))) (CC (CDR X))))
(<= (CC (APP (REV (CDR X)) (LIST (CAR X))))
(+ 1 (CC (CAR X)) (CC (CDR X))))).
But simplification reduces this to T, using the :definitions CC and
FIX, the :executable-counterpart of CC, linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-131B, the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+ and UNICITY-
OF-0 and the :type-prescription rule CC.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-131C ...)
Rules: ((:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART CC)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION CC)
(:LINEAR PROBLEM-131B)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.13 seconds (prove: 0.07, print: 0.04, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-131C
ACL2 >>(THEOREM PROBLEM-131D
(EQUAL (CONSP (REV X)) (CONSP X))
:HINTS (("Goal" :INDUCT (REV X))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (REV X). This suggestion
was produced using the :induction rule REV. If we let (:P X) denote
*1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (:P (CDR X)))
(:P X))).
This induction is justified by the same argument used to admit REV,
namely, the measure (ACL2-COUNT X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (CONSP X))
(EQUAL (CONSP (REV X)) (CONSP X))).
But simplification reduces this to T, using the :definition REV and
the :executable-counterparts of CONSP and EQUAL.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(EQUAL (CONSP (REV (CDR X)))
(CONSP (CDR X))))
(EQUAL (CONSP (REV X)) (CONSP X))).
But simplification reduces this to T, using the :definition REV, the
:executable-counterpart of EQUAL, primitive type reasoning and the
:type-prescription rule APP.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-131D ...)
Rules: ((:DEFINITION REV)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION REV)
(:TYPE-PRESCRIPTION APP))
Warnings: None
Time: 0.03 seconds (prove: 0.00, print: 0.03, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
PROBLEM-131D
ACL2 >>(DEFUN RMB-HINT (X)
(DECLARE (XARGS :MEASURE (CC X)
:HINTS
(("Goal" :IN-THEORY
(ENABLE PROBLEM-108C PROBLEM-130A
PROBLEM-131C PROBLEM-131D)))))
(IF (CONSP X)
(IF (CONSP (CDR X))
(LIST (RMB-HINT (CDR X))
(RMB-HINT (CDR (REV (CDR X))))
(RMB-HINT (CONS (CAR X)
(REV (CDR (REV (CDR X)))))))
X)
X))
For the admission of RMB-HINT we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR (REV (CDR X)))) (CC X)))
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR X)) (CC X)))
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CONS (CAR X)
(REV (CDR (REV (CDR X))))))
(CC X)))).
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
By case analysis we reduce the conjecture to the following four conjectures.
Subgoal 4
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 3
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR (REV (CDR X)))) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, linear arithmetic, the :linear rules PROBLEM-108C,
PROBLEM-130A and PROBLEM-131C, the :rewrite rules O-FINP-< and PROBLEM-
131D and the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CDR X)) (CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, linear arithmetic, the :linear rule PROBLEM-108C, the
:rewrite rule O-FINP-< and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X) (CONSP (CDR X)))
(O< (CC (CONS (CAR X)
(REV (CDR (REV (CDR X))))))
(CC X))).
But simplification reduces this to T, using the :compound-recognizer
rule O-FINP-CR, the :definition CC, linear arithmetic, primitive type
reasoning, the :linear rules PROBLEM-108C and PROBLEM-131C, the :rewrite
rules CAR-CONS, CDR-CONS, O-FINP-< and PROBLEM-131D and the :type-
prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for RMB-HINT. Thus,
we admit this function under the principle of definition. We could
deduce no constraints on the type of RMB-HINT.
Summary
Form: ( DEFUN RMB-HINT ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION CC)
(:DEFINITION NOT)
(:FAKE-RUNE-FOR-LINEAR NIL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:LINEAR PROBLEM-108C)
(:LINEAR PROBLEM-130A)
(:LINEAR PROBLEM-131C)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE O-FINP-<)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE PROBLEM-131D)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.26 seconds (prove: 0.18, print: 0.05, other: 0.03)
RMB-HINT
ACL2 >>(THEOREM PROBLEM-131 (EQUAL (RMB X) (REV X))
:HINTS
(("Goal" :INDUCT (RMB-HINT X)
:IN-THEORY
(ENABLE PROBLEM-44B PROBLEM-44 PROBLEM-130
PROBLEM-131A PROBLEM-131D))))
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (RMB-HINT X). This
suggestion was produced using the :induction rule RMB-HINT. If we
let (:P X) denote *1 above then the induction scheme we'll use is
(AND (IMPLIES (NOT (CONSP X)) (:P X))
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(:P X))
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(:P (CDR X))
(:P (CDR (REV (CDR X))))
(:P (CONS (CAR X)
(REV (CDR (REV (CDR X)))))))
(:P X))).
This induction is justified by the same argument used to admit RMB-
HINT, namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following three nontautological subgoals.
Subgoal *1/3
(IMPLIES (NOT (CONSP X))
(EQUAL (RMB X) (REV X))).
But simplification reduces this to T, using the :definitions PROBLEM-
130 and REV and the :executable-counterpart of EQUAL.
Subgoal *1/2
(IMPLIES (AND (CONSP X) (NOT (CONSP (CDR X))))
(EQUAL (RMB X) (REV X))).
But simplification reduces this to T, using the :definitions APP, PROBLEM-
130 and REV, primitive type reasoning and the :rewrite rule PROBLEM-
131D.
Subgoal *1/1
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(EQUAL (RMB (CDR X)) (REV (CDR X)))
(EQUAL (RMB (CDR (REV (CDR X))))
(REV (CDR (REV (CDR X)))))
(EQUAL (RMB (CONS (CAR X)
(REV (CDR (REV (CDR X))))))
(REV (CONS (CAR X)
(REV (CDR (REV (CDR X))))))))
(EQUAL (RMB X) (REV X))).
This simplifies, using the :definitions ATOM, PROBLEM-130 and REV,
primitive type reasoning and the :rewrite rules CAR-CONS, CDR-CONS,
PROBLEM-131A, PROBLEM-131D, PROBLEM-44 and PROBLEM-44B, to
Subgoal *1/1'
(IMPLIES (AND (CONSP X)
(CONSP (CDR X))
(EQUAL (RMB (CDR X)) (REV (CDR X)))
(EQUAL (RMB (CDR (REV (CDR X))))
(REV (CDR (REV (CDR X)))))
(EQUAL (RMB (CONS (CAR X)
(REV (CDR (REV (CDR X))))))
(APP (CDR (REV (CDR X)))
(LIST (CAR X)))))
(EQUAL (CONS (CAR (REV (CDR X)))
(APP (CDR (REV (CDR X)))
(LIST (CAR X))))
(APP (REV (CDR X)) (LIST (CAR X))))).
But simplification reduces this to T, using the :definition APP, primitive
type reasoning and the :rewrite rule PROBLEM-131D.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-131 ...)
Rules: ((:DEFINITION APP)
(:DEFINITION ATOM)
(:DEFINITION PROBLEM-130)
(:DEFINITION REV)
(:EXECUTABLE-COUNTERPART EQUAL)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION RMB-HINT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE PROBLEM-131A)
(:REWRITE PROBLEM-131D)
(:REWRITE PROBLEM-44)
(:REWRITE PROBLEM-44B))
Warnings: None
Time: 0.45 seconds (prove: 0.37, print: 0.06, other: 0.02)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-131
ACL2 >>(DEFUN IF-EXPRP (X)
(AND (CONSP X) (EQUAL (CAR X) 'IF)))
Since IF-EXPRP is non-recursive, its admission is trivial. We observe
that the type of IF-EXPRP is described by the theorem
(OR (EQUAL (IF-EXPRP X) T) (EQUAL (IF-EXPRP X) NIL)). We used primitive
type reasoning.
Summary
Form: ( DEFUN IF-EXPRP ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
IF-EXPRP
ACL2 >>(DEFUN A1 (X) (CADR X))
Since A1 is non-recursive, its admission is trivial. We could deduce
no constraints on the type of A1.
Summary
Form: ( DEFUN A1 ...)
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.01, other: 0.01)
A1
ACL2 >>(DEFUN A2 (X) (CADDR X))
Since A2 is non-recursive, its admission is trivial. We could deduce
no constraints on the type of A2.
Summary
Form: ( DEFUN A2 ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
A2
ACL2 >>(DEFUN A3 (X) (CADDDR X))
Since A3 is non-recursive, its admission is trivial. We could deduce
no constraints on the type of A3.
Summary
Form: ( DEFUN A3 ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
A3
ACL2 >>(DEFUN ASSOC-EQUAL (X ALIST)
(DECLARE (XARGS :GUARD (ALISTP ALIST)))
(COND ((ENDP ALIST) NIL)
((EQUAL X (CAR (CAR ALIST)))
(CAR ALIST))
(T (ASSOC-EQUAL X (CDR ALIST)))))
This event is redundant. See :DOC redundant-events.
Summary
Form: ( DEFUN ASSOC-EQUAL ...)
Rules: NIL
Warnings: None
Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
:REDUNDANT
ACL2 >>(DEFUN ASSIGNMENT (VAR ALIST)
(IF (QUOTEP VAR)
(A1 VAR)
(CDR (ASSOC-EQUAL VAR ALIST))))
Since ASSIGNMENT is non-recursive, its admission is trivial. We could
deduce no constraints on the type of ASSIGNMENT.
Summary
Form: ( DEFUN ASSIGNMENT ...)
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
ASSIGNMENT
ACL2 >>(DEFUN PEVAL (X ALIST)
(DECLARE (XARGS :MEASURE (CC X)))
(COND ((IF-EXPRP X)
(IF (PEVAL (A1 X) ALIST)
(PEVAL (A2 X) ALIST)
(PEVAL (A3 X) ALIST)))
(T (ASSIGNMENT X ALIST))))
For the admission of PEVAL we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (IF-EXPRP X)
(O< (CC (A1 X)) (CC X)))
(IMPLIES (AND (IF-EXPRP X) (PEVAL (A1 X) ALIST))
(O< (CC (A2 X)) (CC X)))
(IMPLIES (AND (IF-EXPRP X)
(NOT (PEVAL (A1 X) ALIST)))
(O< (CC (A3 X)) (CC X)))).
By the simple :definitions A1, A2, A3 and IF-EXPRP we reduce the conjecture
to the following four conjectures.
Subgoal 4
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 3
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(O< (CC (CADR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 3'
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(< (CC (CADR X)) (+ 1 (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These
steps produce the following two goals.
Subgoal 3.2
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
By case analysis we reduce the conjecture to
Subgoal 3.2'
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CC, EQUAL, NOT and SYMBOLP,
primitive type reasoning and the :rewrite rule DEFAULT-CAR.
Subgoal 3.1
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
By case analysis we reduce the conjecture to
Subgoal 3.1'
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS and FOLD-CONSTS-IN-+, to
Subgoal 3.1''
(< 0 (+ 2 (CC X4))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(PEVAL (CADR X) ALIST))
(O< (CC (CADDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to the following two conjectures.
Subgoal 2.2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(PEVAL (CADR X) ALIST)
(CONSP (CDR X)))
(< (CC (CADDR X))
(+ 1 1 (CC (CADR X)) (CC (CDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rule FOLD-CONSTS-IN-+, to
Subgoal 2.2'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(PEVAL (CADR X) ALIST)
(CONSP (CDR X)))
(< (CC (CADDR X))
(+ 2 (CC (CADR X)) (CC (CDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of three rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Finally, use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by
X5 and (CDR X4) by X6. These steps produce the following two goals.
Subgoal 2.2.2
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(PEVAL X3 ALIST))
(< (CC (CAR X4))
(+ 2 (CC X3) (CC X4)))).
By case analysis we reduce the conjecture to
Subgoal 2.2.2'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(PEVAL X3 ALIST))
(< (CC (CAR X4))
(+ 2 (CC X3) (CC X4)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterparts of CC, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CAR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 2.2.2''
(IMPLIES (AND (NOT (CONSP X4)) (PEVAL X3 ALIST))
(< 0 (+ 2 (CC X3)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.2.1
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(PEVAL X3 ALIST))
(< (CC X5)
(+ 2 (CC X3) (CC (CONS X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 2.2.1'
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(PEVAL X3 ALIST))
(< (CC X5)
(+ 2 (CC X3) (CC (CONS X5 X6))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 2.2.1''
(IMPLIES (PEVAL X3 ALIST)
(< 0 (+ 3 (CC X3) (CC X6)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(PEVAL (CADR X) ALIST)
(NOT (CONSP (CDR X))))
(< (CC (CADDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR and CC and the :rewrite rules DEFAULT-CAR and DEFAULT-CDR.
Subgoal 1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (PEVAL (CADR X) ALIST)))
(O< (CC (CADDDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to the following two conjectures.
Subgoal 1.2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (PEVAL (CADR X) ALIST))
(CONSP (CDR X)))
(< (CC (CADDDR X))
(+ 1 1 (CC (CADR X)) (CC (CDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rule FOLD-CONSTS-IN-+, to
Subgoal 1.2'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (PEVAL (CADR X) ALIST))
(CONSP (CDR X)))
(< (CC (CADDDR X))
(+ 2 (CC (CADR X)) (CC (CDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of four rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by X5 and
(CDR X4) by X6. (4) Finally, use CAR-CDR-ELIM to replace X6 by (CONS X7 X8),
(CAR X6) by X7 and (CDR X6) by X8. These steps produce the following
three goals.
Subgoal 1.2.3
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC (CADR X4))
(+ 2 (CC X3) (CC X4)))).
By case analysis we reduce the conjecture to
Subgoal 1.2.3'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC (CADR X4))
(+ 2 (CC X3) (CC X4)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterparts of CAR, CC, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CDR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 1.2.3''
(IMPLIES (AND (NOT (CONSP X4))
(NOT (PEVAL X3 ALIST)))
(< 0 (+ 2 (CC X3)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2.2
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC (CAR X6))
(+ 2 (CC X3) (CC (CONS X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 1.2.2'
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC (CAR X6))
(+ 2 (CC X3) (CC (CONS X5 X6))))).
This simplifies, using the :definitions CC, FIX and SYNP, the :executable-
counterparts of BINARY-+, CC, EQUAL, NOT and SYMBOLP, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-
+, COMMUTATIVITY-OF-+, DEFAULT-CAR, FOLD-CONSTS-IN-+ and UNICITY-OF-
0 and the :type-prescription rule CC, to
Subgoal 1.2.2''
(IMPLIES (AND (NOT (CONSP X6))
(NOT (PEVAL X3 ALIST)))
(< 0 (+ 3 (CC X3) (CC X5)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2.1
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC X7)
(+ 2 (CC X3) (CC (LIST* X5 X7 X8))))).
By case analysis we reduce the conjecture to
Subgoal 1.2.1'
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (PEVAL X3 ALIST)))
(< (CC X7)
(+ 2 (CC X3) (CC (LIST* X5 X7 X8))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 1.2.1''
(IMPLIES (NOT (PEVAL X3 ALIST))
(< 0 (+ 4 (CC X3) (CC X5) (CC X8)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (PEVAL (CADR X) ALIST))
(NOT (CONSP (CDR X))))
(< (CC (CADDDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR, CC and CDR and the :rewrite rules DEFAULT-CAR and DEFAULT-
CDR.
Q.E.D.
That completes the proof of the measure theorem for PEVAL. Thus, we
admit this function under the principle of definition. We could deduce
no constraints on the type of PEVAL.
Summary
Form: ( DEFUN PEVAL ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION A1)
(:DEFINITION A2)
(:DEFINITION A3)
(:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION IF-EXPRP)
(:DEFINITION NOT)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART SYMBOLP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DEFAULT-CAR)
(:REWRITE DEFAULT-CDR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.82 seconds (prove: 0.57, print: 0.23, other: 0.02)
PEVAL
ACL2 >>(DEFUN NORMP (X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (IF-EXPRP X)
(AND (NOT (IF-EXPRP (A1 X)))
(NORMP (A2 X))
(NORMP (A3 X)))
T))
For the admission of NORMP we will use the relation O< (which is known
to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (AND (IF-EXPRP X)
(NOT (IF-EXPRP (A1 X))))
(O< (CC (A2 X)) (CC X)))
(IMPLIES (AND (IF-EXPRP X)
(NOT (IF-EXPRP (A1 X)))
(NORMP (A2 X)))
(O< (CC (A3 X)) (CC X)))).
By the simple :definitions A1, A2, A3 and IF-EXPRP we reduce the conjecture
to the following three conjectures.
Subgoal 3
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (IF-EXPRP (CADR X))))
(O< (CC (CADDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX, IF-EXPRP and O<, the :executable-counterpart
of CC, primitive type reasoning, the :rewrite rule UNICITY-OF-0 and
the :type-prescription rule CC, to the following four conjectures.
Subgoal 2.4
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(CONSP (CDR X)))
(< (CC (CADDR X))
(+ 1 1 (CC (CDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rule FOLD-CONSTS-IN-+, to
Subgoal 2.4'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(CONSP (CDR X)))
(< (CC (CADDR X)) (+ 2 (CC (CDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of three rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Finally, use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by
X5 and (CDR X4) by X6. These steps produce the following two goals.
Subgoal 2.4.2
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (CONSP X3)))
(< (CC (CAR X4)) (+ 2 (CC X4)))).
By case analysis we reduce the conjecture to
Subgoal 2.4.2'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (CONSP X3)))
(< (CC (CAR X4)) (+ 2 (CC X4)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CC, EQUAL, NOT and SYMBOLP,
primitive type reasoning and the :rewrite rule DEFAULT-CAR.
Subgoal 2.4.1
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (CONSP X3)))
(< (CC X5) (+ 2 (CC (CONS X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 2.4.1'
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (CONSP X3)))
(< (CC X5) (+ 2 (CC (CONS X5 X6))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS and FOLD-CONSTS-IN-+, to
Subgoal 2.4.1''
(IMPLIES (NOT (CONSP X3))
(< 0 (+ 3 (CC X6)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.3
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CDR X))))
(< (CC (CADDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR, CC and CONSP and the :rewrite rules DEFAULT-CAR and DEFAULT-
CDR.
Subgoal 2.2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(CONSP (CDR X)))
(< (CC (CADDR X))
(+ 1 1 (CC (CADR X)) (CC (CDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rule FOLD-CONSTS-IN-+, to
Subgoal 2.2'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(CONSP (CDR X)))
(< (CC (CADDR X))
(+ 2 (CC (CADR X)) (CC (CDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of four rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by X5 and
(CDR X4) by X6. (4) Finally, use CAR-CDR-ELIM to replace X3 by (CONS X4 X7),
(CAR X3) by X4 and (CDR X3) by X7. These steps produce the following
three goals.
Subgoal 2.2.3
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF)))
(< (CC (CAR X4))
(+ 2 (CC X3) (CC X4)))).
By case analysis we reduce the conjecture to
Subgoal 2.2.3'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF)))
(< (CC (CAR X4))
(+ 2 (CC X3) (CC X4)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterparts of CC, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CAR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 2.2.3''
(IMPLIES (AND (NOT (CONSP X4))
(NOT (EQUAL (CAR X3) 'IF)))
(< 0 (+ 2 (CC X3)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.2.2
(IMPLIES (AND (NOT (CONSP X3))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF)))
(< (CC X5)
(+ 2 (CC X3) (CC (CONS X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 2.2.2'
(IMPLIES (AND (NOT (CONSP X3))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF)))
(< (CC X5)
(+ 2 (CC X3) (CC (CONS X5 X6))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, DEFAULT-CAR and FOLD-CONSTS-IN-+, to
Subgoal 2.2.2''
(IMPLIES (NOT (CONSP X3))
(< 0 (+ 3 (CC X6)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.2.1
(IMPLIES (AND (CONSP (CONS X4 X7))
(CONSP (CONS X5 X6))
(CONSP (LIST* (CONS X4 X7) X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 (CONS X4 X7) X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL X4 'IF)))
(< (CC X5)
(+ 2 (CC (CONS X4 X7))
(CC (CONS X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 2.2.1'
(IMPLIES (AND (CONSP (CONS X4 X7))
(CONSP (CONS X5 X6))
(CONSP (LIST* (CONS X4 X7) X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 (CONS X4 X7) X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL X4 'IF)))
(< (CC X5)
(+ 2 (CC (CONS X4 X7))
(CC (CONS X5 X6))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+ and FOLD-CONSTS-
IN-+, to
Subgoal 2.2.1''
(IMPLIES (NOT (EQUAL X4 'IF))
(< 0 (+ 4 (CC X4) (CC X6) (CC X7)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2.1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CDR X))))
(< (CC (CADDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR, CC and EQUAL and the :rewrite rules DEFAULT-CAR and DEFAULT-
CDR.
Subgoal 1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (IF-EXPRP (CADR X)))
(NORMP (CADDR X)))
(O< (CC (CADDDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX, IF-EXPRP and O<, the :executable-counterpart
of CC, primitive type reasoning, the :rewrite rule UNICITY-OF-0 and
the :type-prescription rule CC, to the following six conjectures.
Subgoal 1.6
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NORMP (CADDR X))
(NOT (CONSP (CDR X))))
(< (CC (CADDDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR, CC, CDR and CONSP and the :rewrite rules DEFAULT-CAR and
DEFAULT-CDR.
Subgoal 1.5
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NORMP (CADDR X))
(CONSP (CDR X))
(CONSP (CDDR X)))
(< (CC (CADDDR X))
(+ 1 1 1 (CC (CADDR X))
(CC (CDDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rule FOLD-CONSTS-IN-+, to
Subgoal 1.5'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NORMP (CADDR X))
(CONSP (CDR X))
(CONSP (CDDR X)))
(< (CC (CADDDR X))
(+ 3 (CC (CADDR X)) (CC (CDDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of four rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by X5 and
(CDR X4) by X6. (4) Finally, use CAR-CDR-ELIM to replace X6 by (CONS X7 X8),
(CAR X6) by X7 and (CDR X6) by X8. These steps produce the following
two goals.
Subgoal 1.5.2
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (CONSP X3))
(NORMP X5))
(< (CC (CAR X6))
(+ 3 (CC X5) (CC X6)))).
By case analysis we reduce the conjecture to
Subgoal 1.5.2'
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (CONSP X3))
(NORMP X5))
(< (CC (CAR X6))
(+ 3 (CC X5) (CC X6)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterparts of CC, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CAR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 1.5.2''
(IMPLIES (AND (NOT (CONSP X6))
(NOT (CONSP X3))
(NORMP X5))
(< 0 (+ 3 (CC X5)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.5.1
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (CONSP X3))
(NORMP X5))
(< (CC X7)
(+ 3 (CC X5) (CC (CONS X7 X8))))).
By case analysis we reduce the conjecture to
Subgoal 1.5.1'
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (CONSP X3))
(NORMP X5))
(< (CC X7)
(+ 3 (CC X5) (CC (CONS X7 X8))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 1.5.1''
(IMPLIES (AND (NOT (CONSP X3)) (NORMP X5))
(< 0 (+ 4 (CC X5) (CC X8)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.4
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NORMP (CADDR X))
(CONSP (CDR X))
(NOT (CONSP (CDDR X))))
(< (CC (CADDDR X)) 2)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR and CC and the :rewrite rules DEFAULT-CAR and DEFAULT-CDR.
Subgoal 1.3
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NORMP (CADDR X))
(NOT (CONSP (CDR X))))
(< (CC (CADDDR X)) 1)).
But simplification reduces this to T, using the :executable-counterparts
of <, CAR, CC, CDR and EQUAL and the :rewrite rules DEFAULT-CAR and
DEFAULT-CDR.
Subgoal 1.2
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NORMP (CADDR X))
(CONSP (CDR X))
(CONSP (CDDR X)))
(< (CC (CADDDR X))
(+ 1 1 (CC (CADR X))
1 (CC (CADDR X))
(CC (CDDDR X))))).
This simplifies, using the :definition SYNP, the :executable-counterpart
of BINARY-+ and the :rewrite rules COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-
IN-+, to
Subgoal 1.2'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NORMP (CADDR X))
(CONSP (CDR X))
(CONSP (CDDR X)))
(< (CC (CADDDR X))
(+ 3 (CC (CADR X))
(CC (CADDR X))
(CC (CDDDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of five rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by X5 and
(CDR X4) by X6. (4) Use CAR-CDR-ELIM to replace X6 by (CONS X7 X8),
(CAR X6) by X7 and (CDR X6) by X8. (5) Finally, use CAR-CDR-ELIM to
replace X3 by (CONS X4 X6), (CAR X3) by X4 and (CDR X3) by X6. These
steps produce the following three goals.
Subgoal 1.2.3
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF))
(NORMP X5))
(< (CC (CAR X6))
(+ 3 (CC X3) (CC X5) (CC X6)))).
By case analysis we reduce the conjecture to
Subgoal 1.2.3'
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF))
(NORMP X5))
(< (CC (CAR X6))
(+ 3 (CC X3) (CC X5) (CC X6)))).
This simplifies, using the :definitions CC and FIX, the :executable-
counterparts of CC, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :rewrite rules COMMUTATIVITY-OF-+, DEFAULT-CAR and UNICITY-OF-0
and the :type-prescription rule CC, to
Subgoal 1.2.3''
(IMPLIES (AND (NOT (CONSP X6))
(NOT (EQUAL (CAR X3) 'IF))
(NORMP X5))
(< 0 (+ 3 (CC X3) (CC X5)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2.2
(IMPLIES (AND (NOT (CONSP X3))
(CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF))
(NORMP X5))
(< (CC X7)
(+ 3 (CC X3)
(CC X5)
(CC (CONS X7 X8))))).
By case analysis we reduce the conjecture to
Subgoal 1.2.2'
(IMPLIES (AND (NOT (CONSP X3))
(CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF)
(NOT (EQUAL (CAR X3) 'IF))
(NORMP X5))
(< (CC X7)
(+ 3 (CC X3)
(CC X5)
(CC (CONS X7 X8))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, DEFAULT-CAR and FOLD-CONSTS-IN-
+, to
Subgoal 1.2.2''
(IMPLIES (AND (NOT (CONSP X3)) (NORMP X5))
(< 0 (+ 4 (CC X5) (CC X8)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2.1
(IMPLIES (AND (CONSP (CONS X4 X6))
(CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* (CONS X4 X6) X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 (CONS X4 X6) X5 X7 X8))
(EQUAL X1 'IF)
(NOT (EQUAL X4 'IF))
(NORMP X5))
(< (CC X7)
(+ 3 (CC (CONS X4 X6))
(CC X5)
(CC (CONS X7 X8))))).
By case analysis we reduce the conjecture to
Subgoal 1.2.1'
(IMPLIES (AND (CONSP (CONS X4 X6))
(CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* (CONS X4 X6) X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1
(CONSP (LIST* X1 (CONS X4 X6) X5 X7 X8))
(EQUAL X1 'IF)
(NOT (EQUAL X4 'IF))
(NORMP X5))
(< (CC X7)
(+ 3 (CC (CONS X4 X6))
(CC X5)
(CC (CONS X7 X8))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+, COMMUTATIVITY-OF-+ and FOLD-CONSTS-
IN-+, to
Subgoal 1.2.1''
(IMPLIES (AND (NOT (EQUAL X4 'IF)) (NORMP X5))
(< 0
(+ 5 (CC X4) (CC X5) (CC X6) (CC X8)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NORMP (CADDR X))
(CONSP (CDR X))
(NOT (CONSP (CDDR X))))
(< (CC (CADDDR X))
(+ 1 1 (CC (CADR X)) 0))).
This simplifies, using the :definitions FIX and SYNP, the :executable-
counterparts of BINARY-+, CAR and CC, the :rewrite rules COMMUTATIVITY-
OF-+, DEFAULT-CAR, DEFAULT-CDR, FOLD-CONSTS-IN-+ and UNICITY-OF-0 and
the :type-prescription rule CC, to
Subgoal 1.1'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NORMP NIL)
(CONSP (CDR X))
(NOT (CONSP (CDDR X))))
(< 0 (+ 2 (CC (CADR X))))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for NORMP. Thus, we
admit this function under the principle of definition. We observe that
the type of NORMP is described by the theorem
(OR (EQUAL (NORMP X) T) (EQUAL (NORMP X) NIL)).
Summary
Form: ( DEFUN NORMP ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION A1)
(:DEFINITION A2)
(:DEFINITION A3)
(:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION IF-EXPRP)
(:DEFINITION NOT)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART CONSP)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART SYMBOLP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DEFAULT-CAR)
(:REWRITE DEFAULT-CDR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 2.46 seconds (prove: 1.83, print: 0.62, other: 0.01)
NORMP
ACL2 >>(DEFUN IF-DEPTH (X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (IF-EXPRP X)
(+ 1 (IF-DEPTH (A1 X)))
0))
For the admission of IF-DEPTH we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (IF-EXPRP X)
(O< (CC (A1 X)) (CC X)))).
By the simple :definitions A1 and IF-EXPRP we reduce the conjecture
to the following two conjectures.
Subgoal 2
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(O< (CC (CADR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 1'
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(< (CC (CADR X)) (+ 1 (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These
steps produce the following two goals.
Subgoal 1.2
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
By case analysis we reduce the conjecture to
Subgoal 1.2'
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CC, EQUAL, NOT and SYMBOLP,
primitive type reasoning and the :rewrite rule DEFAULT-CAR.
Subgoal 1.1
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
By case analysis we reduce the conjecture to
Subgoal 1.1'
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS and FOLD-CONSTS-IN-+, to
Subgoal 1.1''
(< 0 (+ 2 (CC X4))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for IF-DEPTH. Thus,
we admit this function under the principle of definition. We observe
that the type of IF-DEPTH is described by the theorem
(AND (INTEGERP (IF-DEPTH X)) (<= 0 (IF-DEPTH X))). We used primitive
type reasoning.
Summary
Form: ( DEFUN IF-DEPTH ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION A1)
(:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION IF-EXPRP)
(:DEFINITION NOT)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART SYMBOLP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE DEFAULT-CAR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.15 seconds (prove: 0.09, print: 0.04, other: 0.02)
IF-DEPTH
ACL2 >>(DEFUN IF-COMPLEXITY (X)
(DECLARE (XARGS :MEASURE (CC X)))
(IF (IF-EXPRP X)
(* (IF-COMPLEXITY (A1 X))
(+ (IF-COMPLEXITY (A2 X))
(IF-COMPLEXITY (A3 X))))
1))
For the admission of IF-COMPLEXITY we will use the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (CC X). The non-trivial part of the measure conjecture is
Goal
(AND (O-P (CC X))
(IMPLIES (IF-EXPRP X)
(O< (CC (A2 X)) (CC X)))
(IMPLIES (IF-EXPRP X)
(O< (CC (A1 X)) (CC X)))
(IMPLIES (IF-EXPRP X)
(O< (CC (A3 X)) (CC X)))).
By the simple :definitions A1, A2, A3 and IF-EXPRP we reduce the conjecture
to the following four conjectures.
Subgoal 4
(O-P (CC X)).
But simplification reduces this to T, using the :compound-recognizer
rules NATP-CR and O-FINP-CR, the :rewrite rule O-P-DEF-O-FINP-1 and
the :type-prescription rule CC.
Subgoal 3
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(O< (CC (CADDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 3'
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(< (CC (CADDR X)) (+ 1 (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of three rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Finally, use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by
X5 and (CDR X4) by X6. These steps produce the following three goals.
Subgoal 3.3
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CADR X2)) (+ 1 (CC X2)))).
By case analysis we reduce the conjecture to
Subgoal 3.3'
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CADR X2)) (+ 1 (CC X2)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CAR, CC, EQUAL, NOT and SYMBOLP,
primitive type reasoning and the :rewrite rule DEFAULT-CDR.
Subgoal 3.2
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC (CAR X4))
(+ 1 (CC (CONS X3 X4))))).
By case analysis we reduce the conjecture to
Subgoal 3.2'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC (CAR X4))
(+ 1 (CC (CONS X3 X4))))).
This simplifies, using the :definitions CC, FIX and SYNP, the :executable-
counterparts of BINARY-+, CC, EQUAL, NOT and SYMBOLP, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-OF-
+, DEFAULT-CAR, FOLD-CONSTS-IN-+ and UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 3.2''
(IMPLIES (NOT (CONSP X4))
(< 0 (+ 2 (CC X3)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 3.1
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF))
(< (CC X5)
(+ 1 (CC (LIST* X3 X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 3.1'
(IMPLIES (AND (CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF))
(< (CC X5)
(+ 1 (CC (LIST* X3 X5 X6))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 3.1''
(< 0 (+ 3 (CC X3) (CC X6))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 2
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(O< (CC (CADR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 2'
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(< (CC (CADR X)) (+ 1 (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. These
steps produce the following two goals.
Subgoal 2.2
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
By case analysis we reduce the conjecture to
Subgoal 2.2'
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CAR X2)) (+ 1 (CC X2)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CC, EQUAL, NOT and SYMBOLP,
primitive type reasoning and the :rewrite rule DEFAULT-CAR.
Subgoal 2.1
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
By case analysis we reduce the conjecture to
Subgoal 2.1'
(IMPLIES (AND (CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC X3) (+ 1 (CC (CONS X3 X4))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS and FOLD-CONSTS-IN-+, to
Subgoal 2.1''
(< 0 (+ 2 (CC X4))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(O< (CC (CADDDR X)) (CC X))).
This simplifies, using the :compound-recognizer rule O-FINP-CR, the
:definitions CC, FIX and O<, the :executable-counterpart of CC, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule CC, to
Subgoal 1'
(IMPLIES (AND (CONSP X) (EQUAL (CAR X) 'IF))
(< (CC (CADDDR X)) (+ 1 (CC (CDR X))))).
The destructor terms (CAR X) and (CDR X) can be eliminated. Furthermore,
those terms are at the root of a chain of four rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces. (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4. (3)
Use CAR-CDR-ELIM to replace X4 by (CONS X5 X6), (CAR X4) by X5 and
(CDR X4) by X6. (4) Finally, use CAR-CDR-ELIM to replace X6 by (CONS X7 X8),
(CAR X6) by X7 and (CDR X6) by X8. These steps produce the following
four goals.
Subgoal 1.4
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CADDR X2)) (+ 1 (CC X2)))).
By case analysis we reduce the conjecture to
Subgoal 1.4'
(IMPLIES (AND (NOT (CONSP X2))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (CONS X1 X2))
(EQUAL X1 'IF))
(< (CC (CADDR X2)) (+ 1 (CC X2)))).
But simplification reduces this to T, using the :definition CC, the
:executable-counterparts of <, BINARY-+, CAR, CC, CDR, EQUAL, NOT and
SYMBOLP, primitive type reasoning and the :rewrite rule DEFAULT-CDR.
Subgoal 1.3
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC (CADR X4))
(+ 1 (CC (CONS X3 X4))))).
By case analysis we reduce the conjecture to
Subgoal 1.3'
(IMPLIES (AND (NOT (CONSP X4))
(CONSP (CONS X3 X4))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X4))
(EQUAL X1 'IF))
(< (CC (CADR X4))
(+ 1 (CC (CONS X3 X4))))).
This simplifies, using the :definitions CC, FIX and SYNP, the :executable-
counterparts of BINARY-+, CAR, CC, EQUAL, NOT and SYMBOLP, primitive
type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-
OF-+, DEFAULT-CDR, FOLD-CONSTS-IN-+ and UNICITY-OF-0 and the :type-
prescription rule CC, to
Subgoal 1.3''
(IMPLIES (NOT (CONSP X4))
(< 0 (+ 2 (CC X3)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.2
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF))
(< (CC (CAR X6))
(+ 1 (CC (LIST* X3 X5 X6))))).
By case analysis we reduce the conjecture to
Subgoal 1.2'
(IMPLIES (AND (NOT (CONSP X6))
(CONSP (CONS X5 X6))
(CONSP (LIST* X3 X5 X6))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X6))
(EQUAL X1 'IF))
(< (CC (CAR X6))
(+ 1 (CC (LIST* X3 X5 X6))))).
This simplifies, using the :definitions CC, FIX and SYNP, the :executable-
counterparts of BINARY-+, CC, EQUAL, NOT and SYMBOLP, primitive type
reasoning, the :rewrite rules CAR-CONS, CDR-CONS, COMMUTATIVITY-2-OF-
+, COMMUTATIVITY-OF-+, DEFAULT-CAR, FOLD-CONSTS-IN-+ and UNICITY-OF-
0 and the :type-prescription rule CC, to
Subgoal 1.2''
(IMPLIES (NOT (CONSP X6))
(< 0 (+ 3 (CC X3) (CC X5)))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Subgoal 1.1
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
(NOT (EQUAL X1 NIL))
(CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF))
(< (CC X7)
(+ 1 (CC (LIST* X3 X5 X7 X8))))).
By case analysis we reduce the conjecture to
Subgoal 1.1'
(IMPLIES (AND (CONSP (CONS X7 X8))
(CONSP (LIST* X5 X7 X8))
(CONSP (LIST* X3 X5 X7 X8))
(SYMBOLP X1)
(NOT (EQUAL X1 T))
X1 (CONSP (LIST* X1 X3 X5 X7 X8))
(EQUAL X1 'IF))
(< (CC X7)
(+ 1 (CC (LIST* X3 X5 X7 X8))))).
This simplifies, using the :definitions CC and SYNP, the :executable-
counterparts of BINARY-+, EQUAL, NOT and SYMBOLP, primitive type reasoning,
the :meta rule CANCEL_PLUS-LESSP-CORRECT and the :rewrite rules CAR-
CONS, CDR-CONS, COMMUTATIVITY-2-OF-+ and FOLD-CONSTS-IN-+, to
Subgoal 1.1''
(< 0 (+ 4 (CC X3) (CC X5) (CC X8))).
But simplification reduces this to T, using primitive type reasoning
and the :type-prescription rule CC.
Q.E.D.
That completes the proof of the measure theorem for IF-COMPLEXITY.
Thus, we admit this function under the principle of definition. We
observe that the type of IF-COMPLEXITY is described by the theorem
(AND (INTEGERP (IF-COMPLEXITY X)) (< 0 (IF-COMPLEXITY X))). We used
primitive type reasoning.
Summary
Form: ( DEFUN IF-COMPLEXITY ...)
Rules: ((:COMPOUND-RECOGNIZER NATP-CR)
(:COMPOUND-RECOGNIZER O-FINP-CR)
(:DEFINITION A1)
(:DEFINITION A2)
(:DEFINITION A3)
(:DEFINITION CC)
(:DEFINITION FIX)
(:DEFINITION IF-EXPRP)
(:DEFINITION NOT)
(:DEFINITION O<)
(:DEFINITION SYNP)
(:ELIM CAR-CDR-ELIM)
(:EXECUTABLE-COUNTERPART <)
(:EXECUTABLE-COUNTERPART BINARY-+)
(:EXECUTABLE-COUNTERPART CAR)
(:EXECUTABLE-COUNTERPART CC)
(:EXECUTABLE-COUNTERPART CDR)
(:EXECUTABLE-COUNTERPART EQUAL)
(:EXECUTABLE-COUNTERPART NOT)
(:EXECUTABLE-COUNTERPART SYMBOLP)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:META CANCEL_PLUS-LESSP-CORRECT)
(:REWRITE CAR-CONS)
(:REWRITE CDR-CONS)
(:REWRITE COMMUTATIVITY-2-OF-+)
(:REWRITE COMMUTATIVITY-OF-+)
(:REWRITE DEFAULT-CAR)
(:REWRITE DEFAULT-CDR)
(:REWRITE FOLD-CONSTS-IN-+)
(:REWRITE O-P-DEF-O-FINP-1)
(:REWRITE UNICITY-OF-0)
(:TYPE-PRESCRIPTION CC))
Warnings: None
Time: 0.62 seconds (prove: 0.27, print: 0.33, other: 0.02)
IF-COMPLEXITY
ACL2 >>(THEOREM PROBLEM-133A (<= 1 (IF-COMPLEXITY X))
:HINTS
(("Goal" :INDUCT (IF-COMPLEXITY X)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (IF-COMPLEXITY X).
This suggestion was produced using the :induction rule IF-COMPLEXITY.
If we let (:P X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (IF-EXPRP X)) (:P X))
(IMPLIES (AND (IF-EXPRP X)
(:P (A1 X))
(:P (A2 X))
(:P (A3 X)))
(:P X))).
This induction is justified by the same argument used to admit IF-COMPLEXITY,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
the following two nontautological subgoals.
Subgoal *1/2
(IMPLIES (NOT (IF-EXPRP X))
(<= 1 (IF-COMPLEXITY X))).
But we reduce the conjecture to T, by primitive type reasoning and
the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/1
(IMPLIES (AND (IF-EXPRP X)
(<= 1 (IF-COMPLEXITY (A1 X)))
(<= 1 (IF-COMPLEXITY (A2 X)))
(<= 1 (IF-COMPLEXITY (A3 X))))
(<= 1 (IF-COMPLEXITY X))).
But we reduce the conjecture to T, by primitive type reasoning and
the :type-prescription rule IF-COMPLEXITY.
That completes the proof of *1.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-133A ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)
(:INDUCTION IF-COMPLEXITY)
(:TYPE-PRESCRIPTION IF-COMPLEXITY))
Warnings: None
Time: 0.05 seconds (prove: 0.00, print: 0.04, other: 0.01)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
PROBLEM-133A
ACL2 >>(THEOREM PROBLEM-133B
(IMPLIES (AND (RATIONALP X)
(RATIONALP Y)
(<= 1 X)
(< 0 Y))
(<= Y (* X Y)))
:RULE-CLASSES :LINEAR)
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
But simplification reduces this to T, using primitive type reasoning
and the :rewrite rule <-*-X-Y-Y.
Q.E.D.
Summary
Form: ( DEFTHM PROBLEM-133B ...)
Rules: ((:DEFINITION NOT)
(:FAKE-RUNE-FOR-TYPE-SET NIL)
(:REWRITE <-*-X-Y-Y))
Warnings: None
Time: 0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
Summary
Form: (IN-THEORY (DISABLE ...))
Rules: NIL
Warnings: None
Time: 0.02 seconds (prove: 0.00, print: 0.00, other: 0.02)
PROBLEM-133B
ACL2 >>(THEOREM PROBLEM-133C
(IMPLIES (IF-EXPRP X)
(< (IF-COMPLEXITY (A2 X))
(IF-COMPLEXITY X)))
:HINTS
(("Goal" :INDUCT (IF-COMPLEXITY X)
:IN-THEORY (ENABLE PROBLEM-133B)))
:RULE-CLASSES :LINEAR)
ACL2 Warning [Non-rec] in ( DEFTHM PROBLEM-133C ...): The :LINEAR
rule generated from PROBLEM-133C will be triggered only by terms containing
the non-recursive function symbol A2. Unless this function is disabled,
such triggering terms are unlikely to arise and so PROBLEM-133C is
unlikely to ever be used.
[Note: A hint was supplied for our processing of the goal above.
Thanks!]
Name the formula above *1.
We have been told to use induction. One induction scheme is suggested
by the induction hint.
We will induct according to a scheme suggested by (IF-COMPLEXITY X).
This suggestion was produced using the :induction rule IF-COMPLEXITY.
If we let (:P X) denote *1 above then the induction scheme we'll use
is
(AND (IMPLIES (NOT (IF-EXPRP X)) (:P X))
(IMPLIES (AND (IF-EXPRP X)
(:P (A1 X))
(:P (A2 X))
(:P (A3 X)))
(:P X))).
This induction is justified by the same argument used to admit IF-COMPLEXITY,
namely, the measure (CC X) is decreasing according to the relation
O< (which is known to be well-founded on the domain recognized by O-
P). When applied to the goal at hand the above induction scheme produces
one nontautological subgoal.
Subgoal *1/
(IMPLIES (AND (IF-EXPRP X)
(IMPLIES (IF-EXPRP (A1 X))
(< (IF-COMPLEXITY (A2 (A1 X)))
(IF-COMPLEXITY (A1 X))))
(IMPLIES (IF-EXPRP (A2 X))
(< (IF-COMPLEXITY (A2 (A2 X)))
(IF-COMPLEXITY (A2 X))))
(IMPLIES (IF-EXPRP (A3 X))
(< (IF-COMPLEXITY (A2 (A3 X)))
(IF-COMPLEXITY (A3 X)))))
(IMPLIES (IF-EXPRP X)
(< (IF-COMPLEXITY (A2 X))
(IF-COMPLEXITY X)))).
By the simple :definitions A1, A2, A3 and IF-EXPRP we reduce the conjecture
to
Subgoal *1/'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(IMPLIES (IF-EXPRP (CADR X))
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X))))
(IMPLIES (IF-EXPRP (CADDR X))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X))))
(IMPLIES (IF-EXPRP (CADDDR X))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X)))))
(< (IF-COMPLEXITY (CADDR X))
(IF-COMPLEXITY X))).
This simplifies, using the :definitions IF-COMPLEXITY and IF-EXPRP,
the :executable-counterpart of EQUAL and the :rewrite rule DISTRIBUTIVITY,
to the following 27 conjectures.
Subgoal *1/27
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/27'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/26
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/26'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/25
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/25'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/24
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/24'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/23
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/23'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/22
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/22'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/21
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/21'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/20
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/20'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/19
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/19'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (CONSP (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/18
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/18'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/17
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/17'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/16
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/16'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/15
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/15'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/14
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/14'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/13
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/13'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/12
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/12'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/11
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/11'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/10
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/10'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(< (IF-COMPLEXITY (CADDAR (CDR X)))
(IF-COMPLEXITY (CADR X)))
(NOT (EQUAL (CAADDR X) 'IF))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/9
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/9'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/8
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/8'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CADDDR X))))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/7
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/7'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(NOT (CONSP (CADDR X)))
(NOT (EQUAL (CAADDR (CDR X)) 'IF)))
(< 1
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule IF-COMPLEXITY.
Subgoal *1/6
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A2 X)))
(* (IF-COMPLEXITY (A1 X))
(IF-COMPLEXITY (A3 X)))))).
By the simple :definitions A1, A2 and A3 we reduce the conjecture to
Subgoal *1/6'
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(NOT (CONSP (CADDDR X))))
(< (IF-COMPLEXITY (CADDR X))
(+ (* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDR X)))
(* (IF-COMPLEXITY (CADR X))
(IF-COMPLEXITY (CADDDR X)))))).
But simplification reduces this to T, using linear arithmetic, primitive
type reasoning, the :linear rule PROBLEM-133B and the :type-prescription
rule IF-COMPLEXITY.
Subgoal *1/5
(IMPLIES (AND (CONSP X)
(EQUAL (CAR X) 'IF)
(NOT (EQUAL (CAADR X) 'IF))
(< (IF-COMPLEXITY (CADDAR (CDDR X)))
(IF-COMPLEXITY (CADDR X)))
(< (IF-COMPLEXITY (CADDAR (CDDDR X)))
(IF-COMPLEXITY (CA**