occam-verify-cli 1.0.230 → 1.0.233

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 (109) hide show
  1. package/lib/context/local.js +1 -14
  2. package/lib/dom/axiom.js +22 -16
  3. package/lib/dom/combinator.js +5 -5
  4. package/lib/dom/conclusion.js +5 -5
  5. package/lib/dom/conjecture.js +9 -9
  6. package/lib/dom/constructor.js +5 -5
  7. package/lib/dom/declaration/combinator.js +14 -14
  8. package/lib/dom/declaration/complexType.js +35 -35
  9. package/lib/dom/declaration/constructor.js +19 -19
  10. package/lib/dom/declaration/metavariable.js +22 -22
  11. package/lib/dom/declaration/simpleType.js +23 -23
  12. package/lib/dom/declaration/variable.js +20 -20
  13. package/lib/dom/declaration.js +4 -2
  14. package/lib/dom/deduction.js +5 -5
  15. package/lib/dom/derivation.js +5 -5
  16. package/lib/dom/error.js +9 -9
  17. package/lib/dom/hypothesis.js +260 -0
  18. package/lib/dom/label.js +18 -24
  19. package/lib/dom/lemma.js +7 -7
  20. package/lib/dom/metaLemma.js +9 -9
  21. package/lib/dom/metaType.js +4 -10
  22. package/lib/dom/metatheorem.js +9 -9
  23. package/lib/dom/metavariable.js +7 -8
  24. package/lib/dom/parameter.js +2 -2
  25. package/lib/dom/premise.js +5 -5
  26. package/lib/dom/procedureCall.js +11 -10
  27. package/lib/dom/proof.js +3 -3
  28. package/lib/dom/property.js +9 -9
  29. package/lib/dom/reference.js +23 -22
  30. package/lib/dom/rule.js +25 -25
  31. package/lib/dom/section.js +146 -0
  32. package/lib/dom/signature.js +5 -5
  33. package/lib/dom/statement.js +25 -20
  34. package/lib/dom/step.js +3 -3
  35. package/lib/dom/subDerivation.js +5 -5
  36. package/lib/dom/subproof.js +7 -7
  37. package/lib/dom/substitution/statement.js +3 -3
  38. package/lib/dom/supposition.js +5 -5
  39. package/lib/dom/term.js +5 -6
  40. package/lib/dom/theorem.js +9 -9
  41. package/lib/dom/topLevelAssertion.js +22 -22
  42. package/lib/dom/topLevelMetaAssertion.js +14 -14
  43. package/lib/dom/type.js +21 -21
  44. package/lib/dom/variable.js +9 -15
  45. package/lib/index.js +3 -1
  46. package/lib/node/hypothesis.js +123 -0
  47. package/lib/node/section.js +116 -0
  48. package/lib/nonTerminalNodeMap.js +5 -3
  49. package/lib/ruleNames.js +9 -1
  50. package/lib/utilities/json.js +59 -59
  51. package/lib/utilities/subproof.js +10 -10
  52. package/lib/verifier/combinator.js +9 -10
  53. package/lib/verifier/constructor.js +10 -11
  54. package/lib/verifier/topLevel.js +38 -31
  55. package/package.json +2 -2
  56. package/src/context/local.js +0 -14
  57. package/src/dom/axiom.js +30 -29
  58. package/src/dom/combinator.js +4 -4
  59. package/src/dom/conclusion.js +5 -5
  60. package/src/dom/conjecture.js +8 -8
  61. package/src/dom/constructor.js +4 -4
  62. package/src/dom/declaration/combinator.js +14 -14
  63. package/src/dom/declaration/complexType.js +35 -35
  64. package/src/dom/declaration/constructor.js +20 -20
  65. package/src/dom/declaration/metavariable.js +22 -22
  66. package/src/dom/declaration/simpleType.js +22 -22
  67. package/src/dom/declaration/variable.js +21 -21
  68. package/src/dom/declaration.js +5 -3
  69. package/src/dom/deduction.js +5 -5
  70. package/src/dom/derivation.js +5 -5
  71. package/src/dom/error.js +8 -8
  72. package/src/dom/hypothesis.js +230 -0
  73. package/src/dom/label.js +17 -19
  74. package/src/dom/lemma.js +8 -8
  75. package/src/dom/metaLemma.js +8 -8
  76. package/src/dom/metaType.js +2 -6
  77. package/src/dom/metatheorem.js +8 -8
  78. package/src/dom/metavariable.js +9 -12
  79. package/src/dom/parameter.js +1 -1
  80. package/src/dom/premise.js +8 -8
  81. package/src/dom/procedureCall.js +9 -9
  82. package/src/dom/proof.js +2 -2
  83. package/src/dom/property.js +8 -8
  84. package/src/dom/reference.js +23 -27
  85. package/src/dom/rule.js +30 -30
  86. package/src/dom/section.js +70 -0
  87. package/src/dom/signature.js +4 -4
  88. package/src/dom/statement.js +24 -32
  89. package/src/dom/step.js +4 -4
  90. package/src/dom/subDerivation.js +5 -5
  91. package/src/dom/subproof.js +8 -8
  92. package/src/dom/substitution/statement.js +5 -5
  93. package/src/dom/supposition.js +7 -7
  94. package/src/dom/term.js +3 -8
  95. package/src/dom/theorem.js +7 -7
  96. package/src/dom/topLevelAssertion.js +29 -30
  97. package/src/dom/topLevelMetaAssertion.js +20 -20
  98. package/src/dom/type.js +22 -22
  99. package/src/dom/variable.js +8 -11
  100. package/src/index.js +2 -0
  101. package/src/node/hypothesis.js +23 -0
  102. package/src/node/section.js +16 -0
  103. package/src/nonTerminalNodeMap.js +7 -1
  104. package/src/ruleNames.js +2 -0
  105. package/src/utilities/json.js +58 -58
  106. package/src/utilities/subproof.js +10 -10
  107. package/src/verifier/combinator.js +6 -11
  108. package/src/verifier/constructor.js +9 -12
  109. package/src/verifier/topLevel.js +42 -30
