occam-verify-cli 1.0.611 → 1.0.617

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 (151) hide show
  1. package/lib/context/ephemeral.js +59 -31
  2. package/lib/context/file/nominal.js +45 -19
  3. package/lib/context/liminal.js +38 -53
  4. package/lib/context/scoped.js +34 -26
  5. package/lib/context.js +74 -46
  6. package/lib/element/assertion/contained.js +8 -1
  7. package/lib/element/assertion/defined.js +8 -1
  8. package/lib/element/assertion/property.js +8 -1
  9. package/lib/element/assertion/satisfies.js +8 -1
  10. package/lib/element/assertion/subproof.js +8 -1
  11. package/lib/element/assertion/type.js +8 -1
  12. package/lib/element/assertion.js +5 -9
  13. package/lib/element/assumption.js +21 -14
  14. package/lib/element/combinator/bracketed.js +8 -1
  15. package/lib/element/combinator.js +8 -1
  16. package/lib/element/conclusion.js +8 -1
  17. package/lib/element/constructor/bracketed.js +8 -1
  18. package/lib/element/constructor.js +8 -1
  19. package/lib/element/declaration/combinator.js +8 -1
  20. package/lib/element/declaration/complexType.js +8 -1
  21. package/lib/element/declaration/constructor.js +32 -25
  22. package/lib/element/declaration/metavariable.js +9 -9
  23. package/lib/element/declaration/simpleType.js +8 -1
  24. package/lib/element/declaration/typePrefix.js +8 -1
  25. package/lib/element/declaration/variable.js +16 -9
  26. package/lib/element/declaration.js +3 -7
  27. package/lib/element/deduction.js +8 -1
  28. package/lib/element/derivation.js +8 -1
  29. package/lib/element/equality.js +8 -1
  30. package/lib/element/equivalence.js +8 -1
  31. package/lib/element/equivalences.js +8 -1
  32. package/lib/element/error.js +10 -7
  33. package/lib/element/hypothesis.js +8 -1
  34. package/lib/element/judgement.js +9 -2
  35. package/lib/element/label.js +8 -1
  36. package/lib/element/metaType.js +8 -1
  37. package/lib/element/metavariable.js +11 -14
  38. package/lib/element/parameter.js +8 -1
  39. package/lib/element/procedureCall.js +21 -29
  40. package/lib/element/procedureReference.js +15 -1
  41. package/lib/element/proof.js +8 -1
  42. package/lib/element/proofAssertion/premise.js +8 -1
  43. package/lib/element/proofAssertion/step.js +8 -1
  44. package/lib/element/proofAssertion/supposition.js +8 -1
  45. package/lib/element/proofAssertion.js +8 -1
  46. package/lib/element/property.js +8 -1
  47. package/lib/element/propertyRelation.js +8 -1
  48. package/lib/element/reference.js +8 -8
  49. package/lib/element/rule.js +10 -7
  50. package/lib/element/section.js +8 -1
  51. package/lib/element/signature.js +8 -1
  52. package/lib/element/statement.js +12 -16
  53. package/lib/element/subDerivation.js +8 -1
  54. package/lib/element/subproof.js +8 -1
  55. package/lib/element/substitution/frame.js +11 -4
  56. package/lib/element/substitution/reference.js +11 -4
  57. package/lib/element/substitution/statement.js +16 -15
  58. package/lib/element/substitution/term.js +10 -3
  59. package/lib/element/substitution.js +3 -7
  60. package/lib/element/topLevelAssertion/axiom.js +8 -1
  61. package/lib/element/topLevelAssertion/conjecture.js +8 -1
  62. package/lib/element/topLevelAssertion/lemma.js +8 -1
  63. package/lib/element/topLevelAssertion/theorem.js +8 -1
  64. package/lib/element/topLevelAssertion.js +3 -7
  65. package/lib/element/topLevelMetaAssertion/metaLemma.js +8 -1
  66. package/lib/element/topLevelMetaAssertion/metatheorem.js +8 -1
  67. package/lib/element/type.js +8 -1
  68. package/lib/element/typePrefix.js +8 -1
  69. package/lib/element/variable.js +8 -3
  70. package/lib/preamble.js +1 -2
  71. package/lib/process/assign.js +2 -3
  72. package/lib/utilities/element.js +3 -3
  73. package/lib/utilities/substitutions.js +11 -12
  74. package/lib/utilities/unification.js +30 -15
  75. package/package.json +2 -2
  76. package/src/context/ephemeral.js +64 -32
  77. package/src/context/file/nominal.js +82 -17
  78. package/src/context/liminal.js +40 -65
  79. package/src/context/scoped.js +47 -31
  80. package/src/context.js +68 -40
  81. package/src/element/assertion/contained.js +7 -0
  82. package/src/element/assertion/defined.js +7 -0
  83. package/src/element/assertion/property.js +7 -0
  84. package/src/element/assertion/satisfies.js +7 -0
  85. package/src/element/assertion/subproof.js +7 -0
  86. package/src/element/assertion/type.js +7 -0
  87. package/src/element/assertion.js +4 -8
  88. package/src/element/assumption.js +11 -4
  89. package/src/element/combinator/bracketed.js +7 -0
  90. package/src/element/combinator.js +7 -0
  91. package/src/element/conclusion.js +7 -0
  92. package/src/element/constructor/bracketed.js +7 -0
  93. package/src/element/constructor.js +7 -0
  94. package/src/element/declaration/combinator.js +7 -0
  95. package/src/element/declaration/complexType.js +7 -0
  96. package/src/element/declaration/constructor.js +31 -24
  97. package/src/element/declaration/metavariable.js +6 -6
  98. package/src/element/declaration/simpleType.js +7 -0
  99. package/src/element/declaration/typePrefix.js +7 -0
  100. package/src/element/declaration/variable.js +13 -6
  101. package/src/element/declaration.js +1 -3
  102. package/src/element/deduction.js +7 -0
  103. package/src/element/derivation.js +7 -0
  104. package/src/element/equality.js +7 -0
  105. package/src/element/equivalence.js +8 -0
  106. package/src/element/equivalences.js +7 -0
  107. package/src/element/error.js +5 -2
  108. package/src/element/hypothesis.js +7 -0
  109. package/src/element/judgement.js +8 -2
  110. package/src/element/label.js +7 -0
  111. package/src/element/metaType.js +7 -0
  112. package/src/element/metavariable.js +13 -18
  113. package/src/element/parameter.js +7 -0
  114. package/src/element/procedureCall.js +21 -14
  115. package/src/element/procedureReference.js +13 -0
  116. package/src/element/proof.js +7 -0
  117. package/src/element/proofAssertion/premise.js +7 -0
  118. package/src/element/proofAssertion/step.js +7 -0
  119. package/src/element/proofAssertion/supposition.js +7 -0
  120. package/src/element/proofAssertion.js +7 -0
  121. package/src/element/property.js +7 -0
  122. package/src/element/propertyRelation.js +7 -0
  123. package/src/element/reference.js +8 -7
  124. package/src/element/rule.js +8 -9
  125. package/src/element/section.js +7 -0
  126. package/src/element/signature.js +7 -0
  127. package/src/element/statement.js +9 -14
  128. package/src/element/subDerivation.js +7 -0
  129. package/src/element/subproof.js +7 -0
  130. package/src/element/substitution/frame.js +10 -3
  131. package/src/element/substitution/reference.js +10 -3
  132. package/src/element/substitution/statement.js +11 -17
  133. package/src/element/substitution/term.js +9 -2
  134. package/src/element/substitution.js +0 -4
  135. package/src/element/topLevelAssertion/axiom.js +7 -0
  136. package/src/element/topLevelAssertion/conjecture.js +7 -0
  137. package/src/element/topLevelAssertion/lemma.js +7 -0
  138. package/src/element/topLevelAssertion/theorem.js +7 -0
  139. package/src/element/topLevelAssertion.js +1 -9
  140. package/src/element/topLevelMetaAssertion/metaLemma.js +7 -0
  141. package/src/element/topLevelMetaAssertion/metatheorem.js +7 -0
  142. package/src/element/type.js +7 -0
  143. package/src/element/typePrefix.js +7 -0
  144. package/src/element/variable.js +7 -4
  145. package/src/preamble.js +0 -1
  146. package/src/process/assign.js +1 -3
  147. package/src/utilities/element.js +2 -2
  148. package/src/utilities/substitutions.js +8 -12
  149. package/src/utilities/unification.js +2 -4
  150. package/lib/element/substitutions.js +0 -225
  151. package/src/element/substitutions.js +0 -84
