occam-verify-cli 1.0.852 → 1.0.858

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
@@ -37,7 +37,7 @@ import { termsFromJSON,
37
37
 
38
38
  const { push } = arrayUtilities;
39
39
 
40
- export default class EphemeralContext extends Context {
40
+ export default class MnemicContext extends Context {
41
41
  constructor(context, terms, frames, equalities, judgements, assertions, statements, references, assumptions, metavariables, substitutions) {
42
42
  super(context);
43
43
 
@@ -178,7 +178,7 @@ export default class EphemeralContext extends Context {
178
178
  termA = term, ///
179
179
  termString = term.getString();
180
180
 
181
- context.trace(`Adding the '${termString}' term to the ephemeral context...`);
181
+ context.trace(`Adding the '${termString}' term to the mnemic context...`);
182
182
 
183
183
  const terms = this.getTerms(),
184
184
  termB = terms.find((term) => {
@@ -191,12 +191,12 @@ export default class EphemeralContext extends Context {
191
191
  }) || null;
192
192
 
193
193
  if (termB !== null) {
194
- context.trace(`The '${termString}' term has already been added to the ephemeral context.`);
194
+ context.trace(`The '${termString}' term has already been added to the mnemic context.`);
195
195
  } else {
196
196
  this.terms.push(term);
197
197
  }
198
198
 
199
- context.debug(`...added the '${termString}' term to the ephemeral context.`);
199
+ context.debug(`...added the '${termString}' term to the mnemic context.`);
200
200
  }
201
201
 
202
202
  addFrame(frame) {
@@ -204,7 +204,7 @@ export default class EphemeralContext extends Context {
204
204
  frameA = frame, ///
205
205
  frameString = frame.getString();
206
206
 
207
- context.trace(`Adding the '${frameString}' frame to the ephemeral context...`);
207
+ context.trace(`Adding the '${frameString}' frame to the mnemic context...`);
208
208
 
209
209
  const frames = this.getFrames(),
210
210
  frameB = frames.find((frame) => {
@@ -217,12 +217,12 @@ export default class EphemeralContext extends Context {
217
217
  }) || null;
218
218
 
219
219
  if (frameB !== null) {
220
- context.trace(`The '${frameString}' frame has already been added to the ephemeral context.`);
220
+ context.trace(`The '${frameString}' frame has already been added to the mnemic context.`);
221
221
  } else {
222
222
  this.frames.push(frame);
223
223
  }
224
224
 
225
- context.debug(`...added the '${frameString}' frame to the ephemeral context.`);
225
+ context.debug(`...added the '${frameString}' frame to the mnemic context.`);
226
226
  }
227
227
 
228
228
  addEquality(equality) {
@@ -230,7 +230,7 @@ export default class EphemeralContext extends Context {
230
230
  equalityA = equality, ///
231
231
  equalityString = equality.getString();
232
232
 
233
- context.trace(`Adding the '${equalityString}' equality to the ephemeral context...`);
233
+ context.trace(`Adding the '${equalityString}' equality to the mnemic context...`);
234
234
 
235
235
  const equalities = this.getEqualities(),
236
236
  equalityB = equalities.find((equality) => {
@@ -243,12 +243,12 @@ export default class EphemeralContext extends Context {
243
243
  }) || null;
244
244
 
245
245
  if (equalityB !== null) {
246
- context.trace(`The '${equalityString}' equality has already been added to the ephemeral context.`);
246
+ context.trace(`The '${equalityString}' equality has already been added to the mnemic context.`);
247
247
  } else {
248
248
  this.equalities.push(equality);
249
249
  }
250
250
 
251
- context.debug(`...added the '${equalityString}' equality to the ephemeral context.`);
251
+ context.debug(`...added the '${equalityString}' equality to the mnemic context.`);
252
252
  }
253
253
 
254
254
  addJudgement(judgement) {
@@ -256,7 +256,7 @@ export default class EphemeralContext extends Context {
256
256
  judgementA = judgement, ///
257
257
  judgementString = judgement.getString();
258
258
 
259
- context.trace(`Adding the '${judgementString}' judgement to the ephemeral context...`);
259
+ context.trace(`Adding the '${judgementString}' judgement to the mnemic context...`);
260
260
 
261
261
  const judgements = this.getJudgements(),
262
262
  judgementB = judgements.find((judgement) => {
@@ -269,12 +269,12 @@ export default class EphemeralContext extends Context {
269
269
  }) || null;
270
270
 
271
271
  if (judgementB !== null) {
272
- context.trace(`The '${judgementString}' judgement has already been added to the ephemeral context.`);
272
+ context.trace(`The '${judgementString}' judgement has already been added to the mnemic context.`);
273
273
  } else {
274
274
  this.judgements.push(judgement);
275
275
  }
276
276
 
277
- context.debug(`...added the '${judgementString}' judgement to the ephemeral context.`);
277
+ context.debug(`...added the '${judgementString}' judgement to the mnemic context.`);
278
278
  }
279
279
 
280
280
  addStatement(statement) {
@@ -282,7 +282,7 @@ export default class EphemeralContext extends Context {
282
282
  statementA = statement, ///
283
283
  statementString = statement.getString();
284
284
 
285
- context.trace(`Adding the '${statementString}' statement to the ephemeral context...`);
285
+ context.trace(`Adding the '${statementString}' statement to the mnemic context...`);
286
286
 
287
287
  const statements = this.getStatements(),
288
288
  statementB = statements.find((statement) => {
@@ -295,12 +295,12 @@ export default class EphemeralContext extends Context {
295
295
  }) || null;
296
296
 
297
297
  if (statementB !== null) {
298
- context.trace(`The '${statementString}' statement has already been added to the ephemeral context.`);
298
+ context.trace(`The '${statementString}' statement has already been added to the mnemic context.`);
299
299
  } else {
300
300
  this.statements.push(statement);
301
301
  }
302
302
 
303
- context.debug(`...added the '${statementString}' statement to the ephemeral context.`);
303
+ context.debug(`...added the '${statementString}' statement to the mnemic context.`);
304
304
  }
305
305
 
306
306
  addAssertion(assertion) {
@@ -308,7 +308,7 @@ export default class EphemeralContext extends Context {
308
308
  assertionA = assertion, ///
309
309
  assertionString = assertion.getString();
310
310
 
311
- context.trace(`Adding the '${assertionString}' assertion to the ephemeral context...`);
311
+ context.trace(`Adding the '${assertionString}' assertion to the mnemic context...`);
312
312
 
313
313
  const assertions = this.getAssumptions(),
314
314
  assertionB = assertions.find((assertion) => {
@@ -321,12 +321,12 @@ export default class EphemeralContext extends Context {
321
321
  }) || null;
322
322
 
323
323
  if (assertionB !== null) {
324
- context.trace(`The '${assertionString}' assertion has already been added to the ephemeral context.`);
324
+ context.trace(`The '${assertionString}' assertion has already been added to the mnemic context.`);
325
325
  } else {
326
326
  this.assertions.push(assertion);
327
327
  }
328
328
 
329
- context.debug(`...added the '${assertionString}' assertion to the ephemeral context.`);
329
+ context.debug(`...added the '${assertionString}' assertion to the mnemic context.`);
330
330
  }
331
331
 
332
332
  addReference(reference) {
@@ -334,7 +334,7 @@ export default class EphemeralContext extends Context {
334
334
  referenceA = reference, ///
335
335
  referenceString = reference.getString();
336
336
 
337
- context.trace(`Adding the '${referenceString}' reference to the ephemeral context...`);
337
+ context.trace(`Adding the '${referenceString}' reference to the mnemic context...`);
338
338
 
339
339
  const references = this.getReferences(),
340
340
  referenceB = references.find((reference) => {
@@ -347,12 +347,12 @@ export default class EphemeralContext extends Context {
347
347
  }) || null;
348
348
 
349
349
  if (referenceB !== null) {
350
- context.trace(`The '${referenceString}' reference has already been added to the ephemeral context.`);
350
+ context.trace(`The '${referenceString}' reference has already been added to the mnemic context.`);
351
351
  } else {
352
352
  this.references.push(reference);
353
353
  }
354
354
 
355
- context.debug(`...added the '${referenceString}' reference to the ephemeral context.`);
355
+ context.debug(`...added the '${referenceString}' reference to the mnemic context.`);
356
356
  }
357
357
 
358
358
  addAssumption(assumption) {
@@ -360,7 +360,7 @@ export default class EphemeralContext extends Context {
360
360
  assumptionA = assumption, ///
361
361
  assumptionString = assumption.getString();
362
362
 
363
- context.trace(`Adding the '${assumptionString}' assumption to the ephemeral context...`);
363
+ context.trace(`Adding the '${assumptionString}' assumption to the mnemic context...`);
364
364
 
365
365
  const assumptions = this.getAssumptions(),
366
366
  assumptionB = assumptions.find((assumption) => {
@@ -373,12 +373,12 @@ export default class EphemeralContext extends Context {
373
373
  }) || null;
374
374
 
375
375
  if (assumptionB !== null) {
376
- context.trace(`The '${assumptionString}' assumption has already been added to the ephemeral context.`);
376
+ context.trace(`The '${assumptionString}' assumption has already been added to the mnemic context.`);
377
377
  } else {
378
378
  this.assumptions.push(assumption);
379
379
  }
380
380
 
381
- context.debug(`...added the '${assumptionString}' assumption to the ephemeral context.`);
381
+ context.debug(`...added the '${assumptionString}' assumption to the mnemic context.`);
382
382
  }
383
383
 
384
384
  addMetavariable(metavariable) {
@@ -386,7 +386,7 @@ export default class EphemeralContext extends Context {
386
386
  metavariableA = metavariable, ///
387
387
  metavariableString = metavariable.getString();
388
388
 
389
- context.trace(`Adding the '${metavariableString}' metavariable to the ephemeral context...`);
389
+ context.trace(`Adding the '${metavariableString}' metavariable to the mnemic context...`);
390
390
 
391
391
  const metavariables = this.getMetavariables(),
392
392
  metavariableB = metavariables.find((metavariable) => {
@@ -399,12 +399,12 @@ export default class EphemeralContext extends Context {
399
399
  }) || null;
400
400
 
401
401
  if (metavariableB !== null) {
402
- context.trace(`The '${metavariableString}' metavariable has already been added to the ephemeral context.`);
402
+ context.trace(`The '${metavariableString}' metavariable has already been added to the mnemic context.`);
403
403
  } else {
404
404
  this.metavariables.push(metavariable);
405
405
  }
406
406
 
407
- context.debug(`...added the '${metavariableString}' metavariable to the ephemeral context.`);
407
+ context.debug(`...added the '${metavariableString}' metavariable to the mnemic context.`);
408
408
  }
409
409
 
410
410
  addSubstitution(substitution) {
@@ -412,25 +412,25 @@ export default class EphemeralContext extends Context {
412
412
  substitutionA = substitution, ///
413
413
  substitutionString = substitution.getString();
414
414
 
415
- context.trace(`Adding the '${substitutionString}' substitution to the ephemeral context...`);
415
+ context.trace(`Adding the '${substitutionString}' substitution to the mnemic context...`);
416
416
 
417
417
  const substitutions = this.getSubstitutions(),
418
418
  substitutionB = substitutions.find((substitution) => {
419
419
  const substitutionB = substitution, ///
420
420
  substitutionAEqualToSubstitutionB = substitutionA.isEqualTo(substitutionB);
421
-
421
+
422
422
  if (substitutionAEqualToSubstitutionB) {
423
423
  return true;
424
424
  }
425
425
  }) || null;
426
426
 
427
427
  if (substitutionB !== null) {
428
- context.trace(`The '${substitutionString}' substitution has already been added to the ephemeral context.`);
428
+ context.trace(`The '${substitutionString}' substitution has already been added to the mnemic context.`);
429
429
  } else {
430
430
  this.substitutions.push(substitution);
431
431
  }
432
432
 
433
- context.debug(`...added the '${substitutionString}' substitution to the ephemeral context.`);
433
+ context.debug(`...added the '${substitutionString}' substitution to the mnemic context.`);
434
434
  }
435
435
 
436
436
  addTerms(terms) {
@@ -488,9 +488,7 @@ export default class EphemeralContext extends Context {
488
488
  }
489
489
 
490
490
  addSubstitutions(substitutions) {
491
- substitutions.forEach((substitution) => {
492
- this.addSubstitution(substitution);
493
- });
491
+ ///
494
492
  }
495
493
 
496
494
  findVariableByVariableNode(variableNode) {
@@ -801,11 +799,11 @@ export default class EphemeralContext extends Context {
801
799
  assumptions = null,
802
800
  metavariables = null,
803
801
  substitutions = null,
804
- emphemeralContext = new EphemeralContext(context, terms, frames, equalities, judgements, assertions, statements, references, assumptions, metavariables, substitutions);
802
+ mnemicContext = new MnemicContext(context, terms, frames, equalities, judgements, assertions, statements, references, assumptions, metavariables, substitutions);
805
803
 
806
- emphemeralContext.initialise(json);
804
+ mnemicContext.initialise(json);
807
805
 
808
- return emphemeralContext;
806
+ return mnemicContext;
809
807
  }
810
808
 
811
809
  static fromNothing(context) {
@@ -819,8 +817,8 @@ export default class EphemeralContext extends Context {
819
817
  assumptions = [],
820
818
  metavariables = [],
821
819
  substitutions = [],
822
- emphemeralContext = new EphemeralContext(context, terms, frames, equalities, judgements, assertions, statements, references, assumptions, metavariables, substitutions);
820
+ mnemicContext = new MnemicContext(context, terms, frames, equalities, judgements, assertions, statements, references, assumptions, metavariables, substitutions);
823
821
 
824
- return emphemeralContext;
822
+ return mnemicContext;
825
823
  }
826
824
  }
package/src/context.js CHANGED
@@ -104,6 +104,14 @@ export default class Context extends ContextBase {
104
104
  return substitutions;
105
105
  }
106
106
 
107
+ getDerivedSubstitutions(derivedSubstitutions = []) {
108
+ const context = this.getContext();
109
+
110
+ context.getDerivedSubstitutions(derivedSubstitutions);
111
+
112
+ return derivedSubstitutions;
113
+ }
114
+
107
115
  getEquivalences() {
108
116
  const context = this.getContext(),
109
117
  equivalences = context.getEquivalences();
@@ -160,7 +168,9 @@ export default class Context extends ContextBase {
160
168
 
161
169
  const parentContext = context; ///
162
170
 
163
- metavariable = parentContext.findMetavariable(metavariable, childContext); ///
171
+ context = childContext; ///
172
+
173
+ metavariable = parentContext.findMetavariable(metavariable, context);
164
174
 
165
175
  return metavariable;
166
176
  }
@@ -374,15 +384,25 @@ export default class Context extends ContextBase {
374
384
 
375
385
  context = this.getContext();
376
386
 
377
- const parentContext = context, ///
378
- metavariablePresent = parentContext.isMetavariablePresent(metavariable, childContext);
387
+ const parentContext = context; ///
388
+
389
+ context = childContext; ///
390
+
391
+ const metavariablePresent = parentContext.isMetavariablePresent(metavariable, context);
379
392
 
380
393
  return metavariablePresent;
381
394
  }
382
395
 
383
- isLabelPresentByReference(reference) {
384
- const context = this.getContext(),
385
- labelPresent = context.isLabelPresentByReference(reference);
396
+ isLabelPresentByReference(reference, context = null) {
397
+ const childContext = context; ///
398
+
399
+ context = this.getContext();
400
+
401
+ const parentContext = context; ///
402
+
403
+ context = childContext; ///
404
+
405
+ const labelPresent = parentContext.isLabelPresentByReference(reference, context);
386
406
 
387
407
  return labelPresent;
388
408
  }
@@ -485,11 +505,11 @@ export default class Context extends ContextBase {
485
505
  return referencePresent;
486
506
  }
487
507
 
488
- isSubstitutionPresentByMetavariableNode(metavariableNode) {
508
+ isDerivedSubstitutionPresentByMetavariableNode(metavariableNode) {
489
509
  const context = this.getContext(),
490
- substitutionPresent = context.isSubstitutionPresentByMetavariableNode(metavariableNode);
510
+ derivedSubstitutionPresent = context.isDerivedSubstitutionPresentByMetavariableNode(metavariableNode);
491
511
 
492
- return substitutionPresent;
512
+ return derivedSubstitutionPresent;
493
513
  }
494
514
 
495
515
  isDeclaredJudgementPresentByMetavariableNode(metavariableNode) {
@@ -499,11 +519,11 @@ export default class Context extends ContextBase {
499
519
  return declaredJudgementPresent;
500
520
  }
501
521
 
502
- isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
522
+ isDerivedSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution) {
503
523
  const context = this.getContext(),
504
- substitutionPresent = context.isSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution);
524
+ derivedSubstitutionPresent = context.isDerivedSubstitutionPresentByMetavariableNodeAndSubstitution(metavariableNode, substitution);
505
525
 
506
- return substitutionPresent;
526
+ return derivedSubstitutionPresent;
507
527
  }
508
528
 
509
529
  isMetaLevel() {
@@ -103,13 +103,11 @@ export default define(class ContainedAssertion extends Assertion {
103
103
  const termString = this.term.getString(),
104
104
  containedAssertionString = this.getString(); ///
105
105
 
106
- context.trace(`Validating the '${containedAssertionString}' contained assertion's '${termString}' term...`);
106
+ context.trace(`Validating the '${containedAssertionString}' contained assertion's term...`);
107
107
 
108
108
  const termSingular = this.term.isSingular();
109
109
 
110
- if (!termSingular) {
111
- context.debug(`The '${termString}' term is not singular.`);
112
- } else {
110
+ if (termSingular) {
113
111
  const term = this.term.validate(context, (term) => {
114
112
  const validatesForwards = true;
115
113
 
@@ -123,8 +121,10 @@ export default define(class ContainedAssertion extends Assertion {
123
121
  }
124
122
 
125
123
  if (termValidates) {
126
- context.debug(`...validated the '${containedAssertionString}' contained assertion's '${termString}' term.`);
124
+ context.debug(`...validated the '${containedAssertionString}' contained assertion's term.`);
127
125
  }
126
+ } else {
127
+ context.debug(`The '${termString}' term is not singular.`);
128
128
  }
129
129
  }
130
130
 
@@ -138,7 +138,7 @@ export default define(class ContainedAssertion extends Assertion {
138
138
  const frameString = this.frame.getString(),
139
139
  containedAssertionString = this.getString(); ///
140
140
 
141
- context.trace(`Validating the '${containedAssertionString}' contained assertion's '${frameString}' frame...`);
141
+ context.trace(`Validating the '${containedAssertionString}' contained assertion's frame...`);
142
142
 
143
143
  const frameSingular = this.frame.isSingular();
144
144
 
@@ -155,7 +155,7 @@ export default define(class ContainedAssertion extends Assertion {
155
155
  }
156
156
 
157
157
  if (frameValidates) {
158
- context.debug(`...validated the '${containedAssertionString}' contained assertion's '${frameString}' frame.`);
158
+ context.debug(`...validated the '${containedAssertionString}' contained assertion's frame.`);
159
159
  }
160
160
  }
161
161
 
@@ -94,13 +94,11 @@ export default define(class DefinedAssertion extends Assertion {
94
94
  const termString = this.term.getString(), ///
95
95
  definedAssertionString = this.getString(); ///
96
96
 
97
- context.trace(`Validating the '${definedAssertionString}' defined assertion's '${termString}' term...`);
97
+ context.trace(`Validating the '${definedAssertionString}' defined assertion's term...`);
98
98
 
99
99
  const termSingular = this.term.isSingular();
100
100
 
101
- if (!termSingular) {
102
- context.debug(`The '${termString}' term is not singular.`);
103
- } else {
101
+ if (termSingular) {
104
102
  const term = this.term.validate(context, (term) => {
105
103
  const validatesForwards = true;
106
104
 
@@ -114,8 +112,10 @@ export default define(class DefinedAssertion extends Assertion {
114
112
  }
115
113
 
116
114
  if (termValidates) {
117
- context.debug(`...validates the'${definedAssertionString}' defined assertion's '${termString}' term.`);
115
+ context.debug(`...validates the'${definedAssertionString}' defined assertion's term.`);
118
116
  }
117
+ } else {
118
+ context.debug(`The '${termString}' term is not singular.`);
119
119
  }
120
120
  }
121
121
 
@@ -91,10 +91,9 @@ export default define(class SatisfiesAssertion extends Assertion {
91
91
  validateReference(context) {
92
92
  let referenceVerifies = false;
93
93
 
94
- const referenceString = this.reference.getString(),
95
- satisfiesAssertionString = this.getString(); ///
94
+ const satisfiesAssertionString = this.getString(); ///
96
95
 
97
- context.trace(`Validating the '${satisfiesAssertionString}' satisfies assertino's '${referenceString}' reference...`);
96
+ context.trace(`Validating the '${satisfiesAssertionString}' satisfies assertino's reference...`);
98
97
 
99
98
  const axiom = context.findAxiomByReference(this.reference);
100
99
 
@@ -107,7 +106,7 @@ export default define(class SatisfiesAssertion extends Assertion {
107
106
  }
108
107
 
109
108
  if (referenceVerifies) {
110
- context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertino's '${referenceString}' reference.`);
109
+ context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertino's reference.`);
111
110
  }
112
111
 
113
112
  return referenceVerifies;
@@ -86,10 +86,9 @@ export default define(class TypeAssertion extends Assertion {
86
86
  validateType(context) {
87
87
  let typeValidates;
88
88
 
89
- const typeString = this.type.getString(),
90
- typeAssertionString = this.getString(); ///
89
+ const typeAssertionString = this.getString(); ///
91
90
 
92
- context.trace(`Validating the '${typeAssertionString}' type assertion's '${typeString}' type...`);
91
+ context.trace(`Validating the '${typeAssertionString}' type assertion's type...`);
93
92
 
94
93
  const nominalTypeName = this.type.getNominalTypeName(),
95
94
  type = context.findTypeByNominalTypeName(nominalTypeName);
@@ -99,11 +98,13 @@ export default define(class TypeAssertion extends Assertion {
99
98
 
100
99
  typeValidates = true;
101
100
  } else {
101
+ const typeString = this.type.getString();
102
+
102
103
  context.debug(`The '${typeString}' type is not present.`);
103
104
  }
104
105
 
105
106
  if (typeValidates) {
106
- context.debug(`...validated the '${typeAssertionString}' type assertion's '${typeString}' type.`);
107
+ context.debug(`...validated the '${typeAssertionString}' type assertion's type.`);
107
108
  }
108
109
 
109
110
  return typeValidates;
@@ -119,10 +119,9 @@ export default define(class MetaLevelAssumption extends Element {
119
119
  validateReference(context) {
120
120
  let referenceValidates = false;
121
121
 
122
- const referenceString = this.reference.getString(),
123
- metaLevelAssumptionString = this.getString(); ///
122
+ const metaLevelAssumptionString = this.getString(); ///
124
123
 
125
- context.trace(`Validating the '${metaLevelAssumptionString}' meta-level assumption's '${referenceString}' reference...`);
124
+ context.trace(`Validating the '${metaLevelAssumptionString}' meta-level assumption's reference...`);
126
125
 
127
126
  const reference = this.reference.validate(context);
128
127
 
@@ -139,7 +138,7 @@ export default define(class MetaLevelAssumption extends Element {
139
138
  }
140
139
 
141
140
  if (referenceValidates) {
142
- context.debug(`...validated the '${metaLevelAssumptionString}' meta-level assumption's '${referenceString}' reference.`);
141
+ context.debug(`...validated the '${metaLevelAssumptionString}' meta-level assumption's reference.`);
143
142
  }
144
143
 
145
144
  return referenceValidates;
@@ -148,10 +147,9 @@ export default define(class MetaLevelAssumption extends Element {
148
147
  validateStatement(context) {
149
148
  let statementValidates = false;
150
149
 
151
- const metaLevelAssumptionString = this.getString(), ///
152
- statementString = this.statement.getString();
150
+ const metaLevelAssumptionString = this.getString(); ///
153
151
 
154
- context.trace(`Validating the '${metaLevelAssumptionString}' meta-level assumption's '${statementString}' statement...`);
152
+ context.trace(`Validating the '${metaLevelAssumptionString}' meta-level assumption's statement...`);
155
153
 
156
154
  descend((context) => {
157
155
  const statement = this.statement.validate(context);
@@ -162,7 +160,7 @@ export default define(class MetaLevelAssumption extends Element {
162
160
  }, context);
163
161
 
164
162
  if (statementValidates) {
165
- context.debug(`...validated the '${metaLevelAssumptionString}' meta-level assumption's '${statementString}' statement.`);
163
+ context.debug(`...validated the '${metaLevelAssumptionString}' meta-level assumption's statement.`);
166
164
  }
167
165
 
168
166
  return statementValidates;
@@ -112,37 +112,33 @@ export default define(class Assumption extends Element {
112
112
  validateReference(context) {
113
113
  let referenceValidates = false;
114
114
 
115
- const referenceString = this.reference.getString(),
116
- assumptionString = this.getString(); ///
115
+ const assumptionString = this.getString(); ///
117
116
 
118
- context.trace(`Validating the '${assumptionString}' assumption's '${referenceString}' reference...`);
117
+ context.trace(`Validating the '${assumptionString}' assumption's reference...`);
119
118
 
120
119
  const reference = this.reference.validate(context);
121
120
 
122
121
  if (reference !== null) {
123
- const metavariable = this.reference.getMetavariable(),
122
+ const metavariable = reference.getMetavariable(),
124
123
  metavariablePresent = context.isMetavariablePresent(metavariable, context);
125
124
 
126
125
  if (metavariablePresent) {
126
+ this.reference = reference;
127
+
127
128
  referenceValidates = true;
128
129
  } else {
129
- const topLevelMetaAssertions = context.findTopLevelMetaAssertionsByReference(this.reference),
130
- topLevelMetaAssertionsCompare = topLevelMetaAssertions.some((topLevelMetaAssertion) => {
131
- const topLevelMetaAssertionUnifies = this.unifyTopLevelMetaAssertion(topLevelMetaAssertion, context);
130
+ const topLevelMetaAssertionsUnify = this.unifyTopLevelMetaAssertions(reference, context);
132
131
 
133
- if (topLevelMetaAssertionUnifies) {
134
- return true;
135
- }
136
- });
132
+ if (topLevelMetaAssertionsUnify) {
133
+ this.reference = reference;
137
134
 
138
- if (topLevelMetaAssertionsCompare) {
139
135
  referenceValidates = true;
140
136
  }
141
137
  }
142
138
  }
143
139
 
144
140
  if (referenceValidates) {
145
- context.debug(`...validated the '${assumptionString}' assumption's '${referenceString}' reference.`);
141
+ context.debug(`...validated the '${assumptionString}' assumption's reference.`);
146
142
  }
147
143
 
148
144
  return referenceValidates;
@@ -151,10 +147,9 @@ export default define(class Assumption extends Element {
151
147
  validateStatement(context) {
152
148
  let statementValidates = false;
153
149
 
154
- const assumptionString = this.getString(), ///
155
- statementString = this.statement.getString();
150
+ const assumptionString = this.getString(); ///
156
151
 
157
- context.trace(`Validating the '${assumptionString}' assumption's '${statementString}' statement...`);
152
+ context.trace(`Validating the '${assumptionString}' assumption's statement...`);
158
153
 
159
154
  const statement = this.statement.validate(context);
160
155
 
@@ -163,7 +158,7 @@ export default define(class Assumption extends Element {
163
158
  }
164
159
 
165
160
  if (statementValidates) {
166
- context.debug(`...validated the '${assumptionString}' assumption's '${statementString}' statement.`);
161
+ context.debug(`...validated the '${assumptionString}' assumption's statement.`);
167
162
  }
168
163
 
169
164
  return statementValidates;
@@ -267,6 +262,22 @@ export default define(class Assumption extends Element {
267
262
  return topLevelMetaAssertionUnifies;
268
263
  }
269
264
 
265
+ unifyTopLevelMetaAssertions(reference, context) {
266
+ let topLevelMetaAssertionsUnify;
267
+
268
+ const topLevelMetaAssertions = context.findTopLevelMetaAssertionsByReference(reference);
269
+
270
+ topLevelMetaAssertionsUnify = topLevelMetaAssertions.some((topLevelMetaAssertion) => {
271
+ const topLevelMetaAssertionUnifies = this.unifyTopLevelMetaAssertion(topLevelMetaAssertion, context);
272
+
273
+ if (topLevelMetaAssertionUnifies) {
274
+ return true;
275
+ }
276
+ });
277
+
278
+ return topLevelMetaAssertionsUnify;
279
+ }
280
+
270
281
  static name = "Assumption";
271
282
 
272
283
  toJSON() {
@@ -56,10 +56,9 @@ export default define(class Combinator extends Element {
56
56
  validateStatement(context) {
57
57
  let statementValidates = false;
58
58
 
59
- const statementString = this.statement.getString(),
60
- combinatorString = this.getString(); ///
59
+ const combinatorString = this.getString(); ///
61
60
 
62
- context.trace(`Validating the '${combinatorString}' combinator's '${statementString}' statement...`);
61
+ context.trace(`Validating the '${combinatorString}' combinator's statement...`);
63
62
 
64
63
  const statementValidatesAsCombinator = validateStatementAsCombinator(this.statement, context);
65
64
 
@@ -68,7 +67,7 @@ export default define(class Combinator extends Element {
68
67
  }
69
68
 
70
69
  if (statementValidates) {
71
- context.debug(`...validated the '${combinatorString}' combinator's '${statementString}' statement.`);
70
+ context.debug(`...validated the '${combinatorString}' combinator's statement.`);
72
71
  }
73
72
 
74
73
  return statementValidates;