occam-verify-cli 1.0.427 → 1.0.436

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 (125) hide show
  1. package/lib/context/file.js +1 -1
  2. package/lib/element/assertion.js +115 -24
  3. package/lib/element/assumption.js +120 -20
  4. package/lib/element/axiomLemmaTheoremConjecture.js +118 -30
  5. package/lib/element/conclusion.js +113 -25
  6. package/lib/element/declaration.js +112 -37
  7. package/lib/element/deduction.js +112 -66
  8. package/lib/element/derivation.js +114 -5
  9. package/lib/element/equality.js +119 -26
  10. package/lib/element/equivalence.js +129 -40
  11. package/lib/element/equivalences.js +122 -7
  12. package/lib/element/error.js +115 -32
  13. package/lib/element/frame.js +119 -59
  14. package/lib/element/hypothesis.js +115 -27
  15. package/lib/element/judgement.js +120 -33
  16. package/lib/element/label.js +116 -63
  17. package/lib/element/lemma.js +1 -9
  18. package/lib/element/metaLemma.js +1 -8
  19. package/lib/element/metaLemmaMetatheorem.js +117 -29
  20. package/lib/element/metaType.js +68 -61
  21. package/lib/element/metatheorem.js +1 -8
  22. package/lib/element/metavariable.js +122 -93
  23. package/lib/element/parameter.js +120 -20
  24. package/lib/element/premise.js +114 -35
  25. package/lib/element/procedureCall.js +117 -99
  26. package/lib/element/procedureReference.js +120 -20
  27. package/lib/element/proof.js +111 -55
  28. package/lib/element/property.js +121 -35
  29. package/lib/element/propertyRelation.js +116 -72
  30. package/lib/element/reference.js +120 -70
  31. package/lib/element/rule.js +116 -41
  32. package/lib/element/section.js +114 -133
  33. package/lib/element/signature.js +120 -20
  34. package/lib/element/statement/combinator/bracketed.js +4 -9
  35. package/lib/element/statement.js +110 -125
  36. package/lib/element/step.js +115 -27
  37. package/lib/element/subDerivation.js +111 -43
  38. package/lib/element/subproof.js +115 -20
  39. package/lib/element/substitution.js +115 -31
  40. package/lib/element/substitutions.js +120 -6
  41. package/lib/element/supposition.js +114 -35
  42. package/lib/element/term/constructor/bracketed.js +4 -8
  43. package/lib/element/term.js +111 -98
  44. package/lib/element/theorem.js +1 -8
  45. package/lib/element/type.js +71 -91
  46. package/lib/element/typePrefix.js +120 -20
  47. package/lib/element/variable.js +116 -111
  48. package/lib/element.js +67 -0
  49. package/lib/node/equivalence.js +116 -0
  50. package/lib/node/{nonsense.js → equivalences.js} +10 -10
  51. package/lib/node/frame.js +11 -5
  52. package/lib/node/procedureReference.js +6 -6
  53. package/lib/node/statement.js +11 -5
  54. package/lib/node/term.js +8 -1
  55. package/lib/nonTerminalNodeMap.js +5 -4
  56. package/lib/process/instantiate.js +13 -38
  57. package/lib/process/verify.js +22 -29
  58. package/lib/ruleNames.js +9 -5
  59. package/lib/utilities/brackets.js +11 -11
  60. package/lib/utilities/element.js +606 -99
  61. package/lib/utilities/instance.js +61 -0
  62. package/lib/utilities/string.js +87 -34
  63. package/package.json +6 -6
  64. package/src/context/file.js +1 -1
  65. package/src/element/assertion.js +4 -16
  66. package/src/element/assumption.js +5 -12
  67. package/src/element/axiomLemmaTheoremConjecture.js +4 -16
  68. package/src/element/conclusion.js +4 -16
  69. package/src/element/declaration.js +4 -16
  70. package/src/element/deduction.js +5 -19
  71. package/src/element/derivation.js +5 -2
  72. package/src/element/equality.js +4 -16
  73. package/src/element/equivalence.js +25 -37
  74. package/src/element/equivalences.js +12 -6
  75. package/src/element/error.js +4 -24
  76. package/src/element/frame.js +5 -56
  77. package/src/element/hypothesis.js +6 -23
  78. package/src/element/judgement.js +5 -30
  79. package/src/element/label.js +8 -19
  80. package/src/element/lemma.js +0 -7
  81. package/src/element/metaLemma.js +0 -7
  82. package/src/element/metaLemmaMetatheorem.js +4 -16
  83. package/src/element/metaType.js +23 -64
  84. package/src/element/metatheorem.js +0 -7
  85. package/src/element/metavariable.js +6 -94
  86. package/src/element/parameter.js +10 -18
  87. package/src/element/premise.js +4 -31
  88. package/src/element/procedureCall.js +5 -77
  89. package/src/element/procedureReference.js +7 -17
  90. package/src/element/proof.js +5 -17
  91. package/src/element/property.js +8 -30
  92. package/src/element/propertyRelation.js +5 -33
  93. package/src/element/reference.js +8 -72
  94. package/src/element/rule.js +4 -41
  95. package/src/element/section.js +4 -129
  96. package/src/element/signature.js +7 -13
  97. package/src/element/statement/combinator/bracketed.js +3 -9
  98. package/src/element/statement.js +3 -126
  99. package/src/element/step.js +4 -16
  100. package/src/element/subDerivation.js +5 -3
  101. package/src/element/subproof.js +5 -12
  102. package/src/element/substitution.js +4 -24
  103. package/src/element/substitutions.js +6 -2
  104. package/src/element/supposition.js +4 -31
  105. package/src/element/term/constructor/bracketed.js +4 -9
  106. package/src/element/term.js +6 -59
  107. package/src/element/theorem.js +0 -7
  108. package/src/element/type.js +9 -104
  109. package/src/element/typePrefix.js +8 -13
  110. package/src/element/variable.js +6 -109
  111. package/src/element.js +29 -0
  112. package/src/node/equivalence.js +16 -0
  113. package/src/node/{nonsense.js → equivalences.js} +2 -2
  114. package/src/node/frame.js +10 -5
  115. package/src/node/procedureReference.js +4 -4
  116. package/src/node/statement.js +10 -5
  117. package/src/node/term.js +7 -0
  118. package/src/nonTerminalNodeMap.js +7 -4
  119. package/src/process/instantiate.js +8 -36
  120. package/src/process/verify.js +42 -47
  121. package/src/ruleNames.js +2 -1
  122. package/src/utilities/brackets.js +13 -13
  123. package/src/utilities/element.js +760 -139
  124. package/src/utilities/instance.js +53 -0
  125. package/src/utilities/string.js +118 -59
