occam-verify-cli 0.0.843 → 0.0.845

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.
@@ -5,12 +5,7 @@ import Equivalence from "../equivalence";
5
5
  import contextMixins from "../mixins/context";
6
6
 
7
7
  import { last } from "../utilities/array";
8
- import { mergeEquivalences,
9
- separateEquivalences,
10
- findEquivalenceByTerm,
11
- compressDefinedVariables,
12
- definedVariablesFromGroundedEquivalences,
13
- implicitlyGroundedEquivalencesFromRemainingEquivalencesAndDefinedVariables } from "../utilities/equivalences";
8
+ import { mergeEquivalences, findEquivalenceByTerm, groundedTermsAndDefinedVariablesFromFromEquivalences } from "../utilities/equivalences";
14
9
 
15
10
  class LocalContext {
16
11
  constructor(context, variables, proofSteps, equivalences) {
@@ -90,49 +85,42 @@ class LocalContext {
90
85
  return termType;
91
86
  }
92
87
 
93
- isVariableDefined(variable) {
94
- let variableDefined = false;
95
-
96
- const equivalences = this.getEquivalences(),
97
- remainingEquivalences = [],
98
- initiallyGroundedEquivalences = [];
99
-
100
- separateEquivalences(equivalences, remainingEquivalences, initiallyGroundedEquivalences);
101
-
102
- const initiallyGroundedEquivalencesLength = initiallyGroundedEquivalences.length;
103
-
104
- if (initiallyGroundedEquivalencesLength > 0) {
105
- let groundedEquivalences,
106
- implicitlyGroundedEquivalences,
107
- implicitlyGroundedEquivalencesLength;
108
-
109
- const context = this,
110
- definedVariables = [];
111
-
112
- groundedEquivalences = initiallyGroundedEquivalences; ///
113
-
114
- definedVariablesFromGroundedEquivalences(groundedEquivalences, definedVariables, context);
115
-
116
- implicitlyGroundedEquivalences = implicitlyGroundedEquivalencesFromRemainingEquivalencesAndDefinedVariables(remainingEquivalences, definedVariables);
88
+ isTermGrounded(term) {
89
+ const context = this,
90
+ equivalences = this.getEquivalences(),
91
+ groundedTerms = [],
92
+ definedVariables = [];
117
93
 
118
- implicitlyGroundedEquivalencesLength = implicitlyGroundedEquivalences.length;
94
+ groundedTermsAndDefinedVariablesFromFromEquivalences(equivalences, groundedTerms, definedVariables, context);
119
95
 
120
- while (implicitlyGroundedEquivalencesLength > 0) {
121
- groundedEquivalences = implicitlyGroundedEquivalences; ///
96
+ const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
97
+ const termMatchesGroundedTerm = term.match(groundedTerm);
122
98
 
123
- definedVariablesFromGroundedEquivalences(groundedEquivalences, definedVariables, context);
99
+ if (termMatchesGroundedTerm) {
100
+ return true;
101
+ }
102
+ }),
103
+ termGrounded = termMatchesGroundedTerm; ///
124
104
 
125
- implicitlyGroundedEquivalences = implicitlyGroundedEquivalencesFromRemainingEquivalencesAndDefinedVariables(remainingEquivalences, definedVariables);
105
+ return termGrounded;
106
+ }
126
107
 
127
- implicitlyGroundedEquivalencesLength = implicitlyGroundedEquivalences.length;
128
- }
108
+ isVariableDefined(variable) {
109
+ const context = this,
110
+ equivalences = this.getEquivalences(),
111
+ groundedTerms = [],
112
+ definedVariables = [];
129
113
 
130
- compressDefinedVariables(definedVariables);
114
+ groundedTermsAndDefinedVariablesFromFromEquivalences(equivalences, groundedTerms, definedVariables, context);
131
115
 
132
- const definedVariablesIncludesVariable = definedVariables.includes(variable);
116
+ const variableMatchesDefinedVariable = definedVariables.some((definedVariable) => {
117
+ const variableMatchesDefinedVariable = variable.match(definedVariable);
133
118
 
134
- variableDefined = definedVariablesIncludesVariable; ///
135
- }
119
+ if (variableMatchesDefinedVariable) {
120
+ return true;
121
+ }
122
+ }),
123
+ variableDefined = variableMatchesDefinedVariable; ///
136
124
 
137
125
  return variableDefined;
138
126
  }
@@ -107,35 +107,47 @@ export default class Equivalence {
107
107
  return termNodesMatch;
108
108
  }
109
109
 
110
- getVariables(context) {
111
- const variables = [];
112
-
110
+ getGroundedTerms(definedVariables, groundedTerms, context) {
113
111
  this.terms.forEach((term) => {
114
- term.getVariables(variables, context);
115
- });
112
+ const termGrounded = term.isGrounded(definedVariables, context);
113
+
114
+ if (termGrounded) {
115
+ const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
116
+ const termMatchesGroundedTerm = term.match(groundedTerm);
117
+
118
+ if (termMatchesGroundedTerm) {
119
+ return true;
120
+ }
121
+ })
116
122
 
117
- return variables;
123
+ if (!termMatchesGroundedTerm) {
124
+ const groundedTerm = term;
125
+
126
+ groundedTerms.push(groundedTerm);
127
+ }
128
+ }
129
+ });
118
130
  }
