occam-verify-cli 1.0.438 → 1.0.448

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/lib/context/file.js +42 -39
  2. package/lib/context/local.js +34 -34
  3. package/lib/context/release.js +3 -7
  4. package/lib/context/temporary.js +26 -26
  5. package/lib/element/assertion/contained.js +45 -45
  6. package/lib/element/assertion/defined.js +13 -13
  7. package/lib/element/assertion/property.js +23 -22
  8. package/lib/element/assertion/satisfies.js +7 -6
  9. package/lib/element/assertion/subproof.js +20 -17
  10. package/lib/element/assertion/type.js +3 -2
  11. package/lib/element/assertion.js +1 -23
  12. package/lib/element/assumption.js +24 -22
  13. package/lib/element/axiom.js +27 -30
  14. package/lib/element/axiomLemmaTheoremConjecture.js +50 -57
  15. package/lib/element/{statement/combinator → combinator}/bracketed.js +16 -16
  16. package/lib/element/combinator.js +229 -0
  17. package/lib/element/conclusion.js +11 -9
  18. package/lib/element/{term/constructor → constructor}/bracketed.js +5 -5
  19. package/lib/element/constructor.js +232 -0
  20. package/lib/element/declaration/combinator.js +2 -16
  21. package/lib/element/declaration/complexType.js +12 -12
  22. package/lib/element/declaration/constructor.js +13 -11
  23. package/lib/element/declaration/simpleType.js +4 -4
  24. package/lib/element/declaration/typePrefix.js +2 -2
  25. package/lib/element/declaration/variable.js +3 -3
  26. package/lib/element/deduction.js +11 -9
  27. package/lib/element/derivation.js +17 -20
  28. package/lib/element/equivalence.js +10 -10
  29. package/lib/element/equivalences.js +5 -5
  30. package/lib/element/frame.js +32 -38
  31. package/lib/element/hypothesis.js +16 -57
  32. package/lib/element/judgement.js +6 -4
  33. package/lib/element/label.js +8 -8
  34. package/lib/element/metaLemmaMetatheorem.js +6 -39
  35. package/lib/element/metaType.js +17 -80
  36. package/lib/element/metavariable.js +38 -34
  37. package/lib/element/parameter.js +3 -3
  38. package/lib/element/premise.js +92 -174
  39. package/lib/element/proof.js +7 -7
  40. package/lib/element/proofAssertion.js +203 -0
  41. package/lib/element/property.js +9 -9
  42. package/lib/element/propertyRelation.js +13 -13
  43. package/lib/element/reference.js +16 -17
  44. package/lib/element/rule.js +46 -46
  45. package/lib/element/signature.js +11 -11
  46. package/lib/element/statement.js +18 -18
  47. package/lib/element/step.js +73 -124
  48. package/lib/element/subDerivation.js +17 -20
  49. package/lib/element/subproof.js +16 -24
  50. package/lib/element/substitution/frame.js +1 -7
  51. package/lib/element/substitution/reference.js +2 -3
  52. package/lib/element/substitution/statement.js +44 -15
  53. package/lib/element/substitution/term.js +10 -57
  54. package/lib/element/substitution.js +5 -11
  55. package/lib/element/substitutions.js +29 -29
  56. package/lib/element/supposition.js +95 -177
  57. package/lib/element/term.js +21 -34
  58. package/lib/element/type.js +47 -60
  59. package/lib/element/typePrefix.js +5 -5
  60. package/lib/element/variable.js +9 -9
  61. package/lib/element.js +9 -3
  62. package/lib/metaTypes.js +63 -0
  63. package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
  64. package/lib/node/body/axiom.js +2 -25
  65. package/lib/node/body/conjecture.js +2 -25
  66. package/lib/node/body/lemma.js +2 -25
  67. package/lib/node/body/metaLemma.js +2 -25
  68. package/lib/node/body/metatheorem.js +2 -25
  69. package/lib/node/body/rule.js +15 -1
  70. package/lib/node/body/theorem.js +2 -25
  71. package/lib/node/body.js +25 -2
  72. package/lib/node/combinator.js +11 -2
  73. package/lib/node/constructor.js +11 -2
  74. package/lib/node/declaration/combinator.js +5 -5
  75. package/lib/node/declaration/constructor.js +8 -8
  76. package/lib/node/declaration/property.js +15 -15
  77. package/lib/node/declaration/simpleType.js +31 -31
  78. package/lib/node/declaration/variable.js +8 -8
  79. package/lib/node/equality.js +8 -8
  80. package/lib/node/frame.js +20 -20
  81. package/lib/node/header.js +22 -22
  82. package/lib/node/metaLemmaMetaTheorem.js +16 -16
  83. package/lib/node/metavariable.js +15 -15
  84. package/lib/node/property.js +8 -8
  85. package/lib/node/propertyRelation.js +8 -8
  86. package/lib/node/rule.js +16 -16
  87. package/lib/node/statement.js +12 -12
  88. package/lib/node/step.js +22 -22
  89. package/lib/node/subDerivation.js +1 -8
  90. package/lib/node/subproof.js +5 -12
  91. package/lib/node/substitution/frame.js +19 -19
  92. package/lib/node/substitution/statement.js +19 -19
  93. package/lib/node/substitution/term.js +19 -19
  94. package/lib/node/term.js +35 -35
  95. package/lib/preamble.js +5 -5
  96. package/lib/process/instantiate.js +20 -2
  97. package/lib/process/unify.js +39 -42
  98. package/lib/process/validate.js +431 -0
  99. package/lib/process/verify.js +44 -135
  100. package/lib/types.js +27 -0
  101. package/lib/utilities/brackets.js +9 -14
  102. package/lib/utilities/element.js +91 -55
  103. package/lib/utilities/instance.js +41 -28
  104. package/lib/utilities/statement.js +2 -2
  105. package/lib/utilities/string.js +25 -14
  106. package/lib/utilities/unification.js +237 -0
  107. package/lib/utilities/validation.js +251 -0
  108. package/package.json +6 -6
  109. package/src/context/file.js +40 -34
  110. package/src/context/local.js +34 -34
  111. package/src/context/release.js +2 -6
  112. package/src/context/temporary.js +15 -15
  113. package/src/element/assertion/contained.js +19 -20
  114. package/src/element/assertion/defined.js +11 -12
  115. package/src/element/assertion/property.js +20 -20
  116. package/src/element/assertion/satisfies.js +6 -6
  117. package/src/element/assertion/subproof.js +17 -15
  118. package/src/element/assertion/type.js +2 -2
  119. package/src/element/assertion.js +0 -2
  120. package/src/element/assumption.js +22 -19
  121. package/src/element/axiom.js +33 -37
  122. package/src/element/axiomLemmaTheoremConjecture.js +54 -73
  123. package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
  124. package/src/element/combinator.js +90 -0
  125. package/src/element/conclusion.js +12 -10
  126. package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
  127. package/src/element/{term/constructor.js → constructor.js} +17 -25
  128. package/src/element/declaration/combinator.js +1 -22
  129. package/src/element/declaration/complexType.js +11 -11
  130. package/src/element/declaration/constructor.js +13 -10
  131. package/src/element/declaration/simpleType.js +3 -3
  132. package/src/element/declaration/typePrefix.js +1 -1
  133. package/src/element/declaration/variable.js +2 -2
  134. package/src/element/deduction.js +12 -9
  135. package/src/element/derivation.js +15 -19
  136. package/src/element/equivalence.js +8 -8
  137. package/src/element/equivalences.js +4 -4
  138. package/src/element/frame.js +28 -30
  139. package/src/element/hypothesis.js +16 -18
  140. package/src/element/judgement.js +6 -3
  141. package/src/element/label.js +4 -4
  142. package/src/element/metaLemmaMetatheorem.js +5 -69
  143. package/src/element/metaType.js +9 -45
  144. package/src/element/metavariable.js +34 -31
  145. package/src/element/parameter.js +2 -2
  146. package/src/element/premise.js +124 -99
  147. package/src/element/proof.js +6 -6
  148. package/src/element/proofAssertion.js +76 -0
  149. package/src/element/property.js +6 -6
  150. package/src/element/propertyRelation.js +11 -11
  151. package/src/element/reference.js +14 -21
  152. package/src/element/rule.js +39 -38
  153. package/src/element/signature.js +10 -9
  154. package/src/element/statement.js +16 -18
  155. package/src/element/step.js +78 -78
  156. package/src/element/subDerivation.js +15 -19
  157. package/src/element/subproof.js +11 -19
  158. package/src/element/substitution/frame.js +0 -2
  159. package/src/element/substitution/reference.js +1 -5
  160. package/src/element/substitution/statement.js +44 -14
  161. package/src/element/substitution/term.js +10 -13
  162. package/src/element/substitution.js +3 -5
  163. package/src/element/substitutions.js +48 -30
  164. package/src/element/supposition.js +127 -108
  165. package/src/element/term.js +18 -28
  166. package/src/element/type.js +42 -36
  167. package/src/element/typePrefix.js +3 -3
  168. package/src/element/variable.js +7 -7
  169. package/src/element.js +3 -1
  170. package/src/metaTypes.js +55 -0
  171. package/src/node/axiomLemmaTheoremConjecture.js +6 -6
  172. package/src/node/body/axiom.js +0 -21
  173. package/src/node/body/conjecture.js +0 -23
  174. package/src/node/body/lemma.js +0 -23
  175. package/src/node/body/metaLemma.js +0 -23
  176. package/src/node/body/metatheorem.js +0 -23
  177. package/src/node/body/rule.js +12 -0
  178. package/src/node/body/theorem.js +0 -23
  179. package/src/node/body.js +23 -0
  180. package/src/node/combinator.js +9 -0
  181. package/src/node/constructor.js +9 -0
  182. package/src/node/declaration/combinator.js +5 -5
  183. package/src/node/declaration/constructor.js +8 -8
  184. package/src/node/declaration/property.js +14 -14
  185. package/src/node/declaration/simpleType.js +31 -31
  186. package/src/node/declaration/variable.js +7 -7
  187. package/src/node/equality.js +7 -7
  188. package/src/node/frame.js +21 -21
  189. package/src/node/header.js +22 -22
  190. package/src/node/metaLemmaMetaTheorem.js +14 -14
  191. package/src/node/metavariable.js +14 -14
  192. package/src/node/property.js +7 -7
  193. package/src/node/propertyRelation.js +7 -7
  194. package/src/node/rule.js +15 -15
  195. package/src/node/statement.js +12 -12
  196. package/src/node/step.js +21 -21
  197. package/src/node/subDerivation.js +0 -7
  198. package/src/node/subproof.js +4 -11
  199. package/src/node/substitution/frame.js +18 -18
  200. package/src/node/substitution/statement.js +18 -18
  201. package/src/node/substitution/term.js +18 -18
  202. package/src/node/term.js +34 -34
  203. package/src/preamble.js +4 -4
  204. package/src/process/instantiate.js +12 -0
  205. package/src/process/unify.js +53 -57
  206. package/src/process/validate.js +316 -0
  207. package/src/process/verify.js +50 -138
  208. package/src/types.js +18 -0
  209. package/src/utilities/brackets.js +15 -14
  210. package/src/utilities/element.js +125 -82
  211. package/src/utilities/instance.js +42 -24
  212. package/src/utilities/statement.js +2 -2
  213. package/src/utilities/string.js +38 -24
  214. package/src/{mixins/step/unify.js → utilities/unification.js} +99 -85
  215. package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
  216. package/lib/element/statement/combinator.js +0 -105
  217. package/lib/element/term/constructor.js +0 -172
  218. package/lib/mixins/statement/validate.js +0 -198
  219. package/lib/mixins/step/unify.js +0 -228
  220. package/lib/mixins/term/verify.js +0 -65
  221. package/src/element/statement/combinator.js +0 -59
  222. package/src/mixins/term/verify.js +0 -81
