occam-verify-cli 1.0.438 → 1.0.448

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 (222) hide show
  1. package/lib/context/file.js +42 -39
  2. package/lib/context/local.js +34 -34
  3. package/lib/context/release.js +3 -7
  4. package/lib/context/temporary.js +26 -26
  5. package/lib/element/assertion/contained.js +45 -45
  6. package/lib/element/assertion/defined.js +13 -13
  7. package/lib/element/assertion/property.js +23 -22
  8. package/lib/element/assertion/satisfies.js +7 -6
  9. package/lib/element/assertion/subproof.js +20 -17
  10. package/lib/element/assertion/type.js +3 -2
  11. package/lib/element/assertion.js +1 -23
  12. package/lib/element/assumption.js +24 -22
  13. package/lib/element/axiom.js +27 -30
  14. package/lib/element/axiomLemmaTheoremConjecture.js +50 -57
  15. package/lib/element/{statement/combinator → combinator}/bracketed.js +16 -16
  16. package/lib/element/combinator.js +229 -0
  17. package/lib/element/conclusion.js +11 -9
  18. package/lib/element/{term/constructor → constructor}/bracketed.js +5 -5
  19. package/lib/element/constructor.js +232 -0
  20. package/lib/element/declaration/combinator.js +2 -16
  21. package/lib/element/declaration/complexType.js +12 -12
  22. package/lib/element/declaration/constructor.js +13 -11
  23. package/lib/element/declaration/simpleType.js +4 -4
  24. package/lib/element/declaration/typePrefix.js +2 -2
  25. package/lib/element/declaration/variable.js +3 -3
  26. package/lib/element/deduction.js +11 -9
  27. package/lib/element/derivation.js +17 -20
  28. package/lib/element/equivalence.js +10 -10
  29. package/lib/element/equivalences.js +5 -5
  30. package/lib/element/frame.js +32 -38
  31. package/lib/element/hypothesis.js +16 -57
  32. package/lib/element/judgement.js +6 -4
  33. package/lib/element/label.js +8 -8
  34. package/lib/element/metaLemmaMetatheorem.js +6 -39
  35. package/lib/element/metaType.js +17 -80
  36. package/lib/element/metavariable.js +38 -34
  37. package/lib/element/parameter.js +3 -3
  38. package/lib/element/premise.js +92 -174
  39. package/lib/element/proof.js +7 -7
  40. package/lib/element/proofAssertion.js +203 -0
  41. package/lib/element/property.js +9 -9
  42. package/lib/element/propertyRelation.js +13 -13
  43. package/lib/element/reference.js +16 -17
  44. package/lib/element/rule.js +46 -46
  45. package/lib/element/signature.js +11 -11
  46. package/lib/element/statement.js +18 -18
  47. package/lib/element/step.js +73 -124
  48. package/lib/element/subDerivation.js +17 -20
  49. package/lib/element/subproof.js +16 -24
  50. package/lib/element/substitution/frame.js +1 -7
  51. package/lib/element/substitution/reference.js +2 -3
  52. package/lib/element/substitution/statement.js +44 -15
  53. package/lib/element/substitution/term.js +10 -57
  54. package/lib/element/substitution.js +5 -11
  55. package/lib/element/substitutions.js +29 -29
  56. package/lib/element/supposition.js +95 -177
  57. package/lib/element/term.js +21 -34
  58. package/lib/element/type.js +47 -60
  59. package/lib/element/typePrefix.js +5 -5
  60. package/lib/element/variable.js +9 -9
  61. package/lib/element.js +9 -3
  62. package/lib/metaTypes.js +63 -0
  63. package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
  64. package/lib/node/body/axiom.js +2 -25
  65. package/lib/node/body/conjecture.js +2 -25
  66. package/lib/node/body/lemma.js +2 -25
  67. package/lib/node/body/metaLemma.js +2 -25
  68. package/lib/node/body/metatheorem.js +2 -25
  69. package/lib/node/body/rule.js +15 -1
  70. package/lib/node/body/theorem.js +2 -25
  71. package/lib/node/body.js +25 -2
  72. package/lib/node/combinator.js +11 -2
  73. package/lib/node/constructor.js +11 -2
  74. package/lib/node/declaration/combinator.js +5 -5
  75. package/lib/node/declaration/constructor.js +8 -8
  76. package/lib/node/declaration/property.js +15 -15
  77. package/lib/node/declaration/simpleType.js +31 -31
  78. package/lib/node/declaration/variable.js +8 -8
  79. package/lib/node/equality.js +8 -8
  80. package/lib/node/frame.js +20 -20
  81. package/lib/node/header.js +22 -22
  82. package/lib/node/metaLemmaMetaTheorem.js +16 -16
  83. package/lib/node/metavariable.js +15 -15
  84. package/lib/node/property.js +8 -8
  85. package/lib/node/propertyRelation.js +8 -8
  86. package/lib/node/rule.js +16 -16
  87. package/lib/node/statement.js +12 -12
  88. package/lib/node/step.js +22 -22
  89. package/lib/node/subDerivation.js +1 -8
  90. package/lib/node/subproof.js +5 -12
  91. package/lib/node/substitution/frame.js +19 -19
  92. package/lib/node/substitution/statement.js +19 -19
  93. package/lib/node/substitution/term.js +19 -19
  94. package/lib/node/term.js +35 -35
  95. package/lib/preamble.js +5 -5
  96. package/lib/process/instantiate.js +20 -2
  97. package/lib/process/unify.js +39 -42
  98. package/lib/process/validate.js +431 -0
  99. package/lib/process/verify.js +44 -135
  100. package/lib/types.js +27 -0
  101. package/lib/utilities/brackets.js +9 -14
  102. package/lib/utilities/element.js +91 -55
  103. package/lib/utilities/instance.js +41 -28
  104. package/lib/utilities/statement.js +2 -2
  105. package/lib/utilities/string.js +25 -14
  106. package/lib/utilities/unification.js +237 -0
  107. package/lib/utilities/validation.js +251 -0
  108. package/package.json +6 -6
  109. package/src/context/file.js +40 -34
  110. package/src/context/local.js +34 -34
  111. package/src/context/release.js +2 -6
  112. package/src/context/temporary.js +15 -15
  113. package/src/element/assertion/contained.js +19 -20
  114. package/src/element/assertion/defined.js +11 -12
  115. package/src/element/assertion/property.js +20 -20
  116. package/src/element/assertion/satisfies.js +6 -6
  117. package/src/element/assertion/subproof.js +17 -15
  118. package/src/element/assertion/type.js +2 -2
  119. package/src/element/assertion.js +0 -2
  120. package/src/element/assumption.js +22 -19
  121. package/src/element/axiom.js +33 -37
  122. package/src/element/axiomLemmaTheoremConjecture.js +54 -73
  123. package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
  124. package/src/element/combinator.js +90 -0
  125. package/src/element/conclusion.js +12 -10
  126. package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
  127. package/src/element/{term/constructor.js → constructor.js} +17 -25
  128. package/src/element/declaration/combinator.js +1 -22
  129. package/src/element/declaration/complexType.js +11 -11
  130. package/src/element/declaration/constructor.js +13 -10
  131. package/src/element/declaration/simpleType.js +3 -3
  132. package/src/element/declaration/typePrefix.js +1 -1
  133. package/src/element/declaration/variable.js +2 -2
  134. package/src/element/deduction.js +12 -9
  135. package/src/element/derivation.js +15 -19
  136. package/src/element/equivalence.js +8 -8
  137. package/src/element/equivalences.js +4 -4
  138. package/src/element/frame.js +28 -30
  139. package/src/element/hypothesis.js +16 -18
  140. package/src/element/judgement.js +6 -3
  141. package/src/element/label.js +4 -4
  142. package/src/element/metaLemmaMetatheorem.js +5 -69
  143. package/src/element/metaType.js +9 -45
  144. package/src/element/metavariable.js +34 -31
  145. package/src/element/parameter.js +2 -2
  146. package/src/element/premise.js +124 -99
  147. package/src/element/proof.js +6 -6
  148. package/src/element/proofAssertion.js +76 -0
  149. package/src/element/property.js +6 -6
  150. package/src/element/propertyRelation.js +11 -11
  151. package/src/element/reference.js +14 -21
  152. package/src/element/rule.js +39 -38
  153. package/src/element/signature.js +10 -9
  154. package/src/element/statement.js +16 -18
  155. package/src/element/step.js +78 -78
  156. package/src/element/subDerivation.js +15 -19
  157. package/src/element/subproof.js +11 -19
  158. package/src/element/substitution/frame.js +0 -2
  159. package/src/element/substitution/reference.js +1 -5
  160. package/src/element/substitution/statement.js +44 -14
  161. package/src/element/substitution/term.js +10 -13
  162. package/src/element/substitution.js +3 -5
  163. package/src/element/substitutions.js +48 -30
  164. package/src/element/supposition.js +127 -108
  165. package/src/element/term.js +18 -28
  166. package/src/element/type.js +42 -36
  167. package/src/element/typePrefix.js +3 -3
  168. package/src/element/variable.js +7 -7
  169. package/src/element.js +3 -1
  170. package/src/metaTypes.js +55 -0
  171. package/src/node/axiomLemmaTheoremConjecture.js +6 -6
  172. package/src/node/body/axiom.js +0 -21
  173. package/src/node/body/conjecture.js +0 -23
  174. package/src/node/body/lemma.js +0 -23
  175. package/src/node/body/metaLemma.js +0 -23
  176. package/src/node/body/metatheorem.js +0 -23
  177. package/src/node/body/rule.js +12 -0
  178. package/src/node/body/theorem.js +0 -23
  179. package/src/node/body.js +23 -0
  180. package/src/node/combinator.js +9 -0
  181. package/src/node/constructor.js +9 -0
  182. package/src/node/declaration/combinator.js +5 -5
  183. package/src/node/declaration/constructor.js +8 -8
  184. package/src/node/declaration/property.js +14 -14
  185. package/src/node/declaration/simpleType.js +31 -31
  186. package/src/node/declaration/variable.js +7 -7
  187. package/src/node/equality.js +7 -7
  188. package/src/node/frame.js +21 -21
  189. package/src/node/header.js +22 -22
  190. package/src/node/metaLemmaMetaTheorem.js +14 -14
  191. package/src/node/metavariable.js +14 -14
  192. package/src/node/property.js +7 -7
  193. package/src/node/propertyRelation.js +7 -7
  194. package/src/node/rule.js +15 -15
  195. package/src/node/statement.js +12 -12
  196. package/src/node/step.js +21 -21
  197. package/src/node/subDerivation.js +0 -7
  198. package/src/node/subproof.js +4 -11
  199. package/src/node/substitution/frame.js +18 -18
  200. package/src/node/substitution/statement.js +18 -18
  201. package/src/node/substitution/term.js +18 -18
  202. package/src/node/term.js +34 -34
  203. package/src/preamble.js +4 -4
  204. package/src/process/instantiate.js +12 -0
  205. package/src/process/unify.js +53 -57
  206. package/src/process/validate.js +316 -0
  207. package/src/process/verify.js +50 -138
  208. package/src/types.js +18 -0
  209. package/src/utilities/brackets.js +15 -14
  210. package/src/utilities/element.js +125 -82
  211. package/src/utilities/instance.js +42 -24
  212. package/src/utilities/statement.js +2 -2
  213. package/src/utilities/string.js +38 -24
  214. package/src/{mixins/step/unify.js → utilities/unification.js} +99 -85
  215. package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
  216. package/lib/element/statement/combinator.js +0 -105
  217. package/lib/element/term/constructor.js +0 -172
  218. package/lib/mixins/statement/validate.js +0 -198
  219. package/lib/mixins/step/unify.js +0 -228
  220. package/lib/mixins/term/verify.js +0 -65
  221. package/src/element/statement/combinator.js +0 -59
  222. package/src/mixins/term/verify.js +0 -81
