occam-verify-cli 1.0.437 → 1.0.444

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 (217) hide show
  1. package/lib/context/file.js +38 -35
  2. package/lib/context/local.js +10 -10
  3. package/lib/context/release.js +6 -6
  4. package/lib/context/temporary.js +14 -14
  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 +9 -12
  14. package/lib/element/axiomLemmaTheoremConjecture.js +32 -32
  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 +5 -8
  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 +3 -3
  32. package/lib/element/judgement.js +6 -4
  33. package/lib/element/label.js +16 -18
  34. package/lib/element/metaLemmaMetatheorem.js +5 -5
  35. package/lib/element/metaType.js +17 -80
  36. package/lib/element/metavariable.js +34 -34
  37. package/lib/element/parameter.js +3 -3
  38. package/lib/element/premise.js +43 -52
  39. package/lib/element/property.js +9 -9
  40. package/lib/element/propertyRelation.js +13 -13
  41. package/lib/element/reference.js +14 -17
  42. package/lib/element/rule.js +26 -50
  43. package/lib/element/signature.js +11 -11
  44. package/lib/element/statement.js +54 -56
  45. package/lib/element/step.js +79 -51
  46. package/lib/element/subDerivation.js +7 -10
  47. package/lib/element/subproof.js +6 -14
  48. package/lib/element/substitution/frame.js +1 -7
  49. package/lib/element/substitution/reference.js +2 -3
  50. package/lib/element/substitution/statement.js +44 -15
  51. package/lib/element/substitution/term.js +10 -57
  52. package/lib/element/substitution.js +5 -11
  53. package/lib/element/substitutions.js +29 -29
  54. package/lib/element/supposition.js +63 -55
  55. package/lib/element/term.js +21 -34
  56. package/lib/element/type.js +47 -60
  57. package/lib/element/typePrefix.js +5 -5
  58. package/lib/element/variable.js +9 -9
  59. package/lib/element.js +27 -3
  60. package/lib/metaTypes.js +52 -0
  61. package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
  62. package/lib/node/body/axiom.js +2 -25
  63. package/lib/node/body/conjecture.js +2 -25
  64. package/lib/node/body/lemma.js +2 -25
  65. package/lib/node/body/metaLemma.js +2 -25
  66. package/lib/node/body/metatheorem.js +2 -25
  67. package/lib/node/body/rule.js +15 -1
  68. package/lib/node/body/theorem.js +2 -25
  69. package/lib/node/body.js +25 -2
  70. package/lib/node/combinator.js +11 -2
  71. package/lib/node/constructor.js +11 -2
  72. package/lib/node/declaration/combinator.js +5 -5
  73. package/lib/node/declaration/constructor.js +8 -8
  74. package/lib/node/declaration/property.js +15 -15
  75. package/lib/node/declaration/simpleType.js +31 -31
  76. package/lib/node/declaration/variable.js +8 -8
  77. package/lib/node/equality.js +8 -8
  78. package/lib/node/frame.js +20 -20
  79. package/lib/node/header.js +22 -22
  80. package/lib/node/metaLemmaMetaTheorem.js +16 -16
  81. package/lib/node/metavariable.js +15 -15
  82. package/lib/node/property.js +8 -8
  83. package/lib/node/propertyRelation.js +8 -8
  84. package/lib/node/rule.js +16 -16
  85. package/lib/node/statement.js +12 -12
  86. package/lib/node/step.js +22 -22
  87. package/lib/node/subproof.js +8 -8
  88. package/lib/node/substitution/frame.js +19 -19
  89. package/lib/node/substitution/statement.js +19 -19
  90. package/lib/node/substitution/term.js +19 -19
  91. package/lib/node/term.js +35 -35
  92. package/lib/preamble.js +5 -5
  93. package/lib/process/instantiate.js +20 -2
  94. package/lib/process/unify.js +39 -42
  95. package/lib/process/validate.js +431 -0
  96. package/lib/process/verify.js +44 -135
  97. package/lib/types.js +27 -0
  98. package/lib/utilities/brackets.js +4 -4
  99. package/lib/utilities/element.js +100 -61
  100. package/lib/utilities/instance.js +18 -18
  101. package/lib/utilities/statement.js +11 -16
  102. package/lib/utilities/string.js +21 -10
  103. package/lib/utilities/unification.js +237 -0
  104. package/lib/utilities/validation.js +251 -0
  105. package/package.json +6 -6
  106. package/src/context/file.js +37 -31
  107. package/src/context/local.js +8 -8
  108. package/src/context/release.js +9 -6
  109. package/src/context/temporary.js +11 -11
  110. package/src/element/assertion/contained.js +19 -20
  111. package/src/element/assertion/defined.js +11 -12
  112. package/src/element/assertion/property.js +20 -20
  113. package/src/element/assertion/satisfies.js +6 -6
  114. package/src/element/assertion/subproof.js +17 -15
  115. package/src/element/assertion/type.js +2 -2
  116. package/src/element/assertion.js +0 -2
  117. package/src/element/assumption.js +22 -19
  118. package/src/element/axiom.js +7 -11
  119. package/src/element/axiomLemmaTheoremConjecture.js +36 -36
  120. package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
  121. package/src/element/combinator.js +90 -0
  122. package/src/element/conclusion.js +12 -10
  123. package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
  124. package/src/element/{term/constructor.js → constructor.js} +17 -25
  125. package/src/element/declaration/combinator.js +1 -22
  126. package/src/element/declaration/complexType.js +11 -11
  127. package/src/element/declaration/constructor.js +13 -10
  128. package/src/element/declaration/simpleType.js +3 -3
  129. package/src/element/declaration/typePrefix.js +1 -1
  130. package/src/element/declaration/variable.js +2 -2
  131. package/src/element/deduction.js +12 -9
  132. package/src/element/derivation.js +4 -8
  133. package/src/element/equivalence.js +8 -8
  134. package/src/element/equivalences.js +4 -4
  135. package/src/element/frame.js +28 -30
  136. package/src/element/hypothesis.js +2 -2
  137. package/src/element/judgement.js +6 -3
  138. package/src/element/label.js +14 -21
  139. package/src/element/metaLemmaMetatheorem.js +4 -3
  140. package/src/element/metaType.js +9 -45
  141. package/src/element/metavariable.js +29 -31
  142. package/src/element/parameter.js +2 -2
  143. package/src/element/premise.js +56 -62
  144. package/src/element/property.js +6 -6
  145. package/src/element/propertyRelation.js +11 -11
  146. package/src/element/reference.js +12 -21
  147. package/src/element/rule.js +28 -72
  148. package/src/element/signature.js +10 -9
  149. package/src/element/statement.js +69 -56
  150. package/src/element/step.js +89 -51
  151. package/src/element/subDerivation.js +6 -10
  152. package/src/element/subproof.js +4 -12
  153. package/src/element/substitution/frame.js +0 -2
  154. package/src/element/substitution/reference.js +1 -5
  155. package/src/element/substitution/statement.js +44 -14
  156. package/src/element/substitution/term.js +10 -13
  157. package/src/element/substitution.js +3 -5
  158. package/src/element/substitutions.js +48 -30
  159. package/src/element/supposition.js +88 -70
  160. package/src/element/term.js +18 -28
  161. package/src/element/type.js +42 -36
  162. package/src/element/typePrefix.js +3 -3
  163. package/src/element/variable.js +7 -7
  164. package/src/element.js +15 -1
  165. package/src/metaTypes.js +42 -0
  166. package/src/node/axiomLemmaTheoremConjecture.js +6 -6
  167. package/src/node/body/axiom.js +0 -21
  168. package/src/node/body/conjecture.js +0 -23
  169. package/src/node/body/lemma.js +0 -23
  170. package/src/node/body/metaLemma.js +0 -23
  171. package/src/node/body/metatheorem.js +0 -23
  172. package/src/node/body/rule.js +12 -0
  173. package/src/node/body/theorem.js +0 -23
  174. package/src/node/body.js +23 -0
  175. package/src/node/combinator.js +9 -0
  176. package/src/node/constructor.js +9 -0
  177. package/src/node/declaration/combinator.js +5 -5
  178. package/src/node/declaration/constructor.js +8 -8
  179. package/src/node/declaration/property.js +14 -14
  180. package/src/node/declaration/simpleType.js +31 -31
  181. package/src/node/declaration/variable.js +7 -7
  182. package/src/node/equality.js +7 -7
  183. package/src/node/frame.js +21 -21
  184. package/src/node/header.js +22 -22
  185. package/src/node/metaLemmaMetaTheorem.js +14 -14
  186. package/src/node/metavariable.js +14 -14
  187. package/src/node/property.js +7 -7
  188. package/src/node/propertyRelation.js +7 -7
  189. package/src/node/rule.js +15 -15
  190. package/src/node/statement.js +12 -12
  191. package/src/node/step.js +21 -21
  192. package/src/node/subproof.js +7 -7
  193. package/src/node/substitution/frame.js +18 -18
  194. package/src/node/substitution/statement.js +18 -18
  195. package/src/node/substitution/term.js +18 -18
  196. package/src/node/term.js +34 -34
  197. package/src/preamble.js +4 -4
  198. package/src/process/instantiate.js +12 -0
  199. package/src/process/unify.js +53 -57
  200. package/src/process/validate.js +316 -0
  201. package/src/process/verify.js +50 -138
  202. package/src/types.js +18 -0
  203. package/src/utilities/brackets.js +10 -6
  204. package/src/utilities/element.js +138 -91
  205. package/src/utilities/instance.js +18 -18
  206. package/src/utilities/statement.js +27 -28
  207. package/src/utilities/string.js +34 -20
  208. package/src/{mixins/step/unify.js → utilities/unification.js} +82 -68
  209. package/src/utilities/validation.js +369 -0
  210. package/lib/element/statement/combinator.js +0 -105
  211. package/lib/element/term/constructor.js +0 -172
  212. package/lib/mixins/statement/verify.js +0 -198
  213. package/lib/mixins/step/unify.js +0 -228
  214. package/lib/mixins/term/verify.js +0 -65
  215. package/src/element/statement/combinator.js +0 -59
  216. package/src/mixins/statement/verify.js +0 -295
  217. package/src/mixins/term/verify.js +0 -81
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../../elements";
4
3
  import Substitution from "../substitution";