@@ -74,19 +74,19 @@ export default domAssigned(class Conclusion {
74
74
 
75
75
  static name = "Conclusion";
76
76
 
77
- static fromJSON(json, fileContext) {
78
- const statement = statementFromJSON(json, fileContext),
77
+ static fromJSON(json, context) {
78
+ const statement = statementFromJSON(json, context),
79
79
  string = statement.getString(),
80
80
  conclusion = new Conclusion(string, statement);
81
81
 
82
82
  return conclusion;
83
83
  }
84
84
 
85
- static fromConclusionNode(conclusionNode, fileContext) {
85
+ static fromConclusionNode(conclusionNode, context) {
86
86
  const { Statement } = dom,
87
87
  node = conclusionNode, ///
88
- string = fileContext.nodeAsString(node),
89
- statement = Statement.fromConclusionNode(conclusionNode, fileContext),
88
+ string = context.nodeAsString(node),
89
+ statement = Statement.fromConclusionNode(conclusionNode, context),
90
90
  conclusion = new Conclusion(string, statement);
91
91
 
92
92
  return conclusion;
@@ -8,20 +8,20 @@ export default domAssigned(class Conjecture extends TopLevelAssertion {
8
8
  verify() {
9
9
  let verifies;
10
10
 
11
- const conjecture = this, ///
12
- fileContext = this.getFileContext(),
11
+ const context = this.getContext(),
12
+ conjecture = this, ///
13
13
  conjectureString = conjecture.getString();
14
14
 
15
- fileContext.trace(`Verifying the '${conjectureString}' conjecture...`);
15
+ context.trace(`Verifying the '${conjectureString}' conjecture...`);
16
16
 
17
17
  verifies = super.verify();
18
18
 
19
19
  if (verifies) {
20
20
  const conjecture = this; ///
21
21
 
22
- fileContext.addConjecture(conjecture);
22
+ context.addConjecture(conjecture);
23
23
 
24
- fileContext.debug(`...verified the '${conjectureString}' conjecture.`);
24
+ context.debug(`...verified the '${conjectureString}' conjecture.`);
25
25
  }
26
26
 
27
27
  return verifies;
@@ -29,11 +29,11 @@ export default domAssigned(class Conjecture extends TopLevelAssertion {
29
29
 
30
30
  static name = "Conjecture";
31
31
 
32
- static fromJSON(json, fileContext) { return TopLevelAssertion.fromJSON(Conjecture, json, fileContext); }
32
+ static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Conjecture, json, context); }
33
33
 
34
- static fromConjectureNode(conjectureNode, fileContext) {
34
+ static fromConjectureNode(conjectureNode, context) {
35
35
  const node = conjectureNode, ///
36
- conjecture = TopLevelAssertion.fromNode(Conjecture, node, fileContext);
36
+ conjecture = TopLevelAssertion.fromNode(Conjecture, node, context);
37
37
 
38
38
  return conjecture;
39
39
  }
@@ -67,17 +67,17 @@ export default domAssigned(class Constructor {
67
67
  return json;
68
68
  }
69
69
 
70
- static fromJSON(json, fileContext) {
71
- const term = termFromJSON(json, fileContext),
70
+ static fromJSON(json, context) {
71
+ const term = termFromJSON(json, context),
72
72
  string = stringFromTerm(term),
73
73
  constructor = new Constructor(string, term);
74
74
 
75
75
  return constructor;
76
76
  }
77
77
 
78
- static fromConstructorDeclarationNode(constructorDeclarationNode, fileContext) {
78
+ static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
79
79
  const { Term } = dom,
80
- term = Term.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
80
+ term = Term.fromConstructorDeclarationNode(constructorDeclarationNode, context),
81
81
  string = stringFromTerm(term),
82
82
  constructor = new Constructor(string, term);
83
83
 
@@ -7,14 +7,14 @@ import { domAssigned } from "../../dom";
7
7
  import combinatorVerifier from "../../verifier/combinator";
8
8
 
9
9
  export default domAssigned(class CombinatorDeclaration {
10
- constructor(fileContext, string, combinator) {
11
- this.fileContext = fileContext;
10
+ constructor(context, string, combinator) {
11
+ this.context = context;
12
12
  this.string = string;
13
13
  this.combinator = combinator;
14
14
  }
15
15
 
16
- getFileContext() {
17
- return this.fileContext;
16
+ getContext() {
17
+ return this.context;
18
18
  }
19
19
 
20
20
  getString() {
@@ -30,18 +30,18 @@ export default domAssigned(class CombinatorDeclaration {
30
30
 
31
31
  const combinatorDeclarationString = this.getString(); ///
32
32
 
33
- this.fileContext.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`);
33
+ this.context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`);
34
34
 
35
35
  const combinatorVerifies = this.verifyCombinator();
36
36
 
37
37
  if (combinatorVerifies) {
38
- this.fileContext.addCombinator(this.combinator);
38
+ this.context.addCombinator(this.combinator);
39
39
 
40
40
  verifies = true;
41
41
  }
42
42
 
43
43
  if (verifies) {
44
- this.fileContext.debug(`...verified the '${combinatorDeclarationString}' combinator declaration.`);
44
+ this.context.debug(`...verified the '${combinatorDeclarationString}' combinator declaration.`);
45
45
  }
46
46
 
47
47
  return verifies;
@@ -52,15 +52,15 @@ export default domAssigned(class CombinatorDeclaration {
52
52
 
53
53
  const combinatorString = this.combinator.getString();
54
54
 
55
- this.fileContext.trace(`Verifying the '${combinatorString}' combinator...`);
55
+ this.context.trace(`Verifying the '${combinatorString}' combinator...`);
56
56
 
57
57
  const statement = this.combinator.getStatement(),
58
58
  statementNode = statement.getNode();
59
59
 
60
- statementVerifies = combinatorVerifier.verifyStatement(statementNode, this.fileContext);
60
+ statementVerifies = combinatorVerifier.verifyStatement(statementNode, this.context);
61
61
 
62
62
  if (statementVerifies) {
63
- this.fileContext.debug(`...verified the '${combinatorString}' combinator.`);
63
+ this.context.debug(`...verified the '${combinatorString}' combinator.`);
64
64
  }
65
65
 
66
66
  return statementVerifies;
@@ -68,12 +68,12 @@ export default domAssigned(class CombinatorDeclaration {
68
68
 
69
69
  static name = "CombinatorDeclaration";
70
70
 
71
- static fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext) {
71
+ static fromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
72
72
  const { Combinator } = dom,
73
73
  node = combinatorDeclarationNode, ///
74
- string = fileContext.nodeAsString(node),
75
- combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext),
76
- combinatorDeclaration = new CombinatorDeclaration(fileContext, string, combinator);
74
+ string = context.nodeAsString(node),
75
+ combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
76
+ combinatorDeclaration = new CombinatorDeclaration(context, string, combinator);
77
77
 
78
78
  return combinatorDeclaration;
79
79
  }
@@ -7,14 +7,14 @@ import { domAssigned } from "../../dom";
7
7
  import { stringFromTypeNameNameAndSuperTypes } from "../../utilities/type";
8
8
 
9
9
  export default domAssigned(class ComplexTypeDeclaration {
10
- constructor(fileContext, string, type) {
11
- this.fileContext = fileContext;
10
+ constructor(context, string, type) {
11
+ this.context = context;
12
12
  this.string = string;
13
13
  this.type = type;
14
14
  }
15
15
 
16
- getFileContext() {
17
- return this.fileContext;
16
+ getContext() {
17
+ return this.context;
18
18
  }
19
19
 
20
20
  getString() {
@@ -25,16 +25,16 @@ export default domAssigned(class ComplexTypeDeclaration {
25
25
  return this.type;
26
26
  }
27
27
 
28
- getReleaseContext() { return this.fileContext.getReleaseContext(); }
28
+ getReleaseContext() { return this.context.getReleaseContext(); }
29
29
 
30
30
  getReleaseTypes() {
31
31
  const includeDependencies = false,
32
32
  includeRelease = false,
33
33
  releaseContext = this.getReleaseContext(),
34
- fileContextTypes = this.fileContext.getTypes(includeRelease),
34
+ contextTypes = this.context.getTypes(includeRelease),
35
35
  releaseContextTypes = releaseContext.getTypes(includeDependencies),
36
36
  releaseTypes = [
37
- ...fileContextTypes,
37
+ ...contextTypes,
38
38
  ...releaseContextTypes
39
39
  ];
40
40
 
@@ -46,7 +46,7 @@ export default domAssigned(class ComplexTypeDeclaration {
46
46
 
47
47
  const complexTypeDeclarationString = this.getString();
48
48
 
49
- this.fileContext.trace(`Verifying the '${complexTypeDeclarationString}' complex type declaration...`);
49
+ this.context.trace(`Verifying the '${complexTypeDeclarationString}' complex type declaration...`);
50
50
 
51
51
  const typeVerifies = this.verifyType();
52
52
 
@@ -57,7 +57,7 @@ export default domAssigned(class ComplexTypeDeclaration {
57
57
  const propertiesVerify = this.verifyProperties();
58
58
 
59
59
  if (propertiesVerify) {
60
- this.fileContext.addType(this.type);
60
+ this.context.addType(this.type);
61
61
 
62
62
  verifies = true;
63
63
  }
@@ -65,7 +65,7 @@ export default domAssigned(class ComplexTypeDeclaration {
65
65
  }
66
66
 
67
67
  if (verifies) {
68
- this.fileContext.debug(`...verified the '${complexTypeDeclarationString}' complex type declaration.`);
68
+ this.context.debug(`...verified the '${complexTypeDeclarationString}' complex type declaration.`);
69
69
  }
70
70
 
71
71
  return verifies;
@@ -76,7 +76,7 @@ export default domAssigned(class ComplexTypeDeclaration {
76
76
 
77
77
  const complexTypeString = this.type.getString();
78
78
 
79
- this.fileContext.trace(`Verifying the '${complexTypeString}' complex type...`);
79
+ this.context.trace(`Verifying the '${complexTypeString}' complex type...`);
80
80
 
81
81
  const typeName = this.type.getName(),
82
82
  releaseTypes = this.getReleaseTypes(),
@@ -89,13 +89,13 @@ export default domAssigned(class ComplexTypeDeclaration {
89
89
  });
90
90
 
91
91
  if (typePresent) {
92
- this.fileContext.debug(`The type '${complexTypeString}' is already present in the package.`);
92
+ this.context.debug(`The type '${complexTypeString}' is already present in the package.`);
93
93
  } else {
94
94
  typeVerifies = true;
95
95
  }
96
96
 
97
97
  if (typeVerifies) {
98
- this.fileContext.debug(`...verified the '${complexTypeString}' complex type.`);
98
+ this.context.debug(`...verified the '${complexTypeString}' complex type.`);
99
99
  }
100
100
 
101
101
  return typeVerifies;
@@ -106,17 +106,17 @@ export default domAssigned(class ComplexTypeDeclaration {
106
106
 
107
107
  const superTypeString = superType.getString();
108
108
 
109
- this.fileContext.trace(`Verifying the '${superTypeString}' super-type...`);
109
+ this.context.trace(`Verifying the '${superTypeString}' super-type...`);
110
110
 
111
111
  const superTypeName = superType.getName(),
112
- superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
112
+ superTypePresent = this.context.isTypePresentByTypeName(superTypeName);
113
113
 
114
114
  if (superTypePresent) {
115
115
  superTypeVerifies = true;
116
116
  }
117
117
 
118
118
  if (superTypeVerifies) {
119
- this.fileContext.debug(`...verified the '${superTypeString}' super-type.`);
119
+ this.context.debug(`...verified the '${superTypeString}' super-type.`);
120
120
  }
121
121
 
122
122
  return superTypeVerifies;
@@ -125,7 +125,7 @@ export default domAssigned(class ComplexTypeDeclaration {
125
125
  verifySuperTypes() {
126
126
  let superTypesVerify = false;
127
127
 
128
- this.fileContext.trace(`Verifying the super-types...`);
128
+ this.context.trace(`Verifying the super-types...`);
129
129
 
130
130
  let superTypes;
131
131
 
@@ -135,7 +135,7 @@ export default domAssigned(class ComplexTypeDeclaration {
135
135
  superTypesLength = superTypes.length;
136
136
 
137
137
  if (superTypesLength === 0) {
138
- const type = this.fileContext.findTypeByTypeName(typeName);
138
+ const type = this.context.findTypeByTypeName(typeName);
139
139
 
140
140
  if (type === null) {
141
141
  const superType = objectType; ///
@@ -150,7 +150,7 @@ export default domAssigned(class ComplexTypeDeclaration {
150
150
  if (typeBasic) {
151
151
  superTypesVerify = true;
152
152
 
153
- this.fileContext.trace(`The '${typeString}' type is basic.`)
153
+ this.context.trace(`The '${typeString}' type is basic.`)
154
154
  } else {
155
155
  const superTypeNames = superTypes.map((superType) => {
156
156
  const superTypeName = superType.getName();
@@ -160,10 +160,10 @@ export default domAssigned(class ComplexTypeDeclaration {
160
160
  superTypeNamesIncludesTypeName = superTypeNames.includes(typeName);
161
161
 
162
162
  if (superTypeNamesIncludesTypeName) {
163
- this.fileContext.trace(`The '${typeName}' type cannot be a super-type `);
163
+ this.context.trace(`The '${typeName}' type cannot be a super-type `);
164
164
  } else {
165
165
  if (superTypesLength === 0) {
166
- const type = this.fileContext.findTypeByTypeName(typeName),
166
+ const type = this.context.findTypeByTypeName(typeName),
167
167
  superType = type; ///
168
168
 
169
169
  superTypes.push(superType);
@@ -181,7 +181,7 @@ export default domAssigned(class ComplexTypeDeclaration {
181
181
  superTypes = superTypes.map((superType) => {
182
182
  const superTypeName = superType.getName();
183
183
 
184
- superType = this.fileContext.findTypeByTypeName(superTypeName);
184
+ superType = this.context.findTypeByTypeName(superTypeName);
185
185
 
186
186
  return superType;
187
187
  });
@@ -197,7 +197,7 @@ export default domAssigned(class ComplexTypeDeclaration {
197
197
  }
198
198
 
199
199
  if (superTypesVerify) {
200
- this.fileContext.debug(`...verified the super-types.`);
200
+ this.context.debug(`...verified the super-types.`);
201
201
  }
202
202
 
203
203
  return superTypesVerify;
@@ -208,7 +208,7 @@ export default domAssigned(class ComplexTypeDeclaration {
208
208
 
209
209
  const propertyString = property.getString();
210
210
 
211
- this.fileContext.trace(`Verifying the '${propertyString}' property...`);
211
+ this.context.trace(`Verifying the '${propertyString}' property...`);
212
212
 
213
213
  const propertyName = property.getName(),
214
214
  count = properties.reduce((count, property) => {
@@ -222,7 +222,7 @@ export default domAssigned(class ComplexTypeDeclaration {
222
222
  }, 0);
223
223
 
224
224
  if (count > 1) {
225
- this.fileContext.debug(`The '${propertyString}' property appears more than once.`);
225
+ this.context.debug(`The '${propertyString}' property appears more than once.`);
226
226
  } else {
227
227
  const superTypeProperty = superTypeProperties.find((superTypeProperty) => {
228
228
  const propertyNameMatches = superTypeProperty.matchPropertyName(propertyName);
@@ -235,7 +235,7 @@ export default domAssigned(class ComplexTypeDeclaration {
235
235
  if (superTypeProperty !== null) {
236
236
  const superTypePropertyString = superTypeProperty.getString();
237
237
 
238
- this.fileContext.debug(`The '${propertyString}' property matches the super-type's '${superTypePropertyString}' property.`);
238
+ this.context.debug(`The '${propertyString}' property matches the super-type's '${superTypePropertyString}' property.`);
239
239
  } else {
240
240
  let propertyType;
241
241
 
@@ -246,7 +246,7 @@ export default domAssigned(class ComplexTypeDeclaration {
246
246
  if (propertyTypeVerifies) {
247
247
  const propertyTypeName = propertyType.getName();
248
248
 
249
- propertyType = this.fileContext.findTypeByTypeName(propertyTypeName);
249
+ propertyType = this.context.findTypeByTypeName(propertyTypeName);
250
250
 
251
251
  const type = propertyType; ///
252
252
 
@@ -265,7 +265,7 @@ export default domAssigned(class ComplexTypeDeclaration {
265
265
  property.setType(this.type);
266
266
  }
267
267
 
268
- this.fileContext.debug(`verifies the '${propertyString}' property.`);
268
+ this.context.debug(`verifies the '${propertyString}' property.`);
269
269
  }
270
270
 
271
271
  return propertyVerifies;
@@ -306,21 +306,21 @@ export default domAssigned(class ComplexTypeDeclaration {
306
306
  } else {
307
307
  const propertyTypeString = propertyType.getString(); ///
308
308
 
309
- this.fileContext.trace(`Verifying the '${propertyTypeString}' property type...`);
309
+ this.context.trace(`Verifying the '${propertyTypeString}' property type...`);
310
310
 
311
311
  const propertyTypeName = propertyType.getName(),
312
- propertyTypePresent = this.fileContext.isTypePresentByTypeName(propertyTypeName);
312
+ propertyTypePresent = this.context.isTypePresentByTypeName(propertyTypeName);
313
313
 
314
314
  if (!propertyTypePresent) {
315
315
  const propertyTypeString = propertyType.getString();
316
316
 
317
- this.fileContext.debug(`The '${propertyTypeString}' property type is not present.`);
317
+ this.context.debug(`The '${propertyTypeString}' property type is not present.`);
318
318
  } else {
319
319
  propertyTypeVerifies = true;
320
320
  }
321
321
 
322
322
  if (propertyTypeVerifies) {
323
- this.fileContext.debug(`...verified the '${propertyTypeString}' property type.`);
323
+ this.context.debug(`...verified the '${propertyTypeString}' property type.`);
324
324
  }
325
325
  }
326
326
 
@@ -329,13 +329,13 @@ export default domAssigned(class ComplexTypeDeclaration {
329
329
 
330
330
  static name = "ComplexTypeDeclaration";
331
331
 
332
- static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext) {
332
+ static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
333
333
  const { Type } = dom,
334
- type = Type.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
334
+ type = Type.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
335
335
  typeName = type.getName(),
336
336
  superTypes = type.getSuperTypes(),
337
337
  string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
338
- complexTypeDeclaration = new ComplexTypeDeclaration(fileContext, string, type);
338
+ complexTypeDeclaration = new ComplexTypeDeclaration(context, string, type);
339
339
 
340
340
  return complexTypeDeclaration;
341
341
  }
@@ -7,14 +7,14 @@ import constructorVerifier from "../../verifier/constructor";
7
7
  import { domAssigned } from "../../dom";
8
8
 
9
9
  export default domAssigned(class ConstructorDeclaration {
10
- constructor(fileContext, string, constructor) {
11
- this.fileContext = fileContext;
10
+ constructor(context, string, constructor) {
11
+ this.context = context;
12
12
  this.string = string;
13
13
  this.constructor = constructor;
14
14
  }
15
15
 
16
- getFileContext() {
17
- return this.fileContext;
16
+ getContext() {
17
+ return this.context;
18
18
  }
19
19
 
20
20
  getString() {
@@ -30,7 +30,7 @@ export default domAssigned(class ConstructorDeclaration {
30
30
 
31
31
  const constructorDeclarationString = this.getString(); ///
32
32
 
33
- this.fileContext.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`);
33
+ this.context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`);
34
34
 
35
35
  const constructorTypeVerifies = this.verifyConstructorType();
36
36
 
@@ -38,14 +38,14 @@ export default domAssigned(class ConstructorDeclaration {
38
38
  const constructorVerifies = this.verifyConstructor();
39
39
 
40
40
  if (constructorVerifies) {
41
- this.fileContext.addConstructor(this.constructor);
41
+ this.context.addConstructor(this.constructor);
42
42
 
43
43
  verifies = true;
44
44
  }
45
45
  }
46
46
 
47
47
  if (verifies) {
48
- this.fileContext.debug(`...verified the '${constructorDeclarationString}' constructor declaration.`);
48
+ this.context.debug(`...verified the '${constructorDeclarationString}' constructor declaration.`);
49
49
  }
50
50
 
51
51
  return verifies;
@@ -56,15 +56,15 @@ export default domAssigned(class ConstructorDeclaration {
56
56
 
57
57
  const constructorString = this.constructor.getString();
58
58
 
59
- this.fileContext.trace(`Verifying the '${constructorString}' constructor...`);
59
+ this.context.trace(`Verifying the '${constructorString}' constructor...`);
60
60
 
61
61
  const term = this.constructor.getTerm(),
62
62
  termNode = term.getNode();
63
63
 
64
- constructorVerifies = constructorVerifier.verifyTerm(termNode, this.fileContext);
64
+ constructorVerifies = constructorVerifier.verifyTerm(termNode, this.context);
65
65
 
66
66
  if (constructorVerifies) {
67
- this.fileContext.debug(`...verified the '${constructorString}' constructor.`);
67
+ this.context.debug(`...verified the '${constructorString}' constructor.`);
68
68
  }
69
69
 
70
70
  return constructorVerifies;
@@ -80,24 +80,24 @@ export default domAssigned(class ConstructorDeclaration {
80
80
  const typeName = type.getName(),
81
81
  typeString = type.getString();
82
82
 
83
- this.fileContext.trace(`Verifying the '${typeString}' type...`);
83
+ this.context.trace(`Verifying the '${typeString}' type...`);
84
84
 
85
85
  const includeSupertypes = false,
86
86
  provisional = type.isProvisional(includeSupertypes);
87
87
 
88
- type = this.fileContext.findTypeByTypeName(typeName);
88
+ type = this.context.findTypeByTypeName(typeName);
89
89
 
90
90
  const typePresent = (type !== null)
91
91
 
92
92
  if (!typePresent) {
93
- this.fileContext.debug(`The '${typeString}' type is not present.`);
93
+ this.context.debug(`The '${typeString}' type is not present.`);
94
94
  } else {
95
95
  const provisionalMatches = type.matchProvisional(provisional);
96
96
 
97
97
  if (!provisionalMatches) {
98
98
  provisional ?
99
- this.fileContext.debug(`The '${typeString}' type is present but not provisional.`) :
100
- this.fileContext.debug(`The '${typeString}' type is present but provisional.`);
99
+ this.context.debug(`The '${typeString}' type is present but not provisional.`) :
100
+ this.context.debug(`The '${typeString}' type is present but provisional.`);
101
101
  } else {
102
102
  this.constructor.setType(type);
103
103
 
@@ -106,7 +106,7 @@ export default domAssigned(class ConstructorDeclaration {
106
106
  }
107
107
 
108
108
  if (constructorTypeVerifies) {
109
- this.fileContext.debug(`...verified the '${typeString}' type.`);
109
+ this.context.debug(`...verified the '${typeString}' type.`);
110
110
  }
111
111
 
112
112
  return constructorTypeVerifies;
@@ -114,12 +114,12 @@ export default domAssigned(class ConstructorDeclaration {
114
114
 
115
115
  static name = "ConstructorDeclaration";
116
116
 
117
- static fromConstructorDeclarationNode(constructorDeclarationNode, fileContext) {
117
+ static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
118
118
  const { Constructor } = dom,
119
119
  node = constructorDeclarationNode, ///
120
- string = fileContext.nodeAsString(node),
121
- constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
122
- constructorDeclaration = new ConstructorDeclaration(fileContext, string, constructor);
120
+ string = context.nodeAsString(node),
121
+ constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, context),
122
+ constructorDeclaration = new ConstructorDeclaration(context, string, constructor);
123
123
 
124
124
  return constructorDeclaration;
125
125
  }
@@ -5,14 +5,14 @@ import dom from "../../dom";
5
5
  import { domAssigned } from "../../dom";
6
6
 
7
7
  export default domAssigned(class MetavariableDeclaration {
8
- constructor(fileContext, string, metavariable) {
9
- this.fileContext = fileContext;
8
+ constructor(context, string, metavariable) {
9
+ this.context = context;
10
10
  this.string = string;
11
11
  this.metavariable = metavariable;
12
12
  }
13
13
 
14
- getFileContext() {
15
- return this.fileContext;
14
+ getContext() {
15
+ return this.context;
16
16
  }
17
17
 
18
18
  getString() {
@@ -28,18 +28,18 @@ export default domAssigned(class MetavariableDeclaration {
28
28
 
29
29
  const metavariableDeclarationString = this.string; ///
30
30
 
31
- this.fileContext.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration...`);
31
+ this.context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration...`);
32
32
 
33
33
  const metavariableVerifies = this.verifyMetavariable(this.metavariable);
34
34
 
35
35
  if (metavariableVerifies) {
36
- this.fileContext.addMetavariable(this.metavariable);
36
+ this.context.addMetavariable(this.metavariable);
37
37
 
38
38
  verifies = true;
39
39
  }
40
40
 
41
41
  if (verifies) {
42
- this.fileContext.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration.`);
42
+ this.context.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration.`);
43
43
  }
44
44
 
45
45
  return verifies;
@@ -54,18 +54,18 @@ export default domAssigned(class MetavariableDeclaration {
54
54
  const typeName = type.getName(),
55
55
  typeString = type.getString();
56
56
 
57
- this.fileContext.trace(`Verifying the '${typeString}' type...`);
57
+ this.context.trace(`Verifying the '${typeString}' type...`);
58
58
 
59
- const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
59
+ const typePresent = this.context.isTypePresentByTypeName(typeName);
60
60
 
61
61
  if (!typePresent) {
62
- this.fileContext.debug(`The '${typeString}' type is not present.`);
62
+ this.context.debug(`The '${typeString}' type is not present.`);
63
63
  } else {
64
64
  typeVerifies = true;
65
65
  }
66
66
 
67
67
  if (typeVerifies) {
68
- this.fileContext.debug(`...verified the '${typeString}' type.`);
68
+ this.context.debug(`...verified the '${typeString}' type.`);
69
69
  }
70
70
  }
71
71
 
@@ -77,19 +77,19 @@ export default domAssigned(class MetavariableDeclaration {
77
77
 
78
78
  const metavariableString = metavariable.getString();
79
79
 
80
- this.fileContext.trace(`Verifying the '${metavariableString}' metavariable when declared...`);
80
+ this.context.trace(`Verifying the '${metavariableString}' metavariable when declared...`);
81
81
 
82
82
  const metavariableNode = metavariable.getNode(), ///
83
83
  termNode = metavariableNode.getTermNode();
84
84
 
85
85
  if (termNode !== null) {
86
- this.fileContext.debug(`A term was found in the '${metavariableString}' metavariable when a type should have been present.`);
86
+ this.context.debug(`A term was found in the '${metavariableString}' metavariable when a type should have been present.`);
87
87
  } else {
88
88
  const metavariableName = metavariable.getName(),
89
- metavariablePresent = this.fileContext.isMetavariablePresentByMetavariableName(metavariableName);
89
+ metavariablePresent = this.context.isMetavariablePresentByMetavariableName(metavariableName);
90
90
 
91
91
  if (metavariablePresent) {
92
- this.fileContext.debug(`The '${metavariableName}' metavariable is already present.`);
92
+ this.context.debug(`The '${metavariableName}' metavariable is already present.`);
93
93
  } else {
94
94
  const type = metavariable.getType(),
95
95
  typeVerifies = this.verifyType(type);
@@ -99,7 +99,7 @@ export default domAssigned(class MetavariableDeclaration {
99
99
  }
100
100
 
101
101
  if (metavariableVerifies) {
102
- this.fileContext.debug(`...verified the '${metavariableString}' metavariable when declared.`);
102
+ this.context.debug(`...verified the '${metavariableString}' metavariable when declared.`);
103
103
  }
104
104
 
105
105
  return metavariableVerifies;
@@ -107,12 +107,12 @@ export default domAssigned(class MetavariableDeclaration {
107
107
 
108
108
  static name = "MetavariableDeclaration";
109
109
 
110
- static fromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext) {
110
+ static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
111
111
  const { Metavariable } = dom,
112
- metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext),
113
- metavariable = Metavariable.fromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext),
112
+ metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
113
+ metavariable = Metavariable.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
114
114
  string = stringFromMetavariableAndMetaType(metavariable, metaType),
115
- metavariableDeclaration = new MetavariableDeclaration(fileContext, string, metavariable);
115
+ metavariableDeclaration = new MetavariableDeclaration(context, string, metavariable);
116
116
 
117
117
  return metavariableDeclaration;
118
118
  }
@@ -134,10 +134,10 @@ function stringFromMetavariableAndMetaType(metavariable, metaType) {
134
134
  return string;
135
135
  }
136
136
 
137
- function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext) {
137
+ function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
138
138
  const { MetaType } = dom,
139
139
  metaTypeNode = metavariableDeclarationNode.getMetaTypeNode(),
140
- metaType = MetaType.fromMetaTypeNode(metaTypeNode, fileContext);
140
+ metaType = MetaType.fromMetaTypeNode(metaTypeNode, context);
141
141
 
142
142
  return metaType;
143
143
  }