occam-verify-cli 0.0.1245 → 0.0.1247
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 +172 -210
- 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 +113 -71
- 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 +20 -41
- package/lib/dom/metatheorem.js +20 -41
- package/lib/dom/metavariable.js +7 -7
- package/lib/dom/reference.js +32 -18
- package/lib/dom/rule.js +3 -4
- package/lib/dom/statement.js +2 -2
- package/lib/dom/term.js +2 -2
- package/lib/dom/topLevelAssertion.js +50 -71
- 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/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 +166 -206
- 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} +8 -7
- package/src/dom/declaration/combinator.js +2 -3
- package/src/dom/declaration/constructor.js +3 -2
- package/src/dom/declaration.js +133 -101
- 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 +23 -55
- package/src/dom/metatheorem.js +23 -55
- package/src/dom/metavariable.js +6 -6
- package/src/dom/reference.js +43 -25
- package/src/dom/rule.js +2 -2
- package/src/dom/statement.js +1 -1
- package/src/dom/term.js +1 -1
- package/src/dom/topLevelAssertion.js +53 -86
- 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/unification.js +43 -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/context/local.js
CHANGED
|
@@ -165,9 +165,9 @@ class LocalContext {
|
|
|
165
165
|
let variableAdded = false;
|
|
166
166
|
|
|
167
167
|
const variableName = variable.getNode(),
|
|
168
|
-
|
|
168
|
+
variablePresent = this.isVariablePresentByVariableName(variableName, nested);
|
|
169
169
|
|
|
170
|
-
if (!
|
|
170
|
+
if (!variablePresent) {
|
|
171
171
|
this.variables.push(variable);
|
|
172
172
|
|
|
173
173
|
variableAdded = true;
|
|
@@ -217,75 +217,23 @@ class LocalContext {
|
|
|
217
217
|
return termType;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
const context = this, ///
|
|
222
|
-
equivalences = this.getEquivalences(),
|
|
223
|
-
groundedTerms = [],
|
|
224
|
-
definedVariables = [];
|
|
225
|
-
|
|
226
|
-
equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
|
|
227
|
-
|
|
228
|
-
const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
|
|
229
|
-
const groundedTermNode = groundedTerm.getNode(),
|
|
230
|
-
groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
|
|
231
|
-
|
|
232
|
-
if (groundedTermNodeMatches) {
|
|
233
|
-
return true;
|
|
234
|
-
}
|
|
235
|
-
}),
|
|
236
|
-
termGrounded = termMatchesGroundedTerm; ///
|
|
237
|
-
|
|
238
|
-
return termGrounded;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
isVariableDefined(variable) {
|
|
242
|
-
const context = this, ///
|
|
243
|
-
equivalences = this.getEquivalences(),
|
|
244
|
-
groundedTerms = [],
|
|
245
|
-
definedVariables = [];
|
|
246
|
-
|
|
247
|
-
equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
|
|
248
|
-
|
|
249
|
-
const variableMatchesDefinedVariable = definedVariables.some((definedVariable) => {
|
|
250
|
-
const definedVariableEqualToVariable = definedVariable.isEqualTo(variable);
|
|
251
|
-
|
|
252
|
-
if (definedVariableEqualToVariable === variable) {
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
}),
|
|
256
|
-
variableDefined = variableMatchesDefinedVariable; ///
|
|
257
|
-
|
|
258
|
-
return variableDefined;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
isMetavariableDefined(metavariable) {
|
|
262
|
-
const judgementPresent = this.isJudgementPresentByMetavariable(metavariable),
|
|
263
|
-
metavariableDefined = judgementPresent; ///
|
|
264
|
-
|
|
265
|
-
return metavariableDefined
|
|
266
|
-
}
|
|
220
|
+
findLabelByReference(reference, context) { return this.context.findLabelByReference(reference, context); }
|
|
267
221
|
|
|
268
|
-
|
|
222
|
+
findRuleByReference(reference) { return this.context.findRuleByReference(reference); }
|
|
269
223
|
|
|
270
|
-
|
|
224
|
+
findAxiomByReference(reference) { return this.context.findAxiomByReference(reference); }
|
|
271
225
|
|
|
272
|
-
|
|
226
|
+
findLemmaByReference(reference) { return this.context.findLemmaByReference(reference); }
|
|
273
227
|
|
|
274
|
-
|
|
228
|
+
findTheoremByReference(reference) { return this.context.findTheoremByReference(reference); }
|
|
275
229
|
|
|
276
|
-
|
|
277
|
-
const variable = this.findVariableByVariableName(variableName, nested),
|
|
278
|
-
variableDeclared = (variable !== null);
|
|
230
|
+
findProcedureByReference(reference) { return this.context.findProcedureByReference(reference); }
|
|
279
231
|
|
|
280
|
-
|
|
281
|
-
}
|
|
232
|
+
findConjectureByReference(reference) { return this.context.findConjectureByReference(reference); }
|
|
282
233
|
|
|
283
|
-
|
|
284
|
-
const judgement = this.findJudgementByMetavariable(metavariable),
|
|
285
|
-
judgementPresent = (judgement !== null);
|
|
234
|
+
findMetaLemmasByReference(reference) { return this.context.findMetaLemmasByReference(reference); }
|
|
286
235
|
|
|
287
|
-
|
|
288
|
-
}
|
|
236
|
+
findMetatheoremsByReference(reference) { return this.context.findMetatheoremsByReference(reference); }
|
|
289
237
|
|
|
290
238
|
findVariableByVariableName(variableName, nested = true) {
|
|
291
239
|
const variables = this.getVariables(nested),
|
|
@@ -321,49 +269,91 @@ class LocalContext {
|
|
|
321
269
|
|
|
322
270
|
findTypeByTypeName(typeName) { return this.context.findTypeByTypeName(typeName); }
|
|
323
271
|
|
|
272
|
+
findLabelByMetavariable(metavariable) { return this.context.findLabelByMetavariable(metavariable); }
|
|
273
|
+
|
|
324
274
|
findMetaTypeByMetaTypeName(metaTypeName) { return this.context.findMetaTypeByMetaTypeName(metaTypeName); }
|
|
325
275
|
|
|
326
276
|
findMetavariableByMetavariableName(metavariableName) { return this.context.findMetavariableByMetavariableName(metavariableName); }
|
|
327
277
|
|
|
328
|
-
|
|
278
|
+
isLabelPresentByReference(reference) { return this.context.isLabelPresentByReference(reference); }
|
|
329
279
|
|
|
330
|
-
|
|
280
|
+
isProcedurePresentByReference(reference) { return this.context.isProcedurePresentByReference(reference); }
|
|
331
281
|
|
|
332
|
-
|
|
282
|
+
isMetavariablePresentByReference(reference) { return this.context.isMetavariablePresentByReference(reference); }
|
|
333
283
|
|
|
334
|
-
|
|
284
|
+
findAxiomLemmaTheoremConjectureByReference(reference) { return this.context.findAxiomLemmaTheoremConjectureByReference(reference); }
|
|
335
285
|
|
|
336
|
-
|
|
286
|
+
isMetavariablePresent(metavariable, generalContext, specificContext) { return this.context.isMetavariablePresent(metavariable, generalContext, specificContext); }
|
|
337
287
|
|
|
338
|
-
|
|
288
|
+
isTypePresentByTypeName(typeName) { return this.context.isTypePresentByTypeName(typeName); }
|
|
339
289
|
|
|
340
|
-
|
|
290
|
+
isVariablePresentByVariableName(variableName, nested = true) {
|
|
291
|
+
const variable = this.findVariableByVariableName(variableName, nested),
|
|
292
|
+
variablePresent = (variable !== null);
|
|
341
293
|
|
|
342
|
-
|
|
294
|
+
return variablePresent;
|
|
295
|
+
}
|
|
343
296
|
|
|
344
|
-
|
|
297
|
+
isLabelPresentByMetavariableName(metavariableName) { return this.context.isLabelPresentByMetavariableName(metavariableName); }
|
|
345
298
|
|
|
346
|
-
|
|
299
|
+
isLabelPresentByMetavariableNode(metavariableNode) { return this.context.isLabelPresentByMetavariableNode(metavariableNode); }
|
|
347
300
|
|
|
348
|
-
|
|
301
|
+
isMetavariablePresentByMetavariableName(metavariableNode) { return this.context.isMetavariablePresentByMetavariableName(metavariableNode); }
|
|
349
302
|
|
|
350
|
-
|
|
303
|
+
isJudgementPresentByMetavariable(metavariable) {
|
|
304
|
+
const judgement = this.findJudgementByMetavariable(metavariable),
|
|
305
|
+
judgementPresent = (judgement !== null);
|
|
351
306
|
|
|
352
|
-
|
|
307
|
+
return judgementPresent;
|
|
308
|
+
}
|
|
353
309
|
|
|
354
|
-
|
|
310
|
+
isTermGrounded(term) {
|
|
311
|
+
const context = this, ///
|
|
312
|
+
equivalences = this.getEquivalences(),
|
|
313
|
+
groundedTerms = [],
|
|
314
|
+
definedVariables = [];
|
|
355
315
|
|
|
356
|
-
|
|
316
|
+
equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
|
|
357
317
|
|
|
358
|
-
|
|
318
|
+
const termMatchesGroundedTerm = groundedTerms.some((groundedTerm) => {
|
|
319
|
+
const groundedTermNode = groundedTerm.getNode(),
|
|
320
|
+
groundedTermNodeMatches = term.matchTermNode(groundedTermNode);
|
|
359
321
|
|
|
360
|
-
|
|
322
|
+
if (groundedTermNodeMatches) {
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
}),
|
|
326
|
+
termGrounded = termMatchesGroundedTerm; ///
|
|
327
|
+
|
|
328
|
+
return termGrounded;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
isVariableDefined(variable) {
|
|
332
|
+
const context = this, ///
|
|
333
|
+
equivalences = this.getEquivalences(),
|
|
334
|
+
groundedTerms = [],
|
|
335
|
+
definedVariables = [];
|
|
336
|
+
|
|
337
|
+
equivalences.separateGroundedTermsAndDefinedVariables(groundedTerms, definedVariables, context);
|
|
361
338
|
|
|
362
|
-
|
|
339
|
+
const variableMatchesDefinedVariable = definedVariables.some((definedVariable) => {
|
|
340
|
+
const definedVariableEqualToVariable = definedVariable.isEqualTo(variable);
|
|
363
341
|
|
|
364
|
-
|
|
342
|
+
if (definedVariableEqualToVariable === variable) {
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
}),
|
|
346
|
+
variableDefined = variableMatchesDefinedVariable; ///
|
|
365
347
|
|
|
366
|
-
|
|
348
|
+
return variableDefined;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
isMetavariableDefined(metavariable) {
|
|
352
|
+
const judgementPresent = this.isJudgementPresentByMetavariable(metavariable),
|
|
353
|
+
metavariableDefined = judgementPresent; ///
|
|
354
|
+
|
|
355
|
+
return metavariableDefined
|
|
356
|
+
}
|
|
367
357
|
|
|
368
358
|
nodeAsString(node, tokens = null) {
|
|
369
359
|
if (tokens === null) {
|
|
@@ -57,25 +57,9 @@ export default domAssigned(class ContainedAssertion {
|
|
|
57
57
|
|
|
58
58
|
context.trace(`Verifying the '${containedAssertionString}' contained assertion...`);
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (this.term !== null) {
|
|
65
|
-
termVerified = this.term.verify(context, () => {
|
|
66
|
-
const verifiedAhead = true;
|
|
67
|
-
|
|
68
|
-
return verifiedAhead;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (this.frame !== null) {
|
|
73
|
-
frameVerified = this.verifyFrame(this.frame, assignments, stated, context);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (this.statement !== null) {
|
|
77
|
-
statementVerified = this.verifyStatement(this.statement, assignments, stated, context);
|
|
78
|
-
}
|
|
60
|
+
const termVerified = this.verifyTerm(assignments, stated, context),
|
|
61
|
+
frameVerified = this.verifyFrame(assignments, stated, context),
|
|
62
|
+
statementVerified = this.verifyStatement(assignments, stated, context)
|
|
79
63
|
|
|
80
64
|
if (termVerified || frameVerified || statementVerified) {
|
|
81
65
|
let verifiedWhenStated = false,
|
|
@@ -99,22 +83,71 @@ export default domAssigned(class ContainedAssertion {
|
|
|
99
83
|
return verified;
|
|
100
84
|
}
|
|
101
85
|
|
|
102
|
-
|
|
103
|
-
|
|
86
|
+
verifyTerm(assignments, stated, context) {
|
|
87
|
+
let termVerified = false;
|
|
104
88
|
|
|
105
|
-
|
|
89
|
+
if (this.term !== null) {
|
|
90
|
+
const termString = this.term.getString(),
|
|
91
|
+
containedAssertionString = this.string; ///
|
|
106
92
|
|
|
107
|
-
|
|
93
|
+
context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${termString}' term...`);
|
|
94
|
+
|
|
95
|
+
termVerified = this.term.verify(context, () => {
|
|
96
|
+
const verifiedAhead = true;
|
|
97
|
+
|
|
98
|
+
return verifiedAhead;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
if (termVerified) {
|
|
102
|
+
context.trace(`...verified the '${containedAssertionString}' contained assertion's '${termString}' term.`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return termVerified;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
verifyFrame(assignments, stated, context) {
|
|
110
|
+
let frameVerified = false;
|
|
111
|
+
|
|
112
|
+
if (this.frame !== null) {
|
|
113
|
+
const frameString = this.frame.getString(),
|
|
114
|
+
containedAssertionString = this.string; ///
|
|
115
|
+
|
|
116
|
+
context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${frameString}' frame...`);
|
|
117
|
+
|
|
118
|
+
stated = true; ///
|
|
119
|
+
|
|
120
|
+
assignments = null; ///
|
|
121
|
+
|
|
122
|
+
frameVerified = this.frame.verify(assignments, stated, context);
|
|
123
|
+
|
|
124
|
+
if (frameVerified) {
|
|
125
|
+
context.trace(`...verified the '${containedAssertionString}' contained assertion's '${frameString}' frame.`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
108
128
|
|
|
109
129
|
return frameVerified;
|
|
110
130
|
}
|
|
111
131
|
|
|
112
|
-
verifyStatement(
|
|
113
|
-
|
|
132
|
+
verifyStatement(assignments, stated, context) {
|
|
133
|
+
let statementVerified = false;
|
|
134
|
+
|
|
135
|
+
if (this.statement !== null) {
|
|
136
|
+
const statementString = this.statement.getString(),
|
|
137
|
+
containedAssertionString = this.string; ///
|
|
138
|
+
|
|
139
|
+
context.trace(`Verifying the '${containedAssertionString}' contained assertion's '${statementString}' statement...`);
|
|
140
|
+
|
|
141
|
+
stated = true; ///
|
|
142
|
+
|
|
143
|
+
assignments = null; ///
|
|
114
144
|
|
|
115
|
-
|
|
145
|
+
statementVerified = this.statement.verify(assignments, stated, context);
|
|
116
146
|
|
|
117
|
-
|
|
147
|
+
if (statementVerified) {
|
|
148
|
+
context.trace(`...verified the '${containedAssertionString}' contained assertion's '${statementString}' statement.`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
118
151
|
|
|
119
152
|
return statementVerified;
|
|
120
153
|
}
|
|
@@ -52,27 +52,15 @@ export default domAssigned(class DefinedAssertion {
|
|
|
52
52
|
|
|
53
53
|
context.trace(`Verifying the '${definedAssertionString}' defined assertion...`);
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (this.term !== null) {
|
|
59
|
-
termVerified = this.term.verify(context, () => {
|
|
60
|
-
const verifiedAhead = true;
|
|
61
|
-
|
|
62
|
-
return verifiedAhead;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (this.frame!== null) {
|
|
67
|
-
frameVerified = this.verifyFrame(this.frame, assignments, stated, context);
|
|
68
|
-
}
|
|
55
|
+
const termVerified = this.verifyTerm(assignments, stated, context),
|
|
56
|
+
frameVerified = this.verifyFrame(assignments, stated, context);
|
|
69
57
|
|
|
70
58
|
if (termVerified || frameVerified) {
|
|
71
59
|
let verifiedWhenStated = false,
|
|
72
60
|
verifiedWhenDerived = false;
|
|
73
61
|
|
|
74
62
|
if (stated) {
|
|
75
|
-
verifiedWhenStated = this.verifyWhenStated(context);
|
|
63
|
+
verifiedWhenStated = this.verifyWhenStated(assignments, context);
|
|
76
64
|
} else {
|
|
77
65
|
verifiedWhenDerived = this.verifyWhenDerived(context);
|
|
78
66
|
}
|
|
@@ -89,17 +77,53 @@ export default domAssigned(class DefinedAssertion {
|
|
|
89
77
|
return verified;
|
|
90
78
|
}
|
|
91
79
|
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
verifyTerm(assignments, stated, context) {
|
|
81
|
+
let termVerified = false;
|
|
82
|
+
|
|
83
|
+
if (this.term !== null) {
|
|
84
|
+
const termString = this.term.getString(),
|
|
85
|
+
definedAssertionString = this.string; ///
|
|
86
|
+
|
|
87
|
+
context.trace(`Verifying the '${definedAssertionString}' defined assertion's '${termString}' term...`);
|
|
94
88
|
|
|
95
|
-
|
|
89
|
+
termVerified = this.term.verify(context, () => {
|
|
90
|
+
const verifiedAhead = true;
|
|
96
91
|
|
|
97
|
-
|
|
92
|
+
return verifiedAhead;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (termVerified) {
|
|
96
|
+
context.debug(`...verified the '${definedAssertionString}' defined assertion's '${termString}' term.`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return termVerified;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
verifyFrame(assignments, stated, context) {
|
|
104
|
+
let frameVerified = false;
|
|
105
|
+
|
|
106
|
+
if (this.frame !== null) {
|
|
107
|
+
const frameString = this.frame.getString(),
|
|
108
|
+
definedAssertionString = this.string; ///
|
|
109
|
+
|
|
110
|
+
context.trace(`Verifying the '${definedAssertionString}' defined assertion's '${frameString}' frame...`);
|
|
111
|
+
|
|
112
|
+
stated = true; ///
|
|
113
|
+
|
|
114
|
+
assignments = null; ///
|
|
115
|
+
|
|
116
|
+
frameVerified = this.frame.verify(assignments, stated, context);
|
|
117
|
+
|
|
118
|
+
if (frameVerified) {
|
|
119
|
+
context.debug(`...verified the '${definedAssertionString}' defined assertion's '${frameString}' frame.`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
98
122
|
|
|
99
123
|
return frameVerified;
|
|
100
124
|
}
|
|
101
125
|
|
|
102
|
-
verifyWhenStated(context) {
|
|
126
|
+
verifyWhenStated(assignments, context) {
|
|
103
127
|
let verifiedWhenStated;
|
|
104
128
|
|
|
105
129
|
const definedAssertionString = this.string; ///
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import dom from "
|
|
3
|
+
import dom from "../../dom";
|
|
4
4
|
import Combinator from "../combinator";
|
|
5
|
-
import combinatorBracketedContext from "
|
|
5
|
+
import combinatorBracketedContext from "../../context/bracketed/combinator";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { domAssigned } from "../../dom";
|
|
8
|
+
import { unifyStatementWithCombinator } from "../../utilities/unification";
|
|
8
9
|
|
|
9
|
-
export default class BracketedCombinator extends Combinator {
|
|
10
|
+
export default domAssigned(class BracketedCombinator extends Combinator {
|
|
10
11
|
unifyStatement(statement, assignments, stated, context) {
|
|
11
12
|
let statementUnified;
|
|
12
13
|
|
|
@@ -37,4 +38,4 @@ export default class BracketedCombinator extends Combinator {
|
|
|
37
38
|
|
|
38
39
|
return bracketedCombinator;
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
+
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import dom from "
|
|
4
|
-
import LocalContext from "
|
|
3
|
+
import dom from "../dom";
|
|
4
|
+
import LocalContext from "../context/local";
|
|
5
5
|
|
|
6
|
-
import { nodeQuery } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
7
|
+
import { domAssigned } from "../dom";
|
|
8
|
+
import { unifyStatementWithCombinator } from "../utilities/unification";
|
|
9
|
+
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
9
10
|
|
|
10
11
|
const statementNodeQuery = nodeQuery("/combinatorDeclaration/statement");
|
|
11
12
|
|
|
12
|
-
export default class Combinator {
|
|
13
|
+
export default domAssigned(class Combinator {
|
|
13
14
|
constructor(statement) {
|
|
14
15
|
this.statement = statement;
|
|
15
16
|
}
|
|
@@ -91,4 +92,4 @@ export default class Combinator {
|
|
|
91
92
|
|
|
92
93
|
return combinator;
|
|
93
94
|
}
|
|
94
|
-
}
|
|
95
|
+
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import dom from "
|
|
3
|
+
import dom from "../../dom";
|
|
4
4
|
import Constructor from "../constructor";
|
|
5
|
-
import constructorBracketedContext from "
|
|
5
|
+
import constructorBracketedContext from "../../context/bracketed/constructor";
|
|
6
6
|
|
|
7
|
-
import { nodeQuery } from "
|
|
7
|
+
import { nodeQuery } from "../../utilities/query";
|
|
8
|
+
import { domAssigned } from "../../dom";
|
|
8
9
|
import { stringFromTermAndType } from "../constructor";
|
|
9
10
|
|
|
10
11
|
const termNodeQuery = nodeQuery("/term/argument/term");
|
|
11
12
|
|
|
12
|
-
export default class BracketedConstructor extends Constructor {
|
|
13
|
+
export default domAssigned(class BracketedConstructor extends Constructor {
|
|
13
14
|
unifyTerm(term, context, verifyAhead) {
|
|
14
15
|
let termUnified;
|
|
15
16
|
|
|
@@ -65,4 +66,4 @@ export default class BracketedConstructor extends Constructor {
|
|
|
65
66
|
|
|
66
67
|
return bracketedConstructor;
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
});
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import dom from "
|
|
4
|
-
import LocalContext from "
|
|
3
|
+
import dom from "../dom";
|
|
4
|
+
import LocalContext from "../context/local";
|
|
5
5
|
|
|
6
|
-
import { nodeQuery } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { nodeQuery } from "../utilities/query";
|
|
7
|
+
import { domAssigned } from "../dom";
|
|
8
|
+
import { unifyTermWithConstructor } from "../utilities/unification";
|
|
9
|
+
import { termFromJSON, termToTermJSON } from "../utilities/json";
|
|
9
10
|
|
|
10
11
|
const termNodeQuery = nodeQuery("/constructorDeclaration/term"),
|
|
11
12
|
typeNodeQuery = nodeQuery("/constructorDeclaration/type");
|
|
12
13
|
|
|
13
|
-
export default class Constructor {
|
|
14
|
+
export default domAssigned(class Constructor {
|
|
14
15
|
constructor(string, term) {
|
|
15
16
|
this.string = string;
|
|
16
17
|
this.term = term;
|
|
@@ -108,7 +109,7 @@ export default class Constructor {
|
|
|
108
109
|
|
|
109
110
|
return constructor;
|
|
110
111
|
}
|
|
111
|
-
}
|
|
112
|
+
});
|
|
112
113
|
|
|
113
114
|
export function stringFromTermAndType(term, type) {
|
|
114
115
|
let string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import Combinator from "../../combinator";
|
|
4
|
-
|
|
5
3
|
import { domAssigned } from "../../dom";
|
|
6
4
|
|
|
7
5
|
export default domAssigned(class CombinatorDeclaration {
|
|
@@ -45,7 +43,8 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
45
43
|
static name = "CombinatorDeclaration";
|
|
46
44
|
|
|
47
45
|
static fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext) {
|
|
48
|
-
const
|
|
46
|
+
const { Combinator } = dom,
|
|
47
|
+
combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext),
|
|
49
48
|
combinatorDeclaration = new CombinatorDeclaration(fileContext, combinator);
|
|
50
49
|
|
|
51
50
|
return combinatorDeclaration;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import dom from "../../dom";
|
|
4
4
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
6
|
|
|
@@ -45,7 +45,8 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
45
45
|
static name = "ConstructorDeclaration";
|
|
46
46
|
|
|
47
47
|
static fromConstructorDeclarationNode(constructorDeclarationNode, fileContext) {
|
|
48
|
-
const
|
|
48
|
+
const { Constructor } = dom,
|
|
49
|
+
constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
|
|
49
50
|
constructorDeclaration = new ConstructorDeclaration(fileContext, constructor);
|
|
50
51
|
|
|
51
52
|
return constructorDeclaration;
|