occam-verify-cli 0.0.910 → 0.0.911
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/axiomLemmaTheoremConjecture.js +6 -6
- package/lib/conclusion.js +7 -7
- package/lib/consequent.js +3 -3
- package/lib/context/file.js +7 -7
- package/lib/context/local.js +9 -9
- package/lib/context/localMeta.js +11 -11
- package/lib/declaration.js +9 -9
- package/lib/equivalence.js +15 -15
- package/lib/frame.js +5 -5
- package/lib/frameAssertion.js +3 -3
- package/lib/metaConsequent.js +4 -4
- package/lib/metaLemmaMetatheorem.js +10 -10
- package/lib/metaSupposition.js +7 -7
- package/lib/metaType.js +7 -7
- package/lib/metavariable.js +7 -7
- package/lib/mixins/nodesVerifier/intrinsiclevel.js +3 -3
- package/lib/mixins/nodesVerifier/metaLevel.js +3 -3
- package/lib/premise.js +16 -16
- package/lib/rule.js +21 -21
- package/lib/step/metaproof.js +6 -6
- package/lib/step/proof.js +6 -6
- package/lib/substitution/metastatementForMetavariable.js +8 -8
- package/lib/substitution/statementForMetavariable.js +5 -4
- package/lib/substitution/termForVariable.js +9 -9
- package/lib/substitution.js +11 -11
- package/lib/supposition.js +3 -3
- package/lib/type.js +7 -7
- package/lib/utilities/match.js +3 -3
- package/lib/variable.js +8 -8
- package/lib/verify/containedAssertion.js +54 -20
- package/lib/verify/definedAssertion.js +67 -33
- package/lib/verify/frame.js +2 -2
- package/lib/verify/frameAssertion.js +3 -3
- package/lib/verify/metaproofStep.js +37 -15
- package/lib/verify/metastatement/unqualified.js +3 -3
- package/lib/verify/metastatement.js +35 -6
- package/lib/verify/ruleProofStep.js +25 -14
- package/lib/verify/statement/unqualified.js +3 -3
- package/lib/verify/statement.js +4 -7
- package/package.json +2 -2
- package/src/axiomLemmaTheoremConjecture.js +6 -6
- package/src/conclusion.js +6 -6
- package/src/consequent.js +2 -2
- package/src/context/file.js +6 -6
- package/src/context/local.js +7 -7
- package/src/context/localMeta.js +9 -9
- package/src/declaration.js +10 -10
- package/src/equivalence.js +14 -14
- package/src/frame.js +4 -4
- package/src/frameAssertion.js +2 -2
- package/src/metaConsequent.js +3 -3
- package/src/metaLemmaMetatheorem.js +10 -10
- package/src/metaSupposition.js +6 -6
- package/src/metaType.js +7 -7
- package/src/metavariable.js +6 -6
- package/src/mixins/nodesVerifier/intrinsiclevel.js +2 -2
- package/src/mixins/nodesVerifier/metaLevel.js +2 -2
- package/src/premise.js +15 -15
- package/src/rule.js +22 -22
- package/src/step/metaproof.js +4 -4
- package/src/step/proof.js +4 -4
- package/src/substitution/metastatementForMetavariable.js +7 -7
- package/src/substitution/statementForMetavariable.js +5 -3
- package/src/substitution/termForVariable.js +8 -8
- package/src/substitution.js +10 -10
- package/src/supposition.js +2 -2
- package/src/type.js +7 -7
- package/src/utilities/match.js +2 -2
- package/src/variable.js +11 -11
- package/src/verify/containedAssertion.js +76 -27
- package/src/verify/definedAssertion.js +90 -41
- package/src/verify/frame.js +1 -1
- package/src/verify/frameAssertion.js +2 -2
- package/src/verify/metaproofStep.js +43 -2
- package/src/verify/metastatement/unqualified.js +2 -2
- package/src/verify/metastatement.js +46 -5
- package/src/verify/ruleProofStep.js +22 -1
- package/src/verify/statement/unqualified.js +2 -2
- package/src/verify/statement.js +2 -6
package/src/frame.js
CHANGED
|
@@ -37,7 +37,7 @@ export default class Frame {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
matchSubstitution(substitution) {
|
|
40
|
-
const
|
|
40
|
+
const matchesSubstitution = this.declarations.some((declaration) => {
|
|
41
41
|
const declarationMatchesSubstitution = declaration.matchSubstitution(substitution);
|
|
42
42
|
|
|
43
43
|
if (declarationMatchesSubstitution) {
|
|
@@ -45,12 +45,12 @@ export default class Frame {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
return
|
|
48
|
+
return matchesSubstitution;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
matchMetaLemmaOrMetaTheorem(metaLemmaMetatheorem) {
|
|
52
52
|
const substitutions = metaLemmaMetatheorem.getSubstitutions(),
|
|
53
|
-
|
|
53
|
+
matchesMetaLemmaOrMetaTheorem = substitutions.every((substitution) => {
|
|
54
54
|
const frameMatchesSubstitution = this.matchSubstitution(substitution);
|
|
55
55
|
|
|
56
56
|
if (frameMatchesSubstitution) {
|
|
@@ -58,7 +58,7 @@ export default class Frame {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
return
|
|
61
|
+
return matchesMetaLemmaOrMetaTheorem;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
static fromDeclarations(declarations) {
|
package/src/frameAssertion.js
CHANGED
|
@@ -22,9 +22,9 @@ export default class FrameAssertion {
|
|
|
22
22
|
getDeclarations() { return this.frame.getDeclarations(); }
|
|
23
23
|
|
|
24
24
|
matchMetavariableNode(metavariableNode) {
|
|
25
|
-
const
|
|
25
|
+
const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return matchesMetavariableNode;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
matchMetaLemmaOrMetaTheorem(metaLemmaMetatheorem) { return this.frame.matchMetaLemmaOrMetaTheorem(metaLemmaMetatheorem); }
|
package/src/metaConsequent.js
CHANGED
|
@@ -21,7 +21,7 @@ export default class MetaConsequent {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
24
|
-
let
|
|
24
|
+
let matchesMetastatementNode = false;
|
|
25
25
|
|
|
26
26
|
if (this.metastatementNode !== null) {
|
|
27
27
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -35,10 +35,10 @@ export default class MetaConsequent {
|
|
|
35
35
|
return verifiedAhead;
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
matchesMetastatementNode = nonTerminalNodeVerified; ///
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return matchesMetastatementNode;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
toJSON(tokens) {
|
|
@@ -53,7 +53,7 @@ export default class MetaLemmaMetatheorem {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
matchMetavariableNode(metavariableNode) {
|
|
56
|
-
const
|
|
56
|
+
const matchesMetavariableNode = this.labels.some((label) => {
|
|
57
57
|
const labelMatchesMetavariableNode = label.matchMetavariableNode(metavariableNode);
|
|
58
58
|
|
|
59
59
|
if (labelMatchesMetavariableNode) {
|
|
@@ -61,7 +61,7 @@ export default class MetaLemmaMetatheorem {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return matchesMetavariableNode;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
toJSON(tokens) {
|
|
@@ -160,29 +160,29 @@ function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions,
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
function matchMetaSupposition(metaSupposition, metaproofStep, substitutions, fileContext, localMetaContext) {
|
|
163
|
-
let
|
|
163
|
+
let matchesMetaSupposition = false;
|
|
164
164
|
|
|
165
165
|
const metaSubproofNode = metaproofStep.getMetaSubproofNode(),
|
|
166
166
|
metastatementNode = metaproofStep.getMetastatementNode();
|
|
167
167
|
|
|
168
168
|
if (metaSubproofNode !== null) {
|
|
169
|
-
const
|
|
169
|
+
const metaSuppositionMatchesMetaSubproofNode = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
matchesMetaSupposition - metaSuppositionMatchesMetaSubproofNode; ///
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
if (metastatementNode !== null) {
|
|
175
|
-
const
|
|
175
|
+
const metaSuppositionMatchesMetastatementNode = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
matchesMetaSupposition - metaSuppositionMatchesMetastatementNode; ///
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
return
|
|
180
|
+
return matchesMetaSupposition;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
184
|
-
const
|
|
185
|
-
metaConsequentMatches =
|
|
184
|
+
const metaConsequentMatchesMetastatementNode = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
|
|
185
|
+
metaConsequentMatches = metaConsequentMatchesMetastatementNode; ///
|
|
186
186
|
|
|
187
187
|
return metaConsequentMatches;
|
|
188
188
|
}
|
package/src/metaSupposition.js
CHANGED
|
@@ -28,7 +28,7 @@ export default class MetaSupposition {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
31
|
-
let
|
|
31
|
+
let matchesMetaSubproofNode = false;
|
|
32
32
|
|
|
33
33
|
if (this.metastatementNode !== null) {
|
|
34
34
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
@@ -42,7 +42,7 @@ export default class MetaSupposition {
|
|
|
42
42
|
],
|
|
43
43
|
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
matchesMetaSubproofNode = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
46
46
|
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
47
47
|
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
48
48
|
fileContextA = fileContext, ///
|
|
@@ -61,11 +61,11 @@ export default class MetaSupposition {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return matchesMetaSubproofNode;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
68
|
-
let
|
|
68
|
+
let matchesMetastatementNode = false;
|
|
69
69
|
|
|
70
70
|
if (this.metastatementNode !== null) {
|
|
71
71
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -79,10 +79,10 @@ export default class MetaSupposition {
|
|
|
79
79
|
return verifiedAhead;
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
matchesMetastatementNode = nonTerminalNodeVerified; ///
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
return
|
|
85
|
+
return matchesMetastatementNode;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
toJSON(tokens) {
|
package/src/metaType.js
CHANGED
|
@@ -25,23 +25,23 @@ export default class MetaType {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
matchName(name) {
|
|
28
|
-
const
|
|
28
|
+
const matchesName = (this.name === name);
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return matchesName;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
matchMetaTypeName(metaTypeName) {
|
|
34
|
-
const
|
|
34
|
+
const matchesMetaTypeName = (this.name === metaTypeName);
|
|
35
35
|
|
|
36
|
-
return
|
|
36
|
+
return matchesMetaTypeName;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
matchMetaTypeNode(metaTypeNode) {
|
|
40
40
|
const metaTypeName = metaTypeNameFromMetaTypeNode(metaTypeNode),
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
matchesMetaTypeName = this.matchMetaTypeName(metaTypeName),
|
|
42
|
+
matchesMetaTypeNode = matchesMetaTypeName; ///
|
|
43
43
|
|
|
44
|
-
return
|
|
44
|
+
return matchesMetaTypeNode;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
asString(tokens) {
|
package/src/metavariable.js
CHANGED
|
@@ -37,13 +37,13 @@ export default class Metavariable {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
matchName(name) {
|
|
40
|
-
const
|
|
40
|
+
const matchesName = (this.name === name);
|
|
41
41
|
|
|
42
|
-
return
|
|
42
|
+
return matchesName;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
matchNode(node, localMetaContext) {
|
|
46
|
-
let
|
|
46
|
+
let matchesNode = false;
|
|
47
47
|
|
|
48
48
|
const metavariableNode = node, ///
|
|
49
49
|
typeNode = typeNodeQuery(metavariableNode);
|
|
@@ -57,16 +57,16 @@ export default class Metavariable {
|
|
|
57
57
|
if (false) {
|
|
58
58
|
///
|
|
59
59
|
} else if ((termNode === null) && (this.termType === null)) {
|
|
60
|
-
|
|
60
|
+
matchesNode = true;
|
|
61
61
|
} else if ((termNode !== null) && (this.termType !== null)) {
|
|
62
62
|
const termVerifiedAgainstTermType = verifyTermAgainstTermType(termNode, this.termType, localMetaContext);
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
matchesNode = termVerifiedAgainstTermType; ///
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
return
|
|
69
|
+
return matchesNode;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
toJSON(tokens) {
|
|
@@ -18,9 +18,9 @@ function verifyVariableNode(variableNodeA, termNodeB, substitutions, localContex
|
|
|
18
18
|
|
|
19
19
|
if (substitution !== null) {
|
|
20
20
|
const termNode = termNodeB, ///
|
|
21
|
-
|
|
21
|
+
substitutionMatchesTermNode = substitution.matchTermNode(termNode);
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (substitutionMatchesTermNode) {
|
|
24
24
|
const verifiedAhead = verifyAhead();
|
|
25
25
|
|
|
26
26
|
variableNodeVerified = verifiedAhead; ///
|
|
@@ -15,9 +15,9 @@ function verifyMetavariableNode(metavariableNodeA, metastatementNodeB, substitut
|
|
|
15
15
|
|
|
16
16
|
if (substitution !== null) {
|
|
17
17
|
const metastatementNode = metastatementNodeB, ///
|
|
18
|
-
|
|
18
|
+
substitutionMetastatementNode = substitution.matchMetastatementNode(metastatementNode);
|
|
19
19
|
|
|
20
|
-
metavariableNodeVerified =
|
|
20
|
+
metavariableNodeVerified = substitutionMetastatementNode; ///
|
|
21
21
|
} else {
|
|
22
22
|
const metavariableNode = metavariableNodeA, ///
|
|
23
23
|
metastatementNode = metastatementNodeB, ///
|
package/src/premise.js
CHANGED
|
@@ -34,7 +34,7 @@ export default class Premise {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
matchStatementNode(statementNode, substitutions, fileContext, localContext) {
|
|
37
|
-
let
|
|
37
|
+
let matchesStatementNode = false;
|
|
38
38
|
|
|
39
39
|
if (this.metastatementNode !== null) {
|
|
40
40
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -48,14 +48,14 @@ export default class Premise {
|
|
|
48
48
|
return verifiedAhead;
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
matchesStatementNode = nonTerminalNodeVerified; ///
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
return
|
|
54
|
+
return matchesStatementNode;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
matchSubproofNode(subproofNode, substitutions, fileContext, localContext) {
|
|
58
|
-
let
|
|
58
|
+
let matchesSubproofNode = false;
|
|
59
59
|
|
|
60
60
|
if (this.metastatementNode !== null) {
|
|
61
61
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
@@ -69,7 +69,7 @@ export default class Premise {
|
|
|
69
69
|
],
|
|
70
70
|
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
matchesSubproofNode = match(subproofAssertionMetastatementNodes, subproofStatementNodes, (subproofAssertionMetastatementNode, subproofStatementNode) => {
|
|
73
73
|
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
74
74
|
nonTerminalNodeB = subproofStatementNode, ///
|
|
75
75
|
fileContextA = fileContext, ///
|
|
@@ -88,11 +88,11 @@ export default class Premise {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return matchesSubproofNode;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
95
|
-
let
|
|
95
|
+
let matchesRuleSubproofNode = false;
|
|
96
96
|
|
|
97
97
|
if (this.metastatementNode !== null) {
|
|
98
98
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
@@ -106,7 +106,7 @@ export default class Premise {
|
|
|
106
106
|
],
|
|
107
107
|
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
matchesRuleSubproofNode = match(subproofAssertionMetastatementNodes, ruleSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
110
110
|
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
111
111
|
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
112
112
|
fileContextA = fileContext, ///
|
|
@@ -125,11 +125,11 @@ export default class Premise {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
return
|
|
128
|
+
return matchesRuleSubproofNode;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
132
|
-
let
|
|
132
|
+
let matchesMetaSubproofNode = false;
|
|
133
133
|
|
|
134
134
|
if (this.metastatementNode !== null) {
|
|
135
135
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
@@ -143,7 +143,7 @@ export default class Premise {
|
|
|
143
143
|
],
|
|
144
144
|
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
matchesMetaSubproofNode = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
147
147
|
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
148
148
|
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
149
149
|
fileContextA = fileContext, ///
|
|
@@ -162,11 +162,11 @@ export default class Premise {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
return
|
|
165
|
+
return matchesMetaSubproofNode;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
169
|
-
let
|
|
169
|
+
let matchesMetastatementNode = false;
|
|
170
170
|
|
|
171
171
|
if (this.metastatementNode !== null) {
|
|
172
172
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -180,10 +180,10 @@ export default class Premise {
|
|
|
180
180
|
return verifiedAhead;
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
matchesMetastatementNode = nonTerminalNodeVerified; ///
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
return
|
|
186
|
+
return matchesMetastatementNode;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
toJSON(tokens) {
|
package/src/rule.js
CHANGED
|
@@ -31,7 +31,7 @@ export default class Rule {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
matchStatement(statementNode, localContext) {
|
|
34
|
-
let
|
|
34
|
+
let matchesStatement = false;
|
|
35
35
|
|
|
36
36
|
const proofSteps = localContext.getProofSteps(),
|
|
37
37
|
substitutions = [],
|
|
@@ -40,14 +40,14 @@ export default class Rule {
|
|
|
40
40
|
if (premisesMatch) {
|
|
41
41
|
const conclusionMatches = matchConclusion(this.conclusion, statementNode, substitutions, this.fileContext, localContext);
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
matchesStatement = conclusionMatches; ///
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return matchesStatement;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
matchMetastatement(metastatementNode, localMetaContext) {
|
|
50
|
-
let
|
|
50
|
+
let matchesMetastatement = false;
|
|
51
51
|
|
|
52
52
|
const metaproofSteps = localMetaContext.getMetaproofSteps(),
|
|
53
53
|
substitutions = [],
|
|
@@ -56,14 +56,14 @@ export default class Rule {
|
|
|
56
56
|
if (premisesMatch) {
|
|
57
57
|
const conclusionMatches = metaMatchConclusion(this.conclusion, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
matchesMetastatement = conclusionMatches; ///
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
return
|
|
62
|
+
return matchesMetastatement;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
matchMetavariableNode(metavariableNode) {
|
|
66
|
-
const
|
|
66
|
+
const matchesMetavariableNode = this.labels.some((label) => {
|
|
67
67
|
const labelMatchesMetavariableNode = label.matchMetavariableNode(metavariableNode);
|
|
68
68
|
|
|
69
69
|
if (labelMatchesMetavariableNode) {
|
|
@@ -71,7 +71,7 @@ export default class Rule {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
return
|
|
74
|
+
return matchesMetavariableNode;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
toJSON(tokens) {
|
|
@@ -150,15 +150,15 @@ function matchPremise(premise, proofStep, substitutions, fileContext, localConte
|
|
|
150
150
|
statementNode = proofStep.getStatementNode();
|
|
151
151
|
|
|
152
152
|
if (subproofNode !== null) {
|
|
153
|
-
const
|
|
153
|
+
const premiseMatchesSubproofNode = premise.matchSubproofNode(subproofNode, substitutions, fileContext, localContext);
|
|
154
154
|
|
|
155
|
-
premiseMatches =
|
|
155
|
+
premiseMatches = premiseMatchesSubproofNode; ///
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
if (statementNode !== null) {
|
|
159
|
-
const
|
|
159
|
+
const premiseMatchesStatementNode = premise.matchStatementNode(statementNode, substitutions, fileContext, localContext);
|
|
160
160
|
|
|
161
|
-
premiseMatches =
|
|
161
|
+
premiseMatches = premiseMatchesStatementNode; ///
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
return premiseMatches;
|
|
@@ -181,8 +181,8 @@ function matchPremises(premises, proofSteps, substitutions, fileContext, localCo
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
function matchConclusion(conclusion, statementNode, substitutions, fileContext, localContext) {
|
|
184
|
-
const
|
|
185
|
-
conclusionMatches =
|
|
184
|
+
const conclusionMatchesStatementNode = conclusion.matchStatementNode(statementNode, substitutions, fileContext, localContext),
|
|
185
|
+
conclusionMatches = conclusionMatchesStatementNode; ///
|
|
186
186
|
|
|
187
187
|
return conclusionMatches;
|
|
188
188
|
}
|
|
@@ -195,21 +195,21 @@ function metaMatchPremise(premise, metaproofStep, substitutions, fileContext, lo
|
|
|
195
195
|
metastatementNode = metaproofStep.getMetastatementNode()
|
|
196
196
|
|
|
197
197
|
if (ruleSubproofNode !== null) {
|
|
198
|
-
const
|
|
198
|
+
const premiseMatchesRuleSubproofNode = premise.matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext);
|
|
199
199
|
|
|
200
|
-
premiseMatches =
|
|
200
|
+
premiseMatches = premiseMatchesRuleSubproofNode; ///
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
if (metaSubproofNode !== null) {
|
|
204
|
-
const
|
|
204
|
+
const premiseMatchesMetaSubproofNode = premise.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
|
|
205
205
|
|
|
206
|
-
premiseMatches =
|
|
206
|
+
premiseMatches = premiseMatchesMetaSubproofNode; ///
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
if (metastatementNode !== null) {
|
|
210
|
-
const
|
|
210
|
+
const premiseMatchesMetastatementNode = premise.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
|
|
211
211
|
|
|
212
|
-
premiseMatches =
|
|
212
|
+
premiseMatches = premiseMatchesMetastatementNode; ///
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
return premiseMatches;
|
|
@@ -232,8 +232,8 @@ function metaMatchPremises(premises, metaproofSteps, substitutions, fileContext,
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
function metaMatchConclusion(conclusion, metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
235
|
-
const
|
|
236
|
-
conclusionMatches =
|
|
235
|
+
const conclusionMatchesMetastatementNode = conclusion.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
|
|
236
|
+
conclusionMatches = conclusionMatchesMetastatementNode; ///
|
|
237
237
|
|
|
238
238
|
return conclusionMatches;
|
|
239
239
|
}
|
package/src/step/metaproof.js
CHANGED
|
@@ -24,14 +24,14 @@ export default class MetaproofStep {
|
|
|
24
24
|
return this.metastatementNode;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
let
|
|
27
|
+
matchMetastatementNode(metastatementNode) {
|
|
28
|
+
let matchesMetastatementNode = false;
|
|
29
29
|
|
|
30
30
|
if (this.metastatementNode !== null) {
|
|
31
|
-
|
|
31
|
+
matchesMetastatementNode = this.metastatementNode.match(metastatementNode);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
return
|
|
34
|
+
return matchesMetastatementNode;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
static fromStatementNode(statementNode) {
|
package/src/step/proof.js
CHANGED
|
@@ -14,14 +14,14 @@ export default class ProofStep {
|
|
|
14
14
|
return this.statementNode;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
let
|
|
17
|
+
matchStatementNode(statementNode) {
|
|
18
|
+
let matchesStatementNode = false;
|
|
19
19
|
|
|
20
20
|
if (this.statementNode !== null) {
|
|
21
|
-
|
|
21
|
+
matchesStatementNode = this.statementNode.match(statementNode);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
return
|
|
24
|
+
return matchesStatementNode;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
static fromSubproofNode(subproofNode) {
|
|
@@ -23,27 +23,27 @@ export default class MetastatementForMetavariableSubstitution extends Substituti
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
matchMetavariableNode(metavariableNode) {
|
|
26
|
-
const
|
|
26
|
+
const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return matchesMetavariableNode;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
matchMetastatementNode(metastatementNode) {
|
|
32
|
-
let
|
|
32
|
+
let matchesMetastatementNode;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
matchesMetastatementNode = this.metastatementNode.match(metastatementNode)
|
|
35
35
|
|
|
36
|
-
if (!
|
|
36
|
+
if (!matchesMetastatementNode) {
|
|
37
37
|
const bracketedMetastatementChildNode = bracketedMetastatementChildNodeFromMetastatementNode(metastatementNode);
|
|
38
38
|
|
|
39
39
|
if (bracketedMetastatementChildNode !== null) {
|
|
40
40
|
const metastatementNode = bracketedMetastatementChildNode; ///
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
matchesMetastatementNode = this.metastatementNode.match(metastatementNode);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return matchesMetastatementNode;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
toJSON(tokens) {
|
|
@@ -50,9 +50,9 @@ export default class StatementForMetavariableSubstitution extends Substitution {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
matchMetavariableNode(metavariableNode) {
|
|
53
|
-
const
|
|
53
|
+
const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
|
|
54
54
|
|
|
55
|
-
return
|
|
55
|
+
return matchesMetavariableNode;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
static fromMetavariableNodeAndStatementNode(metavariableNode, statementNode) {
|
|
@@ -102,7 +102,9 @@ function matchStatementNode(statementNodeA, statementNodeB, substitution, substi
|
|
|
102
102
|
let statementNodeMatches;
|
|
103
103
|
|
|
104
104
|
if (substitution === null) {
|
|
105
|
-
|
|
105
|
+
const statementNodeAMatchesStatementNodeB = statementNodeB.match(statementNodeA);
|
|
106
|
+
|
|
107
|
+
statementNodeMatches = statementNodeAMatchesStatementNodeB; ///
|
|
106
108
|
} else {
|
|
107
109
|
const statementVerifiedAgainstStatement = verifyStatementAgainstStatement(statementNodeA, statementNodeB, substitution, substitutions, localContextA, localContextB);
|
|
108
110
|
|
|
@@ -34,15 +34,15 @@ export default class TermForVariableSubstitution extends Substitution {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
matchTermNode(termNode) {
|
|
37
|
-
const
|
|
37
|
+
const matchesTermNode = this.termNode.match(termNode);
|
|
38
38
|
|
|
39
|
-
return
|
|
39
|
+
return matchesTermNode;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
matchVariableNode(variableNode) {
|
|
43
|
-
const
|
|
43
|
+
const matchesVariableNode = this.variableNode.match(variableNode);
|
|
44
44
|
|
|
45
|
-
return
|
|
45
|
+
return matchesVariableNode;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
static fromSubstitutionNode(substitutionNode) {
|
|
@@ -91,9 +91,9 @@ function substituteTermNode(termNode, substitutions) {
|
|
|
91
91
|
|
|
92
92
|
if (termVariableNode !== null) {
|
|
93
93
|
substitutions.some((substitution) => {
|
|
94
|
-
const
|
|
94
|
+
const substitutionMatchesVariableNode = substitution.matchVariableNode(termVariableNode);
|
|
95
95
|
|
|
96
|
-
if (
|
|
96
|
+
if (substitutionMatchesVariableNode) {
|
|
97
97
|
termNode = substitution.getTermNode(); ///
|
|
98
98
|
|
|
99
99
|
return true;
|
|
@@ -106,9 +106,9 @@ function substituteTermNode(termNode, substitutions) {
|
|
|
106
106
|
|
|
107
107
|
function substituteVariableNode(variableNode, substitutions) {
|
|
108
108
|
substitutions.some((substitution) => {
|
|
109
|
-
const
|
|
109
|
+
const substitutionMatchesVariableNode = substitution.matchVariableNode(variableNode);
|
|
110
110
|
|
|
111
|
-
if (
|
|
111
|
+
if (substitutionMatchesVariableNode) {
|
|
112
112
|
const termNode = substitution.getTermNode(),
|
|
113
113
|
termVariableNode = variableNodeQuery(termNode);
|
|
114
114
|
|