occam-nominal 1.0.310 → 1.0.317
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/liminal.js +17 -15
- package/lib/context/phaneric.js +3 -3
- package/lib/context.js +3 -3
- package/lib/element/assertion/contained.js +19 -17
- package/lib/element/assertion/defined.js +16 -14
- package/lib/element/conclusion.js +10 -11
- package/lib/element/declaration/variable.js +2 -2
- package/lib/element/deduction.js +7 -7
- package/lib/element/equality.js +3 -3
- package/lib/element/frame.js +8 -3
- package/lib/element/goal.js +7 -8
- package/lib/element/judgement.js +8 -10
- package/lib/element/metavariable.js +44 -40
- package/lib/element/proof.js +2 -2
- package/lib/element/proofAssertion/premise.js +17 -21
- package/lib/element/proofAssertion/step.js +5 -5
- package/lib/element/proofAssertion/supposition.js +39 -35
- package/lib/element/rule.js +24 -22
- package/lib/element/statement.js +56 -32
- package/lib/element/substitution/frame.js +71 -62
- package/lib/element/substitution/reference.js +21 -21
- package/lib/element/substitution/statement.js +81 -98
- package/lib/element/substitution/term.js +76 -67
- package/lib/element/substitution.js +5 -5
- package/lib/element/term.js +2 -2
- package/lib/element/topLevelAssertion/axiom.js +4 -5
- package/lib/element/topLevelAssertion/conjecture.js +3 -3
- package/lib/element/topLevelAssertion/lemma.js +3 -3
- package/lib/element/topLevelAssertion/theorem.js +3 -3
- package/lib/element/topLevelAssertion.js +59 -69
- package/lib/node/metavariable.js +18 -1
- package/lib/process/unify.js +5 -7
- package/lib/process/validation.js +5 -2
- package/lib/utilities/element.js +34 -56
- package/package.json +2 -2
- package/src/context/liminal.js +18 -16
- package/src/context/phaneric.js +3 -3
- package/src/context.js +2 -2
- package/src/element/assertion/contained.js +19 -18
- package/src/element/assertion/defined.js +16 -16
- package/src/element/conclusion.js +9 -11
- package/src/element/declaration/variable.js +1 -1
- package/src/element/deduction.js +6 -6
- package/src/element/equality.js +2 -2
- package/src/element/frame.js +10 -2
- package/src/element/goal.js +6 -8
- package/src/element/judgement.js +7 -11
- package/src/element/metavariable.js +56 -52
- package/src/element/proof.js +1 -1
- package/src/element/proofAssertion/premise.js +17 -25
- package/src/element/proofAssertion/step.js +4 -4
- package/src/element/proofAssertion/supposition.js +44 -43
- package/src/element/rule.js +27 -25
- package/src/element/statement.js +71 -41
- package/src/element/substitution/frame.js +88 -82
- package/src/element/substitution/reference.js +30 -32
- package/src/element/substitution/statement.js +97 -132
- package/src/element/substitution/term.js +95 -89
- package/src/element/substitution.js +6 -6
- package/src/element/term.js +1 -1
- package/src/element/topLevelAssertion/axiom.js +3 -5
- package/src/element/topLevelAssertion/conjecture.js +2 -2
- package/src/element/topLevelAssertion/lemma.js +2 -2
- package/src/element/topLevelAssertion/theorem.js +2 -2
- package/src/element/topLevelAssertion.js +61 -80
- package/src/node/metavariable.js +28 -1
- package/src/process/unify.js +7 -16
- package/src/process/validation.js +5 -4
- package/src/utilities/element.js +49 -64
|
@@ -152,15 +152,13 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
152
152
|
|
|
153
153
|
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's target reference...`);
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const targetReference = this.targetReference.validate(context);
|
|
155
|
+
elide((context) => {
|
|
156
|
+
const targetReference = this.targetReference.validate(context);
|
|
158
157
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, specificContext, context);
|
|
158
|
+
if (targetReference !== null) {
|
|
159
|
+
targetReferenceValidates = true;
|
|
160
|
+
}
|
|
161
|
+
}, context);
|
|
164
162
|
|
|
165
163
|
if (targetReferenceValidates) {
|
|
166
164
|
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's target reference...`);
|
|
@@ -221,41 +219,41 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
221
219
|
return referenceSubstitutionn;
|
|
222
220
|
}
|
|
223
221
|
|
|
224
|
-
static
|
|
222
|
+
static fromAssumptionAndConstraint(assumption, constraint, generalContext, specificContext) {
|
|
225
223
|
let referenceSubstitution;
|
|
226
224
|
|
|
227
225
|
ablates((generalContext, specificContext) => {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
226
|
+
instantiate((specificContext) => {
|
|
227
|
+
manifest((generalContext) => {
|
|
228
|
+
const metavariable = assumption.getMetavariable(),
|
|
229
|
+
reference = constraint.getReference(),
|
|
230
|
+
referenceSubstitutionString = referenceSubstitutionStringFromReferenceAndMetavariable(reference, metavariable),
|
|
231
|
+
string = referenceSubstitutionString, ///
|
|
232
|
+
context = specificContext, ///
|
|
233
|
+
referenceSubstitutionNode = instantiateReferenceSubstitution(string, context);
|
|
234
|
+
|
|
235
|
+
referenceSubstitution = referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext, specificContext);
|
|
236
|
+
}, generalContext, specificContext);
|
|
237
|
+
}, specificContext);
|
|
238
238
|
}, generalContext, specificContext);
|
|
239
239
|
|
|
240
240
|
return referenceSubstitution;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
static
|
|
243
|
+
static fromReferenceAndMetavariable(reference, metavariable, generalContext, specificContext) {
|
|
244
244
|
let referenceSubstitution;
|
|
245
245
|
|
|
246
246
|
ablates((generalContext, specificContext) => {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
referenceSubstitution = referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext, specificContext);
|
|
258
|
-
}, context);
|
|
247
|
+
instantiate((specificContext) => {
|
|
248
|
+
manifest((generalContext) => {
|
|
249
|
+
const referenceSubstitutionString = referenceSubstitutionStringFromReferenceAndMetavariable(reference, metavariable),
|
|
250
|
+
string = referenceSubstitutionString, ///
|
|
251
|
+
context = specificContext, ///
|
|
252
|
+
referenceSubstitutionNode = instantiateReferenceSubstitution(string, context);
|
|
253
|
+
|
|
254
|
+
referenceSubstitution = referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext, specificContext);
|
|
255
|
+
}, generalContext, specificContext);
|
|
256
|
+
}, specificContext);
|
|
259
257
|
}, generalContext, specificContext);
|
|
260
258
|
|
|
261
259
|
return referenceSubstitution;
|
|
@@ -15,11 +15,10 @@ import { statementSubstitutionStringFromStatementAndMetavariable, statementSubst
|
|
|
15
15
|
const { breakPointFromJSON } = breakPointUtilities;
|
|
16
16
|
|
|
17
17
|
export default define(class StatementSubstitution extends Substitution {
|
|
18
|
-
constructor(contexts, string, node, breakPoint, resolved,
|
|
18
|
+
constructor(contexts, string, node, breakPoint, resolved, targetStatement, replacementStatement) {
|
|
19
19
|
super(contexts, string, node, breakPoint);
|
|
20
20
|
|
|
21
21
|
this.resolved = resolved;
|
|
22
|
-
this.substitution = substitution;
|
|
23
22
|
this.targetStatement = targetStatement;
|
|
24
23
|
this.replacementStatement = replacementStatement;
|
|
25
24
|
}
|
|
@@ -28,10 +27,6 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
28
27
|
return this.resolved;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
getSubstitution() {
|
|
32
|
-
return this.substitution;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
getTargetStatement() {
|
|
36
31
|
return this.targetStatement;
|
|
37
32
|
}
|
|
@@ -61,13 +56,9 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
61
56
|
return replacementNode;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
|
-
|
|
59
|
+
isSimple() { return this.targetStatement.isSimple(); }
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
const simple = (this.substitution === null);
|
|
68
|
-
|
|
69
|
-
return simple;
|
|
70
|
-
}
|
|
61
|
+
getMetavariableNode() { return this.targetStatement.getMetavariableNode(); }
|
|
71
62
|
|
|
72
63
|
matchMetavariableNode(metavariableNode) { return this.targetStatement.matchMetavariableNode(metavariableNode); }
|
|
73
64
|
|
|
@@ -87,7 +78,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
87
78
|
return comparesToParameter;
|
|
88
79
|
}
|
|
89
80
|
|
|
90
|
-
validate(
|
|
81
|
+
validate(context, continuatino) {
|
|
91
82
|
const statementSubstitutionString = this.getString(); ///
|
|
92
83
|
|
|
93
84
|
context.trace(`Validating the '${statementSubstitutionString}' statement substitution...`);
|
|
@@ -111,12 +102,9 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
111
102
|
const validateTargetStatement = this.validateTargetStatement.bind(this),
|
|
112
103
|
validateReplacementStatement = this.validateReplacementStatement.bind(this);
|
|
113
104
|
|
|
114
|
-
all([
|
|
105
|
+
return all([
|
|
115
106
|
validateTargetStatement,
|
|
116
|
-
validateReplacementStatement
|
|
117
|
-
(generalContext, specificContext, continuatino) => {
|
|
118
|
-
this.validateSubstitution(substitution, generalContext, specificContext, continuatino);
|
|
119
|
-
}
|
|
107
|
+
validateReplacementStatement
|
|
120
108
|
], generalContext, specificContext, (validates) => {
|
|
121
109
|
let statementSubstitution = null;
|
|
122
110
|
|
|
@@ -136,38 +124,11 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
136
124
|
context.debug(`...validated the '${statementSubstitutionString}' statement substitution.`);
|
|
137
125
|
}
|
|
138
126
|
|
|
139
|
-
continuatino(statementSubstitution);
|
|
127
|
+
return continuatino(statementSubstitution);
|
|
140
128
|
});
|
|
141
129
|
}, generalContext, specificContext);
|
|
142
130
|
}
|
|
143
131
|
|
|
144
|
-
validateSubstitution(substitution, generalContext, specificContext, continuatino) {
|
|
145
|
-
if (substitution === null) {
|
|
146
|
-
const substitutionValidates = true;
|
|
147
|
-
|
|
148
|
-
continuatino(substitutionValidates);
|
|
149
|
-
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
let substitutionValidates;
|
|
154
|
-
|
|
155
|
-
const context = generalContext, ///
|
|
156
|
-
statementSubstitutionString = this.getString(); ///
|
|
157
|
-
|
|
158
|
-
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's substitution...`);
|
|
159
|
-
|
|
160
|
-
this.substitution = substitution;
|
|
161
|
-
|
|
162
|
-
substitutionValidates = true;
|
|
163
|
-
|
|
164
|
-
if (substitutionValidates) {
|
|
165
|
-
context.debug(`...validatewd the '${statementSubstitutionString}' statement substitution's substitution.`);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
continuatino(substitutionValidates);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
132
|
validateTargetStatement(generalContext, specificContext, continuatino) {
|
|
172
133
|
const context = generalContext, ///
|
|
173
134
|
statementSubstitutionString = this.getString(); ///
|
|
@@ -187,23 +148,21 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
187
148
|
return;
|
|
188
149
|
}
|
|
189
150
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
let targetStatementValidates = false;
|
|
151
|
+
elide((context) => {
|
|
152
|
+
this.targetStatement.validate(context, (targetStatement) => {
|
|
153
|
+
let targetStatementValidates = false;
|
|
194
154
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
155
|
+
if (targetStatement !== null) {
|
|
156
|
+
targetStatementValidates = true;
|
|
157
|
+
}
|
|
198
158
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
159
|
+
if (targetStatementValidates) {
|
|
160
|
+
context.debug(`...validated the '${statementSubstitutionString}' statement substitution's target statement...`);
|
|
161
|
+
}
|
|
202
162
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}, specificContext, context);
|
|
163
|
+
continuatino(targetStatementValidates);
|
|
164
|
+
});
|
|
165
|
+
}, context);
|
|
207
166
|
}
|
|
208
167
|
|
|
209
168
|
validateReplacementStatement(generalContext, specificContext, continuatino) {
|
|
@@ -265,9 +224,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
265
224
|
return targetStatemnentUnifies;
|
|
266
225
|
}
|
|
267
226
|
|
|
268
|
-
unifyReplacementStatement(substitution, context) {
|
|
269
|
-
let replacementStatemnentUnifies = false;
|
|
270
|
-
|
|
227
|
+
unifyReplacementStatement(substitution, context, continuation) {
|
|
271
228
|
const generalSubstitution = this, ///
|
|
272
229
|
specificSubstitution = substitution,
|
|
273
230
|
generalSubstitutionString = generalSubstitution.getString(),
|
|
@@ -285,77 +242,93 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
285
242
|
specificStatement = specificSubstitutionReplacementStatement; ///
|
|
286
243
|
|
|
287
244
|
reconcile((specificContext) => {
|
|
288
|
-
|
|
245
|
+
return generalStatement.unifyStatement(specificStatement, generalContext, specificContext, (statementUnifies) => {
|
|
246
|
+
let replacementStatemnentUnifies = false;
|
|
289
247
|
|
|
290
|
-
|
|
291
|
-
|
|
248
|
+
if (statementUnifies) {
|
|
249
|
+
specificContext.commit(context);
|
|
292
250
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, specificContext);
|
|
251
|
+
replacementStatemnentUnifies = true;
|
|
252
|
+
}
|
|
296
253
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
254
|
+
if (replacementStatemnentUnifies) {
|
|
255
|
+
context.trace(`...unified the '${specificSubstitutionString}' substitution's replacement statement with the '${generalSubstitutionString}' substitution's replacement statement.`);
|
|
256
|
+
}
|
|
300
257
|
|
|
301
|
-
|
|
258
|
+
return continuation(replacementStatemnentUnifies);
|
|
259
|
+
});
|
|
260
|
+
}, specificContext);
|
|
302
261
|
}
|
|
303
262
|
|
|
304
|
-
unifyComplexSubstitution(complexSubstitution, context) {
|
|
305
|
-
let substitution = null;
|
|
306
|
-
|
|
263
|
+
unifyComplexSubstitution(complexSubstitution, context, continuation) {
|
|
307
264
|
const simpleSubstitution = this, ///
|
|
308
265
|
simpleSubstitutionString = simpleSubstitution.getString(), ///
|
|
309
266
|
complexSubstitutionString = complexSubstitution.getString(); ///
|
|
310
267
|
|
|
311
268
|
context.trace(`Unifying the '${complexSubstitutionString}' complex substitution with the '${simpleSubstitutionString}' simple substitution...`);
|
|
312
269
|
|
|
313
|
-
let simpleSubstitutionUnifies = false;
|
|
314
|
-
|
|
315
270
|
reconcile((context) => {
|
|
316
|
-
|
|
271
|
+
return this.unifyReplacementStatement(complexSubstitution, context, (replacementStatementUnifies) => {
|
|
272
|
+
let substitution = null;
|
|
273
|
+
|
|
274
|
+
if (!replacementStatementUnifies) {
|
|
275
|
+
return continuation(substitution);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
let simpleSubstitutionUnifies = false;
|
|
317
279
|
|
|
318
|
-
if (replacementStatementUnifies) {
|
|
319
280
|
const soleNonTrivialDerivedSubstitution = context.getSoleNonTrivialDerivedSubstitution();
|
|
320
281
|
|
|
321
282
|
substitution = soleNonTrivialDerivedSubstitution; ///
|
|
322
|
-
}
|
|
323
|
-
}, context);
|
|
324
283
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
284
|
+
if (substitution !== null) {
|
|
285
|
+
simpleSubstitutionUnifies = true;
|
|
286
|
+
}
|
|
328
287
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
288
|
+
if (simpleSubstitutionUnifies) {
|
|
289
|
+
context.debug(`...unified the '${complexSubstitutionString}' complex substitution with the '${simpleSubstitutionString}' simple substitution.`);
|
|
290
|
+
}
|
|
332
291
|
|
|
333
|
-
|
|
292
|
+
return continuation(substitution);
|
|
293
|
+
});
|
|
294
|
+
}, context);
|
|
334
295
|
}
|
|
335
296
|
|
|
336
|
-
resolve(context) {
|
|
297
|
+
resolve(context, continuation) {
|
|
337
298
|
const metavariableNode = this.getMetavariableNode(),
|
|
338
299
|
simpleDerivedSubstitution = context.findSimpleDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
339
300
|
|
|
340
|
-
if (simpleDerivedSubstitution
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
complexSubstitutionString = complexSubstitution.getString();
|
|
301
|
+
if (simpleDerivedSubstitution === null) {
|
|
302
|
+
return continuation();
|
|
303
|
+
}
|
|
344
304
|
|
|
345
|
-
|
|
305
|
+
const simpleSubstitution = simpleDerivedSubstitution, ///
|
|
306
|
+
complexSubstitution = this, ///
|
|
307
|
+
complexSubstitutionString = complexSubstitution.getString();
|
|
346
308
|
|
|
347
|
-
|
|
309
|
+
context.trace(`Resolving the ${complexSubstitutionString}' complex substitution...`);
|
|
348
310
|
|
|
349
|
-
|
|
350
|
-
|
|
311
|
+
return simpleSubstitution.unifyComplexSubstitution(complexSubstitution, context, (substitution) => {
|
|
312
|
+
if (substitution === null) {
|
|
313
|
+
return continuation();
|
|
314
|
+
}
|
|
351
315
|
|
|
352
|
-
|
|
316
|
+
const replacementSubstitution = substitution; ///
|
|
317
|
+
|
|
318
|
+
substitution = this.targetStatement.getSubstitution();
|
|
319
|
+
|
|
320
|
+
const targetSubstitution = substitution; ///
|
|
321
|
+
|
|
322
|
+
return targetSubstitution.unifySubstitution(replacementSubstitution, context, (substitutionUnifies) => {
|
|
323
|
+
if (substitutionUnifies) {
|
|
353
324
|
this.resolved = true;
|
|
354
325
|
|
|
355
326
|
context.debug(`...resolved the '${complexSubstitutionString}' complex substitution.`);
|
|
356
327
|
}
|
|
357
|
-
|
|
358
|
-
|
|
328
|
+
|
|
329
|
+
return continuation();
|
|
330
|
+
});
|
|
331
|
+
});
|
|
359
332
|
}
|
|
360
333
|
|
|
361
334
|
static name = "StatementSubstitution";
|
|
@@ -372,8 +345,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
372
345
|
statementSubstitutionNode = instantiateStatementSubstitution(string, context),
|
|
373
346
|
node = statementSubstitutionNode, ///
|
|
374
347
|
breakPoint = breakPointFromJSON(json),
|
|
375
|
-
resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode,
|
|
376
|
-
substitution = substitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext),
|
|
348
|
+
resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext),
|
|
377
349
|
targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, generalContext),
|
|
378
350
|
replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, specificContext),
|
|
379
351
|
contexts = [
|
|
@@ -381,7 +353,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
381
353
|
specificContext
|
|
382
354
|
];
|
|
383
355
|
|
|
384
|
-
statementSubstitutionn = new StatementSubstitution(contexts, string, node, breakPoint, resolved,
|
|
356
|
+
statementSubstitutionn = new StatementSubstitution(contexts, string, node, breakPoint, resolved, targetStatement, replacementStatement);
|
|
385
357
|
}, json, context);
|
|
386
358
|
}, context);
|
|
387
359
|
}
|
|
@@ -397,16 +369,16 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
397
369
|
let statementSubstitution;
|
|
398
370
|
|
|
399
371
|
ablates((generalContext, specificContext) => {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
},
|
|
372
|
+
instantiate((specificContext) => {
|
|
373
|
+
manifest((generalContext) => {
|
|
374
|
+
const statementSubstitutionString = statementSubstitutionStringFromStatementAndMetavariable(statement, metavariable),
|
|
375
|
+
string = statementSubstitutionString, ///
|
|
376
|
+
context = specificContext, ///
|
|
377
|
+
statementSubstitutionNode = instantiateStatementSubstitution(string, context);
|
|
378
|
+
|
|
379
|
+
statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext);
|
|
380
|
+
}, generalContext, specificContext);
|
|
381
|
+
}, specificContext);
|
|
410
382
|
}, generalContext, specificContext);
|
|
411
383
|
|
|
412
384
|
return statementSubstitution;
|
|
@@ -420,35 +392,28 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
420
392
|
let statementSubstitution;
|
|
421
393
|
|
|
422
394
|
ablates((generalContext, specificContext) => {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
},
|
|
395
|
+
instantiate((specificContext) => {
|
|
396
|
+
manifest((generalContext) => {
|
|
397
|
+
const statementSubstitutionString = statementSubstitutionStringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution),
|
|
398
|
+
string = statementSubstitutionString, ///
|
|
399
|
+
context = specificContext, ///
|
|
400
|
+
statementSubstitutionNode = instantiateStatementSubstitution(string, context);
|
|
401
|
+
|
|
402
|
+
statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext);
|
|
403
|
+
}, generalContext, specificContext);
|
|
404
|
+
}, specificContext);
|
|
433
405
|
}, generalContext, specificContext);
|
|
434
406
|
|
|
435
407
|
return statementSubstitution;
|
|
436
408
|
}
|
|
437
409
|
});
|
|
438
410
|
|
|
439
|
-
function resolvedFromStatementSubstitutionNode(statementSubstitutionNode,
|
|
411
|
+
function resolvedFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext) {
|
|
440
412
|
const resolved = true;
|
|
441
413
|
|
|
442
414
|
return resolved;
|
|
443
415
|
}
|
|
444
416
|
|
|
445
|
-
function substitutionFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
446
|
-
const substitutionNode = statementSubstitutionNode.getSubstitutionNode(),
|
|
447
|
-
substitution = context.findSubstitutionBySubstitutionNode(substitutionNode);
|
|
448
|
-
|
|
449
|
-
return substitution;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
417
|
function targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, generalContext) {
|
|
453
418
|
const targetStatementNode = statementSubstitutionNode.getTargetStatementNode(),
|
|
454
419
|
targetStatement = generalContext.findStatementByStatementNode(targetStatementNode);
|