occam-verify-cli 1.0.438 → 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 (216) 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 +7 -10
  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 +8 -8
  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 +49 -58
  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 +21 -21
  43. package/lib/element/signature.js +11 -11
  44. package/lib/element/statement.js +18 -18
  45. package/lib/element/step.js +83 -55
  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 +9 -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 +91 -55
  100. package/lib/utilities/instance.js +18 -18
  101. package/lib/utilities/statement.js +2 -2
  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 +6 -10
  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 +4 -4
  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 +55 -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 +17 -16
  148. package/src/element/signature.js +10 -9
  149. package/src/element/statement.js +16 -18
  150. package/src/element/step.js +93 -55
  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 +3 -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 +125 -82
  205. package/src/utilities/instance.js +18 -18
  206. package/src/utilities/statement.js +2 -2
  207. package/src/utilities/string.js +34 -20
  208. package/src/{mixins/step/unify.js → utilities/unification.js} +82 -68
  209. package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
  210. package/lib/element/statement/combinator.js +0 -105
  211. package/lib/element/term/constructor.js +0 -172
  212. package/lib/mixins/statement/validate.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/term/verify.js +0 -81
@@ -159,9 +159,9 @@ export default class TemporaryContext {
159
159
 
160
160
  findTermByTermNode(termNode) {
161
161
  const term = this.terms.find((term) => {
162
- const termMatchesTermNode = term.matchTermNode(termNode);
162
+ const termNodeMatches = term.matchNode(termNode);
163
163
 
164
- if (termMatchesTermNode) {
164
+ if (termNodeMatches) {
165
165
  return true;
166
166
  }
167
167
  }) || null;
@@ -171,9 +171,9 @@ export default class TemporaryContext {
171
171
 
172
172
  findFrameByFrameNode(frameNode) {
173
173
  const frame = this.frames.find((frame) => {
174
- const frameMatchesFrameNode = frame.matchFrameNode(frameNode);
174
+ const frameNodeMatches = frame.matchNode(frameNode);
175
175
 
176
- if (frameMatchesFrameNode) {
176
+ if (frameNodeMatches) {
177
177
  return true;
178
178
  }
179
179
  }) || null;
@@ -183,9 +183,9 @@ export default class TemporaryContext {
183
183
 
184
184
  findStatementByStatementNode(statementNode) {
185
185
  const statement = this.statements.find((statement) => {
186
- const statementMatchesStatementNode = statement.matchStatementNode(statementNode);
186
+ const statementNodeMatches = statement.matchNode(statementNode);
187
187
 
188
- if (statementMatchesStatementNode) {
188
+ if (statementNodeMatches) {
189
189
  return true;
190
190
  }
191
191
  }) || null;
@@ -195,9 +195,9 @@ export default class TemporaryContext {
195
195
 
196
196
  findAssertionByAssertionNode(assertionNode) {
197
197
  const assertion = this.assertions.find((assertion) => {
198
- const assertionMatchesAssertionNode = assertion.matchAssertionNode(assertionNode);
198
+ const assertionNodeMatches = assertion.matchNode(assertionNode);
199
199
 
200
- if (assertionMatchesAssertionNode) {
200
+ if (assertionNodeMatches) {
201
201
  return true;
202
202
  }
203
203
  }) || null;
@@ -219,9 +219,9 @@ export default class TemporaryContext {
219
219
 
220
220
  findSubstitutionBySubstitutionNode(substitutionNode) {
221
221
  const substitution = this.substitutions.find((substitution) => {
222
- const substitutionMatchesSubtitutionNode = substitution.matchSubstitutionNode(substitutionNode);
222
+ const substitutionNodeMatches = substitution.matchNode(substitutionNode);
223
223
 
224
- if (substitutionMatchesSubtitutionNode) {
224
+ if (substitutionNodeMatches) {
225
225
  return true;
226
226
  }
227
227
  }) || null;
@@ -349,7 +349,7 @@ export default class TemporaryContext {
349
349
 
350
350
  isMetavariableDefined(metavariable) { return this.context.isMetavariableDefined(metavariable); }
351
351
 
352
- matchTermAndPropertyRelation(term, propertyRelation) { return this.context.matchTermAndPropertyRelation(term, propertyRelation); }
352
+ compareTermAndPropertyRelation(term, propertyRelation) { return this.context.compareTermAndPropertyRelation(term, propertyRelation); }
353
353
 
354
354
  nodeAsString(node) { return this.context.nodeAsString(node); }
355
355
 
@@ -3,12 +3,11 @@
3
3
  import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
- import { containedAssertionFromStatementNode } from "../../utilities/element";
7
6
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions, statementFromStatementAndSubstitutions } from "../../utilities/substitutions";
8
7
 
9
8
  export default define(class ContainedAssertion extends Assertion {
10
- constructor(string, node, term, frame, negated, statement) {
11
- super(string, node);
9
+ constructor(cpontext, string, node, term, frame, negated, statement) {
10
+ super(context, string, node);
12
11
 
13
12
  this.term = term;
14
13
  this.frame = frame;
@@ -39,11 +38,11 @@ export default define(class ContainedAssertion extends Assertion {
39
38
 
40
39
  context.trace(`Verifying the '${containedAssertionString}' contained assertion...`);
41
40
 
42
- const termVerifies = this.verifyTerm(assignments, stated, context),
41
+ const termValidates = this.validateTerm(assignments, stated, context),
43
42
  frameVerifies = this.verifyFrame(assignments, stated, context),
44
- statementVerifies = this.verifyStatement(assignments, stated, context)
43
+ statementValidates = this.validateStatement(assignments, stated, context)
45
44
 
46
- if (termVerifies || frameVerifies || statementVerifies) {
45
+ if (termValidates || frameVerifies || statementValidates) {
47
46
  let verifiesWhenStated = false,
48
47
  verifiesWhenDerived = false;
49
48
 
@@ -65,32 +64,32 @@ export default define(class ContainedAssertion extends Assertion {
65
64
  return verifies;
66
65
  }
67
66
 
68
- verifyTerm(assignments, stated, context) {
69
- let termVerifies = false;
67
+ validateTerm(assignments, stated, context) {
68
+ let termValidates = false;
70
69
 
71
70
  if (this.term !== null) {
72
71
  const termString = this.term.getString();
73
72
 
74
- context.trace(`Verifying the '${termString}' term...`);
73
+ context.trace(`Validating the '${termString}' term...`);
75
74
 
76
75
  const termSingular = this.term.isSingular();
77
76
 
78
77
  if (!termSingular) {
79
78
  context.debug(`The '${termString}' term is not singular.`);
80
79
  } else {
81
- termVerifies = this.term.verify(context, () => {
80
+ termValidates = this.term.validate(context, () => {
82
81
  const verifiesAhead = true;
83
82
 
84
83
  return verifiesAhead;
85
84
  });
86
85
 
87
- if (termVerifies) {
88
- context.debug(`...verified the '${termString}' term.`);
86
+ if (termValidates) {
87
+ context.debug(`...validated the '${termString}' term.`);
89
88
  }
90
89
  }
91
90
  }
92
91
 
93
- return termVerifies;
92
+ return termValidates;
94
93
  }
95
94
 
96
95
  verifyFrame(assignments, stated, context) {
@@ -121,26 +120,26 @@ export default define(class ContainedAssertion extends Assertion {
121
120
  return frameVerifies;
122
121
  }
123
122
 
124
- verifyStatement(assignments, stated, context) {
125
- let statementVerifies = false;
123
+ validateStatement(assignments, stated, context) {
124
+ let statementValidates = false;
126
125
 
127
126
  if (this.statement !== null) {
128
127
  const statementString = this.statement.getString();
129
128
 
130
- context.trace(`Verifying the '${statementString}' statement...`);
129
+ context.trace(`Validating the '${statementString}' statement...`);
131
130
 
132
131
  stated = true; ///
133
132
 
134
133
  assignments = null; ///
135
134
 
136
- statementVerifies = this.statement.verify(assignments, stated, context);
135
+ statementValidates = this.statement.validate(assignments, stated, context);
137
136
 
138
- if (statementVerifies) {
139
- context.debug(`...verified the '${statementString}' statement.`);
137
+ if (statementValidates) {
138
+ context.debug(`...validated the '${statementString}' statement.`);
140
139
  }
141
140
  }
142
141
 
143
- return statementVerifies;
142
+ return statementValidates;
144
143
  }
145
144
 
146
145
  verifyWhenStated(assignments, context) {
@@ -4,12 +4,11 @@ import elements from "../../elements";
4
4
  import Assertion from "../assertion";
5
5
 
6
6
  import { define } from "../../elements";
7
- import { definedAssertionFromStatementNode } from "../../utilities/element";
8
7
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions } from "../../utilities/substitutions";
9
8
 
10
9
  export default define(class DefinedAssertion extends Assertion {
11
- constructor(string, node, term, frame, negated) {
12
- super(string, node);
10
+ constructor(context, string, node, term, frame, negated) {
11
+ super(context, string, node);
13
12
 
14
13
  this.term = term;
15
14
  this.frame= frame;
@@ -35,10 +34,10 @@ export default define(class DefinedAssertion extends Assertion {
35
34
 
36
35
  context.trace(`Verifying the '${definedAssertionString}' defined assertion...`);
37
36
 
38
- const termVerifies = this.verifyTerm(assignments, stated, context),
37
+ const termValidates = this.validateTerm(assignments, stated, context),
39
38
  frameVerifies = this.verifyFrame(assignments, stated, context);
40
39
 
41
- if (termVerifies || frameVerifies) {
40
+ if (termValidates || frameVerifies) {
42
41
  let verifiesWhenStated = false,
43
42
  verifiesWhenDerived = false;
44
43
 
@@ -60,32 +59,32 @@ export default define(class DefinedAssertion extends Assertion {
60
59
  return verifies;
61
60
  }
62
61
 
63
- verifyTerm(assignments, stated, context) {
64
- let termVerifies = false;
62
+ validateTerm(assignments, stated, context) {
63
+ let termValidates = false;
65
64
 
66
65
  if (this.term !== null) {
67
66
  const termString = this.term.getString(); ///
68
67
 
69
- context.trace(`Verifying the '${termString}' term...`);
68
+ context.trace(`Validating the '${termString}' term...`);
70
69
 
71
70
  const termSingular = this.term.isSingular();
72
71
 
73
72
  if (!termSingular) {
74
73
  context.debug(`The '${termString}' term is not singular.`);
75
74
  } else {
76
- termVerifies = this.term.verify(context, () => {
75
+ termValidates = this.term.validate(context, () => {
77
76
  const verifiesAhead = true;
78
77
 
79
78
  return verifiesAhead;
80
79
  });
81
80
 
82
- if (termVerifies) {
83
- context.debug(`...verified the '${termString}' term.`);
81
+ if (termValidates) {
82
+ context.debug(`...validated the '${termString}' term.`);
84
83
  }
85
84
  }
86
85
  }
87
86
 
88
- return termVerifies;
87
+ return termValidates;
89
88
  }
90
89
 
91
90
  verifyFrame(assignments, stated, context) {
@@ -7,8 +7,8 @@ import { define } from "../../elements";
7
7
  import { variableAssignmentFromVariable } from "../../process/assign";
8
8
 
9
9
  export default define(class PropertyAssertion extends Assertion {
10
- constructor(string, node, term, propertyRelation) {
11
- super(string, node);
10
+ constructor(context, string, node, term, propertyRelation) {
11
+ super(context, string, node);
12
12
 
13
13
  this.term = term;
14
14
  this.propertyRelation = propertyRelation;
@@ -22,14 +22,14 @@ export default define(class PropertyAssertion extends Assertion {
22
22
  return this.propertyRelation;
23
23
  }
24
24
 
25
- matchTermAndPropertyRelation(term, propertyRelation, context) {
26
- let propertyMatchesTermAndPropertyRelation = false;
25
+ compareTermAndPropertyRelation(term, propertyRelation, context) {
26
+ let comparesToTermAndPropertyRelation = false;
27
27
 
28
28
  const termString = term.getString(),
29
29
  propertyRelationString = propertyRelation.getString(),
30
- propertyAssertionString = this.getString();
30
+ propertyAssertionString = this.getString(); ///
31
31
 
32
- context.trace(`Matching the '${termString}' term and '${propertyRelationString}' property relation against the '${propertyAssertionString}' property assertion...`);
32
+ context.trace(`Comparing the '${propertyAssertionString}' property assertion to the '${termString}' term and '${propertyRelationString}' property relation...`);
33
33
 
34
34
  const termA = term,
35
35
  termB = this.term, ///
@@ -38,14 +38,14 @@ export default define(class PropertyAssertion extends Assertion {
38
38
  if (termAEqualToTermB) {
39
39
  const propertyRelationEqualToPropertyRelation = this.propertyRelation.isEqualTo(propertyRelation);
40
40
 
41
- propertyMatchesTermAndPropertyRelation = propertyRelationEqualToPropertyRelation; ///
41
+ comparesToTermAndPropertyRelation = propertyRelationEqualToPropertyRelation; ///
42
42
  }
43
43
 
44
- if (propertyMatchesTermAndPropertyRelation) {
45
- context.debug(`...matched the '${termString}' term and '${propertyRelationString}' property relation against the '${propertyAssertionString}' property assertion.`);
44
+ if (comparesToTermAndPropertyRelation) {
45
+ context.debug(`...compared the '${propertyAssertionString}' property assertion to the '${termString}' term and '${propertyRelationString}' property relation.`);
46
46
  }
47
47
 
48
- return propertyMatchesTermAndPropertyRelation;
48
+ return comparesToTermAndPropertyRelation;
49
49
  }
50
50
 
51
51
  verify(assignments, stated, context) {
@@ -55,9 +55,9 @@ export default define(class PropertyAssertion extends Assertion {
55
55
 
56
56
  context.trace(`Verifying the '${propertyAssertionString}' property assertion...`);
57
57
 
58
- const termVerifies = this.verifyTerm(assignments, stated, context);
58
+ const termValidates = this.validateTerm(assignments, stated, context);
59
59
 
60
- if (termVerifies) {
60
+ if (termValidates) {
61
61
  const propertyRelationVerifies = this.verifyPropertyRelation(assignments, stated, context);
62
62
 
63
63
  if (propertyRelationVerifies) {
@@ -89,24 +89,24 @@ export default define(class PropertyAssertion extends Assertion {
89
89
  return verifies;
90
90
  }
91
91
 
92
- verifyTerm(assignments, stated, context) {
93
- let termVerifies;
92
+ validateTerm(assignments, stated, context) {
93
+ let termValidates;
94
94
 
95
95
  const termString = this.term.getString();
96
96
 
97
- context.trace(`Verifying the '${termString}' term...`);
97
+ context.trace(`Validating the '${termString}' term...`);
98
98
 
99
- termVerifies = this.term.verify(context, () => {
99
+ termValidates = this.term.verify(context, () => {
100
100
  const verifiesAhead = true;
101
101
 
102
102
  return verifiesAhead;
103
103
  });
104
104
 
105
- if (termVerifies) {
106
- context.debug(`...verified the '${termString}' term.`);
105
+ if (termValidates) {
106
+ context.debug(`...validated the '${termString}' term.`);
107
107
  }
108
108
 
109
- return termVerifies;
109
+ return termValidates;
110
110
  }
111
111
 
112
112
  verifyPropertyRelation(assignments, stated, context) {
@@ -126,7 +126,7 @@ export default define(class PropertyAssertion extends Assertion {
126
126
  }
127
127
 
128
128
  verifyWhenStated(assignments, context) {
129
- let verifiesWhenStated = false;
129
+ let verifiesWhenStated;
130
130
 
131
131
  const propertyAssertionString = this.getString(); ///
132
132
 
@@ -6,8 +6,8 @@ import Assertion from "../assertion";
6
6
  import { define } from "../../elements";
7
7
 
8
8
  export default define(class SatisfiesAssertion extends Assertion {
9
- constructor(string, node, signature, reference) {
10
- super(string, node);
9
+ constructor(context, string, node, signature, reference) {
10
+ super(context, string, node);
11
11
 
12
12
  this.signature = signature;
13
13
  this.reference = reference;
@@ -97,9 +97,9 @@ export default define(class SatisfiesAssertion extends Assertion {
97
97
 
98
98
  substitutions = Substitutions.fromNothing();
99
99
 
100
- const signatureMatches = axiom.matchSignature(this.signature, substitutions, context);
100
+ const axiomComparesToSignature = axiom.compareSignature(this.signature, substitutions, context);
101
101
 
102
- if (signatureMatches) {
102
+ if (axiomComparesToSignature) {
103
103
  const substitutionsB = substitutions; ///
104
104
 
105
105
  substitutions = Substitutions.fromNothing();
@@ -108,9 +108,9 @@ export default define(class SatisfiesAssertion extends Assertion {
108
108
 
109
109
  if (statementUnifies) {
110
110
  const substitutionsA = substitutions, ///
111
- substitutionsMatch = substitutionsA.correlateSubstitutions(substitutionsB);
111
+ substitutionsCorrelate = substitutionsA.correlateSubstitutions(substitutionsB);
112
112
 
113
- if (!substitutionsMatch) {
113
+ if (!substitutionsCorrelate) {
114
114
  const substitutionsAString = substitutionsA.asString(),
115
115
  substitutionsBString = substitutionsB.asString();
116
116
 
@@ -10,8 +10,8 @@ import { unifyStatement } from "../../process/unify";
10
10
  const { match } = arrayUtilities;
11
11
 
12
12
  export default define(class SubproofAssertion extends Assertion {
13
- constructor(string, node, statements) {
14
- super(string, node);
13
+ constructor(context, string, node, statements) {
14
+ super(context, string, node);
15
15
 
16
16
  this.statements = statements;
17
17
  }
@@ -20,38 +20,40 @@ export default define(class SubproofAssertion extends Assertion {
20
20
  return this.statements;
21
21
  }
22
22
 
23
- verify(assignments, stated, context) {
24
- let verifies;
23
+ validate(assignments, stated, context) {
24
+ let validates = false;
25
25
 
26
26
  const subproofAssertionString = this.getString(); ///
27
27
 
28
- context.trace(`Verifying the '${subproofAssertionString}' subproof assertion...`);
28
+ context.trace(`Validating the '${subproofAssertionString}' subproof assertion...`);
29
29
 
30
- const statementsVerify = this.verifyStatements(assignments, stated, context);
30
+ const statementsValidate = this.validateStatements(assignments, stated, context);
31
31
 
32
- verifies = statementsVerify; ///
32
+ if (statementsValidate) {
33
+ validates = true;
34
+ }
33
35
 
34
- if (verifies) {
35
- context.debug(`...verified the '${subproofAssertionString}' subproof assertion.`);
36
+ if (validates) {
37
+ context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
36
38
  }
37
39
 
38
- return verifies;
40
+ return validates;
39
41
  }
40
42
 
41
- verifyStatements(assignments, stated, context) {
43
+ validateStatements(assignments, stated, context) {
42
44
  stated = true; ///
43
45
 
44
46
  assignments = null; ///
45
47
 
46
- const statementsVerify = this.statements.map((statement) => {
47
- const statementVerifies = statement.verify(assignments, stated, context);
48
+ const statementsValidate = this.statements.map((statement) => {
49
+ const statementValidates = statement.validate(assignments, stated, context);
48
50
 
49
- if (statementVerifies) {
51
+ if (statementValidates) {
50
52
  return true;
51
53
  }
52
54
  });
53
55
 
54
- return statementsVerify;
56
+ return statementsValidate;
55
57
  }
56
58
 
57
59
  unifySubproof(subproof, substitutions, generalContext, specificContext) {
@@ -7,8 +7,8 @@ import { define } from "../../elements";
7
7
  import { variableAssignmentFromVariable } from "../../process/assign";
8
8
 
9
9
  export default define(class TypeAssertion extends Assertion {
10
- constructor(string, node, term, type) {
11
- super(string, node);
10
+ constructor(context, string, node, term, type) {
11
+ super(context, string, node);
12
12
 
13
13
  this.term = term;
14
14
  this.type = type;
@@ -6,6 +6,4 @@ export default class Assertion extends Element {
6
6
  constructor(context, string, node) {
7
7
  super(context, string, node);
8
8
  }
9
-
10
- matchAssertionNode(assertionNode) { return this.node.match(assertionNode); }
11
9
  }
@@ -31,13 +31,13 @@ export default define(class Assumption extends Element {
31
31
  return simple;
32
32
  }
33
33
 
34
- matchSubstitution(substitution, context) {
35
- let substitutionMatches = false;
34
+ compareSubstitution(substitution, context) {
35
+ let comparesToSubstituion = false;
36
36
 
37
37
  const assumptionString = this.string, ///
38
38
  substitutionString = substitution.getString();
39
39
 
40
- context.trace(`Matching the '${substitutionString}' substitution against the '${assumptionString}' assumption...`);
40
+ context.trace(`Comparing the '${assumptionString}' assumption to the '${substitutionString}' substitution...`);
41
41
 
42
42
  const simple = this.isSimple();
43
43
 
@@ -46,9 +46,12 @@ export default define(class Assumption extends Element {
46
46
  judgement = context.findJudgementByMetavariable(metavariable);
47
47
 
48
48
  if (judgement !== null) {
49
- const assumption = judgement.getDeclaration();
49
+ const assumption = judgement.getDeclaration(),
50
+ assumptionComaresToSubstitution = assumption.compareSubstitution(substitution, context);
50
51
 
51
- substitutionMatches = assumption.matchSubstitution(substitution, context);
52
+ if (assumptionComaresToSubstitution) {
53
+ comparesToSubstituion = true;
54
+ }
52
55
  }
53
56
  } else {
54
57
  const statement = substitution.getStatement(),
@@ -57,15 +60,15 @@ export default define(class Assumption extends Element {
57
60
  referenceMetavariableEqualToMetavariable = this.reference.isMetavariableEqualToMetavariable(metavariable);
58
61
 
59
62
  if (statementEqualToStatement && referenceMetavariableEqualToMetavariable) {
60
- substitutionMatches = true;
63
+ comparesToSubstituion = true;
61
64
  }
62
65
  }
63
66
 
64
- if (substitutionMatches) {
65
- context.debug(`...matches the '${assumptionString}' substitution against the '${substitutionString}' assumption.`);
67
+ if (comparesToSubstituion) {
68
+ context.debug(`...compared the '${substitutionString}' assumption to the '${assumptionString}' substitution.`);
66
69
  }
67
70
 
68
- return substitutionMatches;
71
+ return comparesToSubstituion;
69
72
  }
70
73
 
71
74
  verify(assignments, stated, context) {
@@ -85,9 +88,9 @@ export default define(class Assumption extends Element {
85
88
  const referenceVerified = this.verifyReference(assignments, stated, context);
86
89
 
87
90
  if (referenceVerified) {
88
- const statementVerifies = this.verifyStatement(assignments, stated, context);
91
+ const statementValidates = this.validateStatement(assignments, stated, context);
89
92
 
90
- if (statementVerifies) {
93
+ if (statementValidates) {
91
94
  let verifiesWhenStated = false,
92
95
  verifiesWhenDerived = false;
93
96
 
@@ -128,28 +131,28 @@ export default define(class Assumption extends Element {
128
131
  return referenceVerified;
129
132
  }
130
133
 
131
- verifyStatement(assignments, stated, context) {
132
- let statementVerifies;
134
+ validateStatement(assignments, stated, context) {
135
+ let statementValidates;
133
136
 
134
137
  if (this.statement === null) {
135
- statementVerifies = true;
138
+ statementValidates = true;
136
139
  } else {
137
140
  const statementString = this.statement.getString();
138
141
 
139
- context.trace(`Verifying the '${statementString}' statement...`);
142
+ context.trace(`Validating the '${statementString}' statement...`);
140
143
 
141
144
  stated = true; ///
142
145
 
143
146
  assignments = null; ///
144
147
 
145
- statementVerifies = this.statement.verify(assignments, stated, context);
148
+ statementValidates = this.statement.validate(assignments, stated, context);
146
149
 
147
- if (statementVerifies) {
148
- context.debug(`...verified the '${statementString}' statement.`);
150
+ if (statementValidates) {
151
+ context.debug(`...validated the '${statementString}' statement.`);
149
152
  }
150
153
  }
151
154
 
152
- return statementVerifies;
155
+ return statementValidates;
153
156
  }
154
157
 
155
158
  verifyReferenceAsMetavariable(assignments, stated, context) {
@@ -56,8 +56,8 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
56
56
  return signatureVerifies;
57
57
  }
58
58
 
59
- matchSignature(signature, substitutions, context) {
60
- let signatureMatches = false;
59
+ compareSignature(signature, substitutions, context) {
60
+ let comparesToSignature = false;
61
61
 
62
62
  const satisfiable = this.isSatisfiable();
63
63
 
@@ -73,10 +73,10 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
73
73
 
74
74
  const generalContext = context; ///
75
75
 
76
- signatureMatches = signatureA.match(signatureB, substitutions, generalContext, specificContext);
76
+ comparesToSignature = signatureA.compare(signatureB, substitutions, generalContext, specificContext);
77
77
  }
78
78
 
79
- return signatureMatches;
79
+ return comparesToSignature;
80
80
  }
81
81
 
82
82
  unifyStep(step, substitutions, context) {
@@ -93,7 +93,7 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
93
93
  const unconditional = this.isUnconditional();
94
94
 
95
95
  if (!unconditional) {
96
- context.trace(`Cannot unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional.`, node);
96
+ context.trace(`Unable to unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional.`, node);
97
97
  } else {
98
98
  const statement = step.getStatement(),
99
99
  statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
@@ -145,7 +145,7 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
145
145
  const unconditional = this.isUnconditional();
146
146
 
147
147
  if (unconditional) {
148
- context.trace(`Cannot unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
148
+ context.trace(`Unable to unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
149
149
  } else {
150
150
  const lastStep = subproof.getLastStep(),
151
151
  lastStepUnifies = this.unifyLastStep(lastStep, substitutions, context);
@@ -213,17 +213,13 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
213
213
  if (generalSuppositionsLength === specificSuppositionsLength) {
214
214
  suppositions = specificSuppositions; ///
215
215
 
216
- const suppositionsMatch = suppositions.every((supposition, index) => {
216
+ suppositionsUnify = suppositions.every((supposition, index) => {
217
217
  const suppositionUnifies = this.unifySupposition(supposition, index, substitutions, generalContext, specificContext);
218
218
 
219
219
  if (suppositionUnifies) {
220
220
  return true;
221
221
  }
222
222
  });
223
-
224
- if (suppositionsMatch) {
225
- suppositionsUnify = true;
226
- }
227
223
  }
228
224
 
229
225
  return suppositionsUnify;