5
4
 
6
5
  import { define } from "../../elements";
@@ -31,28 +30,26 @@ export default define(class TermSubstitution extends Substitution {
31
30
  return replacementNode;
32
31
  }
33
32
 
33
+ isTermEqualToTerm(term, context) {
34
+ term = stripBracketsFromTerm(term, context); ///
35
+
36
+ const termEqualToTerm = this.term.isEqualTo(term);
37
+
38
+ return termEqualToTerm;
39
+ }
40
+
34
41
  isTrivial() {
35
42
  let trivial = false;
36
43
 
37
- const termEqualToVariable = this.term.isEqualToVariable(this.variable);
44
+ const termComparesToVaraible = this.term.compareVariable(this.variable);
38
45
 
39
- if (termEqualToVariable) {
46
+ if (termComparesToVaraible) {
40
47
  trivial = true;
41
48
  }
42
49
 
43
50
  return trivial;
44
51
  }
45
52
 
46
- isTermEqualToTerm(term, context) {
47
- term = stripBracketsFromTerm(term, context); ///
48
-
49
- const termEqualToTerm = this.term.isEqualTo(term);
50
-
51
- return termEqualToTerm;
52
- }
53
-
54
- matchParameter(parameter) { return this.variable.matchParameter(parameter); }
55
-
56
53
  verify(context) {
57
54
  let verifies = false;
58
55
 
@@ -110,14 +110,12 @@ export default class Substitution extends Element {
110
110
  return substitutionEqualToSubstitution;
111
111
  }
112
112
 
113
- matchParameter(parameter) {
114
- const parameterMatches = false;
113
+ compareParameter(parameter) {
114
+ const comparesToParameter = false;
115
115
 
116
- return parameterMatches;
116
+ return comparesToParameter;
117
117
  }
118
118
 
119
- matchSubstitutionNode(substitutionNode) { return this.node.match(substitutionNode); }
120
-
121
119
  resolve(substitutions, context) {
122
120
  const resolved = true;
123
121
 
@@ -6,6 +6,7 @@ import Element from "../element";
6
6
 
7
7
  import { define } from "../elements";
8
8
  import { EMPTY_STRING } from "../constants";
9
+ import { substitutionsStringFromSubstitutions } from "../utilities/string";
9
10
 
10
11
  const { find, first, clear, prune, filter, compress, correlate } = arrayUtilities;
11
12
 
@@ -25,8 +26,6 @@ export default define(class Substitutions extends Element {
25
26
  return this.savedArray;
26
27
  }
27
28
 
28
- getLength() { return this.array.length; }
29
-
30
29
  getMetavariables() {
31
30
  const metavariables = [];
32
31
 
@@ -75,6 +74,8 @@ export default define(class Substitutions extends Element {
75
74
  return firstSubstitution;
76
75
  }
77
76
 
77
+ getLength() { return this.array.length; }
78
+
78
79
  mapSubstitution(callback) { return this.array.map(callback); }
79
80
 
80
81
  findSubstitution(callback) { return this.array.find(callback) || null; } ///
@@ -200,9 +201,13 @@ export default define(class Substitutions extends Element {
200
201
  addSubstitution(substitution, context) {
201
202
  this.array.push(substitution);
202
203
 
203
- const substitutionString = substitution.getString();
204
+ const string = this.asString(),
205
+ substitutionString = substitution.getString(),
206
+ substitutionsString = string; ///
204
207
 
205
- context.trace(`Added the '${substitutionString}' substitution.`);
208
+ this.setString(string);
209
+
210
+ context.trace(`Added the '${substitutionString}' substitution to the '${substitutionsString}' substitutions.`);
206
211
  }
207
212
 
208
213
  removeSubstitution(substitution, context) {
@@ -216,9 +221,13 @@ export default define(class Substitutions extends Element {
216
221
  }
217
222
  });
218
223
 
219
- const substitutionString = substitution.getString();
224
+ const string = this.asString(),
225
+ substitutionString = substitution.getString(),
226
+ substitutionsString = string; ///
227
+
228
+ this.setString(string);
220
229
 
221
- context.trace(`Removed the '${substitutionString}' substitution.`);
230
+ context.trace(`Removed the '${substitutionString}' substitution from the '${substitutionsString}' substitutions.`);
222
231
  }
223
232
 
224
233
  correlateSubstitutions(substitutions) {
@@ -236,16 +245,6 @@ export default define(class Substitutions extends Element {
236
245
  return correlates;
237
246
  }
238
247
 
239
- removeTrivialSubstitutions() {
240
- filter(this.array, (substitution) => {
241
- const trivial = substitution.isTrivial();
242
-
243
- if (!trivial) {
244
- return true;
245
- }
246
- });
247
- }
248
-
249
248
  clear() {
250
249
  clear(this.array);
251
250
 
@@ -318,6 +317,10 @@ export default define(class Substitutions extends Element {
318
317
  ];
319
318
 
320
319
  this.savedArray = null;
320
+
321
+ const string = this.asString();
322
+
323
+ this.setString(string);
321
324
  }
322
325
 
323
326
  continue() {
@@ -332,15 +335,8 @@ export default define(class Substitutions extends Element {
332
335
  if (length === 0) {
333
336
  string = EMPTY_STRING;
334
337
  } else {
335
- const substitutionsString = this.array.reduce((substitutionsString, substitution) => {
336
- const substitutionString = substitution.getString();
337
-
338
- substitutionsString = (substitutionsString === null) ?
339
- substitutionString :
340
- `${substitutionsString}, ${substitutionString}`;
341
-
342
- return substitutionsString;
343
- }, null);
338
+ const substitutions = this.array, ///
339
+ substitutionsString = substitutionsStringFromSubstitutions(substitutions);
344
340
 
345
341
  string = substitutionsString; ///
346
342
  }
@@ -349,16 +345,38 @@ export default define(class Substitutions extends Element {
349
345
  }
350
346
 
351
347
  static fromArray(array) {
352
- const savedArray = [],
353
- substitutions = new Substitutions(array, savedArray);
348
+ let string;
349
+
350
+ const context = null;
351
+
352
+ string = null;
353
+
354
+ const node = null,
355
+ savedArray = [],
356
+ substitutions = new Substitutions(context, string, node, array, savedArray);
357
+
358
+ string = substitutions.asString();
359
+
360
+ substitutions.setString(string);
354
361
 
355
362
  return substitutions;
356
363
  }
357
364
 
358
365
  static fromNothing() {
359
- const array = [],
360
- savedArray = null,
361
- substitutions = new Substitutions(array, savedArray);
366
+ let string;
367
+
368
+ const context = null;
369
+
370
+ string = null;
371
+
372
+ const node = null,
373
+ array = [],
374
+ savedArray = [],
375
+ substitutions = new Substitutions(context, string, node, array, savedArray);
376
+
377
+ string = substitutions.asString();
378
+
379
+ substitutions.setString(string);
362
380
 
363
381
  return substitutions;
364
382
  }
@@ -6,7 +6,6 @@ import TemporaryContext from "../context/temporary";
6
6
  import assignAssignments from "../process/assign";
7
7
 
8
8
  import { define } from "../elements";
9
- import { subproofAssertionFromStatement } from "../utilities/statement";
10
9
  import { termsFromJSON, framesFromJSON, statementFromJSON, procedureCallFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
11
10
 
12
11
  export default define(class Supposition extends Element {
@@ -32,81 +31,69 @@ export default define(class Supposition extends Element {
32
31
 
33
32
  context = temporaryContext; ///
34
33
 
35
- const suppositionString = this.string; ///
34
+ const node = this.getNode(),
35
+ suppositionString = this.getString(); ///
36
36
 
37
- context.trace(`Verifying the '${suppositionString}' supposition...`, this.node);
37
+ context.trace(`Verifying the '${suppositionString}' supposition...`, node);
38
38
 
39
- if (false) {
40
- ///
41
- } else if (this.statement !== null) {
42
- const stated = true,
43
- assignments = [],
44
- statementVerifies = this.statement.verify(assignments, stated, context);
39
+ if ((this.statement === null) && (this.procedureCall === null)) {
40
+ context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense.`, node);
41
+ } else {
42
+ if (this.statement !== null) {
43
+ const stated = true,
44
+ assignments = [],
45
+ statementValidates = this.statement.validate(assignments, stated, context);
45
46
 
46
- if (statementVerifies) {
47
- const assignmentsAssigned = assignAssignments(assignments, context);
47
+ if (statementValidates) {
48
+ const assignmentsAssigned = assignAssignments(assignments, context);
48
49
 
49
- if (assignmentsAssigned) {
50
- const { Step } = elements,
51
- step = Step.fromStatement(this.statement, context),
52
- stepOrSubproof = step; ///
50
+ if (assignmentsAssigned) {
51
+ const { Step } = elements,
52
+ step = Step.fromStatement(this.statement, context),
53
+ stepOrSubproof = step; ///
53
54
 
54
- context.addStepOrSubproof(stepOrSubproof);
55
+ context.addStepOrSubproof(stepOrSubproof);
55
56
 
56
- verifies = true;
57
+ verifies = true;
58
+ }
57
59
  }
58
60
  }
59
- } else if (this.procedureCall !== null) {
60
- const stated = true,
61
- assignments = null,
62
- procedureCallVerifies = this.procedureCall.verify(assignments, stated, context);
63
61
 
64
- if (procedureCallVerifies) {
65
- verifies = true;
62
+ if (this.procedureCall !== null) {
63
+ const stated = true,
64
+ assignments = null,
65
+ procedureCallVerifies = this.procedureCall.verify(assignments, stated, context);
66
+
67
+ if (procedureCallVerifies) {
68
+ verifies = true;
69
+ }
66
70
  }
67
- } else {
68
- context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense.`, this.node);
69
71
  }
70
72
 
71
73
  if (verifies) {
72
- this.context = context;
74
+ this.setContext(context);
73
75
 
74
- context.debug(`...verified the '${suppositionString}' supposition.`, this.node);
76
+ context.debug(`...verified the '${suppositionString}' supposition.`, node);
75
77
  }
76
78
 
77
79
  return verifies;
78
80
  }
79
81
 
80
- unifySupposition(supposition, substitutions, generalContext, specificContext) {
81
- let suppositionUnifies;
82
+ unifyIndependently(substitutions, context) {
83
+ let unifiesIndependently = false;
82
84
 
83
- const context = specificContext, ///
84
- specificSupposition = supposition, ///
85
- generalSuppositionString = this.string, ///
86
- specificSuppositionString = specificSupposition.getString();
85
+ const node = this.getNode(),
86
+ suppositionString = this.getString();
87
87
 
88
- context.trace(`Unifying the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition...`, this.node);
88
+ context.trace(`Unifying the '${suppositionString}' supposition independently...`, node);
89
89
 
90
- const statement = specificSupposition.getStatement(),
91
- statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
90
+ const specificContext = context; ///
92
91
 
93
- suppositionUnifies = statementUnifies; ///
92
+ context = this.getContext();
94
93
 
95
- if (suppositionUnifies) {
96
- context.debug(`...unified the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition.`, this.node);
97
- }
94
+ const generalContext = context; ///
98
95
 
99
- return suppositionUnifies;
100
- }
101
-
102
- unifyIndependently(substitutions, context) {
103
- let unifiesIndependently = false;
104
-
105
- const suppositionString = this.string, ///
106
- generalContext = this.context, ///
107
- specificContext = context; ///
108
-
109
- context.trace(`Unifying the '${suppositionString}' supposition independently...`, this.node);
96
+ context = specificContext; ///
110
97
 
111
98
  if (this.statement !== null) {
112
99
  const statementUnifiesIndependently = this.statement.unifyIndependently(substitutions, generalContext, specificContext);
@@ -125,7 +112,7 @@ export default define(class Supposition extends Element {
125
112
  }
126
113
 
127
114
  if (unifiesIndependently) {
128
- context.debug(`...unified the '${suppositionString}' supposition independenly.`, this.node);
115
+ context.debug(`...unified the '${suppositionString}' supposition independenly.`, node);
129
116
  }
130
117
 
131
118
  return unifiesIndependently;
@@ -167,19 +154,6 @@ export default define(class Supposition extends Element {
167
154
  return stepOrSubproofUnifies;
168
155
  }
169
156
 
170
- unifyStep(step, substitutions, context) {
171
- let stepUnifies;
172
-
173
- context = step.getContext();
174
-
175
- const statement = step.getStatement(),
176
- statementUnifies = this.unifyStatement(statement, substitutions, context);
177
-
178
- stepUnifies = statementUnifies; ///
179
-
180
- return stepUnifies;
181
- }
182
-
183
157
  unifySubproof(subproof, substitutions, context) {
184
158
  let subproofUnifies = false;
185
159
 
@@ -190,14 +164,22 @@ export default define(class Supposition extends Element {
190
164
 
191
165
  context.trace(`Unifying the '${subproofString}' subproof with the supposition's '${suppositionStatementString}' statement...`);
192
166
 
167
+ const specificContext = context; ///
168
+
169
+ context = this.getContext();
170
+
171
+ const generalContext = context; ///
172
+
173
+ context = specificContext; ///
174
+
193
175
  if (this.statement !== null) {
194
- const context = generalContext, ///
195
- subproofAssertion = subproofAssertionFromStatement(this.statement, context);
176
+ const node = this.getNode(),
177
+ assertionNode = node, ///
178
+ assertion = context.findAssertionByAssertionNode(assertionNode);
196
179
 
197
- if (subproofAssertion !== null) {
198
- const generalContext = this.context, ///
199
- specificContext = context; ///
180
+ if (assertion !== null) {}
200
181
 
182
+ if (subproofAssertion !== null) {
201
183
  subproofUnifies = subproofAssertion.unifySubproof(subproof, substitutions, generalContext, specificContext);
202
184
  }
203
185
  }
@@ -209,6 +191,19 @@ export default define(class Supposition extends Element {
209
191
  return subproofUnifies;
210
192
  }
211
193
 
194
+ unifyStep(step, substitutions, context) {
195
+ let stepUnifies;
196
+
197
+ context = step.getContext();
198
+
199
+ const statement = step.getStatement(),
200
+ statementUnifies = this.unifyStatement(statement, substitutions, context);
201
+
202
+ stepUnifies = statementUnifies; ///
203
+
204
+ return stepUnifies;
205
+ }
206
+
212
207
  unifyStatement(statement, substitutions, context) {
213
208
  let statementUnifies;
214
209
 
@@ -232,6 +227,29 @@ export default define(class Supposition extends Element {
232
227
  return statementUnifies;
233
228
  }
234
229
 
230
+ unifySupposition(supposition, substitutions, generalContext, specificContext) {
231
+ let suppositionUnifies;
232
+
233
+ const node = this.getNode(),
234
+ context = specificContext, ///
235
+ specificSupposition = supposition, ///
236
+ generalSuppositionString = this.getString(), ///
237
+ specificSuppositionString = specificSupposition.getString();
238
+
239
+ context.trace(`Unifying the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition...`, node);
240
+
241
+ const statement = specificSupposition.getStatement(),
242
+ statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
243
+
244
+ suppositionUnifies = statementUnifies; ///
245
+
246
+ if (suppositionUnifies) {
247
+ context.debug(`...unified the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition.`, node);
248
+ }
249
+
250
+ return suppositionUnifies;
251
+ }
252
+
235
253
  toJSON() {
236
254
  let frames,
237
255
  terms;
@@ -3,9 +3,9 @@
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
5
  import Element from "../element";
6
- import verifyMixins from "../mixins/term/verify";
7
6
 
8
7
  import { define } from "../elements";
8
+ import { validateTerms } from "../utilities/validation";
9
9
  import { instantiateTerm } from "../process/instantiate";
10
10
  import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
11
11
 
@@ -30,10 +30,8 @@ export default define(class Term extends Element {
30
30
 
31
31
  isProvisional() { return this.type.isProvisional(); }
32
32
 
33
- matchTermNode(termNode) { return this.node.match(termNode); }
34
-
35
- isEqualToVariable(variable) {
36
- let variableNodeMathces = false;
33
+ compareVariable(variable) {
34
+ let comparesToVaraible = false;
37
35
 
38
36
  const singular = this.isSingular();
39
37
 
@@ -45,19 +43,11 @@ export default define(class Term extends Element {
45
43
  matches = variableNodeA.match(variableNodeB);
46
44
 
47
45
  if (matches) {
48
- variableNodeMathces = true;
46
+ comparesToVaraible = true;
49
47
  }
50
48
  }
51
49
 
52
- return variableNodeMathces;
53
- }
54
-
55
- isEqualTo(term) {
56
- const termNode = term.getNode(),
57
- matches = this.node.match(termNode),
58
- equalTo = matches; ///
59
-
60
- return equalTo;
50
+ return comparesToVaraible;
61
51
  }
62
52
 
63
53
  isGrounded(definedVariables, context) {
@@ -95,31 +85,31 @@ export default define(class Term extends Element {
95
85
  return implicitlyGrounded;
96
86
  }
97
87
 
98
- verify(context, verifyAhead) {
99
- let verifies;
88
+ validate(context, verifyAhead) {
89
+ let validates;
100
90
 
101
91
  const termString = this.string; ///
102
92
 
103
- context.trace(`Verifying the '${termString}' term...`);
93
+ context.trace(`Validating the '${termString}' term...`);
104
94
 
105
- verifies = verifyMixins.some((verifyMixin) => {
95
+ validates = validateTerms.some((validateTerm) => { ///
106
96
  const term = this, ///
107
- verifies = verifyMixin(term, context, verifyAhead);
97
+ termValidates = validateTerm(term, context, verifyAhead);
108
98
 
109
- if (verifies) {
99
+ if (termValidates) {
110
100
  return true;
111
101
  }
112
102
  });
113
103
 
114
- if (verifies) {
104
+ if (validates) {
115
105
  const term = this; ///
116
106
 
117
107
  context.addTerm(term);
118
108
 
119
- context.debug(`...verified the '${termString}' term.`);
109
+ context.debug(`...validated the '${termString}' term.`);
120
110
  }
121
111
 
122
- return verifies;
112
+ return validates;
123
113
  }
124
114
 
125
115
  verifyGivenType(type, generalContext, specificContext) {
@@ -128,10 +118,10 @@ export default define(class Term extends Element {
128
118
  const typeString = type.getString(),
129
119
  termString = this.getString(); ///
130
120
 
131
- specificContext.trace(`Verifying the '${termString}' term given the '${typeString}' type...`);
121
+ specificContext.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
132
122
 
133
123
  const context = specificContext, ///
134
- verifies = this.verify(context, () => {
124
+ validates = this.validate(context, () => {
135
125
  let verifiesAhead;
136
126
 
137
127
  const typeEqualToOrSubTypeOfGivenTypeType = this.type.isEqualToOrSubTypeOf(type);
@@ -143,10 +133,10 @@ export default define(class Term extends Element {
143
133
  return verifiesAhead;
144
134
  });
145
135
 
146
- verifiesGivenType = verifies; ///
136
+ verifiesGivenType = validates; ///
147
137
 
148
138
  if (verifiesGivenType) {
149
- specificContext.debug(`...verified the '${termString}' term given the '${typeString}' type.`);
139
+ specificContext.debug(`...validated the '${termString}' term given the '${typeString}' type.`);
150
140
  }
151
141
 
152
142
  return verifiesGivenType;