@@ -2,11 +2,11 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
+ import Element from "../element";
5
6
  import elements from "../elements";
6
7
  import LocalContext from "../context/local";
7
8
 
8
9
  import { define } from "../elements";
9
- import { labelsStringFromLabels } from "./axiomLemmaTheoremConjecture";
10
10
  import { labelsFromJSON,
11
11
  premisesFromJSON,
12
12
  conclusionFromJSON,
@@ -16,29 +16,16 @@ import { labelsFromJSON,
16
16
 
17
17
  const { reverse, extract, backwardsEvery } = arrayUtilities;
18
18
 
19
- export default define(class Rule {
19
+ export default define(class Rule extends Element {
20
20
  constructor(context, string, node, labels, premises, conclusion, proof) {
21
- this.context = context;
22
- this.string = string;
23
- this.node = node;
21
+ super(context, string, node);
22
+
24
23
  this.labels = labels;
25
24
  this.premises = premises;
26
25
  this.conclusion = conclusion;
27
26
  this.proof = proof;
28
27
  }
29
28
 
30
- getContext() {
31
- return this.context;
32
- }
33
-
34
- getNode() {
35
- return this.node;
36
- }
37
-
38
- getString() {
39
- return this.string;
40
- }
41
-
42
29
  getLabels() {
43
30
  return this.labels;
44
31
  }
@@ -319,27 +306,3 @@ function conclusionFromRuleNode(ruleNode, context) {
319
306
  return conclusion;
320
307
  }
321
308
 
322
- function premisesStringFromPremises(premises) {
323
- const premisesString = premises.reduce((premisesString, premise) => {
324
- const premiseString = premise.getString();
325
-
326
- premisesString = (premisesString !== null) ?
327
- `${premisesString}, ${premiseString}` :
328
- premiseString; ///
329
-
330
- return premisesString;
331
- }, null);
332
-
333
- return premisesString;
334
- }
335
-
336
- function stringFromLabelsPremisesAndConclusion(labels, premises, conclusion) {
337
- const premisesString = premisesStringFromPremises(premises),
338
- conclusionString = conclusion.getString(),
339
- labelsString = labelsStringFromLabels(labels),
340
- string = (premisesString !== null) ?
341
- `${labelsString} :: [${premisesString}] ... ${conclusionString}` :
342
- `${labelsString} :: ${conclusionString}`;
343
-
344
- return string;
345
- }
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../elements";
4
- import LocalContext from "../context/local";
3
+ import Element from "../element";
5
4
 
6
5
  import { define } from "../elements";
7
6
 
8
- export default define(class Section {
7
+ export default define(class Section extends Element {
9
8
  constructor(context, string, node, hypotheses, axiom, lemma, theorem, conjecture) {
10
- this.context = context;
11
- this.string = string;
12
- this.node = node;
9
+ super(context, string, node);
10
+
13
11
  this.hypotheses = hypotheses;
14
12
  this.axiom = axiom;
15
13
  this.lemma = lemma;
@@ -17,18 +15,6 @@ export default define(class Section {
17
15
  this.conjecture = conjecture;
18
16
  }
19
17
 
20
- getContext() {
21
- return this.context;
22
- }
23
-
24
- getNode() {
25
- return this.node;
26
- }
27
-
28
- getString() {
29
- return this.string;
30
- }
31
-
32
18
  getHypotheses() {
33
19
  return this.hypotheses;
34
20
  }
@@ -89,115 +75,4 @@ export default define(class Section {
89
75
  }
90
76
 
91
77
  static name = "Section";
92
-
93
- static fromSectionNode(sectionNode, context) {
94
- const localContext = LocalContext.fromNothing(context);
95
-
96
- context = localContext; ///
97
-
98
- const hypothesisNodes = sectionNode.getHypothesisNodes(),
99
- hypotheses = hypothesesFromHypothesisNodes(hypothesisNodes, context),
100
- axiom = axiomFroSectionNode(sectionNode, context),
101
- lemma = lemmaFroSectionNode(sectionNode, context),
102
- theorem = theoremFroSectionNode(sectionNode, context),
103
- conjecture = conjectureFroSectionNode(sectionNode, context),
104
- node = sectionNode, ///
105
- string = stringFromHypothesesAxiomLemmaTheoremAndConjecture(hypotheses, axiom, lemma, theorem, conjecture, context),
106
- section = new Section(context, string, node, hypotheses, axiom, lemma, theorem, conjecture);
107
-
108
- return section;
109
- }
110
78
  });
111
-
112
- function axiomFroSectionNode(sectionNode, context) {
113
- let axiom = null;
114
-
115
- const axiomNode = sectionNode.getAxiomNode();
116
-
117
- if (axiomNode !== null) {
118
- const { Axiom } = elements;
119
-
120
- axiom = Axiom.fromAxiomNode(axiomNode, context);
121
- }
122
-
123
- return axiom;
124
- }
125
-
126
- function lemmaFroSectionNode(sectionNode, context) {
127
- let lemma = null;
128
-
129
- const lemmaNode = sectionNode.getLemmaNode();
130
-
131
- if (lemmaNode !== null) {
132
- const { Lemma } = elements;
133
-
134
- lemma = Lemma.fromLemmaNode(lemmaNode, context);
135
- }
136
-
137
- return lemma;
138
- }
139
-
140
- function theoremFroSectionNode(sectionNode, context) {
141
- let theorem = null;
142
-
143
- const theoremNode = sectionNode.getTheoremNode();
144
-
145
- if (theoremNode !== null) {
146
- const { Theorem } = elements;
147
-
148
- theorem = Theorem.fromTheoremNode(theoremNode, context);
149
- }
150
-
151
- return theorem;
152
- }
153
-
154
- function conjectureFroSectionNode(sectionNode, context) {
155
- let conjecture = null;
156
-
157
- const conjectureNode = sectionNode.getConjectureNode();
158
-
159
- if (conjectureNode !== null) {
160
- const { Conjecture } = elements;
161
-
162
- conjecture = Conjecture.fromConjectureNode(conjectureNode, context);
163
- }
164
-
165
- return conjecture;
166
- }
167
-
168
- function hypothesesFromHypothesisNodes(hypothesisNodes, context) {
169
- const hypotheses = hypothesisNodes.map((hypothesisNode) => {
170
- const { Hypothesis } = elements,
171
- hypothesis = Hypothesis.fromHypothesisNode(hypothesisNode, context);
172
-
173
- return hypothesis;
174
- });
175
-
176
- return hypotheses;
177
- }
178
-
179
- function hypothesesStringFromHypotheses(hypotheses, context) {
180
- const hypothesesString = hypotheses.reduce((hypothesesString, hypothesis) => {
181
- const hypothesisString = hypothesis.getString();
182
-
183
- hypothesesString = (hypothesesString !== null) ?
184
- `${hypothesesString}, ${hypothesisString}` :
185
- hypothesisString; ///
186
-
187
- return hypothesesString;
188
- }, null);
189
-
190
- return hypothesesString;
191
- }
192
-
193
- function stringFromHypothesesAxiomLemmaTheoremAndConjecture(hypotheses, axiom, lemma, theorem, conjecture, context) {
194
- const axiomLemmaTheoremOrConjecture = (axiom || lemma || theorem || conjecture),
195
- axiomLemmaTheoremOrConjectureString = axiomLemmaTheoremOrConjecture.getString(),
196
- hypothesesString = hypothesesStringFromHypotheses(hypotheses, context),
197
- string = (axiomLemmaTheoremOrConjectureString !== null) ?
198
- `[${hypothesesString}]::: ${axiomLemmaTheoremOrConjectureString}` :
199
- `[${hypothesesString}]::: `;
200
-
201
-
202
- return string;
203
- }
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
+ import Element from "../element";
5
6
  import elements from "../elements";
6
7
 
7
8
  import { define } from "../elements";
@@ -10,19 +11,11 @@ import { termsFromJSON, termsToTermsJSON } from "../utilities/json";
10
11
 
11
12
  const { match, compare, correlate } = arrayUtilities;
12
13
 
13
- export default define(class Signature {
14
- constructor(string, node, terms) {
15
- this.string = string;
16
- this.node = node;
17
- this.terms = terms;
18
- }
14
+ export default define(class Signature extends Element {
15
+ constructor(context, string, node, terms) {
16
+ super(context, string, node);
19
17
 
20
- getString() {
21
- return this.string;
22
- }
23
-
24
- getNode() {
25
- return this.node;
18
+ this.terms = terms;
26
19
  }
27
20
 
28
21
  getTerms() {
@@ -160,7 +153,8 @@ export default define(class Signature {
160
153
  const terms = termsFromJSON(json, context),
161
154
  signatureString = signatureStringFromTerms(terms),
162
155
  string = signatureString, ///
163
- signature = new Signature(string, terms);
156
+ node = null,
157
+ signature = new Signature(context, string, node, terms);
164
158
 
165
159
  return signature;
166
160
  }
@@ -2,9 +2,8 @@
2
2
 
3
3
  import CombinatorStatement from "../../statement/combinator";
4
4
 
5
- import { define } from "../../elements";
6
- import { statementFromStatementNode } from "../../utilities/element";
7
- import { bracketedCombinatorStatementString, instantiateBracketedCombinatorStatement } from "../../../process/instantiate";
5
+ import { define } from "../../../elements";
6
+ import { bracketedCombinatorStatementFromNothing } from "../../../utilities/instance";
8
7
 
9
8
  export default define(class BracketedCombinatorStatement extends CombinatorStatement {
10
9
  unifyStatement(statement, assignments, stated, context) {
@@ -26,12 +25,7 @@ export default define(class BracketedCombinatorStatement extends CombinatorState
26
25
  static name = "BracketedCombinatorStatement";
27
26
 
28
27
  static fromNothing() {
29
- const bracketedCombinatorStatementNode = instantiateBracketedCombinatorStatement(),
30
- nodeAsString = () => bracketedCombinatorStatementString,
31
- context = {
32
- nodeAsString
33
- },
34
- bracketedCombinatorStatement = statementFromStatementNode(bracketedCombinatorStatementNode, context);
28
+ const bracketedCombinatorStatement = bracketedCombinatorStatementFromNothing();
35
29
 
36
30
  return bracketedCombinatorStatement;
37
31
  }
@@ -2,33 +2,19 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
+ import Element from "../element";
5
6
  import verifyMixins from "../mixins/statement/verify";
6
7
 
7
8
  import { define } from "../elements";
8
9
  import { unifyStatement } from "../process/unify";
9
10
  import { instantiateStatement } from "../process/instantiate";
10
11
  import { STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
11
- import { stripBracketsFromStatementNode } from "../utilities/brackets";
12
12
 
13
13
  const { match, backwardsSome } = arrayUtilities;
14
14
 
15
- export default define(class Statement {
15
+ export default define(class Statement extends Element {
16
16
  constructor(context, string, node) {
17
- this.context = context;
18
- this.string = string;
19
- this.node = node;
20
- }
21
-
22
- getContext() {
23
- return this.context;
24
- }
25
-
26
- getString() {
27
- return this.string;
28
- }
29
-
30
- getNode() {
31
- return this.node;
17
+ super(context, string, node);
32
18
  }
33
19
 
34
20
  getMetavariableName() {
@@ -45,14 +31,6 @@ export default define(class Statement {
45
31
 
46
32
  isSingular() { return this.node.isSingular(); }
47
33
 
48
- isEqualTo(statement) {
49
- const statementNode = statement.getNode(),
50
- matches = this.node.match(statementNode),
51
- equalTo = matches; ///
52
-
53
- return equalTo;
54
- }
55
-
56
34
  isTermContained(term, context) {
57
35
  let termContained;
58
36
 
@@ -300,105 +278,4 @@ export default define(class Statement {
300
278
 
301
279
  return statement;
302
280
  }
303
-
304
- static fromStepNode(stepNode, context) {
305
- let statement = null;
306
-
307
- const statementNode = stepNode.getStatementNode();
308
-
309
- if (statementNode !== null) {
310
- statement = statementFromStatementNode(statementNode, context);
311
- }
312
-
313
- return statement;
314
- }
315
-
316
- static fromPremiseNode(premiseNode, context) {
317
- let statement = null;
318
-
319
- const statementNode = premiseNode.getStatementNode();
320
-
321
- if (statementNode !== null) {
322
- statement = statementFromStatementNode(statementNode, context);
323
- }
324
-
325
- return statement;
326
- }
327
-
328
- static fromStatementNode(statementNode, context) {
329
- const statement = statementFromStatementNode(statementNode, context);
330
-
331
- return statement;
332
- }
333
-
334
- static fromDeductionNode(deductionNode, context) {
335
- let statement = null;
336
-
337
- const statementNode = deductionNode.getStatementNode();
338
-
339
- if (statementNode !== null) {
340
- statement = statementFromStatementNode(statementNode, context);
341
- }
342
-
343
- return statement;
344
- }
345
-
346
- static fromHypothesisNode(hypothesisNode, context) {
347
- let statement = null;
348
-
349
- const statementNode = hypothesisNode.getStatementNode();
350
-
351
- if (statementNode !== null) {
352
- statement = statementFromStatementNode(statementNode, context);
353
- }
354
-
355
- return statement;
356
- }
357
-
358
- static fromConclusionNode(conclusionNode, context) {
359
- let statement = null;
360
-
361
- const statementNode = conclusionNode.getStatementNode();
362
-
363
- if (statementNode !== null) {
364
- statement = statementFromStatementNode(statementNode, context);
365
- }
366
-
367
- return statement;
368
- }
369
-
370
- static fromAssumptionNode(assumptionNode, context) {
371
- let statement = null;
372
-
373
- let statementNode;
374
-
375
- statementNode = assumptionNode.getStatementNode(); ///
376
-
377
- if (statementNode !== null) {
378
- statementNode = stripBracketsFromStatementNode(statementNode); ///
379
-
380
- statement = statementFromStatementNode(statementNode, context);
381
- }
382
-
383
- return statement;
384
- }
385
-
386
- static fromSuppositionNode(suppositionNode, context) {
387
- let statement = null;
388
-
389
- const statementNode = suppositionNode.getStatementNode();
390
-
391
- if (statementNode !== null) {
392
- statement = statementFromStatementNode(statementNode, context);
393
- }
394
-
395
- return statement;
396
- }
397
-
398
- static fromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
399
- const statementNode = combinatorDeclarationNode.getStatementNode(),
400
- statement = statementFromStatementNode(statementNode, context);
401
-
402
- return statement;
403
- }
404
281
  });
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import Element from "../element";
3
4
  import elements from "../elements";
4
5
  import unifyMixins from "../mixins/step/unify";
5
6
  import TemporaryContext from "../context/temporary";
@@ -8,28 +9,15 @@ import { define } from "../elements";
8
9
  import { equateStatements } from "../process/equate";
9
10
  import { propertyAssertionFromStatement } from "../utilities/statement";
10
11
 
11
- export default define(class Step {
12
+ export default define(class Step extends Element {
12
13
  constructor(context, string, node, statement, reference, satisfiesAssertion) {
13
- this.context = context;
14
- this.string = string;
15
- this.node = node;
14
+ super(context, string, node);
15
+
16
16
  this.statement = statement;
17
17
  this.reference = reference;
18
18
  this.satisfiesAssertion = satisfiesAssertion;
19
19
  }
20
20
 
21
- getContext() {
22
- return this.context;
23
- }
24
-
25
- getString() {
26
- return this.string;
27
- }
28
-
29
- getNode() {
30
- return this.node;
31
- }
32
-
33
21
  getStatement() {
34
22
  return this.statement;
35
23
  }
@@ -2,15 +2,17 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
- import elements from "../elements";
5
+ import Element from "../element";
6
6
  import assignAssignments from "../process/assign";
7
7
 
8
8
  import { define } from "../elements";
9
9
 
10
10
  const { last } = arrayUtilities;
11
11
 
12
- export default define(class SubDerivation {
13
- constructor(stepsOrSubproofs) {
12
+ export default define(class SubDerivation extends Element {
13
+ constructor(context, string, node, stepsOrSubproofs) {
14
+ super(context, string, node);
15
+
14
16
  this.stepsOrSubproofs = stepsOrSubproofs;
15
17
  }
16
18
 
@@ -1,26 +1,19 @@
1
1
  "use strict";
2
2
 
3
+ import Element from "../element";
3
4
  import elements from "../elements";
4
5
  import LocalContext from "../context/local";
5
6
 
6
7
  import { define } from "../elements";
7
8
 
8
- export default define(class Subproof {
9
- constructor(string, node, suppositions, subDerivation) {
10
- this.string = string;
11
- this.node = node;
9
+ export default define(class Subproof extends Element {
10
+ constructor(context, string, node, suppositions, subDerivation) {
11
+ super(context, string, node);
12
+
12
13
  this.suppositions = suppositions;
13
14
  this.subDerivation = subDerivation;
14
15
  }
15
16
 
16
- getString() {
17
- return this.string;
18
- }
19
-
20
- getNode() {
21
- return this.node;
22
- }
23
-
24
17
  getSuppositions() {
25
18
  return this.suppositions;
26
19
  }
@@ -1,22 +1,10 @@
1
1
  "use strict";
2
2
 
3
- export default class Substitution {
4
- constructor(context, string, node) {
5
- this.context = context;
6
- this.string = string;
7
- this.node = node;
8
- }
9
-
10
- getContext() {
11
- return this.context;
12
- }
13
-
14
- getString() {
15
- return this.string;
16
- }
3
+ import Element from "../element";
17
4
 
18
- getNode() {
19
- return this.node;
5
+ export default class Substitution extends Element {
6
+ constructor(context, string, node) {
7
+ super(context, string, node);
20
8
  }
21
9
 
22
10
  getTerm() {
@@ -86,14 +74,6 @@ export default class Substitution {
86
74
  return trivial;
87
75
  }
88
76
 
89
- isEqualTo(substitution) {
90
- const substitutionNode = substitution.getNode(),
91
- matches = this.node.match(substitutionNode),
92
- equalTo = matches; ///
93
-
94
- return equalTo;
95
- }
96
-
97
77
  isTermEqualToTerm(term, context) {
98
78
  const termEqualToTerm = false;
99
79
 
@@ -2,13 +2,17 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
+ import Element from "../element";
6
+
5
7
  import { define } from "../elements";
6
8
  import { EMPTY_STRING } from "../constants";
7
9
 
8
10
  const { find, first, clear, prune, filter, compress, correlate } = arrayUtilities;
9
11
 
10
- export default define(class Substitutions {
11
- constructor(array, savedArray) {
12
+ export default define(class Substitutions extends Element {
13
+ constructor(context, string, node, array, savedArray) {
14
+ super(context, string, node);
15
+
12
16
  this.array = array;
13
17
  this.savedArray = savedArray;
14
18
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import Element from "../element";
3
4
  import elements from "../elements";
4
5
  import TemporaryContext from "../context/temporary";
5
6
  import assignAssignments from "../process/assign";
@@ -8,27 +9,14 @@ import { define } from "../elements";
8
9
  import { subproofAssertionFromStatement } from "../utilities/statement";
9
10
  import { termsFromJSON, framesFromJSON, statementFromJSON, procedureCallFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
10
11
 
11
- export default define(class Supposition {
12
+ export default define(class Supposition extends Element {
12
13
  constructor(context, string, node, statement, procedureCall) {
13
- this.context = context;
14
- this.string = string;
15
- this.node = node;
14
+ super(context, string, node);
15
+
16
16
  this.statement = statement;
17
17
  this.procedureCall = procedureCall;
18
18
  }
19
19
 
20
- getContext() {
21
- return this.context;
22
- }
23
-
24
- getNode() {
25
- return this.node;
26
- }
27
-
28
- getString() {
29
- return this.string;
30
- }
31
-
32
20
  getStatement() {
33
21
  return this.statement;
34
22
  }
@@ -300,19 +288,4 @@ export default define(class Supposition {
300
288
 
301
289
  return supposition;
302
290
  }
303
-
304
- static fromSuppositionNode(suppositionNode, context) {
305
- const { Statement, ProcedureCall } = elements,
306
- node = suppositionNode, ///
307
- string = context.nodeAsString(node),
308
- statement = Statement.fromSuppositionNode(suppositionNode, context),
309
- procedureCall = ProcedureCall.fromSuppositionNode(suppositionNode, context),
310
- temporaryContext = null;
311
-
312
- context = temporaryContext; ///
313
-
314
- const supposition = new Supposition(context, string, node, statement, procedureCall);
315
-
316
- return supposition
317
- }
318
291
  });
@@ -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 { bracketedConstructorTermString, instantiateBracketedConstructorTerm } from "../../../process/instantiate";
6
+ import { define } from "../../../elements";
7
+ import { bracketedConstructorTermFromNothing } from "../../../utilities/instance";
8
8
 
9
9
  export default define(class BracketedConstructor extends Constructor {
10
10
  unifyTerm(term, context, verifyAhead) {
@@ -55,12 +55,7 @@ export default define(class BracketedConstructor extends Constructor {
55
55
  static name = "BracketedConstructor";
56
56
 
57
57
  static fromNothing() {
58
- const bracketedConstructorTermNode = instantiateBracketedConstructorTerm(),
59
- nodeAsString = () => bracketedConstructorTermString,
60
- context = {
61
- nodeAsString
62
- },
63
- bracketedConstructorTerm = statementFromTermNode(bracketedConstructorTermNode, context);
58
+ const bracketedConstructorTerm = bracketedConstructorTermFromNothing();
64
59
 
65
60
  return bracketedConstructorTerm;
66
61
  }