occam-verify-cli 0.0.922 → 0.0.923
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/conclusion.js +11 -41
- package/lib/constants.js +1 -5
- package/lib/context/local.js +15 -55
- package/lib/declaration.js +15 -15
- package/lib/metaLemmaMetatheorem.js +59 -59
- package/lib/mixins/nodesVerifier/metaLevel.js +6 -6
- package/lib/premise.js +14 -91
- package/lib/{step/proof.js → proofStep.js} +1 -1
- package/lib/rule.js +1 -45
- package/lib/ruleNames.js +1 -9
- package/lib/substitution/statementForMetavariable.js +9 -1
- package/lib/substitution.js +1 -8
- package/lib/supposition.js +55 -1
- package/lib/utilities/customGrammar.js +2 -2
- package/lib/utilities/match.js +13 -50
- package/lib/utilities/node.js +2 -27
- package/lib/utilities/tokens.js +1 -8
- package/lib/utilities/verify.js +8 -24
- package/lib/verifier/nodes/intrinsicLevelAgainstMetaLevel.js +29 -29
- package/lib/verifier/nodes/metaLevel.js +13 -13
- package/lib/verify/conclusion.js +10 -11
- package/lib/verify/declaration.js +6 -6
- package/lib/verify/metaLemma.js +12 -12
- package/lib/verify/metastatement.js +64 -64
- package/lib/verify/metatheorem.js +12 -12
- package/lib/verify/premise.js +11 -30
- package/lib/verify/proofStep.js +5 -5
- package/lib/verify/rule.js +9 -9
- package/lib/verify/statement/qualified.js +35 -9
- package/lib/verify/statement/unqualified.js +1 -1
- package/lib/verify/supposition.js +3 -3
- package/package.json +1 -1
- package/src/conclusion.js +13 -52
- package/src/constants.js +0 -1
- package/src/context/local.js +17 -64
- package/src/declaration.js +19 -19
- package/src/metaLemmaMetatheorem.js +58 -58
- package/src/mixins/nodesVerifier/metaLevel.js +8 -8
- package/src/premise.js +20 -137
- package/src/rule.js +0 -67
- package/src/ruleNames.js +0 -2
- package/src/substitution/statementForMetavariable.js +14 -0
- package/src/substitution.js +0 -6
- package/src/supposition.js +46 -0
- package/src/utilities/customGrammar.js +1 -2
- package/src/utilities/match.js +13 -60
- package/src/utilities/node.js +3 -32
- package/src/utilities/tokens.js +0 -8
- package/src/utilities/verify.js +4 -20
- package/src/verifier/nodes/intrinsicLevelAgainstMetaLevel.js +36 -37
- package/src/verifier/nodes/metaLevel.js +17 -17
- package/src/verify/conclusion.js +9 -13
- package/src/verify/declaration.js +7 -7
- package/src/verify/metaLemma.js +22 -22
- package/src/verify/metastatement.js +64 -64
- package/src/verify/metatheorem.js +21 -21
- package/src/verify/premise.js +14 -46
- package/src/verify/proofStep.js +1 -1
- package/src/verify/rule.js +8 -8
- package/src/verify/statement/qualified.js +43 -9
- package/src/verify/statement/unqualified.js +1 -1
- package/src/verify/supposition.js +1 -1
- package/lib/metaConsequent.js +0 -108
- package/lib/metaSupposition.js +0 -160
- package/lib/node/metastatement/bracketed.js +0 -16
- package/lib/step/metaproof.js +0 -106
- package/lib/substitution/metastatementForMetavariable.js +0 -173
- package/lib/verify/metaConsequent.js +0 -50
- package/lib/verify/metaDerivation.js +0 -31
- package/lib/verify/metaSubDerivation.js +0 -25
- package/lib/verify/metaSubproof.js +0 -34
- package/lib/verify/metaSupposition.js +0 -61
- package/lib/verify/metaSuppositions.js +0 -28
- package/lib/verify/metaproof.js +0 -31
- package/lib/verify/metaproofStep.js +0 -98
- package/lib/verify/metastatement/qualified.js +0 -95
- package/lib/verify/metastatement/unqualified.js +0 -37
- package/lib/verify/metastatementAsContainedAssertion.js +0 -109
- package/lib/verify/metastatementAsDefinedAssertion.js +0 -132
- package/lib/verify/metavariableAgainstMetastatement.js +0 -44
- package/src/metaConsequent.js +0 -83
- package/src/metaSupposition.js +0 -127
- package/src/node/metastatement/bracketed.js +0 -9
- package/src/step/metaproof.js +0 -73
- package/src/substitution/metastatementForMetavariable.js +0 -90
- package/src/verify/metaConsequent.js +0 -61
- package/src/verify/metaDerivation.js +0 -23
- package/src/verify/metaSubDerivation.js +0 -22
- package/src/verify/metaSubproof.js +0 -32
- package/src/verify/metaSupposition.js +0 -78
- package/src/verify/metaSuppositions.js +0 -17
- package/src/verify/metaproof.js +0 -28
- package/src/verify/metaproofStep.js +0 -137
- package/src/verify/metastatement/qualified.js +0 -130
- package/src/verify/metastatement/unqualified.js +0 -34
- package/src/verify/metastatementAsContainedAssertion.js +0 -127
- package/src/verify/metastatementAsDefinedAssertion.js +0 -156
- package/src/verify/metavariableAgainstMetastatement.js +0 -42
- /package/src/{step/proof.js → proofStep.js} +0 -0
package/src/constants.js
CHANGED
package/src/context/local.js
CHANGED
|
@@ -8,14 +8,13 @@ import { last, reverse } from "../utilities/array";
|
|
|
8
8
|
import { mergeEquivalences, findEquivalenceByTerm, groundedTermsAndDefinedVariablesFromFromEquivalences } from "../utilities/equivalences";
|
|
9
9
|
|
|
10
10
|
class LocalContext {
|
|
11
|
-
constructor(context, variables, proofSteps,
|
|
11
|
+
constructor(context, variables, proofSteps, judgements, equivalences, metavariables) {
|
|
12
12
|
this.context = context;
|
|
13
13
|
this.variables = variables;
|
|
14
14
|
this.proofSteps = proofSteps;
|
|
15
|
-
this.equivalences = equivalences;
|
|
16
15
|
this.judgements = judgements;
|
|
16
|
+
this.equivalences = equivalences;
|
|
17
17
|
this.metavariables = metavariables;
|
|
18
|
-
this.metaproofSteps = metaproofSteps;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
getContext() {
|
|
@@ -44,6 +43,17 @@ class LocalContext {
|
|
|
44
43
|
return proofSteps;
|
|
45
44
|
}
|
|
46
45
|
|
|
46
|
+
getJudgements() {
|
|
47
|
+
let judgements = this.context.getJudgements();
|
|
48
|
+
|
|
49
|
+
judgements = [ ///
|
|
50
|
+
...this.judgements,
|
|
51
|
+
...judgements
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
return judgements;
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
getEquivalences() {
|
|
48
58
|
let equivalences = this.context.getEquivalences();
|
|
49
59
|
|
|
@@ -56,17 +66,6 @@ class LocalContext {
|
|
|
56
66
|
return equivalences;
|
|
57
67
|
}
|
|
58
68
|
|
|
59
|
-
getJudgements() {
|
|
60
|
-
let judgements = this.context.getJudgements();
|
|
61
|
-
|
|
62
|
-
judgements = [ ///
|
|
63
|
-
...this.judgements,
|
|
64
|
-
...judgements
|
|
65
|
-
]
|
|
66
|
-
|
|
67
|
-
return judgements;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
69
|
getMetavariables() {
|
|
71
70
|
let metavariables = this.context.getMetavariables();
|
|
72
71
|
|
|
@@ -78,17 +77,6 @@ class LocalContext {
|
|
|
78
77
|
return metavariables;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
getMetaproofSteps() {
|
|
82
|
-
let metaproofSteps = this.context.getMetaproofSteps();
|
|
83
|
-
|
|
84
|
-
metaproofSteps = [ ///
|
|
85
|
-
...metaproofSteps,
|
|
86
|
-
...this.metaproofSteps
|
|
87
|
-
];
|
|
88
|
-
|
|
89
|
-
return metaproofSteps;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
80
|
getLastProofStep() {
|
|
93
81
|
let lastProofStep = null;
|
|
94
82
|
|
|
@@ -101,18 +89,6 @@ class LocalContext {
|
|
|
101
89
|
return lastProofStep;
|
|
102
90
|
}
|
|
103
91
|
|
|
104
|
-
getLastMetaproofStep() {
|
|
105
|
-
let lastMetaproofStep = null;
|
|
106
|
-
|
|
107
|
-
const metaproofStepsLength = this.metaproofSteps.length;
|
|
108
|
-
|
|
109
|
-
if (metaproofStepsLength > 0) {
|
|
110
|
-
lastMetaproofStep = last(this.metaproofSteps);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return lastMetaproofStep;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
92
|
addEquality(equality) {
|
|
117
93
|
let equalityAdded;
|
|
118
94
|
|
|
@@ -241,10 +217,6 @@ class LocalContext {
|
|
|
241
217
|
return metavariableAdded;
|
|
242
218
|
}
|
|
243
219
|
|
|
244
|
-
addMetaproofStep(metaproofStep) {
|
|
245
|
-
this.metaproofSteps.push(metaproofStep);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
220
|
matchStatementNode(statementNode) {
|
|
249
221
|
let proofSteps = this.getProofSteps();
|
|
250
222
|
|
|
@@ -261,22 +233,6 @@ class LocalContext {
|
|
|
261
233
|
return matchesStatementNode;
|
|
262
234
|
}
|
|
263
235
|
|
|
264
|
-
matchMetastatementNode(metastatementNode) {
|
|
265
|
-
let metaproofSteps = this.getMetaproofSteps();
|
|
266
|
-
|
|
267
|
-
metaproofSteps = reverse(metaproofSteps); ///
|
|
268
|
-
|
|
269
|
-
const matchesMetastatementNode = metaproofSteps.some((metaproofStep) => {
|
|
270
|
-
const metaproofStepMatchesMetastatementNode = metaproofStep.matchMetastatementNode(metastatementNode);
|
|
271
|
-
|
|
272
|
-
if (metaproofStepMatchesMetastatementNode) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
return matchesMetastatementNode;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
236
|
getTermType(term) {
|
|
281
237
|
let termType;
|
|
282
238
|
|
|
@@ -404,8 +360,7 @@ class LocalContext {
|
|
|
404
360
|
equivalences = [],
|
|
405
361
|
judgements = [],
|
|
406
362
|
metavariables = [],
|
|
407
|
-
|
|
408
|
-
localContext = new LocalContext(context, variables, proofSteps, equivalences, judgements, metavariables, metaproofSteps);
|
|
363
|
+
localContext = new LocalContext(context, variables, proofSteps, judgements, equivalences, metavariables);
|
|
409
364
|
|
|
410
365
|
return localContext;
|
|
411
366
|
}
|
|
@@ -416,10 +371,9 @@ class LocalContext {
|
|
|
416
371
|
proofSteps = [],
|
|
417
372
|
equivalences = [],
|
|
418
373
|
judgements = [],
|
|
419
|
-
metavariables = []
|
|
420
|
-
metaproofSteps = [];
|
|
374
|
+
metavariables = [];
|
|
421
375
|
|
|
422
|
-
localContext = new LocalContext(context, variables, proofSteps,
|
|
376
|
+
localContext = new LocalContext(context, variables, proofSteps, judgements, equivalences, metavariables); ///
|
|
423
377
|
|
|
424
378
|
return localContext;
|
|
425
379
|
}
|
|
@@ -441,8 +395,7 @@ class LocalContext {
|
|
|
441
395
|
equivalences = [],
|
|
442
396
|
judgements = [],
|
|
443
397
|
metavariables = [],
|
|
444
|
-
|
|
445
|
-
localContext = new LocalContext(context, variables, proofSteps, equivalences, judgements, metavariables, metaproofSteps); ///
|
|
398
|
+
localContext = new LocalContext(context, variables, proofSteps, judgements, equivalences, metavariables); ///
|
|
446
399
|
|
|
447
400
|
return localContext;
|
|
448
401
|
}
|
package/src/declaration.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { matchStatementModuloBrackets } from "./utilities/match";
|
|
4
4
|
|
|
5
5
|
export default class Declaration {
|
|
6
|
-
constructor(metavariableNode,
|
|
6
|
+
constructor(metavariableNode, statementNode) {
|
|
7
7
|
this.metavariableNode = metavariableNode;
|
|
8
|
-
this.
|
|
8
|
+
this.statementNode = statementNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
getMetavariableNode() {
|
|
12
12
|
return this.metavariableNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
return this.
|
|
15
|
+
getStatementNode() {
|
|
16
|
+
return this.statementNode;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
matchSubstitution(substitution) {
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const statementNode = substitution.getStatementNode(),
|
|
21
|
+
metavariableNode = substitution.getMetavariableNode(),
|
|
22
|
+
matchesStatementNode = this.matchStatementNode(statementNode),
|
|
22
23
|
matchesMetavariableNode = this.matchMetavariableNode(metavariableNode),
|
|
23
|
-
|
|
24
|
-
matchesSubstitution = (matchesMetavariableNode && matchesMetastatementNode);
|
|
24
|
+
matchesSubstitution = (matchesMetavariableNode && matchesStatementNode);
|
|
25
25
|
|
|
26
26
|
return matchesSubstitution;
|
|
27
27
|
}
|
|
@@ -32,26 +32,26 @@ export default class Declaration {
|
|
|
32
32
|
return matchesMetavariableNode;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
matchStatementNode(statementNode) {
|
|
36
|
+
const statementNodeA = statementNode, ///
|
|
37
|
+
statementNodeB = this.statementNode, ///
|
|
38
|
+
statementMatches = matchStatementModuloBrackets(statementNodeA, statementNodeB),
|
|
39
|
+
matchesStatementNode = statementMatches; ///
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return matchesStatementNode;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
matchMetaLemmaOrMetaTheorem(metaLemmaMetatheorem) {
|
|
45
45
|
const metaConsequent = metaLemmaMetatheorem.getMetaConsequent(),
|
|
46
|
-
|
|
47
|
-
matches = this.
|
|
46
|
+
statementNode = metaConsequent.getStatementNode(),
|
|
47
|
+
matches = this.statementNode.match(statementNode),
|
|
48
48
|
matchesMetaLemmaOrMetaTheorem = matches; ///
|
|
49
49
|
|
|
50
50
|
return matchesMetaLemmaOrMetaTheorem;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
static
|
|
54
|
-
const declaration = new Declaration(metavariableNode,
|
|
53
|
+
static fromMetavariableNodeAndStatementNode(metavariableNode, statementNode) {
|
|
54
|
+
const declaration = new Declaration(metavariableNode, statementNode);
|
|
55
55
|
|
|
56
56
|
return declaration;
|
|
57
57
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Label from "./label";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import Consequent from "./consequent";
|
|
5
|
+
import Supposition from "./supposition";
|
|
6
|
+
import StatementForMetavariableSubstitution from "./substitution/statementForMetavariable";
|
|
7
7
|
|
|
8
8
|
import { reverse, correlate } from "./utilities/array";
|
|
9
9
|
|
|
10
10
|
export default class MetaLemmaMetatheorem {
|
|
11
|
-
constructor(labels,
|
|
11
|
+
constructor(labels, suppositions, consequent, substitutions, fileContext) {
|
|
12
12
|
this.labels = labels;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
13
|
+
this.suppositions = suppositions;
|
|
14
|
+
this.consequent = consequent;
|
|
15
15
|
this.substitutions = substitutions;
|
|
16
16
|
this.fileContext = fileContext;
|
|
17
17
|
}
|
|
@@ -20,12 +20,12 @@ export default class MetaLemmaMetatheorem {
|
|
|
20
20
|
return this.labels;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
return this.
|
|
23
|
+
getSuppositions() {
|
|
24
|
+
return this.suppositions;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
return this.
|
|
27
|
+
getConsequent() {
|
|
28
|
+
return this.consequent;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getSubstitutions() {
|
|
@@ -36,20 +36,20 @@ export default class MetaLemmaMetatheorem {
|
|
|
36
36
|
return this.fileContext;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
let
|
|
39
|
+
matchStatement(statementNode, localContext) {
|
|
40
|
+
let statementNatches = false;
|
|
41
41
|
|
|
42
42
|
const metaproofSteps = localContext.getProofSteps(),
|
|
43
43
|
substitutions = [],
|
|
44
|
-
|
|
44
|
+
suppositionsMatch = matchSuppositions(this.suppositions, metaproofSteps, substitutions, this.fileContext, localContext);
|
|
45
45
|
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
46
|
+
if (suppositionsMatch) {
|
|
47
|
+
const consequentMatches = matchConsequent(this.consequent, statementNode, substitutions, this.fileContext, localContext);
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
statementNatches = consequentMatches; ///
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
return
|
|
52
|
+
return statementNatches;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
matchMetavariableNode(metavariableNode) {
|
|
@@ -70,12 +70,12 @@ export default class MetaLemmaMetatheorem {
|
|
|
70
70
|
|
|
71
71
|
return labelJSON;
|
|
72
72
|
}),
|
|
73
|
-
|
|
74
|
-
const
|
|
73
|
+
suppositionsJSON = this.suppositions.map((supposition) => {
|
|
74
|
+
const suppositionJSON = supposition.toJSON(tokens);
|
|
75
75
|
|
|
76
|
-
return
|
|
76
|
+
return suppositionJSON;
|
|
77
77
|
}),
|
|
78
|
-
|
|
78
|
+
consequentJSON = this.consequent.toJSON(tokens),
|
|
79
79
|
substitutionsJSON = this.substitutions.map((substitution) => {
|
|
80
80
|
const substitutionJSON = substitution.toJSON();
|
|
81
81
|
|
|
@@ -83,14 +83,14 @@ export default class MetaLemmaMetatheorem {
|
|
|
83
83
|
}),
|
|
84
84
|
localContextJSON = this.fileContext.toJSON(tokens),
|
|
85
85
|
labels = labelsJSON, ///
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
suppositions = suppositionsJSON, ///
|
|
87
|
+
consequent = consequentJSON, ///
|
|
88
88
|
substitutions = substitutionsJSON, ///
|
|
89
89
|
fileContext = localContextJSON, ///
|
|
90
90
|
json = {
|
|
91
91
|
labels,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
suppositions,
|
|
93
|
+
consequent,
|
|
94
94
|
substitutions,
|
|
95
95
|
fileContext
|
|
96
96
|
};
|
|
@@ -110,79 +110,79 @@ export default class MetaLemmaMetatheorem {
|
|
|
110
110
|
return label;
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
let {
|
|
113
|
+
let { suppositions, consequent, substitutions } = json;
|
|
114
114
|
|
|
115
|
-
const
|
|
115
|
+
const suppositionsJSON = suppositions; ///
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
const json =
|
|
119
|
-
|
|
117
|
+
suppositions = suppositionsJSON.map((suppositionJSON) => {
|
|
118
|
+
const json = suppositionJSON, ///
|
|
119
|
+
supposition = Supposition.fromJSONAndFileContext(json, fileContext);
|
|
120
120
|
|
|
121
|
-
return
|
|
121
|
+
return supposition;
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
const
|
|
124
|
+
const consequentJSON = consequent; ///
|
|
125
125
|
|
|
126
|
-
json =
|
|
126
|
+
json = consequentJSON; ///
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
consequent = Consequent.fromJSONAndFileContext(json, fileContext);
|
|
129
129
|
|
|
130
130
|
const substitutionsJSON = substitutions; ///
|
|
131
131
|
|
|
132
132
|
substitutions = substitutionsJSON.map((substitutionJSON) => {
|
|
133
133
|
const json = substitutionJSON, ///
|
|
134
|
-
|
|
135
|
-
substitution =
|
|
134
|
+
statementForMetavariableSubstitution = StatementForMetavariableSubstitution.fromJSONAndFileContext(json, fileContext),
|
|
135
|
+
substitution = statementForMetavariableSubstitution; ///
|
|
136
136
|
|
|
137
137
|
return substitution;
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
-
return new Class(labels,
|
|
140
|
+
return new Class(labels, suppositions, consequent, substitutions, fileContext); ///
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
static
|
|
143
|
+
static fromLabelsSuppositionsConsequentSubstitutionsAndFileContext(Class, labels, suppositions, consequent, substitutions, fileContext) { return new Class(labels, suppositions, consequent, substitutions, fileContext); }
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
function
|
|
147
|
-
|
|
146
|
+
function matchSuppositions(suppositions, metaproofSteps, substitutions, fileContext, localContext) {
|
|
147
|
+
suppositions = reverse(suppositions); ///
|
|
148
148
|
|
|
149
149
|
metaproofSteps = reverse(metaproofSteps); ///
|
|
150
150
|
|
|
151
|
-
const
|
|
152
|
-
const
|
|
151
|
+
const suppositionsMatch = correlate(suppositions, metaproofSteps, (supposition, metaproofStep) => {
|
|
152
|
+
const suppositionMatches = matchSupposition(supposition, metaproofStep, substitutions, fileContext, localContext);
|
|
153
153
|
|
|
154
|
-
if (
|
|
154
|
+
if (suppositionMatches) {
|
|
155
155
|
return true;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
return
|
|
159
|
+
return suppositionsMatch;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
function
|
|
163
|
-
let
|
|
162
|
+
function matchSupposition(supposition, metaproofStep, substitutions, fileContext, localContext) {
|
|
163
|
+
let matchesSupposition = false;
|
|
164
164
|
|
|
165
|
-
const metaSubproofNode = metaproofStep.
|
|
166
|
-
|
|
165
|
+
const metaSubproofNode = metaproofStep.getSubproofNode(),
|
|
166
|
+
statementNode = metaproofStep.getStatementNode();
|
|
167
167
|
|
|
168
168
|
if (metaSubproofNode !== null) {
|
|
169
|
-
const
|
|
169
|
+
const suppositionMatchesSubproofNode = supposition.matchSubproofNode(metaSubproofNode, substitutions, fileContext, localContext);
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
matchesSupposition - suppositionMatchesSubproofNode; ///
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
174
|
+
if (statementNode !== null) {
|
|
175
|
+
const suppositionMatchesStatementNode = supposition.matchStatementNode(statementNode, substitutions, fileContext, localContext);
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
matchesSupposition - suppositionMatchesStatementNode; ///
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
return
|
|
180
|
+
return matchesSupposition;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function
|
|
184
|
-
const
|
|
185
|
-
|
|
183
|
+
function matchConsequent(consequent, statementNode, substitutions, fileContext, localContext) {
|
|
184
|
+
const consequentMatchesStatementNode = consequent.matchStatementNode(statementNode, substitutions, fileContext, localContext),
|
|
185
|
+
consequentMatches = consequentMatchesStatementNode; ///
|
|
186
186
|
|
|
187
|
-
return
|
|
187
|
+
return consequentMatches;
|
|
188
188
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import StatementForMetavariableSubstitution from "../../substitution/statementForMetavariable";
|
|
4
4
|
|
|
5
|
-
function verifyMetavariableNode(metavariableNodeA,
|
|
5
|
+
function verifyMetavariableNode(metavariableNodeA, statementNodeB, substitutions, localContextA, localMetaContextB, verifyAhead) {
|
|
6
6
|
let metavariableNodeVerified;
|
|
7
7
|
|
|
8
8
|
const substitution = substitutions.find((substitution) => {
|
|
@@ -14,15 +14,15 @@ function verifyMetavariableNode(metavariableNodeA, metastatementNodeB, substitut
|
|
|
14
14
|
}) || null;
|
|
15
15
|
|
|
16
16
|
if (substitution !== null) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const statementNode = statementNodeB, ///
|
|
18
|
+
substitutionStatementNode = substitution.matchStatementNode(statementNode);
|
|
19
19
|
|
|
20
|
-
metavariableNodeVerified =
|
|
20
|
+
metavariableNodeVerified = substitutionStatementNode; ///
|
|
21
21
|
} else {
|
|
22
22
|
const metavariableNode = metavariableNodeA, ///
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
substitution =
|
|
23
|
+
statementNode = statementNodeB, ///
|
|
24
|
+
statementForMetavariableSubstitution = StatementForMetavariableSubstitution.fromMetavariableNodeAndStatementNode(metavariableNode, statementNode),
|
|
25
|
+
substitution = statementForMetavariableSubstitution; ///
|
|
26
26
|
|
|
27
27
|
substitutions.push(substitution);
|
|
28
28
|
|