occam-verify-cli 0.0.909 → 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 -35
- package/lib/context/local.js +14 -19
- package/lib/context/localMeta.js +16 -21
- package/lib/declaration.js +10 -10
- 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 +10 -10
- 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 +19 -19
- package/lib/rule.js +21 -21
- package/lib/step/metaproof.js +14 -53
- package/lib/step/proof.js +10 -22
- package/lib/substitution/metastatementForMetavariable.js +11 -11
- package/lib/substitution/statementForMetavariable.js +9 -8
- 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 +96 -0
- 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/metaDerivation.js +7 -7
- package/lib/verify/metaSubDerivation.js +6 -6
- package/lib/verify/metaproofStep.js +98 -0
- package/lib/verify/metastatement/unqualified.js +4 -7
- 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 -30
- package/src/context/local.js +13 -19
- package/src/context/localMeta.js +15 -21
- package/src/declaration.js +12 -12
- 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 +9 -9
- 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 +18 -18
- package/src/rule.js +22 -22
- package/src/step/metaproof.js +12 -73
- package/src/step/proof.js +8 -26
- package/src/substitution/metastatementForMetavariable.js +10 -10
- package/src/substitution/statementForMetavariable.js +6 -4
- 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 +100 -0
- 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/metaDerivation.js +6 -6
- package/src/verify/metaSubDerivation.js +6 -6
- package/src/verify/{metaProofStep.js → metaproofStep.js} +60 -19
- package/src/verify/metastatement/unqualified.js +3 -7
- 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/lib/utilities/metaproof.js +0 -59
- package/lib/utilities/proof.js +0 -59
- package/lib/verify/metaProofStep.js +0 -76
- package/src/utilities/metaproof.js +0 -53
- package/src/utilities/proof.js +0 -53
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occam-verify-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.911",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.28",
|
|
14
14
|
"necessary": "^14.0.1",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.811",
|
|
16
16
|
"occam-entities": "^1.0.146",
|
|
17
17
|
"occam-file-system": "^6.0.187",
|
|
18
18
|
"occam-grammar-utilities": "^8.0.207",
|
|
@@ -48,7 +48,7 @@ export default class AxiomLemmaTheoremConjecture {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
matchMetavariableNode(metavariableNode) {
|
|
51
|
-
const
|
|
51
|
+
const matchesMetavariableNode = this.labels.some((label) => {
|
|
52
52
|
const labelMatchesMetavariableNode = label.matchMetavariableNode(metavariableNode);
|
|
53
53
|
|
|
54
54
|
if (labelMatchesMetavariableNode) {
|
|
@@ -56,7 +56,7 @@ export default class AxiomLemmaTheoremConjecture {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return matchesMetavariableNode;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
toJSON(tokens) {
|
|
@@ -149,17 +149,17 @@ function matchSupposition(supposition, proofStep, substitutions, localContext, s
|
|
|
149
149
|
const statementNode = proofStep.getStatementNode();
|
|
150
150
|
|
|
151
151
|
if (statementNode !== null) {
|
|
152
|
-
const
|
|
152
|
+
const suppositionMatchesStatementNode = supposition.matchStatementNode(statementNode, substitutions, localContext, statementLocalContext);
|
|
153
153
|
|
|
154
|
-
suppositionMatches =
|
|
154
|
+
suppositionMatches = suppositionMatchesStatementNode; ///
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
return suppositionMatches;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
function matchConsequent(consequent, statementNode, substitutions, localContext, statementLocalContext) {
|
|
161
|
-
const
|
|
162
|
-
consequentMatches =
|
|
161
|
+
const consequentMatchesStatementNode = consequent.matchStatementNode(statementNode, substitutions, localContext, statementLocalContext),
|
|
162
|
+
consequentMatches = consequentMatchesStatementNode; ///
|
|
163
163
|
|
|
164
164
|
return consequentMatches;
|
|
165
165
|
}
|
package/src/conclusion.js
CHANGED
|
@@ -22,7 +22,7 @@ export default class Conclusion {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
matchStatementNode(statementNode, substitutions, localContext, statementLocalContext) {
|
|
25
|
-
let
|
|
25
|
+
let matchesStatementNose = false;
|
|
26
26
|
|
|
27
27
|
if (this.metastatementNode !== null) {
|
|
28
28
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -35,14 +35,14 @@ export default class Conclusion {
|
|
|
35
35
|
return verifiedAhead;
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
matchesStatementNose = nonTerminalNodeVerified; ///
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return matchesStatementNose;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
45
|
-
let
|
|
45
|
+
let matchesMetastatementNode = false;
|
|
46
46
|
|
|
47
47
|
if (this.metastatementNode !== null) {
|
|
48
48
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
@@ -56,10 +56,10 @@ export default class Conclusion {
|
|
|
56
56
|
return verifiedAhead;
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
matchesMetastatementNode = nonTerminalNodeVerified; ///
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
return
|
|
62
|
+
return matchesMetastatementNode;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
toJSON(tokens) {
|
package/src/consequent.js
CHANGED
|
@@ -24,9 +24,9 @@ export default class Consequent {
|
|
|
24
24
|
|
|
25
25
|
return verifiedAhead;
|
|
26
26
|
}),
|
|
27
|
-
|
|
27
|
+
matchesStatementNode = nonTerminalNodeVerified; ///
|
|
28
28
|
|
|
29
|
-
return
|
|
29
|
+
return matchesStatementNode;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
toJSON(tokens) {
|
package/src/context/file.js
CHANGED
|
@@ -337,9 +337,9 @@ export default class FileContext {
|
|
|
337
337
|
const node = variableNode, ///
|
|
338
338
|
variables = this.getVariables(),
|
|
339
339
|
variable = variables.find((variable) => {
|
|
340
|
-
const
|
|
340
|
+
const variableMatchesNode = variable.matchNode(node);
|
|
341
341
|
|
|
342
|
-
if (
|
|
342
|
+
if (variableMatchesNode) {
|
|
343
343
|
return true;
|
|
344
344
|
}
|
|
345
345
|
}) || null;
|
|
@@ -520,30 +520,6 @@ export default class FileContext {
|
|
|
520
520
|
return metavariablePresent;
|
|
521
521
|
}
|
|
522
522
|
|
|
523
|
-
isTermGrounded(term) {
|
|
524
|
-
const termGrounded = false; ///
|
|
525
|
-
|
|
526
|
-
return termGrounded;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
isVariableDefined(variable) {
|
|
530
|
-
const variableDefined = false; ///
|
|
531
|
-
|
|
532
|
-
return variableDefined;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
matchStatement(statementNode) {
|
|
536
|
-
const statementMatches = false;
|
|
537
|
-
|
|
538
|
-
return statementMatches;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
matchMetastatement(metastatementNode) {
|
|
542
|
-
const metastatementMatches = false;
|
|
543
|
-
|
|
544
|
-
return metastatementMatches;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
523
|
nodeAsString(node) {
|
|
548
524
|
const string = nodeAsString(node, this.tokens);
|
|
549
525
|
|
|
@@ -581,9 +557,9 @@ export default class FileContext {
|
|
|
581
557
|
|
|
582
558
|
const node = variable.getNode(),
|
|
583
559
|
variablePresent = this.variables.some((variable) => {
|
|
584
|
-
const
|
|
560
|
+
const variableMatchesNode = variable.matchNode(node);
|
|
585
561
|
|
|
586
|
-
if (
|
|
562
|
+
if (variableMatchesNode) {
|
|
587
563
|
return true;
|
|
588
564
|
}
|
|
589
565
|
});
|
|
@@ -622,9 +598,9 @@ export default class FileContext {
|
|
|
622
598
|
|
|
623
599
|
const name = metavariable.getName(),
|
|
624
600
|
metavariablePresent = this.metavariables.some((metavariable) => {
|
|
625
|
-
const
|
|
601
|
+
const metavariableMatchesNode = metavariable.matchName(name);
|
|
626
602
|
|
|
627
|
-
if (
|
|
603
|
+
if (metavariableMatchesNode) {
|
|
628
604
|
return true;
|
|
629
605
|
}
|
|
630
606
|
});
|
package/src/context/local.js
CHANGED
|
@@ -4,7 +4,7 @@ import Variable from "../variable";
|
|
|
4
4
|
import Equivalence from "../equivalence";
|
|
5
5
|
import contextMixins from "../mixins/context";
|
|
6
6
|
|
|
7
|
-
import { last } from "../utilities/array";
|
|
7
|
+
import { last, reverse } from "../utilities/array";
|
|
8
8
|
import { mergeEquivalences, findEquivalenceByTerm, groundedTermsAndDefinedVariablesFromFromEquivalences } from "../utilities/equivalences";
|
|
9
9
|
|
|
10
10
|
class LocalContext {
|
|
@@ -183,9 +183,9 @@ class LocalContext {
|
|
|
183
183
|
|
|
184
184
|
const node = variable.getNode(),
|
|
185
185
|
variablePresent = this.variables.some((variable) => {
|
|
186
|
-
const
|
|
186
|
+
const variableMatchesNode = variable.matchNode(node);
|
|
187
187
|
|
|
188
|
-
if (
|
|
188
|
+
if (variableMatchesNode) {
|
|
189
189
|
return true;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
@@ -215,26 +215,20 @@ class LocalContext {
|
|
|
215
215
|
this.equivalences.splice(start, deleteCount);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
let
|
|
218
|
+
matchStatementNode(statementNode) {
|
|
219
|
+
let proofSteps = this.getProofSteps();
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
const proofStepMatchesStatement = this.proofSteps.some((proofStep) => {
|
|
223
|
-
const proofStepMatchesStatement = proofStep.match(statementNode);
|
|
221
|
+
proofSteps = reverse(proofSteps); ///
|
|
224
222
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
statementMatches = proofStepMatchesStatement; ///
|
|
231
|
-
}
|
|
223
|
+
const matchesStatementNode = proofSteps.some((proofStep) => {
|
|
224
|
+
const proofStepMatchesStatementNode = proofStep.matchStatementNode(statementNode);
|
|
232
225
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
226
|
+
if (proofStepMatchesStatementNode) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
236
230
|
|
|
237
|
-
return
|
|
231
|
+
return matchesStatementNode;
|
|
238
232
|
}
|
|
239
233
|
|
|
240
234
|
findVariableByVariableNode(variableNode) {
|
package/src/context/localMeta.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import LocalContext from "../context/local";
|
|
4
4
|
|
|
5
|
-
import { last } from "../utilities/array";
|
|
5
|
+
import { last, reverse } from "../utilities/array";
|
|
6
6
|
|
|
7
7
|
class LocalMetaContext extends LocalContext {
|
|
8
8
|
constructor(context, variables, proofSteps, equivalences, metavariables, metaproofSteps, frameAssertions) {
|
|
@@ -78,9 +78,9 @@ class LocalMetaContext extends LocalContext {
|
|
|
78
78
|
|
|
79
79
|
const node = metavariable.getName(),
|
|
80
80
|
metavariablePresent = this.metavariables.some((metavariable) => {
|
|
81
|
-
const
|
|
81
|
+
const metavariableMatchesNode = metavariable.matchNode(node);
|
|
82
82
|
|
|
83
|
-
if (
|
|
83
|
+
if (metavariableMatchesNode) {
|
|
84
84
|
return true;
|
|
85
85
|
}
|
|
86
86
|
});
|
|
@@ -98,26 +98,20 @@ class LocalMetaContext extends LocalContext {
|
|
|
98
98
|
this.metaproofSteps.push(metaproofStep);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
let
|
|
101
|
+
matchMetastatementNode(metastatementNode) {
|
|
102
|
+
let metaproofSteps = this.getMetaproofSteps();
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
const proofStepMatchesMetastatement = this.metaproofSteps.some((metaproofStep) => {
|
|
106
|
-
const proofStepMatchesMetastatement = metaproofStep.match(metastatementNode);
|
|
104
|
+
metaproofSteps = reverse(metaproofSteps); ///
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
});
|
|
106
|
+
const matchesMetastatementNode = metaproofSteps.some((metaproofStep) => {
|
|
107
|
+
const metaproofStepMatchesMetastatementNode = metaproofStep.matchMetastatementNode(metastatementNode);
|
|
112
108
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
metastatementMatches = this.context.matchMetastatement(metastatementNode);
|
|
118
|
-
}
|
|
109
|
+
if (metaproofStepMatchesMetastatementNode) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
119
113
|
|
|
120
|
-
return
|
|
114
|
+
return matchesMetastatementNode;
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
findMetavariableByMetavariableNode(metavariableNode, localMetaContext) {
|
|
@@ -137,9 +131,9 @@ class LocalMetaContext extends LocalContext {
|
|
|
137
131
|
findFrameAssertionByMetavariableNode(metavariableNode) {
|
|
138
132
|
const frameAssertions = this.getFrameAssertions(),
|
|
139
133
|
frameAssertion = frameAssertions.find((frameAssertion) => {
|
|
140
|
-
const
|
|
134
|
+
const frameAssertionMatchesMetavariableNode = frameAssertion.matchMetavariableNode(metavariableNode);
|
|
141
135
|
|
|
142
|
-
if (
|
|
136
|
+
if (frameAssertionMatchesMetavariableNode) {
|
|
143
137
|
return true;
|
|
144
138
|
}
|
|
145
139
|
}) || null;
|
package/src/declaration.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { matchMetastatementModuloBrackets } from "./utilities/match";
|
|
4
4
|
|
|
5
5
|
export default class Declaration {
|
|
6
6
|
constructor(metavariableNode, metastatementNode) {
|
|
@@ -19,35 +19,35 @@ export default class Declaration {
|
|
|
19
19
|
matchSubstitution(substitution) {
|
|
20
20
|
const metavariableNode = substitution.getMetavariableNode(),
|
|
21
21
|
metastatementNode = substitution.getMetastatementNode(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
matchesMetavariableNode = this.matchMetavariableNode(metavariableNode),
|
|
23
|
+
matchesMetastatementNode = this.matchMetastatementNode(metastatementNode),
|
|
24
|
+
matchesSubstitution = (matchesMetavariableNode && matchesMetastatementNode);
|
|
25
25
|
|
|
26
|
-
return
|
|
26
|
+
return matchesSubstitution;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
matchMetavariableNode(metavariableNode) {
|
|
30
|
-
const
|
|
30
|
+
const matchesMetavariableNode = this.metavariableNode.match(metavariableNode);
|
|
31
31
|
|
|
32
|
-
return
|
|
32
|
+
return matchesMetavariableNode;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
matchMetastatementNode(metastatementNode) {
|
|
36
36
|
const metastatementNodeA = metastatementNode, ///
|
|
37
37
|
metastatementNodeB = this.metastatementNode, ///
|
|
38
|
-
metastatementMatches =
|
|
39
|
-
|
|
38
|
+
metastatementMatches = matchMetastatementModuloBrackets(metastatementNodeA, metastatementNodeB),
|
|
39
|
+
matchesMetastatementNode = metastatementMatches; ///
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return matchesMetastatementNode;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
matchMetaLemmaOrMetaTheorem(metaLemmaMetatheorem) {
|
|
45
45
|
const metaConsequent = metaLemmaMetatheorem.getMetaConsequent(),
|
|
46
46
|
metastatementNode = metaConsequent.getMetastatementNode(),
|
|
47
47
|
matches = this.metastatementNode.match(metastatementNode),
|
|
48
|
-
|
|
48
|
+
matchesMetaLemmaOrMetaTheorem = matches; ///
|
|
49
49
|
|
|
50
|
-
return
|
|
50
|
+
return matchesMetaLemmaOrMetaTheorem;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
static fromMetavariableNodeAndMetastatementNode(metavariableNode, metastatementNode) {
|
package/src/equivalence.js
CHANGED
|
@@ -49,14 +49,14 @@ export default class Equivalence {
|
|
|
49
49
|
const typeB = type; ///
|
|
50
50
|
|
|
51
51
|
const typeAEqualToTypeB = typeA.isEqualTo(typeB),
|
|
52
|
-
|
|
52
|
+
matchesType = typeAEqualToTypeB; ///
|
|
53
53
|
|
|
54
|
-
return
|
|
54
|
+
return matchesType;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
matchTerm(term) {
|
|
58
58
|
const termA = term, ///
|
|
59
|
-
|
|
59
|
+
matchesTerm = this.terms.some((term) => {
|
|
60
60
|
const termB = term, ///
|
|
61
61
|
termAMatchesTermB = termA.match(termB);
|
|
62
62
|
|
|
@@ -65,24 +65,24 @@ export default class Equivalence {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
return
|
|
68
|
+
return matchesTerm;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
matchTerms(terms) {
|
|
72
|
-
const
|
|
73
|
-
const
|
|
72
|
+
const matchesTerms = terms.every((term) => {
|
|
73
|
+
const matchesTerm = this.matchTerm(term);
|
|
74
74
|
|
|
75
|
-
if (
|
|
75
|
+
if (matchesTerm) {
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
return
|
|
80
|
+
return matchesTerms;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
matchTermNode(termNode) {
|
|
84
84
|
const termNodeA = termNode, ///
|
|
85
|
-
|
|
85
|
+
matchesTermNode = this.terms.some((term) => {
|
|
86
86
|
const termNode = term.getNode(),
|
|
87
87
|
termNodeB = termNode, ///
|
|
88
88
|
termNodeAMatchesTermB = termNodeA.match(termNodeB);
|
|
@@ -92,19 +92,19 @@ export default class Equivalence {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
return
|
|
95
|
+
return matchesTermNode;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
matchTermNodes(termNodes) {
|
|
99
|
-
const
|
|
100
|
-
const
|
|
99
|
+
const matchesTermNodes = termNodes.every((termNode) => {
|
|
100
|
+
const matchesTermNode = this.matchTermNode(termNode);
|
|
101
101
|
|
|
102
|
-
if (
|
|
102
|
+
if (matchesTermNode) {
|
|
103
103
|
return true;
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
return
|
|
107
|
+
return matchesTermNodes;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
getGroundedTerms(definedVariables, groundedTerms, localContext) {
|
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
|
@@ -11,7 +11,7 @@ import { statementNodeFromStatementString, metastatementNodeFromMetastatementStr
|
|
|
11
11
|
const subproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion!"),
|
|
12
12
|
subproofAssertionMetastatementNodesQuery = nodesQuery("/subproofAssertion/metastatement"),
|
|
13
13
|
metaSubproofMetaSuppositionMetastatementNodesQuery = nodesQuery("/metaSubproof/metaSupposition/unqualifiedMetastatement/metastatement!"),
|
|
14
|
-
|
|
14
|
+
metaSubproofLastMetpProofStepMetastatementNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation/lastMetpProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
|
|
15
15
|
|
|
16
16
|
export default class MetaSupposition {
|
|
17
17
|
constructor(metastatementNode, statementNode) {
|
|
@@ -28,21 +28,21 @@ 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);
|
|
35
35
|
|
|
36
36
|
if (subproofAssertionNode !== null) {
|
|
37
37
|
const metaSubproofMetaSuppositionMetastatementNodes = metaSubproofMetaSuppositionMetastatementNodesQuery(metaSubproofNode),
|
|
38
|
-
|
|
38
|
+
metaSubproofLastMetpProofStepMetastatementNode = metaSubproofLastMetpProofStepMetastatementNodeQuery(metaSubproofNode),
|
|
39
39
|
metaSubproofMetastatementNodes = [
|
|
40
40
|
...metaSubproofMetaSuppositionMetastatementNodes,
|
|
41
|
-
|
|
41
|
+
metaSubproofLastMetpProofStepMetastatementNode
|
|
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) {
|