1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
; Milawa - A Reflective Theorem Prover
; Copyright (C) 2005-2009 Kookamara LLC
;
; Contact:
;
; Kookamara LLC
; 11410 Windermere Meadows
; Austin, TX 78759, USA
; http://www.kookamara.com/
;
; License: (An MIT/X11-style license)
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
;
; Original author: Jared Davis <jared@kookamara.com>
(in-package "MILAWA")
(include-book "depth-3-special")
(%interactive)
(%autoadmit clause.lift-term1)
(defmacro %clause.lift-term1-induction (x)
`(%induct (rank ,x)
((logic.constantp ,x)
nil)
((logic.variablep ,x)
nil)
((logic.functionp ,x)
(((,x (first (logic.function-args ,x))))
((,x (second (logic.function-args ,x))))
((,x (third (logic.function-args ,x))))))
((logic.lambdap ,x)
nil)
((and (not (logic.constantp ,x))
(not (logic.variablep ,x))
(not (logic.functionp ,x))
(not (logic.lambdap ,x)))
nil)))
(local (%disable default
same-length-prefixes-equal-cheap
logic.termp-when-logic.formulap))
(%autoprove forcing-logic.termp-of-clause.lift-term1
(%clause.lift-term1-induction x)
(%restrict default clause.lift-term1 (equal x 'x))
(%disable default
expensive-arithmetic-rules
type-set-like-rules))
(%autoprove forcing-logic.term-atblp-of-clause.lift-term1
(%clause.lift-term1-induction x)
(%restrict default clause.lift-term1 (equal x 'x))
(%disable default
expensive-arithmetic-rules
type-set-like-rules))
(%autoprove clause.lift-term1-when-no-clause.unlifted-subterms
(%clause.lift-term1-induction x)
(%restrict default clause.lift-term1 (equal x 'x))
(%disable default
expensive-arithmetic-rules
type-set-like-rules))
(%autoprove forcing-clause.depth-of-clause.factor-strong)
(local (%enable default forcing-clause.depth-of-clause.factor-strong))
(%autoprove lemma-for-clause.depth-decreases-in-lambda-case
(%disable default clause.deepest-weakly-deeper-than-any-member)
(%use (%instance (%thm clause.deepest-weakly-deeper-than-any-member)
(x (logic.lambda-actuals x))
(a (clause.deepest-after-factoring (logic.lambda-actuals x) assignment)))))
(%autoprove lemma2-for-clause.depth-decreases-in-lambda-case
(%disable default
expensive-arithmetic-rules
type-set-like-rules
clause.simple-term-listp-of-domain-of-clause.cases
disjoint-from-nonep-of-domain-of-clause.cases
lemma-for-clause.depth-decreases-in-lambda-case)
(%use (%instance (%thm lemma-for-clause.depth-decreases-in-lambda-case)
(assignment (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.lambda-actuals x)) nil)))))
(%use (%instance (%thm clause.simple-term-listp-of-domain-of-clause.cases)
(x (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.lambda-actuals x)) nil)))
(cases (clause.simple-tests-list (logic.lambda-actuals x)))
(assignment nil)))
(%use (%instance (%thm disjoint-from-nonep-of-domain-of-clause.cases)
(x (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.lambda-actuals x)) nil)))
(cases (clause.simple-tests-list (logic.lambda-actuals x)))
(set (clause.term-paths-list (logic.lambda-actuals x)))
(assignment nil))))
(%autoprove clause.depth-decreases-in-lambda-case
(%enable default
clause.depth-list-redefinition
lemma2-for-clause.depth-decreases-in-lambda-case)
(%disable default
expensive-arithmetic-rules
type-set-like-rules))
(%autoprove lemma-for-clause.depth-decreases-in-logic.functionp-case
(%disable default clause.deepest-weakly-deeper-than-any-member)
(%use (%instance (%thm clause.deepest-weakly-deeper-than-any-member)
(x (logic.function-args x))
(a (clause.deepest-after-factoring (logic.function-args x) assignment)))))
(%autoprove lemma2-for-clause.depth-decreases-in-logic.functionp-case
(%disable default
clause.simple-term-listp-of-domain-of-clause.cases
disjoint-from-nonep-of-domain-of-clause.cases
lemma-for-clause.depth-decreases-in-logic.functionp-case
type-set-like-rules
expensive-arithmetic-rules)
(%use (%instance (%thm lemma-for-clause.depth-decreases-in-logic.functionp-case)
(assignment (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.function-args x)) nil)))))
(%use (%instance (%thm clause.simple-term-listp-of-domain-of-clause.cases)
(x (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.function-args x)) nil)))
(cases (clause.simple-tests-list (logic.function-args x)))
(assignment nil)))
(%use (%instance (%thm disjoint-from-nonep-of-domain-of-clause.cases)
(x (clause.special-assignment x (clause.cases (clause.simple-tests-list (logic.function-args x)) nil)))
(cases (clause.simple-tests-list (logic.function-args x)))
(set (clause.term-paths-list (logic.function-args x)))
(assignment nil))))
(%autoprove clause.depth-decreases-in-non-if-logic.functionp-case
(%disable default
expensive-arithmetic-rules
type-set-like-rules
clause.simple-termp-when-bad-args-logic.functionp
clause.unlifted-subterms-when-bad-args-logic.functionp)
(%enable default
clause.depth-list-redefinition
lemma2-for-clause.depth-decreases-in-logic.functionp-case))
(%autoprove clause.depth-decreases-in-bad-args-logic.functionp-case
(%enable default
clause.depth-list-redefinition
lemma2-for-clause.depth-decreases-in-logic.functionp-case))
(%autoprove clause.lift-term1-makes-progress
(%clause.lift-term1-induction x)
(%auto :strategy (cleanup split urewrite))
(%disable default
expensive-arithmetic-rules
type-set-like-rules)
(%crewrite default)
(%auto :strategy (cleanup split urewrite))
(%restrict default definition-of-clause.depth (equal x 'x))
(%restrict default clause.lift-term1 (equal x 'x))
(%enable default
clause.depth-decreases-in-bad-args-logic.functionp-case
clause.depth-decreases-in-non-if-logic.functionp-case
clause.depth-decreases-in-lambda-case)
(%disable default
expensive-arithmetic-rules-two
clause.depth-list-when-length-three)
(%crewrite default)
(%auto :strategy (cleanup split urewrite))
(%crewrite default)
(%auto :strategy (cleanup split urewrite))
(%enable default
clause.depth-list-when-length-three
expensive-arithmetic-rules
expensive-arithmetic-rules-two
type-set-like-rules))
|