occam-verify-cli 1.0.420 → 1.0.427
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/action/verify.js +7 -3
- package/lib/context/file.js +8 -44
- package/lib/context/local.js +8 -26
- package/lib/context/nominal.js +64 -0
- package/lib/context/release.js +2 -2
- package/lib/context/temporary.js +6 -58
- package/lib/element/assertion/contained.js +303 -0
- package/lib/element/assertion/defined.js +318 -0
- package/lib/element/assertion/property.js +299 -0
- package/lib/element/assertion/satisfies.js +264 -0
- package/lib/element/assertion/subproof.js +178 -0
- package/lib/element/assertion/type.js +294 -0
- package/lib/{ontology → element}/assertion.js +9 -9
- package/lib/element/assumption.js +365 -0
- package/lib/element/axiom.js +332 -0
- package/lib/element/axiomLemmaTheoremConjecture.js +346 -0
- package/lib/element/conclusion.js +151 -0
- package/lib/{ontology → element}/conjecture.js +7 -14
- package/lib/element/declaration/combinator.js +161 -0
- package/lib/element/declaration/complexType.js +343 -0
- package/lib/element/declaration/constructor.js +193 -0
- package/lib/element/declaration/metavariable.js +193 -0
- package/lib/element/declaration/simpleType.js +240 -0
- package/lib/element/declaration/typePrefix.js +179 -0
- package/lib/element/declaration/variable.js +196 -0
- package/lib/{ontology → element}/declaration.js +9 -9
- package/lib/element/deduction.js +207 -0
- package/lib/element/derivation.js +96 -0
- package/lib/element/equality.js +275 -0
- package/lib/element/equivalence.js +316 -0
- package/lib/element/equivalences.js +264 -0
- package/lib/{ontology → element}/error.js +12 -12
- package/lib/element/frame.js +387 -0
- package/lib/element/hypothesis.js +195 -0
- package/lib/element/judgement.js +243 -0
- package/lib/element/label.js +198 -0
- package/lib/{ontology → element}/lemma.js +7 -7
- package/lib/{ontology → element}/metaLemma.js +8 -8
- package/lib/element/metaLemmaMetatheorem.js +234 -0
- package/lib/{ontology → element}/metaType.js +18 -11
- package/lib/{ontology → element}/metatheorem.js +8 -8
- package/lib/element/metavariable.js +459 -0
- package/lib/element/parameter.js +108 -0
- package/lib/element/premise.js +310 -0
- package/lib/element/procedureCall.js +243 -0
- package/lib/{ontology → element}/procedureReference.js +3 -3
- package/lib/{ontology → element}/proof.js +4 -4
- package/lib/element/property.js +128 -0
- package/lib/element/propertyRelation.js +195 -0
- package/lib/element/reference.js +304 -0
- package/lib/element/rule.js +373 -0
- package/lib/element/section.js +255 -0
- package/lib/element/signature.js +217 -0
- package/lib/element/statement/combinator/bracketed.js +166 -0
- package/lib/element/statement/combinator.js +105 -0
- package/lib/element/statement.js +386 -0
- package/lib/element/step.js +274 -0
- package/lib/element/subDerivation.js +137 -0
- package/lib/element/subproof.js +240 -0
- package/lib/element/substitution/frame.js +216 -0
- package/lib/{ontology → element}/substitution/reference.js +5 -4
- package/lib/{ontology → element}/substitution/statement.js +7 -6
- package/lib/element/substitution/term.js +265 -0
- package/lib/element/substitution.js +206 -0
- package/lib/element/substitutions.js +425 -0
- package/lib/element/supposition.js +323 -0
- package/lib/{ontology → element/term}/constructor/bracketed.js +11 -7
- package/lib/element/term/constructor.js +172 -0
- package/lib/element/term.js +322 -0
- package/lib/{ontology → element}/theorem.js +8 -8
- package/lib/element/type.js +490 -0
- package/lib/element/typePrefix.js +99 -0
- package/lib/element/variable.js +345 -0
- package/lib/elements.js +27 -0
- package/lib/mixins/statement/verify.js +14 -14
- package/lib/mixins/step/unify.js +12 -12
- package/lib/mixins/term/verify.js +4 -4
- package/lib/node/substitution/frame.js +15 -1
- package/lib/node/substitution/statement.js +37 -1
- package/lib/node/substitution/term.js +15 -1
- package/lib/preamble.js +63 -63
- package/lib/process/assign.js +58 -0
- package/lib/process/instantiate.js +68 -7
- package/lib/process/unify.js +26 -26
- package/lib/process/verify.js +21 -21
- package/lib/utilities/brackets.js +9 -18
- package/lib/utilities/customGrammar.js +1 -1
- package/lib/utilities/element.js +1128 -0
- package/lib/utilities/json.js +32 -32
- package/lib/utilities/node.js +49 -61
- package/lib/utilities/statement.js +83 -0
- package/lib/utilities/string.js +98 -56
- package/package.json +10 -10
- package/src/action/verify.js +8 -1
- package/src/context/file.js +9 -39
- package/src/context/local.js +5 -11
- package/src/context/nominal.js +30 -0
- package/src/context/release.js +1 -1
- package/src/context/temporary.js +6 -63
- package/src/{ontology → element}/assertion/contained.js +4 -25
- package/src/{ontology → element}/assertion/defined.js +7 -26
- package/src/{ontology → element}/assertion/property.js +7 -26
- package/src/{ontology → element}/assertion/satisfies.js +5 -53
- package/src/{ontology → element}/assertion/subproof.js +3 -32
- package/src/{ontology → element}/assertion/type.js +7 -26
- package/src/{ontology → element}/assertion.js +6 -6
- package/src/{ontology → element}/assumption.js +3 -27
- package/src/{ontology → element}/axiom.js +4 -11
- package/src/{ontology/topLevelAssertion.js → element/axiomLemmaTheoremConjecture.js} +9 -105
- package/src/{ontology → element}/conclusion.js +4 -19
- package/src/{ontology → element}/conjecture.js +4 -11
- package/src/{ontology → element}/declaration/combinator.js +3 -14
- package/src/{ontology → element}/declaration/complexType.js +3 -19
- package/src/{ontology → element}/declaration/constructor.js +3 -14
- package/src/{ontology → element}/declaration/metavariable.js +3 -39
- package/src/{ontology → element}/declaration/simpleType.js +3 -19
- package/src/{ontology → element}/declaration/typePrefix.js +3 -15
- package/src/{ontology → element}/declaration/variable.js +3 -14
- package/src/{ontology → element}/declaration.js +6 -6
- package/src/{ontology → element}/deduction.js +9 -22
- package/src/{ontology → element}/derivation.js +2 -32
- package/src/{ontology → element}/equality.js +18 -42
- package/src/{ontology → element}/equivalence.js +17 -2
- package/src/{ontology → element}/equivalences.js +1 -1
- package/src/{ontology → element}/error.js +8 -8
- package/src/{ontology → element}/frame.js +8 -56
- package/src/{ontology → element}/hypothesis.js +5 -5
- package/src/{ontology → element}/judgement.js +7 -7
- package/src/{ontology → element}/label.js +3 -3
- package/src/{ontology → element}/lemma.js +4 -4
- package/src/{ontology → element}/metaLemma.js +5 -5
- package/src/{ontology/topLevelMetaAssertion.js → element/metaLemmaMetatheorem.js} +11 -11
- package/src/{ontology → element}/metaType.js +11 -7
- package/src/{ontology → element}/metatheorem.js +5 -5
- package/src/{ontology → element}/metavariable.js +10 -60
- package/src/{ontology → element}/parameter.js +1 -1
- package/src/{ontology → element}/premise.js +14 -14
- package/src/{ontology → element}/procedureCall.js +4 -4
- package/src/{ontology → element}/procedureReference.js +1 -1
- package/src/{ontology → element}/proof.js +3 -3
- package/src/{ontology → element}/property.js +7 -15
- package/src/{ontology → element}/propertyRelation.js +5 -11
- package/src/{ontology → element}/reference.js +5 -19
- package/src/{ontology → element}/rule.js +13 -13
- package/src/{ontology → element}/section.js +10 -10
- package/src/{ontology → element}/signature.js +12 -15
- package/src/element/statement/combinator/bracketed.js +38 -0
- package/src/element/statement/combinator.js +59 -0
- package/src/{ontology → element}/statement.js +11 -27
- package/src/{ontology → element}/step.js +10 -44
- package/src/{ontology → element}/subDerivation.js +3 -24
- package/src/{ontology → element}/subproof.js +3 -43
- package/src/{ontology → element}/substitution/frame.js +4 -21
- package/src/{ontology → element}/substitution/reference.js +3 -3
- package/src/{ontology → element}/substitution/statement.js +6 -10
- package/src/{ontology → element}/substitution/term.js +7 -23
- package/src/{ontology → element}/substitutions.js +1 -1
- package/src/{ontology → element}/supposition.js +10 -10
- package/src/{ontology → element/term}/constructor/bracketed.js +12 -13
- package/src/element/term/constructor.js +82 -0
- package/src/{ontology → element}/term.js +6 -38
- package/src/{ontology → element}/theorem.js +5 -5
- package/src/{ontology → element}/type.js +17 -64
- package/src/{ontology → element}/typePrefix.js +8 -12
- package/src/{ontology → element}/variable.js +9 -20
- package/src/elements.js +13 -0
- package/src/mixins/statement/verify.js +4 -4
- package/src/mixins/step/unify.js +6 -6
- package/src/mixins/term/verify.js +3 -3
- package/src/node/substitution/frame.js +14 -0
- package/src/node/substitution/statement.js +40 -0
- package/src/node/substitution/term.js +15 -0
- package/src/preamble.js +62 -62
- package/src/process/assign.js +59 -0
- package/src/process/instantiate.js +67 -15
- package/src/process/unify.js +37 -39
- package/src/process/verify.js +20 -20
- package/src/utilities/brackets.js +12 -17
- package/src/utilities/customGrammar.js +3 -3
- package/src/utilities/element.js +1380 -0
- package/src/utilities/json.js +31 -31
- package/src/utilities/node.js +56 -64
- package/src/utilities/{context.js → statement.js} +10 -39
- package/src/utilities/string.js +120 -52
- package/lib/assignment/equality.js +0 -62
- package/lib/assignment/judgement.js +0 -62
- package/lib/assignment/variable.js +0 -64
- package/lib/context/bracketed/combinator.js +0 -121
- package/lib/context/bracketed/constructor.js +0 -121
- package/lib/context/bracketted.js +0 -86
- package/lib/context/partial/metavariable.js +0 -180
- package/lib/context/partial/statement.js +0 -180
- package/lib/context/partial/term.js +0 -192
- package/lib/context/partial/variable.js +0 -192
- package/lib/context/partial.js +0 -93
- package/lib/ontology/assertion/contained.js +0 -357
- package/lib/ontology/assertion/defined.js +0 -331
- package/lib/ontology/assertion/property.js +0 -313
- package/lib/ontology/assertion/satisfies.js +0 -302
- package/lib/ontology/assertion/subproof.js +0 -240
- package/lib/ontology/assertion/type.js +0 -308
- package/lib/ontology/assumption.js +0 -383
- package/lib/ontology/axiom.js +0 -339
- package/lib/ontology/combinator/bracketed.js +0 -202
- package/lib/ontology/combinator.js +0 -155
- package/lib/ontology/conclusion.js +0 -201
- package/lib/ontology/constructor.js +0 -185
- package/lib/ontology/declaration/combinator.js +0 -210
- package/lib/ontology/declaration/complexType.js +0 -393
- package/lib/ontology/declaration/constructor.js +0 -242
- package/lib/ontology/declaration/metavariable.js +0 -257
- package/lib/ontology/declaration/simpleType.js +0 -290
- package/lib/ontology/declaration/typePrefix.js +0 -228
- package/lib/ontology/declaration/variable.js +0 -245
- package/lib/ontology/deduction.js +0 -215
- package/lib/ontology/derivation.js +0 -155
- package/lib/ontology/equality.js +0 -288
- package/lib/ontology/equivalence.js +0 -295
- package/lib/ontology/equivalences.js +0 -264
- package/lib/ontology/frame.js +0 -419
- package/lib/ontology/hypothesis.js +0 -190
- package/lib/ontology/judgement.js +0 -248
- package/lib/ontology/label.js +0 -198
- package/lib/ontology/metavariable.js +0 -502
- package/lib/ontology/parameter.js +0 -108
- package/lib/ontology/premise.js +0 -310
- package/lib/ontology/procedureCall.js +0 -243
- package/lib/ontology/property.js +0 -166
- package/lib/ontology/propertyRelation.js +0 -202
- package/lib/ontology/reference.js +0 -315
- package/lib/ontology/rule.js +0 -373
- package/lib/ontology/section.js +0 -255
- package/lib/ontology/signature.js +0 -217
- package/lib/ontology/statement.js +0 -398
- package/lib/ontology/step.js +0 -295
- package/lib/ontology/subDerivation.js +0 -147
- package/lib/ontology/subproof.js +0 -265
- package/lib/ontology/substitution/frame.js +0 -261
- package/lib/ontology/substitution/term.js +0 -269
- package/lib/ontology/substitution.js +0 -206
- package/lib/ontology/substitutions.js +0 -425
- package/lib/ontology/supposition.js +0 -323
- package/lib/ontology/term.js +0 -351
- package/lib/ontology/topLevelAssertion.js +0 -431
- package/lib/ontology/topLevelMetaAssertion.js +0 -234
- package/lib/ontology/type.js +0 -556
- package/lib/ontology/typePrefix.js +0 -99
- package/lib/ontology/variable.js +0 -343
- package/lib/ontology.js +0 -27
- package/lib/utilities/assignments.js +0 -19
- package/lib/utilities/context.js +0 -101
- package/lib/utilities/subproof.js +0 -42
- package/lib/utilities/type.js +0 -40
- package/src/assignment/equality.js +0 -29
- package/src/assignment/judgement.js +0 -29
- package/src/assignment/variable.js +0 -34
- package/src/context/bracketed/combinator.js +0 -31
- package/src/context/bracketed/constructor.js +0 -31
- package/src/context/bracketted.js +0 -41
- package/src/context/partial/metavariable.js +0 -39
- package/src/context/partial/statement.js +0 -39
- package/src/context/partial/term.js +0 -49
- package/src/context/partial/variable.js +0 -49
- package/src/context/partial.js +0 -71
- package/src/ontology/combinator/bracketed.js +0 -38
- package/src/ontology/combinator.js +0 -72
- package/src/ontology/constructor.js +0 -105
- package/src/ontology.js +0 -13
- package/src/utilities/assignments.js +0 -11
- package/src/utilities/subproof.js +0 -56
- package/src/utilities/type.js +0 -35
- /package/src/{ontology → element}/substitution.js +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import elements from "../../elements";
|
|
4
|
+
|
|
5
|
+
import { define } from "../../elements";
|
|
6
|
+
import { unifyTermWithConstructorTerm } from "../../process/unify";
|
|
7
|
+
import { termFromJSON, termToTermJSON } from "../../utilities/json";
|
|
8
|
+
|
|
9
|
+
export default define(class ConstructorTerm {
|
|
10
|
+
constructor(term) {
|
|
11
|
+
this.term = term;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getTerm() {
|
|
15
|
+
return this.term;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
getType() { return this.term.getType(); }
|
|
19
|
+
|
|
20
|
+
getString() { return this.term.getString(); }
|
|
21
|
+
|
|
22
|
+
isProvisional() { return this.term.isProvisional(); }
|
|
23
|
+
|
|
24
|
+
setType(type) { this.term.setType(type); }
|
|
25
|
+
|
|
26
|
+
unifyTerm(term, context, verifyAhead) {
|
|
27
|
+
let termUnifies = false;
|
|
28
|
+
|
|
29
|
+
const termString = term.getString(),
|
|
30
|
+
constructorTermString = this.getString();
|
|
31
|
+
|
|
32
|
+
context.trace(`Unifying the '${termString}' term with the '${constructorTermString}' constructor's term...`);
|
|
33
|
+
|
|
34
|
+
const constructorTerm = this, ///
|
|
35
|
+
termUnifiesWithConstructor = unifyTermWithConstructorTerm(term, constructorTerm, context);
|
|
36
|
+
|
|
37
|
+
if (termUnifiesWithConstructor) {
|
|
38
|
+
let verifiesAhead;
|
|
39
|
+
|
|
40
|
+
const type = this.getType();
|
|
41
|
+
|
|
42
|
+
term.setType(type);
|
|
43
|
+
|
|
44
|
+
verifiesAhead = verifyAhead();
|
|
45
|
+
|
|
46
|
+
termUnifies = verifiesAhead; ///
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (termUnifies) {
|
|
50
|
+
context.debug(`...unified the '${termString}' term with the '${constructorTermString}' constructor's term.`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return termUnifies;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
toJSON() {
|
|
57
|
+
const termJSON = termToTermJSON(this.term),
|
|
58
|
+
term = termJSON, ///
|
|
59
|
+
json = {
|
|
60
|
+
term
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static name = "ConstructorTerm";
|
|
67
|
+
|
|
68
|
+
static fromJSON(json, context) {
|
|
69
|
+
const term = termFromJSON(json, context),
|
|
70
|
+
constructor = new ConstructorTerm(term);
|
|
71
|
+
|
|
72
|
+
return constructor;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
76
|
+
const { Term } = elements,
|
|
77
|
+
term = Term.fromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
78
|
+
constructor = new ConstructorTerm(term);
|
|
79
|
+
|
|
80
|
+
return constructor;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import elements from "../elements";
|
|
6
6
|
import verifyMixins from "../mixins/term/verify";
|
|
7
7
|
|
|
8
|
-
import { define } from "../
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { define } from "../elements";
|
|
9
|
+
import { instantiateTerm } from "../process/instantiate";
|
|
10
|
+
import { termFromTermNode } from "../utilities/node.old";
|
|
11
11
|
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
12
12
|
|
|
13
13
|
const { filter, compress } = arrayUtilities;
|
|
@@ -177,8 +177,7 @@ export default define(class Term {
|
|
|
177
177
|
|
|
178
178
|
static fromJSON(json, context) {
|
|
179
179
|
const { string } = json,
|
|
180
|
-
|
|
181
|
-
termNode = termNodeFromTermString(termString, context),
|
|
180
|
+
termNode = instantiateTerm(string, context),
|
|
182
181
|
node = termNode, ///
|
|
183
182
|
type = typeFromJSON(json, context),
|
|
184
183
|
term = new Term(string, node, type);
|
|
@@ -200,18 +199,6 @@ export default define(class Term {
|
|
|
200
199
|
return term;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
|
-
static fromTypeAssertionNode(typeAssertionNode, context) {
|
|
204
|
-
let term = null;
|
|
205
|
-
|
|
206
|
-
const termNode = typeAssertionNode.getTermNode();
|
|
207
|
-
|
|
208
|
-
if (termNode !== null) {
|
|
209
|
-
term = termFromTermNode(termNode, context);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return term;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
202
|
static fromDefinedAssertionNode(definedAssertionNode, context) {
|
|
216
203
|
let term = null;
|
|
217
204
|
|
|
@@ -231,27 +218,8 @@ export default define(class Term {
|
|
|
231
218
|
return term;
|
|
232
219
|
}
|
|
233
220
|
|
|
234
|
-
static fromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
235
|
-
const termNode = propertyAssertionNode.getTermNode(),
|
|
236
|
-
term = termFromTermNode(termNode, context);
|
|
237
|
-
|
|
238
|
-
return term;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
static fromContainedAssertionNode(containedAssertionNode, context) {
|
|
242
|
-
let term = null;
|
|
243
|
-
|
|
244
|
-
const termNode = containedAssertionNode.getTermNode();
|
|
245
|
-
|
|
246
|
-
if (termNode !== null) {
|
|
247
|
-
term = termFromTermNode(termNode, context);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return term;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
221
|
static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
254
|
-
const { Type } =
|
|
222
|
+
const { Type } = elements,
|
|
255
223
|
termNode = constructorDeclarationNode.getTermNode(),
|
|
256
224
|
term = termFromTermNode(termNode, context),
|
|
257
225
|
type = Type.fromConstructorDeclarationNode(constructorDeclarationNode, context);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
|
|
4
4
|
|
|
5
|
-
import { define } from "../
|
|
5
|
+
import { define } from "../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Theorem extends
|
|
7
|
+
export default define(class Theorem extends AxiomLemmaTheoremConjecture {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -29,11 +29,11 @@ export default define(class Theorem extends TopLevelAssertion {
|
|
|
29
29
|
|
|
30
30
|
static name = "Theorem";
|
|
31
31
|
|
|
32
|
-
static fromJSON(json, context) { return
|
|
32
|
+
static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Theorem, json, context); }
|
|
33
33
|
|
|
34
34
|
static fromTheoremNode(theoremNode, context) {
|
|
35
35
|
const node = theoremNode, ///
|
|
36
|
-
theorem =
|
|
36
|
+
theorem = AxiomLemmaTheoremConjecture.fromNode(Theorem, node, context);
|
|
37
37
|
|
|
38
38
|
return theorem;
|
|
39
39
|
}
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import { define } from "../ontology";
|
|
5
|
+
import { define } from "../elements";
|
|
8
6
|
import { BASE_TYPE_SYMBOL } from "../constants";
|
|
9
|
-
import { typeFromTypeNode } from "../utilities/node";
|
|
10
|
-
import {
|
|
7
|
+
import { typeFromTypeNode } from "../utilities/node.old";
|
|
8
|
+
import { typeStringFromTypeNameTypePrefixNameAndSuperTypes } from "../utilities/string";
|
|
11
9
|
import { superTypesFromJSON, propertiesFromJSON, superTypesToSuperTypesJSON, propertiesToPropertiesJSON } from "../utilities/json";
|
|
12
10
|
|
|
13
11
|
const { push, first } = arrayUtilities;
|
|
14
12
|
|
|
15
13
|
class Type {
|
|
16
|
-
constructor(string, name, prefixName, superTypes, properties, provisional) {
|
|
14
|
+
constructor(string, node, name, prefixName, superTypes, properties, provisional) {
|
|
17
15
|
this.string = string;
|
|
16
|
+
this.node = node;
|
|
18
17
|
this.name = name;
|
|
19
18
|
this.prefixName = prefixName;
|
|
20
19
|
this.superTypes = superTypes;
|
|
@@ -26,6 +25,10 @@ class Type {
|
|
|
26
25
|
return this.string;
|
|
27
26
|
}
|
|
28
27
|
|
|
28
|
+
getNode() {
|
|
29
|
+
return this.node;
|
|
30
|
+
}
|
|
31
|
+
|
|
29
32
|
getName() {
|
|
30
33
|
return this.name;
|
|
31
34
|
}
|
|
@@ -306,8 +309,8 @@ class Type {
|
|
|
306
309
|
superTypes = superTypesFromJSON(json, context),
|
|
307
310
|
typeName = name, ///
|
|
308
311
|
typePrefixName = null,
|
|
309
|
-
string =
|
|
310
|
-
type = new Type(string, name, prefixName, superTypes, properties, provisional);
|
|
312
|
+
string = typeStringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
313
|
+
type = new Type(string, node, name, prefixName, superTypes, properties, provisional);
|
|
311
314
|
|
|
312
315
|
return type;
|
|
313
316
|
}
|
|
@@ -327,13 +330,6 @@ class Type {
|
|
|
327
330
|
return type;
|
|
328
331
|
}
|
|
329
332
|
|
|
330
|
-
static fromTypeAssertionNode(typeAssertionNode, context) {
|
|
331
|
-
const typeNode = typeAssertionNode.getTypeNode(),
|
|
332
|
-
type = typeFromTypeNode(typeNode, context);
|
|
333
|
-
|
|
334
|
-
return type;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
333
|
static fromTypeAndProvisional(type, provisional) {
|
|
338
334
|
const name = type.getName(),
|
|
339
335
|
prefixName = type.getPrefixName(),
|
|
@@ -343,10 +339,10 @@ class Type {
|
|
|
343
339
|
superTypes = [
|
|
344
340
|
superType
|
|
345
341
|
],
|
|
346
|
-
string =
|
|
342
|
+
string = typeStringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
347
343
|
properties = type.getProperties();
|
|
348
344
|
|
|
349
|
-
type = new Type(string, name, prefixName, superTypes, properties, provisional); ///
|
|
345
|
+
type = new Type(string, node, name, prefixName, superTypes, properties, provisional); ///
|
|
350
346
|
|
|
351
347
|
return type;
|
|
352
348
|
}
|
|
@@ -366,22 +362,8 @@ class Type {
|
|
|
366
362
|
name = typeName, ///
|
|
367
363
|
prefixName = typePrefixName, ///
|
|
368
364
|
properties = [],
|
|
369
|
-
string =
|
|
370
|
-
type = new Type(string, name, prefixName, superTypes, properties, provisional);
|
|
371
|
-
|
|
372
|
-
return type;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
376
|
-
const typeName = complexTypeDeclarationNode.getTypeName(),
|
|
377
|
-
provisional = complexTypeDeclarationNode.isProvisional(),
|
|
378
|
-
typePrefixName = complexTypeDeclarationNode.getTypePrefixName(),
|
|
379
|
-
superTypes = superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
380
|
-
name = typeName, ///
|
|
381
|
-
prefixName = typePrefixName, ///
|
|
382
|
-
properties = propertiesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
383
|
-
string = stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
384
|
-
type = new Type(string, name, prefixName, superTypes, properties, provisional);
|
|
365
|
+
string = typeStringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
366
|
+
type = new Type(string, node, name, prefixName, superTypes, properties, provisional);
|
|
385
367
|
|
|
386
368
|
return type;
|
|
387
369
|
}
|
|
@@ -425,45 +407,16 @@ function superTypesFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, cont
|
|
|
425
407
|
return superTypes;
|
|
426
408
|
}
|
|
427
409
|
|
|
428
|
-
function superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
429
|
-
const superTypeNodes = complexTypeDeclarationNode.getSuperTypeNodes(),
|
|
430
|
-
superTypes = superTypeNodes.map((superTypeNode) => {
|
|
431
|
-
const superType = Type.fromSuperTypeNode(superTypeNode, context);
|
|
432
|
-
|
|
433
|
-
return superType;
|
|
434
|
-
}),
|
|
435
|
-
superTypesLength = superTypes.length;
|
|
436
|
-
|
|
437
|
-
if (superTypesLength === 0) {
|
|
438
|
-
const superType = baseType; ///
|
|
439
|
-
|
|
440
|
-
superTypes.push(superType);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return superTypes;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
function propertiesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
447
|
-
const { Property } = ontology,
|
|
448
|
-
propertyDeclarationNodes = complexTypeDeclarationNode.getPropertyDeclarationNodes(),
|
|
449
|
-
properties = propertyDeclarationNodes.map((propertyDeclarationNode) => {
|
|
450
|
-
const property = Property.fromPropertyDeclarationNode(propertyDeclarationNode, context);
|
|
451
|
-
|
|
452
|
-
return property;
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
return properties;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
410
|
class BaseType extends Type {
|
|
459
411
|
static fromNothing() {
|
|
460
412
|
const name = BASE_TYPE_SYMBOL, ///
|
|
461
413
|
string = name, ///
|
|
414
|
+
node = null,
|
|
462
415
|
prefixName = null,
|
|
463
416
|
superTypes = [],
|
|
464
417
|
properties = [],
|
|
465
418
|
provisional = false,
|
|
466
|
-
baseType = new BaseType(string, name, prefixName, superTypes, properties, provisional);
|
|
419
|
+
baseType = new BaseType(string, node, name, prefixName, superTypes, properties, provisional);
|
|
467
420
|
|
|
468
421
|
return baseType;
|
|
469
422
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { define } from "../
|
|
3
|
+
import { define } from "../elements";
|
|
4
4
|
|
|
5
|
-
export default define
|
|
6
|
-
constructor(string, name) {
|
|
5
|
+
export default define(class TypePrefix {
|
|
6
|
+
constructor(string, node, name) {
|
|
7
7
|
this.string = string;
|
|
8
|
+
this.node = node;
|
|
8
9
|
this.name = name;
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -12,6 +13,10 @@ export default define (class TypePrefix {
|
|
|
12
13
|
return this.string;
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
getNode() {
|
|
17
|
+
return this.node;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
getName() {
|
|
16
21
|
return this.name;
|
|
17
22
|
}
|
|
@@ -40,13 +45,4 @@ export default define (class TypePrefix {
|
|
|
40
45
|
|
|
41
46
|
return typePrefix;
|
|
42
47
|
}
|
|
43
|
-
|
|
44
|
-
static fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
|
|
45
|
-
const typePrefix = typePrefixDeclarationNode.getTypePrefix(),
|
|
46
|
-
name = typePrefix, ///
|
|
47
|
-
string = name, ///
|
|
48
|
-
type = new TypePrefix(string, name);
|
|
49
|
-
|
|
50
|
-
return type;
|
|
51
|
-
}
|
|
52
48
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../elements";
|
|
4
4
|
|
|
5
|
-
import { define } from "../
|
|
5
|
+
import { define } from "../elements";
|
|
6
6
|
import { EMPTY_STRING } from "../constants";
|
|
7
|
-
import { typeFromTypeNode } from "../utilities/node";
|
|
7
|
+
import { typeFromTypeNode } from "../utilities/node.old";
|
|
8
|
+
import { instantiateVariable } from "../process/instantiate";
|
|
8
9
|
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
9
|
-
import { variableNodeFromVariableString } from "../context/partial/variable";
|
|
10
10
|
|
|
11
11
|
export default define(class Variable {
|
|
12
12
|
constructor(string, node, type, identifier, propertyRelations) {
|
|
@@ -41,6 +41,8 @@ export default define(class Variable {
|
|
|
41
41
|
this.type = type;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
getTypeString() { return this.type.getString(); }
|
|
45
|
+
|
|
44
46
|
isEqualTo(variable) {
|
|
45
47
|
const variableNode = variable.getNode(),
|
|
46
48
|
matches = this.node.match(variableNode),
|
|
@@ -156,7 +158,7 @@ export default define(class Variable {
|
|
|
156
158
|
termTypeEqualToOrSubTypeOfVariableType = termType.isEqualToOrSubTypeOf(variableType);
|
|
157
159
|
|
|
158
160
|
if (termTypeEqualToOrSubTypeOfVariableType) {
|
|
159
|
-
const { TermSubstitution } =
|
|
161
|
+
const { TermSubstitution } = elements,
|
|
160
162
|
termSubstitution = TermSubstitution.fromTernAndVariable(term, variable, context),
|
|
161
163
|
substitution = termSubstitution; ///
|
|
162
164
|
|
|
@@ -189,8 +191,7 @@ export default define(class Variable {
|
|
|
189
191
|
|
|
190
192
|
static fromJSON(json, context) {
|
|
191
193
|
const { string } = json,
|
|
192
|
-
|
|
193
|
-
variableNode = variableNodeFromVariableString(variableString, context),
|
|
194
|
+
variableNode = instantiateVariable(string, context),
|
|
194
195
|
variableIdentifier = variableNode.getVariableIdentifier(),
|
|
195
196
|
node = variableNode,
|
|
196
197
|
identifier = variableIdentifier, ///
|
|
@@ -235,7 +236,7 @@ export default define(class Variable {
|
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
static fromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
238
|
-
const { Variable } =
|
|
239
|
+
const { Variable } = elements,
|
|
239
240
|
provisional = variableDeclarationNode.isProvisional(),
|
|
240
241
|
typeNode = variableDeclarationNode.getTypeNode(),
|
|
241
242
|
type = typeFromTypeNode(typeNode, context);
|
|
@@ -275,18 +276,6 @@ export default define(class Variable {
|
|
|
275
276
|
}
|
|
276
277
|
});
|
|
277
278
|
|
|
278
|
-
function variableFromVariableNodeAndType(variableNode, type) {
|
|
279
|
-
const { Variable } = ontology,
|
|
280
|
-
node = variableNode, ///
|
|
281
|
-
variableIdentifier = variableNode.getVariableIdentifier(),
|
|
282
|
-
string = variableIdentifier, ///,
|
|
283
|
-
identifier = variableIdentifier, ///
|
|
284
|
-
propertyRelations = [],
|
|
285
|
-
variable = new Variable(string, node, type, identifier, propertyRelations);
|
|
286
|
-
|
|
287
|
-
return variable;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
279
|
function stringFromNameAndPropertyRelations(identifier, propertyRelations) {
|
|
291
280
|
const propertyRelationsString = propertyRelations.reduce((propertyRelationsString, propertyRelation) => {
|
|
292
281
|
const propertyRelationString = propertyRelation.getString();
|
package/src/elements.js
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
|
|
5
5
|
import { equalityFromStatement,
|
|
6
6
|
judgementFromStatement,
|
|
@@ -10,7 +10,7 @@ import { equalityFromStatement,
|
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
11
|
subproofAssertionFromStatement,
|
|
12
12
|
containedAssertionFromStatement,
|
|
13
|
-
satisfiesAssertionFromStatement } from "../../utilities/
|
|
13
|
+
satisfiesAssertionFromStatement } from "../../utilities/statement";
|
|
14
14
|
|
|
15
15
|
function verifyAsMetavariableAndSubstitution(statement, assignments, stated, context) {
|
|
16
16
|
let verifiesAsMetavariableAndSubstitution = false;
|
|
@@ -25,7 +25,7 @@ function verifyAsMetavariableAndSubstitution(statement, assignments, stated, con
|
|
|
25
25
|
const metavariableVerifies = metavariable.verify(context);
|
|
26
26
|
|
|
27
27
|
if (metavariableVerifies) {
|
|
28
|
-
const { TermSubstitution, FrameSubstitution } =
|
|
28
|
+
const { TermSubstitution, FrameSubstitution } = elements,
|
|
29
29
|
frameSubstitution = FrameSubstitution.fromStatement(statement, context),
|
|
30
30
|
termSubstitution = TermSubstitution.fromStatement(statement, context),
|
|
31
31
|
substitution = (termSubstitution || frameSubstitution);
|
|
@@ -54,7 +54,7 @@ function unifyWithBracketedCombinator(statement, assignments, stated, context) {
|
|
|
54
54
|
|
|
55
55
|
assignments = null; ///
|
|
56
56
|
|
|
57
|
-
const { BracketedCombinator } =
|
|
57
|
+
const { BracketedCombinator } = elements,
|
|
58
58
|
bracketedCombinator = BracketedCombinator.fromNothing(),
|
|
59
59
|
unifiesWithBracketedCombinator = bracketedCombinator.unifyStatement(statement, assignments, stated, context);
|
|
60
60
|
|
package/src/mixins/step/unify.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import elements from "../../elements";
|
|
6
6
|
|
|
7
7
|
import { equalityFromStatement,
|
|
8
8
|
judgementFromStatement,
|
|
9
9
|
typeAssertionFromStatement,
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
|
-
satisfiesAssertionFromStatement } from "../../utilities/
|
|
11
|
+
satisfiesAssertionFromStatement } from "../../utilities/statement";
|
|
12
12
|
|
|
13
13
|
const { backwardsSome } = arrayUtilities;
|
|
14
14
|
|
|
@@ -52,7 +52,7 @@ function unifyWithReference(statement, reference, satisfiesAssertion, substituti
|
|
|
52
52
|
|
|
53
53
|
context.trace(`Unifying the '${statementString}' statement with the '${referenceString}' reference...`);
|
|
54
54
|
|
|
55
|
-
const { StatementSubstitution } =
|
|
55
|
+
const { StatementSubstitution } = elements,
|
|
56
56
|
metavariable = reference.getMetavariable(),
|
|
57
57
|
statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
|
|
58
58
|
substitution = statementSubstitution; ///
|
|
@@ -107,7 +107,7 @@ function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, sub
|
|
|
107
107
|
const satisfiable = axiom.isSatisfiable();
|
|
108
108
|
|
|
109
109
|
if (satisfiable) {
|
|
110
|
-
const { Substitutions } =
|
|
110
|
+
const { Substitutions } = elements,
|
|
111
111
|
substitutions = Substitutions.fromNothing(),
|
|
112
112
|
axiomLemmaTheoremOrConjectureUnifies = axiom.unifyAxiomLemmaTheoremOrConjecture(axiomLemmaTheoremOrConjecture, substitutions, context);
|
|
113
113
|
|
|
@@ -139,7 +139,7 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
|
|
|
139
139
|
let unifiesWithAxiomLemmaTheoremOrConjecture = false;
|
|
140
140
|
|
|
141
141
|
if (reference !== null) {
|
|
142
|
-
const { Substitutions } =
|
|
142
|
+
const { Substitutions } = elements,
|
|
143
143
|
axiomLemmaTheoremOrConjecture = context.findAxiomLemmaTheoremOrConjectureByReference(reference),
|
|
144
144
|
generalSubstitutions = substitutions; ///
|
|
145
145
|
|
|
@@ -156,7 +156,7 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
|
|
|
156
156
|
const statementAndStepsUnify = axiomLemmaTheoremOrConjecture.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context);
|
|
157
157
|
|
|
158
158
|
if (statementAndStepsUnify) {
|
|
159
|
-
const { StatementSubstitution } =
|
|
159
|
+
const { StatementSubstitution } = elements,
|
|
160
160
|
metavariable = reference.getMetavariable(),
|
|
161
161
|
statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
|
|
162
162
|
substitution = statementSubstitution; ///
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
|
|
5
5
|
function unifyWithBracketedConstructor(term, context, verifyAhead) {
|
|
6
6
|
let unifiesWithBracketedConstructor;
|
|
7
7
|
|
|
8
|
-
const { BracketedConstructor } =
|
|
8
|
+
const { BracketedConstructor } = elements,
|
|
9
9
|
bracketedConstructor = BracketedConstructor.fromNothing();
|
|
10
10
|
|
|
11
11
|
unifiesWithBracketedConstructor = bracketedConstructor.unifyTerm(term, context, verifyAhead);
|
|
@@ -32,7 +32,7 @@ function unifyWithConstructors(term, context, verifyAhead) {
|
|
|
32
32
|
function verifyTermAsVariable(term, context, verifyAhead) {
|
|
33
33
|
let termVerifiesAsVariable = false;
|
|
34
34
|
|
|
35
|
-
const { Variable } =
|
|
35
|
+
const { Variable } = elements,
|
|
36
36
|
termNode = term.getNode(),
|
|
37
37
|
singularVariableNode = termNode.getSingularVariableNode();
|
|
38
38
|
|
|
@@ -5,6 +5,20 @@ import SubstitutionNode from "../../node/substitution";
|
|
|
5
5
|
import { FRAME_RULE_NAME } from "../../ruleNames";
|
|
6
6
|
|
|
7
7
|
export default class FrameSubstitutionNode extends SubstitutionNode {
|
|
8
|
+
getMetavariableNode() {
|
|
9
|
+
const lastMetavariableNode = this.getLastMetavariableNode(),
|
|
10
|
+
metavariableNode = lastMetavariableNode; ///
|
|
11
|
+
|
|
12
|
+
return metavariableNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getFrameNode() {
|
|
16
|
+
const firstFrameNode = this.getFirstFrameNode(),
|
|
17
|
+
frameNode = firstFrameNode; ///
|
|
18
|
+
|
|
19
|
+
return frameNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
getLastFrameNode() {
|
|
9
23
|
const ruleName = FRAME_RULE_NAME,
|
|
10
24
|
lastFrameNode = this.getLastNodeByRuleName(ruleName);
|
|
@@ -5,6 +5,20 @@ import SubstitutionNode from "../../node/substitution";
|
|
|
5
5
|
import { STATEMENT_RULE_NAME } from "../../ruleNames";
|
|
6
6
|
|
|
7
7
|
export default class StatementSubstitutionNode extends SubstitutionNode {
|
|
8
|
+
getMetavariableNode() {
|
|
9
|
+
const lastMetavariableNode = this.getLastVariableNode(),
|
|
10
|
+
metavariableNode = lastMetavariableNode; ///
|
|
11
|
+
|
|
12
|
+
return metavariableNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getStatementNode() {
|
|
16
|
+
const firstStatementNode = this.getFirstStatementNode(),
|
|
17
|
+
statementNode = firstStatementNode; ///
|
|
18
|
+
|
|
19
|
+
return statementNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
getLastStatementNode() {
|
|
9
23
|
const ruleName = STATEMENT_RULE_NAME,
|
|
10
24
|
lastStatementNode = this.getLastNodeByRuleName(ruleName);
|
|
@@ -19,5 +33,31 @@ export default class StatementSubstitutionNode extends SubstitutionNode {
|
|
|
19
33
|
return firstStatementNode;
|
|
20
34
|
}
|
|
21
35
|
|
|
36
|
+
getLastMetavariableNode() {
|
|
37
|
+
let lastMetavariableNode = null;
|
|
38
|
+
|
|
39
|
+
const lastStatementNode = this.getLastStatementNode(),
|
|
40
|
+
singularMetavariableNode = lastStatementNode.getSingularMetavariableNode();
|
|
41
|
+
|
|
42
|
+
if (singularMetavariableNode !== null) {
|
|
43
|
+
lastMetavariableNode = singularMetavariableNode; ///
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return lastMetavariableNode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getFirstMetavariableNode() {
|
|
50
|
+
let firstMetavariableNode = null;
|
|
51
|
+
|
|
52
|
+
const firstStatementNode = this.getFirstStatementNode(),
|
|
53
|
+
singularMetavariableNode = firstStatementNode.getSingularMetavariableNode();
|
|
54
|
+
|
|
55
|
+
if (singularMetavariableNode !== null) {
|
|
56
|
+
firstMetavariableNode = singularMetavariableNode; ///
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return firstMetavariableNode;
|
|
60
|
+
}
|
|
61
|
+
|
|
22
62
|
static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return SubstitutionNode.fromRuleNameChildNodesOpacityAndPrecedence(StatementSubstitutionNode, ruleName, childNodes, opacity, precedence); }
|
|
23
63
|
}
|
|
@@ -5,6 +5,20 @@ import SubstitutionNode from "../../node/substitution";
|
|
|
5
5
|
import { TERM_RULE_NAME } from "../../ruleNames";
|
|
6
6
|
|
|
7
7
|
export default class TermSubstitutionNode extends SubstitutionNode {
|
|
8
|
+
getVariableNode() {
|
|
9
|
+
const lastVariableNode = this.getLastVariableNode(),
|
|
10
|
+
variableNode = lastVariableNode; ///
|
|
11
|
+
|
|
12
|
+
return variableNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getTermNode() {
|
|
16
|
+
const firstTermNode = this.getFirstTermNode(),
|
|
17
|
+
termNode = firstTermNode; ///
|
|
18
|
+
|
|
19
|
+
return termNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
getLastTermNode() {
|
|
9
23
|
const ruleName = TERM_RULE_NAME,
|
|
10
24
|
lastTermNode = this.getLastNodeByRuleName(ruleName);
|
|
@@ -37,3 +51,4 @@ export default class TermSubstitutionNode extends SubstitutionNode {
|
|
|
37
51
|
|
|
38
52
|
static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return SubstitutionNode.fromRuleNameChildNodesOpacityAndPrecedence(TermSubstitutionNode, ruleName, childNodes, opacity, precedence); }
|
|
39
53
|
}
|
|
54
|
+
|