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
@@ -42,16 +42,16 @@ export default define(class Rule extends Element {
42
42
  return this.conclusion;
43
43
  }
44
44
 
45
- matchMetavariableName(metavariableName) {
46
- const metavariableNameMatches = this.labels.some((label) => {
47
- const metavariableNameMatches = label.matchMetavariableName(metavariableName);
45
+ compareMetavariableName(metavariableName) {
46
+ const comparesToMetavariableName = this.labels.some((label) => {
47
+ const labelComparesToMetavariableName = label.compareMetavariableName(metavariableName);
48
48
 
49
- if (metavariableNameMatches) {
49
+ if (labelComparesToMetavariableName) {
50
50
  return true;
51
51
  }
52
52
  });
53
53
 
54
- return metavariableNameMatches;
54
+ return comparesToMetavariableName;
55
55
  }
56
56
 
57
57
  verify() {
@@ -74,16 +74,17 @@ export default define(class Rule extends Element {
74
74
 
75
75
  context = localContext; ///
76
76
 
77
- const premisesValidate = this.validatePremises(context);
77
+ const premisesVerify = this.verifyPremises(context);
78
78
 
79
- if (premisesValidate) {
79
+ if (premisesVerify) {
80
80
  const conclusionVerifies = this.verifyConclusion(context);
81
81
 
82
82
  if (conclusionVerifies) {
83
83
  const proofVerifies = this.verifyProof(context);
84
84
 
85
85
  if (proofVerifies) {
86
- const rule = this; ///
86
+ const rule = this, ///
87
+ context = this.getContext();
87
88
 
88
89
  context.addRule(rule);
89
90
 
@@ -113,22 +114,22 @@ export default define(class Rule extends Element {
113
114
  return labelsVerify;
114
115
  }
115
116
 
116
- validatePremises(context) {
117
- const premisesValidate = this.premises.every((premise) => {
118
- const premiseValidates = this.validatePremise(premise, context);
117
+ verifyPremises(context) {
118
+ const premisesVerify = this.premises.every((premise) => {
119
+ const premiseVerifies = this.verifyPremise(premise, context);
119
120
 
120
- if (premiseValidates) {
121
+ if (premiseVerifies) {
121
122
  return true;
122
123
  }
123
124
  });
124
125
 
125
- return premisesValidate;
126
+ return premisesVerify;
126
127
  }
127
128
 
128
- validatePremise(premise, context) {
129
- const premiseValidates = premise.validate(context);
129
+ verifyPremise(premise, context) {
130
+ const premiseVerifies = premise.verify(context);
130
131
 
131
- return premiseValidates;
132
+ return premiseVerifies;
132
133
  }
133
134
 
134
135
  verifyConclusion(context) {
@@ -164,68 +165,68 @@ export default define(class Rule extends Element {
164
165
  return statementUnifiesWithConclusion;
165
166
  }
166
167
 
167
- unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, context) {
168
- let statementAndStepsOrSubproofsUnify = false;
168
+ unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context) {
169
+ let statementAndSubproofOrProofAssertionsUnify = false;
169
170
 
170
171
  const { Substitutions } = elements,
171
172
  substitutions = Substitutions.fromNothing(),
172
173
  statementUnifiesWithConclusion = this.unifyStatementWithConclusion(statement, substitutions, context);
173
174
 
174
175
  if (statementUnifiesWithConclusion) {
175
- const stepsOrSubproofsUnifiesWithPremises = this.unifyStepsOrSubproofsWithPremises(stepsOrSubproofs, substitutions, context);
176
+ const subproofOrProofAssertionsUnifiesWithPremises = this.unifySubproofOrProofAssertionsWithPremises(subproofOrProofAssertions, substitutions, context);
176
177
 
177
- if (stepsOrSubproofsUnifiesWithPremises) {
178
+ if (subproofOrProofAssertionsUnifiesWithPremises) {
178
179
  const substitutionsResolved = substitutions.areResolved();
179
180
 
180
181
  if (substitutionsResolved) {
181
- statementAndStepsOrSubproofsUnify = true;
182
+ statementAndSubproofOrProofAssertionsUnify = true;
182
183
  }
183
184
  }
184
185
  }
185
186
 
186
- return statementAndStepsOrSubproofsUnify;
187
+ return statementAndSubproofOrProofAssertionsUnify;
187
188
  }
188
189
 
189
- unifyStepsOrSubproofsWithPremise(stepsOrSubproofs, premise, substitutions, context) {
190
- let stepsOrSubproofsUnifiesWithPremise = false;
190
+ unifySubproofOrProofAssertionsWithPremise(subproofOrProofAssertions, premise, substitutions, context) {
191
+ let subproofOrProofAssertionsUnifiesWithPremise = false;
191
192
 
192
- if (!stepsOrSubproofsUnifiesWithPremise) {
193
+ if (!subproofOrProofAssertionsUnifiesWithPremise) {
193
194
  const premiseUnifiesIndependently = premise.unifyIndependently(substitutions, context);
194
195
 
195
196
  if (premiseUnifiesIndependently) {
196
- stepsOrSubproofsUnifiesWithPremise = true;
197
+ subproofOrProofAssertionsUnifiesWithPremise = true;
197
198
  }
198
199
  }
199
200
 
200
- if (!stepsOrSubproofsUnifiesWithPremise) {
201
- const stepOrSubproof = extract(stepsOrSubproofs, (stepOrSubproof) => {
202
- const stepOrSubproofUnifies = premise.unifyStepOrSubproof(stepOrSubproof, substitutions, context);
201
+ if (!subproofOrProofAssertionsUnifiesWithPremise) {
202
+ const subproofOrProofAssertion = extract(subproofOrProofAssertions, (subproofOrProofAssertion) => {
203
+ const subproofOrProofAssertionUnifies = premise.unifySubproofOrProofAssertion(subproofOrProofAssertion, substitutions, context);
203
204
 
204
- if (stepOrSubproofUnifies) {
205
+ if (subproofOrProofAssertionUnifies) {
205
206
  return true;
206
207
  }
207
208
  }) || null;
208
209
 
209
- if (stepOrSubproof !== null) {
210
- stepsOrSubproofsUnifiesWithPremise = true;
210
+ if (subproofOrProofAssertion !== null) {
211
+ subproofOrProofAssertionsUnifiesWithPremise = true;
211
212
  }
212
213
  }
213
214
 
214
- return stepsOrSubproofsUnifiesWithPremise;
215
+ return subproofOrProofAssertionsUnifiesWithPremise;
215
216
  }
216
217
 
217
- unifyStepsOrSubproofsWithPremises(stepsOrSubproofs, substitutions, context) {
218
- stepsOrSubproofs = reverse(stepsOrSubproofs); ///
218
+ unifySubproofOrProofAssertionsWithPremises(subproofOrProofAssertions, substitutions, context) {
219
+ subproofOrProofAssertions = reverse(subproofOrProofAssertions); ///
219
220
 
220
- const stepsOrSubproofsUnifiesWithPremises = backwardsEvery(this.premises, (premise) => {
221
- const stepUnifiesWithPremise = this.unifyStepsOrSubproofsWithPremise(stepsOrSubproofs, premise, substitutions, context);
221
+ const subproofOrProofAssertionsUnifiesWithPremises = backwardsEvery(this.premises, (premise) => {
222
+ const stepUnifiesWithPremise = this.unifySubproofOrProofAssertionsWithPremise(subproofOrProofAssertions, premise, substitutions, context);
222
223
 
223
224
  if (stepUnifiesWithPremise) {
224
225
  return true;
225
226
  }
226
227
  });
227
228
 
228
- return stepsOrSubproofsUnifiesWithPremises;
229
+ return subproofOrProofAssertionsUnifiesWithPremises;
229
230
  }
230
231
 
231
232
  toJSON() {
@@ -27,7 +27,7 @@ export default define(class Signature extends Element {
27
27
 
28
28
  const signatureString = this.string; ///
29
29
 
30
- context.trace(`Verifying the ${signatureString} signature...`);
30
+ context.trace(`Verifying the '${signatureString}' signature...`);
31
31
 
32
32
  verifies = this.terms.every((term) => {
33
33
  const termVerifies = term.verify(context, () => {
@@ -42,13 +42,13 @@ export default define(class Signature extends Element {
42
42
  });
43
43
 
44
44
  if (verifies) {
45
- context.debug(`...verified the ${signatureString} signature.`);
45
+ context.debug(`...verified the '${signatureString}' signature.`);
46
46
  }
47
47
 
48
48
  return verifies;
49
49
  }
50
50
 
51
- match(signature, substitutions, generalContext, specificContext) {
51
+ compare(signature, substitutions, generalContext, specificContext) {
52
52
  const terms = signature.getTerms(),
53
53
  termsA = this.terms, ///
54
54
  termsB = terms, ///
@@ -74,9 +74,10 @@ export default define(class Signature extends Element {
74
74
  return true;
75
75
  }
76
76
  }
77
- });
77
+ }),
78
+ compares = matches; ///
78
79
 
79
- return matches;
80
+ return compares;
80
81
  }
81
82
 
82
83
  compareSubstitutions(substitutions, context) {
@@ -85,7 +86,7 @@ export default define(class Signature extends Element {
85
86
  const signatureString = this.string, ///
86
87
  substitutionsString = substitutions.asString();
87
88
 
88
- context.trace(`Comparing the '${substitutionsString}' substitutions against the ${signatureString} signature...`);
89
+ context.trace(`Comparing the '${substitutionsString}' substitutions against the '${signatureString}' signature...`);
89
90
 
90
91
  const array = substitutions.getArray(),
91
92
  compares = compare(this.terms, array, (term, substitution) => {
@@ -102,7 +103,7 @@ export default define(class Signature extends Element {
102
103
  }
103
104
 
104
105
  if (substitutionsCompares) {
105
- context.debug(`...compared the '${substitutionsString}' substitutions against the ${signatureString} signature.`);
106
+ context.debug(`...compared the '${substitutionsString}' substitutions against the '${signatureString}' signature.`);
106
107
  }
107
108
 
108
109
  return substitutionsCompares;
@@ -114,7 +115,7 @@ export default define(class Signature extends Element {
114
115
  const signatureString = this.string, ///
115
116
  substitutionsString = substitutions.asString();
116
117
 
117
- context.trace(`Correlating the '${substitutionsString}' substitutions against the ${signatureString} signature...`);
118
+ context.trace(`Correlating the '${substitutionsString}' substitutions against the '${signatureString}' signature...`);
118
119
 
119
120
  const array = substitutions.getArray(),
120
121
  correlates = correlate(this.terms, array, (term, substitution) => {
@@ -131,7 +132,7 @@ export default define(class Signature extends Element {
131
132
  }
132
133
 
133
134
  if (substitutionsCorrelates) {
134
- context.debug(`...correlated the '${substitutionsString}' substitutions against the ${signatureString} signature.`);
135
+ context.debug(`...correlated the '${substitutionsString}' substitutions against the '${signatureString}' signature.`);
135
136
  }
136
137
 
137
138
  return substitutionsCorrelates;
@@ -3,10 +3,10 @@
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
5
  import Element from "../element";
6
- import validateMixins from "../mixins/statement/validate";
7
6
 
8
7
  import { define } from "../elements";
9
8
  import { unifyStatement } from "../process/unify";
9
+ import { validateStatements } from "../utilities/validation";
10
10
  import { instantiateStatement } from "../process/instantiate";
11
11
  import { STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
12
12
 
@@ -47,14 +47,13 @@ export default define(class Statement extends Element {
47
47
 
48
48
  context.trace(`Is the '${termString}' term contained in the '${statementString}' statement...`, node);
49
49
 
50
- const termNode = term.getNode(),
51
- statementNode = node, ///
50
+ const statementNode = node, ///
52
51
  statementNodeTermNodes = statementNode.getTermNodes();
53
52
 
54
53
  termContained = statementNodeTermNodes.some((statementNodeTermNode) => { ///
55
- const termNodeMatchesStatementNodeTermNode = termNode.match(statementNodeTermNode);
54
+ const statementNodeTermNodeMatches = term.matchNode(statementNodeTermNode);
56
55
 
57
- if (termNodeMatchesStatementNodeTermNode) {
56
+ if (statementNodeTermNodeMatches) {
58
57
  return true;
59
58
  }
60
59
  });
@@ -75,14 +74,13 @@ export default define(class Statement extends Element {
75
74
 
76
75
  context.trace(`Is the '${frameString}' frame contained in the '${statementString}' statement...`, node);
77
76
 
78
- const frameNode = frame.getNode(),
79
- statementNode = node,
77
+ const statementNode = node,
80
78
  statementNodeFrameNodes = statementNode.getFrameNodes();
81
79
 
82
80
  frameContained = statementNodeFrameNodes.some((statementNodeFrameNode) => { ///
83
- const frameNodeMatchesStatementNodeFrameNode = frameNode.match(statementNodeFrameNode);
81
+ const statementNodeFrameNodeMatches = frame.matchNode(statementNodeFrameNode);
84
82
 
85
- if (frameNodeMatchesStatementNodeFrameNode) {
83
+ if (statementNodeFrameNodeMatches) {
86
84
  return true;
87
85
  }
88
86
  });
@@ -124,11 +122,11 @@ export default define(class Statement extends Element {
124
122
 
125
123
  context.trace(`Validating the '${statementString}' statement...`, node);
126
124
 
127
- validates = validateMixins.some((validateMixin) => {
125
+ validates = validateStatements.some((validateStatement) => {
128
126
  const statement = this, ///
129
- validates = validateMixin(statement, assignments, stated, context);
127
+ statementValidates = validateStatement(statement, assignments, stated, context);
130
128
 
131
- if (validates) {
129
+ if (statementValidates) {
132
130
  return true;
133
131
  }
134
132
  });
@@ -256,19 +254,19 @@ export default define(class Statement extends Element {
256
254
  return unifiesIndependently;
257
255
  }
258
256
 
259
- equateWithStepsOrSubproofs(stepsOrSubproofs, context) {
260
- let equatesWithStepsOrSubproofs;
257
+ compareSubproofOrProofAssertions(subproofOrProofAssertions, context) {
258
+ let comparesToSubproofOrProofAssertions;
261
259
 
262
- equatesWithStepsOrSubproofs = backwardsSome(stepsOrSubproofs, (stepOrSubproof) => {
260
+ comparesToSubproofOrProofAssertions = backwardsSome(subproofOrProofAssertions, (subproofOrProofAssertion) => {
263
261
  const statement = this, ///
264
- statementUnifies = stepOrSubproof.equateWithStatement(statement, context);
262
+ subproofOrProofAssertionComparesToStatement = subproofOrProofAssertion.compareStatement(statement, context);
265
263
 
266
- if (statementUnifies) {
264
+ if (subproofOrProofAssertionComparesToStatement) {
267
265
  return true;
268
266
  }
269
267
  });
270
268
 
271
- return equatesWithStepsOrSubproofs;
269
+ return comparesToSubproofOrProofAssertions;
272
270
  }
273
271
 
274
272
  toJSON() {
@@ -1,27 +1,21 @@
1
1
  "use strict";
2
2
 
3
- import Element from "../element";
4
3
  import elements from "../elements";
5
- import unifyMixins from "../mixins/step/unify";
4
+ import ProofAssertion from "./proofAssertion";
6
5
  import TemporaryContext from "../context/temporary";
7
6
 
8
7
  import { define } from "../elements";
9
- import { equateStatements } from "../process/equate";
8
+ import { unifyStatements } from "../utilities/unification";
10
9
  import { propertyAssertionFromStatement } from "../utilities/statement";
11
10
 
12
- export default define(class Step extends Element {
11
+ export default define(class Step extends ProofAssertion {
13
12
  constructor(context, string, node, statement, reference, satisfiesAssertion) {
14
- super(context, string, node);
13
+ super(context, string, node, statement);
15
14
 
16
- this.statement = statement;
17
15
  this.reference = reference;
18
16
  this.satisfiesAssertion = satisfiesAssertion;
19
17
  }
20
18
 
21
- getStatement() {
22
- return this.statement;
23
- }
24
-
25
19
  getReference() {
26
20
  return this.reference;
27
21
  }
@@ -49,112 +43,118 @@ export default define(class Step extends Element {
49
43
  return stated;
50
44
  }
51
45
 
52
- isStep() {
53
- const step = true;
54
-
55
- return step;
56
- }
46
+ compareTermAndPropertyRelation(term, propertyRelation, context) {
47
+ let comparesToTermAndPropertyRelation = false;
57
48
 
58
- matchTermAndPropertyRelation(term, propertyRelation, context) {
59
- let termAndPropertyRelationMatch = false;
60
-
61
- const propertyAssertion = propertyAssertionFromStatement(this.statement, context);
49
+ const statement = this.getStatement(),
50
+ propertyAssertion = propertyAssertionFromStatement(statement, context);
62
51
 
63
52
  if (propertyAssertion !== null) {
64
- termAndPropertyRelationMatch = propertyAssertion.matchTermAndPropertyRelation(term, propertyRelation, context);
53
+ comparesToTermAndPropertyRelation = propertyAssertion.compareTermAndPropertyRelation(term, propertyRelation, context);
65
54
  }
66
55
 
67
- return termAndPropertyRelationMatch;
56
+ return comparesToTermAndPropertyRelation;
68
57
  }
69
58
 
70
- validate(substitutions, assignments, context) {
71
- let validates = false;
59
+ verify(substitutions, assignments, context) {
60
+ let verifies = false;
72
61
 
73
62
  const temporaryContext = TemporaryContext.fromNothing(context);
74
63
 
75
64
  context = temporaryContext; ///
76
65
 
77
- const stepString = this.string; ///
66
+ const node = this.getNode(),
67
+ stepString = this.getString(); ///
78
68
 
79
- context.trace(`Validating the '${stepString}' step...`, this.node);
69
+ context.trace(`Verifying the '${stepString}' step...`, node);
80
70
 
81
- if (this.statement !== null) {
82
- const stated = this.isStated(),
83
- statementVerifies = this.statement.validate(assignments, stated, context);
71
+ const statement = this.getStatement();
84
72
 
85
- if (statementVerifies) {
86
- const qualified = this.isQualified(),
87
- satisfied = this.isSatisfied();
73
+ if (statement === null) {
74
+ context.debug(`Unable to verify the '${stepString}' step because it is nonsense.`, node);
75
+ } else {
76
+ const referenceVerifies = this.verifyReference(context);
88
77
 
89
- if (false) {
90
- ///
91
- } else if (qualified) {
92
- const referenceVerifies = this.reference.validate(context);
78
+ if (referenceVerifies) {
79
+ const satisfiesAssertioVeriries = this.verifySatisfiesAssertion(context);
93
80
 
94
- if (referenceVerifies) {
95
- validates = true;
96
- }
97
- } else if (satisfied) {
98
- const stated = true,
99
- assignments = null,
100
- satisfiesAssertionVerifies = this.satisfiesAssertion.validate(assignments, stated, context);
81
+ if (satisfiesAssertioVeriries) {
82
+ const stated = this.isStated(),
83
+ statementValidates = statement.validate(assignments, stated, context);
101
84
 
102
- if (satisfiesAssertionVerifies) {
103
- validates = true;
85
+ if (statementValidates) {
86
+ const statementUnifies = unifyStatements.some((unifyStatement) => {
87
+ const statementUnifies = unifyStatement(statement, this.reference, this.satisfiesAssertion, substitutions, context);
88
+
89
+ if (statementUnifies) {
90
+ return true;
91
+ }
92
+ });
93
+
94
+ if (statementUnifies) {
95
+ const subproofOrProofAssertion = this; ///
96
+
97
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
98
+
99
+ this.setContext(context);
100
+
101
+ verifies = true;
102
+ }
104
103
  }
105
- } else {
106
- validates = true;
107
104
  }
108
105
  }
109
- } else {
110
- context.debug(`Cannot validate the '${stepString}' step because it is nonsense.`, this.node);
111
106
  }
112
107
 
113
- if (validates) {
114
- this.context = context;
115
-
116
- context.debug(`...verified the '${stepString}' step.`, this.node);
108
+ if (verifies) {
109
+ context.debug(`...verified the '${stepString}' step.`, node);
117
110
  }
118
111
 
119
- return validates;
112
+ return verifies;
120
113
  }
121
114
 
122
- unify(substitutions, context) {
123
- let unifies;
124
-
125
- context = this.context;
126
-
127
- const stepString = this.string; ///
115
+ verifyReference(context) {
116
+ let referenceVeriries;
128
117
 
129
- context.trace(`Unifying the '${stepString}' step...`, this.node);
118
+ const node = this.getNode(),
119
+ stepString = this.getString(); ///
130
120
 
131
- unifies = unifyMixins.some((unifyMixin) => {
132
- const unifies = unifyMixin(this.statement, this.reference, this.satisfiesAssertion, substitutions, context);
121
+ context.trace(`Verifying the '${stepString}' step's reference... `, node);
133
122
 
134
- if (unifies) {
135
- return true;
136
- }
137
- });
123
+ if (this.reference !== null) {
124
+ referenceVeriries = this.reference.verify(context);
125
+ } else {
126
+ referenceVeriries = true;
127
+ }
138
128
 
139
- if (unifies) {
140
- context.debug(`...unified the '${stepString}' step.`, this.node);
129
+ if (referenceVeriries) {
130
+ context.debug(`...verified the '${stepString}' step's reference. `, node);
141
131
  }
142
132
 
143
- return unifies;
133
+ return referenceVeriries;
144
134
  }
145
135
 
146
- equateWithStatement(statement, context) {
147
- let statementEquates;
136
+ verifySatisfiesAssertion(context) {
137
+ let satisfiesAssertionVerifies;
148
138
 
149
- const leftStatement = statement, ///
150
- rightStatement = this.statement, ///
151
- leftStatementNode = leftStatement.getNode(),
152
- rightStatementNode = rightStatement.getNode(),
153
- statementsEquate = equateStatements(leftStatementNode, rightStatementNode, context);
139
+ const node = this.getNode(),
140
+ stepString = this.getString(); ///
154
141
 
155
- statementEquates = statementsEquate; ///
142
+ context.trace(`Verifying the '${stepString}' step's satisfies assertion... `, node);
143
+
144
+ if (this.satisfiesAssertion !== null) {
145
+ const stated = true,
146
+ assignments = null;
147
+
148
+ satisfiesAssertionVerifies = this.satisfiesAssertion.validate(assignments, stated, context);
149
+ } else {
150
+ satisfiesAssertionVerifies = true;
151
+ }
152
+
153
+ if (satisfiesAssertionVerifies) {
154
+ context.debug(`...verified the '${stepString}' step's satisfies assertion. `, node);
155
+ }
156
156
 
157
- return statementEquates;
157
+ return satisfiesAssertionVerifies;
158
158
  }
159
159
 
160
160
  unifyWithSatisfiesAssertion(satisfiesAssertion, context) {
@@ -10,41 +10,37 @@ import { define } from "../elements";
10
10
  const { last } = arrayUtilities;
11
11
 
12
12
  export default define(class SubDerivation extends Element {
13
- constructor(context, string, node, stepsOrSubproofs) {
13
+ constructor(context, string, node, subproofOrProofAssertions) {
14
14
  super(context, string, node);
15
15
 
16
- this.stepsOrSubproofs = stepsOrSubproofs;
16
+ this.subproofOrProofAssertions = subproofOrProofAssertions;
17
17
  }
18
18
 
19
- getStepsOrSubproofs() {
20
- return this.stepsOrSubproofs;
19
+ getSubproofOrProofAssertions() {
20
+ return this.subproofOrProofAssertions;
21
21
  }
22
22
 
23
- getLastStep() {
24
- const lastStepOrSubproof = last(this.stepsOrSubproofs),
25
- lastStep = lastStepOrSubproof; ///
23
+ getLastProofAssertion() {
24
+ const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
25
+ lastProofAssertion = lastSubproofOrProofAssertion; ///
26
26
 
27
- return lastStep;
27
+ return lastProofAssertion;
28
28
  }
29
29
 
30
30
  verify(substitutions, context) {
31
31
  let verifies;
32
32
 
33
- verifies = this.stepsOrSubproofs.every((stepOrSubproof) => { ///
33
+ verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
34
34
  const assignments = [],
35
- stepOrSubproofValidates = stepOrSubproof.validate(substitutions, assignments, context);
35
+ subproofOrProofAssertionVarifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
36
36
 
37
- if (stepOrSubproofValidates) {
38
- const stepOrSubproofUnifies = stepOrSubproof.unify(substitutions, context);
37
+ if (subproofOrProofAssertionVarifies) {
38
+ const assignmentsAssigned = assignAssignments(assignments, context);
39
39
 
40
- if (stepOrSubproofUnifies) {
41
- const assignmentsAssigned = assignAssignments(assignments, context);
40
+ if (assignmentsAssigned) {
41
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
42
42
 
43
- if (assignmentsAssigned) {
44
- context.addStepOrSubproof(stepOrSubproof);
45
-
46
- return true;
47
- }
43
+ return true;
48
44
  }
49
45
  }
50
46
  });
@@ -22,40 +22,32 @@ export default define(class Subproof extends Element {
22
22
  return this.subDerivation;
23
23
  }
24
24
 
25
- getLastStep() { return this.subDerivation.getLastStep(); }
25
+ getLastProofAssertion() { return this.subDerivation.getLastProofAssertion(); }
26
26
 
27
27
  getStatements() {
28
- const lastStep = this.getLastStep(),
28
+ const lastProofAssertion = this.getLastProofAssertion(),
29
29
  suppositionStatements = this.suppositions.map((supposition) => {
30
30
  const suppositionStatement = supposition.getStatement();
31
31
 
32
32
  return suppositionStatement;
33
33
  }),
34
- lastStepStatement = lastStep.getStatement(),
34
+ lastProofAssertionStatement = lastProofAssertion.getStatement(),
35
35
  statements = [
36
36
  ...suppositionStatements,
37
- lastStepStatement
37
+ lastProofAssertionStatement
38
38
  ];
39
39
 
40
40
  return statements;
41
41
  }
42
42
 
43
- isStep() {
44
- const sStep = false;
43
+ isProofAssertion() {
44
+ const proofAssertion = false;
45
45
 
46
- return sStep;
47
- }
48
-
49
- unify(substitutions, context) {
50
- let unifies;
51
-
52
- unifies = true; ///
53
-
54
- return unifies;
46
+ return proofAssertion;
55
47
  }
56
48
 
57
49
  verify(substitutions, assignments, context) {
58
- let subproofVerifies = false;
50
+ let verifies = false;
59
51
 
60
52
  const localContext = LocalContext.fromNothing(context); ///
61
53
 
@@ -73,14 +65,14 @@ export default define(class Subproof extends Element {
73
65
  const subDerivationVerifies = this.subDerivation.verify(substitutions, context);
74
66
 
75
67
  if (subDerivationVerifies) {
76
- subproofVerifies = true;
68
+ verifies = true;
77
69
  }
78
70
  }
79
71
 
80
- return subproofVerifies;
72
+ return verifies;
81
73
  }
82
74
 
83
- equateWithStatement(statement, context) {
75
+ compareStatement(statement, context) {
84
76
  const statementUnifies = false;
85
77
 
86
78
  return statementUnifies;