occam-verify-cli 1.0.800 → 1.0.806
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/branching.js +2 -2
- package/lib/context/ephemeral.js +186 -69
- package/lib/context/file/nominal.js +87 -52
- package/lib/context/liminal.js +2 -2
- package/lib/context/proof.js +55 -55
- package/lib/context/synthetic.js +151 -74
- package/lib/context.js +57 -17
- package/lib/element/assertion/defined.js +3 -3
- package/lib/element/assumption/metaLevel.js +6 -4
- package/lib/element/combinator.js +4 -2
- package/lib/element/conclusion.js +4 -2
- package/lib/element/constructor.js +4 -2
- package/lib/element/declaration/metavariable.js +10 -9
- package/lib/element/declaration/variable.js +7 -7
- package/lib/element/deduction.js +4 -2
- package/lib/element/label.js +9 -5
- package/lib/element/metavariable.js +34 -34
- package/lib/element/proofAssertion/premise.js +4 -3
- package/lib/element/proofAssertion/step.js +4 -2
- package/lib/element/reference.js +6 -4
- package/lib/element/statement.js +9 -1
- package/lib/element/substitution/frame.js +43 -29
- package/lib/element/substitution/reference.js +38 -28
- package/lib/element/substitution/statement.js +46 -38
- package/lib/element/substitution/term.js +49 -35
- package/lib/element/variable.js +6 -7
- package/lib/preamble.js +1 -2
- package/lib/process/assign.js +11 -10
- package/lib/process/equate.js +3 -2
- package/lib/process/unify.js +7 -7
- package/lib/utilities/context.js +13 -5
- package/lib/utilities/element.js +1 -1
- package/lib/utilities/equivalences.js +131 -0
- package/lib/utilities/json.js +59 -1
- package/lib/utilities/validation.js +4 -3
- package/package.json +2 -2
- package/src/context/branching.js +2 -2
- package/src/context/ephemeral.js +421 -237
- package/src/context/file/nominal.js +127 -77
- package/src/context/liminal.js +2 -2
- package/src/context/proof.js +81 -82
- package/src/context/synthetic.js +198 -88
- package/src/context.js +81 -20
- package/src/element/assertion/defined.js +4 -4
- package/src/element/assumption/metaLevel.js +8 -6
- package/src/element/combinator.js +4 -2
- package/src/element/conclusion.js +4 -2
- package/src/element/constructor.js +4 -2
- package/src/element/declaration/metavariable.js +10 -8
- package/src/element/declaration/variable.js +8 -7
- package/src/element/deduction.js +4 -2
- package/src/element/label.js +11 -7
- package/src/element/metavariable.js +11 -11
- package/src/element/proofAssertion/premise.js +4 -4
- package/src/element/proofAssertion/step.js +4 -2
- package/src/element/reference.js +7 -5
- package/src/element/statement.js +14 -0
- package/src/element/substitution/frame.js +47 -32
- package/src/element/substitution/reference.js +44 -34
- package/src/element/substitution/statement.js +63 -54
- package/src/element/substitution/term.js +53 -38
- package/src/element/variable.js +6 -7
- package/src/preamble.js +0 -1
- package/src/process/assign.js +17 -14
- package/src/process/equate.js +3 -1
- package/src/process/unify.js +10 -13
- package/src/utilities/context.js +13 -6
- package/src/utilities/element.js +1 -0
- package/src/utilities/equivalences.js +158 -0
- package/src/utilities/json.js +66 -0
- package/src/utilities/validation.js +6 -5
- package/lib/element/equivalences.js +0 -173
- package/src/element/equivalences.js +0 -237
package/src/context.js
CHANGED
|
@@ -80,9 +80,16 @@ export default class Context extends ContextBase {
|
|
|
80
80
|
return assumptions;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
getMetavariables() {
|
|
84
|
+
const context = this.getContext(),
|
|
85
|
+
metavariables = context.getMetavariables();
|
|
86
|
+
|
|
87
|
+
return metavariables;
|
|
88
|
+
}
|
|
89
|
+
|
|
83
90
|
getSubstitutions() {
|
|
84
91
|
const context = this.getContext(),
|
|
85
|
-
|
|
92
|
+
substitutions = context.getSubstitutions();
|
|
86
93
|
|
|
87
94
|
return substitutions;
|
|
88
95
|
}
|
|
@@ -94,13 +101,6 @@ export default class Context extends ContextBase {
|
|
|
94
101
|
return equivalences;
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
getVariables(includeRelease) {
|
|
98
|
-
const context = this.getContext(),
|
|
99
|
-
variables = context.getVariables(includeRelease);
|
|
100
|
-
|
|
101
|
-
return variables;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
104
|
getCombinators(includeRelease) {
|
|
105
105
|
const context = this.getContext(),
|
|
106
106
|
combinators = context.getCombinators(includeRelease);
|
|
@@ -115,11 +115,18 @@ export default class Context extends ContextBase {
|
|
|
115
115
|
return constructors;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
getDeclaredVariables(includeRelease) {
|
|
119
119
|
const context = this.getContext(),
|
|
120
|
-
|
|
120
|
+
declaredVariables = context.getDeclaredVariables(includeRelease);
|
|
121
121
|
|
|
122
|
-
return
|
|
122
|
+
return declaredVariables;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
getDeclaredMetavariables(includeRelease) {
|
|
126
|
+
const context = this.getContext(),
|
|
127
|
+
declaredMetavariables = context.getDeclaredMetavariables(includeRelease);
|
|
128
|
+
|
|
129
|
+
return declaredMetavariables;
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
getSubproofOrProofAssertions() {
|
|
@@ -225,9 +232,9 @@ export default class Context extends ContextBase {
|
|
|
225
232
|
return reference;
|
|
226
233
|
}
|
|
227
234
|
|
|
228
|
-
findAssumptionByAssumptionNode(assumptionNode
|
|
235
|
+
findAssumptionByAssumptionNode(assumptionNode) {
|
|
229
236
|
const context = this.getContext(),
|
|
230
|
-
assumption = context.findAssumptionByAssumptionNode(assumptionNode
|
|
237
|
+
assumption = context.findAssumptionByAssumptionNode(assumptionNode);
|
|
231
238
|
|
|
232
239
|
return assumption;
|
|
233
240
|
}
|
|
@@ -274,9 +281,9 @@ export default class Context extends ContextBase {
|
|
|
274
281
|
return type;
|
|
275
282
|
}
|
|
276
283
|
|
|
277
|
-
|
|
284
|
+
findVariableByVariableNode(variableNode) {
|
|
278
285
|
const context = this.getContext(),
|
|
279
|
-
variable = context.
|
|
286
|
+
variable = context.findVariableByVariableNode(variableNode);
|
|
280
287
|
|
|
281
288
|
return variable;
|
|
282
289
|
}
|
|
@@ -288,11 +295,11 @@ export default class Context extends ContextBase {
|
|
|
288
295
|
return substitution;
|
|
289
296
|
}
|
|
290
297
|
|
|
291
|
-
|
|
298
|
+
findDeclaredMetavariableByMetavariableName(metavariableName) {
|
|
292
299
|
const context = this.getContext(),
|
|
293
|
-
|
|
300
|
+
declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
294
301
|
|
|
295
|
-
return
|
|
302
|
+
return declaredMetavariable;
|
|
296
303
|
}
|
|
297
304
|
|
|
298
305
|
findSubstitutionByVariableIdentifier(variableIdentifier) {
|
|
@@ -426,9 +433,9 @@ export default class Context extends ContextBase {
|
|
|
426
433
|
return judgementPresent;
|
|
427
434
|
}
|
|
428
435
|
|
|
429
|
-
|
|
436
|
+
isDeclaredMetavariablePresentByMetavariableName(metavariableName) {
|
|
430
437
|
const context = this.getContext(),
|
|
431
|
-
metavariablePresent = context.
|
|
438
|
+
metavariablePresent = context.isDeclaredMetavariablePresentByMetavariableName(metavariableName);
|
|
432
439
|
|
|
433
440
|
return metavariablePresent;
|
|
434
441
|
}
|
|
@@ -488,6 +495,60 @@ export default class Context extends ContextBase {
|
|
|
488
495
|
context.addTerms(terms);
|
|
489
496
|
}
|
|
490
497
|
|
|
498
|
+
addFrames(frames) {
|
|
499
|
+
const context = this.getContext();
|
|
500
|
+
|
|
501
|
+
context.addFrames(frames);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
addEqualities(equalities) {
|
|
505
|
+
const context = this.getContext();
|
|
506
|
+
|
|
507
|
+
context.addEqualities(equalities);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
addJudgements(judgements) {
|
|
511
|
+
const context = this.getContext();
|
|
512
|
+
|
|
513
|
+
context.addJudgements(judgements);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
addAssertions(assertions) {
|
|
517
|
+
const context = this.getContext();
|
|
518
|
+
|
|
519
|
+
context.addAssertions(assertions);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
addStatements(statements) {
|
|
523
|
+
const context = this.getContext();
|
|
524
|
+
|
|
525
|
+
context.addStatements(statements);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
addReferences(references) {
|
|
529
|
+
const context = this.getContext();
|
|
530
|
+
|
|
531
|
+
context.addReferences(references);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
addAssumptions(assumptions) {
|
|
535
|
+
const context = this.getContext();
|
|
536
|
+
|
|
537
|
+
context.addAssumptions(assumptions);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
addMetavariables(metavariables) {
|
|
541
|
+
const context = this.getContext();
|
|
542
|
+
|
|
543
|
+
context.addMetavariables(metavariables);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
addSubstitutions(substitutions) {
|
|
547
|
+
const context = this.getContext();
|
|
548
|
+
|
|
549
|
+
context.addSubstitutions(substitutions);
|
|
550
|
+
}
|
|
551
|
+
|
|
491
552
|
addTerm(term) {
|
|
492
553
|
const context = this.getContext();
|
|
493
554
|
|
|
@@ -249,8 +249,8 @@ function validateWhenDerived(term, frame, negated, generalContext, specificConte
|
|
|
249
249
|
const context = specificContext; ///
|
|
250
250
|
|
|
251
251
|
if (term !== null) {
|
|
252
|
-
const
|
|
253
|
-
variable = context.
|
|
252
|
+
const variableNode = term.getVariableNode(),
|
|
253
|
+
variable = context.findVariableByVariableNode(variableNode),
|
|
254
254
|
variableDefined = isVariableDefined(variable, context);
|
|
255
255
|
|
|
256
256
|
if (!negated && variableDefined) {
|
|
@@ -264,8 +264,8 @@ function validateWhenDerived(term, frame, negated, generalContext, specificConte
|
|
|
264
264
|
|
|
265
265
|
if (frame!== null) {
|
|
266
266
|
const metavariableName = frame.getMetavariableName(),
|
|
267
|
-
|
|
268
|
-
metavariableDefined = isMetavariableDefined(
|
|
267
|
+
declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName),
|
|
268
|
+
metavariableDefined = isMetavariableDefined(declaredMetavariable, context);
|
|
269
269
|
|
|
270
270
|
if (!negated && metavariableDefined) {
|
|
271
271
|
validatesWhenDerived = true;
|
|
@@ -6,7 +6,7 @@ import { define } from "../../elements";
|
|
|
6
6
|
import { instantiateMetaLevelAssumption } from "../../process/instantiate";
|
|
7
7
|
import { metaLevelAssumptionFromMetaLevelAssumptionNode } from "../../utilities/element";
|
|
8
8
|
import { metaLevelAssumptionStringFromStatementAndReference } from "../../utilities/string";
|
|
9
|
-
import { attempt, descend, serialise, unserialise, instantiate } from "../../utilities/context";
|
|
9
|
+
import { ablate, attempt, descend, serialise, unserialise, instantiate } from "../../utilities/context";
|
|
10
10
|
|
|
11
11
|
export default define(class MetaLevelAssumption extends Element {
|
|
12
12
|
constructor(context, string, node, reference, statement) {
|
|
@@ -236,12 +236,14 @@ export default define(class MetaLevelAssumption extends Element {
|
|
|
236
236
|
static fromStatementAndReference(statement, reference, context) {
|
|
237
237
|
let metaLevelAssumption;
|
|
238
238
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
ablate((context) => {
|
|
240
|
+
instantiate((context) => {
|
|
241
|
+
const metaLevelAssumptionString = metaLevelAssumptionStringFromStatementAndReference(statement, reference),
|
|
242
|
+
string = metaLevelAssumptionString, ///
|
|
243
|
+
metaLevelAssumptionNode = instantiateMetaLevelAssumption(string, context);
|
|
243
244
|
|
|
244
|
-
|
|
245
|
+
metaLevelAssumption = metaLevelAssumptionFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context);
|
|
246
|
+
}, context);
|
|
245
247
|
}, context);
|
|
246
248
|
|
|
247
249
|
return metaLevelAssumption;
|
|
@@ -38,10 +38,12 @@ export default define(class Combinator extends Element {
|
|
|
38
38
|
const statementValidates = this.validateStatement(context);
|
|
39
39
|
|
|
40
40
|
if (statementValidates) {
|
|
41
|
-
context.commit(this);
|
|
42
|
-
|
|
43
41
|
validates = true;
|
|
44
42
|
}
|
|
43
|
+
|
|
44
|
+
if (validates) {
|
|
45
|
+
context.commit(this);
|
|
46
|
+
}
|
|
45
47
|
}, context)
|
|
46
48
|
|
|
47
49
|
if (validates) {
|
|
@@ -62,10 +62,12 @@ export default define(class Conclusion extends Element {
|
|
|
62
62
|
const statementValidates = this.validateStatement(context);
|
|
63
63
|
|
|
64
64
|
if (statementValidates) {
|
|
65
|
-
context.commit(this);
|
|
66
|
-
|
|
67
65
|
validates = true;
|
|
68
66
|
}
|
|
67
|
+
|
|
68
|
+
if (validates) {
|
|
69
|
+
context.commit(this);
|
|
70
|
+
}
|
|
69
71
|
}, context);
|
|
70
72
|
}, context);
|
|
71
73
|
|
|
@@ -64,10 +64,12 @@ export default define(class Constructor extends Element {
|
|
|
64
64
|
const termValidates = this.validateTerm(context);
|
|
65
65
|
|
|
66
66
|
if (termValidates) {
|
|
67
|
-
context.commit(this);
|
|
68
|
-
|
|
69
67
|
validates = true;
|
|
70
68
|
}
|
|
69
|
+
|
|
70
|
+
if (validates) {
|
|
71
|
+
context.commit(this);
|
|
72
|
+
}
|
|
71
73
|
}, context);
|
|
72
74
|
|
|
73
75
|
if (validates) {
|
|
@@ -37,7 +37,9 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
37
37
|
const metaTypeVerifies = this.verifyMetaType();
|
|
38
38
|
|
|
39
39
|
if (metaTypeVerifies) {
|
|
40
|
-
|
|
40
|
+
const declaredMetavariable = this.metavariable; ///
|
|
41
|
+
|
|
42
|
+
context.addDeclaredMetavariable(declaredMetavariable);
|
|
41
43
|
|
|
42
44
|
verifies = true;
|
|
43
45
|
}
|
|
@@ -57,12 +59,12 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
57
59
|
metaTypeString = this.metaType.getString(),
|
|
58
60
|
metaTypeDeclarationString = this.getString(); ///
|
|
59
61
|
|
|
60
|
-
context.trace(`Verifying the '${metaTypeDeclarationString}'
|
|
62
|
+
context.trace(`Verifying the '${metaTypeDeclarationString}' metavariable declaration's '${metaTypeString}' metaType...`);
|
|
61
63
|
|
|
62
64
|
this.metavariable.setMetaType(this.metaType);
|
|
63
65
|
|
|
64
66
|
if (metaTypeVerifies) {
|
|
65
|
-
context.debug(`...verified the '${metaTypeDeclarationString}'
|
|
67
|
+
context.debug(`...verified the '${metaTypeDeclarationString}' metavariable declaration's '${metaTypeString}' metaType.`);
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
return metaTypeVerifies;
|
|
@@ -75,19 +77,19 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
75
77
|
metavariableString = this.metavariable.getString(),
|
|
76
78
|
metavariableDeclarationString = this.getString(); ///
|
|
77
79
|
|
|
78
|
-
context.trace(`Verifying the '${metavariableDeclarationString}'
|
|
80
|
+
context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration's '${metavariableString}' metavariable...`);
|
|
79
81
|
|
|
80
82
|
const metavariableName = this.metavariable.getName(),
|
|
81
|
-
|
|
83
|
+
declaredMetavariablePresent = context.isDeclaredMetavariablePresentByMetavariableName(metavariableName);
|
|
82
84
|
|
|
83
|
-
if (!
|
|
85
|
+
if (!declaredMetavariablePresent) {
|
|
84
86
|
metavariableVerifies = this.metavariable.verify(context);
|
|
85
87
|
} else {
|
|
86
|
-
context.debug(`The '${metavariableName}' metavariable is already present.`);
|
|
88
|
+
context.debug(`The '${metavariableName}' declared metavariable is already present.`);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
if (metavariableVerifies) {
|
|
90
|
-
context.debug(`...verified the '${metavariableDeclarationString}'
|
|
92
|
+
context.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration's '${metavariableString}' metavariable.`);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
return metavariableVerifies;
|
|
@@ -49,7 +49,9 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
49
49
|
const variableVerifies = this.verifyVariable();
|
|
50
50
|
|
|
51
51
|
if (variableVerifies) {
|
|
52
|
-
|
|
52
|
+
const declaredVariable = this.variable;
|
|
53
|
+
|
|
54
|
+
context.addDeclaredVariable(declaredVariable);
|
|
53
55
|
|
|
54
56
|
verifies = true;
|
|
55
57
|
}
|
|
@@ -65,9 +67,8 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
65
67
|
verifyType() {
|
|
66
68
|
let typeVerifies = false;
|
|
67
69
|
|
|
68
|
-
const context = this.getContext()
|
|
69
|
-
|
|
70
|
-
const typeString = this.type.getString(),
|
|
70
|
+
const context = this.getContext(),
|
|
71
|
+
typeString = this.type.getString(),
|
|
71
72
|
variableDeclarationString = this.getString(); ///
|
|
72
73
|
|
|
73
74
|
context.trace(`Verifying the '${variableDeclarationString}' variable declaration's '${typeString}' type...`);
|
|
@@ -109,10 +110,10 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
109
110
|
context.trace(`Verifying the '${variableDeclarationString}' variable declaration's '${variableString}' variable...`);
|
|
110
111
|
|
|
111
112
|
const variableIdentifier = this.variable.getIdentifier(),
|
|
112
|
-
|
|
113
|
+
declaredVariablePresent = context.isDeclaredVariablePresentByVariableIdentifier(variableIdentifier);
|
|
113
114
|
|
|
114
|
-
if (
|
|
115
|
-
context.debug(`The '${variableString}' variable is already present.`);
|
|
115
|
+
if (declaredVariablePresent) {
|
|
116
|
+
context.debug(`The '${variableString}' declared variable is already present.`);
|
|
116
117
|
} else {
|
|
117
118
|
variableVerifies = true;
|
|
118
119
|
}
|
package/src/element/deduction.js
CHANGED
|
@@ -62,10 +62,12 @@ export default define(class Deduction extends Element {
|
|
|
62
62
|
const statementValidates = this.validateStatement(context);
|
|
63
63
|
|
|
64
64
|
if (statementValidates) {
|
|
65
|
-
context.commit(this);
|
|
66
|
-
|
|
67
65
|
validates = true;
|
|
68
66
|
}
|
|
67
|
+
|
|
68
|
+
if (validates) {
|
|
69
|
+
context.commit(this);
|
|
70
|
+
}
|
|
69
71
|
}, context);
|
|
70
72
|
}, context);
|
|
71
73
|
|
package/src/element/label.js
CHANGED
|
@@ -6,7 +6,7 @@ import { define } from "../elements";
|
|
|
6
6
|
import { instantiateLabel } from "../process/instantiate";
|
|
7
7
|
import { labelFromLabelNode } from "../utilities/element";
|
|
8
8
|
import { metavariableFromLabelNode } from "../utilities/element";
|
|
9
|
-
import { attempt, serialise, unserialise, instantiate } from "../utilities/context";
|
|
9
|
+
import { ablate, attempt, serialise, unserialise, instantiate } from "../utilities/context";
|
|
10
10
|
|
|
11
11
|
export default define(class Label extends Element {
|
|
12
12
|
constructor(context, string, node, metavariable) {
|
|
@@ -90,10 +90,12 @@ export default define(class Label extends Element {
|
|
|
90
90
|
const metavariableValidates = this.validateMetavariable(context);
|
|
91
91
|
|
|
92
92
|
if (metavariableValidates) {
|
|
93
|
-
context.commit(this);
|
|
94
|
-
|
|
95
93
|
validates = true;
|
|
96
94
|
}
|
|
95
|
+
|
|
96
|
+
if (validates) {
|
|
97
|
+
context.commit(this);
|
|
98
|
+
}
|
|
97
99
|
}, context);
|
|
98
100
|
|
|
99
101
|
if (validates) {
|
|
@@ -162,11 +164,13 @@ export default define(class Label extends Element {
|
|
|
162
164
|
static fromLabelString(labelString, context) {
|
|
163
165
|
let label;
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
167
|
+
ablate((context) => {
|
|
168
|
+
instantiate((context) => {
|
|
169
|
+
const string = labelString, ///
|
|
170
|
+
labelNode = instantiateLabel(string, context);
|
|
168
171
|
|
|
169
|
-
|
|
172
|
+
label = labelFromLabelNode(labelNode, context);
|
|
173
|
+
}, context);
|
|
170
174
|
}, context);
|
|
171
175
|
|
|
172
176
|
return label;
|
|
@@ -58,8 +58,8 @@ export default define(class Metavariable extends Element {
|
|
|
58
58
|
|
|
59
59
|
isDeclared(context) {
|
|
60
60
|
const metavariableName = this.getMetavariableName(),
|
|
61
|
-
|
|
62
|
-
declared = (
|
|
61
|
+
declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName),
|
|
62
|
+
declared = (declaredMetavariable !== null);
|
|
63
63
|
|
|
64
64
|
return declared;
|
|
65
65
|
}
|
|
@@ -259,11 +259,11 @@ export default define(class Metavariable extends Element {
|
|
|
259
259
|
context.trace(`Validating the '${metavariableString}' metavariable's '${termString}' term...`);
|
|
260
260
|
|
|
261
261
|
const metavariableName = this.getMetavariableName(),
|
|
262
|
-
|
|
262
|
+
declaredMetavaraible = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
263
263
|
|
|
264
264
|
let term = null;
|
|
265
265
|
|
|
266
|
-
if (
|
|
266
|
+
if (declaredMetavaraible !== null) {
|
|
267
267
|
const type = metavariable.getType();
|
|
268
268
|
|
|
269
269
|
if (type !== null) {
|
|
@@ -301,10 +301,10 @@ export default define(class Metavariable extends Element {
|
|
|
301
301
|
|
|
302
302
|
context.trace(`Validating the '${metavariableString}' metavariable's '${metavariableName}' name...`);
|
|
303
303
|
|
|
304
|
-
const
|
|
304
|
+
const declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
305
305
|
|
|
306
|
-
if (
|
|
307
|
-
const metaType =
|
|
306
|
+
if (declaredMetavariable !== null) {
|
|
307
|
+
const metaType = declaredMetavariable.getMetaType(),
|
|
308
308
|
metaTypeString = metaType.getString();
|
|
309
309
|
|
|
310
310
|
this.metaType = metaType;
|
|
@@ -522,8 +522,8 @@ export default define(class Metavariable extends Element {
|
|
|
522
522
|
|
|
523
523
|
if (frameSingular) {
|
|
524
524
|
const frameMetavariableName = frame.getMetavariableName(),
|
|
525
|
-
|
|
526
|
-
frameMetavariableUnifiesIntrinsically = this.unifyMetavariableIntrinsically(
|
|
525
|
+
frameDeclaredMetavariable = context.findDeclaredMetavariableByMetavariableName(frameMetavariableName),
|
|
526
|
+
frameMetavariableUnifiesIntrinsically = this.unifyMetavariableIntrinsically(frameDeclaredMetavariable, generalContext, specificContext);
|
|
527
527
|
|
|
528
528
|
if (frameMetavariableUnifiesIntrinsically) {
|
|
529
529
|
frameMetavariableUnifies = true;
|
|
@@ -597,8 +597,8 @@ export default define(class Metavariable extends Element {
|
|
|
597
597
|
|
|
598
598
|
if (statementSingular) {
|
|
599
599
|
const statementMetavariableName = statement.getMetavariableName(),
|
|
600
|
-
|
|
601
|
-
statementMetavariableUnifiesIntrinsically = this.unifyMetavariableIntrinsically(
|
|
600
|
+
statementDeclaredMetavariable = context.findDeclaredMetavariableByMetavariableName(statementMetavariableName),
|
|
601
|
+
statementMetavariableUnifiesIntrinsically = this.unifyMetavariableIntrinsically(statementDeclaredMetavariable, generalContext, specificContext);
|
|
602
602
|
|
|
603
603
|
if (statementMetavariableUnifiesIntrinsically) {
|
|
604
604
|
statementMetavariableUnifies = true;
|
|
@@ -66,8 +66,6 @@ export default define(class Premise extends ProofAssertion {
|
|
|
66
66
|
const statementValidates = this.validateStatement(context);
|
|
67
67
|
|
|
68
68
|
if (statementValidates) {
|
|
69
|
-
context.commit(this);
|
|
70
|
-
|
|
71
69
|
validates = true;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -76,11 +74,13 @@ export default define(class Premise extends ProofAssertion {
|
|
|
76
74
|
const procedureCallValidates = this.validateProcedureCall(context);
|
|
77
75
|
|
|
78
76
|
if (procedureCallValidates) {
|
|
79
|
-
context.commit(this);
|
|
80
|
-
|
|
81
77
|
validates = true;
|
|
82
78
|
}
|
|
83
79
|
}
|
|
80
|
+
|
|
81
|
+
if (validates) {
|
|
82
|
+
context.commit(this);
|
|
83
|
+
}
|
|
84
84
|
}, context);
|
|
85
85
|
}, context);
|
|
86
86
|
|
|
@@ -112,12 +112,14 @@ export default define(class Step extends ProofAssertion {
|
|
|
112
112
|
const satisfiesAssertioValidates = this.validateSatisfiesAssertion(context);
|
|
113
113
|
|
|
114
114
|
if (satisfiesAssertioValidates) {
|
|
115
|
-
context.commit(this);
|
|
116
|
-
|
|
117
115
|
validates = true;
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
}
|
|
119
|
+
|
|
120
|
+
if (validates) {
|
|
121
|
+
context.commit(this);
|
|
122
|
+
}
|
|
121
123
|
}, context);
|
|
122
124
|
}, context);
|
|
123
125
|
|
package/src/element/reference.js
CHANGED
|
@@ -6,7 +6,7 @@ import { define } from "../elements";
|
|
|
6
6
|
import { instantiateReference } from "../process/instantiate";
|
|
7
7
|
import { REFERENCE_META_TYPE_NAME } from "../metaTypeNames";
|
|
8
8
|
import { referenceFromReferenceNode } from "../utilities/element";
|
|
9
|
-
import { attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
|
|
9
|
+
import { ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
|
|
10
10
|
import { metavariableFromReferenceNode, topLevelMetaAssertionFromReferenceNode } from "../utilities/element";
|
|
11
11
|
|
|
12
12
|
export default define(class Reference extends Element {
|
|
@@ -354,11 +354,13 @@ export default define(class Reference extends Element {
|
|
|
354
354
|
static fromReferenceString(referenceString, context) {
|
|
355
355
|
let reference;
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
357
|
+
ablate((context) => {
|
|
358
|
+
instantiate((context) => {
|
|
359
|
+
const string = referenceString, ///
|
|
360
|
+
referenceNode = instantiateReference(string, context);
|
|
360
361
|
|
|
361
|
-
|
|
362
|
+
reference = referenceFromReferenceNode(referenceNode, context);
|
|
363
|
+
}, context);
|
|
362
364
|
}, context);
|
|
363
365
|
|
|
364
366
|
return reference;
|
package/src/element/statement.js
CHANGED
|
@@ -26,6 +26,20 @@ export default define(class Statement extends Element {
|
|
|
26
26
|
return metavariableName;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
getTermSubstitutionNode() {
|
|
30
|
+
const statementNode = this.getNode(),
|
|
31
|
+
termSubstitutionNode = statementNode.getTermSubstitutionNode();
|
|
32
|
+
|
|
33
|
+
return termSubstitutionNode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getFrameSubstitutionNode() {
|
|
37
|
+
const statementNode = this.getNode(),
|
|
38
|
+
frameSubstitutionNode = statementNode.getFrameSubstitutionNode();
|
|
39
|
+
|
|
40
|
+
return frameSubstitutionNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
isSingular() {
|
|
30
44
|
const statementNode = this.getStatementNode(),
|
|
31
45
|
singular = statementNode.isSingular();
|