occam-verify-cli 1.0.826 → 1.0.827
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/element/declaration/combinator.js +5 -6
- package/lib/element/declaration/complexType.js +23 -24
- package/lib/element/declaration/constructor.js +8 -9
- package/lib/element/declaration/metavariable.js +8 -9
- package/lib/element/declaration/simpleType.js +17 -18
- package/lib/element/declaration/typePrefix.js +5 -6
- package/lib/element/declaration/variable.js +8 -9
- package/lib/element/error.js +3 -3
- package/lib/element/proofAssertion/premise.js +5 -5
- package/lib/element/proofAssertion/step.js +3 -3
- package/lib/element/proofAssertion/supposition.js +5 -5
- package/lib/element/rule.js +8 -9
- package/lib/element/section.js +3 -3
- package/lib/element/topLevelAssertion/axiom.js +3 -4
- package/lib/element/topLevelAssertion/conjecture.js +3 -4
- package/lib/element/topLevelAssertion/lemma.js +3 -4
- package/lib/element/topLevelAssertion/theorem.js +3 -4
- package/lib/element/topLevelAssertion.js +3 -3
- package/lib/element/topLevelMetaAssertion/metaLemma.js +3 -4
- package/lib/element/topLevelMetaAssertion/metatheorem.js +3 -4
- package/lib/element/topLevelMetaAssertion.js +6 -6
- package/lib/process/verify.js +17 -17
- package/lib/utilities/element.js +80 -38
- package/package.json +1 -1
- package/src/element/declaration/combinator.js +4 -7
- package/src/element/declaration/complexType.js +22 -31
- package/src/element/declaration/constructor.js +7 -11
- package/src/element/declaration/metavariable.js +7 -11
- package/src/element/declaration/simpleType.js +17 -24
- package/src/element/declaration/typePrefix.js +4 -7
- package/src/element/declaration/variable.js +7 -11
- package/src/element/error.js +2 -3
- package/src/element/proofAssertion/premise.js +4 -4
- package/src/element/proofAssertion/step.js +2 -2
- package/src/element/proofAssertion/supposition.js +4 -4
- package/src/element/rule.js +7 -11
- package/src/element/section.js +2 -3
- package/src/element/topLevelAssertion/axiom.js +2 -4
- package/src/element/topLevelAssertion/conjecture.js +2 -4
- package/src/element/topLevelAssertion/lemma.js +2 -4
- package/src/element/topLevelAssertion/theorem.js +2 -4
- package/src/element/topLevelAssertion.js +2 -3
- package/src/element/topLevelMetaAssertion/metaLemma.js +2 -4
- package/src/element/topLevelMetaAssertion/metatheorem.js +2 -4
- package/src/element/topLevelMetaAssertion.js +5 -7
- package/src/process/verify.js +16 -16
- package/src/utilities/element.js +133 -70
package/package.json
CHANGED
|
@@ -22,18 +22,16 @@ export default define(class CombinatorDeclaration extends Declaration {
|
|
|
22
22
|
return combinatorDeclarationNode;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async verify() {
|
|
25
|
+
async verify(context) {
|
|
26
26
|
let verifies = false;
|
|
27
27
|
|
|
28
|
-
const context = this.getContext();
|
|
29
|
-
|
|
30
28
|
await this.break(context);
|
|
31
29
|
|
|
32
30
|
const combinatorDeclarationString = this.getString(); ///
|
|
33
31
|
|
|
34
32
|
context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`);
|
|
35
33
|
|
|
36
|
-
const combinatorValidates = this.validateCombinator();
|
|
34
|
+
const combinatorValidates = this.validateCombinator(context);
|
|
37
35
|
|
|
38
36
|
if (combinatorValidates) {
|
|
39
37
|
context.addCombinator(this.combinator);
|
|
@@ -48,11 +46,10 @@ export default define(class CombinatorDeclaration extends Declaration {
|
|
|
48
46
|
return verifies;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
validateCombinator() {
|
|
49
|
+
validateCombinator(context) {
|
|
52
50
|
let combinatorValidates;
|
|
53
51
|
|
|
54
|
-
const
|
|
55
|
-
combinatorString = this.combinator.getString(),
|
|
52
|
+
const combinatorString = this.combinator.getString(),
|
|
56
53
|
combinatorDeclarationString = this.getString(); ///
|
|
57
54
|
|
|
58
55
|
context.trace(`Validating the '${combinatorDeclarationString}' combinator declaration's '${combinatorString}' combinator...`);
|
|
@@ -27,11 +27,9 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
27
27
|
return complexTypeDeclarationNode;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async verify() {
|
|
30
|
+
async verify(context) {
|
|
31
31
|
let verifies = false;
|
|
32
32
|
|
|
33
|
-
const context = this.getContext();
|
|
34
|
-
|
|
35
33
|
await this.break(context);
|
|
36
34
|
|
|
37
35
|
const complexTypeDeclarationString = this.getString(); ///
|
|
@@ -43,13 +41,13 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
43
41
|
|
|
44
42
|
context.trace(`The '${typeString}' type is prefixed.`);
|
|
45
43
|
} else {
|
|
46
|
-
const typeVerifies = this.verifyType();
|
|
44
|
+
const typeVerifies = this.verifyType(context);
|
|
47
45
|
|
|
48
46
|
if (typeVerifies) {
|
|
49
|
-
const superTypesVerify = this.verifySuperTypes();
|
|
47
|
+
const superTypesVerify = this.verifySuperTypes(context);
|
|
50
48
|
|
|
51
49
|
if (superTypesVerify) {
|
|
52
|
-
const propertiesVerify = this.verifyProperties();
|
|
50
|
+
const propertiesVerify = this.verifyProperties(context);
|
|
53
51
|
|
|
54
52
|
if (propertiesVerify) {
|
|
55
53
|
const typePrefix = context.getTypePrefix();
|
|
@@ -76,11 +74,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
76
74
|
return verifies;
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
verifyType() {
|
|
77
|
+
verifyType(context) {
|
|
80
78
|
let typeVerifies = false;
|
|
81
79
|
|
|
82
|
-
const
|
|
83
|
-
typeString = this.type.getString();
|
|
80
|
+
const typeString = this.type.getString();
|
|
84
81
|
|
|
85
82
|
context.trace(`Verifying the '${typeString}' complex type...`);
|
|
86
83
|
|
|
@@ -108,11 +105,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
108
105
|
return typeVerifies;
|
|
109
106
|
}
|
|
110
107
|
|
|
111
|
-
verifySuperType(superType) {
|
|
108
|
+
verifySuperType(context, superType) {
|
|
112
109
|
let superTypeVerifies = false;
|
|
113
110
|
|
|
114
|
-
const
|
|
115
|
-
superTypeString = superType.getString();
|
|
111
|
+
const superTypeString = superType.getString();
|
|
116
112
|
|
|
117
113
|
context.trace(`Verifying the '${superTypeString}' super-type...`);
|
|
118
114
|
|
|
@@ -145,11 +141,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
145
141
|
return superTypeVerifies;
|
|
146
142
|
}
|
|
147
143
|
|
|
148
|
-
verifySuperTypes() {
|
|
144
|
+
verifySuperTypes(context) {
|
|
149
145
|
let superTypesVerify;
|
|
150
146
|
|
|
151
|
-
const
|
|
152
|
-
typeString = this.type.getString();
|
|
147
|
+
const typeString = this.type.getString();
|
|
153
148
|
|
|
154
149
|
context.trace(`Verifying the '${typeString}' complex type's super-types...`);
|
|
155
150
|
|
|
@@ -163,7 +158,7 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
163
158
|
const superTypes = this.type.getSuperTypes();
|
|
164
159
|
|
|
165
160
|
superTypesVerify = superTypes.every((superType) => {
|
|
166
|
-
const superTypeVerifies = this.verifySuperType(superType);
|
|
161
|
+
const superTypeVerifies = this.verifySuperType(context, superType);
|
|
167
162
|
|
|
168
163
|
if (superTypeVerifies) {
|
|
169
164
|
return true;
|
|
@@ -178,18 +173,17 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
178
173
|
return superTypesVerify;
|
|
179
174
|
}
|
|
180
175
|
|
|
181
|
-
verifyProperty(property, properties) {
|
|
176
|
+
verifyProperty(context, property, properties) {
|
|
182
177
|
let propertyVerifies = false;
|
|
183
178
|
|
|
184
|
-
const
|
|
185
|
-
propertyString = property.getString();
|
|
179
|
+
const propertyString = property.getString();
|
|
186
180
|
|
|
187
181
|
context.trace(`Verifying the '${propertyString}' property...`);
|
|
188
182
|
|
|
189
|
-
const propertyNameVerifies = this.verifyPropertyName(property, properties);
|
|
183
|
+
const propertyNameVerifies = this.verifyPropertyName(context, property, properties);
|
|
190
184
|
|
|
191
185
|
if (propertyNameVerifies) {
|
|
192
|
-
const propertyNominalTypeNameVerifies = this.verifyPropertyNominalTypeName(property, properties);
|
|
186
|
+
const propertyNominalTypeNameVerifies = this.verifyPropertyNominalTypeName(context, property, properties);
|
|
193
187
|
|
|
194
188
|
if (propertyNominalTypeNameVerifies) {
|
|
195
189
|
propertyVerifies = true;
|
|
@@ -203,11 +197,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
203
197
|
return propertyVerifies;
|
|
204
198
|
}
|
|
205
199
|
|
|
206
|
-
verifyProperties() {
|
|
200
|
+
verifyProperties(context) {
|
|
207
201
|
let propertiesVerify;
|
|
208
202
|
|
|
209
|
-
const
|
|
210
|
-
typeString = this.type.getString();
|
|
203
|
+
const typeString = this.type.getString();
|
|
211
204
|
|
|
212
205
|
context.trace(`Verifying the '${typeString}' complex type's properties...`);
|
|
213
206
|
|
|
@@ -215,7 +208,7 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
215
208
|
properties = this.type.getProperties(includeSuperTypes);
|
|
216
209
|
|
|
217
210
|
propertiesVerify = properties.every((property) => {
|
|
218
|
-
const propertyVerifies = this.verifyProperty(property, properties);
|
|
211
|
+
const propertyVerifies = this.verifyProperty(context, property, properties);
|
|
219
212
|
|
|
220
213
|
if (propertyVerifies) {
|
|
221
214
|
return true;
|
|
@@ -229,11 +222,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
229
222
|
return propertiesVerify;
|
|
230
223
|
}
|
|
231
224
|
|
|
232
|
-
verifyPropertyName(property, properties) {
|
|
225
|
+
verifyPropertyName(context, property, properties) {
|
|
233
226
|
let propertyNameVerifies = false;
|
|
234
227
|
|
|
235
|
-
const
|
|
236
|
-
propertyString = property.getString();
|
|
228
|
+
const propertyString = property.getString();
|
|
237
229
|
|
|
238
230
|
context.trace(`Verifying the '${propertyString}' property's name...`);
|
|
239
231
|
|
|
@@ -283,11 +275,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
283
275
|
return propertyNameVerifies;
|
|
284
276
|
}
|
|
285
277
|
|
|
286
|
-
verifyPropertyNominalTypeName(property) {
|
|
278
|
+
verifyPropertyNominalTypeName(context, property) {
|
|
287
279
|
let propertyNominalTypeNameVerifies = false;
|
|
288
280
|
|
|
289
|
-
const
|
|
290
|
-
propertyString = property.getString(),
|
|
281
|
+
const propertyString = property.getString(),
|
|
291
282
|
nominalTypeName = property.getNominalTypeName();
|
|
292
283
|
|
|
293
284
|
context.trace(`Verifying the '${propertyString}' property's '${nominalTypeName}' nominal type name...`);
|
|
@@ -32,21 +32,19 @@ export default define(class ConstructorDeclaration extends Declaration {
|
|
|
32
32
|
return constructorDeclarationNode;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async verify() {
|
|
35
|
+
async verify(context) {
|
|
36
36
|
let verifies = false;
|
|
37
37
|
|
|
38
|
-
const context = this.getContext();
|
|
39
|
-
|
|
40
38
|
await this.break(context);
|
|
41
39
|
|
|
42
40
|
const constructorDeclarationString = this.getString(); ///
|
|
43
41
|
|
|
44
42
|
context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`);
|
|
45
43
|
|
|
46
|
-
const typeVerified = this.verifyType();
|
|
44
|
+
const typeVerified = this.verifyType(context);
|
|
47
45
|
|
|
48
46
|
if (typeVerified) {
|
|
49
|
-
const constructorValidates = this.validateConstructor();
|
|
47
|
+
const constructorValidates = this.validateConstructor(context);
|
|
50
48
|
|
|
51
49
|
if (constructorValidates) {
|
|
52
50
|
this.constructor.setType(this.type);
|
|
@@ -64,11 +62,10 @@ export default define(class ConstructorDeclaration extends Declaration {
|
|
|
64
62
|
return verifies;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
verifyType() {
|
|
65
|
+
verifyType(context) {
|
|
68
66
|
let typeVerifies = false;
|
|
69
67
|
|
|
70
|
-
const
|
|
71
|
-
typeString = this.type.getString(),
|
|
68
|
+
const typeString = this.type.getString(),
|
|
72
69
|
constructorDeclarationString = this.getString(); ///
|
|
73
70
|
|
|
74
71
|
context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration's '${typeString}' type...`);
|
|
@@ -100,11 +97,10 @@ export default define(class ConstructorDeclaration extends Declaration {
|
|
|
100
97
|
return typeVerifies;
|
|
101
98
|
}
|
|
102
99
|
|
|
103
|
-
validateConstructor() {
|
|
100
|
+
validateConstructor(context) {
|
|
104
101
|
let constructorValidates;
|
|
105
102
|
|
|
106
|
-
const
|
|
107
|
-
includeType = false,
|
|
103
|
+
const includeType = false,
|
|
108
104
|
constructorString = this.constructor.getString(includeType),
|
|
109
105
|
constructorDeclarationString = this.getString(); ///
|
|
110
106
|
|
|
@@ -20,21 +20,19 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
20
20
|
return this.metavariable;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
async verify() {
|
|
23
|
+
async verify(context) {
|
|
24
24
|
let verifies;
|
|
25
25
|
|
|
26
|
-
const context = this.getContext();
|
|
27
|
-
|
|
28
26
|
await this.break(context);
|
|
29
27
|
|
|
30
28
|
const metavariableDeclarationString = this.getString(); ///
|
|
31
29
|
|
|
32
30
|
context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration...`);
|
|
33
31
|
|
|
34
|
-
const metavariableVerifies = this.verifyMetavariable();
|
|
32
|
+
const metavariableVerifies = this.verifyMetavariable(context);
|
|
35
33
|
|
|
36
34
|
if (metavariableVerifies) {
|
|
37
|
-
const metaTypeVerifies = this.verifyMetaType();
|
|
35
|
+
const metaTypeVerifies = this.verifyMetaType(context);
|
|
38
36
|
|
|
39
37
|
if (metaTypeVerifies) {
|
|
40
38
|
const declaredMetavariable = this.metavariable; ///
|
|
@@ -52,11 +50,10 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
52
50
|
return verifies;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
verifyMetaType() {
|
|
53
|
+
verifyMetaType(context) {
|
|
56
54
|
let metaTypeVerifies = true;
|
|
57
55
|
|
|
58
|
-
const
|
|
59
|
-
metaTypeString = this.metaType.getString(),
|
|
56
|
+
const metaTypeString = this.metaType.getString(),
|
|
60
57
|
metaTypeDeclarationString = this.getString(); ///
|
|
61
58
|
|
|
62
59
|
context.trace(`Verifying the '${metaTypeDeclarationString}' metavariable declaration's '${metaTypeString}' metaType...`);
|
|
@@ -70,11 +67,10 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
70
67
|
return metaTypeVerifies;
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
verifyMetavariable() {
|
|
70
|
+
verifyMetavariable(context) {
|
|
74
71
|
let metavariableVerifies = false;
|
|
75
72
|
|
|
76
|
-
const
|
|
77
|
-
metavariableString = this.metavariable.getString(),
|
|
73
|
+
const metavariableString = this.metavariable.getString(),
|
|
78
74
|
metavariableDeclarationString = this.getString(); ///
|
|
79
75
|
|
|
80
76
|
context.trace(`Verifying the '${metavariableDeclarationString}' metavariable declaration's '${metavariableString}' metavariable...`);
|
|
@@ -34,27 +34,25 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
34
34
|
return simpleTypeDeclarationNode;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
async verify() {
|
|
37
|
+
async verify(context) {
|
|
38
38
|
let verifies = false;
|
|
39
39
|
|
|
40
|
-
const context = this.getContext();
|
|
41
|
-
|
|
42
40
|
await this.break(context);
|
|
43
41
|
|
|
44
42
|
const simpleTypeDeclarationString = this.getString(); ///
|
|
45
43
|
|
|
46
44
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration...`);
|
|
47
45
|
|
|
48
|
-
const typeVerifies = this.verifyType();
|
|
46
|
+
const typeVerifies = this.verifyType(context);
|
|
49
47
|
|
|
50
48
|
if (typeVerifies) {
|
|
51
|
-
const superTypesVerify = this.verifySuperTypes();
|
|
49
|
+
const superTypesVerify = this.verifySuperTypes(context);
|
|
52
50
|
|
|
53
51
|
if (superTypesVerify) {
|
|
54
|
-
const typePrefixVerifies = this.verifyTypePrefix();
|
|
52
|
+
const typePrefixVerifies = this.verifyTypePrefix(context);
|
|
55
53
|
|
|
56
54
|
if (typePrefixVerifies) {
|
|
57
|
-
const propertiesVerifies = this.verifyProperties();
|
|
55
|
+
const propertiesVerifies = this.verifyProperties(context);
|
|
58
56
|
|
|
59
57
|
if (propertiesVerifies) {
|
|
60
58
|
context.addType(this.type);
|
|
@@ -72,11 +70,10 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
72
70
|
return verifies;
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
verifyType() {
|
|
73
|
+
verifyType(context) {
|
|
76
74
|
let typeVerifies = false;
|
|
77
75
|
|
|
78
|
-
const
|
|
79
|
-
typeString = this.type.getString(),
|
|
76
|
+
const typeString = this.type.getString(),
|
|
80
77
|
simpleTypeDeclarationString = this.getString(); ///
|
|
81
78
|
|
|
82
79
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration's '${typeString}' type...`);
|
|
@@ -107,11 +104,10 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
107
104
|
return typeVerifies;
|
|
108
105
|
}
|
|
109
106
|
|
|
110
|
-
verifySuperType(superType, superTypes) {
|
|
107
|
+
verifySuperType(context, superType, superTypes) {
|
|
111
108
|
let superTypeVerifies = false;
|
|
112
109
|
|
|
113
|
-
const
|
|
114
|
-
superTypeString = superType.getString(),
|
|
110
|
+
const superTypeString = superType.getString(),
|
|
115
111
|
simpleTypeDeclarationString = this.getString(); ///;
|
|
116
112
|
|
|
117
113
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration's '${superTypeString}' super-type...`);
|
|
@@ -141,11 +137,10 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
141
137
|
return superTypeVerifies;
|
|
142
138
|
}
|
|
143
139
|
|
|
144
|
-
verifySuperTypes() {
|
|
140
|
+
verifySuperTypes(context) {
|
|
145
141
|
let superTypesVerify;
|
|
146
142
|
|
|
147
|
-
const
|
|
148
|
-
superTypes = [],
|
|
143
|
+
const superTypes = [],
|
|
149
144
|
superTypesString = superTypesStringFromSuperTypes(this.superTypes),
|
|
150
145
|
simpleTypeDeclarationString = this.getString(); ///;
|
|
151
146
|
|
|
@@ -154,7 +149,7 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
154
149
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration's super-types...`);
|
|
155
150
|
|
|
156
151
|
superTypesVerify = this.superTypes.every((superType) => {
|
|
157
|
-
const superTypeVerifies = this.verifySuperType(superType, superTypes);
|
|
152
|
+
const superTypeVerifies = this.verifySuperType(context, superType, superTypes);
|
|
158
153
|
|
|
159
154
|
if (superTypeVerifies) {
|
|
160
155
|
return true;
|
|
@@ -181,12 +176,11 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
181
176
|
return superTypesVerify;
|
|
182
177
|
}
|
|
183
178
|
|
|
184
|
-
verifyTypePrefix() {
|
|
179
|
+
verifyTypePrefix(context) {
|
|
185
180
|
let typePrefixVerifies = false;
|
|
186
181
|
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
simpleTypeDeclarationString = this.getString(); ///;
|
|
182
|
+
const typeString = this.type.getString(),
|
|
183
|
+
simpleTypeDeclarationString = this.getString(); ///;
|
|
190
184
|
|
|
191
185
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration's '${typeString}' type's prefix...`);
|
|
192
186
|
|
|
@@ -205,11 +199,10 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
205
199
|
return typePrefixVerifies;
|
|
206
200
|
}
|
|
207
201
|
|
|
208
|
-
verifyProperties() {
|
|
202
|
+
verifyProperties(context) {
|
|
209
203
|
let propertiesVerify = true; ///
|
|
210
204
|
|
|
211
|
-
const
|
|
212
|
-
typeString = this.type.getString(),
|
|
205
|
+
const typeString = this.type.getString(),
|
|
213
206
|
simpleTypeDeclarationString = this.getString(); ///;
|
|
214
207
|
|
|
215
208
|
context.trace(`Verifying the '${simpleTypeDeclarationString}' simple type declaration's '${typeString}' type's properties...`);
|
|
@@ -22,11 +22,9 @@ export default define(class TypePrefixDeclaration extends Declaration {
|
|
|
22
22
|
return typePrefixDeclarationNode;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async verify() {
|
|
25
|
+
async verify(context) {
|
|
26
26
|
let verifies = false;
|
|
27
27
|
|
|
28
|
-
const context = this.getContext();
|
|
29
|
-
|
|
30
28
|
await this.break(context);
|
|
31
29
|
|
|
32
30
|
const typePrefixDeclarationString = this.getString(); ///
|
|
@@ -37,7 +35,7 @@ export default define(class TypePrefixDeclaration extends Declaration {
|
|
|
37
35
|
typesLength = types.length;
|
|
38
36
|
|
|
39
37
|
if (typesLength === 0) {
|
|
40
|
-
const typePrefixVerifies = this.verifyTypePrefix();
|
|
38
|
+
const typePrefixVerifies = this.verifyTypePrefix(context);
|
|
41
39
|
|
|
42
40
|
if (typePrefixVerifies) {
|
|
43
41
|
context.addTypePrefix(this.typePrefix);
|
|
@@ -55,11 +53,10 @@ export default define(class TypePrefixDeclaration extends Declaration {
|
|
|
55
53
|
return verifies;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
verifyTypePrefix() {
|
|
56
|
+
verifyTypePrefix(context) {
|
|
59
57
|
let typePrefixVerifies = false;
|
|
60
58
|
|
|
61
|
-
const
|
|
62
|
-
typePrefixString = this.typePrefix.getString();
|
|
59
|
+
const typePrefixString = this.typePrefix.getString();
|
|
63
60
|
|
|
64
61
|
context.trace(`Verifying the '${typePrefixString}' type prefix...`);
|
|
65
62
|
|
|
@@ -32,21 +32,19 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
32
32
|
return variableDeclarationNode;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async verify() {
|
|
35
|
+
async verify(context) {
|
|
36
36
|
let verifies = false;
|
|
37
37
|
|
|
38
|
-
const context = this.getContext();
|
|
39
|
-
|
|
40
38
|
await this.break(context);
|
|
41
39
|
|
|
42
40
|
const variableDeclarationString = this.getString(); ///
|
|
43
41
|
|
|
44
42
|
context.trace(`Verifying the '${variableDeclarationString}' variable declaration...`);
|
|
45
43
|
|
|
46
|
-
const typeVerifies = this.verifyType();
|
|
44
|
+
const typeVerifies = this.verifyType(context);
|
|
47
45
|
|
|
48
46
|
if (typeVerifies) {
|
|
49
|
-
const variableVerifies = this.verifyVariable();
|
|
47
|
+
const variableVerifies = this.verifyVariable(context);
|
|
50
48
|
|
|
51
49
|
if (variableVerifies) {
|
|
52
50
|
const declaredVariable = this.variable;
|
|
@@ -64,11 +62,10 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
64
62
|
return verifies;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
verifyType() {
|
|
65
|
+
verifyType(context) {
|
|
68
66
|
let typeVerifies = false;
|
|
69
67
|
|
|
70
|
-
const
|
|
71
|
-
typeString = this.type.getString(),
|
|
68
|
+
const typeString = this.type.getString(),
|
|
72
69
|
variableDeclarationString = this.getString(); ///
|
|
73
70
|
|
|
74
71
|
context.trace(`Verifying the '${variableDeclarationString}' variable declaration's '${typeString}' type...`);
|
|
@@ -100,11 +97,10 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
100
97
|
return typeVerifies;
|
|
101
98
|
}
|
|
102
99
|
|
|
103
|
-
verifyVariable() {
|
|
100
|
+
verifyVariable(context) {
|
|
104
101
|
let variableVerifies = false;
|
|
105
102
|
|
|
106
|
-
const
|
|
107
|
-
variableString = this.variable.getString(),
|
|
103
|
+
const variableString = this.variable.getString(),
|
|
108
104
|
variableDeclarationString = this.getString(); ///
|
|
109
105
|
|
|
110
106
|
context.trace(`Verifying the '${variableDeclarationString}' variable declaration's '${variableString}' variable...`);
|
package/src/element/error.js
CHANGED
|
@@ -12,11 +12,10 @@ export default define(class Error extends Element {
|
|
|
12
12
|
return errorNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies = false;
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
errorString = this.getString(); ///
|
|
18
|
+
const errorString = this.getString(); ///
|
|
20
19
|
|
|
21
20
|
context.warning(`The '${errorString}' error cannot be verified.`);
|
|
22
21
|
|
|
@@ -8,8 +8,8 @@ import { procedureCallFromPremiseNode } from "../../utilities/element";
|
|
|
8
8
|
import { join, declare, attempt, reconcile, serialise, unserialise, instantiate } from "../../utilities/context";
|
|
9
9
|
|
|
10
10
|
export default define(class Premise extends ProofAssertion {
|
|
11
|
-
constructor(context, string, node, statement, procedureCall) {
|
|
12
|
-
super(context, string, node, statement);
|
|
11
|
+
constructor(context, string, node, lineIndex, statement, procedureCall) {
|
|
12
|
+
super(context, string, node, lineIndex, statement);
|
|
13
13
|
|
|
14
14
|
this.procedureCall = procedureCall;
|
|
15
15
|
}
|
|
@@ -305,13 +305,13 @@ export default define(class Premise extends ProofAssertion {
|
|
|
305
305
|
|
|
306
306
|
unserialise((json, context) => {
|
|
307
307
|
instantiate((context) => {
|
|
308
|
-
const { string } = json,
|
|
308
|
+
const { string, lineIndex } = json,
|
|
309
309
|
premiseNode = instantiatePremise(string, context),
|
|
310
310
|
node = premiseNode, ///
|
|
311
311
|
statement = statementFromPremiseNode(premiseNode, context),
|
|
312
312
|
procedureCall = procedureCallFromPremiseNode(premiseNode, context);
|
|
313
313
|
|
|
314
|
-
premise = new Premise(context, string, node, statement, procedureCall);
|
|
314
|
+
premise = new Premise(context, string, node, lineIndex, statement, procedureCall);
|
|
315
315
|
}, context);
|
|
316
316
|
}, json, context);
|
|
317
317
|
|
|
@@ -14,8 +14,8 @@ const { asyncSome } = asynchronousUtilities,
|
|
|
14
14
|
{ backwardsSome } = arrayUtilities;
|
|
15
15
|
|
|
16
16
|
export default define(class Step extends ProofAssertion {
|
|
17
|
-
constructor(context, string, node, statement, reference, satisfiesAssertion) {
|
|
18
|
-
super(context, string, node, statement);
|
|
17
|
+
constructor(context, string, node, lineIndex, statement, reference, satisfiesAssertion) {
|
|
18
|
+
super(context, string, node, lineIndex, statement);
|
|
19
19
|
|
|
20
20
|
this.reference = reference;
|
|
21
21
|
this.satisfiesAssertion = satisfiesAssertion;
|
|
@@ -8,8 +8,8 @@ import { procedureCallFromSuppositionNode } from "../../utilities/element";
|
|
|
8
8
|
import { join, declare, attempt, reconcile, serialise, unserialise, instantiate } from "../../utilities/context";
|
|
9
9
|
|
|
10
10
|
export default define(class Supposition extends ProofAssertion {
|
|
11
|
-
constructor(context, string, node, statement, procedureCall) {
|
|
12
|
-
super(context, string, node, statement);
|
|
11
|
+
constructor(context, string, node, lineIndex, statement, procedureCall) {
|
|
12
|
+
super(context, string, node, lineIndex, statement);
|
|
13
13
|
|
|
14
14
|
this.procedureCall = procedureCall;
|
|
15
15
|
}
|
|
@@ -327,13 +327,13 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
327
327
|
|
|
328
328
|
unserialise((json, context) => {
|
|
329
329
|
instantiate((context) => {
|
|
330
|
-
const { string } = json,
|
|
330
|
+
const { string, lineIndex } = json,
|
|
331
331
|
suppositionNode = instantiateSupposition(string, context),
|
|
332
332
|
node = suppositionNode, ///
|
|
333
333
|
statement = statementFromSuppositionNode(suppositionNode, context),
|
|
334
334
|
procedureCall = procedureCallFromSuppositionNode(suppositionNode, context);
|
|
335
335
|
|
|
336
|
-
supposition = new Supposition(context, string, node, statement, procedureCall);
|
|
336
|
+
supposition = new Supposition(context, string, node, lineIndex, statement, procedureCall);
|
|
337
337
|
}, context);
|
|
338
338
|
}, json, context);
|
|
339
339
|
|
package/src/element/rule.js
CHANGED
|
@@ -55,11 +55,9 @@ export default define(class Rule extends Element {
|
|
|
55
55
|
return metavariableNodeMatches;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
async verify() {
|
|
58
|
+
async verify(context) {
|
|
59
59
|
let verifies = false;
|
|
60
60
|
|
|
61
|
-
const context = this.getContext();
|
|
62
|
-
|
|
63
61
|
await this.break(context);
|
|
64
62
|
|
|
65
63
|
const ruleString = this.getString(); ///
|
|
@@ -67,7 +65,7 @@ export default define(class Rule extends Element {
|
|
|
67
65
|
context.trace(`Verifying the '${ruleString}' rule...`);
|
|
68
66
|
|
|
69
67
|
await enclose(async (context) => {
|
|
70
|
-
const labelsVerify = this.verifyLabels();
|
|
68
|
+
const labelsVerify = this.verifyLabels(context);
|
|
71
69
|
|
|
72
70
|
if (labelsVerify) {
|
|
73
71
|
const premisesVerify = await this.verifyPremises(context);
|
|
@@ -97,11 +95,10 @@ export default define(class Rule extends Element {
|
|
|
97
95
|
return verifies;
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
verifyLabel(label) {
|
|
98
|
+
verifyLabel(context, label) {
|
|
101
99
|
let labelVerifies;
|
|
102
100
|
|
|
103
|
-
const
|
|
104
|
-
ruleString = this.getString(), ///
|
|
101
|
+
const ruleString = this.getString(), ///
|
|
105
102
|
labelString = label.getString();
|
|
106
103
|
|
|
107
104
|
context.trace(`Verifying the '${ruleString}' rule's '${labelString}' label...`);
|
|
@@ -115,16 +112,15 @@ export default define(class Rule extends Element {
|
|
|
115
112
|
return labelVerifies;
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
verifyLabels() {
|
|
115
|
+
verifyLabels(context) {
|
|
119
116
|
let labelsVerify;
|
|
120
117
|
|
|
121
|
-
const
|
|
122
|
-
ruleString = this.getString(); ///
|
|
118
|
+
const ruleString = this.getString(); ///
|
|
123
119
|
|
|
124
120
|
context.trace(`Verifying the '${ruleString}' rule's labels...`);
|
|
125
121
|
|
|
126
122
|
labelsVerify = this.labels.every((label) => {
|
|
127
|
-
const labelVerifies = this.verifyLabel(label);
|
|
123
|
+
const labelVerifies = this.verifyLabel(context, label);
|
|
128
124
|
|
|
129
125
|
if (labelVerifies) {
|
|
130
126
|
return true;
|
package/src/element/section.js
CHANGED
|
@@ -42,11 +42,10 @@ export default define(class Section extends Element {
|
|
|
42
42
|
return sectionNode;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async verify() {
|
|
45
|
+
async verify(context) {
|
|
46
46
|
let verifies = false;
|
|
47
47
|
|
|
48
|
-
const
|
|
49
|
-
sectionString = this.getString(); ///
|
|
48
|
+
const sectionString = this.getString(); ///
|
|
50
49
|
|
|
51
50
|
context.trace(`Verifying the '${sectionString}' section...`);
|
|
52
51
|
|