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
@@ -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 steps = context.getSteps(),
103
+ topLevelAssertionString = this.getString(); ///
104
+
105
+ context.trace(`Correlating the hypotheses of the '${topLevelAssertionString}' axiom, lemma, theorem or conjecture...`, this.node);
106
+
107
+ correlatesToHypotheses = correlate(this.hypotheses, steps, (hypothesis, step) => {
108
+ const hypothesesEqualToStep = hypothesis.isEqualToStep(step, context);
109
+
110
+ if (hypothesesEqualToStep) {
111
+ return true;
112
+ }
113
+ });
114
+
115
+ if (correlatesToHypotheses) {
116
+ context.debug(`...correlated the hypotheses of the '${topLevelAssertionString}' 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
 
@@ -215,9 +215,9 @@ export default class AxiomLemmaTheoremConjecture extends Element {
215
215
  unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, 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) {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- import CombinatorStatement from "../../statement/combinator";
3
+ import Combinator from "../combinator";
4
4
 
5
- import { define } from "../../../elements";
6
- import { bracketedCombinatorStatementFromNothing } from "../../../utilities/instance";
5
+ import { define } from "../../elements";
6
+ import { bracketedCombinatorFromNothing } from "../../utilities/instance";
7
7
 
8
- export default define(class BracketedCombinatorStatement extends CombinatorStatement {
8
+ export default define(class BracketedCombinator extends Combinator {
9
9
  unifyStatement(statement, assignments, stated, context) {
10
10
  let statementUnifies;
11
11
 
@@ -22,11 +22,11 @@ export default define(class BracketedCombinatorStatement extends CombinatorState
22
22
  return statementUnifies;
23
23
  }
24
24
 
25
- static name = "BracketedCombinatorStatement";
25
+ static name = "BracketedCombinator";
26
26
 
27
27
  static fromNothing() {
28
- const bracketedCombinatorStatement = bracketedCombinatorStatementFromNothing();
28
+ const bracketedCombinator = bracketedCombinatorFromNothing();
29
29
 
30
- return bracketedCombinatorStatement;
30
+ return bracketedCombinator;
31
31
  }
32
32
  });
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ import Element from "../element";
4
+
5
+ import { define } from "../elements";
6
+ import { verifyCombinator } from "../process/verify";
7
+ import { unifyStatementWithCombinator } from "../process/unify";
8
+ import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
9
+
10
+ export default define(class Combinator extends Element {
11
+ constructor(context, string, node, statement) {
12
+ super(context, string, node)
13
+
14
+ this.statement = statement;
15
+ }
16
+
17
+ getStatement() {
18
+ return this.statement;
19
+ }
20
+
21
+ verify() {
22
+ let verifies;
23
+
24
+ const node = this.getNode(),
25
+ context = this.getContext(),
26
+ combinatorString = this.getString(); ///
27
+
28
+ context.trace(`Verifying the '${combinatorString}' combinator...`, node);
29
+
30
+ const combinator = this, ///
31
+ combinatorVerifies = verifyCombinator(combinator, context);
32
+
33
+ if (combinatorVerifies) {
34
+ verifies = true;
35
+ }
36
+
37
+ if (verifies) {
38
+ context.debug(`...verified the '${combinatorString}' combinator.`, node);
39
+ }
40
+
41
+ return verifies;
42
+ }
43
+
44
+ unifyStatement(statement, assignments, stated, context) {
45
+ let statementUnifies;
46
+
47
+ const statementString = statement.getString(),
48
+ combinatorString = this.getString(); ///
49
+
50
+ context.trace(`Unifying the '${statementString}' statement with the '${combinatorString}' combinator...`);
51
+
52
+ const specifiContext = context; ///
53
+
54
+ context = this.getContext();
55
+
56
+ const generalContext = context; ///
57
+
58
+ context = specifiContext; ///
59
+
60
+ const combinator = this, ///
61
+ statementUnifiesWithCombinator = unifyStatementWithCombinator(statement, combinator, assignments, stated, generalContext, specifiContext);
62
+
63
+ statementUnifies = statementUnifiesWithCombinator; ///
64
+
65
+ if (statementUnifies) {
66
+ context.debug(`...unified the '${statementString}' statement with the '${combinatorString}' combinator.`);
67
+ }
68
+
69
+ return statementUnifies;
70
+ }
71
+
72
+ toJSON() {
73
+ const statementJSON = statementToStatementJSON(this.statement),
74
+ statement = statementJSON, ///
75
+ json = {
76
+ statement,
77
+ };
78
+
79
+ return json;
80
+ }
81
+
82
+ static name = "Combinator";
83
+
84
+ static fromJSON(json, context) {
85
+ const statement = statementFromJSON(json, context),
86
+ combinator = new Combinator(statement);
87
+
88
+ return combinator;
89
+ }
90
+ });
@@ -24,25 +24,27 @@ export default define(class Conclusion extends Element {
24
24
 
25
25
  context = temporaryContext; ///
26
26
 
27
- const conclusionString = this.string; ///
27
+ const node = this.getNode(),
28
+ conclusionString = this.getString(); ///
28
29
 
29
- context.trace(`Verifying the '${conclusionString}' conclusion...`, this.node);
30
+ context.trace(`Verifying the '${conclusionString}' conclusion...`, node);
30
31
 
31
- if (this.statement !== null) {
32
+ if (this.statement === null) {
33
+ context.debug(`Unable to verify the '${conclusionString}' conclusion because it is nonsense.`, node);
34
+ } else {
32
35
  const stated = true,
33
36
  assignments = null,
34
- statementVerifies = this.statement.verify(assignments, stated, context);
35
-
36
- verifies = statementVerifies; ///
37
+ statementValidates = this.statement.validate(assignments, stated, context);
37
38
 
38
- } else {
39
- context.debug(`Unable to verify the '${conclusionString}' conclusion because it is nonsense.`, this.node);
39
+ if (statementValidates) {
40
+ verifies = true;
41
+ }
40
42
  }
41
43
 
42
44
  if (verifies) {
43
- this.context = context;
45
+ this.setContext(context);
44
46
 
45
- context.debug(`...verified the '${conclusionString}' conclusion.`, this.node);
47
+ context.debug(`...verified the '${conclusionString}' conclusion.`, node);
46
48
  }
47
49
 
48
50
  return verifies;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../../../elements";
3
+ import elements from "../../elements";
4
4
  import Constructor from "../constructor";
5
5
 
6
- import { define } from "../../../elements";
7
- import { bracketedConstructorTermFromNothing } from "../../../utilities/instance";
6
+ import { define } from "../../elements";
7
+ import { bracketedConstructorFromNothing } from "../../utilities/instance";
8
8
 
9
9
  export default define(class BracketedConstructor extends Constructor {
10
10
  unifyTerm(term, context, verifyAhead) {
@@ -55,8 +55,8 @@ export default define(class BracketedConstructor extends Constructor {
55
55
  static name = "BracketedConstructor";
56
56
 
57
57
  static fromNothing() {
58
- const bracketedConstructorTerm = bracketedConstructorTermFromNothing();
58
+ const bracketedConstructor = bracketedConstructorFromNothing();
59
59
 
60
- return bracketedConstructorTerm;
60
+ return bracketedConstructor;
61
61
  }
62
62
  });
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../../elements";
3
+ import Element from "../element";
4
4
 
5
- import { define } from "../../elements";
6
- import { unifyTermWithConstructorTerm } from "../../process/unify";
7
- import { termFromJSON, termToTermJSON } from "../../utilities/json";
5
+ import { define } from "../elements";
6
+ import { unifyTermWithConstructor } from "../process/unify";
7
+ import { termFromJSON, termToTermJSON } from "../utilities/json";
8
+
9
+ export default define(class Constructor extends Element {
10
+ constructor(context, string, node, term) {
11
+ super(context, string, node);
8
12
 
9
- export default define(class ConstructorTerm {
10
- constructor(term) {
11
13
  this.term = term;
12
14
  }
13
15
 
@@ -15,24 +17,22 @@ export default define(class ConstructorTerm {
15
17
  return this.term;
16
18
  }
17
19
 
18
- getType() { return this.term.getType(); }
19
-
20
- getString() { return this.term.getString(); }
21
-
22
20
  isProvisional() { return this.term.isProvisional(); }
23
21
 
22
+ getType() { return this.term.getType(); }
23
+
24
24
  setType(type) { this.term.setType(type); }
25
25
 
26
26
  unifyTerm(term, context, verifyAhead) {
27
27
  let termUnifies = false;
28
28
 
29
29
  const termString = term.getString(),
30
- constructorTermString = this.getString();
30
+ constructorString = this.getString();
31
31
 
32
- context.trace(`Unifying the '${termString}' term with the '${constructorTermString}' constructor's term...`);
32
+ context.trace(`Unifying the '${termString}' term with the '${constructorString}' constructor...`);
33
33
 
34
- const constructorTerm = this, ///
35
- termUnifiesWithConstructor = unifyTermWithConstructorTerm(term, constructorTerm, context);
34
+ const constructor = this, ///
35
+ termUnifiesWithConstructor = unifyTermWithConstructor(term, constructor, context);
36
36
 
37
37
  if (termUnifiesWithConstructor) {
38
38
  let verifiesAhead;
@@ -47,7 +47,7 @@ export default define(class ConstructorTerm {
47
47
  }
48
48
 
49
49
  if (termUnifies) {
50
- context.debug(`...unified the '${termString}' term with the '${constructorTermString}' constructor's term.`);
50
+ context.debug(`...unified the '${termString}' term with the '${constructorString}' constructor.`);
51
51
  }
52
52
 
53
53
  return termUnifies;
@@ -63,19 +63,11 @@ export default define(class ConstructorTerm {
63
63
  return json;
64
64
  }
65
65
 
66
- static name = "ConstructorTerm";
66
+ static name = "Constructor";
67
67
 
68
68
  static fromJSON(json, context) {
69
69
  const term = termFromJSON(json, context),
70
- constructor = new ConstructorTerm(term);
71
-
72
- return constructor;
73
- }
74
-
75
- static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
76
- const { Term } = elements,
77
- term = Term.fromConstructorDeclarationNode(constructorDeclarationNode, context),
78
- constructor = new ConstructorTerm(term);
70
+ constructor = new Constructor(term);
79
71
 
80
72
  return constructor;
81
73
  }
@@ -25,7 +25,7 @@ export default define(class CombinatorDeclaration extends Declaration {
25
25
 
26
26
  context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`, node);
27
27
 
28
- const combinatorVerifies = this.verifyCombinator();
28
+ const combinatorVerifies = this.combinator.verify();
29
29
 
30
30
  if (combinatorVerifies) {
31
31
  context.addCombinator(this.combinator);
@@ -40,26 +40,5 @@ export default define(class CombinatorDeclaration extends Declaration {
40
40
  return verifies;
41
41
  }
42
42
 
43
- verifyCombinator() {
44
- let statementVerifies;
45
-
46
- const node = this.getNode(),
47
- context = this.getContext(),
48
- combinatorString = this.combinator.getString();
49
-
50
- context.trace(`Verifying the '${combinatorString}' combinator...`, node);
51
-
52
- const statement = this.combinator.getStatement(),
53
- statementNode = statement.getNode();
54
-
55
- statementVerifies = verifyStatement(statementNode, context);
56
-
57
- if (statementVerifies) {
58
- context.debug(`...verified the '${combinatorString}' combinator.`, node);
59
- }
60
-
61
- return statementVerifies;
62
- }
63
-
64
43
  static name = "CombinatorDeclaration";
65
44
  });
@@ -112,10 +112,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
112
112
 
113
113
  const nominalTypeName = superType.getNominalTypeName(),
114
114
  typeName = nominalTypeName, ///
115
- typeNameMatches = this.type.matchTypeName(typeName);
115
+ typeComparesToTypeName = this.type.compareTypeName(typeName);
116
116
 
117
- if (typeNameMatches) {
118
- context.trace(`The super-type's name matches the ${typeName}' complex type's name.`, node);
117
+ if (typeComparesToTypeName) {
118
+ context.trace(`The super-type's name compares to the ${typeName}' complex type's name.`, node);
119
119
  } else {
120
120
  const oldSuperType = superType;
121
121
 
@@ -237,9 +237,9 @@ export default define(class ComplexTypeDeclaration extends Declaration {
237
237
 
238
238
  const propertyName = property.getName(),
239
239
  count = properties.reduce((count, property) => {
240
- const propertyNameMatches = property.matchPropertyName(propertyName);
240
+ const propertyComparesToPropertyName = property.comparePropertyName(propertyName);
241
241
 
242
- if (propertyNameMatches) {
242
+ if (propertyComparesToPropertyName) {
243
243
  count++;
244
244
  }
245
245
 
@@ -252,15 +252,15 @@ export default define(class ComplexTypeDeclaration extends Declaration {
252
252
  const superTypes = this.type.getSuperTypes(),
253
253
  superType = superTypes.find((superType) => {
254
254
  const superTypeProperties = superType.getProperties(),
255
- propertyNameMatches = superTypeProperties.some((superTypeProperty) => {
256
- const propertyNameMatches = superTypeProperty.matchPropertyName(propertyName);
255
+ superTypePropertyComparesToPropertyName = superTypeProperties.some((superTypeProperty) => {
256
+ const superTypePropertyComparesToPropertyName = superTypeProperty.comparePropertyName(propertyName);
257
257
 
258
- if (propertyNameMatches) {
258
+ if (superTypePropertyComparesToPropertyName) {
259
259
  return true;
260
260
  }
261
261
  });
262
262
 
263
- if (propertyNameMatches) {
263
+ if (superTypePropertyComparesToPropertyName) {
264
264
  return true;
265
265
  }
266
266
  }) || null;
@@ -291,9 +291,9 @@ export default define(class ComplexTypeDeclaration extends Declaration {
291
291
 
292
292
  context.trace(`Verifying the '${propertyString}' property's '${nominalTypeName}' nominal type name...`, node);
293
293
 
294
- const nominalTypeNameMatches = this.type.matchNominalTypeName(nominalTypeName);
294
+ const typeComparesToNominalTypeName = this.type.compareNominalTypeName(nominalTypeName);
295
295
 
296
- if (nominalTypeNameMatches) {
296
+ if (typeComparesToNominalTypeName) {
297
297
  propertyNominalTypeNameVerifies = true;
298
298
  } else {
299
299
  const typePresent = context.isTypePresentByNominalTypeName(nominalTypeName);
@@ -3,7 +3,7 @@
3
3
  import Declaration from "../declaration";
4
4
 
5
5
  import { define } from "../../elements";
6
- import { verifyTerm } from "../../process/verify";
6
+ import { validateTerm } from "../../process/validate";
7
7
 
8
8
  export default define(class ConstructorDeclaration extends Declaration {
9
9
  constructor(context, string, node, constructor) {
@@ -28,9 +28,9 @@ export default define(class ConstructorDeclaration extends Declaration {
28
28
  const constructorTypeVerifies = this.verifyConstructorType();
29
29
 
30
30
  if (constructorTypeVerifies) {
31
- const constructorVerifies = this.verifyConstructor();
31
+ const constructorValidates = this.verifyConstructor();
32
32
 
33
- if (constructorVerifies) {
33
+ if (constructorValidates) {
34
34
  context.addConstructor(this.constructor);
35
35
 
36
36
  verifies = true;
@@ -45,7 +45,7 @@ export default define(class ConstructorDeclaration extends Declaration {
45
45
  }
46
46
 
47
47
  verifyConstructor() {
48
- let constructorVerifies;
48
+ let constructorValidates = false;
49
49
 
50
50
  const node = this.getNode(),
51
51
  context = this.getContext(),
@@ -54,15 +54,18 @@ export default define(class ConstructorDeclaration extends Declaration {
54
54
  context.trace(`Verifying the '${constructorString}' constructor...`, node);
55
55
 
56
56
  const term = this.constructor.getTerm(),
57
- termNode = term.getNode();
57
+ termNode = term.getNode(),
58
+ termValidates = validateTerm(termNode, context);
58
59
 
59
- constructorVerifies = verifyTerm(termNode, context);
60
+ if (termValidates) {
61
+ constructorValidates = true;
62
+ }
60
63
 
61
- if (constructorVerifies) {
64
+ if (constructorValidates) {
62
65
  context.debug(`...verified the '${constructorString}' constructor.`, node);
63
66
  }
64
67
 
65
- return constructorVerifies;
68
+ return constructorValidates;
66
69
  }
67
70
 
68
71
  verifyConstructorType() {
@@ -90,9 +93,9 @@ export default define(class ConstructorDeclaration extends Declaration {
90
93
  } else {
91
94
  const includeSupertypes = false,
92
95
  provisional = type.isProvisional(includeSupertypes),
93
- provisionalMatches = type.matchProvisional(provisional);
96
+ typeComparesToProvisional = type.compareProvisional(provisional);
94
97
 
95
- if (!provisionalMatches) {
98
+ if (!typeComparesToProvisional) {
96
99
  provisional ?
97
100
  context.debug(`The '${typeString}' type is present but not provisional.`, node) :
98
101
  context.debug(`The '${typeString}' type is present but provisional.`, node);
@@ -108,10 +108,10 @@ export default define(class SimpleTypeDeclaration extends Declaration {
108
108
 
109
109
  const nominalTypeName = superType.getNominalTypeName(),
110
110
  typeName = nominalTypeName, ///
111
- typeNameMatches = this.type.matchTypeName(typeName);
111
+ typeComparesToTypeName = this.type.compareTypeName(typeName);
112
112
 
113
- if (typeNameMatches) {
114
- context.trace(`The super-type's name matches the ${typeName}' simple type's name.`, node);
113
+ if (typeComparesToTypeName) {
114
+ context.trace(`The super-type's name compares to the ${typeName}' simple type's name.`, node);
115
115
  } else {
116
116
  const oldSuperType = superType;
117
117
 
@@ -30,7 +30,7 @@ export default define(class TypePrefixDeclaration extends Declaration {
30
30
  typesLength = types.length;
31
31
 
32
32
  if (typesLength > 0) {
33
- context.debug(`Cannot verify the '${typePrefixDeclarationString}' type prefix declaration because types have already been declared.`, node);
33
+ context.debug(`Unable to verify the '${typePrefixDeclarationString}' type prefix declaration because types have already been declared.`, node);
34
34
  } else {
35
35
  const typePrefixVerifies = this.verifyTypePrefix();
36
36
 
@@ -93,9 +93,9 @@ export default define(class VariableDeclaration extends Declaration {
93
93
  } else {
94
94
  const includeSupertypes = false,
95
95
  provisional = type.isProvisional(includeSupertypes),
96
- provisionalMatches = type.matchProvisional(provisional);
96
+ typeComparesToProvisional = type.compareProvisional(provisional);
97
97
 
98
- if (!provisionalMatches) {
98
+ if (!typeComparesToProvisional) {
99
99
  provisional ?
100
100
  context.debug(`The '${typeString}' type is present but not provisional.`, node) :
101
101
  context.debug(`The '${typeString}' type is present but provisional.`, node);
@@ -24,24 +24,27 @@ export default define(class Deduction extends Element {
24
24
 
25
25
  context = temporaryContext; ///
26
26
 
27
- const deductionString = this.string; ///
27
+ const node = this.getNode(),
28
+ deductionString = this.getString(); ///
28
29
 
29
- context.trace(`Verifying the '${deductionString}' deduction...`, this.node);
30
+ context.trace(`Verifying the '${deductionString}' deduction...`, node);
30
31
 
31
- if (this.statement !== null) {
32
+ if (this.statement === null) {
33
+ context.debug(`Unable to verify the '${deductionString}' deduction because it is nonsense.`, node);
34
+ } else {
32
35
  const stated = true,
33
36
  assignments = null,
34
- statementVerifies = this.statement.verify(assignments, stated, context);
37
+ statementVealidates = this.statement.validate(assignments, stated, context);
35
38
 
36
- verifies = statementVerifies; ///
37
- } else {
38
- context.debug(`Unable to verify the '${deductionString}' deduction because it is nonsense.`, this.node);
39
+ if (statementVealidates) {
40
+ verifies = true;
41
+ }
39
42
  }
40
43
 
41
44
  if (verifies) {
42
- this.context = context;
45
+ this.setContext(context);
43
46
 
44
- context.debug(`...verified the '${deductionString}' deduction.`, this.node);
47
+ context.debug(`...verified the '${deductionString}' deduction.`, node);
45
48
  }
46
49
 
47
50
  return verifies;
@@ -35,16 +35,12 @@ export default define(class Derivation extends Element {
35
35
  stepOrSubproofVerifies = stepOrSubproof.verify(substitutions, assignments, context);
36
36
 
37
37
  if (stepOrSubproofVerifies) {
38
- const stepOrSubproofUnifies = stepOrSubproof.unify(substitutions, context);
38
+ const assignmentsAssigned = assignAssignments(assignments, context);
39
39
 
40
- if (stepOrSubproofUnifies) {
41
- const assignmentsAssigned = assignAssignments(assignments, context);
40
+ if (assignmentsAssigned) {
41
+ context.addStepOrSubproof(stepOrSubproof);
42
42
 
43
- if (assignmentsAssigned) {
44
- context.addStepOrSubproof(stepOrSubproof);
45
-
46
- return true;
47
- }
43
+ return true;
48
44
  }
49
45
  }
50
46
  });