occam-verify-cli 1.0.230 → 1.0.233
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/local.js +1 -14
- package/lib/dom/axiom.js +22 -16
- package/lib/dom/combinator.js +5 -5
- package/lib/dom/conclusion.js +5 -5
- package/lib/dom/conjecture.js +9 -9
- package/lib/dom/constructor.js +5 -5
- package/lib/dom/declaration/combinator.js +14 -14
- package/lib/dom/declaration/complexType.js +35 -35
- package/lib/dom/declaration/constructor.js +19 -19
- package/lib/dom/declaration/metavariable.js +22 -22
- package/lib/dom/declaration/simpleType.js +23 -23
- package/lib/dom/declaration/variable.js +20 -20
- package/lib/dom/declaration.js +4 -2
- package/lib/dom/deduction.js +5 -5
- package/lib/dom/derivation.js +5 -5
- package/lib/dom/error.js +9 -9
- package/lib/dom/hypothesis.js +260 -0
- package/lib/dom/label.js +18 -24
- package/lib/dom/lemma.js +7 -7
- package/lib/dom/metaLemma.js +9 -9
- package/lib/dom/metaType.js +4 -10
- package/lib/dom/metatheorem.js +9 -9
- package/lib/dom/metavariable.js +7 -8
- package/lib/dom/parameter.js +2 -2
- package/lib/dom/premise.js +5 -5
- package/lib/dom/procedureCall.js +11 -10
- package/lib/dom/proof.js +3 -3
- package/lib/dom/property.js +9 -9
- package/lib/dom/reference.js +23 -22
- package/lib/dom/rule.js +25 -25
- package/lib/dom/section.js +146 -0
- package/lib/dom/signature.js +5 -5
- package/lib/dom/statement.js +25 -20
- package/lib/dom/step.js +3 -3
- package/lib/dom/subDerivation.js +5 -5
- package/lib/dom/subproof.js +7 -7
- package/lib/dom/substitution/statement.js +3 -3
- package/lib/dom/supposition.js +5 -5
- package/lib/dom/term.js +5 -6
- package/lib/dom/theorem.js +9 -9
- package/lib/dom/topLevelAssertion.js +22 -22
- package/lib/dom/topLevelMetaAssertion.js +14 -14
- package/lib/dom/type.js +21 -21
- package/lib/dom/variable.js +9 -15
- package/lib/index.js +3 -1
- package/lib/node/hypothesis.js +123 -0
- package/lib/node/section.js +116 -0
- package/lib/nonTerminalNodeMap.js +5 -3
- package/lib/ruleNames.js +9 -1
- package/lib/utilities/json.js +59 -59
- package/lib/utilities/subproof.js +10 -10
- package/lib/verifier/combinator.js +9 -10
- package/lib/verifier/constructor.js +10 -11
- package/lib/verifier/topLevel.js +38 -31
- package/package.json +2 -2
- package/src/context/local.js +0 -14
- package/src/dom/axiom.js +30 -29
- package/src/dom/combinator.js +4 -4
- package/src/dom/conclusion.js +5 -5
- package/src/dom/conjecture.js +8 -8
- package/src/dom/constructor.js +4 -4
- package/src/dom/declaration/combinator.js +14 -14
- package/src/dom/declaration/complexType.js +35 -35
- package/src/dom/declaration/constructor.js +20 -20
- package/src/dom/declaration/metavariable.js +22 -22
- package/src/dom/declaration/simpleType.js +22 -22
- package/src/dom/declaration/variable.js +21 -21
- package/src/dom/declaration.js +5 -3
- package/src/dom/deduction.js +5 -5
- package/src/dom/derivation.js +5 -5
- package/src/dom/error.js +8 -8
- package/src/dom/hypothesis.js +230 -0
- package/src/dom/label.js +17 -19
- package/src/dom/lemma.js +8 -8
- package/src/dom/metaLemma.js +8 -8
- package/src/dom/metaType.js +2 -6
- package/src/dom/metatheorem.js +8 -8
- package/src/dom/metavariable.js +9 -12
- package/src/dom/parameter.js +1 -1
- package/src/dom/premise.js +8 -8
- package/src/dom/procedureCall.js +9 -9
- package/src/dom/proof.js +2 -2
- package/src/dom/property.js +8 -8
- package/src/dom/reference.js +23 -27
- package/src/dom/rule.js +30 -30
- package/src/dom/section.js +70 -0
- package/src/dom/signature.js +4 -4
- package/src/dom/statement.js +24 -32
- package/src/dom/step.js +4 -4
- package/src/dom/subDerivation.js +5 -5
- package/src/dom/subproof.js +8 -8
- package/src/dom/substitution/statement.js +5 -5
- package/src/dom/supposition.js +7 -7
- package/src/dom/term.js +3 -8
- package/src/dom/theorem.js +7 -7
- package/src/dom/topLevelAssertion.js +29 -30
- package/src/dom/topLevelMetaAssertion.js +20 -20
- package/src/dom/type.js +22 -22
- package/src/dom/variable.js +8 -11
- package/src/index.js +2 -0
- package/src/node/hypothesis.js +23 -0
- package/src/node/section.js +16 -0
- package/src/nonTerminalNodeMap.js +7 -1
- package/src/ruleNames.js +2 -0
- package/src/utilities/json.js +58 -58
- package/src/utilities/subproof.js +10 -10
- package/src/verifier/combinator.js +6 -11
- package/src/verifier/constructor.js +9 -12
- package/src/verifier/topLevel.js +42 -30
package/src/dom/label.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
|
-
import LocalContext from "../context/local";
|
|
5
4
|
|
|
6
5
|
import { domAssigned } from "../dom";
|
|
7
6
|
import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
|
|
8
7
|
|
|
9
8
|
export default domAssigned(class Label {
|
|
10
|
-
constructor(
|
|
9
|
+
constructor(context, metavariable) {
|
|
10
|
+
this.context = context;
|
|
11
11
|
this.metavariable = metavariable;
|
|
12
|
-
this.fileContext = fileContext;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
return this.
|
|
14
|
+
getContext() {
|
|
15
|
+
return this.context;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
return this.
|
|
18
|
+
getMetavariable() {
|
|
19
|
+
return this.metavariable;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
getString() { return this.metavariable.getString(); }
|
|
@@ -56,28 +55,28 @@ export default domAssigned(class Label {
|
|
|
56
55
|
|
|
57
56
|
const labelString = this.getString(); ///
|
|
58
57
|
|
|
59
|
-
this.
|
|
58
|
+
this.context.trace(`Verifying the '${labelString}' label...`);
|
|
60
59
|
|
|
61
60
|
let labelPresent;
|
|
62
61
|
|
|
63
62
|
if (nameOnly) {
|
|
64
63
|
const metavariableName = this.getMetavariableName();
|
|
65
64
|
|
|
66
|
-
labelPresent = this.
|
|
65
|
+
labelPresent = this.context.isLabelPresentByMetavariableName(metavariableName);
|
|
67
66
|
} else {
|
|
68
67
|
const metavariable = this.getMetavariable();
|
|
69
68
|
|
|
70
|
-
labelPresent = this.
|
|
69
|
+
labelPresent = this.context.isLabelPresentByMetavariable(metavariable);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
if (labelPresent) {
|
|
74
|
-
this.
|
|
73
|
+
this.context.debug(`The '${labelString}' label is already present.`);
|
|
75
74
|
} else {
|
|
76
75
|
verifies = true;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
if (verifies) {
|
|
80
|
-
this.
|
|
79
|
+
this.context.debug(`...verified the '${labelString}' label.`);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
return verifies;
|
|
@@ -95,18 +94,17 @@ export default domAssigned(class Label {
|
|
|
95
94
|
|
|
96
95
|
static name = "Label";
|
|
97
96
|
|
|
98
|
-
static fromJSON(json,
|
|
99
|
-
const metavariable = metavariableFromJSON(json,
|
|
100
|
-
label = new Label(
|
|
97
|
+
static fromJSON(json, context) {
|
|
98
|
+
const metavariable = metavariableFromJSON(json, context),
|
|
99
|
+
label = new Label(context, metavariable);
|
|
101
100
|
|
|
102
101
|
return label;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
static fromLabelNode(labelNode,
|
|
104
|
+
static fromLabelNode(labelNode, context) {
|
|
106
105
|
const { Metavariable } = dom,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
label = new Label(metavariable, fileContext);
|
|
106
|
+
metavariable = Metavariable.fromLabelNode(labelNode, context),
|
|
107
|
+
label = new Label(context, metavariable);
|
|
110
108
|
|
|
111
109
|
return label;
|
|
112
110
|
}
|
package/src/dom/lemma.js
CHANGED
|
@@ -9,23 +9,23 @@ export default domAssigned(class Lemma extends TopLevelAssertion {
|
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
11
|
const lemma = this, ///
|
|
12
|
-
|
|
12
|
+
context = this.getContext(),
|
|
13
13
|
lemmaString = lemma.getString();
|
|
14
14
|
|
|
15
15
|
(lemmaString === null) ?
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
context.trace(`Verifying a lemma...`) :
|
|
17
|
+
context.trace(`Verifying the '${lemmaString}' lemma...`);
|
|
18
18
|
|
|
19
19
|
verifies = super.verify();
|
|
20
20
|
|
|
21
21
|
if (verifies) {
|
|
22
22
|
const lemma = this; ///
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
context.addLemma(lemma);
|
|
25
25
|
|
|
26
26
|
(lemmaString === null) ?
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
context.debug(`...verified a lemma.`) :
|
|
28
|
+
context.debug(`...verified the '${lemmaString}' lemma.`);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return verifies;
|
|
@@ -33,9 +33,9 @@ export default domAssigned(class Lemma extends TopLevelAssertion {
|
|
|
33
33
|
|
|
34
34
|
static name = "Lemma";
|
|
35
35
|
|
|
36
|
-
static fromLemmaNode(lemmaNode,
|
|
36
|
+
static fromLemmaNode(lemmaNode, context) {
|
|
37
37
|
const node = lemmaNode, ///
|
|
38
|
-
lemma = TopLevelAssertion.fromNode(Lemma, node,
|
|
38
|
+
lemma = TopLevelAssertion.fromNode(Lemma, node, context);
|
|
39
39
|
|
|
40
40
|
return lemma;
|
|
41
41
|
}
|
package/src/dom/metaLemma.js
CHANGED
|
@@ -8,20 +8,20 @@ export default domAssigned(class MetaLemma extends TopLevelMetaAssertion {
|
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const context = this.getContext(),
|
|
12
|
+
metaLemma = this, ///
|
|
13
13
|
metaLemmaString = metaLemma.getString();
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
context.trace(`Verifying the '${metaLemmaString}' meta-lemma...`);
|
|
16
16
|
|
|
17
17
|
verifies = super.verify();
|
|
18
18
|
|
|
19
19
|
if (verifies) {
|
|
20
20
|
const metaTheorem = this; ///
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
context.addMetatheorem(metaTheorem);
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
context.debug(`...verified the '${metaLemmaString}' meta-lemma.`);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return verifies;
|
|
@@ -29,11 +29,11 @@ export default domAssigned(class MetaLemma extends TopLevelMetaAssertion {
|
|
|
29
29
|
|
|
30
30
|
static name = "MetaLemma";
|
|
31
31
|
|
|
32
|
-
static fromJSON(json,
|
|
32
|
+
static fromJSON(json, context) { return TopLevelMetaAssertion.fromJSON(MetaLemma, json, context); }
|
|
33
33
|
|
|
34
|
-
static fromMetaLemmaNode(metaLemmaNode,
|
|
34
|
+
static fromMetaLemmaNode(metaLemmaNode, context) {
|
|
35
35
|
const node = metaLemmaNode, ///
|
|
36
|
-
metaLemma = TopLevelMetaAssertion.fromNode(MetaLemma, node,
|
|
36
|
+
metaLemma = TopLevelMetaAssertion.fromNode(MetaLemma, node, context);
|
|
37
37
|
|
|
38
38
|
return metaLemma;
|
|
39
39
|
}
|
package/src/dom/metaType.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import LocalContext from "../context/local";
|
|
4
|
-
|
|
5
3
|
import { domAssigned } from "../dom";
|
|
6
4
|
import { FRAME_META_TYPE_NAME, REFERENCE_META_TYPE_NAME, STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
|
|
7
5
|
|
|
@@ -43,7 +41,7 @@ class MetaType {
|
|
|
43
41
|
|
|
44
42
|
static name = "MetaType";
|
|
45
43
|
|
|
46
|
-
static fromJSON(json,
|
|
44
|
+
static fromJSON(json, context) {
|
|
47
45
|
const { name } = json,
|
|
48
46
|
metaTypeName = name, ///
|
|
49
47
|
metaType = metaTypeFromMetaTypeName(metaTypeName);
|
|
@@ -57,10 +55,8 @@ class MetaType {
|
|
|
57
55
|
return metaType;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
static fromMetavariableDeclarationNode(metavariableDeclarationNode,
|
|
58
|
+
static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
61
59
|
const metaTypeNode = metavariableDeclarationNode.getMetaTypeNode(),
|
|
62
|
-
localContext = LocalContext.fromFileContext(fileContext),
|
|
63
|
-
context = localContext, ///
|
|
64
60
|
metaType = metaTypeFromMetaTypeNode(metaTypeNode, context);
|
|
65
61
|
|
|
66
62
|
return metaType;
|
package/src/dom/metatheorem.js
CHANGED
|
@@ -8,20 +8,20 @@ export default domAssigned(class Metatheorem extends TopLevelMetaAssertion {
|
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const context = this.getContext(),
|
|
12
|
+
metaLemma = this, ///
|
|
13
13
|
metaLemmaString = metaLemma.getString();
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
context.trace(`Verifying the '${metaLemmaString}' metatheorem...`);
|
|
16
16
|
|
|
17
17
|
verifies = super.verify();
|
|
18
18
|
|
|
19
19
|
if (verifies) {
|
|
20
20
|
const metaTheorem = this; ///
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
context.addMetatheorem(metaTheorem);
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
context.debug(`...verified the '${metaLemmaString}' metatheorem.`);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return verifies;
|
|
@@ -29,11 +29,11 @@ export default domAssigned(class Metatheorem extends TopLevelMetaAssertion {
|
|
|
29
29
|
|
|
30
30
|
static name = "Metatheorem";
|
|
31
31
|
|
|
32
|
-
static fromJSON(json,
|
|
32
|
+
static fromJSON(json, context) { return TopLevelMetaAssertion.fromJSON(Metatheorem, json, context); }
|
|
33
33
|
|
|
34
|
-
static fromMetatheoremNode(metatheoremNode,
|
|
34
|
+
static fromMetatheoremNode(metatheoremNode, context) {
|
|
35
35
|
const node = metatheoremNode, ///
|
|
36
|
-
metatheorem = TopLevelMetaAssertion.fromNode(Metatheorem, node,
|
|
36
|
+
metatheorem = TopLevelMetaAssertion.fromNode(Metatheorem, node, context);
|
|
37
37
|
|
|
38
38
|
return metatheorem;
|
|
39
39
|
}
|
package/src/dom/metavariable.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
|
-
import LocalContext from "../context/local";
|
|
5
4
|
import MetavariablePartialContext from "../context/partial/metavariable";
|
|
6
5
|
|
|
7
6
|
import { domAssigned } from "../dom";
|
|
@@ -442,10 +441,10 @@ export default domAssigned(class Metavariable {
|
|
|
442
441
|
|
|
443
442
|
static name = "Metavariable";
|
|
444
443
|
|
|
445
|
-
static fromJSON(json,
|
|
444
|
+
static fromJSON(json, context) {
|
|
446
445
|
const { string } = json,
|
|
447
|
-
lexer =
|
|
448
|
-
parser =
|
|
446
|
+
lexer = context.getLexer(),
|
|
447
|
+
parser = context.getParser(),
|
|
449
448
|
metavariablePartialContext = MetavariablePartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
450
449
|
metavariableTokens = metavariablePartialContext.getMetavariableTokens(),
|
|
451
450
|
metavariableNode = metavariablePartialContext.getMetavariableNode(),
|
|
@@ -453,8 +452,8 @@ export default domAssigned(class Metavariable {
|
|
|
453
452
|
name = metavariableName, ///
|
|
454
453
|
node = metavariableNode, ///
|
|
455
454
|
tokens = metavariableTokens, ///
|
|
456
|
-
type = typeFromJSON(json,
|
|
457
|
-
metaType = metaTypeFromJSON(json,
|
|
455
|
+
type = typeFromJSON(json, context),
|
|
456
|
+
metaType = metaTypeFromJSON(json, context),
|
|
458
457
|
metavariable = new Metavariable(string, node, tokens, name, type, metaType);
|
|
459
458
|
|
|
460
459
|
return metavariable;
|
|
@@ -510,12 +509,10 @@ export default domAssigned(class Metavariable {
|
|
|
510
509
|
return metavariable;
|
|
511
510
|
}
|
|
512
511
|
|
|
513
|
-
static fromMetavariableDeclarationNode(metavariableDeclarationNode,
|
|
512
|
+
static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
514
513
|
const { MetaType } = dom,
|
|
515
514
|
metavariableNode = metavariableDeclarationNode.getMetavariableNode(),
|
|
516
|
-
|
|
517
|
-
context = localContext, ///
|
|
518
|
-
type = typeFromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext),
|
|
515
|
+
type = typeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
519
516
|
metaType = MetaType.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
520
517
|
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
521
518
|
|
|
@@ -541,7 +538,7 @@ function metavariableFromMetavariableNode(metavariableNode, context) {
|
|
|
541
538
|
return metavariable;
|
|
542
539
|
}
|
|
543
540
|
|
|
544
|
-
function typeFromMetavariableDeclarationNode(metavariableDeclarationNode,
|
|
541
|
+
function typeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
545
542
|
let type = null;
|
|
546
543
|
|
|
547
544
|
const typeNode = metavariableDeclarationNode.getTypeNode();
|
|
@@ -549,7 +546,7 @@ function typeFromMetavariableDeclarationNode(metavariableDeclarationNode, fileCo
|
|
|
549
546
|
if (typeNode !== null) {
|
|
550
547
|
const typeName = typeNode.getTypeName();
|
|
551
548
|
|
|
552
|
-
type =
|
|
549
|
+
type = context.findTypeByTypeName(typeName);
|
|
553
550
|
}
|
|
554
551
|
|
|
555
552
|
return type;
|
package/src/dom/parameter.js
CHANGED
package/src/dom/premise.js
CHANGED
|
@@ -200,9 +200,9 @@ export default domAssigned(class Premise {
|
|
|
200
200
|
|
|
201
201
|
static name = "Premise";
|
|
202
202
|
|
|
203
|
-
static fromJSON(json,
|
|
204
|
-
const statement = statementFromJSON(json,
|
|
205
|
-
procedureCall = procedureCallFromJSON(json,
|
|
203
|
+
static fromJSON(json, context) {
|
|
204
|
+
const statement = statementFromJSON(json, context),
|
|
205
|
+
procedureCall = procedureCallFromJSON(json, context);
|
|
206
206
|
|
|
207
207
|
let string;
|
|
208
208
|
|
|
@@ -219,12 +219,12 @@ export default domAssigned(class Premise {
|
|
|
219
219
|
return premise;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
static fromPremiseNode(premiseNode,
|
|
222
|
+
static fromPremiseNode(premiseNode, context) {
|
|
223
223
|
const { Statement, ProcedureCall } = dom,
|
|
224
|
-
node = premiseNode,
|
|
225
|
-
string =
|
|
226
|
-
statement = Statement.fromPremiseNode(premiseNode,
|
|
227
|
-
procedureCall = ProcedureCall.fromPremiseNode(premiseNode,
|
|
224
|
+
node = premiseNode, ///
|
|
225
|
+
string = context.nodeAsString(node),
|
|
226
|
+
statement = Statement.fromPremiseNode(premiseNode, context),
|
|
227
|
+
procedureCall = ProcedureCall.fromPremiseNode(premiseNode, context),
|
|
228
228
|
premise = new Premise(string, statement, procedureCall);
|
|
229
229
|
|
|
230
230
|
return premise
|
package/src/dom/procedureCall.js
CHANGED
|
@@ -76,16 +76,16 @@ export default domAssigned(class ProcedureCall {
|
|
|
76
76
|
nodes = this.findNodes(substitutions),
|
|
77
77
|
expressions = Expressions.fromNodes(nodes, context);
|
|
78
78
|
|
|
79
|
-
try {
|
|
79
|
+
// try {
|
|
80
80
|
const value = procedure.call(expressions, context),
|
|
81
81
|
boolean = value.getBoolean();
|
|
82
82
|
|
|
83
83
|
unifiesIndependently = boolean; ///
|
|
84
|
-
} catch (exception) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
84
|
+
// } catch (exception) {
|
|
85
|
+
// const message = exception.getMessage();
|
|
86
|
+
//
|
|
87
|
+
// context.info(message);
|
|
88
|
+
// }
|
|
89
89
|
|
|
90
90
|
if (unifiesIndependently) {
|
|
91
91
|
context.debug(`...unified the '${procedureCallString}' procedure call independently.`);
|
|
@@ -109,9 +109,9 @@ export default domAssigned(class ProcedureCall {
|
|
|
109
109
|
|
|
110
110
|
static name = "ProcedureCall";
|
|
111
111
|
|
|
112
|
-
static fromJSON(json,
|
|
113
|
-
const reference = referenceFromJSON(json,
|
|
114
|
-
parameters = parametersFromJSON(json,
|
|
112
|
+
static fromJSON(json, context) {
|
|
113
|
+
const reference = referenceFromJSON(json, context),
|
|
114
|
+
parameters = parametersFromJSON(json, context),
|
|
115
115
|
string = stringFromReferenceAndParameters(reference, parameters),
|
|
116
116
|
procedureCall = new ProcedureCall(string, reference, parameters);
|
|
117
117
|
|
package/src/dom/proof.js
CHANGED
|
@@ -52,13 +52,13 @@ export default domAssigned(class Proof {
|
|
|
52
52
|
|
|
53
53
|
static name = "Proof";
|
|
54
54
|
|
|
55
|
-
static fromProofNode(proofNode,
|
|
55
|
+
static fromProofNode(proofNode, context) {
|
|
56
56
|
let proof = null;
|
|
57
57
|
|
|
58
58
|
if (proofNode !== null) {
|
|
59
59
|
const { Derivation } = dom,
|
|
60
60
|
derivationNode = proofNode.getDerivationNode(),
|
|
61
|
-
derivation = Derivation.fromDerivationNode(derivationNode,
|
|
61
|
+
derivation = Derivation.fromDerivationNode(derivationNode, context);
|
|
62
62
|
|
|
63
63
|
proof = new Proof(derivation);
|
|
64
64
|
}
|
package/src/dom/property.js
CHANGED
|
@@ -50,29 +50,29 @@ export default domAssigned(class Property {
|
|
|
50
50
|
|
|
51
51
|
static name = "Property";
|
|
52
52
|
|
|
53
|
-
static fromJSON(json,
|
|
53
|
+
static fromJSON(json, context) {
|
|
54
54
|
const { name } = json,
|
|
55
|
-
type = typeFromJSON(json,
|
|
55
|
+
type = typeFromJSON(json, context),
|
|
56
56
|
string = name, ///
|
|
57
57
|
property = new Property(string, name, type);
|
|
58
58
|
|
|
59
59
|
return property;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
static fromPropertyNode(propertyNode,
|
|
63
|
-
const property = propertyFromPropertyNode(propertyNode,
|
|
62
|
+
static fromPropertyNode(propertyNode, context) {
|
|
63
|
+
const property = propertyFromPropertyNode(propertyNode, context)
|
|
64
64
|
|
|
65
65
|
return property;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
static fromPropertyRelationNode(propertyRelationNode,
|
|
68
|
+
static fromPropertyRelationNode(propertyRelationNode, context) {
|
|
69
69
|
const propertyNode = propertyRelationNode.getPropertyNode(),
|
|
70
|
-
property = propertyFromPropertyNode(propertyNode,
|
|
70
|
+
property = propertyFromPropertyNode(propertyNode, context);
|
|
71
71
|
|
|
72
72
|
return property;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
static fromPropertyDeclarationNode(propertyDeclarationNode,
|
|
75
|
+
static fromPropertyDeclarationNode(propertyDeclarationNode, context) {
|
|
76
76
|
const { Type } = dom,
|
|
77
77
|
type = Type.fromPropertyDeclarationNode(propertyDeclarationNode),
|
|
78
78
|
propertyName = propertyDeclarationNode.getPropertyName(),
|
|
@@ -84,7 +84,7 @@ export default domAssigned(class Property {
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
function propertyFromPropertyNode(propertyNode,
|
|
87
|
+
function propertyFromPropertyNode(propertyNode, context) {
|
|
88
88
|
const { Property } = dom,
|
|
89
89
|
propertyName = propertyNode.getPropertyName(),
|
|
90
90
|
name = propertyName, ///
|
package/src/dom/reference.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
|
-
import LocalContext from "../context/local";
|
|
5
4
|
import Substitutions from "../substitutions";
|
|
6
5
|
|
|
7
6
|
import { domAssigned } from "../dom";
|
|
@@ -90,9 +89,11 @@ export default domAssigned(class Reference {
|
|
|
90
89
|
|
|
91
90
|
context.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
|
|
92
91
|
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const generalContext = context; ///
|
|
93
|
+
|
|
94
|
+
context = label.getContext();
|
|
95
|
+
|
|
96
|
+
const specificContext = context, ///
|
|
96
97
|
labelMetavariable = label.getMetavariable(),
|
|
97
98
|
generalMetavariable = this.metavariable, ///
|
|
98
99
|
specificMetavariable = labelMetavariable, ///
|
|
@@ -116,10 +117,9 @@ export default domAssigned(class Reference {
|
|
|
116
117
|
|
|
117
118
|
context.trace(`Unifying the '${metavariableString}' metavariable with the '${referenceString}' reference...`);
|
|
118
119
|
|
|
119
|
-
const
|
|
120
|
-
substitutions = Substitutions.fromNothing(),
|
|
120
|
+
const substitutions = Substitutions.fromNothing(),
|
|
121
121
|
generalContext = context, ///
|
|
122
|
-
specificContext =
|
|
122
|
+
specificContext = context, ///
|
|
123
123
|
generalMetavariable = this.metavariable, ///
|
|
124
124
|
specificMetavariable = metavariable, ///
|
|
125
125
|
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, substitutions, generalContext, specificContext);
|
|
@@ -167,78 +167,74 @@ export default domAssigned(class Reference {
|
|
|
167
167
|
|
|
168
168
|
static name = "Reference";
|
|
169
169
|
|
|
170
|
-
static fromJSON(json,
|
|
171
|
-
const metavariable = metavariableFromJSON(json,
|
|
170
|
+
static fromJSON(json, context) {
|
|
171
|
+
const metavariable = metavariableFromJSON(json, context),
|
|
172
172
|
reference = new Reference(metavariable);
|
|
173
173
|
|
|
174
174
|
return reference;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
static fromStepNode(stepNode,
|
|
177
|
+
static fromStepNode(stepNode, context) {
|
|
178
178
|
let reference = null;
|
|
179
179
|
|
|
180
180
|
const referenceNode = stepNode.getReferenceNode();
|
|
181
181
|
|
|
182
182
|
if (referenceNode !== null) {
|
|
183
|
-
reference = referenceFromReferenceNode(referenceNode,
|
|
183
|
+
reference = referenceFromReferenceNode(referenceNode, context);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
return reference;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
static fromReferenceNode(referenceNode,
|
|
190
|
-
const reference = referenceFromReferenceNode(referenceNode,
|
|
189
|
+
static fromReferenceNode(referenceNode, context) {
|
|
190
|
+
const reference = referenceFromReferenceNode(referenceNode, context);
|
|
191
191
|
|
|
192
192
|
return reference;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
static fromDeclarationNode(declarationNode,
|
|
195
|
+
static fromDeclarationNode(declarationNode, context) {
|
|
196
196
|
const metavariableNode = declarationNode.getMetavariableNode(),
|
|
197
|
-
reference = referenceFromMetavariableNode(metavariableNode,
|
|
197
|
+
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
198
198
|
|
|
199
199
|
return reference;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
static fromMetavariableNode(metavariableNode,
|
|
203
|
-
const reference = referenceFromMetavariableNode(metavariableNode,
|
|
202
|
+
static fromMetavariableNode(metavariableNode, context) {
|
|
203
|
+
const reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
204
204
|
|
|
205
205
|
return reference;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
static fromProcedureCallNode(procedureCallNode,
|
|
208
|
+
static fromProcedureCallNode(procedureCallNode, context) {
|
|
209
209
|
let reference = null;
|
|
210
210
|
|
|
211
211
|
const referenceNode = procedureCallNode.getReferenceNode();
|
|
212
212
|
|
|
213
213
|
if (referenceNode !== null) {
|
|
214
|
-
reference = referenceFromReferenceNode(referenceNode,
|
|
214
|
+
reference = referenceFromReferenceNode(referenceNode, context);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
return reference;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
static fromSatisfiesAssertionNode(satisfiesAssertionNode,
|
|
220
|
+
static fromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
221
221
|
const metavariableNode = satisfiesAssertionNode.getMetavariableNode(),
|
|
222
|
-
reference = referenceFromMetavariableNode(metavariableNode,
|
|
222
|
+
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
223
223
|
|
|
224
224
|
return reference;
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
-
function referenceFromReferenceNode(referenceNode,
|
|
228
|
+
function referenceFromReferenceNode(referenceNode, context) {
|
|
229
229
|
const { Reference, Metavariable } = dom,
|
|
230
|
-
localContext = LocalContext.fromFileContext(fileContext),
|
|
231
|
-
context = localContext, ///
|
|
232
230
|
metavariable = Metavariable.fromReferenceNode(referenceNode, context),
|
|
233
231
|
reference = new Reference(metavariable);
|
|
234
232
|
|
|
235
233
|
return reference;
|
|
236
234
|
}
|
|
237
235
|
|
|
238
|
-
function referenceFromMetavariableNode(metavariableNode,
|
|
236
|
+
function referenceFromMetavariableNode(metavariableNode, context) {
|
|
239
237
|
const { Reference, Metavariable } = dom,
|
|
240
|
-
localContext = LocalContext.fromFileContext(fileContext),
|
|
241
|
-
context = localContext, ///
|
|
242
238
|
metavariable = Metavariable.fromMetavariableNode(metavariableNode, context),
|
|
243
239
|
reference = new Reference(metavariable);
|
|
244
240
|
|