occam-verify-cli 1.0.852 → 1.0.857

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 (78) hide show
  1. package/lib/context/file/nominal.js +18 -3
  2. package/lib/context/liminal.js +101 -102
  3. package/lib/context/mnemic.js +511 -0
  4. package/lib/context.js +23 -11
  5. package/lib/element/assertion/contained.js +8 -8
  6. package/lib/element/assertion/defined.js +6 -6
  7. package/lib/element/assertion/satisfies.js +4 -4
  8. package/lib/element/assertion/type.js +5 -4
  9. package/lib/element/assumption/metaLevel.js +7 -7
  10. package/lib/element/assumption.js +23 -15
  11. package/lib/element/combinator.js +4 -4
  12. package/lib/element/conclusion.js +4 -4
  13. package/lib/element/constructor.js +4 -4
  14. package/lib/element/declaration/combinator.js +4 -4
  15. package/lib/element/declaration/complexType.js +3 -3
  16. package/lib/element/declaration/constructor.js +6 -4
  17. package/lib/element/declaration/metavariable.js +7 -7
  18. package/lib/element/declaration/variable.js +6 -4
  19. package/lib/element/deduction.js +4 -4
  20. package/lib/element/frame.js +60 -48
  21. package/lib/element/judgement.js +16 -29
  22. package/lib/element/label.js +4 -4
  23. package/lib/element/metavariable.js +59 -58
  24. package/lib/element/proofAssertion/premise.js +4 -4
  25. package/lib/element/reference.js +20 -20
  26. package/lib/element/rule.js +4 -4
  27. package/lib/element/substitution/frame.js +9 -8
  28. package/lib/element/substitution/reference.js +7 -7
  29. package/lib/element/substitution/statement.js +12 -11
  30. package/lib/element/substitution/term.js +9 -8
  31. package/lib/element/topLevelAssertion.js +4 -4
  32. package/lib/element/topLevelMetaAssertion.js +2 -2
  33. package/lib/element/variable.js +8 -8
  34. package/lib/utilities/context.js +6 -6
  35. package/lib/utilities/element.js +3 -3
  36. package/lib/utilities/json.js +16 -16
  37. package/lib/utilities/string.js +7 -29
  38. package/lib/utilities/substitutions.js +6 -6
  39. package/package.json +1 -1
  40. package/src/context/file/nominal.js +24 -2
  41. package/src/context/liminal.js +116 -117
  42. package/src/context/{ephemeral.js → mnemic.js} +38 -40
  43. package/src/context.js +32 -12
  44. package/src/element/assertion/contained.js +7 -7
  45. package/src/element/assertion/defined.js +5 -5
  46. package/src/element/assertion/satisfies.js +3 -4
  47. package/src/element/assertion/type.js +5 -4
  48. package/src/element/assumption/metaLevel.js +6 -8
  49. package/src/element/assumption.js +28 -17
  50. package/src/element/combinator.js +3 -4
  51. package/src/element/conclusion.js +3 -4
  52. package/src/element/constructor.js +3 -4
  53. package/src/element/declaration/combinator.js +3 -4
  54. package/src/element/declaration/complexType.js +2 -2
  55. package/src/element/declaration/constructor.js +7 -4
  56. package/src/element/declaration/metavariable.js +6 -8
  57. package/src/element/declaration/variable.js +7 -4
  58. package/src/element/deduction.js +3 -4
  59. package/src/element/frame.js +81 -64
  60. package/src/element/judgement.js +21 -43
  61. package/src/element/label.js +3 -4
  62. package/src/element/metavariable.js +66 -73
  63. package/src/element/proofAssertion/premise.js +3 -4
  64. package/src/element/reference.js +21 -25
  65. package/src/element/rule.js +3 -3
  66. package/src/element/substitution/frame.js +7 -7
  67. package/src/element/substitution/reference.js +4 -6
  68. package/src/element/substitution/statement.js +9 -10
  69. package/src/element/substitution/term.js +7 -7
  70. package/src/element/topLevelAssertion.js +3 -3
  71. package/src/element/topLevelMetaAssertion.js +2 -2
  72. package/src/element/variable.js +7 -8
  73. package/src/utilities/context.js +9 -9
  74. package/src/utilities/element.js +3 -3
  75. package/src/utilities/json.js +9 -9
  76. package/src/utilities/string.js +11 -40
  77. package/src/utilities/substitutions.js +3 -3
  78. package/lib/context/ephemeral.js +0 -513
