occam-verify-cli 0.0.1245 → 0.0.1247

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 (74) hide show
  1. package/lib/context/file.js +172 -210
  2. package/lib/context/local.js +95 -125
  3. package/lib/dom/assertion/contained.js +44 -22
  4. package/lib/dom/assertion/defined.js +34 -17
  5. package/lib/dom/combinator/bracketed.js +167 -0
  6. package/lib/dom/combinator.js +163 -0
  7. package/lib/{constructor → dom/constructor}/bracketed.js +7 -7
  8. package/lib/dom/constructor.js +190 -0
  9. package/lib/dom/declaration/combinator.js +2 -8
  10. package/lib/dom/declaration/constructor.js +42 -7
  11. package/lib/dom/declaration.js +113 -71
  12. package/lib/dom/equality.js +3 -3
  13. package/lib/dom/frame.js +111 -76
  14. package/lib/dom/judgement.js +29 -3
  15. package/lib/dom/label.js +22 -15
  16. package/lib/dom/metaLemma.js +20 -41
  17. package/lib/dom/metatheorem.js +20 -41
  18. package/lib/dom/metavariable.js +7 -7
  19. package/lib/dom/reference.js +32 -18
  20. package/lib/dom/rule.js +3 -4
  21. package/lib/dom/statement.js +2 -2
  22. package/lib/dom/term.js +2 -2
  23. package/lib/dom/topLevelAssertion.js +50 -71
  24. package/lib/dom/type.js +3 -3
  25. package/lib/dom/variable.js +5 -5
  26. package/lib/equivalence.js +2 -2
  27. package/lib/index.js +7 -3
  28. package/lib/mixins/statement/verify.js +3 -3
  29. package/lib/mixins/term/verify.js +2 -3
  30. package/lib/substitution/statement.js +2 -2
  31. package/lib/unifier/{label.js → reference.js} +14 -14
  32. package/lib/utilities/json.js +5 -7
  33. package/lib/utilities/unification.js +25 -6
  34. package/lib/verifier/combinator.js +3 -3
  35. package/lib/verifier/constructor.js +3 -3
  36. package/package.json +5 -5
  37. package/src/context/file.js +166 -206
  38. package/src/context/local.js +73 -83
  39. package/src/dom/assertion/contained.js +60 -27
  40. package/src/dom/assertion/defined.js +44 -20
  41. package/src/{combinator → dom/combinator}/bracketed.js +6 -5
  42. package/src/{combinator.js → dom/combinator.js} +8 -7
  43. package/src/{constructor → dom/constructor}/bracketed.js +6 -5
  44. package/src/{constructor.js → dom/constructor.js} +8 -7
  45. package/src/dom/declaration/combinator.js +2 -3
  46. package/src/dom/declaration/constructor.js +3 -2
  47. package/src/dom/declaration.js +133 -101
  48. package/src/dom/equality.js +2 -2
  49. package/src/dom/frame.js +151 -95
  50. package/src/dom/judgement.js +36 -2
  51. package/src/dom/label.js +18 -13
  52. package/src/dom/metaLemma.js +23 -55
  53. package/src/dom/metatheorem.js +23 -55
  54. package/src/dom/metavariable.js +6 -6
  55. package/src/dom/reference.js +43 -25
  56. package/src/dom/rule.js +2 -2
  57. package/src/dom/statement.js +1 -1
  58. package/src/dom/term.js +1 -1
  59. package/src/dom/topLevelAssertion.js +53 -86
  60. package/src/dom/type.js +2 -2
  61. package/src/dom/variable.js +4 -4
  62. package/src/equivalence.js +1 -1
  63. package/src/index.js +4 -0
  64. package/src/mixins/statement/verify.js +3 -2
  65. package/src/mixins/term/verify.js +2 -3
  66. package/src/substitution/statement.js +1 -1
  67. package/src/unifier/{label.js → reference.js} +6 -6
  68. package/src/utilities/json.js +4 -4
  69. package/src/utilities/unification.js +43 -5
  70. package/src/verifier/combinator.js +2 -2
  71. package/src/verifier/constructor.js +2 -2
  72. package/lib/combinator/bracketed.js +0 -126
  73. package/lib/combinator.js +0 -122
  74. package/lib/constructor.js +0 -149