119
131
 
120
- isInitiallyGrounded() {
121
- const initiallyGroundedTerms = this.getInitiallyGroundedTerms(),
132
+ isInitiallyGrounded(context) {
133
+ const initiallyGroundedTerms = this.getInitiallyGroundedTerms(context),
122
134
  initiallyGroundedTermsLength = initiallyGroundedTerms.length,
123
135
  initiallyGrounded = (initiallyGroundedTermsLength > 0);
124
136
 
125
137
  return initiallyGrounded;
126
138
  }
127
139
 
128
- isImplicitlyGrounded(definedVariables) {
129
- const implicitlyGroundedTerms = this.getImplicitlyGroundedTerms(definedVariables),
140
+ isImplicitlyGrounded(definedVariables, context) {
141
+ const implicitlyGroundedTerms = this.getImplicitlyGroundedTerms(definedVariables, context),
130
142
  implicitlyGroundedTermsLength = implicitlyGroundedTerms.length,
131
143
  implicitlyGrounded = (implicitlyGroundedTermsLength > 0);
132
144
 
133
145
  return implicitlyGrounded;
134
146
  }
135
147
 
136
- getInitiallyGroundedTerms() {
148
+ getInitiallyGroundedTerms(context) {
137
149
  const initiallyGroundedTerms = this.terms.reduce((initiallyGroundedTerms, term) => {
138
- const termInitiallyGrounded = term.isInitiallyGrounded();
150
+ const termInitiallyGrounded = term.isInitiallyGrounded(context);
139
151
 
140
152
  if (termInitiallyGrounded) {
141
153
  const initiallyGroundedTerm = term; ///
@@ -149,9 +161,9 @@ export default class Equivalence {
149
161
  return initiallyGroundedTerms;
150
162
  }
151
163
 
152
- getImplicitlyGroundedTerms(definedVariables) {
164
+ getImplicitlyGroundedTerms(definedVariables, context) {
153
165
  const implicitlyGroundedTerms = this.terms.reduce((implicitlyGroundedTerms, term) => {
154
- const termImplicitlyGrounded = term.isImplicitlyGrounded(definedVariables);
166
+ const termImplicitlyGrounded = term.isImplicitlyGrounded(definedVariables, context);
155
167
 
156
168
  if (termImplicitlyGrounded) {
157
169
  const implicitlyGroundedTerm = term; ///
@@ -2,9 +2,11 @@
2
2
 
3
3
  import Substitution from "../substitution";
4
4
 
5
+ import substitutionNodesVerifier from "../verifier/nodes/substitution";
5
6
  import TermForVariableSubstitution from "./termForVariable";
6
7
  import intrinsicLevelNodesVerifier from "../verifier/nodes/intrinsicLevel";
7
8
 
9
+ import { push } from "../utilities/array";
8
10
  import { bracketedStatementChildNodeFromStatementNode } from "../utilities/proof";
9
11
 
10
12
  export default class StatementForMetavariableSubstitution extends Substitution {
@@ -52,9 +54,9 @@ export default class StatementForMetavariableSubstitution extends Substitution {
52
54
  if (this.substitution === null) {
53
55
  statementNodeMatches = this.statementNode.match(statementNode);
54
56
  } else {
55
- const substitution = this.substitution,
56
- statementNodeA = statementNode, ///
57
- statementNodeB = this.statementNode; ///
57
+ const substitution = this.substitution, ///
58
+ statementNodeA = statementNode, ///
59
+ statementNodeB = this.statementNode; ///
58
60
 
59
61
  statementNodeMatches = matchStatementNode(statementNodeA, statementNodeB, substitution, substitutions, localContextA, localContextB);
60
62
  }
@@ -99,26 +101,56 @@ export default class StatementForMetavariableSubstitution extends Substitution {
99
101
  }
100
102
  }
101
103
 
104
+ function transformSubstitutions(substitutionsA, substitutionsB) {
105
+ substitutionsA = substitutionsA.map((substitutionA) => {
106
+ const substitution = substitutionA, ///
107
+ substitutions = substitutionsB,
108
+ termForVariableSubstitution = TermForVariableSubstitution.fromSubstitutionAndSubstitutions(substitution, substitutions);
109
+
110
+ substitutionA = termForVariableSubstitution; ///
111
+
112
+ return substitutionA;
113
+ });
114
+
115
+ return substitutionsA;
116
+ }
117
+
102
118
  export function matchStatementNode(statementNodeA, statementNodeB, substitution, substitutions, localContextA, localContextB) {
103
- let statementNodeMatches;
119
+ let statementNodeMatches = false;
120
+
121
+ const termForVariableSubstitution = TermForVariableSubstitution.fromSubstitutionAndSubstitutions(substitution, substitutions),
122
+ intrinsic = termForVariableSubstitution.isIntrinsic(substitution);
104
123
 
105
- const termForVariableSubstitution = TermForVariableSubstitution.fromSubstitutionAndSubstitutions(substitution, substitutions);
124
+ let substitutionsA = []; ///
106
125
 
107
- substitution = termForVariableSubstitution; ///
126
+ if (intrinsic) {
127
+ const substitutionA = termForVariableSubstitution; ///
108
128
 
109
- substitutions = [ ///
110
- substitution
111
- ];
129
+ substitutionsA.push(substitutionA);
130
+ }
112
131
 
113
- const nonTerminalNodeA = statementNodeA, ///
132
+ const nonTerminalNodeA = statementNodeA, ///
114
133
  nonTerminalNodeB = statementNodeB, ///
115
- nonTerminalNodeVerified = intrinsicLevelNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutions, localContextA, localContextB, () => {
134
+ nonTerminalNodeVerified = substitutionNodesVerifier.verifyNonTerminalNode(nonTerminalNodeA, nonTerminalNodeB, substitutionsA, localContextA, localContextB, () => {
116
135
  const verifiedAhead = true;
117
136
 
118
137
  return verifiedAhead;
119
138
  });
120
139
 
121
- statementNodeMatches = nonTerminalNodeVerified; ///
140
+ if (nonTerminalNodeVerified) {
141
+ if (!intrinsic) {
142
+ const substitutionB = termForVariableSubstitution, ///
143
+ substitutionsB = [
144
+ substitutionB
145
+ ];
146
+
147
+ substitutionsA = transformSubstitutions(substitutionsA, substitutionsB);
148
+
149
+ push(substitutions, substitutionsA);
150
+ }
151
+
152
+ statementNodeMatches = true;
153
+ }
122
154
 
123
155
  return statementNodeMatches;
124
156
  }
@@ -23,6 +23,16 @@ export default class TermForVariableSubstitution extends Substitution {
23
23
  return this.termNode;
24
24
  }
25
25
 
26
+ isIntrinsic(substitution) {
27
+ const termNod = substitution.getTermNode(),
28
+ variableNode = substitution.getVariableNode(),
29
+ termNodeMatches = this.termNode.match(termNod),
30
+ variableNodeMatches = this.variableNode.match(variableNode),
31
+ intrinsic = ((!termNodeMatches) && (!variableNodeMatches));
32
+
33
+ return intrinsic;
34
+ }
35
+
26
36
  matchTermNode(termNode) {
27
37
  const termNodeMatches = this.termNode.match(termNode);
28
38
 
package/src/term.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import { filter } from "./utilities/array";
3
4
  import { nodesQuery } from "./utilities/query"
4
5
 
5
6
  const variableNodesQuery = nodesQuery("//variable");
@@ -25,8 +26,9 @@ export default class Term {
25
26
  return matches;
26
27
  }
27
28
 
28
- getVariables(variables, context) {
29
- const variableNodes = variableNodesQuery(this.node);
29
+ getVariables(context) {
30
+ const variables = [],
31
+ variableNodes = variableNodesQuery(this.node);
30
32
 
31
33
  variableNodes.forEach((variableNode) => {
32
34
  const variable = context.findVariableByVariableNode(variableNode),
@@ -40,31 +42,35 @@ export default class Term {
40
42
  return variables;
41
43
  }
42
44
 
43
- isInitiallyGrounded() {
44
- const definedVariables = [],
45
- implicitlyGrounded = this.isImplicitlyGrounded(definedVariables),
46
- initiallyGrounded = implicitlyGrounded; ///
45
+ isGrounded(definedVariables, context) {
46
+ const variables = this.getVariables(context);
47
+
48
+ filter(variables, (variable) => {
49
+ const definedVariablesIncludesVariable = definedVariables.includes(variable);
50
+
51
+ if (!definedVariablesIncludesVariable) {
52
+ return true;
53
+ }
54
+ });
55
+
56
+ const undefinedVariables = variables, ///
57
+ undefinedVariablesLength = undefinedVariables.length,
58
+ grounded = (undefinedVariablesLength <= 1);
59
+
60
+ return grounded;
61
+ }
62
+
63
+ isInitiallyGrounded(context) {
64
+ const variables = this.getVariables(context),
65
+ variablesLength = variables.length,
66
+ initiallyGrounded = (variablesLength === 0);
47
67
 
48
68
  return initiallyGrounded;
49
69
  }
50
70
 
51
- isImplicitlyGrounded(definedVariables) {
52
- const variableNodes = variableNodesQuery(this.node),
53
- variables = definedVariables, ///
54
- nodes = variableNodes, ///
55
- implicitlyGrounded = nodes.every((node) => {
56
- const variableMatchesNode = variables.some((variable) => {
57
- const variableMatchesNode = variable.matchNode(node);
58
-
59
- if (variableMatchesNode) {
60
- return true;
61
- }
62
- });
63
-
64
- if (variableMatchesNode) {
65
- return true;
66
- }
67
- });
71
+ isImplicitlyGrounded(definedVariables, context) {
72
+ const grounded = this.isGrounded(definedVariables, context),
73
+ implicitlyGrounded = grounded; ///
68
74
 
69
75
  return implicitlyGrounded;
70
76
  }
@@ -1,6 +1,43 @@
1
1
  "use strict";
2
2
 
3
- import { push, filter, compress, separate } from "../utilities/array";
3
+ import { push, compress, separate } from "../utilities/array";
4
+
5
+ export function mergeEquivalences(equivalencesA, equivalencesB, localContext) {
6
+ const typesA = typesFromEquivalences(equivalencesA, localContext),
7
+ typesB = typesFromEquivalences(equivalencesB, localContext),
8
+ types = [
9
+ ...typesA,
10
+ ...typesB
11
+ ];
12
+
13
+ compress(types, (typeA, typeB) => {
14
+ if (typeA === typeB) {
15
+ return true;
16
+ }
17
+ });
18
+
19
+ const equivalences = types.map((type) => {
20
+ let equivalence;
21
+
22
+ const equivalenceA = findEquivalenceByType(equivalencesA, type, localContext),
23
+ equivalenceB = findEquivalenceByType(equivalencesB, type, localContext);
24
+
25
+ if ((equivalenceA !== null) && (equivalenceB !== null)) {
26
+ const leftEquivalence = equivalenceA, ///
27
+ rightEquivalence = equivalenceB; ///
28
+
29
+ equivalence = Equivalence.merge(leftEquivalence, rightEquivalence);
30
+ } else if (equivalenceA !== null) {
31
+ equivalence = equivalenceA; ///
32
+ } else if (equivalenceB !== null) {
33
+ equivalence = equivalenceB; ///
34
+ }
35
+
36
+ return equivalence;
37
+ });
38
+
39
+ return equivalences;
40
+ }
4
41
 
5
42
  export function areTermNodesEqual(leftTermNode, rightTermNode, equivalences) {
6
43
  let termNodesEqual;
@@ -46,87 +83,62 @@ export function findEquivalenceByTerm(equivalences, term) {
46
83
  return equivalence;
47
84
  }
48
85
 
49
- export function mergeEquivalences(equivalencesA, equivalencesB, localContext) {
50
- const typesA = typesFromEquivalences(equivalencesA, localContext),
51
- typesB = typesFromEquivalences(equivalencesB, localContext),
52
- types = [
53
- ...typesA,
54
- ...typesB
55
- ];
86
+ export function groundedTermsAndDefinedVariablesFromFromEquivalences(equivalences, groundedTerms, definedVariables, context) {
87
+ let groundedEquivalences,
88
+ remainingEquivalences,
89
+ initiallyGroundedEquivalences,
90
+ implicitlyGroundedEquivalences;
56
91
 
57
- compress(types, (typeA, typeB) => {
58
- if (typeA === typeB) {
59
- return true;
60
- }
61
- });
92
+ remainingEquivalences = [];
62
93
 
63
- const equivalences = types.map((type) => {
64
- let equivalence;
94
+ initiallyGroundedEquivalences = [];
65
95
 
66
- const equivalenceA = findEquivalenceByType(equivalencesA, type, localContext),
67
- equivalenceB = findEquivalenceByType(equivalencesB, type, localContext);
96
+ separateInitiallyGroundedEquivalences(equivalences, remainingEquivalences, initiallyGroundedEquivalences, context);
68
97
 
69
- if ((equivalenceA !== null) && (equivalenceB !== null)) {
70
- const leftEquivalence = equivalenceA, ///
71
- rightEquivalence = equivalenceB; ///
98
+ const initiallyGroundedEquivalencesLength = initiallyGroundedEquivalences.length;
72
99
 
73
- equivalence = Equivalence.merge(leftEquivalence, rightEquivalence);
74
- } else if (equivalenceA !== null) {
75
- equivalence = equivalenceA; ///
76
- } else if (equivalenceB !== null) {
77
- equivalence = equivalenceB; ///
78
- }
100
+ if (initiallyGroundedEquivalencesLength > 0) {
101
+ groundedEquivalences = initiallyGroundedEquivalences; ///
79
102
 
80
- return equivalence;
81
- });
103
+ let implicitlyGroundedEquivalencesLength = 1;
82
104
 
83
- return equivalences;
84
- }
105
+ while (implicitlyGroundedEquivalencesLength > 0) {
106
+ let definedVariablesLength = 0,
107
+ previousDefinedVariablesLength = -1;
85
108
 
86
- export function separateEquivalences(equivalences, remainingEquivalences, initiallyGroundedEquivalences) {
87
- separate(equivalences, remainingEquivalences, initiallyGroundedEquivalences, (equivalence) => {
88
- const equivalenceInitiallyGrounded = equivalence.isInitiallyGrounded();
109
+ while (definedVariablesLength > previousDefinedVariablesLength) {
110
+ previousDefinedVariablesLength = definedVariablesLength; ///
89
111
 
90
- if (!equivalenceInitiallyGrounded) {
91
- return true;
92
- }
93
- });
94
- }
112
+ groundedTermsFromGroundedEquivalencesAndDefinedVariables(groundedEquivalences, definedVariables, groundedTerms, context);
95
113
 
96
- export function compressDefinedVariables(definedVariables) {
97
- compress(definedVariables, (definedVariableA, definedVariableB) => {
98
- if (definedVariableA === definedVariableB) {
99
- return true;
100
- }
101
- });
102
- }
114
+ definedVariablesFromGroundedTerms(groundedTerms, definedVariables, context);
103
115
 
104
- export function definedVariablesFromGroundedEquivalences(groundedEquivalences, definedVariables, context) {
105
- groundedEquivalences.forEach((groundedEquivalence) => {
106
- const variables = groundedEquivalence.getVariables(context);
116
+ definedVariablesLength = definedVariables.length;
117
+ }
107
118
 
108
- push(definedVariables, variables);
109
- });
110
- }
119
+ equivalences = remainingEquivalences; ///
111
120
 
112
- export function implicitlyGroundedEquivalencesFromRemainingEquivalencesAndDefinedVariables(remainingEquivalences, definedVariables) {
113
- const implicitlyGroundedEquivalences = [];
121
+ remainingEquivalences = [];
114
122
 
115
- filter(remainingEquivalences, (remainingEquivalence) => {
116
- const remainingEquivalenceImplicitlyGrounded = remainingEquivalence.isImplicitlyGrounded(definedVariables);
123
+ implicitlyGroundedEquivalences = [];
117
124
 
118
- if (remainingEquivalenceImplicitlyGrounded) {
119
- const implicitlyGroundedEquivalence = remainingEquivalence; ///
125
+ separateImplicitlyGroundedEquivalences(equivalences, remainingEquivalences, implicitlyGroundedEquivalences, definedVariables, context);
120
126
 
121
- implicitlyGroundedEquivalences.push(implicitlyGroundedEquivalence);
122
- }
127
+ push(groundedEquivalences, implicitlyGroundedEquivalences);
123
128
 
124
- if (!remainingEquivalenceImplicitlyGrounded) {
125
- return true;
129
+ implicitlyGroundedEquivalencesLength = implicitlyGroundedEquivalences.length; ///
126
130
  }
131
+ }
132
+ }
133
+
134
+ function typesFromEquivalences(equivalences, localContext) {
135
+ const types = equivalences.map((equivalence) => {
136
+ const type = equivalence.getType(localContext);
137
+
138
+ return type;
127
139
  });
128
140
 
129
- return implicitlyGroundedEquivalences;
141
+ return types;
130
142
  }
131
143
 
132
144
  function findEquivalenceByTermNodes(equivalences, termNodes) {
@@ -141,12 +153,47 @@ function findEquivalenceByTermNodes(equivalences, termNodes) {
141
153
  return equivalence;
142
154
  }
143
155
 
144
- function typesFromEquivalences(equivalences, localContext) {
145
- const types = equivalences.map((equivalence) => {
146
- const type = equivalence.getType(localContext);
156
+ function definedVariablesFromGroundedTerms(groundedTerms, definedVariables, context) {
157
+ const terms = groundedTerms, ///
158
+ variables = definedVariables; ///
147
159
 
148
- return type;
160
+ terms.forEach((term) => {
161
+ const termVariables = term.getVariables(context);
162
+
163
+ termVariables.forEach((termVariable) => {
164
+ const variablesIncludesTermVariable = variables.includes(termVariable);
165
+
166
+ if (!variablesIncludesTermVariable) {
167
+ const variable = termVariable; ///
168
+
169
+ variables.push(variable);
170
+ }
171
+ });
149
172
  });
173
+ }
150
174
 
151
- return types;
175
+ function separateInitiallyGroundedEquivalences(equivalences, remainingEquivalences, initiallyGroundedEquivalences, context) {
176
+ separate(equivalences, remainingEquivalences, initiallyGroundedEquivalences, (equivalence) => {
177
+ const equivalenceInitiallyGrounded = equivalence.isInitiallyGrounded(context);
178
+
179
+ if (!equivalenceInitiallyGrounded) {
180
+ return true;
181
+ }
182
+ });
183
+ }
184
+
185
+ function separateImplicitlyGroundedEquivalences(equivalences, remainingEquivalences, implicitlyGroundedEquivalences, definedVariables, context) {
186
+ separate(equivalences, remainingEquivalences, implicitlyGroundedEquivalences, (equivalence) => {
187
+ const equivalenceImplicitlyGrounded = equivalence.isImplicitlyGrounded(definedVariables, context);
188
+
189
+ if (!equivalenceImplicitlyGrounded) {
190
+ return true;
191
+ }
192
+ });
193
+ }
194
+
195
+ function groundedTermsFromGroundedEquivalencesAndDefinedVariables(groundedEquivalences, definedVariables, groundedTerms, context) {
196
+ groundedEquivalences.forEach((groundedEquivalence) => {
197
+ groundedEquivalence.getGroundedTerms(definedVariables, groundedTerms, context);
198
+ });
152
199
  }
@@ -93,6 +93,31 @@ class MetaLevelToIntrinsicLevelNodesVerifier extends NodesVerifier {
93
93
  return metaArgumentNodeVerified;
94
94
  }
95
95
 
96
+ verifyStatementNode(metastatementNodeA, statementNodeB, substitutions, fileContextA, localContextB, verifyAhead) {
97
+ let statementNodeVerified;
98
+
99
+ const metavariableNodeA = metavariableNodeQuery(metastatementNodeA);
100
+
101
+ if (metavariableNodeA !== null) {
102
+ const substitutionNodeA = substitutionNodeQuery(metastatementNodeA),
103
+ metavariableNodeVerified = this.verifyMetavariableNode(metavariableNodeA, substitutionNodeA, statementNodeB, substitutions, fileContextA, localContextB, verifyAhead);
104
+
105
+ statementNodeVerified = metavariableNodeVerified; ///
106
+ } else {
107
+ const nonTerminalNodeA = metastatementNodeA, ///
108
+ nonTerminalNodeB = statementNodeB, ///
109
+ nonTerminalNodeAChildNodes = nonTerminalNodeA.getChildNodes(),
110
+ nonTerminalNodeBChildNodes = nonTerminalNodeB.getChildNodes(),
111
+ childNodesA = nonTerminalNodeAChildNodes, ///
112
+ childNodesB = nonTerminalNodeBChildNodes, ///
113
+ childNodesVerified = super.verifyChildNodes(childNodesA, childNodesB, substitutions, fileContextA, localContextB, verifyAhead);
114
+
115
+ statementNodeVerified = childNodesVerified; ///
116
+ }
117
+
118
+ return statementNodeVerified;
119
+ }
120
+
96
121
  verifyMetavariableNode(metavariableNodeA, substitutionNodeA, statementNodeB, substitutions, fileContextA, localContextB, verifyAhead) {
97
122
  let metavariableNodeVerified;
98
123
 
@@ -136,31 +161,6 @@ class MetaLevelToIntrinsicLevelNodesVerifier extends NodesVerifier {
136
161
  return metavariableNodeVerified;
137
162
  }
138
163
 
139
- verifyStatementNode(metastatementNodeA, statementNodeB, substitutions, fileContextA, localContextB, verifyAhead) {
140
- let statementNodeVerified;
141
-
142
- const metavariableNodeA = metavariableNodeQuery(metastatementNodeA);
143
-
144
- if (metavariableNodeA !== null) {
145
- const substitutionNodeA = null, ///
146
- metavariableNodeVerified = this.verifyMetavariableNode(metavariableNodeA, substitutionNodeA, statementNodeB, substitutions, fileContextA, localContextB, verifyAhead);
147
-
148
- statementNodeVerified = metavariableNodeVerified; ///
149
- } else {
150
- const nonTerminalNodeA = metastatementNodeA, ///
151
- nonTerminalNodeB = statementNodeB, ///
152
- nonTerminalNodeAChildNodes = nonTerminalNodeA.getChildNodes(),
153
- nonTerminalNodeBChildNodes = nonTerminalNodeB.getChildNodes(),
154
- childNodesA = nonTerminalNodeAChildNodes, ///
155
- childNodesB = nonTerminalNodeBChildNodes, ///
156
- childNodesVerified = super.verifyChildNodes(childNodesA, childNodesB, substitutions, fileContextA, localContextB, verifyAhead);
157
-
158
- statementNodeVerified = childNodesVerified; ///
159
- }
160
-
161
- return statementNodeVerified;
162
- }
163
-
164
164
  verifyTermNode(termNodeA, nonTerminalNodeB, substitutions, fileContextA, localContextB, verifyAhead) {
165
165
  let termNodeVerified = false;
166
166