@@ -4,8 +4,8 @@ import { arrayUtilities } from "necessary";
4
4
 
5
5
  import elements from "../elements";
6
6
 
7
- import { baseType } from "../element/type";
8
7
  import { verifyFile } from "../process/verify";
8
+ import { baseTypeFromNothing } from "../types";
9
9
  import { nodeAsString, nodesAsString } from "../utilities/node";
10
10
  import { typesFromJSON,
11
11
  rulesFromJSON,
@@ -97,10 +97,10 @@ export default class FileContext {
97
97
  return equivalences;
98
98
  }
99
99
 
100
- getStepsOrSubproofs() {
101
- const stepsOrSubproofs = [];
100
+ getSubproofOrProofAssertions() {
101
+ const subproofOrProofAssertions = [];
102
102
 
103
- return stepsOrSubproofs;
103
+ return subproofOrProofAssertions;
104
104
  }
105
105
 
106
106
  getLabels(includeRelease = true) {
@@ -329,9 +329,9 @@ export default class FileContext {
329
329
  findMetaLemmaByReference(reference) {
330
330
  const metaLemmas = this.getMetaLemmas(),
331
331
  metaLemma = metaLemmas.find((metaLemma) => {
332
- const referenceMatches = metaLemma.matchReference(reference);
332
+ const metaLemmaComparesToReference = metaLemma.compareReference(reference);
333
333
 
334
- if (referenceMatches) {
334
+ if (metaLemmaComparesToReference) {
335
335
  return true;
336
336
  }
337
337
  }) || null;
@@ -342,9 +342,9 @@ export default class FileContext {
342
342
  findMetatheoremByReference(reference) {
343
343
  const metatheorems = this.getMetatheorems(),
344
344
  metatheorem = metatheorems.find((metatheorem) => {
345
- const referenceMatches = metatheorem.matchReference(reference);
345
+ const metatheoremComparesToReference = metatheorem.compareReference(reference);
346
346
 
347
- if (referenceMatches) {
347
+ if (metatheoremComparesToReference) {
348
348
  return true;
349
349
  }
350
350
  }) || null;
@@ -356,9 +356,9 @@ export default class FileContext {
356
356
  const rules = this.getRules(),
357
357
  metavariableName = reference.getMetavariableName(),
358
358
  rule = rules.find((rule) => {
359
- const metavariableNameMatches = rule.matchMetavariableName(metavariableName);
359
+ const ruleComparesToMetavariableName = rule.compareMetavariableName(metavariableName);
360
360
 
361
- if (metavariableNameMatches) {
361
+ if (ruleComparesToMetavariableName) {
362
362
  return true;
363
363
  }
364
364
  }) || null;
@@ -370,9 +370,9 @@ export default class FileContext {
370
370
  const axioms = this.getAxioms(),
371
371
  metavariableName = reference.getMetavariableName(),
372
372
  axiom = axioms.find((axiom) => {
373
- const metavariableNameMatches = axiom.matchMetavariableName(metavariableName);
373
+ const axiomComparesToMetavariableName = axiom.compareMetavariableName(metavariableName);
374
374
 
375
- if (metavariableNameMatches) {
375
+ if (axiomComparesToMetavariableName) {
376
376
  return true;
377
377
  }
378
378
  }) || null;
@@ -384,9 +384,9 @@ export default class FileContext {
384
384
  const lemmas = this.getLemmas(),
385
385
  metavariableName = reference.getMetavariableName(),
386
386
  lemma = lemmas.find((lemma) => {
387
- const metavariableNameMatches = lemma.matchMetavariableName(metavariableName);
387
+ const lemmaComparesToMetavariableName = lemma.compareMetavariableName(metavariableName);
388
388
 
389
- if (metavariableNameMatches) {
389
+ if (lemmaComparesToMetavariableName) {
390
390
  return true;
391
391
  }
392
392
  }) || null;
@@ -398,9 +398,9 @@ export default class FileContext {
398
398
  const theorems = this.getTheorems(),
399
399
  metavariableName = reference.getMetavariableName(),
400
400
  theorem = theorems.find((theorem) => {
401
- const metavariableNameMatches = theorem.matchMetavariableName(metavariableName);
401
+ const theoremComparesToMetavariableName = theorem.compareMetavariableName(metavariableName);
402
402
 
403
- if (metavariableNameMatches) {
403
+ if (theoremComparesToMetavariableName) {
404
404
  return true;
405
405
  }
406
406
  }) || null;
@@ -425,9 +425,9 @@ export default class FileContext {
425
425
  const conjectures = this.getConjectures(),
426
426
  metavariableName = reference.getMetavariableName(),
427
427
  conjecture = conjectures.find((conjecture) => {
428
- const metavariableNameMatches = conjecture.matchMetavariableName(metavariableName);
428
+ const conjectureComparesToMetavariableName = conjecture.compareMetavariableName(metavariableName);
429
429
 
430
- if (metavariableNameMatches) {
430
+ if (conjectureComparesToMetavariableName) {
431
431
  return true;
432
432
  }
433
433
  }) || null;
@@ -519,15 +519,17 @@ export default class FileContext {
519
519
  findTypeByTypeName(typeName, includeRelease = true, includeDependencies = true) {
520
520
  let types = this.getTypes(includeRelease, includeDependencies);
521
521
 
522
+ const baseType = baseTypeFromNothing();
523
+
522
524
  types = [
523
525
  ...types,
524
526
  baseType
525
527
  ];
526
528
 
527
529
  const type = types.find((type) => {
528
- const typeNameMatches = type.matchTypeName(typeName);
530
+ const typeComparesToTypeName = type.compareTypeName(typeName);
529
531
 
530
- if (typeNameMatches) {
532
+ if (typeComparesToTypeName) {
531
533
  return true;
532
534
  }
533
535
  }) || null;
@@ -538,15 +540,17 @@ export default class FileContext {
538
540
  findTypeByNominalTypeName(nominalTypeName) {
539
541
  let types = this.getTypes();
540
542
 
543
+ const baseType = baseTypeFromNothing();
544
+
541
545
  types = [
542
546
  ...types,
543
547
  baseType
544
548
  ];
545
549
 
546
550
  const type = types.find((type) => {
547
- const typeNameMatches = type.matchNominalTypeName(nominalTypeName);
551
+ const typeComparesToNominalTypeName = type.compareNominalTypeName(nominalTypeName);
548
552
 
549
- if (typeNameMatches) {
553
+ if (typeComparesToNominalTypeName) {
550
554
  return true;
551
555
  }
552
556
  }) || null;
@@ -557,15 +561,17 @@ export default class FileContext {
557
561
  findTypeByPrefixedTypeName(prefixedTypeName) {
558
562
  let types = this.getTypes();
559
563
 
564
+ const baseType = baseTypeFromNothing();
565
+
560
566
  types = [
561
567
  ...types,
562
568
  baseType
563
569
  ];
564
570
 
565
571
  const type = types.find((type) => {
566
- const typeNameMatches = type.matchPrefixedTypeName(prefixedTypeName);
572
+ const typeComparesToPrefixedTypeName = type.comparePrefixedTypeName(prefixedTypeName);
567
573
 
568
- if (typeNameMatches) {
574
+ if (typeComparesToPrefixedTypeName) {
569
575
  return true;
570
576
  }
571
577
  }) || null;
@@ -576,9 +582,9 @@ export default class FileContext {
576
582
  findMetaTypeByMetaTypeName(metaTypeName) {
577
583
  const metaTypes = this.getMetaTypes(),
578
584
  metaType = metaTypes.find((metaType) => {
579
- const metaTypeNameMatches = metaType.matchMetaTypeName(metaTypeName);
585
+ const metaTypeComparesToMetaTypeName = metaType.compareMetaTypeName(metaTypeName);
580
586
 
581
- if (metaTypeNameMatches) {
587
+ if (metaTypeComparesToMetaTypeName) {
582
588
  return true;
583
589
  }
584
590
  }) || null;
@@ -589,9 +595,9 @@ export default class FileContext {
589
595
  findTypePrefixByTypePrefixName(typePrefixName) {
590
596
  const typePrefixes = this.getTypePrefixes(),
591
597
  typePrefix = typePrefixes.find((typePrefix) => {
592
- const typePrefixNameMatches = typePrefix.matchTypePrefixName(typePrefixName);
598
+ const typePrefixComparesToTypePrefixName = typePrefix.compareTypePrefixName(typePrefixName);
593
599
 
594
- if (typePrefixNameMatches) {
600
+ if (typePrefixComparesToTypePrefixName) {
595
601
  return true;
596
602
  }
597
603
  }) || null;
@@ -602,9 +608,9 @@ export default class FileContext {
602
608
  findVariableByVariableIdentifier(variableIdentifier) {
603
609
  const variables = this.getVariables(),
604
610
  variable = variables.find((variable) => {
605
- const variableIdentifierMatches = variable.matchVariableIdentifier(variableIdentifier);
611
+ const variableComparesToVariableIdentifier = variable.compareVariableIdentifier(variableIdentifier);
606
612
 
607
- if (variableIdentifierMatches) {
613
+ if (variableComparesToVariableIdentifier) {
608
614
  return true;
609
615
  }
610
616
  }) || null;
@@ -615,9 +621,9 @@ export default class FileContext {
615
621
  findLabelByMetavariableName(metavariableName) {
616
622
  const labels = this.getLabels(),
617
623
  label = labels.find((label) => {
618
- const metavariableNameMatches = label.matchMetavariableName(metavariableName);
624
+ const labelComparesToMetavariableName = label.compareMetavariableName(metavariableName);
619
625
 
620
- if (metavariableNameMatches) {
626
+ if (labelComparesToMetavariableName) {
621
627
  return true;
622
628
  }
623
629
  }) || null;
@@ -659,9 +665,9 @@ export default class FileContext {
659
665
  findMetavariableByMetavariableName(metavariableName) {
660
666
  const metavariables = this.getMetavariables(),
661
667
  metavariable = metavariables.find((metavariable) => {
662
- const metavariableNameMatches = metavariable.matchMetavariableName(metavariableName);
668
+ const metavariableComparesToMetavariableName = metavariable.compareMetavariableName(metavariableName);
663
669
 
664
- if (metavariableNameMatches) {
670
+ if (metavariableComparesToMetavariableName) {
665
671
  return true;
666
672
  }
667
673
  }) || null;
@@ -7,12 +7,12 @@ import elements from "../elements";
7
7
  const { last } = arrayUtilities;
8
8
 
9
9
  class LocalContext {
10
- constructor(context, variables, judgements, equivalences, stepsOrSubproofs) {
10
+ constructor(context, variables, judgements, equivalences, subproofOrProofAssertions) {
11
11
  this.context = context;
12
12
  this.variables = variables;
13
13
  this.judgements = judgements;
14
14
  this.equivalences = equivalences;
15
- this.stepsOrSubproofs = stepsOrSubproofs;
15
+ this.subproofOrProofAssertions = subproofOrProofAssertions;
16
16
  }
17
17
 
18
18
  getContext() {
@@ -55,41 +55,41 @@ class LocalContext {
55
55
  return equivalences;
56
56
  }
57
57
 
58
- getSteps() {
59
- const stepsOrSubproofs = this.getStepsOrSubproofs(),
60
- steps = stepsOrSubproofs.filter((stepOrSubproof) => {
61
- const stepOrSubproofStep = stepOrSubproof.isStep();
58
+ getProofAssertions() {
59
+ const subproofOrProofAssertions = this.getSubproofOrProofAssertions(),
60
+ proofAssertions = subproofOrProofAssertions.filter((subproofOrProofAssertion) => {
61
+ const subproofOrProofAssertionproofAssertion = subproofOrProofAssertion.isProofAssertion();
62
62
 
63
- if (stepOrSubproofStep) {
63
+ if (subproofOrProofAssertionproofAssertion) {
64
64
  return true;
65
65
  }
66
66
  });
67
67
 
68
- return steps;
68
+ return proofAssertions;
69
69
  }
70
70
 
71
- getLastStep() {
72
- let lastStep = null;
71
+ getLastProofAssertion() {
72
+ let lastProofAssertion = null;
73
73
 
74
- const steps = this.getSteps(),
75
- stepsLength = steps.length;
74
+ const proofAssertions = this.getProofAssertions(),
75
+ proofAssertionsLength = proofAssertions.length;
76
76
 
77
- if (stepsLength > 0) {
78
- lastStep = last(steps);
77
+ if (proofAssertionsLength > 0) {
78
+ lastProofAssertion = last(proofAssertions);
79
79
  }
80
80
 
81
- return lastStep;
81
+ return lastProofAssertion;
82
82
  }
83
83
 
84
- getStepsOrSubproofs() {
85
- let stepsOrSubproofs = this.context.getStepsOrSubproofs();
84
+ getSubproofOrProofAssertions() {
85
+ let subproofOrProofAssertions = this.context.getSubproofOrProofAssertions();
86
86
 
87
- stepsOrSubproofs = [ ///
88
- ...stepsOrSubproofs,
89
- ...this.stepsOrSubproofs
87
+ subproofOrProofAssertions = [ ///
88
+ ...subproofOrProofAssertions,
89
+ ...this.subproofOrProofAssertions
90
90
  ];
91
91
 
92
- return stepsOrSubproofs;
92
+ return subproofOrProofAssertions;
93
93
  }
94
94
 
95
95
  getFilePath() { return this.context.getFilePath(); }
@@ -187,8 +187,8 @@ class LocalContext {
187
187
  return judgementAdded;
188
188
  }
189
189
 
190
- addStepOrSubproof(stepOrSubproof) {
191
- this.stepsOrSubproofs.push(stepOrSubproof);
190
+ addSubproofOrProofAssertion(subproofOrProofAssertion) {
191
+ this.subproofOrProofAssertions.push(subproofOrProofAssertion);
192
192
  }
193
193
 
194
194
  findProcedureByName(name) { return this.context.findProcedureByName(name); }
@@ -216,9 +216,9 @@ class LocalContext {
216
216
  findVariableByVariableIdentifier(variableIdentifier, nested = true) {
217
217
  const variables = this.getVariables(nested),
218
218
  variable = variables.find((variable) => {
219
- const variableIdentifierMatches = variable.matchVariableIdentifier(variableIdentifier);
219
+ const variableComparesToVariableIdentifier = variable.compareVariableIdentifier(variableIdentifier);
220
220
 
221
- if (variableIdentifierMatches) {
221
+ if (variableComparesToVariableIdentifier) {
222
222
  return true;
223
223
  }
224
224
  }) || null;
@@ -306,7 +306,7 @@ class LocalContext {
306
306
 
307
307
  const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
308
308
  const groundedTermNode = groundedTerm.getNode(),
309
- groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
309
+ groundedTermNodeMatches = term.matchNode(groundedTermNode);
310
310
 
311
311
  if (groundedTermNodeMatches) {
312
312
  return true;
@@ -344,18 +344,18 @@ class LocalContext {
344
344
  return metavariableDefined
345
345
  }
346
346
 
347
- matchTermAndPropertyRelation(term, propertyRelation) {
347
+ compareTermAndPropertyRelation(term, propertyRelation) {
348
348
  const context = this, ///
349
- steps = this.getSteps(),
350
- termAndPropertyRelationMatches = steps.some((step) => {
351
- const termAndPropertyRelationMatches = step.matchTermAndPropertyRelation(term, propertyRelation, context);
349
+ proofAssertions = this.getProofAssertions(),
350
+ comparesToTermAndPropertyRelation = proofAssertions.some((proofAssertion) => {
351
+ const comparesToTermAndPropertyRelation = proofAssertion.compareTermAndPropertyRelation(term, propertyRelation, context);
352
352
 
353
- if (termAndPropertyRelationMatches) {
353
+ if (comparesToTermAndPropertyRelation) {
354
354
  return true;
355
355
  }
356
356
  });
357
357
 
358
- return termAndPropertyRelationMatches;
358
+ return comparesToTermAndPropertyRelation;
359
359
  }
360
360
 
361
361
  nodeAsString(node) { return this.context.nodeAsString(node); }
@@ -377,8 +377,8 @@ class LocalContext {
377
377
  variables = [],
378
378
  judgements = [],
379
379
  equivalences = Equivalences.fromNothing(),
380
- stepsOrSubproofs = [],
381
- localContext = new LocalContext(context, variables, judgements, equivalences, stepsOrSubproofs);
380
+ subproofOrProofAssertions = [],
381
+ localContext = new LocalContext(context, variables, judgements, equivalences, subproofOrProofAssertions);
382
382
 
383
383
  return localContext;
384
384
  }
@@ -10,7 +10,7 @@ import FileContext from "../context/file";
10
10
  import NominalLexer from "../nominal/lexer";
11
11
  import NominalParser from "../nominal/parser";
12
12
 
13
- import { frameMetaType, referenceMetaType, statementMetaType } from "../element/metaType";
13
+ import { getMetaTypes } from "../metaTypes";
14
14
  import { customGrammarFromNameAndEntries, combinedCustomGrammarFromReleaseContexts } from "../utilities/customGrammar";
15
15
 
16
16
  const { nominalLexerFromCombinedCustomGrammar } = lexersUtilities,
@@ -58,11 +58,7 @@ export default class ReleaseContext {
58
58
  }
59
59
 
60
60
  getMetaTypes() {
61
- const metaTypes = [
62
- frameMetaType,
63
- referenceMetaType,
64
- statementMetaType
65
- ];
61
+ const metaTypes = getMetaTypes();
66
62
 
67
63
  return metaTypes;
68
64
  }
@@ -159,9 +159,9 @@ export default class TemporaryContext {
159
159
 
160
160
  findTermByTermNode(termNode) {
161
161
  const term = this.terms.find((term) => {
162
- const termMatchesTermNode = term.matchTermNode(termNode);
162
+ const termNodeMatches = term.matchNode(termNode);
163
163
 
164
- if (termMatchesTermNode) {
164
+ if (termNodeMatches) {
165
165
  return true;
166
166
  }
167
167
  }) || null;
@@ -171,9 +171,9 @@ export default class TemporaryContext {
171
171
 
172
172
  findFrameByFrameNode(frameNode) {
173
173
  const frame = this.frames.find((frame) => {
174
- const frameMatchesFrameNode = frame.matchFrameNode(frameNode);
174
+ const frameNodeMatches = frame.matchNode(frameNode);
175
175
 
176
- if (frameMatchesFrameNode) {
176
+ if (frameNodeMatches) {
177
177
  return true;
178
178
  }
179
179
  }) || null;
@@ -183,9 +183,9 @@ export default class TemporaryContext {
183
183
 
184
184
  findStatementByStatementNode(statementNode) {
185
185
  const statement = this.statements.find((statement) => {
186
- const statementMatchesStatementNode = statement.matchStatementNode(statementNode);
186
+ const statementNodeMatches = statement.matchNode(statementNode);
187
187
 
188
- if (statementMatchesStatementNode) {
188
+ if (statementNodeMatches) {
189
189
  return true;
190
190
  }
191
191
  }) || null;
@@ -195,9 +195,9 @@ export default class TemporaryContext {
195
195
 
196
196
  findAssertionByAssertionNode(assertionNode) {
197
197
  const assertion = this.assertions.find((assertion) => {
198
- const assertionMatchesAssertionNode = assertion.matchAssertionNode(assertionNode);
198
+ const assertionNodeMatches = assertion.matchNode(assertionNode);
199
199
 
200
- if (assertionMatchesAssertionNode) {
200
+ if (assertionNodeMatches) {
201
201
  return true;
202
202
  }
203
203
  }) || null;
@@ -219,9 +219,9 @@ export default class TemporaryContext {
219
219
 
220
220
  findSubstitutionBySubstitutionNode(substitutionNode) {
221
221
  const substitution = this.substitutions.find((substitution) => {
222
- const substitutionMatchesSubtitutionNode = substitution.matchSubstitutionNode(substitutionNode);
222
+ const substitutionNodeMatches = substitution.matchNode(substitutionNode);
223
223
 
224
- if (substitutionMatchesSubtitutionNode) {
224
+ if (substitutionNodeMatches) {
225
225
  return true;
226
226
  }
227
227
  }) || null;
@@ -235,11 +235,11 @@ export default class TemporaryContext {
235
235
 
236
236
  getEquivalences() { return this.context.getEquivalences(); }
237
237
 
238
- getSteps() { return this.context.getSteps(); }
238
+ getProofAssertions() { return this.context.getProofAssertions(); }
239
239
 
240
- getLastStep() { return this.context.getLastStep(); }
240
+ getLastProofAssertion() { return this.context.getLastProofAssertion(); }
241
241
 
242
- getStepsOrSubproofs() { return this.context.getStepsOrSubproofs(); }
242
+ getSubproofOrProofAssertions() { return this.context.getSubproofOrProofAssertions(); }
243
243
 
244
244
  getFilePath() { return this.context.getFilePath(); }
245
245
 
@@ -273,7 +273,7 @@ export default class TemporaryContext {
273
273
 
274
274
  addJudgement(judgement) { return this.context.addJudgement(judgement); }
275
275
 
276
- addStepOrSubproof(stepOrSubproof) { this.context.addStepOrSubproof(stepOrSubproof); }
276
+ addSubproofOrProofAssertion(subproofOrProofAssertion) { this.context.addSubproofOrProofAssertion(subproofOrProofAssertion); }
277
277
 
278
278
  findProcedureByName(name) { return this.context.findProcedureByName(name); }
279
279
 
@@ -349,7 +349,7 @@ export default class TemporaryContext {
349
349
 
350
350
  isMetavariableDefined(metavariable) { return this.context.isMetavariableDefined(metavariable); }
351
351
 
352
- matchTermAndPropertyRelation(term, propertyRelation) { return this.context.matchTermAndPropertyRelation(term, propertyRelation); }
352
+ compareTermAndPropertyRelation(term, propertyRelation) { return this.context.compareTermAndPropertyRelation(term, propertyRelation); }
353
353
 
354
354
  nodeAsString(node) { return this.context.nodeAsString(node); }
355
355
 
@@ -3,12 +3,11 @@
3
3
  import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
- import { containedAssertionFromStatementNode } from "../../utilities/element";
7
6
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions, statementFromStatementAndSubstitutions } from "../../utilities/substitutions";
8
7
 
9
8
  export default define(class ContainedAssertion extends Assertion {
10
- constructor(string, node, term, frame, negated, statement) {
11
- super(string, node);
9
+ constructor(cpontext, string, node, term, frame, negated, statement) {
10
+ super(context, string, node);
12
11
 
13
12
  this.term = term;
14
13
  this.frame = frame;
@@ -39,11 +38,11 @@ export default define(class ContainedAssertion extends Assertion {
39
38
 
40
39
  context.trace(`Verifying the '${containedAssertionString}' contained assertion...`);
41
40
 
42
- const termVerifies = this.verifyTerm(assignments, stated, context),
41
+ const termValidates = this.validateTerm(assignments, stated, context),
43
42
  frameVerifies = this.verifyFrame(assignments, stated, context),
44
- statementVerifies = this.verifyStatement(assignments, stated, context)
43
+ statementValidates = this.validateStatement(assignments, stated, context)
45
44
 
46
- if (termVerifies || frameVerifies || statementVerifies) {
45
+ if (termValidates || frameVerifies || statementValidates) {
47
46
  let verifiesWhenStated = false,
48
47
  verifiesWhenDerived = false;
49
48
 
@@ -65,32 +64,32 @@ export default define(class ContainedAssertion extends Assertion {
65
64
  return verifies;
66
65
  }
67
66
 
68
- verifyTerm(assignments, stated, context) {
69
- let termVerifies = false;
67
+ validateTerm(assignments, stated, context) {
68
+ let termValidates = false;
70
69
 
71
70
  if (this.term !== null) {
72
71
  const termString = this.term.getString();
73
72
 
74
- context.trace(`Verifying the '${termString}' term...`);
73
+ context.trace(`Validating the '${termString}' term...`);
75
74
 
76
75
  const termSingular = this.term.isSingular();
77
76
 
78
77
  if (!termSingular) {
79
78
  context.debug(`The '${termString}' term is not singular.`);
80
79
  } else {
81
- termVerifies = this.term.verify(context, () => {
80
+ termValidates = this.term.validate(context, () => {
82
81
  const verifiesAhead = true;
83
82
 
84
83
  return verifiesAhead;
85
84
  });
86
85
 
87
- if (termVerifies) {
88
- context.debug(`...verified the '${termString}' term.`);
86
+ if (termValidates) {
87
+ context.debug(`...validated the '${termString}' term.`);
89
88
  }
90
89
  }
91
90
  }
92
91
 
93
- return termVerifies;
92
+ return termValidates;
94
93
  }
95
94
 
96
95
  verifyFrame(assignments, stated, context) {
@@ -121,26 +120,26 @@ export default define(class ContainedAssertion extends Assertion {
121
120
  return frameVerifies;
122
121
  }
123
122
 
124
- verifyStatement(assignments, stated, context) {
125
- let statementVerifies = false;
123
+ validateStatement(assignments, stated, context) {
124
+ let statementValidates = false;
126
125
 
127
126
  if (this.statement !== null) {
128
127
  const statementString = this.statement.getString();
129
128
 
130
- context.trace(`Verifying the '${statementString}' statement...`);
129
+ context.trace(`Validating the '${statementString}' statement...`);
131
130
 
132
131
  stated = true; ///
133
132
 
134
133
  assignments = null; ///
135
134
 
136
- statementVerifies = this.statement.verify(assignments, stated, context);
135
+ statementValidates = this.statement.validate(assignments, stated, context);
137
136
 
138
- if (statementVerifies) {
139
- context.debug(`...verified the '${statementString}' statement.`);
137
+ if (statementValidates) {
138
+ context.debug(`...validated the '${statementString}' statement.`);
140
139
  }
141
140
  }
142
141
 
143
- return statementVerifies;
142
+ return statementValidates;
144
143
  }
145
144
 
146
145
  verifyWhenStated(assignments, context) {
@@ -4,12 +4,11 @@ import elements from "../../elements";
4
4
  import Assertion from "../assertion";
5
5
 
6
6
  import { define } from "../../elements";
7
- import { definedAssertionFromStatementNode } from "../../utilities/element";
8
7
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions } from "../../utilities/substitutions";
9
8
 
10
9
  export default define(class DefinedAssertion extends Assertion {
11
- constructor(string, node, term, frame, negated) {
12
- super(string, node);
10
+ constructor(context, string, node, term, frame, negated) {
11
+ super(context, string, node);
13
12
 
14
13
  this.term = term;
15
14
  this.frame= frame;
@@ -35,10 +34,10 @@ export default define(class DefinedAssertion extends Assertion {
35
34
 
36
35
  context.trace(`Verifying the '${definedAssertionString}' defined assertion...`);
37
36
 
38
- const termVerifies = this.verifyTerm(assignments, stated, context),
37
+ const termValidates = this.validateTerm(assignments, stated, context),
39
38
  frameVerifies = this.verifyFrame(assignments, stated, context);
40
39
 
41
- if (termVerifies || frameVerifies) {
40
+ if (termValidates || frameVerifies) {
42
41
  let verifiesWhenStated = false,
43
42
  verifiesWhenDerived = false;
44
43
 
@@ -60,32 +59,32 @@ export default define(class DefinedAssertion extends Assertion {
60
59
  return verifies;
61
60
  }
62
61
 
63
- verifyTerm(assignments, stated, context) {
64
- let termVerifies = false;
62
+ validateTerm(assignments, stated, context) {
63
+ let termValidates = false;
65
64
 
66
65
  if (this.term !== null) {
67
66
  const termString = this.term.getString(); ///
68
67
 
69
- context.trace(`Verifying the '${termString}' term...`);
68
+ context.trace(`Validating the '${termString}' term...`);
70
69
 
71
70
  const termSingular = this.term.isSingular();
72
71
 
73
72
  if (!termSingular) {
74
73
  context.debug(`The '${termString}' term is not singular.`);
75
74
  } else {
76
- termVerifies = this.term.verify(context, () => {
75
+ termValidates = this.term.validate(context, () => {
77
76
  const verifiesAhead = true;
78
77
 
79
78
  return verifiesAhead;
80
79
  });
81
80
 
82
- if (termVerifies) {
83
- context.debug(`...verified the '${termString}' term.`);
81
+ if (termValidates) {
82
+ context.debug(`...validated the '${termString}' term.`);
84
83
  }
85
84
  }
86
85
  }
87
86
 
88
- return termVerifies;
87
+ return termValidates;
89
88
  }
90
89
 
91
90
  verifyFrame(assignments, stated, context) {