occam-verify-cli 1.0.438 → 1.0.448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/file.js +42 -39
- package/lib/context/local.js +34 -34
- package/lib/context/release.js +3 -7
- package/lib/context/temporary.js +26 -26
- package/lib/element/assertion/contained.js +45 -45
- package/lib/element/assertion/defined.js +13 -13
- package/lib/element/assertion/property.js +23 -22
- package/lib/element/assertion/satisfies.js +7 -6
- package/lib/element/assertion/subproof.js +20 -17
- package/lib/element/assertion/type.js +3 -2
- package/lib/element/assertion.js +1 -23
- package/lib/element/assumption.js +24 -22
- package/lib/element/axiom.js +27 -30
- package/lib/element/axiomLemmaTheoremConjecture.js +50 -57
- package/lib/element/{statement/combinator → combinator}/bracketed.js +16 -16
- package/lib/element/combinator.js +229 -0
- package/lib/element/conclusion.js +11 -9
- package/lib/element/{term/constructor → constructor}/bracketed.js +5 -5
- package/lib/element/constructor.js +232 -0
- package/lib/element/declaration/combinator.js +2 -16
- package/lib/element/declaration/complexType.js +12 -12
- package/lib/element/declaration/constructor.js +13 -11
- package/lib/element/declaration/simpleType.js +4 -4
- package/lib/element/declaration/typePrefix.js +2 -2
- package/lib/element/declaration/variable.js +3 -3
- package/lib/element/deduction.js +11 -9
- package/lib/element/derivation.js +17 -20
- package/lib/element/equivalence.js +10 -10
- package/lib/element/equivalences.js +5 -5
- package/lib/element/frame.js +32 -38
- package/lib/element/hypothesis.js +16 -57
- package/lib/element/judgement.js +6 -4
- package/lib/element/label.js +8 -8
- package/lib/element/metaLemmaMetatheorem.js +6 -39
- package/lib/element/metaType.js +17 -80
- package/lib/element/metavariable.js +38 -34
- package/lib/element/parameter.js +3 -3
- package/lib/element/premise.js +92 -174
- package/lib/element/proof.js +7 -7
- package/lib/element/proofAssertion.js +203 -0
- package/lib/element/property.js +9 -9
- package/lib/element/propertyRelation.js +13 -13
- package/lib/element/reference.js +16 -17
- package/lib/element/rule.js +46 -46
- package/lib/element/signature.js +11 -11
- package/lib/element/statement.js +18 -18
- package/lib/element/step.js +73 -124
- package/lib/element/subDerivation.js +17 -20
- package/lib/element/subproof.js +16 -24
- package/lib/element/substitution/frame.js +1 -7
- package/lib/element/substitution/reference.js +2 -3
- package/lib/element/substitution/statement.js +44 -15
- package/lib/element/substitution/term.js +10 -57
- package/lib/element/substitution.js +5 -11
- package/lib/element/substitutions.js +29 -29
- package/lib/element/supposition.js +95 -177
- package/lib/element/term.js +21 -34
- package/lib/element/type.js +47 -60
- package/lib/element/typePrefix.js +5 -5
- package/lib/element/variable.js +9 -9
- package/lib/element.js +9 -3
- package/lib/metaTypes.js +63 -0
- package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
- package/lib/node/body/axiom.js +2 -25
- package/lib/node/body/conjecture.js +2 -25
- package/lib/node/body/lemma.js +2 -25
- package/lib/node/body/metaLemma.js +2 -25
- package/lib/node/body/metatheorem.js +2 -25
- package/lib/node/body/rule.js +15 -1
- package/lib/node/body/theorem.js +2 -25
- package/lib/node/body.js +25 -2
- package/lib/node/combinator.js +11 -2
- package/lib/node/constructor.js +11 -2
- package/lib/node/declaration/combinator.js +5 -5
- package/lib/node/declaration/constructor.js +8 -8
- package/lib/node/declaration/property.js +15 -15
- package/lib/node/declaration/simpleType.js +31 -31
- package/lib/node/declaration/variable.js +8 -8
- package/lib/node/equality.js +8 -8
- package/lib/node/frame.js +20 -20
- package/lib/node/header.js +22 -22
- package/lib/node/metaLemmaMetaTheorem.js +16 -16
- package/lib/node/metavariable.js +15 -15
- package/lib/node/property.js +8 -8
- package/lib/node/propertyRelation.js +8 -8
- package/lib/node/rule.js +16 -16
- package/lib/node/statement.js +12 -12
- package/lib/node/step.js +22 -22
- package/lib/node/subDerivation.js +1 -8
- package/lib/node/subproof.js +5 -12
- package/lib/node/substitution/frame.js +19 -19
- package/lib/node/substitution/statement.js +19 -19
- package/lib/node/substitution/term.js +19 -19
- package/lib/node/term.js +35 -35
- package/lib/preamble.js +5 -5
- package/lib/process/instantiate.js +20 -2
- package/lib/process/unify.js +39 -42
- package/lib/process/validate.js +431 -0
- package/lib/process/verify.js +44 -135
- package/lib/types.js +27 -0
- package/lib/utilities/brackets.js +9 -14
- package/lib/utilities/element.js +91 -55
- package/lib/utilities/instance.js +41 -28
- package/lib/utilities/statement.js +2 -2
- package/lib/utilities/string.js +25 -14
- package/lib/utilities/unification.js +237 -0
- package/lib/utilities/validation.js +251 -0
- package/package.json +6 -6
- package/src/context/file.js +40 -34
- package/src/context/local.js +34 -34
- package/src/context/release.js +2 -6
- package/src/context/temporary.js +15 -15
- package/src/element/assertion/contained.js +19 -20
- package/src/element/assertion/defined.js +11 -12
- package/src/element/assertion/property.js +20 -20
- package/src/element/assertion/satisfies.js +6 -6
- package/src/element/assertion/subproof.js +17 -15
- package/src/element/assertion/type.js +2 -2
- package/src/element/assertion.js +0 -2
- package/src/element/assumption.js +22 -19
- package/src/element/axiom.js +33 -37
- package/src/element/axiomLemmaTheoremConjecture.js +54 -73
- package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
- package/src/element/combinator.js +90 -0
- package/src/element/conclusion.js +12 -10
- package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
- package/src/element/{term/constructor.js → constructor.js} +17 -25
- package/src/element/declaration/combinator.js +1 -22
- package/src/element/declaration/complexType.js +11 -11
- package/src/element/declaration/constructor.js +13 -10
- package/src/element/declaration/simpleType.js +3 -3
- package/src/element/declaration/typePrefix.js +1 -1
- package/src/element/declaration/variable.js +2 -2
- package/src/element/deduction.js +12 -9
- package/src/element/derivation.js +15 -19
- package/src/element/equivalence.js +8 -8
- package/src/element/equivalences.js +4 -4
- package/src/element/frame.js +28 -30
- package/src/element/hypothesis.js +16 -18
- package/src/element/judgement.js +6 -3
- package/src/element/label.js +4 -4
- package/src/element/metaLemmaMetatheorem.js +5 -69
- package/src/element/metaType.js +9 -45
- package/src/element/metavariable.js +34 -31
- package/src/element/parameter.js +2 -2
- package/src/element/premise.js +124 -99
- package/src/element/proof.js +6 -6
- package/src/element/proofAssertion.js +76 -0
- package/src/element/property.js +6 -6
- package/src/element/propertyRelation.js +11 -11
- package/src/element/reference.js +14 -21
- package/src/element/rule.js +39 -38
- package/src/element/signature.js +10 -9
- package/src/element/statement.js +16 -18
- package/src/element/step.js +78 -78
- package/src/element/subDerivation.js +15 -19
- package/src/element/subproof.js +11 -19
- package/src/element/substitution/frame.js +0 -2
- package/src/element/substitution/reference.js +1 -5
- package/src/element/substitution/statement.js +44 -14
- package/src/element/substitution/term.js +10 -13
- package/src/element/substitution.js +3 -5
- package/src/element/substitutions.js +48 -30
- package/src/element/supposition.js +127 -108
- package/src/element/term.js +18 -28
- package/src/element/type.js +42 -36
- package/src/element/typePrefix.js +3 -3
- package/src/element/variable.js +7 -7
- package/src/element.js +3 -1
- package/src/metaTypes.js +55 -0
- package/src/node/axiomLemmaTheoremConjecture.js +6 -6
- package/src/node/body/axiom.js +0 -21
- package/src/node/body/conjecture.js +0 -23
- package/src/node/body/lemma.js +0 -23
- package/src/node/body/metaLemma.js +0 -23
- package/src/node/body/metatheorem.js +0 -23
- package/src/node/body/rule.js +12 -0
- package/src/node/body/theorem.js +0 -23
- package/src/node/body.js +23 -0
- package/src/node/combinator.js +9 -0
- package/src/node/constructor.js +9 -0
- package/src/node/declaration/combinator.js +5 -5
- package/src/node/declaration/constructor.js +8 -8
- package/src/node/declaration/property.js +14 -14
- package/src/node/declaration/simpleType.js +31 -31
- package/src/node/declaration/variable.js +7 -7
- package/src/node/equality.js +7 -7
- package/src/node/frame.js +21 -21
- package/src/node/header.js +22 -22
- package/src/node/metaLemmaMetaTheorem.js +14 -14
- package/src/node/metavariable.js +14 -14
- package/src/node/property.js +7 -7
- package/src/node/propertyRelation.js +7 -7
- package/src/node/rule.js +15 -15
- package/src/node/statement.js +12 -12
- package/src/node/step.js +21 -21
- package/src/node/subDerivation.js +0 -7
- package/src/node/subproof.js +4 -11
- package/src/node/substitution/frame.js +18 -18
- package/src/node/substitution/statement.js +18 -18
- package/src/node/substitution/term.js +18 -18
- package/src/node/term.js +34 -34
- package/src/preamble.js +4 -4
- package/src/process/instantiate.js +12 -0
- package/src/process/unify.js +53 -57
- package/src/process/validate.js +316 -0
- package/src/process/verify.js +50 -138
- package/src/types.js +18 -0
- package/src/utilities/brackets.js +15 -14
- package/src/utilities/element.js +125 -82
- package/src/utilities/instance.js +42 -24
- package/src/utilities/statement.js +2 -2
- package/src/utilities/string.js +38 -24
- package/src/{mixins/step/unify.js → utilities/unification.js} +99 -85
- package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
- package/lib/element/statement/combinator.js +0 -105
- package/lib/element/term/constructor.js +0 -172
- package/lib/mixins/statement/validate.js +0 -198
- package/lib/mixins/step/unify.js +0 -228
- package/lib/mixins/term/verify.js +0 -65
- package/src/element/statement/combinator.js +0 -59
- package/src/mixins/term/verify.js +0 -81
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import elements from "
|
|
5
|
+
import elements from "../elements";
|
|
6
6
|
|
|
7
7
|
import { equalityFromStatement,
|
|
8
8
|
judgementFromStatement,
|
|
9
9
|
typeAssertionFromStatement,
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
|
-
satisfiesAssertionFromStatement } from "
|
|
11
|
+
satisfiesAssertionFromStatement } from "../utilities/statement";
|
|
12
12
|
|
|
13
13
|
const { backwardsSome } = arrayUtilities;
|
|
14
14
|
|
|
15
|
-
function
|
|
16
|
-
let
|
|
15
|
+
function unifyStatementWithRule(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
16
|
+
let statementUnifiesWithRule = false;
|
|
17
17
|
|
|
18
18
|
if (reference !== null) {
|
|
19
19
|
const rule = context.findRuleByReference(reference);
|
|
@@ -24,34 +24,34 @@ function unifyWithRule(statement, reference, satisfiesAssertion, substitutions,
|
|
|
24
24
|
|
|
25
25
|
context.trace(`Unifying the '${statementString}' statement with the '${ruleString}' rule...`);
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
|
|
28
|
+
statementAndSubproofOrProofAssertionsUnify = rule.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context);
|
|
29
29
|
|
|
30
|
-
if (
|
|
31
|
-
|
|
30
|
+
if (statementAndSubproofOrProofAssertionsUnify) {
|
|
31
|
+
statementUnifiesWithRule = true;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
if (
|
|
34
|
+
if (statementUnifiesWithRule) {
|
|
35
35
|
context.debug(`...unified the '${statementString}' statement with the '${ruleString}' rule.`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
return
|
|
40
|
+
return statementUnifiesWithRule;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function
|
|
44
|
-
let
|
|
43
|
+
function unifyStatementWithReference(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
44
|
+
let statementUnifiesWithReference = false;
|
|
45
45
|
|
|
46
46
|
if (reference !== null) {
|
|
47
|
-
const
|
|
47
|
+
const statementString = statement.getString(),
|
|
48
|
+
referenceString = reference.getString();
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
const statementString = statement.getString(),
|
|
51
|
-
referenceString = reference.getString();
|
|
50
|
+
context.trace(`Unifying the '${statementString}' statement with the '${referenceString}' reference...`);
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
const metavariableValidates = reference.validateMetavariable(context);
|
|
54
53
|
|
|
54
|
+
if (metavariableValidates) {
|
|
55
55
|
const { StatementSubstitution } = elements,
|
|
56
56
|
metavariable = reference.getMetavariable(),
|
|
57
57
|
statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
|
|
@@ -59,19 +59,19 @@ function unifyWithReference(statement, reference, satisfiesAssertion, substituti
|
|
|
59
59
|
|
|
60
60
|
substitutions.addSubstitution(substitution, context);
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
statementUnifiesWithReference = true;
|
|
63
|
+
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
65
|
+
if (statementUnifiesWithReference) {
|
|
66
|
+
context.debug(`...unified the '${statementString}' statement with the '${referenceString}' reference.`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
return
|
|
70
|
+
return statementUnifiesWithReference;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
function
|
|
74
|
-
let
|
|
73
|
+
function unifyStatementAsSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
74
|
+
let statementUnifiesAsSatisfiesAssertion = false;
|
|
75
75
|
|
|
76
76
|
satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
|
|
77
77
|
|
|
@@ -86,9 +86,9 @@ function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, sub
|
|
|
86
86
|
satisfiesAssertion.verifySignature(assignments, stated, context);
|
|
87
87
|
|
|
88
88
|
if (reference === null) {
|
|
89
|
-
const
|
|
89
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions();
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
statementUnifiesAsSatisfiesAssertion = backwardsSome(subproofOrProofAssertions, (stepsOrSubproof) => {
|
|
92
92
|
const stepOrSubProofUnifiesWIthSatisfiesAssertion = stepsOrSubproof.unifyWithSatisfiesAssertion(satisfiesAssertion, context);
|
|
93
93
|
|
|
94
94
|
if (stepOrSubProofUnifiesWIthSatisfiesAssertion) {
|
|
@@ -115,28 +115,28 @@ function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, sub
|
|
|
115
115
|
const substitutionsCorrelates = satisfiesAssertion.correlateSubstitutions(substitutions, context);
|
|
116
116
|
|
|
117
117
|
if (substitutionsCorrelates) {
|
|
118
|
-
|
|
118
|
+
statementUnifiesAsSatisfiesAssertion = true;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
} else {
|
|
122
122
|
const axiomString = axiom.getString();
|
|
123
123
|
|
|
124
|
-
context.debug(`
|
|
124
|
+
context.debug(`Unable to unify with the '${axiomString}' because it is not satisfiable.`)
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
if (
|
|
130
|
+
if (statementUnifiesAsSatisfiesAssertion) {
|
|
131
131
|
context.debug(`...unified the '${statementString}' statement as a satisfies assertion.`);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
return
|
|
135
|
+
return statementUnifiesAsSatisfiesAssertion;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
function
|
|
139
|
-
let
|
|
138
|
+
function unifyStatementWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
139
|
+
let statementUnifiesWithAxiomLemmaTheoremOrConjecture = false;
|
|
140
140
|
|
|
141
141
|
if (reference !== null) {
|
|
142
142
|
const { Substitutions } = elements,
|
|
@@ -149,13 +149,13 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
|
|
|
149
149
|
|
|
150
150
|
context.trace(`Unifying the '${statementString}' statement with the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture...`);
|
|
151
151
|
|
|
152
|
-
const
|
|
152
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions();
|
|
153
153
|
|
|
154
154
|
substitutions = Substitutions.fromNothing();
|
|
155
155
|
|
|
156
|
-
const
|
|
156
|
+
const statementAndSubproofOrProofAssertionsUnify = axiomLemmaTheoremOrConjecture.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, substitutions, context);
|
|
157
157
|
|
|
158
|
-
if (
|
|
158
|
+
if (statementAndSubproofOrProofAssertionsUnify) {
|
|
159
159
|
const { StatementSubstitution } = elements,
|
|
160
160
|
metavariable = reference.getMetavariable(),
|
|
161
161
|
statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
|
|
@@ -165,20 +165,20 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
|
|
|
165
165
|
|
|
166
166
|
substitutions.addSubstitution(substitution, context);
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
statementUnifiesWithAxiomLemmaTheoremOrConjecture = true;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
if (
|
|
171
|
+
if (statementUnifiesWithAxiomLemmaTheoremOrConjecture) {
|
|
172
172
|
context.debug(`...unified the '${statementString}' statement with the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture.`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
return
|
|
177
|
+
return statementUnifiesWithAxiomLemmaTheoremOrConjecture;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
function
|
|
181
|
-
let
|
|
180
|
+
function unifyStatementAEquality(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
181
|
+
let statementUnifiesAEquality = false;
|
|
182
182
|
|
|
183
183
|
if (reference === null) {
|
|
184
184
|
const equality = equalityFromStatement(statement, context);
|
|
@@ -191,20 +191,20 @@ function unifyAEquality(statement, reference, satisfiesAssertion, substitutions,
|
|
|
191
191
|
const equalityEqual = equality.isEqual(context);
|
|
192
192
|
|
|
193
193
|
if (equalityEqual) {
|
|
194
|
-
|
|
194
|
+
statementUnifiesAEquality = true;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
if (
|
|
197
|
+
if (statementUnifiesAEquality) {
|
|
198
198
|
context.debug(`...unified the '${statementString}' statement as an equality.`);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
return
|
|
203
|
+
return statementUnifiesAEquality;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
function
|
|
207
|
-
let
|
|
206
|
+
function unifyStatementAsJudgement(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
207
|
+
let statementUnifiesAsJudgement = false;
|
|
208
208
|
|
|
209
209
|
if (reference === null) {
|
|
210
210
|
const judgement = judgementFromStatement(statement, context);
|
|
@@ -214,19 +214,19 @@ function unifyAsJudgement(statement, reference, satisfiesAssertion, substitution
|
|
|
214
214
|
|
|
215
215
|
context.trace(`Unifying the '${statementString}' statement as a judgement...`);
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
statementUnifiesAsJudgement = true;
|
|
218
218
|
|
|
219
|
-
if (
|
|
219
|
+
if (statementUnifiesAsJudgement) {
|
|
220
220
|
context.debug(`...unified the '${statementString}' statement as a judgement.`);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
return
|
|
225
|
+
return statementUnifiesAsJudgement;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
function
|
|
229
|
-
let
|
|
228
|
+
function unifyStatementAsTypeAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
229
|
+
let statementUnifiesAsTypeAssertion = false;
|
|
230
230
|
|
|
231
231
|
if (reference === null) {
|
|
232
232
|
const typeAssertion = typeAssertionFromStatement(statement, context);
|
|
@@ -236,17 +236,17 @@ function unifyAsTypeAssertion(statement, reference, satisfiesAssertion, substitu
|
|
|
236
236
|
|
|
237
237
|
context.trace(`Unifying the '${statementString}' statement as a type assertion...`);
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
statementUnifiesAsTypeAssertion = true;
|
|
240
240
|
|
|
241
241
|
context.debug(`...unified the '${statementString}' statement as a type assertion.`);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
return
|
|
245
|
+
return statementUnifiesAsTypeAssertion;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
function
|
|
249
|
-
let
|
|
248
|
+
function unifyStatementAsPropertyAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
249
|
+
let statementUnifiesAsPropertyAssertion = false;
|
|
250
250
|
|
|
251
251
|
if (reference === null) {
|
|
252
252
|
const propertyAssertion = propertyAssertionFromStatement(statement, context);
|
|
@@ -262,69 +262,83 @@ function unifyAsPropertyAssertion(statement, reference, satisfiesAssertion, subs
|
|
|
262
262
|
if (equivalence !== null) {
|
|
263
263
|
const propertyAssertionMatches = equivalence.someOtherTerm(term, (term) => { ///
|
|
264
264
|
const propertyRelation = propertyAssertion.getPropertyRelation(),
|
|
265
|
-
|
|
265
|
+
comparesToTermAndPropertyRelation = context.compareTermAndPropertyRelation(term, propertyRelation);
|
|
266
266
|
|
|
267
|
-
if (
|
|
267
|
+
if (comparesToTermAndPropertyRelation) {
|
|
268
268
|
return true;
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
|
|
272
272
|
if (propertyAssertionMatches) {
|
|
273
|
-
|
|
273
|
+
statementUnifiesAsPropertyAssertion = true;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
if (
|
|
277
|
+
if (statementUnifiesAsPropertyAssertion) {
|
|
278
278
|
context.debug(`...unified the '${statementString}' statement as a property assertion.`);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
return
|
|
283
|
+
return statementUnifiesAsPropertyAssertion;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
function
|
|
287
|
-
let
|
|
286
|
+
function unifyStatementWithSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
287
|
+
let statementUnifiesWithSatisfiesAssertion = false;
|
|
288
288
|
|
|
289
289
|
if (satisfiesAssertion !== null) {
|
|
290
|
-
const
|
|
291
|
-
|
|
290
|
+
const statementString = statement.getString(),
|
|
291
|
+
satisfiesAssertionString = satisfiesAssertion.getString();
|
|
292
|
+
|
|
293
|
+
context.trace(`Unifying the '${statementString}' statememnt with the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
294
|
+
|
|
295
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
|
|
296
|
+
statementUnifies = satisfiesAssertion.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context);
|
|
292
297
|
|
|
293
298
|
if (statementUnifies) {
|
|
294
|
-
|
|
299
|
+
statementUnifiesWithSatisfiesAssertion = true;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (statementUnifiesWithSatisfiesAssertion) {
|
|
303
|
+
context.debug(`...unified the '${statementString}' statememnt with the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
295
304
|
}
|
|
296
305
|
}
|
|
297
306
|
|
|
298
|
-
return
|
|
307
|
+
return statementUnifiesWithSatisfiesAssertion;
|
|
299
308
|
}
|
|
300
309
|
|
|
301
|
-
function
|
|
302
|
-
let
|
|
310
|
+
function compareStatementWithSubproofOrProofAssertions(statement, reference, satisfiesAssertion, substitutions, context) {
|
|
311
|
+
let statementEquatesWithStepOrSubproofs = false;
|
|
303
312
|
|
|
304
313
|
if (reference === null) {
|
|
305
|
-
const
|
|
306
|
-
|
|
314
|
+
const statementString = statement.getString();
|
|
315
|
+
|
|
316
|
+
context.trace(`Comparing the '${statementString}' statement with the subproofs or proof asssertions...`);
|
|
317
|
+
|
|
318
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
|
|
319
|
+
statementUnifiesWithSteps = statement.compareSubproofOrProofAssertions(subproofOrProofAssertions, context);
|
|
307
320
|
|
|
308
321
|
if (statementUnifiesWithSteps) {
|
|
309
|
-
|
|
322
|
+
statementEquatesWithStepOrSubproofs = true;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (statementEquatesWithStepOrSubproofs) {
|
|
326
|
+
context.debug(`...compared the '${statementString}' statement with the subproofs or proof asssertions.`);
|
|
310
327
|
}
|
|
311
328
|
}
|
|
312
329
|
|
|
313
|
-
return
|
|
330
|
+
return statementEquatesWithStepOrSubproofs;
|
|
314
331
|
}
|
|
315
332
|
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
333
|
+
export const unifyStatements = [
|
|
334
|
+
unifyStatementWithRule,
|
|
335
|
+
unifyStatementWithReference,
|
|
336
|
+
unifyStatementAsSatisfiesAssertion,
|
|
337
|
+
unifyStatementWithAxiomLemmaTheoremOrConjecture,
|
|
338
|
+
unifyStatementAEquality,
|
|
339
|
+
unifyStatementAsJudgement,
|
|
340
|
+
unifyStatementAsTypeAssertion,
|
|
341
|
+
unifyStatementAsPropertyAssertion,
|
|
342
|
+
unifyStatementWithSatisfiesAssertion,
|
|
343
|
+
compareStatementWithSubproofOrProofAssertions
|
|
327
344
|
];
|
|
328
|
-
|
|
329
|
-
export default unifyMixins;
|
|
330
|
-
|