occam-verify-cli 0.0.892 → 0.0.894
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 +5 -5
- package/lib/conclusion.js +4 -3
- package/lib/metaConsequent.js +4 -3
- package/lib/metaLemmaMetatheorem.js +16 -16
- package/lib/metaSupposition.js +19 -20
- package/lib/premise.js +63 -20
- package/lib/rule.js +43 -31
- package/lib/step/metaproof.js +19 -5
- package/lib/utilities/array.js +5 -2
- package/lib/verifier/nodes/metaLevel.js +7 -7
- package/lib/verify/derivation.js +10 -90
- package/lib/verify/metaDerivation.js +7 -87
- package/lib/verify/metaProofStep.js +76 -0
- package/lib/verify/metaSubDerivation.js +25 -0
- package/lib/verify/metaSubproof.js +34 -0
- package/lib/verify/metaproof.js +7 -8
- package/lib/verify/metastatement/qualified.js +71 -35
- package/lib/verify/metastatement/unqualified.js +16 -19
- package/lib/verify/proofStep.js +70 -0
- package/lib/verify/ruleDerivation.js +7 -85
- package/lib/verify/ruleProofStep.js +88 -0
- package/lib/verify/ruleSubDerivation.js +25 -0
- package/lib/verify/ruleSubproof.js +34 -0
- package/lib/verify/statement/qualified.js +74 -100
- package/lib/verify/statement/unqualified.js +16 -19
- package/lib/verify/statement.js +7 -1
- package/lib/verify/subDerivation.js +25 -0
- package/lib/verify/subproof.js +34 -0
- package/package.json +4 -4
- package/src/axiomLemmaTheoremConjecture.js +6 -5
- package/src/conclusion.js +6 -4
- package/src/metaConsequent.js +6 -4
- package/src/metaLemmaMetatheorem.js +16 -16
- package/src/metaSupposition.js +32 -33
- package/src/premise.js +106 -35
- package/src/rule.js +48 -30
- package/src/step/metaproof.js +24 -7
- package/src/utilities/array.js +1 -1
- package/src/verifier/nodes/metaLevel.js +6 -6
- package/src/verify/derivation.js +10 -138
- package/src/verify/metaDerivation.js +7 -135
- package/src/verify/metaProofStep.js +98 -0
- package/src/verify/metaSubDerivation.js +22 -0
- package/src/verify/metaSubproof.js +32 -0
- package/src/verify/metaproof.js +11 -11
- package/src/verify/metastatement/qualified.js +98 -32
- package/src/verify/metastatement/unqualified.js +16 -19
- package/src/verify/proofStep.js +88 -0
- package/src/verify/ruleDerivation.js +7 -133
- package/src/verify/ruleProofStep.js +121 -0
- package/src/verify/ruleSubDerivation.js +22 -0
- package/src/verify/ruleSubproof.js +32 -0
- package/src/verify/statement/qualified.js +83 -125
- package/src/verify/statement/unqualified.js +16 -19
- package/src/verify/statement.js +2 -2
- package/src/verify/subDerivation.js +22 -0
- package/src/verify/subproof.js +32 -0
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.894",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.28",
|
|
14
14
|
"necessary": "^14.0.1",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
16
|
-
"occam-entities": "^1.0.
|
|
17
|
-
"occam-file-system": "^6.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.803",
|
|
16
|
+
"occam-entities": "^1.0.144",
|
|
17
|
+
"occam-file-system": "^6.0.185",
|
|
18
18
|
"occam-grammar-utilities": "^8.0.207",
|
|
19
19
|
"occam-query": "^3.1.174"
|
|
20
20
|
},
|
|
@@ -5,7 +5,7 @@ import Consequent from "./consequent";
|
|
|
5
5
|
import Supposition from "./supposition";
|
|
6
6
|
import LocalContext from "./context/local";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extract } from "./utilities/array";
|
|
9
9
|
import { someSubArray } from "./utilities/array";
|
|
10
10
|
|
|
11
11
|
export default class AxiomLemmaTheoremConjecture {
|
|
@@ -32,10 +32,11 @@ export default class AxiomLemmaTheoremConjecture {
|
|
|
32
32
|
return this.localContext;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
matchStatement(statementNode,
|
|
35
|
+
matchStatement(statementNode, localContext) {
|
|
36
36
|
let statementNatches;
|
|
37
37
|
|
|
38
|
-
const suppositionsLength = this.suppositions.length
|
|
38
|
+
const suppositionsLength = this.suppositions.length,
|
|
39
|
+
statementLocalContext = localContext; ///
|
|
39
40
|
|
|
40
41
|
if (suppositionsLength === 0) {
|
|
41
42
|
const substitutions = [],
|
|
@@ -147,13 +148,13 @@ export default class AxiomLemmaTheoremConjecture {
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
function matchSupposition(supposition, proofSteps, substitutions, localContext, statementLocalContext) {
|
|
150
|
-
const proofStep =
|
|
151
|
+
const proofStep = extract(proofSteps, (proofStep) => {
|
|
151
152
|
const statementNode = proofStep.getStatementNode();
|
|
152
153
|
|
|
153
154
|
if (statementNode !== null) {
|
|
154
155
|
const statementMatches = supposition.matchStatementNode(statementNode, substitutions, localContext, statementLocalContext);
|
|
155
156
|
|
|
156
|
-
if (
|
|
157
|
+
if (statementMatches) {
|
|
157
158
|
return true;
|
|
158
159
|
}
|
|
159
160
|
}
|
package/src/conclusion.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
import intrinsicLevelAgainstMetaLevelNodesVerifier from "./verifier/nodes/intrinsicLevelAgainstMetaLevel";
|
|
5
6
|
|
|
@@ -30,12 +31,13 @@ export default class Conclusion {
|
|
|
30
31
|
return statementNodeMatches;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
34
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
34
35
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
35
36
|
nonTerminalNodeB = metastatementNode, ///
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
fileContextA = fileContext, ///
|
|
38
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
39
|
+
localMetaContextB = localMetaContext, ///
|
|
40
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
39
41
|
const verifiedAhead = true;
|
|
40
42
|
|
|
41
43
|
return verifiedAhead;
|
package/src/metaConsequent.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
|
|
5
6
|
import { nodeAsString } from "./utilities/string";
|
|
@@ -14,12 +15,13 @@ export default class MetaConsequent {
|
|
|
14
15
|
return this.metastatementNode;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
18
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
18
19
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
19
20
|
nonTerminalNodeB = metastatementNode, ///
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
fileContextA = fileContext, ///
|
|
22
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
23
|
+
localMetaContextB = localMetaContext, ///
|
|
24
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
23
25
|
const verifiedAhead = true;
|
|
24
26
|
|
|
25
27
|
return verifiedAhead;
|
|
@@ -5,7 +5,7 @@ import MetaConsequent from "./metaConsequent";
|
|
|
5
5
|
import MetaSupposition from "./metaSupposition";
|
|
6
6
|
import MetastatementForMetavariableSubstitution from "./substitution/metastatementForMetavariable";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extract } from "./utilities/array";
|
|
9
9
|
import { someSubArray } from "./utilities/array";
|
|
10
10
|
|
|
11
11
|
export default class MetaLemmaMetatheorem {
|
|
@@ -37,27 +37,27 @@ export default class MetaLemmaMetatheorem {
|
|
|
37
37
|
return this.fileContext;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
matchMetastatement(metastatementNode,
|
|
40
|
+
matchMetastatement(metastatementNode, localMetaContext) {
|
|
41
41
|
let metastatementNatches;
|
|
42
42
|
|
|
43
43
|
const metaSuppositionsLength = this.metaSuppositions.length;
|
|
44
44
|
|
|
45
45
|
if (metaSuppositionsLength === 0) {
|
|
46
46
|
const substitutions = [],
|
|
47
|
-
metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext,
|
|
47
|
+
metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
48
48
|
|
|
49
49
|
metastatementNatches = metaConsequentMatches; ///
|
|
50
50
|
} else {
|
|
51
|
-
const metaproofSteps =
|
|
51
|
+
const metaproofSteps = localMetaContext.getProofSteps();
|
|
52
52
|
|
|
53
53
|
metastatementNatches = someSubArray(metaproofSteps, metaSuppositionsLength, (metaproofSteps) => {
|
|
54
54
|
let metaSuppositionsMatchMetaConsequent = false;
|
|
55
55
|
|
|
56
56
|
const substitutions = [],
|
|
57
|
-
metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext,
|
|
57
|
+
metaSuppositionsMatch = matchMetaSuppositions(this.metaSuppositions, metaproofSteps, substitutions, this.fileContext, localMetaContext);
|
|
58
58
|
|
|
59
59
|
if (metaSuppositionsMatch) {
|
|
60
|
-
const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext,
|
|
60
|
+
const metaConsequentMatches = matchMetaConsequent(this.metaConsequent, metastatementNode, substitutions, this.fileContext, localMetaContext);
|
|
61
61
|
|
|
62
62
|
metaSuppositionsMatchMetaConsequent = metaConsequentMatches; ///
|
|
63
63
|
}
|
|
@@ -162,23 +162,23 @@ export default class MetaLemmaMetatheorem {
|
|
|
162
162
|
static fromLabelsMetaSuppositionsMetaConsequentSubstitutionsAndFileContext(Class, labels, metaSuppositions, metaConsequent, substitutions, fileContext) { return new Class(labels, metaSuppositions, metaConsequent, substitutions, fileContext); }
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext,
|
|
166
|
-
const metaproofStep =
|
|
165
|
+
function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
166
|
+
const metaproofStep = extract(metaproofSteps, (metaproofStep) => {
|
|
167
167
|
const metaSubproofNode = metaproofStep.getMetaSubproofNode(),
|
|
168
168
|
metastatementNode = metaproofStep.getMetastatementNode();
|
|
169
169
|
|
|
170
170
|
if (metaSubproofNode !== null) {
|
|
171
|
-
const metaSubProofMatches = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext,
|
|
171
|
+
const metaSubProofMatches = metaSupposition.matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext);
|
|
172
172
|
|
|
173
|
-
if (
|
|
173
|
+
if (metaSubProofMatches) {
|
|
174
174
|
return true;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
if (metastatementNode !== null) {
|
|
179
|
-
const metastatementMatches = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
179
|
+
const metastatementMatches = metaSupposition.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext);
|
|
180
180
|
|
|
181
|
-
if (
|
|
181
|
+
if (metastatementMatches) {
|
|
182
182
|
return true;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -189,9 +189,9 @@ function matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fi
|
|
|
189
189
|
return metaSuppositionMatches;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext,
|
|
192
|
+
function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions, fileContext, localMetaContext) {
|
|
193
193
|
const metaSuppositionsMatch = metaSuppositions.every((metaSupposition) => {
|
|
194
|
-
const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext,
|
|
194
|
+
const metaSuppositionMatches = matchMetaSupposition(metaSupposition, metaproofSteps, substitutions, fileContext, localMetaContext);
|
|
195
195
|
|
|
196
196
|
if (metaSuppositionMatches) {
|
|
197
197
|
return true;
|
|
@@ -201,8 +201,8 @@ function matchMetaSuppositions(metaSuppositions, metaproofSteps, substitutions,
|
|
|
201
201
|
return metaSuppositionsMatch;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext,
|
|
205
|
-
const nonTerminalNodeMatches = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext,
|
|
204
|
+
function matchMetaConsequent(metaConsequent, metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
205
|
+
const nonTerminalNodeMatches = metaConsequent.matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext),
|
|
206
206
|
metaConsequentMatches = nonTerminalNodeMatches; ///
|
|
207
207
|
|
|
208
208
|
return metaConsequentMatches;
|
package/src/metaSupposition.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import LocalMetaContext from "./context/localMeta";
|
|
3
4
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
4
5
|
|
|
5
6
|
import { match } from "./utilities/array";
|
|
@@ -7,10 +8,10 @@ import { nodeAsString } from "./utilities/string";
|
|
|
7
8
|
import { nodeQuery, nodesQuery } from "./utilities/query";
|
|
8
9
|
import { metastatementNodeFromMetastatementString } from "./utilities/node";
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const subproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion!"),
|
|
12
|
+
subproofAssertionMetastatementNodesQuery = nodesQuery("/subproofAssertion/metastatement"),
|
|
12
13
|
metaSubproofMetaSuppositionMetastatementNodesQuery = nodesQuery("/metaSubproof/metaSupposition/unqualifiedMetastatement/metastatement!"),
|
|
13
|
-
|
|
14
|
+
metaSubproofLastMetaProofStepMetastatementNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation/lastMetaProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
|
|
14
15
|
|
|
15
16
|
export default class MetaSupposition {
|
|
16
17
|
constructor(metastatementNode) {
|
|
@@ -21,50 +22,48 @@ export default class MetaSupposition {
|
|
|
21
22
|
return this.metastatementNode;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
matchMetaSubproofNode(metaSubproofNode, substitutions,
|
|
25
|
+
matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
25
26
|
let metaSubproofNodeMatches = false;
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
+
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
28
29
|
|
|
29
|
-
if (
|
|
30
|
+
if (subproofAssertionNode !== null) {
|
|
30
31
|
const metaSubproofMetaSuppositionMetastatementNodes = metaSubproofMetaSuppositionMetastatementNodesQuery(metaSubproofNode),
|
|
31
|
-
|
|
32
|
+
metaSubproofLastMetaProofStepMetastatementNode = metaSubproofLastMetaProofStepMetastatementNodeQuery(metaSubproofNode),
|
|
32
33
|
metaSubproofMetastatementNodes = [
|
|
33
34
|
...metaSubproofMetaSuppositionMetastatementNodes,
|
|
34
|
-
|
|
35
|
+
metaSubproofLastMetaProofStepMetastatementNode
|
|
35
36
|
],
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
37
|
+
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
38
|
+
|
|
39
|
+
metaSubproofNodeMatches = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
40
|
+
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
41
|
+
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
42
|
+
fileContextA = fileContext, ///
|
|
43
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
44
|
+
localMetaContextB = localMetaContext, ///
|
|
45
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
46
|
+
const verifiedAhead = true;
|
|
47
|
+
|
|
48
|
+
return verifiedAhead;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (nonTerminalNodeVerified) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
return metaSubproofNodeMatches;
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
matchMetastatementNode(metastatementNode, substitutions,
|
|
60
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
63
61
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
64
62
|
nonTerminalNodeB = metastatementNode, ///
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
fileContextA = fileContext, ///
|
|
64
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
65
|
+
localMetaContextB = localMetaContext, ///
|
|
66
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
68
67
|
const verifiedAhead = true;
|
|
69
68
|
|
|
70
69
|
return verifiedAhead;
|
package/src/premise.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import LocalContext from "./context/local";
|
|
4
|
+
import LocalMetaContext from "./context/localMeta";
|
|
4
5
|
import metaLevelNodesVerifier from "./verifier/nodes/metaLevel";
|
|
5
6
|
import intrinsicLevelAgainstMetaLevelNodesVerifier from "./verifier/nodes/intrinsicLevelAgainstMetaLevel";
|
|
6
7
|
|
|
@@ -10,9 +11,13 @@ import { nodeQuery, nodesQuery } from "./utilities/query";
|
|
|
10
11
|
import { metastatementNodeFromMetastatementString } from "./utilities/node";
|
|
11
12
|
|
|
12
13
|
const subproofAssertionNodeQuery = nodeQuery("/metastatement/subproofAssertion!"),
|
|
13
|
-
|
|
14
|
+
subproofSuppositionStatementNodesQuery = nodesQuery("/subproof/supposition/unqualifiedStatement!/statement!"),
|
|
15
|
+
subproofLastProofStepStatementNodeQuery = nodeQuery("/subproof/subDerivation/lastProofStep/unqualifiedStatement|qualifiedStatement/statement!"),
|
|
14
16
|
subproofAssertionMetastatementNodesQuery = nodesQuery("/subproofAssertion/metastatement"),
|
|
15
|
-
|
|
17
|
+
ruleSubproofPremiseMetastatementNodesQuery = nodesQuery("/ruleSubproof/premise/unqualifiedMetastatement!/metastatement!"),
|
|
18
|
+
metaSubproofMetaSuppositionMetastatementNodesQuery = nodesQuery("/metaSubproof/metaSupposition/unqualifiedMetastatement!/metastatement!"),
|
|
19
|
+
ruleSubproofLastRuleProofStepMetastatementNodeQuery = nodeQuery("/ruleSubproof/ruleSubDerivation/lastRuleProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!"),
|
|
20
|
+
metaSubproofLastMetaProofStepMetastatementNodeQuery = nodeQuery("/metaSubproof/metaSubDerivation/lastMetaProofStep/unqualifiedMetastatement|qualifiedMetastatement/metastatement!");
|
|
16
21
|
|
|
17
22
|
export default class Premise {
|
|
18
23
|
constructor(metastatementNode) {
|
|
@@ -23,12 +28,12 @@ export default class Premise {
|
|
|
23
28
|
return this.metastatementNode;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
matchStatementNode(statementNode, substitutions, fileContext,
|
|
31
|
+
matchStatementNode(statementNode, substitutions, fileContext, localContext) {
|
|
27
32
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
28
33
|
nonTerminalNodeB = statementNode, ///
|
|
29
34
|
fileContextA = fileContext, ///
|
|
30
35
|
localContextA = LocalContext.fromFileContext(fileContextA),
|
|
31
|
-
localContextB =
|
|
36
|
+
localContextB = localContext, ///
|
|
32
37
|
nonTerminalNodeVerified = intrinsicLevelAgainstMetaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
|
|
33
38
|
const verifiedAhead = true;
|
|
34
39
|
|
|
@@ -39,52 +44,118 @@ export default class Premise {
|
|
|
39
44
|
return statementNodeMatches;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
matchSubproofNode(subproofNode, substitutions, fileContext, localContext) {
|
|
48
|
+
let subproofNodeMatches = false;
|
|
49
|
+
|
|
50
|
+
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
51
|
+
|
|
52
|
+
if (subproofAssertionNode !== null) {
|
|
53
|
+
const subproofSuppositionStatementNodes = subproofSuppositionStatementNodesQuery(subproofNode),
|
|
54
|
+
subproofLastProofStepStatementNode = subproofLastProofStepStatementNodeQuery(subproofNode),
|
|
55
|
+
subproofStatementNodes = [
|
|
56
|
+
...subproofSuppositionStatementNodes,
|
|
57
|
+
subproofLastProofStepStatementNode
|
|
58
|
+
],
|
|
59
|
+
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
60
|
+
|
|
61
|
+
subproofNodeMatches = match(subproofAssertionMetastatementNodes, subproofStatementNodes, (subproofAssertionMetastatementNode, subproofStatementNode) => {
|
|
62
|
+
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
63
|
+
nonTerminalNodeB = subproofStatementNode, ///
|
|
64
|
+
fileContextA = fileContext, ///
|
|
65
|
+
localContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
66
|
+
localContextB = localContext, ///
|
|
67
|
+
nonTerminalNodeVerified = intrinsicLevelAgainstMetaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
|
|
68
|
+
const verifiedAhead = true;
|
|
69
|
+
|
|
70
|
+
return verifiedAhead;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (nonTerminalNodeVerified) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return subproofNodeMatches;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
matchRuleSubproofNode(ruleSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
43
83
|
let ruleSubproofNodeMatches = false;
|
|
44
84
|
|
|
45
85
|
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
46
86
|
|
|
47
87
|
if (subproofAssertionNode !== null) {
|
|
48
|
-
const
|
|
49
|
-
|
|
88
|
+
const ruleSubproofPremiseMetastatementNodes = ruleSubproofPremiseMetastatementNodesQuery(ruleSubproofNode),
|
|
89
|
+
ruleSubproofLastRuleProofStepMetastatementNode = ruleSubproofLastRuleProofStepMetastatementNodeQuery(ruleSubproofNode),
|
|
50
90
|
ruleSubproofMetastatementNodes = [
|
|
51
|
-
...
|
|
52
|
-
|
|
91
|
+
...ruleSubproofPremiseMetastatementNodes,
|
|
92
|
+
ruleSubproofLastRuleProofStepMetastatementNode
|
|
53
93
|
],
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
94
|
+
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
95
|
+
|
|
96
|
+
ruleSubproofNodeMatches = match(subproofAssertionMetastatementNodes, ruleSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
97
|
+
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
98
|
+
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
99
|
+
fileContextA = fileContext, ///
|
|
100
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
101
|
+
localMetaContextB = localMetaContext, ///
|
|
102
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
103
|
+
const verifiedAhead = true;
|
|
104
|
+
|
|
105
|
+
return verifiedAhead;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
if (nonTerminalNodeVerified) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
76
112
|
}
|
|
77
113
|
|
|
78
114
|
return ruleSubproofNodeMatches;
|
|
79
115
|
}
|
|
80
116
|
|
|
81
|
-
|
|
117
|
+
matchMetaSubproofNode(metaSubproofNode, substitutions, fileContext, localMetaContext) {
|
|
118
|
+
let metaSubproofNodeMatches = false;
|
|
119
|
+
|
|
120
|
+
const subproofAssertionNode = subproofAssertionNodeQuery(this.metastatementNode);
|
|
121
|
+
|
|
122
|
+
if (subproofAssertionNode !== null) {
|
|
123
|
+
const metaSubproofMetaSuppositionMetastatementNodes = metaSubproofMetaSuppositionMetastatementNodesQuery(metaSubproofNode),
|
|
124
|
+
metaSubproofLastMetaProofStepMetastatementNode = metaSubproofLastMetaProofStepMetastatementNodeQuery(metaSubproofNode),
|
|
125
|
+
metaSubproofMetastatementNodes = [
|
|
126
|
+
...metaSubproofMetaSuppositionMetastatementNodes,
|
|
127
|
+
metaSubproofLastMetaProofStepMetastatementNode
|
|
128
|
+
],
|
|
129
|
+
subproofAssertionMetastatementNodes = subproofAssertionMetastatementNodesQuery(subproofAssertionNode);
|
|
130
|
+
|
|
131
|
+
metaSubproofNodeMatches = match(subproofAssertionMetastatementNodes, metaSubproofMetastatementNodes, (subproofAssertionMetastatementNode, ruleSubproofMetastatementNode) => {
|
|
132
|
+
const nonTerminalNodeA = subproofAssertionMetastatementNode, ///
|
|
133
|
+
nonTerminalNodeB = ruleSubproofMetastatementNode, ///
|
|
134
|
+
fileContextA = fileContext, ///
|
|
135
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
136
|
+
localMetaContextB = localMetaContext, ///
|
|
137
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
138
|
+
const verifiedAhead = true;
|
|
139
|
+
|
|
140
|
+
return verifiedAhead;
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
if (nonTerminalNodeVerified) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return metaSubproofNodeMatches;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
matchMetastatementNode(metastatementNode, substitutions, fileContext, localMetaContext) {
|
|
82
153
|
const nonTerminalNodeA = this.metastatementNode, ///
|
|
83
154
|
nonTerminalNodeB = metastatementNode, ///
|
|
84
155
|
fileContextA = fileContext, ///
|
|
85
|
-
|
|
86
|
-
localMetaContextB =
|
|
87
|
-
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions,
|
|
156
|
+
localMetaContextA = LocalMetaContext.fromFileContext(fileContextA),
|
|
157
|
+
localMetaContextB = localMetaContext, ///
|
|
158
|
+
nonTerminalNodeVerified = metaLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localMetaContextA, localMetaContextB, () => {
|
|
88
159
|
const verifiedAhead = true;
|
|
89
160
|
|
|
90
161
|
return verifiedAhead;
|