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
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import nominalContext from "../context/nominal";
4
-
5
3
  import { ruleFromBNF } from "../utilities/bnf";
6
- import { BASE_TYPE_SYMBOL } from "../constants";
7
- import { STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
8
4
 
9
5
  const termPlaceholderBNF = ` _ ::= term... <END_OF_LINE> ; `,
10
6
  variablePlaceholderBNF = ` _ ::= variable... <END_OF_LINE> ; `,
7
+ referencePlaceholderBNF = ` _ ::= reference... <END_OF_LINE> ; `,
11
8
  statementPlaceholderBNF = ` _ ::= statement... <END_OF_LINE> ; `,
9
+ equivalencePlaceholderBNF = ` _ ::= equivalence... <END_OF_LINE> ; `,
12
10
  metavariablePlaceholderBNF = ` _ ::= metavariable... <END_OF_LINE> ; `,
13
11
  termSubstitutionPlaceholderBNF = ` _ ::= termSubstitution... <END_OF_LINE> ; `,
14
12
  frameSubstitutionPlaceholderBNF = ` _ ::= frameSubstitution... <END_OF_LINE> ; `,
@@ -16,25 +14,25 @@ const termPlaceholderBNF = ` _ ::= term... <END_OF_LINE> ; `,
16
14
  referenceSubstitutionPlaceholderBNF = ` _ ::= referenceSubstitution... <END_OF_LINE> ; `,
17
15
  termPlaceholderRule = ruleFromBNF(termPlaceholderBNF),
18
16
  variablePlaceholderRule = ruleFromBNF(variablePlaceholderBNF),
17
+ referencePlaceholderRule = ruleFromBNF(referencePlaceholderBNF),
19
18
  statementPlaceholderRule = ruleFromBNF(statementPlaceholderBNF),
19
+ equivalencePlaceholderRule = ruleFromBNF(equivalencePlaceholderBNF),
20
20
  metavariablePlaceholderRule = ruleFromBNF(metavariablePlaceholderBNF),
21
21
  termSubstitutionPlaceholderRule = ruleFromBNF(termSubstitutionPlaceholderBNF),
22
22
  frameSubstitutionPlaceholderRule = ruleFromBNF(frameSubstitutionPlaceholderBNF),
23
23
  statementSubstitutionPlaceholderRule = ruleFromBNF(statementSubstitutionPlaceholderBNF),
24
24
  referenceSubstitutionPlaceholderRule = ruleFromBNF(referenceSubstitutionPlaceholderBNF);
25
25
 
26
- let bracketedConstructorTermNode = null,
27
- bracketedCombinatorStatementNode = null;
28
-
29
- export const bracketedConstructorTermString = `(${BASE_TYPE_SYMBOL})`;
30
- export const bracketedCombinatorStatementString = `(${STATEMENT_META_TYPE_NAME})`;
31
-
32
26
  export function instantiateTerm(string, context) { return instantiate(termPlaceholderRule, string, context); }
33
27
 
34
28
  export function instantiateVariable(string, context) { return instantiate(variablePlaceholderRule, string, context); }
35
29
 
30
+ export function instantiateReference(string, context) { return instantiate(referencePlaceholderRule, string, context); }
31
+
36
32
  export function instantiateStatement(string, context) { return instantiate(statementPlaceholderRule, string, context); }
37
33
 
34
+ export function instantiateEquivalence(string, context) { return instantiate(equivalencePlaceholderRule, string, context); }
35
+
38
36
  export function instantiateMetavariable(string, context) { return instantiate(metavariablePlaceholderRule, string, context); }
39
37
 
40
38
  export function instantiateTermSubstitution(string, context) { return instantiate(termSubstitutionPlaceholderRule, string, context); }
@@ -45,32 +43,6 @@ export function instantiateStatementSubstitution(string, context) { return insta
45
43
 
46
44
  export function instantiateReferenceSubstitution(string, context) { return instantiate(referenceSubstitutionPlaceholderRule, string, context); }
47
45
 
48
- export function instantiateBracketedConstructorTerm() {
49
- if (bracketedConstructorTermNode === null) {
50
- const placeholderRule = termPlaceholderRule, ///
51
- string = bracketedConstructorTermString,
52
- context = nominalContext, ///
53
- node = instantiate(placeholderRule, string, context);
54
-
55
- bracketedConstructorTermNode = node; ///
56
- }
57
-
58
- return bracketedConstructorTermNode;
59
- }
60
-
61
- export function instantiateBracketedCombinatorStatement() {
62
- if (bracketedCombinatorStatementNode === null) {
63
- const placeholderRule = statementPlaceholderRule, ///
64
- string = bracketedCombinatorStatementString, ///
65
- context = nominalContext, ///
66
- node = instantiate(placeholderRule, string, context);
67
-
68
- bracketedCombinatorStatementNode = node; ///
69
- }
70
-
71
- return bracketedCombinatorStatementNode;
72
- }
73
-
74
46
  function instantiate(placeholderRule, string, context) {
75
47
  let node;
76
48
 
@@ -1,22 +1,36 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../elements";
4
-
5
3
  import { nodeQuery } from "../utilities/query";
6
4
  import { isLastRemainingArgumentFunction } from "../utilities/pass";
7
-
8
- const nonTerminalNodeQuery = nodeQuery("/*");
9
-
10
- const termNodeQuery = nodeQuery("/term"),
5
+ import { termFromTermNode,
6
+ ruleFromRuleNode,
7
+ errorFromErrorNode,
8
+ axiomFromAxiomNode,
9
+ lemmaFromLemmaNode,
10
+ sectionFromSectionNode,
11
+ theoremFromTheoremNode,
12
+ metaLemmaFromMetaLemmaNode,
13
+ statementFromStatementNode,
14
+ conjectureFromConjectureNode,
15
+ metatheoremFromMetatheoremNode,
16
+ variableDeclarationFromVariableDeclarationNode,
17
+ simpleTypeDeclarationFromSimpleTypeDeclarationNode,
18
+ typePrefixDeclarationFromTypePrefixDeclarationNode,
19
+ combinatorDeclarationFromCombinatorDeclarationNode,
20
+ constructorDeclarationFromConstructorDeclarationNode,
21
+ complexTypeDeclarationFromComplexTypeDeclarationNode,
22
+ metavariableDeclarationFromMetavariableDeclarationNode } from "../utilities/element";
23
+
24
+ const nonTerminalNodeQuery = nodeQuery("/*"),
25
+ termNodeQuery = nodeQuery("/term"),
11
26
  typeNodeQuery = nodeQuery("/type"),
12
- statementNodeQuery = nodeQuery("/statement");
13
-
14
- const errorNodeQuery = nodeQuery("/error"),
15
27
  ruleNodeQuery = nodeQuery("/rule"),
28
+ errorNodeQuery = nodeQuery("/error"),
16
29
  axiomNodeQuery = nodeQuery("/axiom"),
17
30
  lemmaNodeQuery = nodeQuery("/lemma"),
18
31
  sectionNodeQuery = nodeQuery("/section"),
19
32
  theoremNodeQuery = nodeQuery("/theorem"),
33
+ statementNodeQuery = nodeQuery("/statement"),
20
34
  metaLemmaNodeQuery = nodeQuery("/metaLemma"),
21
35
  conjectureNodeQuery = nodeQuery("/conjecture"),
22
36
  metatheoremNodeQuery = nodeQuery("/metatheorem"),
@@ -182,8 +196,7 @@ class TopLevelPass extends Pass {
182
196
  run: (errorNode, context) => {
183
197
  let success = false;
184
198
 
185
- const { Error } = elements,
186
- error = Error.fromErrorNode(errorNode, context),
199
+ const error = errorFromErrorNode(errorNode, context),
187
200
  errorVerifies = error.verify();
188
201
 
189
202
  if (errorVerifies) {
@@ -198,8 +211,7 @@ class TopLevelPass extends Pass {
198
211
  run: (ruleNode, context) => {
199
212
  let success = false;
200
213
 
201
- const { Rule } = elements,
202
- rule = Rule.fromRuleNode(ruleNode, context),
214
+ const rule = ruleFromRuleNode(ruleNode, context),
203
215
  ruleVerifies = rule.verify();
204
216
 
205
217
  if (ruleVerifies) {
@@ -214,8 +226,7 @@ class TopLevelPass extends Pass {
214
226
  run: (axiomNode, context) => {
215
227
  let success = false;
216
228
 
217
- const { Axiom } = elements,
218
- axiom = Axiom.fromAxiomNode(axiomNode, context),
229
+ const axiom = axiomFromAxiomNode(axiomNode, context),
219
230
  axiomVerifies = axiom.verify();
220
231
 
221
232
  if (axiomVerifies) {
@@ -230,8 +241,7 @@ class TopLevelPass extends Pass {
230
241
  run: (lemmaNode, context) => {
231
242
  let success = false;
232
243
 
233
- const { Lemma } = elements,
234
- lemma = Lemma.fromLemmaNode(lemmaNode, context),
244
+ const lemma = lemmaFromLemmaNode(lemmaNode, context),
235
245
  lemmaVerifies = lemma.verify();
236
246
 
237
247
  if (lemmaVerifies) {
@@ -246,8 +256,7 @@ class TopLevelPass extends Pass {
246
256
  run: (sectionNode, context) => {
247
257
  let success = false;
248
258
 
249
- const { Section } = elements,
250
- section = Section.fromSectionNode(sectionNode, context),
259
+ const section = sectionFromSectionNode(sectionNode, context),
251
260
  sectionVerifies = section.verify();
252
261
 
253
262
  if (sectionVerifies) {
@@ -262,8 +271,7 @@ class TopLevelPass extends Pass {
262
271
  run: (theoremNode, context) => {
263
272
  let success = false;
264
273
 
265
- const { Theorem } = elements,
266
- theorem = Theorem.fromTheoremNode(theoremNode, context),
274
+ const theorem = theoremFromTheoremNode(theoremNode, context),
267
275
  theoremVerifies = theorem.verify();
268
276
 
269
277
  if (theoremVerifies) {
@@ -278,8 +286,7 @@ class TopLevelPass extends Pass {
278
286
  run: (metaLemmaNode, context) => {
279
287
  let success = false;
280
288
 
281
- const { MetaLemma } = elements,
282
- metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode, context),
289
+ const metaLemma = metaLemmaFromMetaLemmaNode(metaLemmaNode, context),
283
290
  metaLemmaVerifies = metaLemma.verify();
284
291
 
285
292
  if (metaLemmaVerifies) {
@@ -294,8 +301,7 @@ class TopLevelPass extends Pass {
294
301
  run: (conjectureNode, context) => {
295
302
  let success = false;
296
303
 
297
- const { Conjecture } = elements,
298
- conjecture = Conjecture.fromConjectureNode(conjectureNode, context),
304
+ const conjecture = conjectureFromConjectureNode(conjectureNode, context),
299
305
  conjectureVerifies = conjecture.verify();
300
306
 
301
307
  if (conjectureVerifies) {
@@ -310,8 +316,7 @@ class TopLevelPass extends Pass {
310
316
  run: (metatheoremNode, context) => {
311
317
  let success = false;
312
318
 
313
- const { Metatheorem } = elements,
314
- metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode, context),
319
+ const metatheorem = metatheoremFromMetatheoremNode(metatheoremNode, context),
315
320
  metatheoremVerifies = metatheorem.verify();
316
321
 
317
322
  if (metatheoremVerifies) {
@@ -326,8 +331,7 @@ class TopLevelPass extends Pass {
326
331
  run: (variableDeclarationNode, context) => {
327
332
  let success = false;
328
333
 
329
- const { VariableDeclaration } = elements,
330
- variableDeclaration = VariableDeclaration.fromVariableDeclarationNode(variableDeclarationNode, context),
334
+ const variableDeclaration = variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context),
331
335
  variableDeclarationVerifies = variableDeclaration.verify();
332
336
 
333
337
  if (variableDeclarationVerifies) {
@@ -342,8 +346,7 @@ class TopLevelPass extends Pass {
342
346
  run: (simpleTypeDeclarationNode, context) => {
343
347
  let success = false;
344
348
 
345
- const { SimpleTypeDeclaration } = elements,
346
- simpleTypeDeclaration = SimpleTypeDeclaration.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
349
+ const simpleTypeDeclaration = simpleTypeDeclarationFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
347
350
  simpleTypeDeclarationVerifies = simpleTypeDeclaration.verify();
348
351
 
349
352
  if (simpleTypeDeclarationVerifies) {
@@ -358,8 +361,7 @@ class TopLevelPass extends Pass {
358
361
  run: (typePrefixDeclarationNode, context) => {
359
362
  let success = false;
360
363
 
361
- const { TypePrefixDeclaration } = elements,
362
- typePrefixDeclaration = TypePrefixDeclaration.fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
364
+ const typePrefixDeclaration = typePrefixDeclarationFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
363
365
  typePrefixDeclarationVerifies = typePrefixDeclaration.verify();
364
366
 
365
367
  if (typePrefixDeclarationVerifies) {
@@ -374,8 +376,7 @@ class TopLevelPass extends Pass {
374
376
  run: (combinatorDeclarationNode, context) => {
375
377
  let success = false;
376
378
 
377
- const { CombinatorDeclaration } = elements,
378
- combinatorDeclaration = CombinatorDeclaration.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
379
+ const combinatorDeclaration = combinatorDeclarationFromCombinatorDeclarationNode(combinatorDeclarationNode, context),
379
380
  combinatorDeclarationVerifies = combinatorDeclaration.verify();
380
381
 
381
382
  if (combinatorDeclarationVerifies) {
@@ -390,8 +391,7 @@ class TopLevelPass extends Pass {
390
391
  run: (constructorDeclarationNode, context) => {
391
392
  let success = false;
392
393
 
393
- const { ConstructorDeclaration } = elements,
394
- constructorDeclaration = ConstructorDeclaration.fromConstructorDeclarationNode(constructorDeclarationNode, context),
394
+ const constructorDeclaration = constructorDeclarationFromConstructorDeclarationNode(constructorDeclarationNode, context),
395
395
  constructorDeclarationVerifies = constructorDeclaration.verify();
396
396
 
397
397
  if (constructorDeclarationVerifies) {
@@ -406,8 +406,7 @@ class TopLevelPass extends Pass {
406
406
  run: (complexTypeDeclarationNode, context) => {
407
407
  let success = false;
408
408
 
409
- const { ComplexTypeDeclaration } = elements,
410
- complexTypeDeclaration = ComplexTypeDeclaration.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
409
+ const complexTypeDeclaration = complexTypeDeclarationFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
411
410
  complexTypeDeclarationVerifies = complexTypeDeclaration.verify();
412
411
 
413
412
  if (complexTypeDeclarationVerifies) {
@@ -422,8 +421,7 @@ class TopLevelPass extends Pass {
422
421
  run: (metavariableDeclarationNode, context) => {
423
422
  let success = false;
424
423
 
425
- const { MetavariableDeclaration } = elements,
426
- metavariableDeclaration = MetavariableDeclaration.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
424
+ const metavariableDeclaration = metavariableDeclarationFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
427
425
  metavariableDeclarationVerifies = metavariableDeclaration.verify();
428
426
 
429
427
  if (metavariableDeclarationVerifies) {
@@ -457,8 +455,7 @@ class CombinatorPass extends Pass {
457
455
  run: (statementNode, context) => {
458
456
  let success = false;
459
457
 
460
- const { Statement } = elements,
461
- statement = Statement.fromStatementNode(statementNode, context),
458
+ const statement = statementFromStatementNode(statementNode, context),
462
459
  assignments = null,
463
460
  stated = false,
464
461
  statementVerifies = statement.verify(assignments, stated, context);
@@ -475,8 +472,7 @@ class CombinatorPass extends Pass {
475
472
  run: (termNode, context) => {
476
473
  let success = false;
477
474
 
478
- const { Term } = elements,
479
- term = Term.fromTermNode(termNode, context),
475
+ const term = termFromTermNode(termNode, context),
480
476
  termVerifies = term.verify(context, () => {
481
477
  const verifiesAhead = true;
482
478
 
@@ -529,8 +525,7 @@ class ConstructorPass extends Pass {
529
525
  run: (termNode, context, verifyAhead) => {
530
526
  let success = false;
531
527
 
532
- const { Term } = elements,
533
- term = Term.fromTermNode(termNode, context),
528
+ const term = termFromTermNode(termNode, context),
534
529
  termVerifies = term.verify(context, verifyAhead);
535
530
 
536
531
  if (termVerifies) {
package/src/ruleNames.js CHANGED
@@ -20,7 +20,6 @@ export const PROPERTY_RULE_NAME = "property";
20
20
  export const EQUALITY_RULE_NAME = "equality";
21
21
  export const VARIABLE_RULE_NAME = "variable";
22
22
  export const SUBPROOF_RULE_NAME = "subproof";
23
- export const NONSENSE_RULE_NAME = "nonsense";
24
23
  export const DOCUMENT_RULE_NAME = "document";
25
24
  export const RULE_BODY_RULE_NAME = "ruleBody";
26
25
  export const META_TYPE_RULE_NAME = "metaType";
@@ -45,10 +44,12 @@ export const TYPE_PREFIX_RULE_NAME = "typePrefix";
45
44
  export const SUPPOSITION_RULE_NAME = "supposition";
46
45
  export const CONSTRUCTOR_RULE_NAME = "constructor";
47
46
  export const METATHEOREM_RULE_NAME = "metatheorem";
47
+ export const EQUIVALENCE_RULE_NAME = "equivalence";
48
48
  export const AXIOM_HEADER_RULE_NAME = "axiomHeader";
49
49
  export const LEMMA_HEADER_RULE_NAME = "lemmaHeader";
50
50
  export const THEOREM_BODY_RULE_NAME = "theoremBody";
51
51
  export const METAVARIABLE_RULE_NAME = "metavariable";
52
+ export const EQUIVALENCES_RULE_NAME = "equivalences";
52
53
  export const META_ARGUMENT_RULE_NAME = "metaArgument";
53
54
  export const QUALIFICATION_RULE_NAME = "qualification";
54
55
  export const PROCEDURE_CALL_RULE_NAME = "procedureCall";
@@ -3,7 +3,7 @@
3
3
  import elements from "../elements";
4
4
 
5
5
  import { BRACKETED_TERM_DEPTH, BRACKETED_STATEMENT_DEPTH } from "../constants";
6
- import { instantiateBracketedCombinatorStatement, instantiateBracketedConstructorTerm } from "../process/instantiate";
6
+ import { bracketedConstructorTermFromNothing, bracketedCombinatorStatementFromNothing } from "../utilities/instance";
7
7
 
8
8
  export function stripBracketsFromTerm(term, context) {
9
9
  const termNode = term.getNode(),
@@ -19,6 +19,16 @@ export function stripBracketsFromTerm(term, context) {
19
19
  return term;
20
20
  }
21
21
 
22
+ export function stripBracketsFromTermNode(termNode) {
23
+ const bracketedTermChildNode = bracketedTermChildNodeFromTermNode(termNode);
24
+
25
+ if (bracketedTermChildNode !== null) {
26
+ termNode = bracketedTermChildNode; ///
27
+ }
28
+
29
+ return termNode;
30
+ }
31
+
22
32
  export function stripBracketsFromStatement(statement, context) {
23
33
  const statementNode = statement.getNode(),
24
34
  bracketedStatementChildNode = bracketedStatementChildNodeFromStatementNode(statementNode);
@@ -33,16 +43,6 @@ export function stripBracketsFromStatement(statement, context) {
33
43
  return statement;
34
44
  }
35
45
 
36
- export function stripBracketsFromTermNode(termNode) {
37
- const bracketedTermChildNode = bracketedTermChildNodeFromTermNode(termNode);
38
-
39
- if (bracketedTermChildNode !== null) {
40
- termNode = bracketedTermChildNode; ///
41
- }
42
-
43
- return termNode;
44
- }
45
-
46
46
  export function stripBracketsFromStatementNode(statementNode) {
47
47
  const bracketedStatementChildNode = bracketedStatementChildNodeFromStatementNode(statementNode);
48
48
 
@@ -57,7 +57,7 @@ function bracketedTermChildNodeFromTermNode(termNode) {
57
57
  let bracketedTermChildNode = null;
58
58
 
59
59
  const depth = BRACKETED_TERM_DEPTH,
60
- bracketedConstructorTermNode = instantiateBracketedConstructorTerm(),
60
+ bracketedConstructorTermNode = bracketedConstructorTermFromNothing(),
61
61
  termNodeMatchBracketedConstructorTermNode = termNode.match(bracketedConstructorTermNode, depth);
62
62
 
63
63
  if (termNodeMatchBracketedConstructorTermNode) {
@@ -73,7 +73,7 @@ function bracketedStatementChildNodeFromStatementNode(statementNode) {
73
73
  let bracketedStatementChildNode = null;
74
74
 
75
75
  const depth = BRACKETED_STATEMENT_DEPTH,
76
- bracketedCombinatorStatementNode = instantiateBracketedCombinatorStatement(),
76
+ bracketedCombinatorStatementNode = bracketedCombinatorStatementFromNothing(),
77
77
  statementNodeMatchBracketedCombinatorStatementNode = statementNode.match(bracketedCombinatorStatementNode, depth);
78
78
 
79
79
  if (statementNodeMatchBracketedCombinatorStatementNode) {