package/src/context.js CHANGED
@@ -33,11 +33,25 @@ export default class Context extends ContextBase {
33
33
 
34
34
  getFrames() {
35
35
  const context = this.getContext(),
36
- frames = context.getFrames();
36
+ frames = context.getFrames();
37
37
 
38
38
  return frames;
39
39
  }
40
40
 
41
+ getStatements() {
42
+ const context = this.getContext(),
43
+ statements = context.getStatements();
44
+
45
+ return statements;
46
+ }
47
+
48
+ getReferences() {
49
+ const context = this.getContext(),
50
+ references = context.getReferences();
51
+
52
+ return references;
53
+ }
54
+
41
55
  getSubstitutions() {
42
56
  const context = this.getContext(),
43
57
  substitutions = context.getSubstitutions();
@@ -47,7 +61,7 @@ export default class Context extends ContextBase {
47
61
 
48
62
  getVariables(includeRelease) {
49
63
  const context = this.getContext(),
50
- variables = context.getVariables(includeRelease);
64
+ variables = context.getVariables(includeRelease);
51
65
 
52
66
  return variables;
53
67
  }
@@ -59,6 +73,13 @@ export default class Context extends ContextBase {
59
73
  return combinators;
60
74
  }
61
75
 
76
+ getConstrustors(includeRelease) {
77
+ const context = this.getContext(),
78
+ constructors = context.getConstrustors(includeRelease);
79
+
80
+ return constructors;
81
+ }
82
+
62
83
  getMetavariables(includeRelease) {
63
84
  const context = this.getContext(),
64
85
  metavariables = context.getMetavariables(includeRelease);
@@ -81,20 +102,13 @@ export default class Context extends ContextBase {
81
102
  return metavariable;
82
103
  }
83
104
 
84
- findProcedureByName(name) {
105
+ findProcedureByProcedureName(procedureName) {
85
106
  const context = this.getContext(),
86
- procedure = context.findProcedureByName(name);
107
+ procedure = context.findProcedureByProcedureName(procedureName);
87
108
 
88
109
  return procedure;
89
110
  }
90
111
 
91
- findRuleByReference(reference) {
92
- const context = this.getContext(),
93
- rule = context.findRuleByReference(reference);
94
-
95
- return rule;
96
- }
97
-
98
112
  findFrameByFrameNode(frameNode) {
99
113
  const context = this.getContext(),
100
114
  frame = context.findFrameByFrameNode(frameNode);
@@ -116,46 +130,46 @@ export default class Context extends ContextBase {
116
130
  return reference;
117
131
  }
118
132
 
119
- findTopLevelAssertionByReference(reference) {
133
+ findVariableByVariableIdentifier(variableIdentifier) {
120
134
  const context = this.getContext(),
121
- topLevelAssertion = context.findTopLevelAssertionByReference(reference);
135
+ variable = context.findVariableByVariableIdentifier(variableIdentifier);
122
136
 
123
- return topLevelAssertion;
137
+ return variable;
124
138
  }
125
139
 
126
- findSubstitutionByVariableIdentifier(variableIdentifier) {
140
+ findSubstitutionByMetavariableName(metavariableName) {
127
141
  const context = this.getContext(),
128
- substitution = context.findSubstitutionByVariableIdentifier(variableIdentifier);
142
+ substitution = context.findSubstitutionByMetavariableName(metavariableName);
129
143
 
130
144
  return substitution;
131
145
  }
132
146
 
133
- findSubstitutionByMetavariableName(metavariableName) {
147
+ findMetavariableByMetavariableName(metavariableName) {
134
148
  const context = this.getContext(),
135
- substitution = context.findSubstitutionByMetavariableName(metavariableName);
149
+ metavariable = context.findMetavariableByMetavariableName(metavariableName);
136
150
 
137
- return substitution;
151
+ return metavariable;
138
152
  }
139
153
 
140
- findVariableByVariableIdentifier(variableIdentifier) {
154
+ findSubstitutionByVariableIdentifier(variableIdentifier) {
141
155
  const context = this.getContext(),
142
- variable = context.findVariableByVariableIdentifier(variableIdentifier);
156
+ substitution = context.findSubstitutionByVariableIdentifier(variableIdentifier);
143
157
 
144
- return variable;
158
+ return substitution;
145
159
  }
146
160
 
147
- findMetavariableByMetavariableName(metavariableName) {
161
+ findSimpleSubstitutionByMetavariableName(metavariableName) {
148
162
  const context = this.getContext(),
149
- metavariable = context.findMetavariableByMetavariableName(metavariableName);
163
+ simpleSubstitution = context.findSimpleSubstitutionByMetavariableName(metavariableName);
150
164
 
151
- return metavariable;
165
+ return simpleSubstitution;
152
166
  }
153
167
 
154
- findSimpleSubstitutionByMetavariable(metavariable) {
168
+ findComplexSubstitutionsByMetavariableName(metavariableName) {
155
169
  const context = this.getContext(),
156
- simpleSubstitution = context.findSimpleSubstitutionByMetavariable(metavariable);
170
+ complexSubstitution = context.findComplexSubstitutionsByMetavariableName(metavariableName);
157
171
 
158
- return simpleSubstitution;
172
+ return complexSubstitution;
159
173
  }
160
174
 
161
175
  findSubstitutionByMetavariableNameAndSubstitution(metavariableName, substitution) {
@@ -166,6 +180,20 @@ export default class Context extends ContextBase {
166
180
  return substitution;
167
181
  }
168
182
 
183
+ findRuleByReference(reference) {
184
+ const context = this.getContext(),
185
+ rule = context.findRuleByReference(reference);
186
+
187
+ return rule;
188
+ }
189
+
190
+ findTopLevelAssertionByReference(reference) {
191
+ const context = this.getContext(),
192
+ topLevelAssertion = context.findTopLevelAssertionByReference(reference);
193
+
194
+ return topLevelAssertion;
195
+ }
196
+
169
197
  isTermPresentByTermNode(termNode) {
170
198
  const context = this.getContext(),
171
199
  termPresent = context.isTermPresentByTermNode(termNode);
@@ -173,18 +201,18 @@ export default class Context extends ContextBase {
173
201
  return termPresent;
174
202
  }
175
203
 
176
- isFramePresentByFrameNode(frameNode) {
204
+ isProcedurePresentByProcedureName(procedureName) {
177
205
  const context = this.getContext(),
178
- framePresent = context.isFramePresentByFrameNode(frameNode);
206
+ procedurePresent = context.isProcedurePresentByProcedureName(procedureName);
179
207
 
180
- return framePresent;
208
+ return procedurePresent;
181
209
  }
182
210
 
183
- isJudgementPresentByMetavariableName(metavariableName) {
211
+ isFramePresentByFrameNode(frameNode) {
184
212
  const context = this.getContext(),
185
- judgementPresent = context.isJudgementPresentByMetavariableName(metavariableName);
213
+ framePresent = context.isFramePresentByFrameNode(frameNode);
186
214
 
187
- return judgementPresent;
215
+ return framePresent;
188
216
  }
189
217
 
190
218
  isStatementPresentByStatementNode(statementNode) {
@@ -208,18 +236,18 @@ export default class Context extends ContextBase {
208
236
  return referencePresent;
209
237
  }
210
238
 
211
- isSubstitutionPresentBySubstitutionNode(substitutionNode) {
239
+ isJudgementPresentByMetavariableName(metavariableName) {
212
240
  const context = this.getContext(),
213
- substitutionPresent = context.isSubstitutionPresentBySubstitutionNode(substitutionNode);
241
+ judgementPresent = context.isJudgementPresentByMetavariableName(metavariableName);
214
242
 
215
- return substitutionPresent;
243
+ return judgementPresent;
216
244
  }
217
245
 
218
- isProcedurePresentByName(name) {
246
+ isSubstitutionPresentBySubstitutionNode(substitutionNode) {
219
247
  const context = this.getContext(),
220
- procedurePresent = context.isProcedurePresentByName(name);
248
+ substitutionPresent = context.isSubstitutionPresentBySubstitutionNode(substitutionNode);
221
249
 
222
- return procedurePresent;
250
+ return substitutionPresent;
223
251
  }
224
252
 
225
253
  isLabelPresentByReference(reference) {
@@ -31,6 +31,13 @@ export default define(class ContainedAssertion extends Assertion {
31
31
  return this.statement;
32
32
  }
33
33
 
34
+ getContainedAssertionNode() {
35
+ const node = this.getNode(),
36
+ containedAssertionNode = node; ///
37
+
38
+ return containedAssertionNode;
39
+ }
40
+
34
41
  validate(assignments, stated, context) {
35
42
  let validates = false;
36
43
 
@@ -26,6 +26,13 @@ export default define(class DefinedAssertion extends Assertion {
26
26
  return this.negated;
27
27
  }
28
28
 
29
+ getDefinedAssertionNode() {
30
+ const node = this.getNode(),
31
+ definedAssertionNode = node; ///
32
+
33
+ return definedAssertionNode;
34
+ }
35
+
29
36
  validate(assignments, stated, context) {
30
37
  let validates = false;
31
38
 
@@ -22,6 +22,13 @@ export default define(class PropertyAssertion extends Assertion {
22
22
  return this.propertyRelation;
23
23
  }
24
24
 
25
+ getPropertyAssertionNode() {
26
+ const node = this.getNode(),
27
+ propertyAssertionNode = node; ///
28
+
29
+ return propertyAssertionNode;
30
+ }
31
+
25
32
  compareTermAndPropertyRelation(term, propertyRelation, context) {
26
33
  let comparesToTermAndPropertyRelation = false;
27
34
 
@@ -20,6 +20,13 @@ export default define(class SatisfiesAssertion extends Assertion {
20
20
  return this.reference;
21
21
  }
22
22
 
23
+ getSatisfiesAssertionNode() {
24
+ const node = this.getNode(),
25
+ satisfiesAssertionNode = node; ///
26
+
27
+ return satisfiesAssertionNode;
28
+ }
29
+
23
30
  compareSubstitutions(substitutions, context) { return this.signature.compareSubstitutions(substitutions, context); }
24
31
 
25
32
  correlateSubstitutions(substitutions, context) { return this.signature.correlateSubstitutions(substitutions, context); }
@@ -20,6 +20,13 @@ export default define(class SubproofAssertion extends Assertion {
20
20
  return this.statements;
21
21
  }
22
22
 
23
+ getSubproofAssertionNode() {
24
+ const node = this.getNode(),
25
+ subproofAssertionNode = node; ///
26
+
27
+ return subproofAssertionNode;
28
+ }
29
+
23
30
  validate(assignments, stated, context) {
24
31
  let validates = false;
25
32
 
@@ -22,6 +22,13 @@ export default define(class TypeAssertion extends Assertion {
22
22
  return this.type;
23
23
  }
24
24
 
25
+ getTypeAssertionNBode() {
26
+ const node = this.getNode(),
27
+ typeAssertionNode = node; ///
28
+
29
+ return typeAssertionNode;
30
+ }
31
+
25
32
  verify(assignments, stated, context) {
26
33
  let verifies = false;
27
34
 
@@ -3,10 +3,6 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  export default class Assertion extends Element {
6
- constructor(context, string, node) {
7
- super(context, string, node);
8
- }
9
-
10
6
  getAssertionNode() {
11
7
  const node = this.getNode(),
12
8
  assertionNode = node; ///
@@ -21,9 +17,9 @@ export default class Assertion extends Element {
21
17
 
22
18
  const assertionNodeB = assertionNode, ///
23
19
  assertionNodeAAMatchesAssertionBNodeB = assertionNodeA.match(assertionNodeB),
24
- equalTo = assertionNodeAAMatchesAssertionBNodeB; ///
20
+ assertionNodeMatches = assertionNodeAAMatchesAssertionBNodeB; ///
25
21
 
26
- return equalTo;
22
+ return assertionNodeMatches;
27
23
  }
28
24
 
29
25
  isValid(context) {
@@ -36,8 +32,8 @@ export default class Assertion extends Element {
36
32
 
37
33
  isEqualTo(assertion) {
38
34
  const assertionNode = assertion.getNode(),
39
- assertionNodeMatches = this.matchAssertionNode(assertionNode),
40
- equalTo = assertionNodeMatches; ///
35
+ assertionNodeMatches = this.matchAssertionNode(assertionNode),
36
+ equalTo = assertionNodeMatches; ///
41
37
 
42
38
  return equalTo;
43
39
  }
@@ -14,12 +14,19 @@ export default define(class Assumption extends Element {
14
14
  this.reference = reference;
15
15
  }
16
16
 
17
+ getReference() {
18
+ return this.reference;
19
+ }
20
+
17
21
  getStatement() {
18
22
  return this.statement;
19
23
  }
20
24
 
21
- getReference() {
22
- return this.reference;
25
+ getAssumptionNode() {
26
+ const node = this.getNode(),
27
+ assumptionNode = node; ///
28
+
29
+ return assumptionNode;
23
30
  }
24
31
 
25
32
  getMetavariable() { return this.reference.getMetavariable(); }
@@ -33,9 +40,9 @@ export default define(class Assumption extends Element {
33
40
  context.trace(`Comparing the '${assumptionString}' assumption to the '${substitutionString}' substitution...`);
34
41
 
35
42
  const statement = substitution.getStatement(),
36
- metavariable = substitution.getMetavariable(generalContext, specificContext),
43
+ metavariableName = substitution.getMetavariableName(),
37
44
  statementEqualToStatement = this.statement.isEqualTo(statement),
38
- referenceMetavariableComparesToMetavariable = this.reference.compareMetavariable(metavariable);
45
+ referenceMetavariableComparesToMetavariable = this.reference.compareMetavariableName(metavariableName);
39
46
 
40
47
  if (statementEqualToStatement && referenceMetavariableComparesToMetavariable) {
41
48
  comparesToSubstituion = true;
@@ -5,6 +5,13 @@ import Combinator from "../combinator";
5
5
  import { define } from "../../elements";
6
6
 
7
7
  export default define(class BracketedCombinator extends Combinator {
8
+ getBracketedCombinatorNode() {
9
+ const node = this.getNode(),
10
+ bracketedCombinatorNode = node; ///
11
+
12
+ return bracketedCombinatorNode;
13
+ }
14
+
8
15
  unifyStatement(statement, assignments, stated, context) {
9
16
  let statementUnifies;
10
17
 
@@ -18,6 +18,13 @@ export default define(class Combinator extends Element {
18
18
  return this.statement;
19
19
  }
20
20
 
21
+ getConbinatorNode() {
22
+ const node = this.getNode(),
23
+ combinatorNode = node; ///
24
+
25
+ return combinatorNode;
26
+ }
27
+
21
28
  verify() {
22
29
  let verifies;
23
30
 
@@ -17,6 +17,13 @@ export default define(class Conclusion extends Element {
17
17
  return this.statement;
18
18
  }
19
19
 
20
+ getConclusionNode() {
21
+ const node = this.getNode(),
22
+ conclusionNode = node; ///
23
+
24
+ return conclusionNode;
25
+ }
26
+
20
27
  verify(context) {
21
28
  let verifies = false;
22
29
 
@@ -6,6 +6,13 @@ import Constructor from "../constructor";
6
6
  import { define } from "../../elements";
7
7
 
8
8
  export default define(class BracketedConstructor extends Constructor {
9
+ getBracketedConstructorNode() {
10
+ const node = this.getNode(),
11
+ bracketedConstructorNode = node; ///
12
+
13
+ return bracketedConstructorNode;
14
+ }
15
+
9
16
  unifyTerm(term, context, verifyForwards) {
10
17
  let termUnifies;
11
18
 
@@ -17,6 +17,13 @@ export default define(class Constructor extends Element {
17
17
  return this.term;
18
18
  }
19
19
 
20
+ getConclusionNode() {
21
+ const node = this.getNode(),
22
+ constructorNode = node; ///
23
+
24
+ return constructorNode;
25
+ }
26
+
20
27
  isProvisional() { return this.term.isProvisional(); }
21
28
 
22
29
  getType() { return this.term.getType(); }
@@ -15,6 +15,13 @@ export default define(class CombinatorDeclaration extends Declaration {
15
15
  return this.combinator;
16
16
  }
17
17
 
18
+ getCombinatorDeclarationNode() {
19
+ const node = this.getNode(),
20
+ combinatorDeclarationNode = node; ///
21
+
22
+ return combinatorDeclarationNode;
23
+ }
24
+
18
25
  async verify() {
19
26
  let verifies = false;
20
27
 
@@ -20,6 +20,13 @@ export default define(class ComplexTypeDeclaration extends Declaration {
20
20
  return this.prefixed;
21
21
  }
22
22
 
23
+ getComplexTypeDeclarationNode() {
24
+ const node = this.getNode(),
25
+ complexTypeDeclarationNode = node; ///
26
+
27
+ return complexTypeDeclarationNode;
28
+ }
29
+
23
30
  verifyType() {
24
31
  let typeVerifies = false;
25
32
 
@@ -16,31 +16,11 @@ export default define(class ConstructorDeclaration extends Declaration {
16
16
  return this.constructor;
17
17
  }
18
18
 
19
- async verify() {
20
- let verifies;
21
-
22
- const context = this.getContext(),
23
- constructorDeclarationString = this.getString(); ///
24
-
25
- context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`);
26
-
27
- const constructorTypeVerifies = this.verifyConstructorType();
28
-
29
- if (constructorTypeVerifies) {
30
- const constructorValidates = this.verifyConstructor();
31
-
32
- if (constructorValidates) {
33
- context.addConstructor(this.constructor);
19
+ getConstructorDeclarationNode() {
20
+ const node = this.getNode(),
21
+ constructorDeclarationNode = node; ///
34
22
 
35
- verifies = true;
36
- }
37
- }
38
-
39
- if (verifies) {
40
- context.debug(`...verified the '${constructorDeclarationString}' constructor declaration.`);
41
- }
42
-
43
- return verifies;
23
+ return constructorDeclarationNode;
44
24
  }
45
25
 
46
26
  verifyConstructor() {
@@ -110,5 +90,32 @@ export default define(class ConstructorDeclaration extends Declaration {
110
90
  return constructorTypeVerifies;
111
91
  }
112
92
 
93
+ async verify() {
94
+ let verifies;
95
+
96
+ const context = this.getContext(),
97
+ constructorDeclarationString = this.getString(); ///
98
+
99
+ context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`);
100
+
101
+ const constructorTypeVerifies = this.verifyConstructorType();
102
+
103
+ if (constructorTypeVerifies) {
104
+ const constructorValidates = this.verifyConstructor();
105
+
106
+ if (constructorValidates) {
107
+ context.addConstructor(this.constructor);
108
+
109
+ verifies = true;
110
+ }
111
+ }
112
+
113
+ if (verifies) {
114
+ context.debug(`...verified the '${constructorDeclarationString}' constructor declaration.`);
115
+ }
116
+
117
+ return verifies;
118
+ }
119
+
113
120
  static name = "ConstructorDeclaration";
114
121
  });
@@ -5,21 +5,21 @@ import Declaration from "../declaration";
5
5
  import { define } from "../../elements";
6
6
 
7
7
  export default define(class MetavariableDeclaration extends Declaration {
8
- constructor(context, string, node, metavariable, metaType) {
8
+ constructor(context, string, node, metaType, metavariable) {
9
9
  super(context, string, node);
10
10
 
11
- this.metavariable = metavariable;
12
11
  this.metaType = metaType;
13
- }
14
-
15
- getMetavariable() {
16
- return this.metavariable;
12
+ this.metavariable = metavariable;
17
13
  }
18
14
 
19
15
  getMetaType() {
20
16
  return this.metaType;
21
17
  }
22
18
 
19
+ getMetavariable() {
20
+ return this.metavariable;
21
+ }
22
+
23
23
  verifyMetavariable() {
24
24
  let metavariableVerifies = false;
25
25
 
@@ -16,6 +16,13 @@ export default define(class SimpleTypeDeclaration extends Declaration {
16
16
  return this.type;
17
17
  }
18
18
 
19
+ getSimpleTypeDeclarationNode() {
20
+ const node = this.getNode(),
21
+ simpleTypeDeclarationNode = node; ///
22
+
23
+ return simpleTypeDeclarationNode;
24
+ }
25
+
19
26
  isPrefixed() {
20
27
  return this.prefixed;
21
28
  }
@@ -15,6 +15,13 @@ export default define(class TypePrefixDeclaration extends Declaration {
15
15
  return this.typePrefix;
16
16
  }
17
17
 
18
+ getTypePrefixDeclarationNode() {
19
+ const node = this.getNode(),
20
+ typePrefixDeclarationNode = node; ///
21
+
22
+ return typePrefixDeclarationNode;
23
+ }
24
+
18
25
  verifyTypePrefix() {
19
26
  let typePrefixVerifies = false;
20
27
 
@@ -5,26 +5,33 @@ import Declaration from "../declaration";
5
5
  import { define } from "../../elements";
6
6
 
7
7
  export default define(class VariableDeclaration extends Declaration {
8
- constructor(context, string, node, variable, type, provisional) {
8
+ constructor(context, string, node, type, variable, provisional) {
9
9
  super(context, string, node);
10
10
 
11
- this.variable = variable;
12
11
  this.type = type;
12
+ this.variable = variable;
13
13
  this.provisional = provisional;
14
14
  }
15
15
 
16
- getVariable() {
17
- return this.variable;
18
- }
19
-
20
16
  getType() {
21
17
  return this.type;
22
18
  }
23
19
 
20
+ getVariable() {
21
+ return this.variable;
22
+ }
23
+
24
24
  isProvisional() {
25
25
  return this.provisional;
26
26
  }
27
27
 
28
+ getVariableDeclarationNode() {
29
+ const node = this.getNode(),
30
+ typePrefixDeclarationNode = node; ///
31
+
32
+ return typePrefixDeclarationNode;
33
+ }
34
+
28
35
  verifyType() {
29
36
  let typeVerifies = false;
30
37
 
@@ -3,7 +3,5 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  export default class Declaration extends Element {
6
- constructor(context, string, node) {
7
- super(context, string, node);
8
- }
6
+ ///
9
7
  }
@@ -17,6 +17,13 @@ export default define(class Deduction extends Element {
17
17
  return this.statement;
18
18
  }
19
19
 
20
+ getDeductionNode() {
21
+ const node = this.getNode(),
22
+ deductionNode = node; ///
23
+
24
+ return deductionNode;
25
+ }
26
+
20
27
  verify(context) {
21
28
  let verifies = false;
22
29
 
@@ -21,6 +21,13 @@ export default define(class Derivation extends Element {
21
21
  return this.subproofOrProofAssertions;
22
22
  }
23
23
 
24
+ getDerivationNode() {
25
+ const node = this.getNode(),
26
+ derivationNode = node; ///
27
+
28
+ return derivationNode;
29
+ }
30
+
24
31
  getLastProofAssertion() {
25
32
  const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
26
33
  lastProofAssertion = lastSubproofOrProofAssertion; ///