occam-verify-cli 1.0.404 → 1.0.414

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 (122) hide show
  1. package/lib/context/file.js +3 -3
  2. package/lib/context/local.js +3 -3
  3. package/lib/context/release.js +2 -2
  4. package/lib/context/temporary.js +103 -54
  5. package/lib/mixins/statement/verify.js +2 -2
  6. package/lib/mixins/step/unify.js +2 -2
  7. package/lib/node/argument.js +2 -2
  8. package/lib/node/assumption.js +6 -6
  9. package/lib/node/frame.js +19 -7
  10. package/lib/node/judgement.js +8 -1
  11. package/lib/node/statement.js +34 -15
  12. package/lib/node/substitution/term.js +3 -11
  13. package/lib/node/term.js +20 -8
  14. package/lib/nonTerminalNode.js +3 -3
  15. package/lib/ontology/assertion/contained.js +7 -7
  16. package/lib/ontology/assertion/defined.js +8 -8
  17. package/lib/ontology/assertion/subproof.js +3 -3
  18. package/lib/ontology/assumption.js +49 -45
  19. package/lib/ontology/combinator.js +3 -3
  20. package/lib/ontology/constructor.js +3 -3
  21. package/lib/ontology/equality.js +4 -4
  22. package/lib/ontology/equivalence.js +2 -2
  23. package/lib/ontology/frame.js +37 -12
  24. package/lib/ontology/judgement.js +13 -6
  25. package/lib/ontology/metavariable.js +75 -76
  26. package/lib/ontology/propertyRelation.js +2 -2
  27. package/lib/ontology/reference.js +33 -4
  28. package/lib/ontology/signature.js +2 -2
  29. package/lib/ontology/statement.js +33 -8
  30. package/lib/ontology/step.js +4 -4
  31. package/lib/ontology/substitution/frame.js +13 -15
  32. package/lib/ontology/substitution/statement.js +31 -32
  33. package/lib/ontology/substitution/term.js +26 -25
  34. package/lib/ontology/substitution.js +2 -2
  35. package/lib/ontology/substitutions.js +4 -4
  36. package/lib/ontology/term.js +26 -12
  37. package/lib/ontology/variable.js +2 -2
  38. package/lib/process/equate.js +322 -0
  39. package/lib/process/unify.js +623 -0
  40. package/lib/process/verify.js +332 -0
  41. package/lib/utilities/brackets.js +3 -8
  42. package/lib/utilities/context.js +4 -14
  43. package/lib/utilities/json.js +18 -1
  44. package/lib/utilities/pass.js +68 -0
  45. package/lib/utilities/substitutions.js +11 -16
  46. package/package.json +7 -7
  47. package/src/context/file.js +2 -2
  48. package/src/context/local.js +2 -2
  49. package/src/context/release.js +1 -1
  50. package/src/context/temporary.js +124 -54
  51. package/src/mixins/statement/verify.js +3 -1
  52. package/src/mixins/step/unify.js +0 -1
  53. package/src/node/argument.js +1 -1
  54. package/src/node/assumption.js +4 -4
  55. package/src/node/frame.js +19 -5
  56. package/src/node/judgement.js +7 -0
  57. package/src/node/statement.js +35 -13
  58. package/src/node/substitution/term.js +4 -14
  59. package/src/node/term.js +20 -6
  60. package/src/nonTerminalNode.js +1 -1
  61. package/src/ontology/assertion/contained.js +6 -6
  62. package/src/ontology/assertion/defined.js +7 -7
  63. package/src/ontology/assertion/subproof.js +1 -1
  64. package/src/ontology/assumption.js +52 -57
  65. package/src/ontology/combinator.js +1 -1
  66. package/src/ontology/constructor.js +1 -1
  67. package/src/ontology/equality.js +3 -3
  68. package/src/ontology/equivalence.js +1 -1
  69. package/src/ontology/frame.js +44 -10
  70. package/src/ontology/judgement.js +8 -3
  71. package/src/ontology/metavariable.js +108 -102
  72. package/src/ontology/propertyRelation.js +3 -2
  73. package/src/ontology/reference.js +39 -1
  74. package/src/ontology/signature.js +3 -3
  75. package/src/ontology/statement.js +38 -4
  76. package/src/ontology/step.js +7 -7
  77. package/src/ontology/substitution/frame.js +13 -17
  78. package/src/ontology/substitution/statement.js +45 -48
  79. package/src/ontology/substitution/term.js +19 -19
  80. package/src/ontology/substitution.js +3 -2
  81. package/src/ontology/substitutions.js +3 -3
  82. package/src/ontology/term.js +26 -5
  83. package/src/ontology/variable.js +3 -2
  84. package/src/process/equate.js +212 -0
  85. package/src/process/unify.js +634 -0
  86. package/src/process/verify.js +204 -0
  87. package/src/utilities/brackets.js +2 -11
  88. package/src/utilities/context.js +1 -21
  89. package/src/utilities/json.js +19 -0
  90. package/src/utilities/{unifier.js → pass.js} +17 -1
  91. package/src/utilities/substitutions.js +10 -20
  92. package/lib/unifier/equantional.js +0 -170
  93. package/lib/unifier/intrinsicLevel.js +0 -144
  94. package/lib/unifier/metaLevel.js +0 -197
  95. package/lib/unifier/metavariable.js +0 -140
  96. package/lib/unifier/statementWithCombinator.js +0 -177
  97. package/lib/unifier/termWithConstructor.js +0 -145
  98. package/lib/unifier.js +0 -241
  99. package/lib/utilities/arguments.js +0 -28
  100. package/lib/utilities/frame.js +0 -18
  101. package/lib/utilities/metavariable.js +0 -18
  102. package/lib/utilities/statement.js +0 -18
  103. package/lib/utilities/unification.js +0 -109
  104. package/lib/utilities/unifier.js +0 -51
  105. package/lib/utilities/variable.js +0 -18
  106. package/lib/verifier/combinator.js +0 -158
  107. package/lib/verifier.js +0 -219
  108. package/src/unifier/equantional.js +0 -90
  109. package/src/unifier/intrinsicLevel.js +0 -52
  110. package/src/unifier/metaLevel.js +0 -151
  111. package/src/unifier/metavariable.js +0 -50
  112. package/src/unifier/statementWithCombinator.js +0 -114
  113. package/src/unifier/termWithConstructor.js +0 -56
  114. package/src/unifier.js +0 -183
  115. package/src/utilities/arguments.js +0 -21
  116. package/src/utilities/frame.js +0 -13
  117. package/src/utilities/metavariable.js +0 -13
  118. package/src/utilities/statement.js +0 -13
  119. package/src/utilities/unification.js +0 -136
  120. package/src/utilities/variable.js +0 -13
  121. package/src/verifier/combinator.js +0 -72
  122. package/src/verifier.js +0 -150