@@ -148,10 +148,9 @@ export default define(class Metavariable extends Element {
148
148
  let typeVerifies = true; ///
149
149
 
150
150
  if (this.type !== null) {
151
- const typeString = this.type.getString(),
152
- metavariableString = this.getString();
151
+ const metavariableString = this.getString();
153
152
 
154
- context.trace(`Verifying the '${metavariableString}' metavariable's '${typeString}' type...`);
153
+ context.trace(`Verifying the '${metavariableString}' metavariable's type...`);
155
154
 
156
155
  const typeName = this.type.getName(),
157
156
  type = context.findTypeByTypeName(typeName);
@@ -163,7 +162,7 @@ export default define(class Metavariable extends Element {
163
162
  }
164
163
 
165
164
  if (typeVerifies) {
166
- context.debug(`...verifieds the '${metavariableString}' metavariable's '${typeString}' type.`);
165
+ context.debug(`...verifieds the '${metavariableString}' metavariable's type.`);
167
166
  }
168
167
  }
169
168
 
@@ -193,15 +192,15 @@ export default define(class Metavariable extends Element {
193
192
  } else {
194
193
  let validates = false;
195
194
 
196
- const typeValidates = this.validateType(strict, context);
195
+ const nameValidates = this.validateName(strict, context);
197
196
 
198
- if (typeValidates) {
197
+ if (nameValidates) {
199
198
  const termValidates = this.validateTerm(strict, context);
200
199
 
201
200
  if (termValidates) {
202
- const nameValidates = this.validateName(strict, context);
201
+ const typeValidates = this.validateType(strict, context);
203
202
 
204
- if (nameValidates) {
203
+ if (typeValidates) {
205
204
  validates = true;
206
205
  }
207
206
  }
@@ -223,38 +222,45 @@ export default define(class Metavariable extends Element {
223
222
  return metavariable;
224
223
  }
225
224
 
226
- validateType(strict, context) {
227
- let typeValidates = false;
225
+ validateName(strict, context) {
226
+ let nameValidates = true; ///
228
227
 
229
228
  const metavariableString = this.getString(); ///
230
229
 
231
- context.trace(`Validating the '${metavariableString}' metavariable's type...`);
230
+ context.trace(`Validating the '${metavariableString}' metavariable's name...`);
232
231
 
233
- if (this.type === null) {
234
- typeValidates = true;
235
- } else {
236
- const typeString = this.type.getString();
232
+ const metavariableName = this.getMetavariableName(), ///
233
+ declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
237
234
 
238
- context.trace(`A '${typeString}' type is present in the '${metavariableString}' metavariable.`);
235
+ if (declaredMetavariable !== null) {
236
+ const metaType = declaredMetavariable.getMetaType(),
237
+ metaTypeString = metaType.getString();
238
+
239
+ this.metaType = metaType;
240
+
241
+ context.trace(`Setting the '${metavariableString}' metavariable's meta-type to the '${metaTypeString}' meta-type.`);
242
+ } else {
243
+ if (strict) {
244
+ nameValidates = false;
245
+ }
239
246
  }
240
247
 
241
- if (typeValidates) {
242
- context.trace(`...validated the '${metavariableString}' metavariable's type.`);
248
+ if (nameValidates) {
249
+ context.debug(`...validated the '${metavariableString}' metavariable's name.`);
243
250
  }
244
251
 
245
- return typeValidates;
252
+ return nameValidates;
246
253
  }
247
254
 
248
255
  validateTerm(strict, context) {
249
- let termValidates = true; ///
256
+ let termValidates = false;
250
257
 
251
- if (this.term !== null) {
252
- termValidates = false;
253
-
254
- const termString = this.term.getString(),
255
- metavariableString = this.getString();
258
+ if (this.term === null) {
259
+ termValidates = true;
260
+ } else {
261
+ const metavariableString = this.getString();
256
262
 
257
- context.trace(`Validating the '${metavariableString}' metavariable's '${termString}' term...`);
263
+ context.trace(`Validating the '${metavariableString}' metavariable's term...`);
258
264
 
259
265
  const metavariableName = this.getMetavariableName(),
260
266
  declaredMetavaraible = context.findDeclaredMetavariableByMetavariableName(metavariableName);
@@ -284,41 +290,35 @@ export default define(class Metavariable extends Element {
284
290
  }
285
291
 
286
292
  if (termValidates) {
287
- context.debug(`...validated the '${metavariableString}' metavariable's '${termString}' term.`);
293
+ context.debug(`...validated the '${metavariableString}' metavariable's term.`);
288
294
  }
289
295
  }
290
296
 
291
297
  return termValidates;
292
298
  }
293
299
 
294
- validateName(strict, context) {
295
- let nameValidates = true; ///
300
+ validateType(strict, context) {
301
+ let typeValidates;
296
302
 
297
- const metavariableName = this.getMetavariableName(), ///
298
- metavariableString = this.getString(); ///
303
+ if (this.type === null) {
304
+ typeValidates = true;
305
+ } else {
306
+ const metavariableString = this.getString(); ///
299
307
 
300
- context.trace(`Validating the '${metavariableString}' metavariable's '${metavariableName}' name...`);
308
+ context.trace(`Validating the '${metavariableString}' metavariable's type...`);
301
309
 
302
- const declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
310
+ typeValidates = false;
303
311
 
304
- if (declaredMetavariable !== null) {
305
- const metaType = declaredMetavariable.getMetaType(),
306
- metaTypeString = metaType.getString();
312
+ const typeString = this.type.getString();
307
313
 
308
- this.metaType = metaType;
314
+ context.trace(`A '${typeString}' type is present in the '${metavariableString}' metavariable.`);
309
315
 
310
- context.trace(`Setting the '${metavariableString}' metavariable's meta-type to the '${metaTypeString}' meta-type.`);
311
- } else {
312
- if (strict) {
313
- nameValidates = false;
316
+ if (typeValidates) {
317
+ context.trace(`...validated the '${metavariableString}' metavariable's type.`);
314
318
  }
315
319
  }
316
320
 
317
- if (nameValidates) {
318
- context.debug(`...validated the '${metavariableString}' metavariable's '${metavariableName}' name.`);
319
- }
320
-
321
- return nameValidates;
321
+ return typeValidates;
322
322
  }
323
323
 
324
324
  unifyFrame(frame, generalContext, specificContext) {
@@ -337,16 +337,15 @@ export default define(class Metavariable extends Element {
337
337
  frameUnifies = true;
338
338
  } else {
339
339
  const metavariableNode = metavariable.getNode(),
340
- substitution = context.findSubstitutionByMetavariableNode(metavariableNode);
340
+ derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
341
341
 
342
- if (substitution !== null) {
343
- const substitutionFrameComparesToFrame = substitution.compareFrame(frame, context);
342
+ if (derivedSubstitution !== null) {
343
+ const derivedSubstitutionFrameComparesToFrame = derivedSubstitution.compareFrame(frame, context);
344
344
 
345
- if (substitutionFrameComparesToFrame) {
346
- const frameSubstitution = substitution, ///
347
- frameSubstitutionString = frameSubstitution.getString();
345
+ if (derivedSubstitutionFrameComparesToFrame) {
346
+ const derivedSubstitutionString = derivedSubstitution.getString();
348
347
 
349
- context.trace(`The '${frameSubstitutionString}' frame substitution is already present.`);
348
+ context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
350
349
 
351
350
  frameUnifies = true;
352
351
  }
@@ -386,22 +385,17 @@ export default define(class Metavariable extends Element {
386
385
  statementUnifies = true;
387
386
  } else {
388
387
  const metavariableNode = metavariable.getNode(),
389
- substitutionPresent = (substitution !== null) ?
390
- context.isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
391
- context.isSubstitutionPresentByMetavariableNode(metavariableNode);
392
-
393
- if (substitutionPresent) {
394
- substitution = (substitution !== null) ?
395
- context.findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
396
- context.findSubstitutionByMetavariableNode(metavariableNode);
388
+ derivedSubstitution = (substitution !== null) ?
389
+ context.findDerivedSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
390
+ context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
397
391
 
398
- const substitutionComparesToStatement = substitution.compareStatement(statement, context);
392
+ if (derivedSubstitution !== null) {
393
+ const derivedSubstitutionComparesToStatement = derivedSubstitution.compareStatement(statement, context);
399
394
 
400
- if (substitutionComparesToStatement) {
401
- const statementSubstitution = substitution, //
402
- statementSubstitutionString = statementSubstitution.getString();
395
+ if (derivedSubstitutionComparesToStatement) {
396
+ const derivedSubstitutionString = derivedSubstitution.getString();
403
397
 
404
- context.trace(`The '${statementSubstitutionString}' statement substitution is already present.`);
398
+ context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
405
399
 
406
400
  statementUnifies = true;
407
401
  }
@@ -440,16 +434,15 @@ export default define(class Metavariable extends Element {
440
434
  referenceUnifies = true;
441
435
  } else {
442
436
  const metavariableNode = metavariable.getNode(),
443
- substitution = context.findSubstitutionByMetavariableNode(metavariableNode);
437
+ derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
444
438
 
445
- if (substitution !== null) {
446
- const substitutionReferenceComparesToReference = substitution.compareReference(reference, context);
439
+ if (derivedSubstitution !== null) {
440
+ const derivedSubstitutionReferenceComparesToReference = derivedSubstitution.compareReference(reference, context);
447
441
 
448
- if (substitutionReferenceComparesToReference) {
449
- const referenceSubstitution = substitution, ///
450
- referenceSubstitutionString = referenceSubstitution.getString();
442
+ if (derivedSubstitutionReferenceComparesToReference) {
443
+ const derivedSubstitutionString = derivedSubstitution.getString();
451
444
 
452
- context.trace(`The '${referenceSubstitutionString}' reference substitution is already present.`);
445
+ context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
453
446
 
454
447
  referenceUnifies = true;
455
448
  }
@@ -118,10 +118,9 @@ export default define(class Premise extends ProofAssertion {
118
118
  validateProcedureCall(context) {
119
119
  let procedureCallValidates = false;
120
120
 
121
- const premiseString = this.getString(), ///
122
- procedureCallString = this.procedureCall.getString();
121
+ const premiseString = this.getString(); ///
123
122
 
124
- context.trace(`Validatting the '${premiseString}' premise's '${procedureCallString}' procedure call...`);
123
+ context.trace(`Validatting the '${premiseString}' premise's procedure call...`);
125
124
 
126
125
  const procedureCall = this.procedureCall.validate(context);
127
126
 
@@ -130,7 +129,7 @@ export default define(class Premise extends ProofAssertion {
130
129
  }
131
130
 
132
131
  if (procedureCallValidates) {
133
- context.debug(`...validated the '${premiseString}' premise's '${procedureCallString}' procedure call.`);
132
+ context.debug(`...validated the '${premiseString}' premise's procedure call.`);
134
133
  }
135
134
 
136
135
  return procedureCallValidates;
@@ -6,8 +6,8 @@ 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 { ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
10
9
  import { metavariableFromReferenceNode, topLevelMetaAssertionFromReferenceNode } from "../utilities/element";
10
+ import { join, ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
11
11
 
12
12
  export default define(class Reference extends Element {
13
13
  constructor(context, string, node, lineIndex, metavariable, topLevelMetaAssertion) {
@@ -106,7 +106,7 @@ export default define(class Reference extends Element {
106
106
  context.trace(`Comparing the '${topLevelMetaAssertionString}' top level meta-assertion to the '${referenceString}' reference...`);
107
107
 
108
108
  const label = topLevelMetaAssertion.getLabel(),
109
- labelUnifies = this.unifyLabel(label);
109
+ labelUnifies = this.unifyLabel(label, context);
110
110
 
111
111
  if (labelUnifies) {
112
112
  topLevelMetaAssertionCompares = true;
@@ -155,7 +155,7 @@ export default define(class Reference extends Element {
155
155
 
156
156
  if (metaType === null) {
157
157
  const reference = this, ///
158
- labelPresent = context.isLabelPresentByReference(reference);
158
+ labelPresent = context.isLabelPresentByReference(reference, context);
159
159
 
160
160
  if (labelPresent) {
161
161
  validates = true;
@@ -197,10 +197,9 @@ export default define(class Reference extends Element {
197
197
  validateMetavariable(context) {
198
198
  let metavariableValidates = false;
199
199
 
200
- const referenceString = this.getString(), ///
201
- metavariableString = this.metavariable.getString();
200
+ const referenceString = this.getString(); ///
202
201
 
203
- context.trace(`Validating the '${referenceString}' reference's '${metavariableString}' metavariable...'`);
202
+ context.trace(`Validating the '${referenceString}' reference's metavariable...'`);
204
203
 
205
204
  const metavariable = this.metavariable.validate(context);
206
205
 
@@ -211,30 +210,25 @@ export default define(class Reference extends Element {
211
210
  }
212
211
 
213
212
  if (metavariableValidates) {
214
- context.debug(`...validated the '${referenceString}' reference's '${metavariableString}' metavariable.'`);
213
+ context.debug(`...validated the '${referenceString}' reference's metavariable.'`);
215
214
  }
216
215
 
217
216
  return metavariableValidates;
218
217
  }
219
218
 
220
- unifyLabel(label) {
219
+ unifyLabel(label, context) {
221
220
  let labelUnifies = false;
222
221
 
223
- let context;
224
-
225
222
  const labelString = label.getString(),
226
- labelContext = label.getContext(),
227
223
  referenceString = this.getString(); ///
228
224
 
229
- context = labelContext; ///
230
-
231
225
  context.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
232
226
 
233
- const specificContext = labelContext; ///
227
+ const generalContext = context; ///
234
228
 
235
- context = this.getContext();
229
+ context = label.getContext();
236
230
 
237
- const generalContext = context; ///
231
+ const specificContext = context; ///
238
232
 
239
233
  reconcile((specificContext) => {
240
234
  const metavariable = label.getMetavariable(),
@@ -293,18 +287,20 @@ export default define(class Reference extends Element {
293
287
 
294
288
  context = temporaryContext; ///
295
289
 
296
- reconcile((specificContext) => {
297
- const metavariable = label.getMetavariable(),
298
- metavariableUnifies = this.unifyMetavariable(metavariable, generalContext, specificContext);
290
+ join((specificContext) => {
291
+ reconcile((specificContext) => {
292
+ const metavariable = label.getMetavariable(),
293
+ metavariableUnifies = this.unifyMetavariable(metavariable, generalContext, specificContext);
299
294
 
300
- if (metavariableUnifies) {
301
- this.topLevelMetaAssertion = topLevelMetaAssertion;
295
+ if (metavariableUnifies) {
296
+ this.topLevelMetaAssertion = topLevelMetaAssertion;
302
297
 
303
- specificContext.commit(context);
298
+ specificContext.commit(context);
304
299
 
305
- topLevelMetaAssertionUUnifies = true;
306
- }
307
- }, specificContext);
300
+ topLevelMetaAssertionUUnifies = true;
301
+ }
302
+ }, specificContext);
303
+ }, specificContext, context);
308
304
 
309
305
  if (topLevelMetaAssertionUUnifies) {
310
306
  context.debug(`...unified the '${topLevelMetaAssertionString}' top level meta-assertion with the '${referenceString}' reference.`);
@@ -253,9 +253,9 @@ export default define(class Rule extends Element {
253
253
  const subproofOrProofAssertionsUnifiesWithPremises = await this.unifySubproofOrProofAssertionsWithPremises(subproofOrProofAssertions, context);
254
254
 
255
255
  if (subproofOrProofAssertionsUnifiesWithPremises) {
256
- const substitutionsResolved = context.areSubstitutionsResolved();
256
+ const derivedSubstitutionsResolved = context.areDerivedSubstitutionsResolved();
257
257
 
258
- if (substitutionsResolved) {
258
+ if (derivedSubstitutionsResolved) {
259
259
  stepAndSubproofOrProofAssertionsUnify = true;
260
260
  }
261
261
  }
@@ -274,7 +274,7 @@ export default define(class Rule extends Element {
274
274
  const subproofOrProofAssertionUnifies = await premise.unifySubproofOrProofAssertion(subproofOrProofAssertion, context);
275
275
 
276
276
  if (subproofOrProofAssertionUnifies) {
277
- context.resolveSubstitutions();
277
+ context.resolveDerivedSubstitutions();
278
278
 
279
279
  return true;
280
280
  }
@@ -127,10 +127,9 @@ export default define(class FrameSubstitution extends Substitution {
127
127
  let targetFrameValidates = false;
128
128
 
129
129
  const context = generalContext, ///
130
- targetFrameString = this.targetFrame.getString(),
131
130
  frameSubstitutionString = this.getString(); ///
132
131
 
133
- context.trace(`Validating the '${frameSubstitutionString}' frame substitution's '${targetFrameString}' target frame...`);
132
+ context.trace(`Validating the '${frameSubstitutionString}' frame substitution's target frame...`);
134
133
 
135
134
  const targetFrameSingular = this.targetFrame.isSingular();
136
135
 
@@ -145,11 +144,13 @@ export default define(class FrameSubstitution extends Substitution {
145
144
  }
146
145
  }, context);
147
146
  } else {
148
- context.debug(`The '${frameSubstitutionString}' frame substitution's '${targetFrameString}' target frame is not singular.`);
147
+ const targetFrameString = this.targetFrame.getString();
148
+
149
+ context.debug(`The '${targetFrameString}' target frame is not singular.`);
149
150
  }
150
151
 
151
152
  if (targetFrameValidates) {
152
- context.debug(`...validated the '${frameSubstitutionString}' frame substitution's '${targetFrameString}' target frame...`);
153
+ context.debug(`...validated the frame substitution's target frame...`);
153
154
  }
154
155
 
155
156
  return targetFrameValidates;
@@ -159,10 +160,9 @@ export default define(class FrameSubstitution extends Substitution {
159
160
  let replacementFrameValidates = false;
160
161
 
161
162
  const context = specificContext, ///
162
- replacementFrameString = this.replacementFrame.getString(),
163
163
  frameSubstitutionString = this.getString(); ///
164
164
 
165
- context.trace(`Validating the '${frameSubstitutionString}' frame substitution's '${replacementFrameString}' replacement frame...`);
165
+ context.trace(`Validating the '${frameSubstitutionString}' frame substitution's replacement frame...`);
166
166
 
167
167
  descend((context) => {
168
168
  const replacementFrame = this.replacementFrame.validate(context);
@@ -175,7 +175,7 @@ export default define(class FrameSubstitution extends Substitution {
175
175
  }, context);
176
176
 
177
177
  if (replacementFrameValidates) {
178
- context.debug(`...validated the '${frameSubstitutionString}' frame substitution's '${replacementFrameString}' replacement frame.`);
178
+ context.debug(`...validated the '${frameSubstitutionString}' frame substitution's replacement frame.`);
179
179
  }
180
180
 
181
181
  return replacementFrameValidates;
@@ -144,10 +144,9 @@ export default define(class ReferenceSubstitution extends Substitution {
144
144
  let targetReferenceValidates = false;
145
145
 
146
146
  const context = generalContext, ///
147
- targetReferenceString = this.targetReference.getString(),
148
147
  referenceSubstitutionString = this.getString(); ///
149
148
 
150
- context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's '${targetReferenceString}' target reference...`);
149
+ context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's target reference...`);
151
150
 
152
151
  descend((context) => {
153
152
  const targetReference = this.targetReference.validate(context);
@@ -158,7 +157,7 @@ export default define(class ReferenceSubstitution extends Substitution {
158
157
  }, context);
159
158
 
160
159
  if (targetReferenceValidates) {
161
- context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's '${targetReferenceString}' target reference...`);
160
+ context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's target reference...`);
162
161
  }
163
162
 
164
163
  return targetReferenceValidates;
@@ -168,10 +167,9 @@ export default define(class ReferenceSubstitution extends Substitution {
168
167
  let replacementReferenceValidates = false;
169
168
 
170
169
  const context = specificContext, ///
171
- replacementReferenceString = this.replacementReference.getString(),
172
170
  referenceSubstitutionString = this.getString(); ///
173
171
 
174
- context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's '${replacementReferenceString}' replacement reference...`);
172
+ context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's replacement reference...`);
175
173
 
176
174
  descend((context) => {
177
175
  const replacementReference = this.replacementReference.validate(context);
@@ -182,7 +180,7 @@ export default define(class ReferenceSubstitution extends Substitution {
182
180
  }, context);
183
181
 
184
182
  if (replacementReferenceValidates) {
185
- context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's '${replacementReferenceString}' replacement reference.`);
183
+ context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's replacement reference.`);
186
184
  }
187
185
 
188
186
  return replacementReferenceValidates;
@@ -163,17 +163,16 @@ export default define(class StatementSubstitution extends Substitution {
163
163
 
164
164
  if (substitution !== null) {
165
165
  const context = generalContext, ///
166
- substitutionString = this.substitution.getString(),
167
166
  statementSubstitutionString = this.getString();
168
167
 
169
- context.trace(`Validating the '${statementSubstitutionString}' statement substitution's '${substitutionString}' substitution...`);
168
+ context.trace(`Validating the '${statementSubstitutionString}' statement substitution's substitution...`);
170
169
 
171
170
  this.substitution = substitution;
172
171
 
173
172
  substitutionValidates = true;
174
173
 
175
174
  if (substitutionValidates) {
176
- context.debug(`...validatewd the '${statementSubstitutionString}' statement substitution's '${substitutionString}' substitution.`);
175
+ context.debug(`...validatewd the '${statementSubstitutionString}' statement substitution's substitution.`);
177
176
  }
178
177
  }
179
178
 
@@ -184,10 +183,9 @@ export default define(class StatementSubstitution extends Substitution {
184
183
  let targetStatementValidates = false;
185
184
 
186
185
  const context = generalContext, ///
187
- targetStatementString = this.targetStatement.getString(),
188
186
  statementSubstitutionString = this.getString(); ///
189
187
 
190
- context.trace(`Validating the '${statementSubstitutionString}' statement substitution's '${targetStatementString}' target statement...`);
188
+ context.trace(`Validating the '${statementSubstitutionString}' statement substitution's target statement...`);
191
189
 
192
190
  const targetStatementSingular = this.targetStatement.isSingular();
193
191
 
@@ -200,11 +198,13 @@ export default define(class StatementSubstitution extends Substitution {
200
198
  }
201
199
  }, context);
202
200
  } else {
203
- context.debug(`The '${statementSubstitutionString}' statement substitution's '${targetStatementString}' target statement is not singular.`);
201
+ const targetStatementString = this.targetStatement.getString();
202
+
203
+ context.debug(`The '${targetStatementString}' target statement is not singular.`);
204
204
  }
205
205
 
206
206
  if (targetStatementValidates) {
207
- context.debug(`...validated the '${statementSubstitutionString}' statement substitution's '${targetStatementString}' target statement...`);
207
+ context.debug(`...validated the '${statementSubstitutionString}' statement substitution's target statement...`);
208
208
  }
209
209
 
210
210
  return targetStatementValidates;
@@ -214,10 +214,9 @@ export default define(class StatementSubstitution extends Substitution {
214
214
  let replacementStatementValidates = false;
215
215
 
216
216
  const context = specificContext, ///
217
- replacementStatementString = this.replacementStatement.getString(),
218
217
  statementSubstitutionString = this.getString(); ///
219
218
 
220
- context.trace(`Validating the '${statementSubstitutionString}' statement substitution's '${replacementStatementString}' replacement statement...`);
219
+ context.trace(`Validating the '${statementSubstitutionString}' statement substitution's replacement statement...`);
221
220
 
222
221
  descend((context) => {
223
222
  const replacementStatement = this.replacementStatement.validate(context);
@@ -228,7 +227,7 @@ export default define(class StatementSubstitution extends Substitution {
228
227
  }, context);
229
228
 
230
229
  if (replacementStatementValidates) {
231
- context.debug(`...validated the '${statementSubstitutionString}' statement substitution's '${replacementStatementString}' replacement statement.`);
230
+ context.debug(`...validated the '${statementSubstitutionString}' statement substitution's replacement statement.`);
232
231
  }
233
232
 
234
233
  return replacementStatementValidates;
@@ -130,10 +130,9 @@ export default define(class TermSubstitution extends Substitution {
130
130
  let targetTermValidates = false;
131
131
 
132
132
  const context = generalContext, ///
133
- targetTermString = this.targetTerm.getString(),
134
133
  termSubstitutionString = this.getString(); ///
135
134
 
136
- context.trace(`Validating the '${termSubstitutionString}' term substitution's '${targetTermString}' target term...`);
135
+ context.trace(`Validating the '${termSubstitutionString}' term substitution's target term...`);
137
136
 
138
137
  const targetTermSingular = this.targetTerm.isSingular();
139
138
 
@@ -152,11 +151,13 @@ export default define(class TermSubstitution extends Substitution {
152
151
  }
153
152
  }, context);
154
153
  } else {
155
- context.debug(`The '${termSubstitutionString}' term substitution's '${targetTermString}' target term is not singular.`);
154
+ const targetTermString = this.targetTerm.getString();
155
+
156
+ context.debug(`The '${targetTermString}' target term is not singular.`);
156
157
  }
157
158
 
158
159
  if (targetTermValidates) {
159
- context.debug(`...validated the '${termSubstitutionString}' term substitution's '${targetTermString}' target term...`);
160
+ context.debug(`...validated the '${termSubstitutionString}' term substitution's target term...`);
160
161
  }
161
162
 
162
163
  return targetTermValidates;
@@ -166,10 +167,9 @@ export default define(class TermSubstitution extends Substitution {
166
167
  let replacementTermValidates = false;
167
168
 
168
169
  const context = specificContext, ///
169
- replacementTermString = this.replacementTerm.getString(),
170
170
  termSubstitutionString = this.getString(); ///
171
171
 
172
- context.trace(`Validating the '${termSubstitutionString}' term substitution's '${replacementTermString}' replacement term...`);
172
+ context.trace(`Validating the '${termSubstitutionString}' term substitution's replacement term...`);
173
173
 
174
174
  descend((context) => {
175
175
  const replacementTerm = this.replacementTerm.validate(context, (replacementTerm) => {
@@ -186,7 +186,7 @@ export default define(class TermSubstitution extends Substitution {
186
186
  }, context);
187
187
 
188
188
  if (replacementTermValidates) {
189
- context.debug(`...validated the '${termSubstitutionString}' term substitution's '${replacementTermString}' replacement term...`);
189
+ context.debug(`...validated the '${termSubstitutionString}' term substitution's replacement term...`);
190
190
  }
191
191
 
192
192
  return replacementTermValidates;
@@ -315,9 +315,9 @@ export default class TopLevelAssertion extends Element {
315
315
  const subproofOrProofAssertionsUnifiesWithSuppositions = await this.unifySubproofOrProofAssertionsWithSuppositions(subproofOrProofAssertions, context);
316
316
 
317
317
  if (subproofOrProofAssertionsUnifiesWithSuppositions) {
318
- const substitutionsResolved = context.areSubstitutionsResolved();
318
+ const derivedSubstitutionsResolved = context.areDerivedSubstitutionsResolved();
319
319
 
320
- if (substitutionsResolved) {
320
+ if (derivedSubstitutionsResolved) {
321
321
  stepAndSubproofOrProofAssertionsUnify = true;
322
322
  }
323
323
  }
@@ -337,7 +337,7 @@ export default class TopLevelAssertion extends Element {
337
337
  const subproofOrProofAssertionUnifies = await supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, context);
338
338
 
339
339
  if (subproofOrProofAssertionUnifies) {
340
- context.resolveSubstitutions();
340
+ context.resolveDerivedSubstitutions();
341
341
 
342
342
  return true;
343
343
  }
@@ -3,7 +3,7 @@
3
3
  import { Element, asynchronousUtilities } from "occam-languages";
4
4
 
5
5
  import { enclose } from "../utilities/context";
6
- import { topLevelMetaAssertionStringFromLabelSuppositionsDeductionAndMetaLevelAssumptions } from "../utilities/string";
6
+ import { topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
7
7
  import { labelFromJSON,
8
8
  labelToLabelJSON,
9
9
  deductionFromJSON,
@@ -259,7 +259,7 @@ export default class TopLevelMetaAssertion extends Element {
259
259
  metaLevelAssumptions = metaLevelAssumptionsFromJSON(json, context),
260
260
  node = null,
261
261
  proof = null,
262
- string = topLevelMetaAssertionStringFromLabelSuppositionsDeductionAndMetaLevelAssumptions(label, suppositions, deduction, metaLevelAssumptions),
262
+ string = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
263
263
  topLevelMetaAssertion = new Class(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
264
264
 
265
265
  return topLevelMetaAssertion;