occam-verify-cli 1.0.172 → 1.0.176

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 (157) hide show
  1. package/lib/context/release.js +2 -5
  2. package/lib/customGrammar/combined.js +149 -0
  3. package/lib/dom/constructor.js +11 -11
  4. package/lib/dom/declaration/combinator.js +3 -3
  5. package/lib/dom/declaration/complexType.js +41 -23
  6. package/lib/dom/declaration/constructor.js +35 -42
  7. package/lib/dom/declaration/type.js +26 -27
  8. package/lib/dom/declaration/variable.js +29 -44
  9. package/lib/dom/metaType.js +2 -3
  10. package/lib/dom/metavariable.js +4 -5
  11. package/lib/dom/property.js +3 -4
  12. package/lib/dom/statement.js +13 -62
  13. package/lib/dom/term.js +17 -14
  14. package/lib/dom/type.js +35 -102
  15. package/lib/dom/variable.js +8 -6
  16. package/lib/mixins/node.js +145 -0
  17. package/lib/node/assertion/contained.js +23 -1
  18. package/lib/node/assertion/defined.js +23 -1
  19. package/lib/node/assertion/property.js +23 -1
  20. package/lib/node/assertion/satisfies.js +23 -1
  21. package/lib/node/assertion/subproof.js +23 -1
  22. package/lib/node/assertion/type.js +23 -1
  23. package/lib/node/axiom.js +23 -1
  24. package/lib/node/combinator.js +23 -1
  25. package/lib/node/conclusion.js +23 -1
  26. package/lib/node/conjecture.js +23 -1
  27. package/lib/node/constructor.js +23 -1
  28. package/lib/node/declaration/combinator.js +34 -1
  29. package/lib/node/declaration/complexType.js +81 -1
  30. package/lib/node/declaration/constructor.js +62 -1
  31. package/lib/node/declaration/metavariable.js +23 -1
  32. package/lib/node/declaration/property.js +180 -0
  33. package/lib/node/declaration/type.js +67 -1
  34. package/lib/node/declaration/variable.js +78 -1
  35. package/lib/node/declaration.js +23 -1
  36. package/lib/node/deduction.js +23 -1
  37. package/lib/node/derivation.js +23 -1
  38. package/lib/node/equality.js +23 -1
  39. package/lib/node/error.js +23 -1
  40. package/lib/node/frame.js +23 -1
  41. package/lib/node/judgement.js +23 -1
  42. package/lib/node/label.js +23 -1
  43. package/lib/node/lemma.js +23 -1
  44. package/lib/node/metaLemma.js +23 -1
  45. package/lib/node/metaType.js +34 -1
  46. package/lib/node/metatheorem.js +23 -1
  47. package/lib/node/metavariable.js +34 -1
  48. package/lib/node/parameter.js +23 -1
  49. package/lib/node/premise.js +23 -1
  50. package/lib/node/procedureCall.js +23 -1
  51. package/lib/node/proof.js +23 -1
  52. package/lib/node/property.js +35 -1
  53. package/lib/node/propertyRelation.js +23 -1
  54. package/lib/node/reference.js +23 -1
  55. package/lib/node/rule.js +23 -1
  56. package/lib/node/statement.js +23 -1
  57. package/lib/node/step.js +23 -1
  58. package/lib/node/subDerivation.js +23 -1
  59. package/lib/node/subproof.js +23 -1
  60. package/lib/node/supposition.js +23 -1
  61. package/lib/node/term.js +23 -1
  62. package/lib/node/theorem.js +23 -1
  63. package/lib/node/topLevelAssertion.js +23 -1
  64. package/lib/node/topLevelMetaAssertion.js +23 -1
  65. package/lib/node/type.js +34 -1
  66. package/lib/node/variable.js +34 -1
  67. package/lib/node.js +73 -2
  68. package/lib/nodeMap.js +5 -3
  69. package/lib/ruleNames.js +9 -1
  70. package/lib/unifier/metavariable.js +2 -3
  71. package/lib/unifier/statementWithCombinator.js +2 -3
  72. package/lib/unifier/termWithConstructor.js +2 -3
  73. package/lib/utilities/customGrammar.js +9 -3
  74. package/lib/utilities/node.js +84 -0
  75. package/lib/verifier/combinator.js +2 -3
  76. package/lib/verifier/constructor.js +2 -3
  77. package/package.json +9 -9
  78. package/src/context/release.js +2 -6
  79. package/src/customGrammar/combined.js +36 -0
  80. package/src/dom/constructor.js +10 -12
  81. package/src/dom/declaration/combinator.js +2 -2
  82. package/src/dom/declaration/complexType.js +43 -52
  83. package/src/dom/declaration/constructor.js +49 -57
  84. package/src/dom/declaration/type.js +34 -37
  85. package/src/dom/declaration/variable.js +30 -54
  86. package/src/dom/metaType.js +1 -2
  87. package/src/dom/metavariable.js +3 -4
  88. package/src/dom/property.js +5 -7
  89. package/src/dom/statement.js +6 -24
  90. package/src/dom/term.js +8 -14
  91. package/src/dom/type.js +45 -165
  92. package/src/dom/variable.js +19 -11
  93. package/src/mixins/node.js +201 -0
  94. package/src/node/assertion/contained.js +3 -1
  95. package/src/node/assertion/defined.js +3 -1
  96. package/src/node/assertion/property.js +3 -1
  97. package/src/node/assertion/satisfies.js +3 -1
  98. package/src/node/assertion/subproof.js +3 -1
  99. package/src/node/assertion/type.js +3 -1
  100. package/src/node/axiom.js +3 -1
  101. package/src/node/combinator.js +3 -1
  102. package/src/node/conclusion.js +3 -1
  103. package/src/node/conjecture.js +3 -1
  104. package/src/node/constructor.js +3 -1
  105. package/src/node/declaration/combinator.js +13 -1
  106. package/src/node/declaration/complexType.js +73 -1
  107. package/src/node/declaration/constructor.js +47 -1
  108. package/src/node/declaration/metavariable.js +3 -1
  109. package/src/node/declaration/property.js +36 -0
  110. package/src/node/declaration/type.js +58 -1
  111. package/src/node/declaration/variable.js +67 -1
  112. package/src/node/declaration.js +3 -1
  113. package/src/node/deduction.js +3 -1
  114. package/src/node/derivation.js +3 -1
  115. package/src/node/equality.js +3 -1
  116. package/src/node/error.js +3 -1
  117. package/src/node/frame.js +3 -1
  118. package/src/node/judgement.js +3 -1
  119. package/src/node/label.js +3 -1
  120. package/src/node/lemma.js +3 -1
  121. package/src/node/metaLemma.js +3 -1
  122. package/src/node/metaType.js +15 -1
  123. package/src/node/metatheorem.js +3 -1
  124. package/src/node/metavariable.js +15 -1
  125. package/src/node/parameter.js +3 -1
  126. package/src/node/premise.js +3 -1
  127. package/src/node/procedureCall.js +3 -1
  128. package/src/node/proof.js +3 -1
  129. package/src/node/property.js +18 -1
  130. package/src/node/propertyRelation.js +3 -1
  131. package/src/node/reference.js +3 -1
  132. package/src/node/rule.js +3 -1
  133. package/src/node/statement.js +3 -1
  134. package/src/node/step.js +3 -1
  135. package/src/node/subDerivation.js +3 -1
  136. package/src/node/subproof.js +3 -1
  137. package/src/node/supposition.js +3 -1
  138. package/src/node/term.js +3 -1
  139. package/src/node/theorem.js +3 -1
  140. package/src/node/topLevelAssertion.js +3 -1
  141. package/src/node/topLevelMetaAssertion.js +3 -1
  142. package/src/node/type.js +15 -1
  143. package/src/node/variable.js +15 -1
  144. package/src/node.js +23 -1
  145. package/src/nodeMap.js +7 -1
  146. package/src/ruleNames.js +2 -0
  147. package/src/unifier/metavariable.js +1 -2
  148. package/src/unifier/statementWithCombinator.js +1 -2
  149. package/src/unifier/termWithConstructor.js +1 -2
  150. package/src/utilities/customGrammar.js +3 -1
  151. package/src/utilities/node.js +72 -0
  152. package/src/verifier/combinator.js +1 -2
  153. package/src/verifier/constructor.js +1 -2
  154. package/lib/utilities/name.js +0 -44
  155. package/lib/utilities/parser.js +0 -28
  156. package/src/utilities/name.js +0 -39
  157. package/src/utilities/parser.js +0 -21
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ConclusionNode extends Node {}
5
+ export default class ConclusionNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ConclusionNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ConjectureNode extends Node {}
5
+ export default class ConjectureNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ConjectureNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ConstructorNode extends Node {}
5
+ export default class ConstructorNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ConstructorNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,16 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class ContainedDeclarationNode extends Node {}
5
+ export default class ContainedDeclarationNode extends Node {
6
+ getStatementNode() {
7
+ const statementNode = this.fromSecondChildNode((secondChildNode) => {
8
+ const statementNode = secondChildNode; ///
9
+
10
+ return statementNode;
11
+ });
12
+
13
+ return statementNode;
14
+ }
15
+
16
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ContainedDeclarationNode, ruleName, childNodes, opacity); }
17
+ }
@@ -2,4 +2,76 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class ComplexTypeDeclarationNode extends Node {}
5
+ import { PROVISIONAL } from "../../constants";
6
+ import { isNodeTypeNode, isNodePropertyDeclarationNode } from "../../utilities/node";
7
+
8
+ export default class ComplexTypeDeclarationNode extends Node {
9
+ getTypeName() {
10
+ let typeName;
11
+
12
+ this.someChildNode((childNode) => {
13
+ const childNodeTypeNode = isNodeTypeNode(childNode);
14
+
15
+ if (childNodeTypeNode) {
16
+ const typeNode = childNode; ///
17
+
18
+ typeName = typeNode.getTypeName();
19
+
20
+ return true;
21
+ }
22
+ });
23
+
24
+ return typeName;
25
+ }
26
+
27
+ isProvisional() {
28
+ const provisional = this.fromFirstChildNode((firstChildNode) => {
29
+ const terminalNode = firstChildNode, ///
30
+ content = terminalNode.getContent(),
31
+ contentProvisional = (content === PROVISIONAL),
32
+ provisional = contentProvisional; ///
33
+
34
+ return provisional;
35
+ });
36
+
37
+ return provisional;
38
+ }
39
+
40
+ getSuperTypeNodes() {
41
+ const typeNodes = this.reduceChildNode((typeNodes, childNode) => {
42
+ const childNodeTypeNode = isNodeTypeNode(childNode);
43
+
44
+ if (childNodeTypeNode) {
45
+ const typeNode = childNode; ///
46
+
47
+ typeNodes.push(typeNode);
48
+ }
49
+
50
+ return typeNodes;
51
+ }, []);
52
+
53
+ typeNodes.pop();
54
+
55
+ const superTypeNodes = typeNodes; ///
56
+
57
+ return superTypeNodes;
58
+ }
59
+
60
+ getPropertyDeclarationNodes() {
61
+ const propertyDeclarationNodes = this.reduceChildNode((propertyDeclarationNodes, childNode) => {
62
+ const childNodePropertyDeclarationNode = isNodePropertyDeclarationNode(childNode);
63
+
64
+ if (childNodePropertyDeclarationNode) {
65
+ const propertyDeclarationNode = childNode; ///
66
+
67
+ propertyDeclarationNodes.push(propertyDeclarationNode);
68
+ }
69
+
70
+ return propertyDeclarationNodes;
71
+ }, []);
72
+
73
+ return propertyDeclarationNodes;
74
+ }
75
+
76
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ComplexTypeDeclarationNode, ruleName, childNodes, opacity); }
77
+ }
@@ -2,4 +2,50 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class ConstructorDeclarationNode extends Node {}
5
+ import { PROVISIONALLY } from "../../constants";
6
+
7
+ export default class ConstructorDeclarationNode extends Node {
8
+ getTermNode() {
9
+ const termNode = this.fromSecondChildNode((secondChildNode) => {
10
+ const termNode = secondChildNode; ///
11
+
12
+ return termNode;
13
+ });
14
+
15
+ return termNode;
16
+ }
17
+
18
+ getTypeNode() {
19
+ const typeNode = this.fromFourthChildNode((fourthChildNode) => {
20
+ const typeNode = fourthChildNode; ///
21
+
22
+ return typeNode;
23
+ }) || null;
24
+
25
+ return typeNode;
26
+ }
27
+
28
+ isProvisional() {
29
+ const provisional = this.fromSecondLastChildNode((secondLastChildNode) => {
30
+ let provisional = false;
31
+
32
+ const secondLastChildNodeTerminalNode = secondLastChildNode.isTerminalNode();
33
+
34
+ if (secondLastChildNodeTerminalNode) {
35
+ const terminalNode = secondLastChildNode, ///
36
+ content = terminalNode.getContent(),
37
+ contentProvisionally = (content === PROVISIONALLY);
38
+
39
+ if (contentProvisionally) {
40
+ provisional = true;
41
+ }
42
+ }
43
+
44
+ return provisional;
45
+ });
46
+
47
+ return provisional;
48
+ }
49
+
50
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ConstructorDeclarationNode, ruleName, childNodes, opacity); }
51
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class MetavariableDeclarationNode extends Node {}
5
+ export default class MetavariableDeclarationNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(MetavariableDeclarationNode, ruleName, childNodes, opacity); }
7
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ import Node from "../../node";
4
+
5
+ import { isNodePropertyNode } from "../../utilities/node";
6
+
7
+ export default class PropertyDeclarationNode extends Node {
8
+ getTypeNode() {
9
+ const typeNode = this.fromSecondLastChildNode((secondLastChildNode) => {
10
+ const typeNode = secondLastChildNode;; ///
11
+
12
+ return typeNode;
13
+ });
14
+
15
+ return typeNode;
16
+ }
17
+
18
+ getPropertyNames() {
19
+ const propertyNames = this.reduceChildNode((propertyNames, childNode) => {
20
+ const childNodePropertyNode = isNodePropertyNode(childNode);
21
+
22
+ if (childNodePropertyNode) {
23
+ const propertyNode = childNode, ///
24
+ propertyName = propertyNode.getPropertyName();
25
+
26
+ propertyNames.push(propertyName);
27
+ }
28
+
29
+ return propertyNames;
30
+ }, []);
31
+
32
+ return propertyNames;
33
+ }
34
+
35
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(PropertyDeclarationNode, ruleName, childNodes, opacity); }
36
+ }
@@ -2,4 +2,61 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class TypeDeclarationNode extends Node {}
5
+ import { PROVISIONAL } from "../../constants";
6
+ import { isNodeTypeNode } from "../../utilities/node";
7
+
8
+ export default class TypeDeclarationNode extends Node {
9
+ getTypeName() {
10
+ let typeName;
11
+
12
+ this.someChildNode((childNode) => {
13
+ const childNodeTypeNode = isNodeTypeNode(childNode);
14
+
15
+ if (childNodeTypeNode) {
16
+ const typeNode = childNode; ///
17
+
18
+ typeName = typeNode.getTypeName();
19
+
20
+ return true;
21
+ }
22
+ });
23
+
24
+ return typeName;
25
+ }
26
+
27
+ isProvisional() {
28
+ const provisional = this.fromFirstChildNode((firstChildNode) => {
29
+ const terminalNode = firstChildNode, ///
30
+ content = terminalNode.getContent(),
31
+ contentProvisional = (content === PROVISIONAL),
32
+ provisional = contentProvisional; ///
33
+
34
+ return provisional;
35
+ });
36
+
37
+ return provisional;
38
+ }
39
+
40
+ getSuperTypeNodes() {
41
+ const typeNodes = this.reduceChildNode((typeNodes, childNode) => {
42
+ const childNodeTypeNode = isNodeTypeNode(childNode);
43
+
44
+ if (childNodeTypeNode) {
45
+ const typeNode = childNode; ///
46
+
47
+ typeNodes.push(typeNode);
48
+ }
49
+
50
+ return typeNodes;
51
+ }, []);
52
+
53
+ typeNodes.pop();
54
+
55
+ const superTypeNodes = typeNodes; ///
56
+
57
+ return superTypeNodes;
58
+ }
59
+
60
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(TypeDeclarationNode, ruleName, childNodes, opacity); }
61
+ }
62
+
@@ -2,4 +2,70 @@
2
2
 