@@ -5,7 +5,7 @@ import Substitution from "../substitution";
5
5
  import StatementSubstitutionPartialContext from "../../context/partial/substitution/statement";
6
6
 
7
7
  import { define } from "../../ontology";
8
- import { unifySubstitution } from "../../utilities/unification";
8
+ import { unifySubstitution } from "../../process/unify";
9
9
  import { stripBracketsFromStatement } from "../../utilities/brackets";
10
10
  import { statementFromJSON, statementToStatementJSON, metavariableFromJSON, metavariableToMetavariableJSON } from "../../utilities/json";
11
11
 
@@ -76,52 +76,6 @@ export default define(class StatementSubstitution extends Substitution {
76
76
 
77
77
  matchParameter(parameter) { return this.metavariable.matchParameter(parameter); }
78
78
 
79
- resolve(substitutions, context) {
80
- const substitutionString = this.string; ///
81
-
82
- context.trace(`Resolving the ${substitutionString} substitution...`);
83
-
84
- substitutions.snapshot();
85
-
86
- const metavariable = this.getMetavariable(),
87
- simpleSubstitution = substitutions.findSimpleSubstitutionByMetavariable(metavariable);
88
-
89
- if (simpleSubstitution !== null) {
90
- let context;
91
-
92
- context = this.getContext();
93
-
94
- const substitution = simpleSubstitution.unifyStatement(this.statement, context);
95
-
96
- if (substitution !== null) {
97
- context = simpleSubstitution.getContext();
98
-
99
- const terms = context.getTerms(),
100
- frames = context.getFrames();
101
-
102
- context = substitution.getContext();
103
-
104
- context.addTerms(terms);
105
-
106
- context.addFrames(frames);
107
-
108
- const substitutionUnifies = this.unifySubstitution(substitution, substitutions, context);
109
-
110
- if (substitutionUnifies) {
111
- this.resolved = true;
112
- }
113
- }
114
- }
115
-
116
- this.resolved ?
117
- substitutions.continue() :
118
- substitutions.rollback(context);
119
-
120
- if (this.resolved) {
121
- context.debug(`...resolved the ${substitutionString} substitution.`);
122
- }
123
- }
124
-
125
79
  unifyStatement(statement, context) {
126
80
  let substitution = null;
127
81
 
@@ -173,12 +127,55 @@ export default define(class StatementSubstitution extends Substitution {
173
127
  return substitutionUnifies;
174
128
  }
175
129
 
130
+ resolve(substitutions, context) {
131
+ const substitutionString = this.string; ///
132
+
133
+ context.trace(`Resolving the ${substitutionString} substitution...`);
134
+
135
+ substitutions.snapshot();
136
+
137
+ const metavariable = this.getMetavariable(),
138
+ simpleSubstitution = substitutions.findSimpleSubstitutionByMetavariable(metavariable);
139
+
140
+ if (simpleSubstitution !== null) {
141
+ let context;
142
+
143
+ context = this.getContext();
144
+
145
+ const substitution = simpleSubstitution.unifyStatement(this.statement, context);
146
+
147
+ if (substitution !== null) {
148
+ context = simpleSubstitution.getContext();
149
+
150
+ const simpleContext = context; ///
151
+
152
+ context = substitution.getContext();
153
+
154
+ context.merge(simpleContext);
155
+
156
+ const substitutionUnifies = this.unifySubstitution(substitution, substitutions, context);
157
+
158
+ if (substitutionUnifies) {
159
+ this.resolved = true;
160
+ }
161
+ }
162
+ }
163
+
164
+ this.resolved ?
165
+ substitutions.continue() :
166
+ substitutions.rollback(context);
167
+
168
+ if (this.resolved) {
169
+ context.debug(`...resolved the '${substitutionString}' substitution.`);
170
+ }
171
+ }
172
+
176
173
  toJSON() {
177
174
  const metavariableJSON = metavariableToMetavariableJSON(this.metavariable),
178
175
  statementJSON = statementToStatementJSON(this.statement),
179
176
  metavariable = metavariableJSON, ///
180
177
  statement = statementJSON, ///
181
- string = this.string,
178
+ string = this.string, ///
182
179
  json = {
183
180
  string,
184
181
  statement,
@@ -6,7 +6,6 @@ import TermSubstitutionPartialContext from "../../context/partial/substitution/t
6
6
 
7
7
  import { define } from "../../ontology";
8
8
  import { stripBracketsFromTerm } from "../../utilities/brackets";
9
- import { termVariableIdentifierFromTermNode } from "../../utilities/variable";
10
9
 
11
10
 
12
11
  export default define(class TermSubstitution extends Substitution {
@@ -33,9 +32,13 @@ export default define(class TermSubstitution extends Substitution {
33
32
  }
34
33
 
35
34
  isTrivial() {
36
- const termString = this.term.getString(),
37
- variableString = this.variable.getString(),
38
- trivial = (termString === variableString);
35
+ let trivial = false;
36
+
37
+ const termEqualToVariable = this.term.isEqualToVariable(this.variable);
38
+
39
+ if (termEqualToVariable) {
40
+ trivial = true;
41
+ }
39
42
 
40
43
  return trivial;
41
44
  }
@@ -55,37 +58,34 @@ export default define(class TermSubstitution extends Substitution {
55
58
 
56
59
  const termSubstitutionString = this.string; ///
57
60
 
58
- context.trace(`Verifiying the '${termSubstitutionString}' term substitutin...`);
61
+ context.trace(`Verifiying the '${termSubstitutionString}' term substitution...`);
59
62
 
60
- const termSimple = this.term.isSimple();
63
+ const termSingular = this.term.isSingular();
61
64
 
62
- if (termSimple) {
63
- if (this.variable === null) {
64
- context.debug(`The specific term is not simple.`);
65
- } else {
65
+ if (termSingular) {
66
+ if (this.variable !== null) {
66
67
  const variableIdentifier = this.variable.getIdentifier(),
67
68
  variablePresent = context.isVariablePresentByVariableIdentifier(variableIdentifier);
68
69
 
69
70
  if (variablePresent) {
70
71
  const termNode = this.term.getNode(),
71
- termVariableIdentifier = termVariableIdentifierFromTermNode(termNode),
72
+ variableIdentifier = termNode.getVariableIdentifier(),
73
+ termVariableIdentifier = variableIdentifier, ///
72
74
  termVariablePresent = context.isVariablePresentByVariableIdentifier(termVariableIdentifier);
73
75
 
74
76
  if (termVariablePresent) {
75
77
  verifies = true;
76
78
  } else {
77
- const variableString = variable.getString();
78
-
79
- context.debug(`The '${variableString}' variable is not present.`);
79
+ context.debug(`The '${termSubstitutionString}' term substitution's general term's variable is not present.`);
80
80
  }
81
81
  } else {
82
- const variableString = this.variable.getString();
83
-
84
- context.debug(`The '${variableString}' variable is not present.`);
82
+ context.debug(`The '${termSubstitutionString}' term substitution's specific term's variable is not present.`);
85
83
  }
84
+ } else {
85
+ context.debug(`The '${termSubstitutionString}' term substitution's general term is not singular.`);
86
86
  }
87
87
  } else {
88
- context.debug(`The general term is not simple.`);
88
+ context.debug(`The '${termSubstitutionString}' term substitution's specific term is not singular.`);
89
89
  }
90
90
 
91
91
  if (verifies) {
@@ -93,7 +93,7 @@ export default define(class TermSubstitution extends Substitution {
93
93
 
94
94
  context.addSubstitution(substititoin);
95
95
 
96
- context.debug(`...verified the '${termSubstitutionString}' term substitutin.`);
96
+ context.debug(`...verified the '${termSubstitutionString}' term substitution.`);
97
97
  }
98
98
 
99
99
  return verifies;
@@ -92,8 +92,9 @@ export default class Substitution {
92
92
  }
93
93
 
94
94
  isEqualTo(substitution) {
95
- const substitutionString = substitution.getString(),
96
- equalTo = (substitutionString === this.string);
95
+ const substitutionNode = substitution.getNode(),
96
+ matches = this.node.match(substitutionNode),
97
+ equalTo = matches; ///
97
98
 
98
99
  return equalTo;
99
100
  }
@@ -37,7 +37,7 @@ export default define(class Substitutions {
37
37
  compress(metavariables, (metavariableA, metavariableB) => {
38
38
  const metavariableAEqualToMetavariableB = metavariableB.isEqualTo(metavariableA);
39
39
 
40
- if (metavariableAEqualToMetavariableB) {
40
+ if (!metavariableAEqualToMetavariableB) {
41
41
  return true;
42
42
  }
43
43
  });
@@ -198,7 +198,7 @@ export default define(class Substitutions {
198
198
 
199
199
  const substitutionString = substitution.getString();
200
200
 
201
- context.trace(`Added the ${substitutionString} substitution.`);
201
+ context.trace(`Added the '${substitutionString}' substitution.`);
202
202
  }
203
203
 
204
204
  removeSubstitution(substitution, context) {
@@ -214,7 +214,7 @@ export default define(class Substitutions {
214
214
 
215
215
  const substitutionString = substitution.getString();
216
216
 
217
- context.trace(`Removed the ${substitutionString} substitution.`);
217
+ context.trace(`Removed the '${substitutionString}' substitution.`);
218
218
  }
219
219
 
220
220
  correlateSubstitutions(substitutions) {
@@ -35,15 +35,36 @@ export default define(class Term {
35
35
  this.type = type;
36
36
  }
37
37
 
38
+ isSingular() { return this.node.isSingular(); }
39
+
40
+ isProvisional() { return this.type.isProvisional(); }
41
+
38
42
  matchTermNode(termNode) { return this.node.match(termNode); }
39
43
 
40
- isSimple() { return this.node.isSimple();}
44
+ isEqualToVariable(variable) {
45
+ let variableNodeMathces = false;
41
46
 
42
- isProvisional() { return this.type.isProvisional(); }
47
+ const singular = this.isSingular();
48
+
49
+ if (singular) {
50
+ const variableNode = variable.getNode(),
51
+ singularVariableNode = this.node.getSingularVariableNode(),
52
+ variableNodeA = variableNode, ///
53
+ variableNodeB = singularVariableNode, ///
54
+ matches = variableNodeA.match(variableNodeB);
55
+
56
+ if (matches) {
57
+ variableNodeMathces = true;
58
+ }
59
+ }
60
+
61
+ return variableNodeMathces;
62
+ }
43
63
 
44
64
  isEqualTo(term) {
45
- const termString = term.getString(),
46
- equalTo = (termString === this.string);
65
+ const termNode = term.getNode(),
66
+ matches = this.node.match(termNode),
67
+ equalTo = matches; ///
47
68
 
48
69
  return equalTo;
49
70
  }
@@ -254,7 +275,7 @@ export function variablesFromTerm(term, context) {
254
275
  compress(variables, (variableA, variableB) => {
255
276
  const variableAEqualToVariableB = variableA.isEqualTo(variableB);
256
277
 
257
- if (variableAEqualToVariableB) {
278
+ if (!variableAEqualToVariableB) {
258
279
  return true;
259
280
  }
260
281
  });
@@ -42,8 +42,9 @@ export default define(class Variable {
42
42
  }
43
43
 
44
44
  isEqualTo(variable) {
45
- const variableString = variable.getString(),
46
- equalTo = (variableString === this.string);
45
+ const variableNode = variable.getNode(),
46
+ matches = this.node.match(variableNode),
47
+ equalTo = matches; ///
47
48
 
48
49
  return equalTo;
49
50
  }
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ import { nodeQuery } from "../utilities/query";
4
+ import { terminalNodeMapFromNodes, areTerminalNodeMapsEqual } from "../utilities/pass";
5
+
6
+ const termNodeQuery = nodeQuery("/term"),
7
+ nonTerminalNodeQuery = nodeQuery("/*");
8
+
9
+ class Pass {
10
+ run(leftNode, rightNode, ...remainingArguments) {
11
+ let success;
12
+
13
+ const visited = this.visitNode(leftNode, rightNode, ...remainingArguments);
14
+
15
+ success = visited; ///
16
+
17
+ return success;
18
+ }
19
+
20
+ descend(leftChildNodes, rightChildNodes, ...remainingArguments) {
21
+ let descended = false;
22
+
23
+ const leftChildNodesLength = leftChildNodes.length,
24
+ rightChildNodesLength = rightChildNodes.length;
25
+
26
+ if (leftChildNodesLength === rightChildNodesLength) {
27
+ const leftTerminalNodeMap = terminalNodeMapFromNodes(leftChildNodes),
28
+ rightTerminalNodeMap = terminalNodeMapFromNodes(rightChildNodes),
29
+ terminalNodeMapsEqual = areTerminalNodeMapsEqual(leftTerminalNodeMap, rightTerminalNodeMap);
30
+
31
+ if (terminalNodeMapsEqual) {
32
+ descended = leftChildNodes.every((leftChildNode, index) => {
33
+ const rightChildNode = rightChildNodes[index],
34
+ leftNode = leftChildNode, ///
35
+ rightNode = rightChildNode, ///
36
+ visited = this.visitNode(leftNode, rightNode, ...remainingArguments);
37
+
38
+ if (visited) {
39
+ return true;
40
+ }
41
+ });
42
+ }
43
+ }
44
+
45
+ return descended;
46
+ }
47
+
48
+ visitNode(leftNode, rightNode, ...remainingArguments) {
49
+ let visited = false;
50
+
51
+ const leftNodeTerminalNode = leftNode.isTerminalNode(),
52
+ rightNodeTerminalNode = rightNode.isTerminalNode(),
53
+ leftNodeNonTerminalNode = leftNode.isNonTerminalNode(),
54
+ rightNodeNonTerminalNode = rightNode.isNonTerminalNode();
55
+
56
+ if (false) {
57
+ ///
58
+ } else if (leftNodeTerminalNode && rightNodeTerminalNode) {
59
+ const leftTerminalNode = leftNode, ///
60
+ rightTerminalNode = rightNode; ///
61
+
62
+ visited = this.visitTerminalNode(leftTerminalNode, rightTerminalNode, ...remainingArguments);
63
+ } else if (leftNodeNonTerminalNode && rightNodeNonTerminalNode) {
64
+ const leftNonTerminalNode = leftNode, ///
65
+ rightNonTerminalNode = rightNode; ///
66
+
67
+ visited = this.visitNonTerminalNode(leftNonTerminalNode, rightNonTerminalNode, ...remainingArguments);
68
+ }
69
+
70
+ return visited;
71
+ }
72
+
73
+ visitTerminalNode(leftTerminalNode, rightTerminalNode, ...remainingArguments) { ///
74
+ let visited;
75
+
76
+ visited = true;
77
+
78
+ return visited;
79
+ }
80
+
81
+ visitNonTerminalNode(leftNonTerminalNode, rightNonTerminalNode, ...remainingArguments) {
82
+ let visited = false;
83
+
84
+ let { maps } = this.constructor;
85
+
86
+ maps = [ ///
87
+ ...maps,
88
+ {
89
+ leftNodeQuery: nonTerminalNodeQuery,
90
+ rightNodeQuery: nonTerminalNodeQuery,
91
+ run: (leftNode, rightNode, ...remainingArguments) => {
92
+ let visited = false;
93
+
94
+ const leftNonTerminalNodeRuleName = leftNonTerminalNode.getRuleName(), ///
95
+ rightNonTerminalNodeRuleName = rightNonTerminalNode.getRuleName(); ///
96
+
97
+ if (leftNonTerminalNodeRuleName === rightNonTerminalNodeRuleName) {
98
+ const leftNonTerminalNodeChildNodes = leftNonTerminalNode.getChildNodes(),
99
+ rightNonTerminalNodeChildNodes = rightNonTerminalNode.getChildNodes(),
100
+ leftChildNodes = leftNonTerminalNodeChildNodes, ///
101
+ rightChildNodes = rightNonTerminalNodeChildNodes, ///
102
+ descended = this.descend(leftChildNodes, rightChildNodes, ...remainingArguments);
103
+
104
+ if (descended) {
105
+ visited = true;
106
+ }
107
+ }
108
+
109
+ return visited;
110
+ }
111
+ }
112
+ ]
113
+
114
+ maps.some((map) => {
115
+ const { leftNodeQuery, rightNodeQuery, run } = map;
116
+
117
+ const leftNode = leftNodeQuery(leftNonTerminalNode), ///
118
+ rightNode = rightNodeQuery(rightNonTerminalNode); ///
119
+
120
+ if ((leftNode !== null) && (rightNode !== null)) {
121
+ const success = run(leftNode, rightNode, ...remainingArguments);
122
+
123
+ visited = success; ///
124
+
125
+ return true;
126
+ }
127
+ });
128
+
129
+ return visited;
130
+ }
131
+ }
132
+
133
+ class EquationalPass extends Pass {
134
+ static maps = [
135
+ {
136
+ leftNodeQuery: termNodeQuery, ///
137
+ rightNodeQuery: termNodeQuery, ///
138
+ run: (leftTermNode, rightTermNode, context) => {
139
+ let success = false;
140
+
141
+ if (!success) {
142
+ const depth = Infinity,
143
+ leftTermNodeMatchesRightTermNode = leftTermNode.match(rightTermNode, depth);
144
+
145
+ if (leftTermNodeMatchesRightTermNode) {
146
+ success = true;
147
+ }
148
+ }
149
+
150
+ if (!success) {
151
+ const equivalences = context.getEquivalences(),
152
+ termNodes = [
153
+ leftTermNode,
154
+ rightTermNode
155
+ ],
156
+ equivalence = equivalences.findEquivalenceByTermNodes(termNodes);
157
+
158
+ if (equivalence !== null) {
159
+ success = true;
160
+ }
161
+ }
162
+
163
+ if (!success) {
164
+ const depth = 1,
165
+ leftTermNodeMatchesRightTermNode = leftTermNode.match(rightTermNode, depth);
166
+
167
+ if (leftTermNodeMatchesRightTermNode) {
168
+ const leftNonTerminalNode = leftTermNode, ///
169
+ rightNonTerminalNode = rightTermNode, ///
170
+ leftNonTerminalNodeChildNodes = leftNonTerminalNode.getChildNodes(),
171
+ rightNonTerminalNodeChildNodes = rightNonTerminalNode.getChildNodes(),
172
+ leftChildNodes = leftNonTerminalNodeChildNodes, ///
173
+ rightChildNodes = rightNonTerminalNodeChildNodes, ///
174
+ descended = equationalPass.descend(leftChildNodes, rightChildNodes, context);
175
+
176
+ if (descended) {
177
+ success = true;
178
+ }
179
+ }
180
+ }
181
+
182
+ return success;
183
+ }
184
+ }
185
+ ];
186
+ }
187
+
188
+ const equationalPass = new EquationalPass();
189
+
190
+ export function equateTerms(leftTermNode, rightTermNode, context) {
191
+ let termsEquate;
192
+
193
+ const leftNode = leftTermNode, ///
194
+ rightNode = rightTermNode, ///
195
+ success = equationalPass.run(leftNode, rightNode, context);
196
+
197
+ termsEquate = success; ///
198
+
199
+ return termsEquate;
200
+ }
201
+
202
+ export function equateStatements(leftStatementNode, rightStatementNode, context) {
203
+ let statementsEquate;
204
+
205
+ const leftNode = leftStatementNode, ///
206
+ rightNode = rightStatementNode, ///
207
+ success = equationalPass.run(leftNode, rightNode, context);
208
+
209
+ statementsEquate = success; ///
210
+
211
+ return statementsEquate;
212
+ }