occam-verify-cli 1.0.809 → 1.0.814
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/bounded.js +6 -6
- package/lib/context/branching.js +3 -3
- package/lib/context/ephemeral.js +3 -3
- package/lib/context/file/nominal.js +16 -16
- package/lib/context/liminal.js +26 -30
- package/lib/context/synoptic.js +62 -2
- package/lib/context.js +66 -54
- package/lib/element/assertion/defined.js +8 -8
- package/lib/element/assertion/satisfies.js +15 -11
- package/lib/element/assertion.js +5 -5
- package/lib/element/assumption/metaLevel.js +3 -3
- package/lib/element/conclusion.js +11 -8
- package/lib/element/deduction.js +11 -8
- package/lib/element/frame.js +6 -14
- package/lib/element/label.js +5 -8
- package/lib/element/metavariable.js +17 -17
- package/lib/element/procedureCall.js +10 -6
- package/lib/element/proofAssertion/premise.js +27 -27
- package/lib/element/proofAssertion/step.js +25 -5
- package/lib/element/proofAssertion/supposition.js +27 -27
- package/lib/element/proofAssertion.js +10 -10
- package/lib/element/reference.js +9 -13
- package/lib/element/rule.js +41 -43
- package/lib/element/signature.js +4 -4
- package/lib/element/statement.js +35 -45
- package/lib/element/subproof.js +4 -4
- package/lib/element/substitution/frame.js +16 -11
- package/lib/element/substitution/reference.js +15 -10
- package/lib/element/substitution/statement.js +55 -51
- package/lib/element/substitution/term.js +15 -10
- package/lib/element/substitution.js +29 -31
- package/lib/element/term.js +1 -16
- package/lib/element/topLevelAssertion/axiom.js +5 -3
- package/lib/element/topLevelAssertion.js +36 -38
- package/lib/element/variable.js +6 -6
- package/lib/node/frame.js +1 -9
- package/lib/node/statement.js +1 -9
- package/lib/node/term.js +1 -19
- package/lib/process/assign.js +23 -31
- package/lib/utilities/element.js +33 -5
- package/lib/utilities/equivalence.js +4 -4
- package/lib/utilities/equivalences.js +28 -13
- package/lib/utilities/string.js +2 -2
- package/lib/utilities/substitutions.js +16 -15
- package/lib/utilities/unification.js +133 -124
- package/package.json +1 -1
- package/src/context/bounded.js +5 -5
- package/src/context/branching.js +2 -2
- package/src/context/ephemeral.js +2 -2
- package/src/context/file/nominal.js +15 -15
- package/src/context/liminal.js +29 -35
- package/src/context/synoptic.js +81 -1
- package/src/context.js +88 -69
- package/src/element/assertion/defined.js +8 -8
- package/src/element/assertion/satisfies.js +17 -10
- package/src/element/assertion.js +8 -8
- package/src/element/assumption/metaLevel.js +4 -2
- package/src/element/conclusion.js +12 -7
- package/src/element/deduction.js +12 -7
- package/src/element/frame.js +7 -20
- package/src/element/label.js +3 -5
- package/src/element/metavariable.js +27 -27
- package/src/element/procedureCall.js +14 -9
- package/src/element/proofAssertion/premise.js +41 -41
- package/src/element/proofAssertion/step.js +37 -7
- package/src/element/proofAssertion/supposition.js +41 -41
- package/src/element/proofAssertion.js +10 -9
- package/src/element/reference.js +9 -13
- package/src/element/rule.js +57 -61
- package/src/element/signature.js +3 -3
- package/src/element/statement.js +54 -68
- package/src/element/subproof.js +3 -3
- package/src/element/substitution/frame.js +18 -8
- package/src/element/substitution/reference.js +16 -7
- package/src/element/substitution/statement.js +78 -67
- package/src/element/substitution/term.js +15 -6
- package/src/element/substitution.js +38 -41
- package/src/element/term.js +0 -26
- package/src/element/topLevelAssertion/axiom.js +5 -2
- package/src/element/topLevelAssertion.js +49 -53
- package/src/element/variable.js +5 -5
- package/src/node/frame.js +0 -12
- package/src/node/statement.js +0 -12
- package/src/node/term.js +0 -28
- package/src/process/assign.js +35 -46
- package/src/utilities/element.js +32 -4
- package/src/utilities/equivalence.js +3 -4
- package/src/utilities/equivalences.js +29 -17
- package/src/utilities/string.js +2 -2
- package/src/utilities/substitutions.js +17 -15
- package/src/utilities/unification.js +145 -119
|
@@ -429,11 +429,11 @@ export default class NominalFileContext extends FileContext {
|
|
|
429
429
|
|
|
430
430
|
findRuleByReference(reference) {
|
|
431
431
|
const rules = this.getRules(),
|
|
432
|
-
|
|
432
|
+
metavariableNode = reference.getMetavariableNode(),
|
|
433
433
|
rule = rules.find((rule) => {
|
|
434
|
-
const
|
|
434
|
+
const metavariableNodeMatches = rule.matchMetavariableNode(metavariableNode);
|
|
435
435
|
|
|
436
|
-
if (
|
|
436
|
+
if (metavariableNodeMatches) {
|
|
437
437
|
return true;
|
|
438
438
|
}
|
|
439
439
|
}) || null;
|
|
@@ -443,11 +443,11 @@ export default class NominalFileContext extends FileContext {
|
|
|
443
443
|
|
|
444
444
|
findAxiomByReference(reference) {
|
|
445
445
|
const axioms = this.getAxioms(),
|
|
446
|
-
|
|
446
|
+
metavariableNode = reference.getMetavariableNode(),
|
|
447
447
|
axiom = axioms.find((axiom) => {
|
|
448
|
-
const
|
|
448
|
+
const metavariableNodeMatches = axiom.matchMetavariableNode(metavariableNode);
|
|
449
449
|
|
|
450
|
-
if (
|
|
450
|
+
if (metavariableNodeMatches) {
|
|
451
451
|
return true;
|
|
452
452
|
}
|
|
453
453
|
}) || null;
|
|
@@ -457,11 +457,11 @@ export default class NominalFileContext extends FileContext {
|
|
|
457
457
|
|
|
458
458
|
findLemmaByReference(reference) {
|
|
459
459
|
const lemmas = this.getLemmas(),
|
|
460
|
-
|
|
460
|
+
metavariableNode = reference.getMetavariableNode(),
|
|
461
461
|
lemma = lemmas.find((lemma) => {
|
|
462
|
-
const
|
|
462
|
+
const metavariableNodeMatches = lemma.matchMetavariableNode(metavariableNode);
|
|
463
463
|
|
|
464
|
-
if (
|
|
464
|
+
if (metavariableNodeMatches) {
|
|
465
465
|
return true;
|
|
466
466
|
}
|
|
467
467
|
}) || null;
|
|
@@ -471,11 +471,11 @@ export default class NominalFileContext extends FileContext {
|
|
|
471
471
|
|
|
472
472
|
findTheoremByReference(reference) {
|
|
473
473
|
const theorems = this.getTheorems(),
|
|
474
|
-
|
|
474
|
+
metavariableNode = reference.getMetavariableNode(),
|
|
475
475
|
theorem = theorems.find((theorem) => {
|
|
476
|
-
const
|
|
476
|
+
const metavariableNodeMatches = theorem.matchMetavariableNode(metavariableNode);
|
|
477
477
|
|
|
478
|
-
if (
|
|
478
|
+
if (metavariableNodeMatches) {
|
|
479
479
|
return true;
|
|
480
480
|
}
|
|
481
481
|
}) || null;
|
|
@@ -485,11 +485,11 @@ export default class NominalFileContext extends FileContext {
|
|
|
485
485
|
|
|
486
486
|
findConjectureByReference(reference) {
|
|
487
487
|
const conjectures = this.getConjectures(),
|
|
488
|
-
|
|
488
|
+
metavariableNode = reference.getMetavariableNode(),
|
|
489
489
|
conjecture = conjectures.find((conjecture) => {
|
|
490
|
-
const
|
|
490
|
+
const metavariableNodeMatches = conjecture.matchMetavariableNode(metavariableNode);
|
|
491
491
|
|
|
492
|
-
if (
|
|
492
|
+
if (metavariableNodeMatches) {
|
|
493
493
|
return true;
|
|
494
494
|
}
|
|
495
495
|
}) || null;
|
package/src/context/liminal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
|
-
import {
|
|
4
|
+
import { metavariableNodesFromSubstitutions } from "../utilities/substitutions";
|
|
5
5
|
|
|
6
6
|
import Context from "../context";
|
|
7
7
|
import elements from "../elements";
|
|
@@ -96,19 +96,20 @@ export default class LiminalContext extends Context {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
resolveSubstitutions(
|
|
100
|
-
const
|
|
101
|
-
|
|
99
|
+
resolveSubstitutions() {
|
|
100
|
+
const context = this, ///
|
|
101
|
+
substitutions = this.getSubstitutions(),
|
|
102
|
+
metavariableNodes = metavariableNodesFromSubstitutions(substitutions);
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
const complexSubstitutions = this.
|
|
104
|
+
metavariableNodes.forEach((metavariableNode) => {
|
|
105
|
+
const complexSubstitutions = this.findComplexSubstitutionsByMetavariableNode(metavariableNode);
|
|
105
106
|
|
|
106
107
|
complexSubstitutions.forEach((complexSubstitution) => {
|
|
107
108
|
const substitution = complexSubstitution, ///
|
|
108
109
|
resolved = substitution.isResolved();
|
|
109
110
|
|
|
110
111
|
if (!resolved) {
|
|
111
|
-
substitution.resolve(
|
|
112
|
+
substitution.resolve(context);
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
});
|
|
@@ -116,9 +117,9 @@ export default class LiminalContext extends Context {
|
|
|
116
117
|
|
|
117
118
|
areSubstitutionsResolved() {
|
|
118
119
|
const substitutions = this.getSubstitutions(),
|
|
119
|
-
|
|
120
|
-
resolved =
|
|
121
|
-
const complexSubstitutions = this.
|
|
120
|
+
metavariableNodes = metavariableNodesFromSubstitutions(substitutions),
|
|
121
|
+
resolved = metavariableNodes.every((metavariableNode) => {
|
|
122
|
+
const complexSubstitutions = this.findComplexSubstitutionsByMetavariableNode(metavariableNode),
|
|
122
123
|
complexSubstitutionsResolved = complexSubstitutions.every((complexSubstitution) => {
|
|
123
124
|
const complexSubstitutionResolved = complexSubstitution.isResolved();
|
|
124
125
|
|
|
@@ -195,11 +196,11 @@ export default class LiminalContext extends Context {
|
|
|
195
196
|
return substitutions;
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
|
|
199
|
+
findSubstitutionByVariableNode(variableNode) {
|
|
199
200
|
const substitution = this.findSubstitution((substitution) => {
|
|
200
|
-
const
|
|
201
|
+
const substitutionComparesToVariableNode = substitution.compareVariableNode(variableNode);
|
|
201
202
|
|
|
202
|
-
if (
|
|
203
|
+
if (substitutionComparesToVariableNode) {
|
|
203
204
|
return true;
|
|
204
205
|
}
|
|
205
206
|
}) || null;
|
|
@@ -207,22 +208,22 @@ export default class LiminalContext extends Context {
|
|
|
207
208
|
return substitution;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
const simpleSubstitution = this.
|
|
211
|
+
findSubstitutionByMetavariableNode(metavariableNode) {
|
|
212
|
+
const simpleSubstitution = this.findSimpleSubstitutionByMetavariableNode(metavariableNode),
|
|
212
213
|
substitution = simpleSubstitution; ///
|
|
213
214
|
|
|
214
215
|
return substitution;
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
|
|
218
|
+
findSimpleSubstitutionByMetavariableNode(metavariableNode) {
|
|
218
219
|
const simpleSubstitution = this.findSubstitution((substitution) => {
|
|
219
220
|
const substitutionSimple = substitution.isSimple();
|
|
220
221
|
|
|
221
222
|
if (substitutionSimple) {
|
|
222
223
|
const simpleSubstitution = substitution, ///
|
|
223
|
-
|
|
224
|
+
metavariableNodeMatches = simpleSubstitution.matchMetavariableNode(metavariableNode);
|
|
224
225
|
|
|
225
|
-
if (
|
|
226
|
+
if (metavariableNodeMatches) {
|
|
226
227
|
return true;
|
|
227
228
|
}
|
|
228
229
|
}
|
|
@@ -231,15 +232,15 @@ export default class LiminalContext extends Context {
|
|
|
231
232
|
return simpleSubstitution;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
|
-
|
|
235
|
+
findComplexSubstitutionsByMetavariableNode(metavariableNode) {
|
|
235
236
|
const complexSubstitution = this.findSubstitutions((substitution) => {
|
|
236
237
|
const substitutionComplex = substitution.isComplex();
|
|
237
238
|
|
|
238
239
|
if (substitutionComplex) {
|
|
239
240
|
const complexSubstitution = substitution, ///
|
|
240
|
-
|
|
241
|
+
metavariableNodeMatches = complexSubstitution.matchMetavariableNode(metavariableNode);
|
|
241
242
|
|
|
242
|
-
if (
|
|
243
|
+
if (metavariableNodeMatches) {
|
|
243
244
|
return true;
|
|
244
245
|
}
|
|
245
246
|
}
|
|
@@ -248,13 +249,13 @@ export default class LiminalContext extends Context {
|
|
|
248
249
|
return complexSubstitution;
|
|
249
250
|
}
|
|
250
251
|
|
|
251
|
-
|
|
252
|
+
findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
|
|
252
253
|
const substitutionA = substitution; ///
|
|
253
254
|
|
|
254
255
|
substitution = this.findSubstitution((substitution) => { ///
|
|
255
|
-
const
|
|
256
|
+
const metavariableNodeMatches = substitution.matchMetavariableNode(metavariableNode);
|
|
256
257
|
|
|
257
|
-
if (
|
|
258
|
+
if (metavariableNodeMatches) {
|
|
258
259
|
const substitutionB = substitution, ///
|
|
259
260
|
substitutionBEqualToSubstitutionA = substitutionB.isEqualTo(substitutionA);
|
|
260
261
|
|
|
@@ -267,22 +268,15 @@ export default class LiminalContext extends Context {
|
|
|
267
268
|
return substitution;
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
|
|
271
|
-
const substitution = this.
|
|
271
|
+
isSubstitutionPresentByMetavariableNode(metavariableNode) {
|
|
272
|
+
const substitution = this.findSubstitutionByMetavariableNode(metavariableNode),
|
|
272
273
|
substitutionPresent = (substitution !== null);
|
|
273
274
|
|
|
274
275
|
return substitutionPresent;
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
simpleSubstitutionPresent = (simpleSubstitution !== null);
|
|
280
|
-
|
|
281
|
-
return simpleSubstitutionPresent;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
isSubstitutionPresentByMetavariableNameAndSubstitution(metavariableName, substitution) {
|
|
285
|
-
substitution = this.findSubstitutionByMetavariableNameAndSubstitution(metavariableName, substitution); ///
|
|
278
|
+
isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
|
|
279
|
+
substitution = this.findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution); ///
|
|
286
280
|
|
|
287
281
|
const substitutionPresent = (substitution !== null);
|
|
288
282
|
|
package/src/context/synoptic.js
CHANGED
|
@@ -4,7 +4,7 @@ import { arrayUtilities } from "necessary";
|
|
|
4
4
|
|
|
5
5
|
import Context from "../context";
|
|
6
6
|
|
|
7
|
-
const { push, last } = arrayUtilities;
|
|
7
|
+
const { push, last, compress } = arrayUtilities;
|
|
8
8
|
|
|
9
9
|
export default class SynopticContext extends Context {
|
|
10
10
|
constructor(context, contexts) {
|
|
@@ -25,6 +25,14 @@ export default class SynopticContext extends Context {
|
|
|
25
25
|
|
|
26
26
|
push(terms, contextTerms);
|
|
27
27
|
});
|
|
28
|
+
|
|
29
|
+
compress(terms, (termA, termB) => {
|
|
30
|
+
const termAComparesToTermB = termA.compareTerm(termB);
|
|
31
|
+
|
|
32
|
+
if (!termAComparesToTermB) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
28
36
|
|
|
29
37
|
return terms;
|
|
30
38
|
}
|
|
@@ -38,6 +46,14 @@ export default class SynopticContext extends Context {
|
|
|
38
46
|
push(frames, contextFrames);
|
|
39
47
|
});
|
|
40
48
|
|
|
49
|
+
compress(frames, (frameA, frameB) => {
|
|
50
|
+
const frameAEqualToFrameB = frameA.isEqualTo(frameB);
|
|
51
|
+
|
|
52
|
+
if (!frameAEqualToFrameB) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
41
57
|
return frames;
|
|
42
58
|
}
|
|
43
59
|
|
|
@@ -50,6 +66,14 @@ export default class SynopticContext extends Context {
|
|
|
50
66
|
push(equalities, contextEqualities);
|
|
51
67
|
});
|
|
52
68
|
|
|
69
|
+
compress(equalities, (equalityA, equalityB) => {
|
|
70
|
+
const equalityAEqualToEqualityB = equalityA.isEqualTo(equalityB);
|
|
71
|
+
|
|
72
|
+
if (!equalityAEqualToEqualityB) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
53
77
|
return equalities;
|
|
54
78
|
}
|
|
55
79
|
|
|
@@ -62,6 +86,14 @@ export default class SynopticContext extends Context {
|
|
|
62
86
|
push(judgements, contextJudgements);
|
|
63
87
|
});
|
|
64
88
|
|
|
89
|
+
compress(judgements, (judgementA, judgementB) => {
|
|
90
|
+
const judgementAEqualToJudgementB = judgementA.isEqualTo(judgementB);
|
|
91
|
+
|
|
92
|
+
if (!judgementAEqualToJudgementB) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
65
97
|
return judgements;
|
|
66
98
|
}
|
|
67
99
|
|
|
@@ -74,6 +106,14 @@ export default class SynopticContext extends Context {
|
|
|
74
106
|
push(statements, contextStatements);
|
|
75
107
|
});
|
|
76
108
|
|
|
109
|
+
compress(statements, (statementA, statementB) => {
|
|
110
|
+
const statementAEqualToStatementB = statementA.isEqualTo(statementB);
|
|
111
|
+
|
|
112
|
+
if (!statementAEqualToStatementB) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
77
117
|
return statements;
|
|
78
118
|
}
|
|
79
119
|
|
|
@@ -86,6 +126,14 @@ export default class SynopticContext extends Context {
|
|
|
86
126
|
push(assertions, contextAssertions);
|
|
87
127
|
});
|
|
88
128
|
|
|
129
|
+
compress(assertions, (assertionA, assertionB) => {
|
|
130
|
+
const assertionAEqualToAssertionB = assertionA.isEqualTo(assertionB);
|
|
131
|
+
|
|
132
|
+
if (!assertionAEqualToAssertionB) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
89
137
|
return assertions;
|
|
90
138
|
}
|
|
91
139
|
|
|
@@ -98,6 +146,14 @@ export default class SynopticContext extends Context {
|
|
|
98
146
|
push(references, contextReferences);
|
|
99
147
|
});
|
|
100
148
|
|
|
149
|
+
compress(references, (referenceA, referenceB) => {
|
|
150
|
+
const referenceAEqualToReferenceB = referenceA.isEqualTo(referenceB);
|
|
151
|
+
|
|
152
|
+
if (!referenceAEqualToReferenceB) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
101
157
|
return references;
|
|
102
158
|
}
|
|
103
159
|
|
|
@@ -110,6 +166,14 @@ export default class SynopticContext extends Context {
|
|
|
110
166
|
push(assumptions, contextAssumptions);
|
|
111
167
|
});
|
|
112
168
|
|
|
169
|
+
compress(assumptions, (assumptionA, assumptionB) => {
|
|
170
|
+
const assumptionAEqualToAssumptionB = assumptionA.isEqualTo(assumptionB);
|
|
171
|
+
|
|
172
|
+
if (!assumptionAEqualToAssumptionB) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
113
177
|
return assumptions;
|
|
114
178
|
}
|
|
115
179
|
|
|
@@ -122,6 +186,14 @@ export default class SynopticContext extends Context {
|
|
|
122
186
|
push(metavariables, contextMetavariables);
|
|
123
187
|
});
|
|
124
188
|
|
|
189
|
+
compress(metavariables, (metavariableA, metavariableB) => {
|
|
190
|
+
const metavariableAEqualToMetavariableB = metavariableA.isEqualTo(metavariableB);
|
|
191
|
+
|
|
192
|
+
if (!metavariableAEqualToMetavariableB) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
125
197
|
return metavariables;
|
|
126
198
|
}
|
|
127
199
|
|
|
@@ -134,6 +206,14 @@ export default class SynopticContext extends Context {
|
|
|
134
206
|
push(substitutions, contextSubstitutions);
|
|
135
207
|
});
|
|
136
208
|
|
|
209
|
+
compress(substitutions, (substitutionA, substitutionB) => {
|
|
210
|
+
const substitutionAEqualToSubstitutionB = substitutionA.isEqualTo(substitutionB);
|
|
211
|
+
|
|
212
|
+
if (!substitutionAEqualToSubstitutionB) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
137
217
|
return substitutions;
|
|
138
218
|
}
|
|
139
219
|
|
package/src/context.js
CHANGED
|
@@ -169,20 +169,6 @@ export default class Context extends ContextBase {
|
|
|
169
169
|
return topLevelMetaAssertion;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
findTypeByTypeName(metaTypeName) {
|
|
173
|
-
const context = this.getContext(),
|
|
174
|
-
type = context.findTypeByTypeName(metaTypeName);
|
|
175
|
-
|
|
176
|
-
return type;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
findMetaTypeByMetaTypeName(metaTypeName) {
|
|
180
|
-
const context = this.getContext(),
|
|
181
|
-
metaType = context.findMetaTypeByMetaTypeName(metaTypeName);
|
|
182
|
-
|
|
183
|
-
return metaType;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
172
|
findTermByTermNode(termNode) {
|
|
187
173
|
const context = this.getContext(),
|
|
188
174
|
term = context.findTermByTermNode(termNode);
|
|
@@ -197,6 +183,13 @@ export default class Context extends ContextBase {
|
|
|
197
183
|
return frame;
|
|
198
184
|
}
|
|
199
185
|
|
|
186
|
+
findVariableByVariableNode(variableNode) {
|
|
187
|
+
const context = this.getContext(),
|
|
188
|
+
variable = context.findVariableByVariableNode(variableNode);
|
|
189
|
+
|
|
190
|
+
return variable;
|
|
191
|
+
}
|
|
192
|
+
|
|
200
193
|
findEqualityByEqualityNode(equalityNode) {
|
|
201
194
|
const context = this.getContext(),
|
|
202
195
|
equality = context.findEqualityByEqualityNode(equalityNode);
|
|
@@ -274,61 +267,61 @@ export default class Context extends ContextBase {
|
|
|
274
267
|
return metaLevelAssumption;
|
|
275
268
|
}
|
|
276
269
|
|
|
277
|
-
|
|
270
|
+
findSubstitutionByVariableNode(variableNode) {
|
|
278
271
|
const context = this.getContext(),
|
|
279
|
-
|
|
272
|
+
substitution = context.findSubstitutionByVariableNode(variableNode);
|
|
280
273
|
|
|
281
|
-
return
|
|
274
|
+
return substitution;
|
|
282
275
|
}
|
|
283
276
|
|
|
284
|
-
|
|
277
|
+
findSubstitutionByMetavariableNode(metavariableNode) {
|
|
285
278
|
const context = this.getContext(),
|
|
286
|
-
|
|
279
|
+
substitution = context.findSubstitutionByMetavariableNode(metavariableNode);
|
|
287
280
|
|
|
288
|
-
return
|
|
281
|
+
return substitution;
|
|
289
282
|
}
|
|
290
283
|
|
|
291
|
-
|
|
284
|
+
findSimpleSubstitutionByMetavariableNode(metavariableNode) {
|
|
292
285
|
const context = this.getContext(),
|
|
293
|
-
|
|
286
|
+
simpleSubstitution = context.findSimpleSubstitutionByMetavariableNode(metavariableNode);
|
|
294
287
|
|
|
295
|
-
return
|
|
288
|
+
return simpleSubstitution;
|
|
296
289
|
}
|
|
297
290
|
|
|
298
|
-
|
|
291
|
+
findComplexSubstitutionsByMetavariableNode(metavariableNode) {
|
|
299
292
|
const context = this.getContext(),
|
|
300
|
-
|
|
293
|
+
complexSubstitution = context.findComplexSubstitutionsByMetavariableNode(metavariableNode);
|
|
301
294
|
|
|
302
|
-
return
|
|
295
|
+
return complexSubstitution;
|
|
303
296
|
}
|
|
304
297
|
|
|
305
|
-
|
|
306
|
-
const context = this.getContext()
|
|
307
|
-
|
|
298
|
+
findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
|
|
299
|
+
const context = this.getContext();
|
|
300
|
+
|
|
301
|
+
substitution = context.findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution); ///
|
|
308
302
|
|
|
309
303
|
return substitution;
|
|
310
304
|
}
|
|
311
305
|
|
|
312
|
-
|
|
306
|
+
findTypeByTypeName(metaTypeName) {
|
|
313
307
|
const context = this.getContext(),
|
|
314
|
-
|
|
308
|
+
type = context.findTypeByTypeName(metaTypeName);
|
|
315
309
|
|
|
316
|
-
return
|
|
310
|
+
return type;
|
|
317
311
|
}
|
|
318
312
|
|
|
319
|
-
|
|
313
|
+
findTypeByNominalTypeName(nominalTypeName) {
|
|
320
314
|
const context = this.getContext(),
|
|
321
|
-
|
|
315
|
+
type = context.findTypeByNominalTypeName(nominalTypeName);
|
|
322
316
|
|
|
323
|
-
return
|
|
317
|
+
return type;
|
|
324
318
|
}
|
|
325
319
|
|
|
326
|
-
|
|
327
|
-
const context = this.getContext()
|
|
328
|
-
|
|
329
|
-
substitution = context.findSubstitutionByMetavariableNameAndSubstitution(metavariableName, substitution); ///
|
|
320
|
+
findMetaTypeByMetaTypeName(metaTypeName) {
|
|
321
|
+
const context = this.getContext(),
|
|
322
|
+
metaType = context.findMetaTypeByMetaTypeName(metaTypeName);
|
|
330
323
|
|
|
331
|
-
return
|
|
324
|
+
return metaType;
|
|
332
325
|
}
|
|
333
326
|
|
|
334
327
|
findProcedureByProcedureName(procedureName) {
|
|
@@ -338,6 +331,20 @@ export default class Context extends ContextBase {
|
|
|
338
331
|
return procedure;
|
|
339
332
|
}
|
|
340
333
|
|
|
334
|
+
findDeclaredVariableByVariableIdentifier(variableIdentifier) {
|
|
335
|
+
const context = this.getContext(),
|
|
336
|
+
declaredVariable = context.findDeclaredVariableByVariableIdentifier(variableIdentifier);
|
|
337
|
+
|
|
338
|
+
return declaredVariable;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
findDeclaredMetavariableByMetavariableName(metavariableName) {
|
|
342
|
+
const context = this.getContext(),
|
|
343
|
+
declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
344
|
+
|
|
345
|
+
return declaredMetavariable;
|
|
346
|
+
}
|
|
347
|
+
|
|
341
348
|
isMetavariablePresent(metavariable, context) {
|
|
342
349
|
const childContext = context; ///
|
|
343
350
|
|
|
@@ -384,13 +391,6 @@ export default class Context extends ContextBase {
|
|
|
384
391
|
return framePresent;
|
|
385
392
|
}
|
|
386
393
|
|
|
387
|
-
isTypePresentByNominalTypeName(nominalTypeName) {
|
|
388
|
-
const context = this.getContext(),
|
|
389
|
-
typePresent = context.isTypePresentByNominalTypeName(nominalTypeName);
|
|
390
|
-
|
|
391
|
-
return typePresent;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
394
|
isEqualityPresentByEqualityNode(equalityNode) {
|
|
395
395
|
const context = this.getContext(),
|
|
396
396
|
equalityPresent = context.isEqualityPresentByEqualityNode(equalityNode);
|
|
@@ -419,60 +419,67 @@ export default class Context extends ContextBase {
|
|
|
419
419
|
return assertionPresent;
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
|
|
422
|
+
isMetavariablePresentByMetavariableNode(metavariableNode) {
|
|
423
423
|
const context = this.getContext(),
|
|
424
|
-
|
|
424
|
+
metavariablePresent = context.isMetavariablePresentByMetavariableNode(metavariableNode);
|
|
425
425
|
|
|
426
|
-
return
|
|
426
|
+
return metavariablePresent;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
isSubstitutionPresentBySubstitutionNode(substitutionNode) {
|
|
430
430
|
const context = this.getContext(),
|
|
431
|
-
|
|
431
|
+
substitutionPresent = context.isSubstitutionPresentBySubstitutionNode(substitutionNode);
|
|
432
432
|
|
|
433
|
-
return
|
|
433
|
+
return substitutionPresent;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
|
|
436
|
+
isTypePresentByNominalTypeName(nominalTypeName) {
|
|
437
437
|
const context = this.getContext(),
|
|
438
|
-
|
|
438
|
+
typePresent = context.isTypePresentByNominalTypeName(nominalTypeName);
|
|
439
439
|
|
|
440
|
-
return
|
|
440
|
+
return typePresent;
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
|
|
443
|
+
isProcedurePresentByProcedureName(procedureName) {
|
|
444
444
|
const context = this.getContext(),
|
|
445
|
-
|
|
445
|
+
procedurePresent = context.isProcedurePresentByProcedureName(procedureName);
|
|
446
|
+
|
|
447
|
+
return procedurePresent;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
isDeclaredMetavariablePresentByMetavariableName(metavariableName) {
|
|
451
|
+
const context = this.getContext(),
|
|
452
|
+
metavariablePresent = context.isDeclaredMetavariablePresentByMetavariableName(metavariableName);
|
|
446
453
|
|
|
447
454
|
return metavariablePresent;
|
|
448
455
|
}
|
|
449
456
|
|
|
450
|
-
|
|
457
|
+
isReferencePresentByMetavariableNode(metvvariableNode) {
|
|
451
458
|
const context = this.getContext(),
|
|
452
|
-
|
|
459
|
+
referencePresent = context.isReferencePresentByMetavariableNode(metvvariableNode);
|
|
453
460
|
|
|
454
|
-
return
|
|
461
|
+
return referencePresent;
|
|
455
462
|
}
|
|
456
463
|
|
|
457
|
-
|
|
464
|
+
isJudgementPresentByMetavariableNode(metavariableNode) {
|
|
458
465
|
const context = this.getContext(),
|
|
459
|
-
|
|
466
|
+
judgementPresent = context.isJudgementPresentByMetavariableNode(metavariableNode);
|
|
460
467
|
|
|
461
|
-
return
|
|
468
|
+
return judgementPresent;
|
|
462
469
|
}
|
|
463
470
|
|
|
464
|
-
|
|
471
|
+
isSubstitutionPresentByMetavariableNode(metavariableNode) {
|
|
465
472
|
const context = this.getContext(),
|
|
466
|
-
substitutionPresent = context.
|
|
473
|
+
substitutionPresent = context.isSubstitutionPresentByMetavariableNode(metavariableNode);
|
|
467
474
|
|
|
468
475
|
return substitutionPresent;
|
|
469
476
|
}
|
|
470
477
|
|
|
471
|
-
|
|
478
|
+
isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
|
|
472
479
|
const context = this.getContext(),
|
|
473
|
-
|
|
480
|
+
substitutionPresent = context.isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution);
|
|
474
481
|
|
|
475
|
-
return
|
|
482
|
+
return substitutionPresent;
|
|
476
483
|
}
|
|
477
484
|
|
|
478
485
|
isMetaLevel() {
|
|
@@ -615,12 +622,24 @@ export default class Context extends ContextBase {
|
|
|
615
622
|
context.addSubstitution(substitution);
|
|
616
623
|
}
|
|
617
624
|
|
|
625
|
+
addDeclaredVariable(declaredVariable) {
|
|
626
|
+
const context = this.getContext();
|
|
627
|
+
|
|
628
|
+
context.addDeclaredVariable(declaredVariable);
|
|
629
|
+
}
|
|
630
|
+
|
|
618
631
|
addMetaLevelAssumption(metaLevelAssumption) {
|
|
619
632
|
const context = this.getContext();
|
|
620
633
|
|
|
621
634
|
context.addMetaLevelAssumption(metaLevelAssumption);
|
|
622
635
|
}
|
|
623
636
|
|
|
637
|
+
addDeclaredMetavariable(declaredMetavariable) {
|
|
638
|
+
const context = this.getContext();
|
|
639
|
+
|
|
640
|
+
context.addDeclaredMetavariable(declaredMetavariable);
|
|
641
|
+
}
|
|
642
|
+
|
|
624
643
|
addSubproofOrProofAssertion(subproofOrProofAssertion) {
|
|
625
644
|
const context = this.getContext();
|
|
626
645
|
|