occam-verify-cli 1.0.220 → 1.0.224
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 +19 -19
- package/lib/context/local.js +5 -43
- package/lib/context/release.js +11 -11
- package/lib/dom/assertion/contained.js +44 -44
- package/lib/dom/assertion/defined.js +40 -40
- package/lib/dom/assertion/property.js +37 -35
- package/lib/dom/assertion/satisfies.js +26 -25
- package/lib/dom/assertion/subproof.js +16 -16
- package/lib/dom/assertion/type.js +34 -32
- package/lib/dom/axiom.js +52 -52
- package/lib/dom/combinator/bracketed.js +5 -5
- package/lib/dom/combinator.js +6 -6
- package/lib/dom/conclusion.js +10 -10
- package/lib/dom/conjecture.js +5 -5
- package/lib/dom/constructor/bracketed.js +12 -12
- package/lib/dom/constructor.js +9 -9
- package/lib/dom/declaration/combinator.js +11 -11
- package/lib/dom/declaration/complexType.js +133 -63
- package/lib/dom/declaration/constructor.js +17 -17
- package/lib/dom/declaration/metavariable.js +17 -17
- package/lib/dom/declaration/simpleType.js +229 -0
- package/lib/dom/declaration/variable.js +17 -17
- package/lib/dom/declaration.js +54 -52
- package/lib/dom/deduction.js +15 -15
- package/lib/dom/derivation.js +8 -8
- package/lib/dom/equality.js +49 -34
- package/lib/dom/error.js +3 -3
- package/lib/dom/frame.js +38 -38
- package/lib/dom/judgement.js +31 -29
- package/lib/dom/label.js +5 -5
- package/lib/dom/lemma.js +5 -5
- package/lib/dom/metaLemma.js +5 -5
- package/lib/dom/metatheorem.js +5 -5
- package/lib/dom/metavariable.js +55 -55
- package/lib/dom/premise.js +36 -34
- package/lib/dom/procedureCall.js +9 -9
- package/lib/dom/proof.js +6 -6
- package/lib/dom/propertyRelation.js +18 -18
- package/lib/dom/reference.js +28 -28
- package/lib/dom/rule.js +63 -48
- package/lib/dom/signature.js +17 -17
- package/lib/dom/statement.js +36 -36
- package/lib/dom/step.js +32 -35
- package/lib/dom/subDerivation.js +8 -8
- package/lib/dom/subproof.js +27 -30
- package/lib/dom/substitution/statement.js +7 -7
- package/lib/dom/substitution/term.js +2 -16
- package/lib/dom/substitution.js +1 -15
- package/lib/dom/supposition.js +39 -39
- package/lib/dom/term.js +15 -15
- package/lib/dom/theorem.js +5 -5
- package/lib/dom/topLevelAssertion.js +60 -71
- package/lib/dom/topLevelMetaAssertion.js +28 -20
- package/lib/dom/type.js +18 -24
- package/lib/dom/variable.js +16 -16
- package/lib/equivalence.js +54 -33
- package/lib/equivalences.js +57 -101
- package/lib/index.js +2 -2
- package/lib/mixins/statement/verify.js +52 -52
- package/lib/mixins/step/unify.js +79 -61
- package/lib/mixins/term/verify.js +17 -17
- package/lib/substitutions.js +7 -7
- package/lib/unifier/equantional.js +170 -0
- package/lib/unifier/intrinsicLevel.js +8 -8
- package/lib/unifier/metaLevel.js +21 -21
- package/lib/unifier/metavariable.js +9 -9
- package/lib/unifier/statementWithCombinator.js +18 -18
- package/lib/unifier/termWithConstructor.js +10 -10
- package/lib/unifier.js +41 -41
- package/lib/utilities/brackets.js +2 -2
- package/lib/utilities/release.js +18 -17
- package/lib/utilities/subproof.js +2 -2
- package/lib/utilities/type.js +2 -2
- package/lib/utilities/unification.js +28 -34
- package/lib/verifier/combinator.js +14 -14
- package/lib/verifier/constructor.js +18 -18
- package/lib/verifier/topLevel.js +38 -38
- package/lib/verifier.js +30 -30
- package/package.json +1 -1
- package/src/context/file.js +18 -18
- package/src/context/local.js +5 -48
- package/src/context/release.js +11 -11
- package/src/dom/assertion/contained.js +46 -46
- package/src/dom/assertion/defined.js +41 -41
- package/src/dom/assertion/property.js +37 -35
- package/src/dom/assertion/satisfies.js +26 -25
- package/src/dom/assertion/subproof.js +15 -15
- package/src/dom/assertion/type.js +34 -32
- package/src/dom/axiom.js +56 -54
- package/src/dom/combinator/bracketed.js +4 -4
- package/src/dom/combinator.js +5 -5
- package/src/dom/conclusion.js +9 -9
- package/src/dom/conjecture.js +4 -4
- package/src/dom/constructor/bracketed.js +11 -11
- package/src/dom/constructor.js +8 -8
- package/src/dom/declaration/combinator.js +10 -10
- package/src/dom/declaration/complexType.js +129 -64
- package/src/dom/declaration/constructor.js +16 -16
- package/src/dom/declaration/metavariable.js +16 -16
- package/src/dom/declaration/simpleType.js +179 -0
- package/src/dom/declaration/variable.js +16 -16
- package/src/dom/declaration.js +54 -52
- package/src/dom/deduction.js +14 -14
- package/src/dom/derivation.js +7 -7
- package/src/dom/equality.js +55 -38
- package/src/dom/error.js +2 -2
- package/src/dom/frame.js +38 -38
- package/src/dom/judgement.js +31 -29
- package/src/dom/label.js +4 -4
- package/src/dom/lemma.js +4 -4
- package/src/dom/metaLemma.js +4 -4
- package/src/dom/metatheorem.js +4 -4
- package/src/dom/metavariable.js +54 -54
- package/src/dom/premise.js +35 -33
- package/src/dom/procedureCall.js +8 -8
- package/src/dom/proof.js +5 -5
- package/src/dom/propertyRelation.js +17 -17
- package/src/dom/reference.js +27 -27
- package/src/dom/rule.js +72 -49
- package/src/dom/signature.js +15 -15
- package/src/dom/statement.js +34 -34
- package/src/dom/step.js +42 -48
- package/src/dom/subDerivation.js +7 -7
- package/src/dom/subproof.js +30 -40
- package/src/dom/substitution/statement.js +6 -6
- package/src/dom/substitution/term.js +1 -19
- package/src/dom/substitution.js +0 -13
- package/src/dom/supposition.js +38 -38
- package/src/dom/term.js +14 -14
- package/src/dom/theorem.js +4 -4
- package/src/dom/topLevelAssertion.js +62 -81
- package/src/dom/topLevelMetaAssertion.js +35 -20
- package/src/dom/type.js +23 -33
- package/src/dom/variable.js +16 -15
- package/src/equivalence.js +69 -46
- package/src/equivalences.js +53 -115
- package/src/index.js +1 -1
- package/src/mixins/statement/verify.js +51 -51
- package/src/mixins/step/unify.js +88 -67
- package/src/mixins/term/verify.js +16 -16
- package/src/substitutions.js +5 -6
- package/src/unifier/equantional.js +90 -0
- package/src/unifier/intrinsicLevel.js +7 -7
- package/src/unifier/metaLevel.js +20 -21
- package/src/unifier/metavariable.js +8 -8
- package/src/unifier/statementWithCombinator.js +17 -17
- package/src/unifier/termWithConstructor.js +9 -9
- package/src/unifier.js +40 -40
- package/src/utilities/brackets.js +1 -1
- package/src/utilities/release.js +18 -18
- package/src/utilities/subproof.js +1 -1
- package/src/utilities/type.js +1 -1
- package/src/utilities/unification.js +27 -37
- package/src/verifier/combinator.js +13 -13
- package/src/verifier/constructor.js +17 -17
- package/src/verifier/topLevel.js +41 -41
- package/src/verifier.js +29 -29
- package/lib/dom/declaration/type.js +0 -209
- package/lib/unifier/equality.js +0 -155
- package/src/dom/declaration/type.js +0 -150
- package/src/unifier/equality.js +0 -70
|
@@ -35,42 +35,38 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
35
35
|
return this.reference;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
const substitutionsMatch = this.signature.matchSubstitutions(substitutions, context);
|
|
40
|
-
|
|
41
|
-
return substitutionsMatch;
|
|
42
|
-
}
|
|
38
|
+
correlateSubstitutions(substitutions, context) { return this.signature.correlateSubstitutions(substitutions, context); }
|
|
43
39
|
|
|
44
40
|
verify(assignments, stated, context) {
|
|
45
|
-
let
|
|
41
|
+
let verifies = false;
|
|
46
42
|
|
|
47
43
|
const satisfiesAssertionString = this.string; ///
|
|
48
44
|
|
|
49
45
|
context.trace(`Verifying the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
50
46
|
|
|
51
|
-
const
|
|
47
|
+
const signatureVerifies = this.verifySignature(assignments, stated, context);
|
|
52
48
|
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
49
|
+
if (signatureVerifies) {
|
|
50
|
+
const referenceVerifies = this.verifyReference(assignments, stated, context);
|
|
55
51
|
|
|
56
|
-
|
|
52
|
+
verifies = referenceVerifies; ///
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
if (
|
|
55
|
+
if (verifies) {
|
|
60
56
|
context.debug(`...verified the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
return
|
|
59
|
+
return verifies;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
verifySignature(assignments, stated, context) {
|
|
67
|
-
const
|
|
63
|
+
const signatureVerifies = this.signature.verify(context);
|
|
68
64
|
|
|
69
|
-
return
|
|
65
|
+
return signatureVerifies;
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
verifyReference(assignments, stated, context) {
|
|
73
|
-
let
|
|
69
|
+
let referenceVerifies = false;
|
|
74
70
|
|
|
75
71
|
const referenceString = this.reference.getString();
|
|
76
72
|
|
|
@@ -82,19 +78,19 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
82
78
|
const axiomSatisfiable = axiom.isSatisfiable();
|
|
83
79
|
|
|
84
80
|
if (axiomSatisfiable) {
|
|
85
|
-
|
|
81
|
+
referenceVerifies = true;
|
|
86
82
|
}
|
|
87
83
|
}
|
|
88
84
|
|
|
89
|
-
if (
|
|
85
|
+
if (referenceVerifies) {
|
|
90
86
|
context.debug(`...verified the '${referenceString}' reference.`);
|
|
91
87
|
}
|
|
92
88
|
|
|
93
|
-
return
|
|
89
|
+
return referenceVerifies;
|
|
94
90
|
}
|
|
95
91
|
|
|
96
92
|
unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, context) {
|
|
97
|
-
let
|
|
93
|
+
let statementUnifies = false;
|
|
98
94
|
|
|
99
95
|
const statementString = statement.getString(),
|
|
100
96
|
satisfiesAssertionString = this.string; ///
|
|
@@ -118,24 +114,29 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
118
114
|
|
|
119
115
|
substitutions = Substitutions.fromNothing();
|
|
120
116
|
|
|
121
|
-
|
|
117
|
+
statementUnifies = axiom.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context);
|
|
122
118
|
|
|
123
|
-
if (
|
|
119
|
+
if (statementUnifies) {
|
|
124
120
|
const substitutionsA = substitutions, ///
|
|
125
|
-
substitutionsMatch =
|
|
121
|
+
substitutionsMatch = substitutionsA.correlateSubstitutions(substitutionsB);
|
|
126
122
|
|
|
127
123
|
if (!substitutionsMatch) {
|
|
128
|
-
|
|
124
|
+
const substitutionsAString = substitutionsA.asString(),
|
|
125
|
+
substitutionsBString = substitutionsB.asString();
|
|
126
|
+
|
|
127
|
+
context.trace(`THe signature's ${substitutionsBString} substitutions do not correlate with the unification's ${substitutionsAString} substitutions.`);
|
|
128
|
+
|
|
129
|
+
statementUnifies = false;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
|
|
134
|
-
if (
|
|
135
|
+
if (statementUnifies) {
|
|
135
136
|
context.debug(`...unified the '${statementString}' statement with the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
return
|
|
139
|
+
return statementUnifies;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
static name = "SatisfiesAssertion";
|
|
@@ -29,7 +29,7 @@ export default domAssigned(class SubproofAssertion {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
unifySubproof(subproof, substitutions, generalContext, specificContext) {
|
|
32
|
-
let
|
|
32
|
+
let subproofUnifies;
|
|
33
33
|
|
|
34
34
|
const subproofString = subproof.getString(),
|
|
35
35
|
subproofAssertionString = this.string; ///
|
|
@@ -39,39 +39,39 @@ export default domAssigned(class SubproofAssertion {
|
|
|
39
39
|
const subproofStatements = subproof.getStatements(),
|
|
40
40
|
subproofAssertionStatements = this.statements; ///
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
subproofUnifies = match(subproofAssertionStatements, subproofStatements, (subproofAssertionStatement, subproofStatement) => {
|
|
43
43
|
const generalStatement = subproofAssertionStatement, ///
|
|
44
44
|
specificStatement = subproofStatement, ///
|
|
45
|
-
|
|
45
|
+
statementUnifies = unifyStatement(generalStatement, specificStatement, substitutions, generalContext, specificContext);
|
|
46
46
|
|
|
47
|
-
if (
|
|
47
|
+
if (statementUnifies) {
|
|
48
48
|
return true;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
if (
|
|
52
|
+
if (subproofUnifies) {
|
|
53
53
|
specificContext.debug(`...unified the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion.`);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return
|
|
56
|
+
return subproofUnifies;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
verify(assignments, stated, context) {
|
|
60
|
-
let
|
|
60
|
+
let verifies;
|
|
61
61
|
|
|
62
62
|
const subproofAssertionString = this.string; ///
|
|
63
63
|
|
|
64
64
|
context.trace(`Verifying the '${subproofAssertionString}' subproof assertion...`);
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const statementsVerify = this.verifyStatements(assignments, stated, context);
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
verifies = statementsVerify; ///
|
|
69
69
|
|
|
70
|
-
if (
|
|
70
|
+
if (verifies) {
|
|
71
71
|
context.debug(`...verified the '${subproofAssertionString}' subproof assertion.`);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
return
|
|
74
|
+
return verifies;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
verifyStatements(assignments, stated, context) {
|
|
@@ -79,15 +79,15 @@ export default domAssigned(class SubproofAssertion {
|
|
|
79
79
|
|
|
80
80
|
assignments = null; ///
|
|
81
81
|
|
|
82
|
-
const
|
|
83
|
-
const
|
|
82
|
+
const statementsVerify = this.statements.map((statement) => {
|
|
83
|
+
const statementVerifies = statement.verify(assignments, stated, context);
|
|
84
84
|
|
|
85
|
-
if (
|
|
85
|
+
if (statementVerifies) {
|
|
86
86
|
return true;
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return statementsVerify;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
static name = "SubproofAssertion";
|
|
@@ -25,42 +25,44 @@ export default domAssigned(class TypeAssertion {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
verify(assignments, stated, context) {
|
|
28
|
-
let
|
|
28
|
+
let verifies = false;
|
|
29
29
|
|
|
30
30
|
let typeAssertionString = this.string; ///
|
|
31
31
|
|
|
32
32
|
context.trace(`Verifying the '${typeAssertionString}' type assertion...`);
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const typeVerifies = this.verifyType(context);
|
|
35
35
|
|
|
36
|
-
if (
|
|
37
|
-
let
|
|
38
|
-
|
|
36
|
+
if (typeVerifies) {
|
|
37
|
+
let verifiesWhenStated = false,
|
|
38
|
+
verifiesWhenDerived = false;
|
|
39
39
|
|
|
40
40
|
if (stated) {
|
|
41
|
-
|
|
41
|
+
verifiesWhenStated = this.verifyWhenStated(assignments, context);
|
|
42
42
|
} else {
|
|
43
|
-
|
|
43
|
+
verifiesWhenDerived = this.verifyWhenDerived(context);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
if (verifiesWhenStated || verifiesWhenDerived) {
|
|
47
|
+
verifies = true;
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
if (
|
|
51
|
+
if (verifies) {
|
|
50
52
|
if (stated) {
|
|
51
53
|
this.assign(assignments, context);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
if (
|
|
57
|
+
if (verifies) {
|
|
56
58
|
context.debug(`...verified the '${typeAssertionString}' type assertion.`);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
return
|
|
61
|
+
return verifies;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
verifyType(context) {
|
|
63
|
-
let
|
|
65
|
+
let typeVerifies;
|
|
64
66
|
|
|
65
67
|
const typeString = this.type.getString();
|
|
66
68
|
|
|
@@ -71,58 +73,58 @@ export default domAssigned(class TypeAssertion {
|
|
|
71
73
|
if (type !== null) {
|
|
72
74
|
this.type = type;
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
typeVerifies = true;
|
|
75
77
|
} else {
|
|
76
78
|
context.debug(`The '${typeString}' type is not present.`);
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
if (
|
|
81
|
+
if (typeVerifies) {
|
|
80
82
|
context.debug(`...verified the '${typeString}' type.`);
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
return
|
|
85
|
+
return typeVerifies;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
verifyWhenStated(assignments, context) {
|
|
87
|
-
let
|
|
89
|
+
let verifiesWhenStated = false;
|
|
88
90
|
|
|
89
91
|
const typeAssertionString = this.string; ///
|
|
90
92
|
|
|
91
93
|
context.trace(`Verifying the '${typeAssertionString}' stated type assertion...`);
|
|
92
94
|
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
+
const termVerifies = this.term.verify(context, () => {
|
|
96
|
+
let verifiesAhead;
|
|
95
97
|
|
|
96
98
|
const termType = this.term.getType(),
|
|
97
99
|
typeEqualToOrSubTypeOfTermType = this.type.isEqualToOrSubTypeOf(termType);
|
|
98
100
|
|
|
99
101
|
if (typeEqualToOrSubTypeOfTermType) {
|
|
100
|
-
|
|
102
|
+
verifiesAhead = true;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
return
|
|
105
|
+
return verifiesAhead;
|
|
104
106
|
});
|
|
105
107
|
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
+
if (termVerifies) {
|
|
109
|
+
verifiesWhenStated = true;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
if (
|
|
112
|
+
if (verifiesWhenStated) {
|
|
111
113
|
context.debug(`...verified the '${typeAssertionString}' stated type assertion.`);
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
return
|
|
116
|
+
return verifiesWhenStated;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
verifyWhenDerived(context) {
|
|
118
|
-
let
|
|
120
|
+
let verifiesWhenDerived;
|
|
119
121
|
|
|
120
122
|
const typeAssertionString = this.string; ///
|
|
121
123
|
|
|
122
124
|
context.trace(`Verifying the '${typeAssertionString}' derived type assertion...`);
|
|
123
125
|
|
|
124
|
-
const
|
|
125
|
-
let
|
|
126
|
+
const termVerifies = this.term.verify(context, () => {
|
|
127
|
+
let verifiesAhead = false;
|
|
126
128
|
|
|
127
129
|
const termType = this.term.getType(),
|
|
128
130
|
termTypeProvisional = termType.isProvisional();
|
|
@@ -130,19 +132,19 @@ export default domAssigned(class TypeAssertion {
|
|
|
130
132
|
if (!termTypeProvisional) {
|
|
131
133
|
const typeEqualToOrSuperTypeOfTermType = this.type.isEqualToOrSuperTypeOf(termType);
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
verifiesAhead = typeEqualToOrSuperTypeOfTermType; ///
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
return
|
|
138
|
+
return verifiesAhead;
|
|
137
139
|
});
|
|
138
140
|
|
|
139
|
-
|
|
141
|
+
verifiesWhenDerived = termVerifies; ///
|
|
140
142
|
|
|
141
|
-
if (
|
|
143
|
+
if (verifiesWhenDerived) {
|
|
142
144
|
context.debug(`...verified the '${typeAssertionString}' derived type assertion.`);
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
return
|
|
147
|
+
return verifiesWhenDerived;
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
assign(assignments, context) {
|
package/src/dom/axiom.js
CHANGED
|
@@ -14,7 +14,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
verify() {
|
|
17
|
-
let
|
|
17
|
+
let verifies;
|
|
18
18
|
|
|
19
19
|
const axiom = this, ///
|
|
20
20
|
axiomString = axiom.getString(),
|
|
@@ -22,13 +22,13 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
22
22
|
|
|
23
23
|
fileContext.trace(`Verifying the '${axiomString}' axiom...`);
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const signatureVerifies = this.verifySignature();
|
|
26
26
|
|
|
27
|
-
if (
|
|
28
|
-
|
|
27
|
+
if (signatureVerifies) {
|
|
28
|
+
verifies = super.verify();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
if (
|
|
31
|
+
if (verifies) {
|
|
32
32
|
const axiom = this; ///
|
|
33
33
|
|
|
34
34
|
fileContext.addAxiom(axiom);
|
|
@@ -36,11 +36,11 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
36
36
|
fileContext.debug(`...verified the '${axiomString}' axiom.`);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
return
|
|
39
|
+
return verifies;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
verifySignature() {
|
|
43
|
-
let
|
|
43
|
+
let signatureVerifies = true;
|
|
44
44
|
|
|
45
45
|
const satisfiable = this.isSatisfiable();
|
|
46
46
|
|
|
@@ -50,10 +50,10 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
50
50
|
localContext = LocalContext.fromFileContext(fileContext),
|
|
51
51
|
context = localContext; ///
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
signatureVerifies = signature.verify(context);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return
|
|
56
|
+
return signatureVerifies;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
matchSignature(signature, substitutions, context) {
|
|
@@ -79,31 +79,30 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
79
79
|
return signatureMatches;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
unifyStep(step, substitutions,
|
|
83
|
-
let
|
|
82
|
+
unifyStep(step, substitutions, context) {
|
|
83
|
+
let stepUnifies = false;
|
|
84
84
|
|
|
85
|
-
const
|
|
86
|
-
stepString = step.getString(),
|
|
85
|
+
const stepString = step.getString(),
|
|
87
86
|
axiomString = this.string; ///
|
|
88
87
|
|
|
89
88
|
context.trace(`Unifying the '${stepString}' step with the '${axiomString}' axiom...`);
|
|
90
89
|
|
|
91
90
|
const statement = step.getStatement(),
|
|
92
|
-
|
|
91
|
+
statementUnifies = this.unifyStatement(statement, substitutions, context);
|
|
93
92
|
|
|
94
|
-
if (
|
|
95
|
-
|
|
93
|
+
if (statementUnifies) {
|
|
94
|
+
stepUnifies = true;
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
if (
|
|
97
|
+
if (stepUnifies) {
|
|
99
98
|
context.debug(`...unified the '${stepString}' step with the '${axiomString}' axiom.`);
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
return
|
|
101
|
+
return stepUnifies;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
unifyLastStep(lastStep, substitutions, generalContext, specificContext) {
|
|
106
|
-
let
|
|
105
|
+
let lastStepUnifies = false;
|
|
107
106
|
|
|
108
107
|
const context = specificContext, ///
|
|
109
108
|
axiomString = this.string, ///
|
|
@@ -111,50 +110,53 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
111
110
|
|
|
112
111
|
context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`)
|
|
113
112
|
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
const statement = lastStep.getStatement(),
|
|
114
|
+
statementUnifies = this.unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext);
|
|
116
115
|
|
|
117
|
-
if (
|
|
118
|
-
|
|
116
|
+
if (statementUnifies) {
|
|
117
|
+
lastStepUnifies = true;
|
|
119
118
|
}
|
|
120
119
|
|
|
121
|
-
if (
|
|
120
|
+
if (lastStepUnifies) {
|
|
122
121
|
context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`)
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
return
|
|
124
|
+
return lastStepUnifies;
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
unifySubproof(subproof, substitutions,
|
|
129
|
-
let
|
|
127
|
+
unifySubproof(subproof, substitutions, context) {
|
|
128
|
+
let subproofUnifies = false;
|
|
130
129
|
|
|
131
|
-
const
|
|
132
|
-
axiomString = this.string, ///
|
|
130
|
+
const axiomString = this.string, ///
|
|
133
131
|
subproofString = subproof.getString();
|
|
134
132
|
|
|
135
133
|
context.trace(`Unifying the '${subproofString}' subproof with the '${axiomString}' axiom...`);
|
|
136
134
|
|
|
137
135
|
const lastStep = subproof.getLastStep(),
|
|
138
|
-
|
|
136
|
+
fileContext = this.getFileContext(),
|
|
137
|
+
localContext = LocalContext.fromFileContext(fileContext),
|
|
138
|
+
generalContext = localContext, ///
|
|
139
|
+
specificContext = context, ///
|
|
140
|
+
lastStepUnifies = this.unifyLastStep(lastStep, substitutions, generalContext, specificContext);
|
|
139
141
|
|
|
140
|
-
if (
|
|
142
|
+
if (lastStepUnifies) {
|
|
141
143
|
const suppositions = subproof.getSuppositions(),
|
|
142
|
-
|
|
144
|
+
suppositionsUnify = this.unifySuppositions(suppositions, substitutions, generalContext, specificContext);
|
|
143
145
|
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
+
if (suppositionsUnify) {
|
|
147
|
+
subproofUnifies = true;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
if (
|
|
151
|
+
if (subproofUnifies) {
|
|
150
152
|
context.debug(`...unified the '${subproofString}' subproof with the '${axiomString}' axiom.`);
|
|
151
153
|
}
|
|
152
154
|
|
|
153
|
-
return
|
|
155
|
+
return subproofUnifies;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
unifyDeduction(deduction, substitutions, generalContext, specificContext) {
|
|
157
|
-
let
|
|
159
|
+
let deductionUnifies;
|
|
158
160
|
|
|
159
161
|
const specificDeduction = deduction; ///
|
|
160
162
|
|
|
@@ -164,13 +166,13 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
164
166
|
|
|
165
167
|
deduction = specificDeduction; ///
|
|
166
168
|
|
|
167
|
-
|
|
169
|
+
deductionUnifies = generalDeduction.unifyDeduction(deduction, substitutions, generalContext, specificContext);
|
|
168
170
|
|
|
169
|
-
return
|
|
171
|
+
return deductionUnifies;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
unifySupposition(supposition, index, substitutions, generalContext, specificContext) {
|
|
173
|
-
let
|
|
175
|
+
let suppositionUnifies;
|
|
174
176
|
|
|
175
177
|
const specificSupposition = supposition; ///
|
|
176
178
|
|
|
@@ -180,13 +182,13 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
180
182
|
|
|
181
183
|
supposition = specificSupposition; ///
|
|
182
184
|
|
|
183
|
-
|
|
185
|
+
suppositionUnifies = generalSupposition.unifySupposition(supposition, substitutions, generalContext, specificContext);
|
|
184
186
|
|
|
185
|
-
return
|
|
187
|
+
return suppositionUnifies;
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
unifySuppositions(suppositions, substitutions, generalContext, specificContext) {
|
|
189
|
-
let
|
|
191
|
+
let suppositionsUnify = false;
|
|
190
192
|
|
|
191
193
|
const specificSuppositions = suppositions; ///
|
|
192
194
|
|
|
@@ -200,23 +202,23 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
200
202
|
suppositions = specificSuppositions; ///
|
|
201
203
|
|
|
202
204
|
const suppositionsMatch = suppositions.every((supposition, index) => {
|
|
203
|
-
const
|
|
205
|
+
const suppositionUnifies = this.unifySupposition(supposition, index, substitutions, generalContext, specificContext);
|
|
204
206
|
|
|
205
|
-
if (
|
|
207
|
+
if (suppositionUnifies) {
|
|
206
208
|
return true;
|
|
207
209
|
}
|
|
208
210
|
});
|
|
209
211
|
|
|
210
212
|
if (suppositionsMatch) {
|
|
211
|
-
|
|
213
|
+
suppositionsUnify = true;
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
return
|
|
217
|
+
return suppositionsUnify;
|
|
216
218
|
}
|
|
217
219
|
|
|
218
220
|
unifyAxiomLemmaTheoremConjecture(axiomLemmaTheoremConjecture, substitutions, context) {
|
|
219
|
-
let
|
|
221
|
+
let axiomLemmaTheoremConjectureUnifies = false;
|
|
220
222
|
|
|
221
223
|
const axiomString = this.getString(),
|
|
222
224
|
axiomLemmaTheoremConjectureString = axiomLemmaTheoremConjecture.getString();
|
|
@@ -227,20 +229,20 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
227
229
|
fileContext = this.getFileContext(),
|
|
228
230
|
generalContext = fileContext, ///
|
|
229
231
|
specificContext = context, ///
|
|
230
|
-
|
|
232
|
+
deductionUnifies = this.unifyDeduction(deduction, substitutions, generalContext, specificContext);
|
|
231
233
|
|
|
232
|
-
if (
|
|
234
|
+
if (deductionUnifies) {
|
|
233
235
|
const suppositions = axiomLemmaTheoremConjecture.getSuppositions(),
|
|
234
|
-
|
|
236
|
+
suppositionsUnify = this.unifySuppositions(suppositions, substitutions, generalContext, specificContext);
|
|
235
237
|
|
|
236
|
-
|
|
238
|
+
axiomLemmaTheoremConjectureUnifies = suppositionsUnify; ///
|
|
237
239
|
}
|
|
238
240
|
|
|
239
|
-
if (
|
|
241
|
+
if (axiomLemmaTheoremConjectureUnifies) {
|
|
240
242
|
context.debug(`...unified the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom.`);
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
return
|
|
245
|
+
return axiomLemmaTheoremConjectureUnifies;
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
static name = "Axiom";
|
|
@@ -8,19 +8,19 @@ import { domAssigned } from "../../dom";
|
|
|
8
8
|
|
|
9
9
|
export default domAssigned(class BracketedCombinator extends Combinator {
|
|
10
10
|
unifyStatement(statement, assignments, stated, context) {
|
|
11
|
-
let
|
|
11
|
+
let statementUnifies;
|
|
12
12
|
|
|
13
13
|
const statementString = statement.getString();
|
|
14
14
|
|
|
15
15
|
context.trace(`Unifying the '${statementString}' statement with the bracketed combinator...`);
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
statementUnifies = super.unifyStatement(statement, assignments, stated, context);
|
|
18
18
|
|
|
19
|
-
if (
|
|
19
|
+
if (statementUnifies) {
|
|
20
20
|
context.debug(`...unified the '${statementString}' statement with the bracketed combinator.`);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
return
|
|
23
|
+
return statementUnifies;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
static fromNothing() {
|
package/src/dom/combinator.js
CHANGED
|
@@ -24,7 +24,7 @@ export default domAssigned(class Combinator {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
unifyStatement(statement, assignments, stated, context) {
|
|
27
|
-
let
|
|
27
|
+
let statementUnifies;
|
|
28
28
|
|
|
29
29
|
const combinator = this, ///
|
|
30
30
|
statementString = statement.getString(),
|
|
@@ -32,15 +32,15 @@ export default domAssigned(class Combinator {
|
|
|
32
32
|
|
|
33
33
|
context.trace(`Unifying the '${statementString}' statement with the '${combinatorString}' combinator...`);
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const statementUnifiesWithCombinator = unifyStatementWithCombinator(statement, combinator, assignments, stated, context);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
statementUnifies = statementUnifiesWithCombinator; ///
|
|
38
38
|
|
|
39
|
-
if (
|
|
39
|
+
if (statementUnifies) {
|
|
40
40
|
context.debug(`...unified the '${statementString}' statement with the '${combinatorString}' combinator.`);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
return
|
|
43
|
+
return statementUnifies;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
toJSON() {
|