occam-verify-cli 0.0.1246 → 0.0.1248
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.
- package/lib/context/file.js +170 -209
- package/lib/context/local.js +95 -125
- package/lib/dom/assertion/contained.js +44 -22
- package/lib/dom/assertion/defined.js +34 -17
- package/lib/dom/combinator/bracketed.js +167 -0
- package/lib/dom/combinator.js +163 -0
- package/lib/{constructor → dom/constructor}/bracketed.js +7 -7
- package/lib/dom/constructor.js +190 -0
- package/lib/dom/declaration/combinator.js +2 -8
- package/lib/dom/declaration/constructor.js +42 -7
- package/lib/dom/declaration.js +141 -149
- package/lib/dom/equality.js +3 -3
- package/lib/dom/frame.js +111 -76
- package/lib/dom/judgement.js +29 -3
- package/lib/dom/label.js +22 -15
- package/lib/dom/metaLemma.js +13 -58
- package/lib/dom/metatheorem.js +11 -117
- package/lib/dom/metavariable.js +7 -7
- package/lib/dom/reference.js +60 -18
- package/lib/dom/rule.js +6 -7
- package/lib/dom/statement.js +2 -2
- package/lib/dom/term.js +2 -2
- package/lib/dom/topLevelAssertion.js +78 -99
- package/lib/dom/topLevelMetaAssertion.js +253 -0
- package/lib/dom/type.js +3 -3
- package/lib/dom/variable.js +5 -5
- package/lib/equivalence.js +2 -2
- package/lib/index.js +7 -3
- package/lib/mixins/statement/verify.js +3 -3
- package/lib/mixins/term/verify.js +2 -3
- package/lib/substitution/statement.js +2 -2
- package/lib/unifier/{label.js → reference.js} +14 -14
- package/lib/utilities/json.js +5 -7
- package/lib/utilities/string.js +3 -3
- package/lib/utilities/unification.js +25 -6
- package/lib/verifier/combinator.js +3 -3
- package/lib/verifier/constructor.js +3 -3
- package/package.json +5 -5
- package/src/context/file.js +161 -205
- package/src/context/local.js +73 -83
- package/src/dom/assertion/contained.js +60 -27
- package/src/dom/assertion/defined.js +44 -20
- package/src/{combinator → dom/combinator}/bracketed.js +6 -5
- package/src/{combinator.js → dom/combinator.js} +8 -7
- package/src/{constructor → dom/constructor}/bracketed.js +6 -5
- package/src/{constructor.js → dom/constructor.js} +28 -27
- package/src/dom/declaration/combinator.js +2 -3
- package/src/dom/declaration/constructor.js +3 -2
- package/src/dom/declaration.js +163 -199
- package/src/dom/equality.js +2 -2
- package/src/dom/frame.js +151 -95
- package/src/dom/judgement.js +36 -2
- package/src/dom/label.js +18 -13
- package/src/dom/metaLemma.js +5 -78
- package/src/dom/metatheorem.js +8 -121
- package/src/dom/metavariable.js +6 -6
- package/src/dom/reference.js +85 -25
- package/src/dom/rule.js +7 -5
- package/src/dom/statement.js +1 -1
- package/src/dom/term.js +1 -1
- package/src/dom/topLevelAssertion.js +86 -128
- package/src/dom/topLevelMetaAssertion.js +154 -0
- package/src/dom/type.js +2 -2
- package/src/dom/variable.js +4 -4
- package/src/equivalence.js +1 -1
- package/src/index.js +4 -0
- package/src/mixins/statement/verify.js +3 -2
- package/src/mixins/term/verify.js +2 -3
- package/src/substitution/statement.js +1 -1
- package/src/unifier/{label.js → reference.js} +6 -6
- package/src/utilities/json.js +4 -4
- package/src/utilities/string.js +2 -2
- package/src/utilities/unification.js +44 -5
- package/src/verifier/combinator.js +2 -2
- package/src/verifier/constructor.js +2 -2
- package/lib/combinator/bracketed.js +0 -126
- package/lib/combinator.js +0 -122
- package/lib/constructor.js +0 -149
package/src/dom/declaration.js
CHANGED
|
@@ -5,6 +5,7 @@ import dom from "../dom";
|
|
|
5
5
|
import { nodeQuery } from "../utilities/query";
|
|
6
6
|
import { domAssigned } from "../dom";
|
|
7
7
|
import { stripBracketsFromStatementNode } from "../utilities/brackets";
|
|
8
|
+
import metaLemma from "./metaLemma";
|
|
8
9
|
|
|
9
10
|
const statementNodeQuery = nodeQuery("/declaration/statement");
|
|
10
11
|
|
|
@@ -27,171 +28,93 @@ export default domAssigned(class Declaration {
|
|
|
27
28
|
return this.statement;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
const statementString = statement.getString(),
|
|
34
|
-
declarationStatementString = this.statement.getString(); ///
|
|
35
|
-
|
|
36
|
-
context.trace(`Unifying the '${statementString}' statement with the '${declarationStatementString}' statement...`);
|
|
37
|
-
|
|
38
|
-
let statementNode = statement.getNode();
|
|
39
|
-
|
|
40
|
-
statementNode = stripBracketsFromStatementNode(statementNode); ///
|
|
41
|
-
|
|
42
|
-
const statementNodeMatches = this.statement.matchStatementNode(statementNode);
|
|
43
|
-
|
|
44
|
-
statementUnified = statementNodeMatches; ///
|
|
45
|
-
|
|
46
|
-
if (statementUnified) {
|
|
47
|
-
context.debug(`...unified the '${statementString}' statement with the '${declarationStatementString}' statement.`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return statementUnified;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
unifyMetavariable(metavariable, context) {
|
|
54
|
-
let metavariableUnified;
|
|
55
|
-
|
|
56
|
-
const referenceString = this.reference.getString(),
|
|
57
|
-
metavariableString = metavariable.getString();
|
|
58
|
-
|
|
59
|
-
context.trace(`Unifying the '${metavariableString}' metavariable with the '${referenceString}' reference...`);
|
|
60
|
-
|
|
61
|
-
const metavariableNode = metavariable.getNode(),
|
|
62
|
-
metavariableNodeMatches = this.reference.matchMetavariableNode(metavariableNode);
|
|
63
|
-
|
|
64
|
-
metavariableUnified = metavariableNodeMatches; ///
|
|
65
|
-
|
|
66
|
-
if (metavariableUnified) {
|
|
67
|
-
context.debug(`...unified the '${metavariableString}' metavariable with the '${referenceString}' reference.`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return metavariableUnified;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
unifySubstitution(substitution, context) {
|
|
74
|
-
let substitutionUnified;
|
|
75
|
-
|
|
76
|
-
const declarationString = this.string, ///
|
|
77
|
-
substitutionString = substitution.getString();
|
|
78
|
-
|
|
79
|
-
context.trace(`Unifying the '${substitutionString}' substitution with the '${declarationString}' declaration...`);
|
|
80
|
-
|
|
81
|
-
const statement = substitution.getStatement(),
|
|
82
|
-
metavariable = substitution.getMetavariable(),
|
|
83
|
-
statementUnified = this.unifyStatement(statement, context),
|
|
84
|
-
metavariableUnified = this.unifyMetavariable(metavariable, context);
|
|
31
|
+
verify(frame, assignments, stated, context) {
|
|
32
|
+
let verified = false;
|
|
85
33
|
|
|
86
|
-
|
|
34
|
+
const declarationString = this.string; ///
|
|
87
35
|
|
|
88
|
-
|
|
89
|
-
context.debug(`...unified the '${declarationString}' substitution with the '${substitutionString}' declaration.`);
|
|
90
|
-
}
|
|
36
|
+
context.trace(`Verifying the '${declarationString}' declaration...`);
|
|
91
37
|
|
|
92
|
-
|
|
93
|
-
}
|
|
38
|
+
const referenceVerified = this.verifyReference(assignments, stated, context);
|
|
94
39
|
|
|
95
|
-
|
|
96
|
-
|
|
40
|
+
if (referenceVerified) {
|
|
41
|
+
const statementVerified = this.verifyStatement(assignments, stated, context);
|
|
97
42
|
|
|
98
|
-
|
|
99
|
-
|
|
43
|
+
if (statementVerified) {
|
|
44
|
+
let verifiedWhenStated = false,
|
|
45
|
+
verifiedWhenDerived = false;
|
|
100
46
|
|
|
101
|
-
|
|
47
|
+
if (stated) {
|
|
48
|
+
verifiedWhenStated = this.verifyWhenStated(frame, assignments, context);
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
|
|
50
|
+
verified = verifiedWhenStated; ///
|
|
51
|
+
} else {
|
|
52
|
+
verifiedWhenDerived = this.verifyWhenDerived(context);
|
|
105
53
|
|
|
106
|
-
|
|
107
|
-
|
|
54
|
+
verified = verifiedWhenDerived; ///
|
|
55
|
+
}
|
|
108
56
|
|
|
109
|
-
|
|
110
|
-
|
|
57
|
+
if (verifiedWhenStated || verifiedWhenDerived) {
|
|
58
|
+
verified = true;
|
|
59
|
+
}
|
|
111
60
|
}
|
|
112
61
|
}
|
|
113
62
|
|
|
114
|
-
if (
|
|
115
|
-
context.debug(`...
|
|
63
|
+
if (verified) {
|
|
64
|
+
context.debug(`...verified the '${declarationString}' declaration.`);
|
|
116
65
|
}
|
|
117
66
|
|
|
118
|
-
return
|
|
67
|
+
return verified;
|
|
119
68
|
}
|
|
120
69
|
|
|
121
|
-
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
const declarationString = this.string, ///
|
|
125
|
-
axiomLemmaTheoremConjectureString = axiomLemmaTheoremConjecture.getString();
|
|
126
|
-
|
|
127
|
-
context.trace(`Unifying the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture with the '${declarationString}' declaration...`);
|
|
70
|
+
verifyReference(assignments, stated, context) {
|
|
71
|
+
let referenceVerified;
|
|
128
72
|
|
|
129
|
-
const
|
|
73
|
+
const referenceString = this.reference.getString(),
|
|
74
|
+
declarationString = this.string; ///
|
|
130
75
|
|
|
131
|
-
|
|
132
|
-
const statementUnified = axiomLemmaTheoremConjecture.unifyStatement(this.statement, context);
|
|
76
|
+
context.trace(`Verifying the '${declarationString}' declaration's '${referenceString}' reference...`);
|
|
133
77
|
|
|
134
|
-
|
|
135
|
-
axiomLemmaTheoremConjectureUnified = true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
78
|
+
referenceVerified = this.reference.verify(context);
|
|
138
79
|
|
|
139
|
-
if (
|
|
140
|
-
context.debug(`...
|
|
80
|
+
if (referenceVerified) {
|
|
81
|
+
context.debug(`...verified the '${declarationString}' declaration's '${referenceString}' reference.`);
|
|
141
82
|
}
|
|
142
83
|
|
|
143
|
-
return
|
|
84
|
+
return referenceVerified;
|
|
144
85
|
}
|
|
145
86
|
|
|
146
|
-
|
|
147
|
-
let
|
|
87
|
+
verifyStatement(assignments, stated, context) {
|
|
88
|
+
let statementVerified;
|
|
148
89
|
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
context.trace(`Verifying the '${declarationString}' declaration...`);
|
|
90
|
+
const statementString = this.statement.getString(),
|
|
91
|
+
declarationString = this.string; ///
|
|
152
92
|
|
|
153
|
-
|
|
93
|
+
context.trace(`Verifying the '${declarationString}' declaration's '${statementString}' statement...`);
|
|
154
94
|
|
|
155
|
-
if (statementVerified) {
|
|
156
|
-
let verifiedWhenStated = false,
|
|
157
|
-
verifiedWhenDerived = false;
|
|
158
|
-
|
|
159
|
-
if (stated) {
|
|
160
|
-
verifiedWhenStated = this.verifyWhenStated(context);
|
|
161
|
-
} else {
|
|
162
|
-
verifiedWhenDerived = this.verifyWhenDerived(frame, context);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
verified = (verifiedWhenStated || verifiedWhenDerived);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (verified) {
|
|
169
|
-
context.debug(`...verified the '${declarationString}' declaration.`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return verified;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
verifyStatement(statement, assignments, stated, context) {
|
|
176
95
|
stated = true; ///
|
|
177
96
|
|
|
178
97
|
assignments = null; ///
|
|
179
98
|
|
|
180
|
-
|
|
99
|
+
statementVerified = this.statement.verify(assignments, stated, context);
|
|
100
|
+
|
|
101
|
+
if (statementVerified) {
|
|
102
|
+
context.debug(`...verified the '${declarationString}' declaration's '${statementString}' statement.`);
|
|
103
|
+
}
|
|
181
104
|
|
|
182
105
|
return statementVerified;
|
|
183
106
|
}
|
|
184
107
|
|
|
185
|
-
verifyWhenStated(context) {
|
|
108
|
+
verifyWhenStated(frame, assignments, context) {
|
|
186
109
|
let verifiedWhenStated;
|
|
187
110
|
|
|
188
111
|
const declarationString = this.string; ///
|
|
189
112
|
|
|
190
113
|
context.trace(`Verifying the '${declarationString}' stated declaration...`);
|
|
191
114
|
|
|
192
|
-
const
|
|
115
|
+
const metavariablePresent = context.isMetavariablePresentByReference(this.reference);
|
|
193
116
|
|
|
194
|
-
if (
|
|
117
|
+
if (metavariablePresent) {
|
|
195
118
|
verifiedWhenStated = true;
|
|
196
119
|
} else {
|
|
197
120
|
const metaLemmas = context.findMetaLemmasByReference(this.reference),
|
|
@@ -200,35 +123,19 @@ export default domAssigned(class Declaration {
|
|
|
200
123
|
...metaLemmas,
|
|
201
124
|
...metatheorems
|
|
202
125
|
],
|
|
203
|
-
|
|
204
|
-
const
|
|
126
|
+
metaLemmaMetatheoremsVerifiedWhenStated = metaLemmaMetatheorems.every((metaLemmaMetatheorem) => {
|
|
127
|
+
const metaLemmaMetatheoremVerifiedWhenStated = metaLemmaMetatheorem.verifyWhenStated(this.statement, this.reference, context);
|
|
205
128
|
|
|
206
|
-
if (
|
|
129
|
+
if (metaLemmaMetatheoremVerifiedWhenStated) {
|
|
207
130
|
return true;
|
|
208
131
|
}
|
|
209
132
|
});
|
|
210
133
|
|
|
211
|
-
|
|
212
|
-
verifiedWhenStated = true;
|
|
213
|
-
} else {
|
|
214
|
-
const axiom = context.findAxiomByReference(this.reference),
|
|
215
|
-
lemma = context.findLemmaByReference(this.reference),
|
|
216
|
-
theorem = context.findTheoremByReference(this.reference),
|
|
217
|
-
conjecture = context.findConjectureByReference(this.reference),
|
|
218
|
-
axiomLemmaTheoremConjecture = (axiom || lemma || theorem || conjecture);
|
|
219
|
-
|
|
220
|
-
if (axiomLemmaTheoremConjecture !== null) {
|
|
221
|
-
const axiomLemmaTheoremConjectureUnified = this.unifyAxiomLemmaTheoremConjecture(axiomLemmaTheoremConjecture, context);
|
|
222
|
-
|
|
223
|
-
if (axiomLemmaTheoremConjectureUnified) {
|
|
224
|
-
verifiedWhenStated = true;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
134
|
+
verifiedWhenStated = metaLemmaMetatheoremsVerifiedWhenStated; ///
|
|
228
135
|
}
|
|
229
136
|
|
|
230
137
|
if (verifiedWhenStated) {
|
|
231
|
-
context.
|
|
138
|
+
context.trace(`...verified the '${declarationString}' stated declaration.`);
|
|
232
139
|
}
|
|
233
140
|
|
|
234
141
|
return verifiedWhenStated;
|
|
@@ -241,79 +148,136 @@ export default domAssigned(class Declaration {
|
|
|
241
148
|
|
|
242
149
|
context.trace(`Verifying the '${declarationString}' derived declaration...`);
|
|
243
150
|
|
|
244
|
-
|
|
151
|
+
debugger
|
|
152
|
+
|
|
153
|
+
// const metaLemmas = context.findMetaLemmasByReference(this.reference),
|
|
154
|
+
// metatheorems = context.findMetatheoremsByReference(this.reference),
|
|
155
|
+
// metaLemmaMetatheorems = [
|
|
156
|
+
// ...metaLemmas,
|
|
157
|
+
// ...metatheorems
|
|
158
|
+
// ],
|
|
159
|
+
// metaLemmaMetatheoremUnified = metaLemmaMetatheorems.some((metaLemmaMetatheorem) => {
|
|
160
|
+
// let metaLemmaMetatheoremUnified = true;
|
|
161
|
+
//
|
|
162
|
+
// if (metaLemmaMetatheoremUnified) {
|
|
163
|
+
// metaLemmaMetatheoremUnified = frame.unifyMetaLemmaMetatheorem(metaLemmaMetatheorem, context);
|
|
164
|
+
// }
|
|
165
|
+
//
|
|
166
|
+
// if (metaLemmaMetatheoremUnified) {
|
|
167
|
+
// metaLemmaMetatheoremUnified = this.unifyMetaLemmaMetatheorem(metaLemmaMetatheorem, context);
|
|
168
|
+
// }
|
|
169
|
+
//
|
|
170
|
+
// if (metaLemmaMetatheoremUnified) {
|
|
171
|
+
// return true;
|
|
172
|
+
// }
|
|
173
|
+
// });
|
|
174
|
+
//
|
|
175
|
+
// if (metaLemmaMetatheoremUnified) {
|
|
176
|
+
// verifiedWhenDerived = true;
|
|
177
|
+
// } else {
|
|
178
|
+
// const axiom = context.findAxiomByReference(this.reference),
|
|
179
|
+
// lemma = context.findLemmaByReference(this.reference),
|
|
180
|
+
// theorem = context.findTheoremByReference(this.reference),
|
|
181
|
+
// conjecture = context.findConjectureByReference(this.reference),
|
|
182
|
+
// axiomLemmaTheoremConjecture = (axiom || lemma || theorem || conjecture);
|
|
183
|
+
//
|
|
184
|
+
// if (axiomLemmaTheoremConjecture !== null) {
|
|
185
|
+
// const axiomLemmaTheoremConjectureUnified = this.unifyAxiomLemmaTheoremConjecture(axiomLemmaTheoremConjecture, context);
|
|
186
|
+
//
|
|
187
|
+
// if (axiomLemmaTheoremConjectureUnified) {
|
|
188
|
+
// verifiedWhenDerived = true;
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
// }
|
|
245
192
|
|
|
246
|
-
if (
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
const metaLemmas = context.findMetaLemmasByReference(this.reference),
|
|
250
|
-
metatheorems = context.findMetatheoremsByReference(this.reference),
|
|
251
|
-
metaLemmaMetatheorems = [
|
|
252
|
-
...metaLemmas,
|
|
253
|
-
...metatheorems
|
|
254
|
-
],
|
|
255
|
-
metaLemmaMetatheoremUnified = metaLemmaMetatheorems.some((metaLemmaMetatheorem) => {
|
|
256
|
-
let metaLemmaMetatheoremUnified = true;
|
|
193
|
+
if (verifiedWhenDerived) {
|
|
194
|
+
context.trace(`...verified the '${declarationString}' derived declaration.`);
|
|
195
|
+
}
|
|
257
196
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
197
|
+
return verifiedWhenDerived;
|
|
198
|
+
}
|
|
261
199
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
200
|
+
unifyStatement(statement, context) {
|
|
201
|
+
let statementUnified;
|
|
265
202
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
});
|
|
203
|
+
const statementString = statement.getString(),
|
|
204
|
+
declarationStatementString = this.statement.getString(); ///
|
|
270
205
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (axiomLemmaTheoremConjectureUnified) {
|
|
284
|
-
verifiedWhenDerived = true;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
206
|
+
context.trace(`Unifying the '${statementString}' statement with the '${declarationStatementString}' statement...`);
|
|
207
|
+
|
|
208
|
+
let statementNode = statement.getNode();
|
|
209
|
+
|
|
210
|
+
statementNode = stripBracketsFromStatementNode(statementNode); ///
|
|
211
|
+
|
|
212
|
+
const statementNodeMatches = this.statement.matchStatementNode(statementNode);
|
|
213
|
+
|
|
214
|
+
statementUnified = statementNodeMatches; ///
|
|
215
|
+
|
|
216
|
+
if (statementUnified) {
|
|
217
|
+
context.debug(`...unified the '${statementString}' statement with the '${declarationStatementString}' statement.`);
|
|
288
218
|
}
|
|
289
219
|
|
|
290
|
-
|
|
291
|
-
|
|
220
|
+
return statementUnified;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
unifyMetavariable(metavariable, context) {
|
|
224
|
+
let metavariableUnified;
|
|
225
|
+
|
|
226
|
+
const referenceString = this.reference.getString(),
|
|
227
|
+
metavariableString = metavariable.getString();
|
|
228
|
+
|
|
229
|
+
context.trace(`Unifying the '${metavariableString}' metavariable with the '${referenceString}' reference...`);
|
|
230
|
+
|
|
231
|
+
const metavariableNode = metavariable.getNode(),
|
|
232
|
+
metavariableNodeMatches = this.reference.matchMetavariableNode(metavariableNode);
|
|
233
|
+
|
|
234
|
+
metavariableUnified = metavariableNodeMatches; ///
|
|
235
|
+
|
|
236
|
+
if (metavariableUnified) {
|
|
237
|
+
context.debug(`...unified the '${metavariableString}' metavariable with the '${referenceString}' reference.`);
|
|
292
238
|
}
|
|
293
239
|
|
|
294
|
-
return
|
|
240
|
+
return metavariableUnified;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
unifySubstitution(substitution, context) {
|
|
244
|
+
let substitutionUnified;
|
|
245
|
+
|
|
246
|
+
const declarationString = this.string, ///
|
|
247
|
+
substitutionString = substitution.getString();
|
|
248
|
+
|
|
249
|
+
context.trace(`Unifying the '${substitutionString}' substitution with the '${declarationString}' declaration...`);
|
|
250
|
+
|
|
251
|
+
const statement = substitution.getStatement(),
|
|
252
|
+
metavariable = substitution.getMetavariable(),
|
|
253
|
+
statementUnified = this.unifyStatement(statement, context),
|
|
254
|
+
metavariableUnified = this.unifyMetavariable(metavariable, context);
|
|
255
|
+
|
|
256
|
+
substitutionUnified = (metavariableUnified && statementUnified);
|
|
257
|
+
|
|
258
|
+
if (substitutionUnified) {
|
|
259
|
+
context.debug(`...unified the '${declarationString}' substitution with the '${substitutionString}' declaration.`);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return substitutionUnified;
|
|
295
263
|
}
|
|
296
264
|
|
|
297
265
|
static name = "Declaration";
|
|
298
266
|
|
|
299
267
|
static fromDeclarationNode(declarationNode, context) {
|
|
300
|
-
|
|
268
|
+
const { Reference, Statement } = dom,
|
|
269
|
+
node = declarationNode, ///
|
|
270
|
+
string = context.nodeAsString(node);
|
|
301
271
|
|
|
302
|
-
|
|
303
|
-
const { Statement } = dom;
|
|
272
|
+
let statementNode;
|
|
304
273
|
|
|
305
|
-
|
|
274
|
+
statementNode = statementNodeQuery(declarationNode);
|
|
306
275
|
|
|
307
|
-
|
|
276
|
+
statementNode = stripBracketsFromStatementNode(statementNode); ///
|
|
308
277
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
node = declarationNode, ///
|
|
313
|
-
string = context.nodeAsString(node);
|
|
314
|
-
|
|
315
|
-
declaration = new Declaration(string, reference, statement);
|
|
316
|
-
}
|
|
278
|
+
const reference = Reference.fromDeclarationNode(declarationNode, context),
|
|
279
|
+
statement = Statement.fromStatementNode(statementNode, context),
|
|
280
|
+
declaration = new Declaration(string, reference, statement);
|
|
317
281
|
|
|
318
282
|
return declaration;
|
|
319
283
|
}
|
package/src/dom/equality.js
CHANGED
|
@@ -81,7 +81,7 @@ export default domAssigned(class Equality {
|
|
|
81
81
|
verifiedWhenDerived = false;
|
|
82
82
|
|
|
83
83
|
if (stated) {
|
|
84
|
-
verifiedWhenStated = this.verifyWhenStated(context);
|
|
84
|
+
verifiedWhenStated = this.verifyWhenStated(assignments, context);
|
|
85
85
|
} else {
|
|
86
86
|
verifiedWhenDerived = this.verifyWhenDerived(context);
|
|
87
87
|
}
|
|
@@ -170,7 +170,7 @@ export default domAssigned(class Equality {
|
|
|
170
170
|
return termsVerified;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
verifyWhenStated(context) {
|
|
173
|
+
verifyWhenStated(assignments, context) {
|
|
174
174
|
let verifiedWhenStated;
|
|
175
175
|
|
|
176
176
|
const equalityString = this.string; ///
|