3
3
  import Node from "../../node";
4
4
 
5
- export default class VariableDeclarationNode extends Node {}
5
+ import { PROVISIONALLY } from "../../constants";
6
+ import { isNodeTypeNode, isNodeVariableNode } from "../../utilities/node";
7
+
8
+ export default class VariableDeclarationNode extends Node {
9
+ getTypeNode() {
10
+ let typeNode;
11
+
12
+ this.someChildNode((childNode) => {
13
+ const childNodeTypeNode = isNodeTypeNode(childNode);
14
+
15
+ if (childNodeTypeNode) {
16
+ typeNode = childNode; ///
17
+
18
+ return true;
19
+ }
20
+ });
21
+
22
+ return typeNode;
23
+ }
24
+
25
+ isProvisional() {
26
+ const provisional = this.fromSecondLastChildNode((secondLastChildNode) => {
27
+ let provisional = false;
28
+
29
+ const secondLastChildNodeTerminalNode = secondLastChildNode.isTerminalNode();
30
+
31
+ if (secondLastChildNodeTerminalNode) {
32
+ const terminalNode = secondLastChildNode, ///
33
+ content = terminalNode.getContent(),
34
+ contentProvisionally = (content === PROVISIONALLY);
35
+
36
+ if (contentProvisionally) {
37
+ provisional = true;
38
+ }
39
+ }
40
+
41
+ return provisional;
42
+ });
43
+
44
+ return provisional;
45
+ }
46
+
47
+ getVariableNode() {
48
+ let variableNode;
49
+
50
+ this.someChildNode((childNode) => {
51
+ const childNodeVariableNode = isNodeVariableNode(childNode);
52
+
53
+ if (childNodeVariableNode) {
54
+ variableNode = childNode; ///
55
+
56
+ return true;
57
+ }
58
+ });
59
+
60
+ return variableNode;
61
+ }
62
+
63
+ getVariableName() {
64
+ const variableNode = this.getVariableNode(),
65
+ variableName = variableNode.getVariableName();
66
+
67
+ return variableName;
68
+ }
69
+
70
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(VariableDeclarationNode, ruleName, childNodes, opacity); }
71
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class DeclarationNode extends Node {}
5
+ export default class DeclarationNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(DeclarationNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class DeductionNode extends Node {}
5
+ export default class DeductionNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(DeductionNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class DerivationNode extends Node {}
5
+ export default class DerivationNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(DerivationNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class EqualityNode extends Node {}
5
+ export default class EqualityNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(EqualityNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/error.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ErrorNode extends Node {}
5
+ export default class ErrorNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ErrorNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/frame.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class FrameNode extends Node {}
5
+ export default class FrameNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(FrameNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class JudgementNode extends Node {}
5
+ export default class JudgementNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(JudgementNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/label.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class LabelNode extends Node {}
5
+ export default class LabelNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(LabelNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/lemma.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class LemmaNode extends Node {}
5
+ export default class LemmaNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(LemmaNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class MetaLemmaNode extends Node {}
5
+ export default class MetaLemmaNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(MetaLemmaNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,18 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class MetaTypeNode extends Node {}
5
+ export default class MetaTypeNode extends Node {
6
+ getMetaTypeName() {
7
+ const metaTypeName = this.fromFirstChildNode((firstChildNode) => {
8
+ const metaTypeTerminalNode = firstChildNode, ///
9
+ content = metaTypeTerminalNode.getContent(),
10
+ metaTypeName = content; ///
11
+
12
+ return metaTypeName;
13
+ });
14
+
15
+ return metaTypeName;
16
+ }
17
+
18
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(MetaTypeNode, ruleName, childNodes, opacity); }
19
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class MetatheoremNode extends Node {}
5
+ export default class MetatheoremNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(MetatheoremNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,18 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class MetavariableNode extends Node {}
5
+ export default class MetavariableNode extends Node {
6
+ getMetavariableName() {
7
+ const metavariableName = this.fromFirstChildNode((firstChildNode) => {
8
+ const nameTerminalNode = firstChildNode, ///
9
+ content = nameTerminalNode.getContent(),
10
+ metavariableName = content; ///
11
+
12
+ return metavariableName;
13
+ });
14
+
15
+ return metavariableName;
16
+ }
17
+
18
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(MetavariableNode, ruleName, childNodes, opacity); }
19
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ParameterNode extends Node {}
5
+ export default class ParameterNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ParameterNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class PremiseNode extends Node {}
5
+ export default class PremiseNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(PremiseNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ProcedureCallNode extends Node {}
5
+ export default class ProcedureCallNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ProcedureCallNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/proof.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ProofNode extends Node {}
5
+ export default class ProofNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ProofNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,21 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class PropertyNode extends Node {}
5
+ export default class PropertyNode extends Node {
6
+ getPropertyName() {
7
+ const propertyName = this.reduceChildNode((propertyName, firstChildNode) => {
8
+ const nameTerminalNode = firstChildNode, ///
9
+ content = nameTerminalNode.getContent();
10
+
11
+ propertyName = (propertyName !== null) ?
12
+ `${propertyName} ${content}` :
13
+ content; ///
14
+
15
+ return propertyName;
16
+ }, null);
17
+
18
+ return propertyName;
19
+ }
20
+
21
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(PropertyNode, ruleName, childNodes, opacity); }
22
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class PropertyRelationNode extends Node {}
5
+ export default class PropertyRelationNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(PropertyRelationNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class ReferenceNode extends Node {}
5
+ export default class ReferenceNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(ReferenceNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/rule.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class RuleNode extends Node {}
5
+ export default class RuleNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(RuleNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class StatementNode extends Node {}
5
+ export default class StatementNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(StatementNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/step.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class StepNode extends Node {}
5
+ export default class StepNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(StepNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class SubDerivationNode extends Node {}
5
+ export default class SubDerivationNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(SubDerivationNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class SubproofNode extends Node {}
5
+ export default class SubproofNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(SubproofNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class SuppositionNode extends Node {}
5
+ export default class SuppositionNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(SuppositionNode, ruleName, childNodes, opacity); }
7
+ }
package/src/node/term.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class TermNode extends Node {}
5
+ export default class TermNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(TermNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class TheoremNode extends Node {}
5
+ export default class TheoremNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(TheoremNode, ruleName, childNodes, opacity); }
7
+ }
@@ -2,4 +2,6 @@
2
2
 
3
3
  import Node from "../node";
4
4
 
5
- export default class TopLevelAssertionNode extends Node {}
5
+ export default class TopLevelAssertionNode extends Node {
6
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return Node.fromRuleNameChildNodesAndOpacity(TopLevelAssertionNode, ruleName, childNodes, opacity); }
7
+ }