occam-verify-cli 1.0.955 → 1.0.972

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.
Files changed (89) hide show
  1. package/lib/context/bounded.js +11 -7
  2. package/lib/context.js +17 -5
  3. package/lib/element/assertion/signature.js +17 -19
  4. package/lib/element/assertion/subproof.js +36 -39
  5. package/lib/element/assertion/type.js +20 -1
  6. package/lib/element/assumption/metaLevel.js +18 -17
  7. package/lib/element/assumption.js +52 -3
  8. package/lib/element/combinator.js +10 -12
  9. package/lib/element/conclusion.js +33 -33
  10. package/lib/element/constructor.js +8 -12
  11. package/lib/element/deduction.js +33 -33
  12. package/lib/element/equivalence.js +11 -7
  13. package/lib/element/hypothesis.js +45 -19
  14. package/lib/element/judgement.js +1 -1
  15. package/lib/element/label.js +9 -11
  16. package/lib/element/parameter.js +2 -2
  17. package/lib/element/procedureCall.js +1 -1
  18. package/lib/element/proofAssertion/premise.js +98 -87
  19. package/lib/element/proofAssertion/step.js +27 -27
  20. package/lib/element/proofAssertion/supposition.js +99 -88
  21. package/lib/element/proofAssertion.js +3 -3
  22. package/lib/element/property.js +1 -2
  23. package/lib/element/reference.js +30 -38
  24. package/lib/element/section.js +1 -1
  25. package/lib/element/signature.js +38 -47
  26. package/lib/element/statement.js +18 -58
  27. package/lib/element/substitution/frame.js +33 -38
  28. package/lib/element/substitution/reference.js +12 -13
  29. package/lib/element/substitution/statement.js +26 -31
  30. package/lib/element/substitution/term.js +32 -37
  31. package/lib/element/term.js +2 -2
  32. package/lib/element/topLevelAssertion/axiom.js +33 -34
  33. package/lib/element/topLevelAssertion.js +30 -7
  34. package/lib/element/topLevelMetaAssertion.js +2 -2
  35. package/lib/process/discharge.js +38 -0
  36. package/lib/process/unification.js +228 -0
  37. package/lib/process/unify.js +9 -5
  38. package/lib/process/validation.js +291 -0
  39. package/lib/utilities/context.js +69 -101
  40. package/lib/utilities/element.js +2 -4
  41. package/lib/utilities/string.js +4 -4
  42. package/package.json +4 -4
  43. package/src/context/bounded.js +19 -7
  44. package/src/context.js +26 -6
  45. package/src/element/assertion/signature.js +21 -26
  46. package/src/element/assertion/subproof.js +43 -46
  47. package/src/element/assertion/type.js +30 -1
  48. package/src/element/assumption/metaLevel.js +26 -22
  49. package/src/element/assumption.js +80 -2
  50. package/src/element/combinator.js +11 -14
  51. package/src/element/conclusion.js +38 -37
  52. package/src/element/constructor.js +9 -14
  53. package/src/element/deduction.js +38 -37
  54. package/src/element/equivalence.js +17 -13
  55. package/src/element/hypothesis.js +59 -19
  56. package/src/element/judgement.js +1 -1
  57. package/src/element/label.js +10 -12
  58. package/src/element/parameter.js +1 -1
  59. package/src/element/procedureCall.js +1 -1
  60. package/src/element/proofAssertion/premise.js +123 -107
  61. package/src/element/proofAssertion/step.js +29 -29
  62. package/src/element/proofAssertion/supposition.js +124 -108
  63. package/src/element/proofAssertion.js +2 -2
  64. package/src/element/property.js +0 -1
  65. package/src/element/reference.js +36 -47
  66. package/src/element/section.js +1 -1
  67. package/src/element/signature.js +42 -53
  68. package/src/element/statement.js +18 -89
  69. package/src/element/substitution/frame.js +37 -47
  70. package/src/element/substitution/reference.js +13 -16
  71. package/src/element/substitution/statement.js +27 -34
  72. package/src/element/substitution/term.js +37 -46
  73. package/src/element/term.js +1 -1
  74. package/src/element/topLevelAssertion/axiom.js +43 -45
  75. package/src/element/topLevelAssertion.js +42 -6
  76. package/src/element/topLevelMetaAssertion.js +2 -2
  77. package/src/process/discharge.js +33 -0
  78. package/src/{utilities → process}/unification.js +21 -27
  79. package/src/process/unify.js +9 -5
  80. package/src/{utilities → process}/validation.js +2 -2
  81. package/src/utilities/context.js +78 -123
  82. package/src/utilities/element.js +2 -5
  83. package/src/utilities/string.js +6 -6
  84. package/lib/context/ephemeral.js +0 -28
  85. package/lib/context/synoptic.js +0 -255
  86. package/lib/utilities/unification.js +0 -233
  87. package/lib/utilities/validation.js +0 -291
  88. package/src/context/ephemeral.js +0 -17
  89. package/src/context/synoptic.js +0 -361