@@ -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;
@@ -10,41 +10,37 @@ import { define } from "../elements";
10
10
  const { last } = arrayUtilities;
11
11
 
12
12
  export default define(class Derivation extends Element {
13
- constructor(context, string, node, stepsOrSubproofs) {
13
+ constructor(context, string, node, subproofOrProofAssertions) {
14
14
  super(context, string, node);
15
15
 
16
- this.stepsOrSubproofs = stepsOrSubproofs;
16
+ this.subproofOrProofAssertions = subproofOrProofAssertions;
17
17
  }
18
18
 
19
- getStepsOrSubproofs() {
20
- return this.stepsOrSubproofs;
19
+ getSubproofOrProofAssertions() {
20
+ return this.subproofOrProofAssertions;
21
21
  }
22
22
 
23
- getLastStep() {
24
- const lastStepOrSubproof = last(this.stepsOrSubproofs),
25
- lastStep = lastStepOrSubproof; ///
23
+ getLastProofAssertion() {
24
+ const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
25
+ lastProofAssertion = lastSubproofOrProofAssertion; ///
26
26
 
27
- return lastStep;
27
+ return lastProofAssertion;
28
28
  }
29
29
 
30
30
  verify(substitutions, context) {
31
31
  let verifies;
32
32
 
33
- verifies = this.stepsOrSubproofs.every((stepOrSubproof) => { ///
33
+ verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
34
34
  const assignments = [],
35
- stepOrSubproofValidates = stepOrSubproof.validate(substitutions, assignments, context);
35
+ subproofOrProofAssertionVerifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
36
36
 
37
- if (stepOrSubproofValidates) {
38
- const stepOrSubproofUnifies = stepOrSubproof.unify(substitutions, context);
37
+ if (subproofOrProofAssertionVerifies) {
38
+ const assignmentsAssigned = assignAssignments(assignments, context);
39
39
 
40
- if (stepOrSubproofUnifies) {
41
- const assignmentsAssigned = assignAssignments(assignments, context);
40
+ if (assignmentsAssigned) {
41
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
42
42
 
43
- if (assignmentsAssigned) {
44
- context.addStepOrSubproof(stepOrSubproof);
45
-
46
- return true;
47
- }
43
+ return true;
48
44
  }
49
45
  }
50
46
  });
@@ -26,7 +26,7 @@ export default define(class Equivalence extends Element {
26
26
  const termString = term.getString(),
27
27
  equivalenceString = this.asString(); ///
28
28
 
29
- context.trace(`Adding the '${termString}' term to the '${equivalenceString}' equivalence....`);
29
+ context.trace(`Adding the '${termString}' term to the '${equivalenceString}' equivalence...`);
30
30
 
31
31
  const termA = term, ///
32
32
  termPresent = this.someTerm((term) => {
@@ -76,9 +76,9 @@ export default define(class Equivalence extends Element {
76
76
  return type;
77
77
  }
78
78
 
79
- equateTerm(term) {
79
+ compareTerm(term) {
80
80
  const termA = term, ///
81
- termEquates = this.someTerm((term) => {
81
+ comparesToTerm = this.someTerm((term) => {
82
82
  const termB = term, ///
83
83
  termAEqualToTermB = termA.isEqualTo(termB);
84
84
 
@@ -87,14 +87,14 @@ export default define(class Equivalence extends Element {
87
87
  }
88
88
  });
89
89
 
90
- return termEquates;
90
+ return comparesToTerm;
91
91
  }
92
92
 
93
93
  matchTermNode(termNode) {
94
94
  termNode = stripBracketsFromTermNode(termNode); ///
95
95
 
96
96
  const termNodeMatches = this.someTerm((term) => {
97
- const termNodeMatches = term.matchTermNode(termNode);
97
+ const termNodeMatches = term.matchNode(termNode);
98
98
 
99
99
  if (termNodeMatches) {
100
100
  return true;
@@ -137,9 +137,9 @@ export default define(class Equivalence extends Element {
137
137
 
138
138
  isDisjointFrom(equivalence) {
139
139
  const disjointFrom = equivalence.everyTerm((term) => {
140
- const termEquates = this.equateTerm(term);
140
+ const comparesToTerm = this.compareTerm(term);
141
141
 
142
- if (!termEquates) {
142
+ if (!comparesToTerm) {
143
143
  return true;
144
144
  }
145
145
  });
@@ -196,7 +196,7 @@ export default define(class Equivalence extends Element {
196
196
  if (termGrounded) {
197
197
  const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
198
198
  const groundedTermNode = groundedTerm.getNode(),
199
- groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
199
+ groundedTermNodeMatches = term.matchNode(groundedTermNode);
200
200
 
201
201
  if (groundedTermNodeMatches) {
202
202
  return true;
@@ -51,9 +51,9 @@ export default define(class Equivalences extends Element {
51
51
 
52
52
  findEquivalenceByTerm(term) {
53
53
  const equivalence = this.array.find((equivalence) => {
54
- const termEquates = equivalence.equateTerm(term);
54
+ const equivalenceComparesToTerm = equivalence.compareTerm(term);
55
55
 
56
- if (termEquates) {
56
+ if (equivalenceComparesToTerm) {
57
57
  return true;
58
58
  }
59
59
  }) || null;
@@ -63,9 +63,9 @@ export default define(class Equivalences extends Element {
63
63
 
64
64
  findEquivalenceByTermNodes(termNodes) {
65
65
  const equivalence = this.array.find((equivalence) => {
66
- const equivalenceMatchesTerms = equivalence.matchTermNodes(termNodes);
66
+ const termNodeMatches = equivalence.matchTermNodes(termNodes);
67
67
 
68
- if (equivalenceMatchesTerms) {
68
+ if (termNodeMatches) {
69
69
  return true;
70
70
  }
71
71
  }) || null;