occam-verify-cli 1.0.282 → 1.0.285
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 +51 -9
- package/lib/context/local.js +11 -6
- package/lib/context/release.js +11 -11
- package/lib/dom/axiom.js +18 -18
- package/lib/dom/conclusion.js +16 -9
- package/lib/dom/conjecture.js +4 -4
- package/lib/dom/constructor/bracketed.js +3 -3
- package/lib/dom/constructor.js +3 -3
- package/lib/dom/declaration/combinator.js +14 -7
- package/lib/dom/declaration/complexType.js +28 -21
- package/lib/dom/declaration/constructor.js +18 -11
- package/lib/dom/declaration/metavariable.js +19 -12
- package/lib/dom/declaration/simpleType.js +21 -14
- package/lib/dom/declaration/variable.js +19 -12
- package/lib/dom/deduction.js +18 -11
- package/lib/dom/error.js +11 -4
- package/lib/dom/hypothesis.js +16 -9
- package/lib/dom/lemma.js +4 -4
- package/lib/dom/metaLemma.js +4 -4
- package/lib/dom/metatheorem.js +4 -4
- package/lib/dom/premise.js +18 -11
- package/lib/dom/procedureCall.js +17 -10
- package/lib/dom/rule.js +14 -7
- package/lib/dom/section.js +12 -5
- package/lib/dom/statement.js +15 -15
- package/lib/dom/step.js +18 -11
- package/lib/dom/subproof.js +11 -10
- package/lib/dom/supposition.js +20 -13
- package/lib/dom/theorem.js +4 -4
- package/lib/dom/topLevelAssertion.js +13 -6
- package/lib/dom/topLevelMetaAssertion.js +11 -4
- package/lib/log.js +25 -10
- package/package.json +1 -1
- package/src/context/file.js +68 -9
- package/src/context/local.js +5 -5
- package/src/context/release.js +5 -5
- package/src/dom/axiom.js +23 -18
- package/src/dom/conclusion.js +14 -8
- package/src/dom/conjecture.js +4 -3
- package/src/dom/constructor/bracketed.js +2 -2
- package/src/dom/constructor.js +2 -2
- package/src/dom/declaration/combinator.js +11 -6
- package/src/dom/declaration/complexType.js +26 -20
- package/src/dom/declaration/constructor.js +16 -11
- package/src/dom/declaration/metavariable.js +17 -11
- package/src/dom/declaration/simpleType.js +19 -13
- package/src/dom/declaration/variable.js +17 -12
- package/src/dom/deduction.js +16 -10
- package/src/dom/error.js +8 -3
- package/src/dom/hypothesis.js +14 -8
- package/src/dom/lemma.js +5 -4
- package/src/dom/metaLemma.js +4 -3
- package/src/dom/metatheorem.js +4 -3
- package/src/dom/premise.js +16 -10
- package/src/dom/procedureCall.js +16 -9
- package/src/dom/rule.js +14 -7
- package/src/dom/section.js +10 -4
- package/src/dom/statement.js +14 -14
- package/src/dom/step.js +16 -10
- package/src/dom/subproof.js +8 -6
- package/src/dom/supposition.js +18 -12
- package/src/dom/theorem.js +4 -3
- package/src/dom/topLevelAssertion.js +11 -5
- package/src/dom/topLevelMetaAssertion.js +9 -3
- package/src/log.js +29 -16
|
@@ -5,8 +5,9 @@ import dom from "../../dom";
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
6
|
|
|
7
7
|
export default domAssigned(class MetavariableDeclaration {
|
|
8
|
-
constructor(context, string, metavariable) {
|
|
8
|
+
constructor(context, node, string, metavariable) {
|
|
9
9
|
this.context = context;
|
|
10
|
+
this.node = node;
|
|
10
11
|
this.string = string;
|
|
11
12
|
this.metavariable = metavariable;
|
|
12
13
|
}
|
|
@@ -15,6 +16,10 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
15
16
|
return this.context;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
getNode() {
|
|
20
|
+
return this.node;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
getString() {
|
|
19
24
|
return this.string;
|
|
20
25
|
}
|
|
@@ -28,7 +33,7 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
28
33
|
|
|
29
34
|
const metavariableDeclarationString = this.string; ///
|
|
30
35
|
|
|
31
|
-
this.context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration
|
|
36
|
+
this.context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration...`, this.node);
|
|
32
37
|
|
|
33
38
|
const metavariableVerifies = this.verifyMetavariable(this.metavariable);
|
|
34
39
|
|
|
@@ -39,7 +44,7 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
if (verifies) {
|
|
42
|
-
this.context.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration
|
|
47
|
+
this.context.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration.`, this.node);
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
return verifies;
|
|
@@ -54,18 +59,18 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
54
59
|
const typeName = type.getName(),
|
|
55
60
|
typeString = type.getString();
|
|
56
61
|
|
|
57
|
-
this.context.trace(`Verifying the '${typeString}' type
|
|
62
|
+
this.context.trace(`Verifying the '${typeString}' type...`, this.node);
|
|
58
63
|
|
|
59
64
|
const typePresent = this.context.isTypePresentByTypeName(typeName);
|
|
60
65
|
|
|
61
66
|
if (!typePresent) {
|
|
62
|
-
this.context.debug(`The '${typeString}' type is not present
|
|
67
|
+
this.context.debug(`The '${typeString}' type is not present.`, this.node);
|
|
63
68
|
} else {
|
|
64
69
|
typeVerifies = true;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
if (typeVerifies) {
|
|
68
|
-
this.context.debug(`...verified the '${typeString}' type
|
|
73
|
+
this.context.debug(`...verified the '${typeString}' type.`, this.node);
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -77,19 +82,19 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
77
82
|
|
|
78
83
|
const metavariableString = metavariable.getString();
|
|
79
84
|
|
|
80
|
-
this.context.trace(`Verifying the '${metavariableString}' metavariable when declared
|
|
85
|
+
this.context.trace(`Verifying the '${metavariableString}' metavariable when declared...`, this.node);
|
|
81
86
|
|
|
82
87
|
const metavariableNode = metavariable.getNode(), ///
|
|
83
88
|
termNode = metavariableNode.getTermNode();
|
|
84
89
|
|
|
85
90
|
if (termNode !== null) {
|
|
86
|
-
this.context.debug(`A term was found in the '${metavariableString}' metavariable when a type should have been present
|
|
91
|
+
this.context.debug(`A term was found in the '${metavariableString}' metavariable when a type should have been present.`, this.node);
|
|
87
92
|
} else {
|
|
88
93
|
const metavariableName = metavariable.getName(),
|
|
89
94
|
metavariablePresent = this.context.isMetavariablePresentByMetavariableName(metavariableName);
|
|
90
95
|
|
|
91
96
|
if (metavariablePresent) {
|
|
92
|
-
this.context.debug(`The '${metavariableName}' metavariable is already present
|
|
97
|
+
this.context.debug(`The '${metavariableName}' metavariable is already present.`, this.node);
|
|
93
98
|
} else {
|
|
94
99
|
const type = metavariable.getType(),
|
|
95
100
|
typeVerifies = this.verifyType(type);
|
|
@@ -99,7 +104,7 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
if (metavariableVerifies) {
|
|
102
|
-
this.context.debug(`...verified the '${metavariableString}' metavariable when declared
|
|
107
|
+
this.context.debug(`...verified the '${metavariableString}' metavariable when declared.`, this.node);
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
return metavariableVerifies;
|
|
@@ -109,10 +114,11 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
109
114
|
|
|
110
115
|
static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
111
116
|
const { Metavariable } = dom,
|
|
117
|
+
node = metavariableDeclarationNode, ///
|
|
112
118
|
metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
113
119
|
metavariable = Metavariable.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
114
120
|
string = stringFromMetavariableAndMetaType(metavariable, metaType),
|
|
115
|
-
metavariableDeclaration = new MetavariableDeclaration(context, string, metavariable);
|
|
121
|
+
metavariableDeclaration = new MetavariableDeclaration(context, node, string, metavariable);
|
|
116
122
|
|
|
117
123
|
return metavariableDeclaration;
|
|
118
124
|
}
|
|
@@ -7,8 +7,9 @@ import { domAssigned } from "../../dom";
|
|
|
7
7
|
import { stringFromTypeNameNameAndSuperTypes } from "../../utilities/type";
|
|
8
8
|
|
|
9
9
|
export default domAssigned(class SimpleTypeDeclaration {
|
|
10
|
-
constructor(context, string, type) {
|
|
10
|
+
constructor(context, node, string, type) {
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.type = type;
|
|
14
15
|
}
|
|
@@ -17,6 +18,10 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
17
18
|
return this.context;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
getNode() {
|
|
22
|
+
return this.node;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
getString() {
|
|
21
26
|
return this.string;
|
|
22
27
|
}
|
|
@@ -30,7 +35,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
30
35
|
|
|
31
36
|
const typeDeclarationString = this.getString(); ///
|
|
32
37
|
|
|
33
|
-
this.context.trace(`Verifying the '${typeDeclarationString}' type declaration...`);
|
|
38
|
+
this.context.trace(`Verifying the '${typeDeclarationString}' type declaration...`), this.node;
|
|
34
39
|
|
|
35
40
|
const typeVerifies = this.verifyType();
|
|
36
41
|
|
|
@@ -45,7 +50,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
if (verifies) {
|
|
48
|
-
this.context.debug(`...verified the '${typeDeclarationString}' type declaration
|
|
53
|
+
this.context.debug(`...verified the '${typeDeclarationString}' type declaration.`, this.node);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
return verifies;
|
|
@@ -56,19 +61,19 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
56
61
|
|
|
57
62
|
const typeString = this.type.getString();
|
|
58
63
|
|
|
59
|
-
this.context.trace(`Verifying the '${typeString}' type...`);
|
|
64
|
+
this.context.trace(`Verifying the '${typeString}' type...`), this.node;
|
|
60
65
|
|
|
61
66
|
const typeName = this.type.getName(),
|
|
62
67
|
typePresent = this.context.isTypePresentByTypeName(typeName);
|
|
63
68
|
|
|
64
69
|
if (typePresent) {
|
|
65
|
-
this.context.debug(`The type '${typeString}' is already present
|
|
70
|
+
this.context.debug(`The type '${typeString}' is already present.`, this.node);
|
|
66
71
|
} else {
|
|
67
72
|
typeVerifies = true;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
if (typeVerifies) {
|
|
71
|
-
this.context.debug(`...verified the '${typeString}' type
|
|
76
|
+
this.context.debug(`...verified the '${typeString}' type.`, this.node);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
return typeVerifies;
|
|
@@ -79,7 +84,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
79
84
|
|
|
80
85
|
const superTypeString = superType.getString();
|
|
81
86
|
|
|
82
|
-
this.context.trace(`Verifying the '${superTypeString}' super-type...`);
|
|
87
|
+
this.context.trace(`Verifying the '${superTypeString}' super-type...`), this.node;
|
|
83
88
|
|
|
84
89
|
const superTypeName = superType.getName(),
|
|
85
90
|
superTypePresent = this.context.isTypePresentByTypeName(superTypeName);
|
|
@@ -89,7 +94,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
if (superTypeVerifies) {
|
|
92
|
-
this.context.debug(`...verified the '${superTypeString}' super-type
|
|
97
|
+
this.context.debug(`...verified the '${superTypeString}' super-type.`, this.node);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
return superTypeVerifies;
|
|
@@ -98,7 +103,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
98
103
|
verifySuperTypes() {
|
|
99
104
|
let superTypesVerify = false;
|
|
100
105
|
|
|
101
|
-
this.context.trace(`Verifying the super-types...`);
|
|
106
|
+
this.context.trace(`Verifying the super-types...`), this.node;
|
|
102
107
|
|
|
103
108
|
let superTypes;
|
|
104
109
|
|
|
@@ -119,7 +124,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
119
124
|
if (typeBasic) {
|
|
120
125
|
superTypesVerify = true;
|
|
121
126
|
|
|
122
|
-
this.context.trace(`The '${typeString}' type is basic
|
|
127
|
+
this.context.trace(`The '${typeString}' type is basic.`, this.node)
|
|
123
128
|
} else {
|
|
124
129
|
const superTypeNames = superTypes.map((superType) => {
|
|
125
130
|
const superTypeName = superType.getName();
|
|
@@ -129,7 +134,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
129
134
|
superTypeNamesIncludesTypeName = superTypeNames.includes(typeName);
|
|
130
135
|
|
|
131
136
|
if (superTypeNamesIncludesTypeName) {
|
|
132
|
-
this.context.trace(`The '${typeName}' type cannot be a super-type `);
|
|
137
|
+
this.context.trace(`The '${typeName}' type cannot be a super-type `), this.node;
|
|
133
138
|
} else {
|
|
134
139
|
superTypesVerify = superTypes.every((superType) => {
|
|
135
140
|
const superTypeVerifies = this.verifySuperType(superType);
|
|
@@ -158,7 +163,7 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
158
163
|
}
|
|
159
164
|
|
|
160
165
|
if (superTypesVerify) {
|
|
161
|
-
this.context.debug(`...verified the super-types
|
|
166
|
+
this.context.debug(`...verified the super-types.`, this.node);
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
return superTypesVerify;
|
|
@@ -168,11 +173,12 @@ export default domAssigned(class SimpleTypeDeclaration {
|
|
|
168
173
|
|
|
169
174
|
static fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
170
175
|
const { Type } = dom,
|
|
176
|
+
node = simpleTypeDeclarationNode, ///
|
|
171
177
|
type = Type.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
172
178
|
typeName = type.getName(),
|
|
173
179
|
superTypes = type.getSuperTypes(),
|
|
174
180
|
string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
|
|
175
|
-
simpleTypeDeclaration = new SimpleTypeDeclaration(context, string, type);
|
|
181
|
+
simpleTypeDeclaration = new SimpleTypeDeclaration(context, node, string, type);
|
|
176
182
|
|
|
177
183
|
return simpleTypeDeclaration;
|
|
178
184
|
}
|
|
@@ -5,8 +5,9 @@ import dom from "../../dom";
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
6
|
|
|
7
7
|
export default domAssigned(class VariableDeclaration {
|
|
8
|
-
constructor(context, string, variable) {
|
|
8
|
+
constructor(context, node, string, variable) {
|
|
9
9
|
this.context = context;
|
|
10
|
+
this.node = node;
|
|
10
11
|
this.string = string;
|
|
11
12
|
this.variable = variable;
|
|
12
13
|
}
|
|
@@ -15,6 +16,10 @@ export default domAssigned(class VariableDeclaration {
|
|
|
15
16
|
return this.context;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
getNode() {
|
|
20
|
+
return this.node;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
getString() {
|
|
19
24
|
return this.string;
|
|
20
25
|
}
|
|
@@ -28,7 +33,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
28
33
|
|
|
29
34
|
const variableDeclarationString = this.getString();
|
|
30
35
|
|
|
31
|
-
this.context.trace(`Verifying the '${variableDeclarationString}' variable declaration
|
|
36
|
+
this.context.trace(`Verifying the '${variableDeclarationString}' variable declaration...`, this.node);
|
|
32
37
|
|
|
33
38
|
const variableTypeVerifies = this.verifyVariableType();
|
|
34
39
|
|
|
@@ -43,7 +48,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
if (verifies) {
|
|
46
|
-
this.context.debug(`...verified the '${variableDeclarationString}' variable declaration
|
|
51
|
+
this.context.debug(`...verified the '${variableDeclarationString}' variable declaration.`, this.node);
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
return verifies;
|
|
@@ -54,19 +59,19 @@ export default domAssigned(class VariableDeclaration {
|
|
|
54
59
|
|
|
55
60
|
const variableString = this.variable.getString();
|
|
56
61
|
|
|
57
|
-
this.context.trace(`Verifying the '${variableString}' variable
|
|
62
|
+
this.context.trace(`Verifying the '${variableString}' variable...`, this.node);
|
|
58
63
|
|
|
59
64
|
const variableIdentifier = this.variable.getIdentifier(),
|
|
60
65
|
variablePresent = this.context.isVariablePresentByVariableIdentifier(variableIdentifier);
|
|
61
66
|
|
|
62
67
|
if (variablePresent) {
|
|
63
|
-
this.context.debug(`The '${variableName}' variable is already present
|
|
68
|
+
this.context.debug(`The '${variableName}' variable is already present.`, this.node);
|
|
64
69
|
} else {
|
|
65
70
|
variableVerifies = true;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
if ( variableVerifies) {
|
|
69
|
-
this.context.debug(`...verified the '${variableString}' variable
|
|
74
|
+
this.context.debug(`...verified the '${variableString}' variable.`, this.node);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
return variableVerifies;
|
|
@@ -82,7 +87,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
82
87
|
const typeName = type.getName(),
|
|
83
88
|
typeString = type.getString();
|
|
84
89
|
|
|
85
|
-
this.context.trace(`Verifying the '${typeString}' type
|
|
90
|
+
this.context.trace(`Verifying the '${typeString}' type...`, this.node);
|
|
86
91
|
|
|
87
92
|
const includeSupertypes = false,
|
|
88
93
|
provisional = type.isProvisional(includeSupertypes);
|
|
@@ -92,14 +97,14 @@ export default domAssigned(class VariableDeclaration {
|
|
|
92
97
|
const typePresent = (type !== null)
|
|
93
98
|
|
|
94
99
|
if (!typePresent) {
|
|
95
|
-
this.context.debug(`The '${typeString}' type is not present
|
|
100
|
+
this.context.debug(`The '${typeString}' type is not present.`, this.node);
|
|
96
101
|
} else {
|
|
97
102
|
const provisionalMatches = type.matchProvisional(provisional);
|
|
98
103
|
|
|
99
104
|
if (!provisionalMatches) {
|
|
100
105
|
provisional ?
|
|
101
|
-
this.context.debug(`The '${typeString}' type is present but not provisional
|
|
102
|
-
this.context.debug(`The '${typeString}' type is present but provisional
|
|
106
|
+
this.context.debug(`The '${typeString}' type is present but not provisional.`, this.node) :
|
|
107
|
+
this.context.debug(`The '${typeString}' type is present but provisional.`, this.node);
|
|
103
108
|
} else {
|
|
104
109
|
this.variable.setType(type);
|
|
105
110
|
|
|
@@ -108,7 +113,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
if (variableTypeVerifies) {
|
|
111
|
-
this.context.debug(`...verified the '${typeString}' type
|
|
116
|
+
this.context.debug(`...verified the '${typeString}' type.`, this.node);
|
|
112
117
|
}
|
|
113
118
|
|
|
114
119
|
return variableTypeVerifies;
|
|
@@ -121,7 +126,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
121
126
|
node = variableDeclarationNode, ///
|
|
122
127
|
string = context.nodeAsString(node),
|
|
123
128
|
variable = Variable.fromVariableDeclarationNode(variableDeclarationNode, context),
|
|
124
|
-
variableDeclaration = new VariableDeclaration(context, string, variable);
|
|
129
|
+
variableDeclaration = new VariableDeclaration(context, node, string, variable);
|
|
125
130
|
|
|
126
131
|
return variableDeclaration;
|
|
127
132
|
}
|
package/src/dom/deduction.js
CHANGED
|
@@ -6,11 +6,16 @@ import { domAssigned } from "../dom";
|
|
|
6
6
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
7
7
|
|
|
8
8
|
export default domAssigned(class Deduction {
|
|
9
|
-
constructor(string, statement) {
|
|
9
|
+
constructor(node, string, statement) {
|
|
10
|
+
this.node = node;
|
|
10
11
|
this.string = string;
|
|
11
12
|
this.statement = statement;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
getNode(node) {
|
|
16
|
+
return this.node;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
getString() {
|
|
15
20
|
return this.string;
|
|
16
21
|
}
|
|
@@ -24,7 +29,7 @@ export default domAssigned(class Deduction {
|
|
|
24
29
|
|
|
25
30
|
const deductionString = this.string; ///
|
|
26
31
|
|
|
27
|
-
context.trace(`Verifying the '${deductionString}' deduction
|
|
32
|
+
context.trace(`Verifying the '${deductionString}' deduction...`, this.node);
|
|
28
33
|
|
|
29
34
|
if (this.statement !== null) {
|
|
30
35
|
const stated = true,
|
|
@@ -33,11 +38,11 @@ export default domAssigned(class Deduction {
|
|
|
33
38
|
|
|
34
39
|
verifies = statementVerifies; ///
|
|
35
40
|
} else {
|
|
36
|
-
context.debug(`Unable to verify the '${deductionString}' deduction because it is nonsense
|
|
41
|
+
context.debug(`Unable to verify the '${deductionString}' deduction because it is nonsense.`, this.node);
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
if (verifies) {
|
|
40
|
-
context.debug(`...verified the '${deductionString}' deduction
|
|
45
|
+
context.debug(`...verified the '${deductionString}' deduction.`, this.node);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
return verifies;
|
|
@@ -50,12 +55,12 @@ export default domAssigned(class Deduction {
|
|
|
50
55
|
statementString = statement.getString(),
|
|
51
56
|
deductionString = deduction.getString();
|
|
52
57
|
|
|
53
|
-
specificContext.trace(`Unifying the '${statementString}' statement with the '${deductionString}' deduction
|
|
58
|
+
specificContext.trace(`Unifying the '${statementString}' statement with the '${deductionString}' deduction...`, this.node);
|
|
54
59
|
|
|
55
60
|
statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
56
61
|
|
|
57
62
|
if (statementUnifies) {
|
|
58
|
-
specificContext.debug(`...unified the '${statementString}' statement with the '${deductionString}' deduction
|
|
63
|
+
specificContext.debug(`...unified the '${statementString}' statement with the '${deductionString}' deduction.`, this.node);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
return statementUnifies;
|
|
@@ -69,7 +74,7 @@ export default domAssigned(class Deduction {
|
|
|
69
74
|
generalDeductionString = this.string, ///
|
|
70
75
|
specificDeductionString = specificDeduction.getString();
|
|
71
76
|
|
|
72
|
-
context.trace(`Unifying the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction
|
|
77
|
+
context.trace(`Unifying the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction...`, this.node);
|
|
73
78
|
|
|
74
79
|
const statement = specificDeduction.getStatement(),
|
|
75
80
|
statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
@@ -77,7 +82,7 @@ export default domAssigned(class Deduction {
|
|
|
77
82
|
deductionUnifies = statementUnifies; ///
|
|
78
83
|
|
|
79
84
|
if (deductionUnifies) {
|
|
80
|
-
context.debug(`...unified the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction
|
|
85
|
+
context.debug(`...unified the '${specificDeductionString}' deduction with the '${generalDeductionString}' deduction.`, this.node);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
return deductionUnifies;
|
|
@@ -97,8 +102,9 @@ export default domAssigned(class Deduction {
|
|
|
97
102
|
|
|
98
103
|
static fromJSON(json, context) {
|
|
99
104
|
const statement = statementFromJSON(json, context),
|
|
105
|
+
node = null,
|
|
100
106
|
string = statement.getString(),
|
|
101
|
-
deduction = new Deduction(string, statement);
|
|
107
|
+
deduction = new Deduction(node, string, statement);
|
|
102
108
|
|
|
103
109
|
return deduction;
|
|
104
110
|
}
|
|
@@ -108,7 +114,7 @@ export default domAssigned(class Deduction {
|
|
|
108
114
|
node = deductionNode, ///
|
|
109
115
|
string = context.nodeAsString(node),
|
|
110
116
|
statement = Statement.fromDeductionNode(deductionNode, context),
|
|
111
|
-
deduction = new Deduction(string, statement);
|
|
117
|
+
deduction = new Deduction(node, string, statement);
|
|
112
118
|
|
|
113
119
|
return deduction;
|
|
114
120
|
}
|
package/src/dom/error.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { domAssigned } from "../dom";
|
|
4
4
|
|
|
5
5
|
export default domAssigned(class Error {
|
|
6
|
-
constructor(context, string) {
|
|
6
|
+
constructor(context, node, string) {
|
|
7
7
|
this.context = context;
|
|
8
|
+
this.node = node;
|
|
8
9
|
this.string = string;
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -12,6 +13,10 @@ export default domAssigned(class Error {
|
|
|
12
13
|
return this.context;
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
getNode() {
|
|
17
|
+
return this.node;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
getString() {
|
|
16
21
|
return this.string;
|
|
17
22
|
}
|
|
@@ -21,7 +26,7 @@ export default domAssigned(class Error {
|
|
|
21
26
|
|
|
22
27
|
const errorString = this.string; ///
|
|
23
28
|
|
|
24
|
-
this.context.warning(`The '${errorString}' error cannot be verified
|
|
29
|
+
this.context.warning(`The '${errorString}' error cannot be verified.`, this.node);
|
|
25
30
|
|
|
26
31
|
return verifies;
|
|
27
32
|
}
|
|
@@ -31,7 +36,7 @@ export default domAssigned(class Error {
|
|
|
31
36
|
static fromErrorNode(errorNode, context) {
|
|
32
37
|
const node = errorNode, ///
|
|
33
38
|
string = context.nodeAsString(node),
|
|
34
|
-
error = new Error(context, string);
|
|
39
|
+
error = new Error(context, node, string);
|
|
35
40
|
|
|
36
41
|
return error;
|
|
37
42
|
}
|
package/src/dom/hypothesis.js
CHANGED
|
@@ -8,11 +8,16 @@ import { subproofAssertionFromStatement } from "../utilities/context";
|
|
|
8
8
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
10
|
export default domAssigned(class Hypothesis {
|
|
11
|
-
constructor(string, statement) {
|
|
11
|
+
constructor(node, string, statement) {
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.statement = statement;
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
getNode() {
|
|
18
|
+
return this.node;
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
getString() {
|
|
17
22
|
return this.string;
|
|
18
23
|
}
|
|
@@ -26,7 +31,7 @@ export default domAssigned(class Hypothesis {
|
|
|
26
31
|
|
|
27
32
|
const hypothesisString = this.string; ///
|
|
28
33
|
|
|
29
|
-
context.trace(`Verifying the '${hypothesisString}' hypothesis
|
|
34
|
+
context.trace(`Verifying the '${hypothesisString}' hypothesis...`, this.node);
|
|
30
35
|
|
|
31
36
|
if (false) {
|
|
32
37
|
///
|
|
@@ -49,11 +54,11 @@ export default domAssigned(class Hypothesis {
|
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
56
|
} else {
|
|
52
|
-
context.debug(`Unable to verify the '${hypothesisString}' hypothesis because it is nonsense
|
|
57
|
+
context.debug(`Unable to verify the '${hypothesisString}' hypothesis because it is nonsense.`, this.node);
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
if (verifies) {
|
|
56
|
-
context.debug(`...verified the '${hypothesisString}' hypothesis
|
|
61
|
+
context.debug(`...verified the '${hypothesisString}' hypothesis.`, this.node);
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
return verifies;
|
|
@@ -65,7 +70,7 @@ export default domAssigned(class Hypothesis {
|
|
|
65
70
|
const stepString = step.getString(),
|
|
66
71
|
hypothesisString = this.string; ///
|
|
67
72
|
|
|
68
|
-
context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${stepString}' step
|
|
73
|
+
context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${stepString}' step...`, this.node);
|
|
69
74
|
|
|
70
75
|
const stepStatement = step.getStatement(),
|
|
71
76
|
statementEqualToStepStatement = this.statement.isEqualTo(stepStatement);
|
|
@@ -75,7 +80,7 @@ export default domAssigned(class Hypothesis {
|
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
if (equalToStep) {
|
|
78
|
-
context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${stepString}' step
|
|
83
|
+
context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${stepString}' step.`, this.node);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
return equalToStep;
|
|
@@ -102,7 +107,8 @@ export default domAssigned(class Hypothesis {
|
|
|
102
107
|
string = statement.getString();
|
|
103
108
|
}
|
|
104
109
|
|
|
105
|
-
const
|
|
110
|
+
const node = null,
|
|
111
|
+
hypothesis = new Hypothesis(node, string, statement);
|
|
106
112
|
|
|
107
113
|
return hypothesis;
|
|
108
114
|
}
|
|
@@ -112,7 +118,7 @@ export default domAssigned(class Hypothesis {
|
|
|
112
118
|
node = hypothesisNode, ///
|
|
113
119
|
string = context.nodeAsString(node),
|
|
114
120
|
statement = Statement.fromHypothesisNode(hypothesisNode, context),
|
|
115
|
-
hypothesis = new Hypothesis(string, statement);
|
|
121
|
+
hypothesis = new Hypothesis(node, string, statement);
|
|
116
122
|
|
|
117
123
|
return hypothesis
|
|
118
124
|
}
|
package/src/dom/lemma.js
CHANGED
|
@@ -9,12 +9,13 @@ export default domAssigned(class Lemma extends TopLevelAssertion {
|
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
11
|
const lemma = this, ///
|
|
12
|
+
node = this.getNode(),
|
|
12
13
|
context = this.getContext(),
|
|
13
14
|
lemmaString = lemma.getString();
|
|
14
15
|
|
|
15
16
|
(lemmaString === null) ?
|
|
16
|
-
context.trace(`Verifying a lemma
|
|
17
|
-
context.trace(`Verifying the '${lemmaString}' lemma
|
|
17
|
+
context.trace(`Verifying a lemma...`, node) :
|
|
18
|
+
context.trace(`Verifying the '${lemmaString}' lemma...`, node);
|
|
18
19
|
|
|
19
20
|
verifies = super.verify();
|
|
20
21
|
|
|
@@ -24,8 +25,8 @@ export default domAssigned(class Lemma extends TopLevelAssertion {
|
|
|
24
25
|
context.addLemma(lemma);
|
|
25
26
|
|
|
26
27
|
(lemmaString === null) ?
|
|
27
|
-
context.debug(`...verified a lemma
|
|
28
|
-
context.debug(`...verified the '${lemmaString}' lemma
|
|
28
|
+
context.debug(`...verified a lemma.`, node) :
|
|
29
|
+
context.debug(`...verified the '${lemmaString}' lemma.`, node);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
return verifies;
|
package/src/dom/metaLemma.js
CHANGED
|
@@ -8,11 +8,12 @@ export default domAssigned(class MetaLemma extends TopLevelMetaAssertion {
|
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const node = this.getNode(),
|
|
12
|
+
context = this.getContext(),
|
|
12
13
|
metaLemma = this, ///
|
|
13
14
|
metaLemmaString = metaLemma.getString();
|
|
14
15
|
|
|
15
|
-
context.trace(`Verifying the '${metaLemmaString}' meta-lemma
|
|
16
|
+
context.trace(`Verifying the '${metaLemmaString}' meta-lemma...`, node);
|
|
16
17
|
|
|
17
18
|
verifies = super.verify();
|
|
18
19
|
|
|
@@ -21,7 +22,7 @@ export default domAssigned(class MetaLemma extends TopLevelMetaAssertion {
|
|
|
21
22
|
|
|
22
23
|
context.addMetatheorem(metaTheorem);
|
|
23
24
|
|
|
24
|
-
context.debug(`...verified the '${metaLemmaString}' meta-lemma
|
|
25
|
+
context.debug(`...verified the '${metaLemmaString}' meta-lemma.`, node);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
return verifies;
|
package/src/dom/metatheorem.js
CHANGED
|
@@ -8,11 +8,12 @@ export default domAssigned(class Metatheorem extends TopLevelMetaAssertion {
|
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const node = this.getNode(),
|
|
12
|
+
context = this.getContext(),
|
|
12
13
|
metaLemma = this, ///
|
|
13
14
|
metaLemmaString = metaLemma.getString();
|
|
14
15
|
|
|
15
|
-
context.trace(`Verifying the '${metaLemmaString}' metatheorem
|
|
16
|
+
context.trace(`Verifying the '${metaLemmaString}' metatheorem...`, node);
|
|
16
17
|
|
|
17
18
|
verifies = super.verify();
|
|
18
19
|
|
|
@@ -21,7 +22,7 @@ export default domAssigned(class Metatheorem extends TopLevelMetaAssertion {
|
|
|
21
22
|
|
|
22
23
|
context.addMetatheorem(metaTheorem);
|
|
23
24
|
|
|
24
|
-
context.debug(`...verified the '${metaLemmaString}' metatheorem
|
|
25
|
+
context.debug(`...verified the '${metaLemmaString}' metatheorem.`, node);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
return verifies;
|