@@ -4,9 +4,10 @@ import { Element } from "occam-languages";
4
4
  import { arrayUtilities } from "necessary";
5
5
 
6
6
  import { define } from "../elements";
7
+ import { instantiateSignature } from "../process/instantiate";
7
8
  import { signatureFromSignatureNode } from "../utilities/element";
8
9
  import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
- import { join, posit, ablate, attempt, reconcile, serialise, unserialise, instantiate } from "../utilities/context";
10
+ import { ablate, attempt, reconcile, serialise, unserialise, instantiate } from "../utilities/context";
10
11
 
11
12
  const { match } = arrayUtilities;
12
13
 
@@ -72,16 +73,18 @@ export default define(class Signature extends Element {
72
73
 
73
74
  context.trace(`Verifying the '${signatureString}' signature...`);
74
75
 
75
- attempt((context) => {
76
- const termsValidate = this.validateTerms(context);
76
+ ablate((context) => {
77
+ attempt((context) => {
78
+ const termsValidate = this.validateTerms(context);
77
79
 
78
- if (termsValidate !== null) {
79
- verifies = true;
80
- }
80
+ if (termsValidate !== null) {
81
+ verifies = true;
82
+ }
81
83
 
82
- if (verifies) {
83
- this.commit(context);
84
- }
84
+ if (verifies) {
85
+ this.commit(context);
86
+ }
87
+ }, context);
85
88
  }, context);
86
89
 
87
90
  if (verifies) {
@@ -109,7 +112,7 @@ export default define(class Signature extends Element {
109
112
 
110
113
  context.debug(`...the '${signatureString}' signature is already valid.`);
111
114
  } else {
112
- const specificContext = context; ///
115
+ const temporaryContext = context; ///
113
116
 
114
117
  context = this.getContext();
115
118
 
@@ -125,7 +128,7 @@ export default define(class Signature extends Element {
125
128
  }
126
129
  }, context);
127
130
 
128
- context = specificContext; ///
131
+ context = temporaryContext; ///
129
132
 
130
133
  if (validates) {
131
134
  signature = this; ///
@@ -175,11 +178,10 @@ export default define(class Signature extends Element {
175
178
  return termsValidate
176
179
  }
177
180
 
178
- unifySignature(signature, generalContext, specificContext) {
181
+ unifySignature(signature, context) {
179
182
  let signatureUnifies;
180
183
 
181
- const context = specificContext, ///
182
- generalSignature = this,
184
+ const generalSignature = this,
183
185
  specificSignature = signature, ///
184
186
  generalSignatureString = generalSignature.getString(),
185
187
  specificSignatureString = specificSignature.getString();
@@ -192,35 +194,24 @@ export default define(class Signature extends Element {
192
194
  specificSignatureContext = specificSignature.getContext(),
193
195
  generalTerms = generalSignatureTerms, ///
194
196
  specificTerms = specificSignatureTerms, ///
195
- generalContexts = [
196
- generalSignatureContext,
197
- generalContext
198
- ],
199
- specificContexts = [
200
- specificSignatureContext,
201
- specificContext
202
- ];
203
-
204
- join((generalContext) => {
205
- join((specificContext) => {
206
- signatureUnifies = match(generalTerms, specificTerms, (generalTerm, specificTerm) => {
207
- let termUnifies;
208
-
209
- reconcile((specificContext) => {
210
- termUnifies = generalTerm.unifyTerm(specificTerm, generalContext, specificContext);
211
-
212
- if (termUnifies) {
213
- specificContext.commit();
214
- }
215
- }, specificContext);
216
-
217
- if (termUnifies) {
218
- return true;
219
- }
220
- });
221
- }, ...specificContexts);
222
- }, ...generalContexts);
197
+ generalContext = generalSignatureContext, ///
198
+ specificContext = specificSignatureContext; ///
223
199
 
200
+ reconcile((specificContext) => {
201
+ signatureUnifies = match(generalTerms, specificTerms, (generalTerm, specificTerm) => {
202
+ let termUnifies;
203
+
204
+ termUnifies = generalTerm.unifyTerm(specificTerm, generalContext, specificContext);
205
+
206
+ if (termUnifies) {
207
+ return true;
208
+ }
209
+ });
210
+
211
+ if (signatureUnifies) {
212
+ specificContext.commit(context);
213
+ }
214
+ }, specificContext);
224
215
 
225
216
  if (signatureUnifies) {
226
217
  context.debug(`...unified the '${specificSignatureString}' signature with the '${generalSignatureString}' signature.`);
@@ -258,8 +249,8 @@ export default define(class Signature extends Element {
258
249
  static fromJSON(json, context) {
259
250
  let signature;
260
251
 
261
- unserialise((json, context) => {
262
- instantiate((context) => {
252
+ instantiate((context) => {
253
+ unserialise((json, context) => {
263
254
  const { string } = json,
264
255
  signatureNode = instantiateSignature(string, context),
265
256
  node = signatureNode, ///
@@ -267,8 +258,8 @@ export default define(class Signature extends Element {
267
258
  terms = termsFromSignatureNode(signatureNode, context);
268
259
 
269
260
  signature = new Signature(context, string, node, breakPoint, terms);
270
- }, context);
271
- }, json, context);
261
+ }, json, context);
262
+ }, context);
272
263
 
273
264
  return signature;
274
265
  }
@@ -276,14 +267,12 @@ export default define(class Signature extends Element {
276
267
  static fromSignatureString(signatureString, context) {
277
268
  let signature;
278
269
 
279
- posit((context) => {
280
- ablate((context) => {
281
- instantiate((context) => {
282
- const string = signatureString, ///
283
- signatureNode = instantiateSignature(string, context);
270
+ ablate((context) => {
271
+ instantiate((context) => {
272
+ const string = signatureString, ///
273
+ signatureNode = instantiateSignature(string, context);
284
274
 
285
- signature = signatureFromSignatureNode(signatureNode, context);
286
- }, context);
275
+ signature = signatureFromSignatureNode(signatureNode, context);
287
276
  }, context);
288
277
  }, context);
289
278
 
@@ -3,9 +3,10 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
+ import { instantiate } from "../utilities/context";
6
7
  import { unifyStatement } from "../process/unify";
7
- import { validateStatements } from "../utilities/validation";
8
- import { reconcile, instantiate } from "../utilities/context";
8
+ import { validateStatements } from "../process/validation";
9
+ import { dischargeStatements } from "../process/discharge";
9
10
  import { instantiateStatement } from "../process/instantiate";
10
11
  import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
11
12
 
@@ -125,7 +126,7 @@ export default define(class Statement extends Element {
125
126
  return comparesToParamter;
126
127
  }
127
128
 
128
- findValidStatment(context) {
129
+ findValidStatement(context) {
129
130
  const statementNode = this.getStatementNode(),
130
131
  statement = context.findStatementByStatementNode(statementNode),
131
132
  validStatement = statement; ///
@@ -194,7 +195,7 @@ export default define(class Statement extends Element {
194
195
 
195
196
  let validates;
196
197
 
197
- const validStatement = this.findValidStatment(context);
198
+ const validStatement = this.findValidStatement(context);
198
199
 
199
200
  if (validStatement !== null) {
200
201
  validates = true;
@@ -226,56 +227,27 @@ export default define(class Statement extends Element {
226
227
  return statement;
227
228
  }
228
229
 
229
- unifySubproof(subproof, generalContext, specificContext) {
230
- let subproofUnifies = false;
230
+ discharge(context) {
231
+ let discharges;
231
232
 
232
- const statementNode = this.getStatementNode(),
233
- subproofAssertionNode = statementNode.getSubproofAssertionNode();
234
-
235
- if (subproofAssertionNode !== null) {
236
- const context = generalContext, ///
237
- subproofString = subproof.getString(),
238
- statementString = this.getString(); ///
239
-
240
- context.trace(`Unifying the '${subproofString}' subproof with the '${statementString}' statement...`);
241
-
242
- const subproofAssertion = context.findAssertionByAssertionNode(subproofAssertionNode);
243
-
244
- subproofUnifies = subproofAssertion.unifySubproof(subproof, generalContext, specificContext);
245
-
246
- if (subproofUnifies) {
247
- context.debug(`...unified the '${subproofString}' subproof with the '${statementString}' statement.`);
248
- }
249
- }
250
-
251
- return subproofUnifies;
252
- }
253
-
254
- unifyDeduction(deduction, generalContext, specificContext) {
255
- let deductionUnifies = false;
256
-
257
- const context = generalContext, ///
258
- statementString = this.getString(), ///
259
- deductionString = deduction.getString(),
260
- deductionStatement = deduction.getStatement();
261
-
262
- context.trace(`Unifying the '${deductionString}' deduction with the '${statementString}' statement...`);
233
+ const statementString = this.getString(); ///
263
234
 
264
- reconcile((specificContext) => {
265
- const deductionStatementUnifies = this.unifyStatement(deductionStatement, generalContext, specificContext);
235
+ context.trace(`Dicharging the '${statementString}' statement...`);
266
236
 
267
- if (deductionStatementUnifies) {
268
- specificContext.commit(context);
237
+ discharges = dischargeStatements.some((dischargeStatement) => {
238
+ const statement = this, ///
239
+ statementDischarged = dischargeStatement(statement, context);
269
240
 
270
- deductionUnifies = true;
241
+ if (statementDischarged) {
242
+ return true;
271
243
  }
272
- }, specificContext);
244
+ });
273
245
 
274
- if (deductionUnifies) {
275
- context.debug(`...unified the '${deductionString}' deduction with the '${statementString}' statement.`);
246
+ if (discharges) {
247
+ context.debug(`...discharged the '${statementString}' statement.`);
276
248
  }
277
249
 
278
- return deductionUnifies;
250
+ return discharges;
279
251
  }
280
252
 
281
253
  unifyStatement(statement, generalContext, specificContext) {
@@ -348,49 +320,6 @@ export default define(class Statement extends Element {
348
320
  return unifiesIndependently;
349
321
  }
350
322
 
351
- unifyTopLevelMetaAssertion(topLevelMetaAssertion, context) {
352
- let topLevelAssertionUnifies = false;
353
-
354
- const statementString = this.getString(), ///
355
- topLevelMetaAssertionString = topLevelMetaAssertion.getString();
356
-
357
- context.trace(`Unifying the '${topLevelMetaAssertionString}' top level meta-assertion with the '${statementString}' statement...`);
358
-
359
- const unconditional = topLevelMetaAssertion.isUnconditional();
360
-
361
- if (unconditional) {
362
- const deduction = topLevelMetaAssertion.getDeduction(),
363
- generalContext = context; ///
364
-
365
- context = deduction.getContext();
366
-
367
- const specificContext = context; ///
368
-
369
- context = generalContext; ///
370
-
371
- const deductionUnifies = this.unifyDeduction(deduction, generalContext, specificContext);
372
-
373
- if (deductionUnifies) {
374
- topLevelAssertionUnifies = true;
375
- }
376
- } else {
377
- const statementNode = this.getStatementNode(),
378
- subproofAssertionNode = statementNode.getSubproofAssertionNode();
379
-
380
- if (subproofAssertionNode !== null) {
381
- const subproofAssertion = context.findAssertionByAssertionNode(subproofAssertionNode);
382
-
383
- topLevelAssertionUnifies = subproofAssertion.unifyTopLevelMetaAssertion(topLevelMetaAssertion, context);
384
- }
385
- }
386
-
387
- if (topLevelAssertionUnifies) {
388
- context.debug(`...unified the '${topLevelMetaAssertionString}' top level meta-assertion with the '${statementString}' statement.`);
389
- }
390
-
391
- return topLevelAssertionUnifies;
392
- }
393
-
394
323
  static name = "Statement";
395
324
 
396
325
  toJSON() {
@@ -3,12 +3,11 @@
3
3
  import Substitution from "../substitution";
4
4
 
5
5
  import { define } from "../../elements";
6
- import { join, reconcile } from "../../utilities/context";
7
6
  import { breakPointFromJSON } from "../../utilities/breakPoint";
8
7
  import { instantiateFrameSubstitution } from "../../process/instantiate";
9
8
  import { frameSubstitutionFromFrameSubstitutionNode } from "../../utilities/element";
10
9
  import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
11
- import { ablate, ablates, manifest, attempts, sequester, instantiate, unserialises } from "../../utilities/context";
10
+ import { elide, ablate, ablates, manifest, attempts, reconcile, instantiate, unserialises } from "../../utilities/context";
12
11
 
13
12
  export default define(class FrameSubstitution extends Substitution {
14
13
  constructor(contexts, string, node, breakPoint, targetFrame, replacementFrame) {
@@ -137,7 +136,7 @@ export default define(class FrameSubstitution extends Substitution {
137
136
 
138
137
  if (targetFrameSingular) {
139
138
  manifest((context) => {
140
- sequester((context) => {
139
+ elide((context) => {
141
140
  const tragetFrame = this.targetFrame.validate(context);
142
141
 
143
142
  if (tragetFrame !== null) {
@@ -168,7 +167,7 @@ export default define(class FrameSubstitution extends Substitution {
168
167
 
169
168
  context.trace(`Validating the '${frameSubstitutionString}' frame substitution's replacement frame...`);
170
169
 
171
- sequester((context) => {
170
+ elide((context) => {
172
171
  const replacementFrame = this.replacementFrame.validate(context);
173
172
 
174
173
  if (replacementFrame !== null) {
@@ -235,24 +234,21 @@ export default define(class FrameSubstitution extends Substitution {
235
234
  generalFrame = generalSubstitutionTargetFrame, ///
236
235
  specificFrame = specificSubstitutionTargetFrame; ///
237
236
 
238
- join((specificContext) => {
239
- reconcile((specificContext) => {
240
- const generalFrameNode = generalFrame.getNode(),
241
- generalMetavariable = metavariableFromFrameNode(generalFrameNode, generalContext);
237
+ reconcile((specificContext) => {
238
+ const frameNode = generalFrame.getFrameNode(),
239
+ metavariable = metavariableFromFrameNode(frameNode, generalContext);
242
240
 
243
- if (generalMetavariable !== null) {
244
- const frame = specificFrame, ///
245
- metavariable = generalMetavariable, ///
246
- frameUnifies = metavariable.unifyFrame(frame, generalContext, specificContext);
241
+ if (metavariable !== null) {
242
+ const frame = specificFrame, ///
243
+ frameUnifies = metavariable.unifyFrame(frame, generalContext, specificContext);
247
244
 
248
- if (frameUnifies) {
249
- specificContext.commit(context);
245
+ if (frameUnifies) {
246
+ specificContext.commit(context);
250
247
 
251
- targetFrameUnifies = true;
252
- }
248
+ targetFrameUnifies = true;
253
249
  }
254
- }, specificContext);
255
- }, specificContext, context);
250
+ }
251
+ }, specificContext);
256
252
 
257
253
  if (targetFrameUnifies) {
258
254
  context.trace(`...unified the '${specificSubstitutionString}' substitution's target frame with the '${generalSubstitutionString}' substitution's target frame.`);
@@ -280,24 +276,21 @@ export default define(class FrameSubstitution extends Substitution {
280
276
  generalFrame = generalSubstitutionReplacementFrame, ///
281
277
  specificFrame = specificSubstitutionReplacementFrame; ///
282
278
 
283
- join((specificContext) => {
284
- reconcile((specificContext) => {
285
- const generalFrameNode = generalFrame.getNode(),
286
- generalMetavariable = metavariableFromFrameNode(generalFrameNode, generalContext);
279
+ reconcile((specificContext) => {
280
+ const frameNode = generalFrame.getNode(),
281
+ metavariable = metavariableFromFrameNode(frameNode, generalContext);
287
282
 
288
- if (generalMetavariable !== null) {
289
- const frame = specificFrame, ///
290
- metavariable = generalMetavariable, ///
291
- frameUnifies = metavariable.unifyFrame(frame, generalContext, specificContext);
283
+ if (metavariable !== null) {
284
+ const frame = specificFrame, ///
285
+ frameUnifies = metavariable.unifyFrame(frame, generalContext, specificContext);
292
286
 
293
- if (frameUnifies) {
294
- specificContext.commit(context);
287
+ if (frameUnifies) {
288
+ specificContext.commit(context);
295
289
 
296
- replacementFrameUnifies = true;
297
- }
290
+ replacementFrameUnifies = true;
298
291
  }
299
- }, specificContext);
300
- }, specificContext, context);
292
+ }
293
+ }, specificContext);
301
294
 
302
295
  if (replacementFrameUnifies) {
303
296
  context.trace(`...unified the '${specificSubstitutionString}' substitution's replacement frame with the '${generalSubstitutionString}' substitution's replacement frame.`);
@@ -314,25 +307,22 @@ export default define(class FrameSubstitution extends Substitution {
314
307
  const { name } = json;
315
308
 
316
309
  if (this.name === name) {
317
- unserialises((json, generalContext, specificContext) => {
318
- const context = specificContext; ///
319
-
320
- instantiate((context) => {
310
+ instantiate((context) => {
311
+ unserialises((json, generalContext, specificContext) => {
321
312
  const { string } = json,
322
313
  frameSubstitutionNode = instantiateFrameSubstitution(string, context),
323
314
  node = frameSubstitutionNode, ///
324
315
  breakPoint = breakPointFromJSON(json),
325
- targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
326
- replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
327
- specificContext = context, ///
316
+ targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, generalContext),
317
+ replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, specificContext),
328
318
  contexts = [
329
319
  generalContext,
330
320
  specificContext
331
321
  ];
332
322
 
333
323
  frameSubstitutionn = new FrameSubstitution(contexts, string, node, breakPoint, targetFrame, replacementFrame);
334
- }, context);
335
- }, json, context);
324
+ }, json, context);
325
+ }, context);
336
326
  }
337
327
 
338
328
  return frameSubstitutionn;
@@ -375,28 +365,28 @@ export default define(class FrameSubstitution extends Substitution {
375
365
  }
376
366
  });
377
367
 
378
- function metavariableFromFrameNode(frameNode, context) {
368
+ function metavariableFromFrameNode(frameNode, generalContext) {
379
369
  let metavariable = null;
380
370
 
381
371
  const metavariableNode = frameNode.getMetavariableNode();
382
372
 
383
373
  if (metavariableNode !== null) {
384
- metavariable = context.findMetavariableByMetavariableNode(metavariableNode);
374
+ metavariable = generalContext.findMetavariableByMetavariableNode(metavariableNode);
385
375
  }
386
376
 
387
377
  return metavariable;
388
378
  }
389
379
 
390
- function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
380
+ function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, generalContext) {
391
381
  const targetFrameNode = frameSubstitutionNode.getTargetFrameNode(),
392
- targetFrame = context.findFrameByFrameNode(targetFrameNode);
382
+ targetFrame = generalContext.findFrameByFrameNode(targetFrameNode);
393
383
 
394
384
  return targetFrame;
395
385
  }
396
386
 
397
- function replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
387
+ function replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, specificContext) {
398
388
  const replacementFrameNode = frameSubstitutionNode.getReplacementFrameNode(),
399
- replacementFrame = context.findFrameByFrameNode(replacementFrameNode);
389
+ replacementFrame = specificContext.findFrameByFrameNode(replacementFrameNode);
400
390
 
401
391
  return replacementFrame;
402
392
  }
@@ -7,7 +7,7 @@ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
7
  import { instantiateReferenceSubstitution } from "../../process/instantiate";
8
8
  import { referenceSubstitutionFromReferenceSubstitutionNode } from "../../utilities/element";
9
9
  import { referenceSubstitutionStringFromReferenceAndMetavariable } from "../../utilities/string";
10
- import { ablates, manifest, attempts, sequester, instantiate, unserialises } from "../../utilities/context";
10
+ import { elide, ablates, manifest, attempts, instantiate, unserialises } from "../../utilities/context";
11
11
 
12
12
  export default define(class ReferenceSubstitution extends Substitution {
13
13
  constructor(context, string, node, breakPoint, targetReference, replacementReference) {
@@ -150,7 +150,7 @@ export default define(class ReferenceSubstitution extends Substitution {
150
150
  context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's target reference...`);
151
151
 
152
152
  manifest((context) => {
153
- sequester((context) => {
153
+ elide((context) => {
154
154
  const targetReference = this.targetReference.validate(context);
155
155
 
156
156
  if (targetReference !== null) {
@@ -174,7 +174,7 @@ export default define(class ReferenceSubstitution extends Substitution {
174
174
 
175
175
  context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's replacement reference...`);
176
176
 
177
- sequester((context) => {
177
+ elide((context) => {
178
178
  const replacementReference = this.replacementReference.validate(context);
179
179
 
180
180
  if (replacementReference !== null) {
@@ -197,25 +197,22 @@ export default define(class ReferenceSubstitution extends Substitution {
197
197
  const { name } = json;
198
198
 
199
199
  if (this.name === name) {
200
- unserialises((json, generalContext, specificContext) => {
201
- const context = specificContext; ///
202
-
203
- instantiate((context) => {
200
+ instantiate((context) => {
201
+ unserialises((json, generalContext, specificContext) => {
204
202
  const { string } = json,
205
203
  referenceSubstitutionNode = instantiateReferenceSubstitution(string, context),
206
204
  node = referenceSubstitutionNode, ///
207
205
  breakPoint = breakPointFromJSON(json),
208
- targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
209
- replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
210
- specificContext = context, ///
206
+ targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext),
207
+ replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, specificContext),
211
208
  contexts = [
212
209
  generalContext,
213
210
  specificContext
214
211
  ];
215
212
 
216
213
  referenceSubstitutionn = new ReferenceSubstitution(contexts, string, node, breakPoint, targetReference, replacementReference);
217
- }, context);
218
- }, json, context);
214
+ }, json, context);
215
+ }, context);
219
216
  }
220
217
 
221
218
  return referenceSubstitutionn;
@@ -262,16 +259,16 @@ export default define(class ReferenceSubstitution extends Substitution {
262
259
  }
263
260
  });
264
261
 
265
- function targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
262
+ function targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext) {
266
263
  const targetReferenceNode = referenceSubstitutionNode.getTargetReferenceNode(),
267
- targetReference = context.findReferenceByReferenceNode(targetReferenceNode);
264
+ targetReference = generalContext.findReferenceByReferenceNode(targetReferenceNode);
268
265
 
269
266
  return targetReference;
270
267
  }
271
268
 
272
- function replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
269
+ function replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, specificContext) {
273
270
  const replacementReferenceNode = referenceSubstitutionNode.getReplacementReferenceNode(),
274
- replacementReference = context.findReferenceByReferenceNode(replacementReferenceNode);
271
+ replacementReference = specificContext.findReferenceByReferenceNode(replacementReferenceNode);
275
272
 
276
273
  return replacementReference;
277
274
  }