@@ -165,9 +165,9 @@ class LocalContext {
165
165
  let variableAdded = false;
166
166
 
167
167
  const variableName = variable.getNode(),
168
- variableDeclared = this.isVariableDeclaredByVariableName(variableName, nested);
168
+ variablePresent = this.isVariablePresentByVariableName(variableName, nested);
169
169
 
170
- if (!variableDeclared) {
170
+ if (!variablePresent) {
171
171
  this.variables.push(variable);
172
172
 
173
173
  variableAdded = true;
@@ -217,75 +217,23 @@ class LocalContext {
217
217
  return termType;
218
218
  }
219
219
 
220
- isTermGrounded(term) {
221
- const context = this, ///
222
- equivalences = this.getEquivalences(),
223
- groundedTerms = [],
224
- definedVariables = [];
225
-
226
- equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
227
-
228
- const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
229
- const groundedTermNode = groundedTerm.getNode(),
230
- groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
231
-
232
- if (groundedTermNodeMatches) {
233
- return true;
234
- }
235
- }),
236
- termGrounded = termMatchesGroundedTerm; ///
237
-
238
- return termGrounded;
239
- }
240
-
241
- isVariableDefined(variable) {
242
- const context = this, ///
243
- equivalences = this.getEquivalences(),
244
- groundedTerms = [],
245
- definedVariables = [];
246
-
247
- equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
248
-
249
- const variableMatchesDefinedVariable = definedVariables.some((definedVariable) => {
250
- const definedVariableEqualToVariable = definedVariable.isEqualTo(variable);
251
-
252
- if (definedVariableEqualToVariable === variable) {
253
- return true;
254
- }
255
- }),
256
- variableDefined = variableMatchesDefinedVariable; ///
257
-
258
- return variableDefined;
259
- }
260
-
261
- isMetavariableDefined(metavariable) {
262
- const judgementPresent = this.isJudgementPresentByMetavariable(metavariable),
263
- metavariableDefined = judgementPresent; ///
264
-
265
- return metavariableDefined
266
- }
220
+ findLabelByReference(reference, context) { return this.context.findLabelByReference(reference, context); }
267
221
 
268
- isMetavariableDeclared(metavariable, generalContext, specificContext) { return this.context.isMetavariableDeclared(metavariable, generalContext, specificContext); }
222
+ findRuleByReference(reference) { return this.context.findRuleByReference(reference); }
269
223
 
270
- isTypeDeclaredByTypeName(typeName) { return this.context.isTypeDeclaredByTypeName(typeName); }
224
+ findAxiomByReference(reference) { return this.context.findAxiomByReference(reference); }
271
225
 
272
- isLabelPresentByMetavariableName(metavariableName) { return this.context.isLabelPresentByMetavariableName(metavariableName); }
226
+ findLemmaByReference(reference) { return this.context.findLemmaByReference(reference); }
273
227
 
274
- isLabelPresentByMetavariableNode(metavariableNode) { return this.context.isLabelPresentByMetavariableNode(metavariableNode); }
228
+ findTheoremByReference(reference) { return this.context.findTheoremByReference(reference); }
275
229
 
276
- isVariableDeclaredByVariableName(variableName, nested = true) {
277
- const variable = this.findVariableByVariableName(variableName, nested),
278
- variableDeclared = (variable !== null);
230
+ findProcedureByReference(reference) { return this.context.findProcedureByReference(reference); }
279
231
 
280
- return variableDeclared;
281
- }
232
+ findConjectureByReference(reference) { return this.context.findConjectureByReference(reference); }
282
233
 
283
- isJudgementPresentByMetavariable(metavariable) {
284
- const judgement = this.findJudgementByMetavariable(metavariable),
285
- judgementPresent = (judgement !== null);
234
+ findMetaLemmasByReference(reference) { return this.context.findMetaLemmasByReference(reference); }
286
235
 
287
- return judgementPresent;
288
- }
236
+ findMetatheoremsByReference(reference) { return this.context.findMetatheoremsByReference(reference); }
289
237
 
290
238
  findVariableByVariableName(variableName, nested = true) {
291
239
  const variables = this.getVariables(nested),
@@ -321,49 +269,91 @@ class LocalContext {
321
269
 
322
270
  findTypeByTypeName(typeName) { return this.context.findTypeByTypeName(typeName); }
323
271
 
272
+ findLabelByMetavariable(metavariable) { return this.context.findLabelByMetavariable(metavariable); }
273
+
324
274
  findMetaTypeByMetaTypeName(metaTypeName) { return this.context.findMetaTypeByMetaTypeName(metaTypeName); }
325
275
 
326
276
  findMetavariableByMetavariableName(metavariableName) { return this.context.findMetavariableByMetavariableName(metavariableName); }
327
277
 
328
- findLabelByMetavariable(metavariable) { return this.context.findLabelByMetavariable(metavariable); }
278
+ isLabelPresentByReference(reference) { return this.context.isLabelPresentByReference(reference); }
329
279
 
330
- findRuleByReference(reference) { return this.context.findRuleByReference(reference); }
280
+ isProcedurePresentByReference(reference) { return this.context.isProcedurePresentByReference(reference); }
331
281
 
332
- findAxiomByReference(reference) { return this.context.findAxiomByReference(reference); }
282
+ isMetavariablePresentByReference(reference) { return this.context.isMetavariablePresentByReference(reference); }
333
283
 
334
- findLemmaByReference(reference) { return this.context.findLemmaByReference(reference); }
284
+ findAxiomLemmaTheoremConjectureByReference(reference) { return this.context.findAxiomLemmaTheoremConjectureByReference(reference); }
335
285
 
336
- findTheoremByReference(reference) { return this.context.findTheoremByReference(reference); }
286
+ isMetavariablePresent(metavariable, generalContext, specificContext) { return this.context.isMetavariablePresent(metavariable, generalContext, specificContext); }
337
287
 
338
- findProcedureByReference(reference) { return this.context.findProcedureByReference(reference); }
288
+ isTypePresentByTypeName(typeName) { return this.context.isTypePresentByTypeName(typeName); }
339
289
 
340
- findConjectureByReference(reference) { return this.context.findConjectureByReference(reference); }
290
+ isVariablePresentByVariableName(variableName, nested = true) {
291
+ const variable = this.findVariableByVariableName(variableName, nested),
292
+ variablePresent = (variable !== null);
341
293
 
342
- findMetaLemmasByReference(reference) { return this.context.findMetaLemmasByReference(reference); }
294
+ return variablePresent;
295
+ }
343
296
 
344
- findMetatheoremsByReference(reference) { return this.context.findMetatheoremsByReference(reference); }
297
+ isLabelPresentByMetavariableName(metavariableName) { return this.context.isLabelPresentByMetavariableName(metavariableName); }
345
298
 
346
- findAxiomLemmaTheoremConjectureByReference(reference) { return this.context.findAxiomLemmaTheoremConjectureByReference(reference); }
299
+ isLabelPresentByMetavariableNode(metavariableNode) { return this.context.isLabelPresentByMetavariableNode(metavariableNode); }
347
300
 
348
- isRulePresentByReference(reference) { return this.context.isRulePresentByReference(reference); }
301
+ isMetavariablePresentByMetavariableName(metavariableNode) { return this.context.isMetavariablePresentByMetavariableName(metavariableNode); }
349
302
 
350
- isAxiomPresentByReference(reference) { return this.context.isAxiomPresentByReference(reference); }
303
+ isJudgementPresentByMetavariable(metavariable) {
304
+ const judgement = this.findJudgementByMetavariable(metavariable),
305
+ judgementPresent = (judgement !== null);
351
306
 
352
- isLemmaPresentByReference(reference) { return this.context.isLemmaPresentByReference(reference); }
307
+ return judgementPresent;
308
+ }
353
309
 
354
- isTheoremPresentByReference(reference) { return this.context.isTheoremPresentByReference(reference); }
310
+ isTermGrounded(term) {
311
+ const context = this, ///
312
+ equivalences = this.getEquivalences(),
313
+ groundedTerms = [],
314
+ definedVariables = [];
355
315
 
356
- isProcedurePresentByReference(reference) { return this.context.isProcedurePresentByReference(reference); }
316
+ equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
357
317
 
358
- isConjecturePresentByReference(reference) { return this.context.isConjecturePresentByReference(reference); }
318
+ const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
319
+ const groundedTermNode = groundedTerm.getNode(),
320
+ groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
359
321
 
360
- areMetaLemmasPresentByReference(reference) { return this.context.areMetaLemmasPresentByReference(reference); }
322
+ if (groundedTermNodeMatches) {
323
+ return true;
324
+ }
325
+ }),
326
+ termGrounded = termMatchesGroundedTerm; ///
327
+
328
+ return termGrounded;
329
+ }
330
+
331
+ isVariableDefined(variable) {
332
+ const context = this, ///
333
+ equivalences = this.getEquivalences(),
334
+ groundedTerms = [],
335
+ definedVariables = [];
336
+
337
+ equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
361
338
 
362
- areMetatheoremsPresentByReference(reference) { return this.context.areMetatheoremsPresentByReference(reference); }
339
+ const variableMatchesDefinedVariable = definedVariables.some((definedVariable) => {
340
+ const definedVariableEqualToVariable = definedVariable.isEqualTo(variable);
363
341
 
364
- areMetaLemmasMetaTheoremsPresentByReference(reference) { return this.context.areMetaLemmasMetaTheoremsPresentByReference(reference); }
342
+ if (definedVariableEqualToVariable === variable) {
343
+ return true;
344
+ }
345
+ }),
346
+ variableDefined = variableMatchesDefinedVariable; ///
365
347
 
366
- isAxiomLemmaTheoremConjecturePresentByReference(reference) { return this.context.isAxiomLemmaTheoremConjecturePresentByReference(reference) }
348
+ return variableDefined;
349
+ }
350
+
351
+ isMetavariableDefined(metavariable) {
352
+ const judgementPresent = this.isJudgementPresentByMetavariable(metavariable),
353
+ metavariableDefined = judgementPresent; ///
354
+
355
+ return metavariableDefined
356
+ }
367
357
 
368
358
  nodeAsString(node, tokens = null) {
369
359
  if (tokens === null) {
@@ -57,25 +57,9 @@ export default domAssigned(class ContainedAssertion {
57
57
 
58
58
  context.trace(`Verifying the '${containedAssertionString}' contained assertion...`);
59
59
 
60
- let termVerified = false,
61
- frameVerified = false,
62
- statementVerified = false;
63
-
64
- if (this.term !== null) {
65
- termVerified = this.term.verify(context, () => {
66
- const verifiedAhead = true;
67
-
68
- return verifiedAhead;
69
- });
70
- }
71
-
72
- if (this.frame !== null) {
73
- frameVerified = this.verifyFrame(this.frame, assignments, stated, context);
74
- }
75
-
76
- if (this.statement !== null) {
77
- statementVerified = this.verifyStatement(this.statement, assignments, stated, context);
78
- }
60
+ const termVerified = this.verifyTerm(assignments, stated, context),
61
+ frameVerified = this.verifyFrame(assignments, stated, context),
62
+ statementVerified = this.verifyStatement(assignments, stated, context)
79
63
 
80
64
  if (termVerified || frameVerified || statementVerified) {
81
65
  let verifiedWhenStated = false,
@@ -99,22 +83,71 @@ export default domAssigned(class ContainedAssertion {
99
83
  return verified;
100
84
  }
101
85
 
102
- verifyFrame(frame, assignments, stated, context) {
103
- stated = true; ///
86
+ verifyTerm(assignments, stated, context) {
87
+ let termVerified = false;
104
88
 
105
- assignments = null; ///
89
+ if (this.term !== null) {
90
+ const termString = this.term.getString(),
91
+ containedAssertionString = this.string; ///
106
92
 
107
- const frameVerified = frame.verify(assignments, stated, context);
93
+ context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${termString}' term...`);
94
+
95
+ termVerified = this.term.verify(context, () => {
96
+ const verifiedAhead = true;
97
+
98
+ return verifiedAhead;
99
+ });
100
+
101
+ if (termVerified) {
102
+ context.trace(`...verified the '${containedAssertionString}' contained assertion's '${termString}' term.`);
103
+ }
104
+ }
105
+
106
+ return termVerified;
107
+ }
108
+
109
+ verifyFrame(assignments, stated, context) {
110
+ let frameVerified = false;
111
+
112
+ if (this.frame !== null) {
113
+ const frameString = this.frame.getString(),
114
+ containedAssertionString = this.string; ///
115
+
116
+ context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${frameString}' frame...`);
117
+
118
+ stated = true; ///
119
+
120
+ assignments = null; ///
121
+
122
+ frameVerified = this.frame.verify(assignments, stated, context);
123
+
124
+ if (frameVerified) {
125
+ context.trace(`...verified the '${containedAssertionString}' contained assertion's '${frameString}' frame.`);
126
+ }
127
+ }
108
128
 
109
129
  return frameVerified;
110
130
  }
111
131
 
112
- verifyStatement(statement, assignments, stated, context) {
113
- stated = true; ///
132
+ verifyStatement(assignments, stated, context) {
133
+ let statementVerified = false;
134
+
135
+ if (this.statement !== null) {
136
+ const statementString = this.statement.getString(),
137
+ containedAssertionString = this.string; ///
138
+
139
+ context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${statementString}' statement...`);
140
+
141
+ stated = true; ///
142
+
143
+ assignments = null; ///
114
144
 
115
- assignments = null; ///
145
+ statementVerified = this.statement.verify(assignments, stated, context);
116
146
 
117
- const statementVerified = statement.verify(assignments, stated, context);
147
+ if (statementVerified) {
148
+ context.trace(`...verified the '${containedAssertionString}' contained assertion's '${statementString}' statement.`);
149
+ }
150
+ }
118
151
 
119
152
  return statementVerified;
120
153
  }
@@ -52,27 +52,15 @@ export default domAssigned(class DefinedAssertion {
52
52
 
53
53
  context.trace(`Verifying the '${definedAssertionString}' defined assertion...`);
54
54
 
55
- let termVerified = false,
56
- frameVerified = false;
57
-
58
- if (this.term !== null) {
59
- termVerified = this.term.verify(context, () => {
60
- const verifiedAhead = true;
61
-
62
- return verifiedAhead;
63
- });
64
- }
65
-
66
- if (this.frame!== null) {
67
- frameVerified = this.verifyFrame(this.frame, assignments, stated, context);
68
- }
55
+ const termVerified = this.verifyTerm(assignments, stated, context),
56
+ frameVerified = this.verifyFrame(assignments, stated, context);
69
57
 
70
58
  if (termVerified || frameVerified) {
71
59
  let verifiedWhenStated = false,
72
60
  verifiedWhenDerived = false;
73
61
 
74
62
  if (stated) {
75
- verifiedWhenStated = this.verifyWhenStated(context);
63
+ verifiedWhenStated = this.verifyWhenStated(assignments, context);
76
64
  } else {
77
65
  verifiedWhenDerived = this.verifyWhenDerived(context);
78
66
  }
@@ -89,17 +77,53 @@ export default domAssigned(class DefinedAssertion {
89
77
  return verified;
90
78
  }
91
79
 
92
- verifyFrame(frame, assignments, stated, context) {
93
- stated = true; ///
80
+ verifyTerm(assignments, stated, context) {
81
+ let termVerified = false;
82
+
83
+ if (this.term !== null) {
84
+ const termString = this.term.getString(),
85
+ definedAssertionString = this.string; ///
86
+
87
+ context.trace(`Verifying the '${definedAssertionString}' defined assertion's '${termString}' term...`);
94
88
 
95
- assignments = null; ///
89
+ termVerified = this.term.verify(context, () => {
90
+ const verifiedAhead = true;
96
91
 
97
- const frameVerified = frame.verify(assignments, stated, context);
92
+ return verifiedAhead;
93
+ });
94
+
95
+ if (termVerified) {
96
+ context.debug(`...verified the '${definedAssertionString}' defined assertion's '${termString}' term.`);
97
+ }
98
+ }
99
+
100
+ return termVerified;
101
+ }
102
+
103
+ verifyFrame(assignments, stated, context) {
104
+ let frameVerified = false;
105
+
106
+ if (this.frame !== null) {
107
+ const frameString = this.frame.getString(),
108
+ definedAssertionString = this.string; ///
109
+
110
+ context.trace(`Verifying the '${definedAssertionString}' defined assertion's '${frameString}' frame...`);
111
+
112
+ stated = true; ///
113
+
114
+ assignments = null; ///
115
+
116
+ frameVerified = this.frame.verify(assignments, stated, context);
117
+
118
+ if (frameVerified) {
119
+ context.debug(`...verified the '${definedAssertionString}' defined assertion's '${frameString}' frame.`);
120
+ }
121
+ }
98
122
 
99
123
  return frameVerified;
100
124
  }
101
125
 
102
- verifyWhenStated(context) {
126
+ verifyWhenStated(assignments, context) {
103
127
  let verifiedWhenStated;
104
128
 
105
129
  const definedAssertionString = this.string; ///
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import dom from "../dom";
3
+ import dom from "../../dom";
4
4
  import Combinator from "../combinator";
5
- import combinatorBracketedContext from "../context/bracketed/combinator";
5
+ import combinatorBracketedContext from "../../context/bracketed/combinator";
6
6
 
7
- import { unifyStatementWithCombinator } from "../utilities/unification";
7
+ import { domAssigned } from "../../dom";
8
+ import { unifyStatementWithCombinator } from "../../utilities/unification";
8
9
 
9
- export default class BracketedCombinator extends Combinator {
10
+ export default domAssigned(class BracketedCombinator extends Combinator {
10
11
  unifyStatement(statement, assignments, stated, context) {
11
12
  let statementUnified;
12
13
 
@@ -37,4 +38,4 @@ export default class BracketedCombinator extends Combinator {
37
38
 
38
39
  return bracketedCombinator;
39
40
  }
40
- }
41
+ });
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import dom from "./dom";
4
- import LocalContext from "./context/local";
3
+ import dom from "../dom";
4
+ import LocalContext from "../context/local";
5
5
 
6
- import { nodeQuery } from "./utilities/query";
7
- import { unifyStatementWithCombinator } from "./utilities/unification";
8
- import { statementFromJSON, statementToStatementJSON } from "./utilities/json";
6
+ import { nodeQuery } from "../utilities/query";
7
+ import { domAssigned } from "../dom";
8
+ import { unifyStatementWithCombinator } from "../utilities/unification";
9
+ import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
9
10
 
10
11
  const statementNodeQuery = nodeQuery("/combinatorDeclaration/statement");
11
12
 
12
- export default class Combinator {
13
+ export default domAssigned(class Combinator {
13
14
  constructor(statement) {
14
15
  this.statement = statement;
15
16
  }
@@ -91,4 +92,4 @@ export default class Combinator {
91
92
 
92
93
  return combinator;
93
94
  }
94
- }
95
+ });
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import dom from "../dom";
3
+ import dom from "../../dom";
4
4
  import Constructor from "../constructor";
5
- import constructorBracketedContext from "../context/bracketed/constructor";
5
+ import constructorBracketedContext from "../../context/bracketed/constructor";
6
6
 
7
- import { nodeQuery } from "../utilities/query";
7
+ import { nodeQuery } from "../../utilities/query";
8
+ import { domAssigned } from "../../dom";
8
9
  import { stringFromTermAndType } from "../constructor";
9
10
 
10
11
  const termNodeQuery = nodeQuery("/term/argument/term");
11
12
 
12
- export default class BracketedConstructor extends Constructor {
13
+ export default domAssigned(class BracketedConstructor extends Constructor {
13
14
  unifyTerm(term, context, verifyAhead) {
14
15
  let termUnified;
15
16
 
@@ -65,4 +66,4 @@ export default class BracketedConstructor extends Constructor {
65
66
 
66
67
  return bracketedConstructor;
67
68
  }
68
- }
69
+ });
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
 
3
- import dom from "./dom";
4
- import LocalContext from "./context/local";
3
+ import dom from "../dom";
4
+ import LocalContext from "../context/local";
5
5
 
6
- import { nodeQuery } from "./utilities/query";
7
- import { unifyTermWithConstructor } from "./utilities/unification";
8
- import { termFromJSON, termToTermJSON } from "./utilities/json";
6
+ import { nodeQuery } from "../utilities/query";
7
+ import { domAssigned } from "../dom";
8
+ import { unifyTermWithConstructor } from "../utilities/unification";
9
+ import { termFromJSON, termToTermJSON } from "../utilities/json";
9
10
 
10
11
  const termNodeQuery = nodeQuery("/constructorDeclaration/term"),
11
12
  typeNodeQuery = nodeQuery("/constructorDeclaration/type");
12
13
 
13
- export default class Constructor {
14
+ export default domAssigned(class Constructor {
14
15
  constructor(string, term) {
15
16
  this.string = string;
16
17
  this.term = term;
@@ -108,7 +109,7 @@ export default class Constructor {
108
109
 
109
110
  return constructor;
110
111
  }
111
- }
112
+ });
112
113
 
113
114
  export function stringFromTermAndType(term, type) {
114
115
  let string;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- import Combinator from "../../combinator";
4
-
5
3
  import { domAssigned } from "../../dom";
6
4
 
7
5
  export default domAssigned(class CombinatorDeclaration {
@@ -45,7 +43,8 @@ export default domAssigned(class CombinatorDeclaration {
45
43
  static name = "CombinatorDeclaration";
46
44
 
47
45
  static fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext) {
48
- const combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext),
46
+ const { Combinator } = dom,
47
+ combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext),
49
48
  combinatorDeclaration = new CombinatorDeclaration(fileContext, combinator);
50
49
 
51
50
  return combinatorDeclaration;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import Constructor from "../../constructor";
3
+ import dom from "../../dom";
4
4
 
5
5
  import { domAssigned } from "../../dom";
6
6
 
@@ -45,7 +45,8 @@ export default domAssigned(class ConstructorDeclaration {
45
45
  static name = "ConstructorDeclaration";
46
46
 
47
47
  static fromConstructorDeclarationNode(constructorDeclarationNode, fileContext) {
48
- const constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
48
+ const { Constructor } = dom,
49
+ constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
49
50
  constructorDeclaration = new ConstructorDeclaration(fileContext, constructor);
50
51
 
51
52
  return constructorDeclaration;