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
@@ -7,8 +7,8 @@ import { define } from "../../elements";
7
7
  import { variableAssignmentFromVariable } from "../../process/assign";
8
8
 
9
9
  export default define(class PropertyAssertion extends Assertion {
10
- constructor(string, node, term, propertyRelation) {
11
- super(string, node);
10
+ constructor(context, string, node, term, propertyRelation) {
11
+ super(context, string, node);
12
12
 
13
13
  this.term = term;
14
14
  this.propertyRelation = propertyRelation;
@@ -22,14 +22,14 @@ export default define(class PropertyAssertion extends Assertion {
22
22
  return this.propertyRelation;
23
23
  }
24
24
 
25
- matchTermAndPropertyRelation(term, propertyRelation, context) {
26
- let propertyMatchesTermAndPropertyRelation = false;
25
+ compareTermAndPropertyRelation(term, propertyRelation, context) {
26
+ let comparesToTermAndPropertyRelation = false;
27
27
 
28
28
  const termString = term.getString(),
29
29
  propertyRelationString = propertyRelation.getString(),
30
- propertyAssertionString = this.getString();
30
+ propertyAssertionString = this.getString(); ///
31
31
 
32
- context.trace(`Matching the '${termString}' term and '${propertyRelationString}' property relation against the '${propertyAssertionString}' property assertion...`);
32
+ context.trace(`Comparing the '${propertyAssertionString}' property assertion to the '${termString}' term and '${propertyRelationString}' property relation...`);
33
33
 
34
34
  const termA = term,
35
35
  termB = this.term, ///
@@ -38,14 +38,14 @@ export default define(class PropertyAssertion extends Assertion {
38
38
  if (termAEqualToTermB) {
39
39
  const propertyRelationEqualToPropertyRelation = this.propertyRelation.isEqualTo(propertyRelation);
40
40
 
41
- propertyMatchesTermAndPropertyRelation = propertyRelationEqualToPropertyRelation; ///
41
+ comparesToTermAndPropertyRelation = propertyRelationEqualToPropertyRelation; ///
42
42
  }
43
43
 
44
- if (propertyMatchesTermAndPropertyRelation) {
45
- context.debug(`...matched the '${termString}' term and '${propertyRelationString}' property relation against the '${propertyAssertionString}' property assertion.`);
44
+ if (comparesToTermAndPropertyRelation) {
45
+ context.debug(`...compared the '${propertyAssertionString}' property assertion to the '${termString}' term and '${propertyRelationString}' property relation.`);
46
46
  }
47
47
 
48
- return propertyMatchesTermAndPropertyRelation;
48
+ return comparesToTermAndPropertyRelation;
49
49
  }
50
50
 
51
51
  verify(assignments, stated, context) {
@@ -55,9 +55,9 @@ export default define(class PropertyAssertion extends Assertion {
55
55
 
56
56
  context.trace(`Verifying the '${propertyAssertionString}' property assertion...`);
57
57
 
58
- const termVerifies = this.verifyTerm(assignments, stated, context);
58
+ const termValidates = this.validateTerm(assignments, stated, context);
59
59
 
60
- if (termVerifies) {
60
+ if (termValidates) {
61
61
  const propertyRelationVerifies = this.verifyPropertyRelation(assignments, stated, context);
62
62
 
63
63
  if (propertyRelationVerifies) {
@@ -89,24 +89,24 @@ export default define(class PropertyAssertion extends Assertion {
89
89
  return verifies;
90
90
  }
91
91
 
92
- verifyTerm(assignments, stated, context) {
93
- let termVerifies;
92
+ validateTerm(assignments, stated, context) {
93
+ let termValidates;
94
94
 
95
95
  const termString = this.term.getString();
96
96
 
97
- context.trace(`Verifying the '${termString}' term...`);
97
+ context.trace(`Validating the '${termString}' term...`);
98
98
 
99
- termVerifies = this.term.verify(context, () => {
99
+ termValidates = this.term.verify(context, () => {
100
100
  const verifiesAhead = true;
101
101
 
102
102
  return verifiesAhead;
103
103
  });
104
104
 
105
- if (termVerifies) {
106
- context.debug(`...verified the '${termString}' term.`);
105
+ if (termValidates) {
106
+ context.debug(`...validated the '${termString}' term.`);
107
107
  }
108
108
 
109
- return termVerifies;
109
+ return termValidates;
110
110
  }
111
111
 
112
112
  verifyPropertyRelation(assignments, stated, context) {
@@ -126,7 +126,7 @@ export default define(class PropertyAssertion extends Assertion {
126
126
  }
127
127
 
128
128
  verifyWhenStated(assignments, context) {
129
- let verifiesWhenStated = false;
129
+ let verifiesWhenStated;
130
130
 
131
131
  const propertyAssertionString = this.getString(); ///
132
132
 
@@ -6,8 +6,8 @@ import Assertion from "../assertion";
6
6
  import { define } from "../../elements";
7
7
 
8
8
  export default define(class SatisfiesAssertion extends Assertion {
9
- constructor(string, node, signature, reference) {
10
- super(string, node);
9
+ constructor(context, string, node, signature, reference) {
10
+ super(context, string, node);
11
11
 
12
12
  this.signature = signature;
13
13
  this.reference = reference;
@@ -97,9 +97,9 @@ export default define(class SatisfiesAssertion extends Assertion {
97
97
 
98
98
  substitutions = Substitutions.fromNothing();
99
99
 
100
- const signatureMatches = axiom.matchSignature(this.signature, substitutions, context);
100
+ const axiomComparesToSignature = axiom.compareSignature(this.signature, substitutions, context);
101
101
 
102
- if (signatureMatches) {
102
+ if (axiomComparesToSignature) {
103
103
  const substitutionsB = substitutions; ///
104
104
 
105
105
  substitutions = Substitutions.fromNothing();
@@ -108,9 +108,9 @@ export default define(class SatisfiesAssertion extends Assertion {
108
108
 
109
109
  if (statementUnifies) {
110
110
  const substitutionsA = substitutions, ///
111
- substitutionsMatch = substitutionsA.correlateSubstitutions(substitutionsB);
111
+ substitutionsCorrelate = substitutionsA.correlateSubstitutions(substitutionsB);
112
112
 
113
- if (!substitutionsMatch) {
113
+ if (!substitutionsCorrelate) {
114
114
  const substitutionsAString = substitutionsA.asString(),
115
115
  substitutionsBString = substitutionsB.asString();
116
116
 
@@ -10,8 +10,8 @@ import { unifyStatement } from "../../process/unify";
10
10
  const { match } = arrayUtilities;
11
11
 
12
12
  export default define(class SubproofAssertion extends Assertion {
13
- constructor(string, node, statements) {
14
- super(string, node);
13
+ constructor(context, string, node, statements) {
14
+ super(context, string, node);
15
15
 
16
16
  this.statements = statements;
17
17
  }
@@ -20,38 +20,40 @@ export default define(class SubproofAssertion extends Assertion {
20
20
  return this.statements;
21
21
  }
22
22
 
23
- verify(assignments, stated, context) {
24
- let verifies;
23
+ validate(assignments, stated, context) {
24
+ let validates = false;
25
25
 
26
26
  const subproofAssertionString = this.getString(); ///
27
27
 
28
- context.trace(`Verifying the '${subproofAssertionString}' subproof assertion...`);
28
+ context.trace(`Validating the '${subproofAssertionString}' subproof assertion...`);
29
29
 
30
- const statementsVerify = this.verifyStatements(assignments, stated, context);
30
+ const statementsValidate = this.validateStatements(assignments, stated, context);
31
31
 
32
- verifies = statementsVerify; ///
32
+ if (statementsValidate) {
33
+ validates = true;
34
+ }
33
35
 
34
- if (verifies) {
35
- context.debug(`...verified the '${subproofAssertionString}' subproof assertion.`);
36
+ if (validates) {
37
+ context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
36
38
  }
37
39
 
38
- return verifies;
40
+ return validates;
39
41
  }
40
42
 
41
- verifyStatements(assignments, stated, context) {
43
+ validateStatements(assignments, stated, context) {
42
44
  stated = true; ///
43
45
 
44
46
  assignments = null; ///
45
47
 
46
- const statementsVerify = this.statements.map((statement) => {
47
- const statementVerifies = statement.verify(assignments, stated, context);
48
+ const statementsValidate = this.statements.map((statement) => {
49
+ const statementValidates = statement.validate(assignments, stated, context);
48
50
 
49
- if (statementVerifies) {
51
+ if (statementValidates) {
50
52
  return true;
51
53
  }
52
54
  });
53
55
 
54
- return statementsVerify;
56
+ return statementsValidate;
55
57
  }
56
58
 
57
59
  unifySubproof(subproof, substitutions, generalContext, specificContext) {
@@ -7,8 +7,8 @@ import { define } from "../../elements";
7
7
  import { variableAssignmentFromVariable } from "../../process/assign";
8
8
 
9
9
  export default define(class TypeAssertion extends Assertion {
10
- constructor(string, node, term, type) {
11
- super(string, node);
10
+ constructor(context, string, node, term, type) {
11
+ super(context, string, node);
12
12
 
13
13
  this.term = term;
14
14
  this.type = type;
@@ -6,6 +6,4 @@ export default class Assertion extends Element {
6
6
  constructor(context, string, node) {
7
7
  super(context, string, node);
8
8
  }
9
-
10
- matchAssertionNode(assertionNode) { return this.node.match(assertionNode); }
11
9
  }
@@ -31,13 +31,13 @@ export default define(class Assumption extends Element {
31
31
  return simple;
32
32
  }
33
33
 
34
- matchSubstitution(substitution, context) {
35
- let substitutionMatches = false;
34
+ compareSubstitution(substitution, context) {
35
+ let comparesToSubstituion = false;
36
36
 
37
37
  const assumptionString = this.string, ///
38
38
  substitutionString = substitution.getString();
39
39
 
40
- context.trace(`Matching the '${substitutionString}' substitution against the '${assumptionString}' assumption...`);
40
+ context.trace(`Comparing the '${assumptionString}' assumption to the '${substitutionString}' substitution...`);
41
41
 
42
42
  const simple = this.isSimple();
43
43
 
@@ -46,9 +46,12 @@ export default define(class Assumption extends Element {
46
46
  judgement = context.findJudgementByMetavariable(metavariable);
47
47
 
48
48
  if (judgement !== null) {
49
- const assumption = judgement.getDeclaration();
49
+ const assumption = judgement.getDeclaration(),
50
+ assumptionComaresToSubstitution = assumption.compareSubstitution(substitution, context);
50
51
 
51
- substitutionMatches = assumption.matchSubstitution(substitution, context);
52
+ if (assumptionComaresToSubstitution) {
53
+ comparesToSubstituion = true;
54
+ }
52
55
  }
53
56
  } else {
54
57
  const statement = substitution.getStatement(),
@@ -57,15 +60,15 @@ export default define(class Assumption extends Element {
57
60
  referenceMetavariableEqualToMetavariable = this.reference.isMetavariableEqualToMetavariable(metavariable);
58
61
 
59
62
  if (statementEqualToStatement && referenceMetavariableEqualToMetavariable) {
60
- substitutionMatches = true;
63
+ comparesToSubstituion = true;
61
64
  }
62
65
  }
63
66
 
64
- if (substitutionMatches) {
65
- context.debug(`...matches the '${assumptionString}' substitution against the '${substitutionString}' assumption.`);
67
+ if (comparesToSubstituion) {
68
+ context.debug(`...compared the '${substitutionString}' assumption to the '${assumptionString}' substitution.`);
66
69
  }
67
70
 
68
- return substitutionMatches;
71
+ return comparesToSubstituion;
69
72
  }
70
73
 
71
74
  verify(assignments, stated, context) {
@@ -85,9 +88,9 @@ export default define(class Assumption extends Element {
85
88
  const referenceVerified = this.verifyReference(assignments, stated, context);
86
89
 
87
90
  if (referenceVerified) {
88
- const statementVerifies = this.verifyStatement(assignments, stated, context);
91
+ const statementValidates = this.validateStatement(assignments, stated, context);
89
92
 
90
- if (statementVerifies) {
93
+ if (statementValidates) {
91
94
  let verifiesWhenStated = false,
92
95
  verifiesWhenDerived = false;
93
96
 
@@ -128,28 +131,28 @@ export default define(class Assumption extends Element {
128
131
  return referenceVerified;
129
132
  }
130
133
 
131
- verifyStatement(assignments, stated, context) {
132
- let statementVerifies;
134
+ validateStatement(assignments, stated, context) {
135
+ let statementValidates;
133
136
 
134
137
  if (this.statement === null) {
135
- statementVerifies = true;
138
+ statementValidates = true;
136
139
  } else {
137
140
  const statementString = this.statement.getString();
138
141
 
139
- context.trace(`Verifying the '${statementString}' statement...`);
142
+ context.trace(`Validating the '${statementString}' statement...`);
140
143
 
141
144
  stated = true; ///
142
145
 
143
146
  assignments = null; ///
144
147
 
145
- statementVerifies = this.statement.verify(assignments, stated, context);
148
+ statementValidates = this.statement.validate(assignments, stated, context);
146
149
 
147
- if (statementVerifies) {
148
- context.debug(`...verified the '${statementString}' statement.`);
150
+ if (statementValidates) {
151
+ context.debug(`...validated the '${statementString}' statement.`);
149
152
  }
150
153
  }
151
154
 
152
- return statementVerifies;
155
+ return statementValidates;
153
156
  }
154
157
 
155
158
  verifyReferenceAsMetavariable(assignments, stated, context) {
@@ -56,8 +56,8 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
56
56
  return signatureVerifies;
57
57
  }
58
58
 
59
- matchSignature(signature, substitutions, context) {
60
- let signatureMatches = false;
59
+ compareSignature(signature, substitutions, context) {
60
+ let comparesToSignature = false;
61
61
 
62
62
  const satisfiable = this.isSatisfiable();
63
63
 
@@ -73,10 +73,10 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
73
73
 
74
74
  const generalContext = context; ///
75
75
 
76
- signatureMatches = signatureA.match(signatureB, substitutions, generalContext, specificContext);
76
+ comparesToSignature = signatureA.compare(signatureB, substitutions, generalContext, specificContext);
77
77
  }
78
78
 
79
- return signatureMatches;
79
+ return comparesToSignature;
80
80
  }
81
81
 
82
82
  unifyStep(step, substitutions, context) {
@@ -93,7 +93,7 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
93
93
  const unconditional = this.isUnconditional();
94
94
 
95
95
  if (!unconditional) {
96
- context.trace(`Cannot unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional.`, node);
96
+ context.trace(`Unable to unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional.`, node);
97
97
  } else {
98
98
  const statement = step.getStatement(),
99
99
  statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
@@ -110,29 +110,6 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
110
110
  return stepUnifies;
111
111
  }
112
112
 
113
- unifyLastStep(lastStep, substitutions, context) {
114
- let lastStepUnifies = false;
115
-
116
- const node = this.getNode(),
117
- axiomString = this.getString(),
118
- lastStepString = lastStep.getString();
119
-
120
- context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`, node)
121
-
122
- const statement = lastStep.getStatement(),
123
- statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
124
-
125
- if (statementUnifiesWithDeduction) {
126
- lastStepUnifies = true;
127
- }
128
-
129
- if (lastStepUnifies) {
130
- context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`, node)
131
- }
132
-
133
- return lastStepUnifies;
134
- }
135
-
136
113
  unifySubproof(subproof, substitutions, context) {
137
114
  let subproofUnifies = false;
138
115
 
@@ -145,12 +122,12 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
145
122
  const unconditional = this.isUnconditional();
146
123
 
147
124
  if (unconditional) {
148
- context.trace(`Cannot unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
125
+ context.trace(`Unable to unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
149
126
  } else {
150
- const lastStep = subproof.getLastStep(),
151
- lastStepUnifies = this.unifyLastStep(lastStep, substitutions, context);
127
+ const lastProofAssertion = subproof.getLastProofAssertion(),
128
+ lastProofAssertionUnifies = this.unifyLastProofAssertion(lastProofAssertion, substitutions, context);
152
129
 
153
- if (lastStepUnifies) {
130
+ if (lastProofAssertionUnifies) {
154
131
  const suppositions = subproof.getSuppositions(),
155
132
  suppositionsUnify = this.unifySuppositions(suppositions, substitutions, context);
156
133
 
@@ -213,22 +190,41 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
213
190
  if (generalSuppositionsLength === specificSuppositionsLength) {
214
191
  suppositions = specificSuppositions; ///
215
192
 
216
- const suppositionsMatch = suppositions.every((supposition, index) => {
193
+ suppositionsUnify = suppositions.every((supposition, index) => {
217
194
  const suppositionUnifies = this.unifySupposition(supposition, index, substitutions, generalContext, specificContext);
218
195
 
219
196
  if (suppositionUnifies) {
220
197
  return true;
221
198
  }
222
199
  });
223
-
224
- if (suppositionsMatch) {
225
- suppositionsUnify = true;
226
- }
227
200
  }
228
201
 
229
202
  return suppositionsUnify;
230
203
  }
231
204
 
205
+ unifyLastProofAssertion(lastProofAssertion, substitutions, context) {
206
+ let lastProofAssertionUnifies = false;
207
+
208
+ const node = this.getNode(),
209
+ axiomString = this.getString(),
210
+ lastProofAssertionString = lastProofAssertion.getString();
211
+
212
+ context.trace(`Unifying the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom...`, node)
213
+
214
+ const statement = lastProofAssertion.getStatement(),
215
+ statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
216
+
217
+ if (statementUnifiesWithDeduction) {
218
+ lastProofAssertionUnifies = true;
219
+ }
220
+
221
+ if (lastProofAssertionUnifies) {
222
+ context.debug(`...unified the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom.`, node)
223
+ }
224
+
225
+ return lastProofAssertionUnifies;
226
+ }
227
+
232
228
  unifyAxiomLemmaTheoremOrConjecture(axiomLemmaTheoremOrConjecture, substitutions, context) {
233
229
  let axiomLemmaTheoremOrConjectureUnifies = false;
234
230
 
@@ -81,16 +81,45 @@ export default class AxiomLemmaTheoremConjecture extends Element {
81
81
  return supposition;
82
82
  }
83
83
 
84
- matchMetavariableName(metavariableName) {
85
- const metavariableNameMatches = this.labels.some((label) => {
86
- const metavariableNameMatches = label.matchMetavariableName(metavariableName);
84
+ compareMetavariableName(metavariableName) {
85
+ const comparesToMetavariableName = this.labels.some((label) => {
86
+ const labelComparesToMetavariableName = label.compareMetavariableName(metavariableName);
87
87
 
88
- if (metavariableNameMatches) {
88
+ if (labelComparesToMetavariableName) {
89
89
  return true;
90
90
  }
91
91
  });
92
92
 
93
- return metavariableNameMatches;
93
+ return comparesToMetavariableName;
94
+ }
95
+
96
+ correlateHypotheses(context) {
97
+ let correlatesToHypotheses;
98
+
99
+ const hypothetical = this.isHypothetical();
100
+
101
+ if (hypothetical) {
102
+ const proofAssertions = context.getProofAssertions(),
103
+ axiomLemmaTheoremConjectureString = this.getString(); ///
104
+
105
+ context.trace(`Correlating the hypotheses of the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`, this.node);
106
+
107
+ correlatesToHypotheses = correlate(this.hypotheses, proofAssertions, (hypothesis, proofAssertion) => {
108
+ const hypothesesComparesToStep = hypothesis.compareProofAssertion(proofAssertion, context);
109
+
110
+ if (hypothesesComparesToStep) {
111
+ return true;
112
+ }
113
+ });
114
+
115
+ if (correlatesToHypotheses) {
116
+ context.debug(`...correlated the hypotheses of the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture.`, this.node);
117
+ }
118
+ } else {
119
+ correlatesToHypotheses = true
120
+ }
121
+
122
+ return correlatesToHypotheses;
94
123
  }
95
124
 
96
125
  verify() {
@@ -171,35 +200,6 @@ export default class AxiomLemmaTheoremConjecture extends Element {
171
200
  return proofVerifies;
172
201
  }
173
202
 
174
- correlateHypotheses(context) {
175
- let hypothesesCorrelate;
176
-
177
- const hypothetical = this.isHypothetical();
178
-
179
- if (hypothetical) {
180
- const steps = context.getSteps(),
181
- topLevelAssertionString = this.string; ///
182
-
183
- context.trace(`Correlating the hypotheses of the '${topLevelAssertionString}' axiom, lemma, theorem or conjecture...`, this.node);
184
-
185
- hypothesesCorrelate = correlate(this.hypotheses, steps, (hypothesis, step) => {
186
- const hypothesesEqualToStep = hypothesis.isEqualToStep(step, context);
187
-
188
- if (hypothesesEqualToStep) {
189
- return true;
190
- }
191
- });
192
-
193
- if (hypothesesCorrelate) {
194
- context.debug(`...correlated the hypotheses of the '${topLevelAssertionString}' axiom, lemma, theorem or conjecture.`, this.node);
195
- }
196
- } else {
197
- hypothesesCorrelate = true
198
- }
199
-
200
- return hypothesesCorrelate;
201
- }
202
-
203
203
  unifyStatementWithDeduction(statement, substitutions, context) {
204
204
  let statementUnifiesWithDeduction = false;
205
205
 
@@ -212,18 +212,18 @@ export default class AxiomLemmaTheoremConjecture extends Element {
212
212
  return statementUnifiesWithDeduction;
213
213
  }
214
214
 
215
- unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context) {
215
+ unifyStatementAndStepsOrSubproofs(statement, subproofOrProofAssertions, substitutions, context) {
216
216
  let statementAndStepsOrSubproofsUnifies = false;
217
217
 
218
- const hypothesesCorrelate = this.correlateHypotheses(context);
218
+ const correlatesToHypotheses = this.correlateHypotheses(context);
219
219
 
220
- if (hypothesesCorrelate) {
220
+ if (correlatesToHypotheses) {
221
221
  const statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
222
222
 
223
223
  if (statementUnifiesWithDeduction) {
224
- const stepsOrSubproofsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, context);
224
+ const subproofOrProofAssertionsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, context);
225
225
 
226
- if (stepsOrSubproofsUnifyWithSuppositions) {
226
+ if (subproofOrProofAssertionsUnifyWithSuppositions) {
227
227
  const substitutionsResolved = substitutions.areResolved();
228
228
 
229
229
  if (substitutionsResolved) {
@@ -236,43 +236,43 @@ export default class AxiomLemmaTheoremConjecture extends Element {
236
236
  return statementAndStepsOrSubproofsUnifies;
237
237
  }
238
238
 
239
- unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext) {
240
- let stepsOrSubproofsUnifiesWithSupposition = false;
239
+ unifyStepsOrSubproofsWithSupposition(subproofOrProofAssertions, supposition, substitutions, generalContext, specificContext) {
240
+ let subproofOrProofAssertionsUnifiesWithSupposition = false;
241
241
 
242
242
  const context = specificContext, ///
243
243
  suppositionUnifiesIndependently = supposition.unifyIndependently(substitutions, context);
244
244
 
245
245
  if (suppositionUnifiesIndependently) {
246
- stepsOrSubproofsUnifiesWithSupposition = true;
246
+ subproofOrProofAssertionsUnifiesWithSupposition = true;
247
247
  } else {
248
- const stepOrSubproof = extract(stepsOrSubproofs, (stepOrSubproof) => {
249
- const stepOrSubproofUnifies = supposition.unifyStepOrSubproof(stepOrSubproof, substitutions, generalContext, specificContext);
248
+ const subproofOrProofAssertion = extract(subproofOrProofAssertions, (subproofOrProofAssertion) => {
249
+ const subproofOrProofAssertionUnifies = supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, substitutions, generalContext, specificContext);
250
250
 
251
- if (stepOrSubproofUnifies) {
251
+ if (subproofOrProofAssertionUnifies) {
252
252
  return true;
253
253
  }
254
254
  }) || null;
255
255
 
256
- if (stepOrSubproof !== null) {
257
- stepsOrSubproofsUnifiesWithSupposition = true;
256
+ if (subproofOrProofAssertion !== null) {
257
+ subproofOrProofAssertionsUnifiesWithSupposition = true;
258
258
  }
259
259
  }
260
260
 
261
- return stepsOrSubproofsUnifiesWithSupposition;
261
+ return subproofOrProofAssertionsUnifiesWithSupposition;
262
262
  }
263
263
 
264
- unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, generalContext, specificContext) {
265
- stepsOrSubproofs = reverse(stepsOrSubproofs); ///
264
+ unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, generalContext, specificContext) {
265
+ subproofOrProofAssertions = reverse(subproofOrProofAssertions); ///
266
266
 
267
- const stepsOrSubproofsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
268
- const stepsOrSubproofsUnifiesWithSupposition = this.unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext);
267
+ const subproofOrProofAssertionsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
268
+ const subproofOrProofAssertionsUnifiesWithSupposition = this.unifyStepsOrSubproofsWithSupposition(subproofOrProofAssertions, supposition, substitutions, generalContext, specificContext);
269
269
 
270
- if (stepsOrSubproofsUnifiesWithSupposition) {
270
+ if (subproofOrProofAssertionsUnifiesWithSupposition) {
271
271
  return true;
272
272
  }
273
273
  });
274
274
 
275
- return stepsOrSubproofsUnifyWithSuppositions;
275
+ return subproofOrProofAssertionsUnifyWithSuppositions;
276
276
  }
277
277
 
278
278
  toJSON() {
@@ -310,23 +310,4 @@ export default class AxiomLemmaTheoremConjecture extends Element {
310
310
 
311
311
  return axiomLemmaTheoremConjecture;
312
312
  }
313
-
314
- static fromNode(Class, node, context) {
315
- const topLevelAssertionNode = node, ///
316
- proofNode = topLevelAssertionNode.getProofNode(),
317
- labelNodes = topLevelAssertionNode.getLabelNodes(),
318
- deductionNode = topLevelAssertionNode.getDeductionNode(),
319
- suppositionNodes = topLevelAssertionNode.getSuppositionNodes(),
320
- signatureNode = topLevelAssertionNode.getSignatureNode(),
321
- proof = proofFromProofNode(proofNode, context),
322
- labels = labelsFromLabelNodes(labelNodes, context),
323
- deduction = deductionFromDeductionNode(deductionNode, context),
324
- suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context),
325
- signature = signatureFromSignatureNode(signatureNode, context),
326
- hypotheses = [],
327
- string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
328
- axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
329
-
330
- return axiomLemmaTheoremConjecture;
331
- }
332
313
  }