occam-verify-cli 1.0.825 → 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/assertion/contained.js +9 -5
- package/lib/element/assertion/property.js +9 -5
- package/lib/element/assertion/satisfies.js +9 -5
- package/lib/element/assertion/subproof.js +9 -5
- package/lib/element/assertion/type.js +9 -9
- package/lib/element/assertion.js +4 -3
- package/lib/element/assumption.js +7 -6
- package/lib/element/combinator.js +8 -7
- package/lib/element/conclusion.js +8 -7
- package/lib/element/constructor.js +7 -6
- package/lib/element/declaration/combinator.js +7 -8
- package/lib/element/declaration/complexType.js +25 -26
- package/lib/element/declaration/constructor.js +10 -11
- package/lib/element/declaration/metavariable.js +10 -11
- package/lib/element/declaration/simpleType.js +19 -20
- package/lib/element/declaration/typePrefix.js +7 -8
- package/lib/element/declaration/variable.js +10 -11
- package/lib/element/deduction.js +8 -7
- package/lib/element/derivation.js +10 -3
- package/lib/element/equality.js +8 -7
- package/lib/element/equivalence.js +10 -3
- package/lib/element/error.js +10 -3
- package/lib/element/frame.js +8 -7
- package/lib/element/hypothesis.js +8 -7
- package/lib/element/judgement.js +8 -7
- package/lib/element/label.js +8 -7
- package/lib/element/metaType.js +7 -6
- package/lib/element/metavariable.js +6 -5
- package/lib/element/parameter.js +8 -7
- package/lib/element/procedureCall.js +8 -7
- package/lib/element/procedureReference.js +8 -7
- package/lib/element/proof.js +10 -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/proofAssertion.js +3 -3
- package/lib/element/property.js +7 -6
- package/lib/element/propertyRelation.js +8 -7
- package/lib/element/reference.js +8 -7
- package/lib/element/rule.js +13 -13
- package/lib/element/section.js +12 -5
- package/lib/element/signature.js +7 -6
- package/lib/element/statement.js +6 -5
- package/lib/element/subDerivation.js +10 -3
- package/lib/element/subproof.js +10 -3
- package/lib/element/substitution/frame.js +5 -5
- package/lib/element/substitution/reference.js +5 -5
- package/lib/element/substitution/statement.js +5 -5
- package/lib/element/substitution/term.js +5 -5
- package/lib/element/substitution.js +6 -5
- package/lib/element/term.js +7 -6
- 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 +9 -7
- package/lib/element/topLevelMetaAssertion/metaLemma.js +3 -4
- package/lib/element/topLevelMetaAssertion/metatheorem.js +3 -4
- package/lib/element/topLevelMetaAssertion.js +12 -10
- package/lib/element/type.js +9 -8
- package/lib/element/typePrefix.js +8 -7
- package/lib/element/variable.js +7 -6
- package/lib/process/verify.js +17 -17
- package/lib/utilities/element.js +127 -93
- package/package.json +4 -4
- package/src/element/assertion/contained.js +10 -4
- package/src/element/assertion/property.js +10 -4
- package/src/element/assertion/satisfies.js +10 -4
- package/src/element/assertion/subproof.js +10 -4
- package/src/element/assertion/type.js +13 -15
- package/src/element/assertion.js +3 -1
- package/src/element/assumption.js +7 -5
- package/src/element/combinator.js +7 -5
- package/src/element/conclusion.js +7 -5
- package/src/element/constructor.js +6 -4
- package/src/element/declaration/combinator.js +6 -9
- package/src/element/declaration/complexType.js +24 -33
- package/src/element/declaration/constructor.js +9 -13
- package/src/element/declaration/metavariable.js +9 -13
- package/src/element/declaration/simpleType.js +19 -26
- package/src/element/declaration/typePrefix.js +6 -9
- package/src/element/declaration/variable.js +9 -13
- package/src/element/deduction.js +7 -5
- package/src/element/derivation.js +13 -2
- package/src/element/equality.js +7 -5
- package/src/element/equivalence.js +13 -2
- package/src/element/error.js +13 -3
- package/src/element/frame.js +7 -5
- package/src/element/hypothesis.js +7 -5
- package/src/element/judgement.js +7 -5
- package/src/element/label.js +7 -5
- package/src/element/metaType.js +7 -4
- package/src/element/metavariable.js +6 -4
- package/src/element/parameter.js +7 -5
- package/src/element/procedureCall.js +7 -5
- package/src/element/procedureReference.js +7 -5
- package/src/element/proof.js +13 -2
- 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/proofAssertion.js +2 -2
- package/src/element/property.js +6 -4
- package/src/element/propertyRelation.js +7 -5
- package/src/element/reference.js +7 -5
- package/src/element/rule.js +15 -17
- package/src/element/section.js +15 -5
- package/src/element/signature.js +7 -5
- package/src/element/statement.js +5 -3
- package/src/element/subDerivation.js +13 -2
- package/src/element/subproof.js +13 -2
- package/src/element/substitution/frame.js +4 -4
- package/src/element/substitution/reference.js +4 -4
- package/src/element/substitution/statement.js +4 -4
- package/src/element/substitution/term.js +4 -4
- package/src/element/substitution.js +5 -3
- package/src/element/term.js +6 -4
- 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 +11 -7
- package/src/element/topLevelMetaAssertion/metaLemma.js +2 -4
- package/src/element/topLevelMetaAssertion/metatheorem.js +2 -4
- package/src/element/topLevelMetaAssertion.js +14 -11
- package/src/element/type.js +8 -5
- package/src/element/typePrefix.js +7 -5
- package/src/element/variable.js +6 -4
- package/src/process/verify.js +16 -16
- package/src/utilities/element.js +194 -84
|
@@ -9,8 +9,8 @@ const { last } = arrayUtilities,
|
|
|
9
9
|
{ asyncEvery } = asynchronousUtilities;
|
|
10
10
|
|
|
11
11
|
export default define(class SubDerivation extends Element {
|
|
12
|
-
constructor(context, string, node, subproofOrProofAssertions) {
|
|
13
|
-
super(context, string, node);
|
|
12
|
+
constructor(context, string, node, lineIndex, subproofOrProofAssertions) {
|
|
13
|
+
super(context, string, node, lineIndex);
|
|
14
14
|
|
|
15
15
|
this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
16
16
|
}
|
|
@@ -52,5 +52,16 @@ export default define(class SubDerivation extends Element {
|
|
|
52
52
|
return verifies;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
toJSON() {
|
|
56
|
+
const string = this.getString(),
|
|
57
|
+
lineIndex = this.getLineIndex(),
|
|
58
|
+
json = {
|
|
59
|
+
string,
|
|
60
|
+
lineIndex
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
static name = "SubDerivation";
|
|
56
67
|
});
|
package/src/element/subproof.js
CHANGED
|
@@ -8,8 +8,8 @@ import { enclose } from "../utilities/context";
|
|
|
8
8
|
const { asyncEvery } = asynchronousUtilities;
|
|
9
9
|
|
|
10
10
|
export default define(class Subproof extends Element {
|
|
11
|
-
constructor(context, string, node, suppositions, subDerivation) {
|
|
12
|
-
super(context, string, node);
|
|
11
|
+
constructor(context, string, node, lineIndex, suppositions, subDerivation) {
|
|
12
|
+
super(context, string, node, lineIndex);
|
|
13
13
|
|
|
14
14
|
this.suppositions = suppositions;
|
|
15
15
|
this.subDerivation = subDerivation;
|
|
@@ -147,5 +147,16 @@ export default define(class Subproof extends Element {
|
|
|
147
147
|
return unifiesWithSatisfiesAssertion;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
toJSON() {
|
|
151
|
+
const string = this.getString(),
|
|
152
|
+
lineIndex = this.getLineIndex(),
|
|
153
|
+
json = {
|
|
154
|
+
string,
|
|
155
|
+
lineIndex
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return json;
|
|
159
|
+
}
|
|
160
|
+
|
|
150
161
|
static name = "Subproof";
|
|
151
162
|
});
|
|
@@ -9,8 +9,8 @@ import { join, ablate, descend, attempt, instantiate } from "../../utilities/con
|
|
|
9
9
|
import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
|
|
10
10
|
|
|
11
11
|
export default define(class FrameSubstitution extends Substitution {
|
|
12
|
-
constructor(context, string, node, generalContext, targetFrame, replacementFrame) {
|
|
13
|
-
super(context, string, node, generalContext);
|
|
12
|
+
constructor(context, string, node, lineIndex, generalContext, targetFrame, replacementFrame) {
|
|
13
|
+
super(context, string, node, lineIndex, generalContext);
|
|
14
14
|
|
|
15
15
|
this.targetFrame = targetFrame;
|
|
16
16
|
this.replacementFrame = replacementFrame;
|
|
@@ -191,14 +191,14 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
191
191
|
|
|
192
192
|
if (this.name === name) {
|
|
193
193
|
instantiate((context) => {
|
|
194
|
-
const { string } = json,
|
|
194
|
+
const { string, lineIndex } = json,
|
|
195
195
|
frameSubstitutionNode = instantiateFrameSubstitution(string, context),
|
|
196
196
|
node = frameSubstitutionNode, ///
|
|
197
197
|
generalContext = generalContextFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
198
198
|
targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
199
199
|
replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context);
|
|
200
200
|
|
|
201
|
-
frameSubstitutionn = new FrameSubstitution(context, string, node, generalContext, targetFrame, replacementFrame);
|
|
201
|
+
frameSubstitutionn = new FrameSubstitution(context, string, node, lineIndex, generalContext, targetFrame, replacementFrame);
|
|
202
202
|
}, context);
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -9,8 +9,8 @@ import { referenceSubstitutionFromReferenceSubstitutionNode } from "../../utilit
|
|
|
9
9
|
import { referenceSubstitutionStringFromReferenceAndMetavariable } from "../../utilities/string";
|
|
10
10
|
|
|
11
11
|
export default define(class ReferenceSubstitution extends Substitution {
|
|
12
|
-
constructor(context, string, node, generalContext, targetReference, replacementReference) {
|
|
13
|
-
super(context, string, node, generalContext);
|
|
12
|
+
constructor(context, string, node, lineIndex, generalContext, targetReference, replacementReference) {
|
|
13
|
+
super(context, string, node, lineIndex, generalContext);
|
|
14
14
|
|
|
15
15
|
this.targetReference = targetReference;
|
|
16
16
|
this.replacementReference = replacementReference;
|
|
@@ -198,14 +198,14 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
198
198
|
|
|
199
199
|
if (this.name === name) {
|
|
200
200
|
instantiate((context) => {
|
|
201
|
-
const { string } = json,
|
|
201
|
+
const { string, lineIndex } = json,
|
|
202
202
|
referenceSubstitutionNode = instantiateReferenceSubstitution(string, context),
|
|
203
203
|
node = referenceSubstitutionNode, ///
|
|
204
204
|
generalContext = generalContextFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
205
205
|
targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
206
206
|
replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context);
|
|
207
207
|
|
|
208
|
-
referenceSubstitutionn = new ReferenceSubstitution(context, string, node, generalContext, targetReference, replacementReference);
|
|
208
|
+
referenceSubstitutionn = new ReferenceSubstitution(context, string, node, lineIndex, generalContext, targetReference, replacementReference);
|
|
209
209
|
}, context);
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -11,8 +11,8 @@ import { join, ablate, attempt, descend, reconcile, instantiate } from "../../ut
|
|
|
11
11
|
import { statementSubstitutionStringFromStatementAndMetavariable, statementSubstitutionStringFromStatementMetavariableAndSubstitution } from "../../utilities/string";
|
|
12
12
|
|
|
13
13
|
export default define(class StatementSubstitution extends Substitution {
|
|
14
|
-
constructor(context, string, node, generalContext, resolved, substitution, targetStatement, replacementStatement) {
|
|
15
|
-
super(context, string, node, generalContext);
|
|
14
|
+
constructor(context, string, node, lineIndex, generalContext, resolved, substitution, targetStatement, replacementStatement) {
|
|
15
|
+
super(context, string, node, lineIndex, generalContext);
|
|
16
16
|
|
|
17
17
|
this.resolved = resolved;
|
|
18
18
|
this.substitution = substitution;
|
|
@@ -384,7 +384,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
384
384
|
|
|
385
385
|
if (this.name === name) {
|
|
386
386
|
instantiate((context) => {
|
|
387
|
-
const { string } = json,
|
|
387
|
+
const { string, lineIndex } = json,
|
|
388
388
|
statementSubstitutionNode = instantiateStatementSubstitution(string, context),
|
|
389
389
|
node = statementSubstitutionNode, ///
|
|
390
390
|
generalContext = generalContextFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
@@ -393,7 +393,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
393
393
|
targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
394
394
|
replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context);
|
|
395
395
|
|
|
396
|
-
statementSubstitutionn = new StatementSubstitution(context, string, node, generalContext, resolved, substitution, targetStatement, replacementStatement);
|
|
396
|
+
statementSubstitutionn = new StatementSubstitution(context, string, node, lineIndex, generalContext, resolved, substitution, targetStatement, replacementStatement);
|
|
397
397
|
}, context);
|
|
398
398
|
}
|
|
399
399
|
|
|
@@ -10,8 +10,8 @@ import { termSubstitutionStringFromTermAndVariable } from "../../utilities/strin
|
|
|
10
10
|
import { join, ablate, descend, attempt, instantiate } from "../../utilities/context";
|
|
11
11
|
|
|
12
12
|
export default define(class TermSubstitution extends Substitution {
|
|
13
|
-
constructor(context, string, node, generalContext, targetTerm, replacementTerm) {
|
|
14
|
-
super(context, string, node, generalContext);
|
|
13
|
+
constructor(context, string, node, lineIndex, generalContext, targetTerm, replacementTerm) {
|
|
14
|
+
super(context, string, node, lineIndex, generalContext);
|
|
15
15
|
|
|
16
16
|
this.targetTerm = targetTerm;
|
|
17
17
|
this.replacementTerm = replacementTerm;
|
|
@@ -202,14 +202,14 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
202
202
|
|
|
203
203
|
if (this.name === name) {
|
|
204
204
|
instantiate((context) => {
|
|
205
|
-
const { string } = json,
|
|
205
|
+
const { string, lineIndex } = json,
|
|
206
206
|
termSubstitutionNode = instantiateTermSubstitution(string, context),
|
|
207
207
|
node = termSubstitutionNode, ///
|
|
208
208
|
generalContext = generalContextFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
209
209
|
targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
210
210
|
replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context);
|
|
211
211
|
|
|
212
|
-
termSubstitutionn = new TermSubstitution(context, string, node, generalContext, targetTerm, replacementTerm);
|
|
212
|
+
termSubstitutionn = new TermSubstitution(context, string, node, lineIndex, generalContext, targetTerm, replacementTerm);
|
|
213
213
|
}, context);
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -6,8 +6,8 @@ import { primitiveUtilities } from "occam-furtle";
|
|
|
6
6
|
const { primitiveFromNode } =primitiveUtilities;
|
|
7
7
|
|
|
8
8
|
export default class Substitution extends Element {
|
|
9
|
-
constructor(context, string, node, generalContext) {
|
|
10
|
-
super(context, string, node);
|
|
9
|
+
constructor(context, string, node, lineIndex, generalContext) {
|
|
10
|
+
super(context, string, node, lineIndex);
|
|
11
11
|
|
|
12
12
|
this.generalContext = generalContext;
|
|
13
13
|
}
|
|
@@ -138,9 +138,11 @@ export default class Substitution extends Element {
|
|
|
138
138
|
toJSON() {
|
|
139
139
|
const { name } = this.constructor,
|
|
140
140
|
string = this.getString(),
|
|
141
|
+
lineIndex = this.getLineIndex(),
|
|
141
142
|
json = {
|
|
142
143
|
name,
|
|
143
|
-
string
|
|
144
|
+
string,
|
|
145
|
+
lineIndex
|
|
144
146
|
};
|
|
145
147
|
|
|
146
148
|
return json;
|
package/src/element/term.js
CHANGED
|
@@ -13,8 +13,8 @@ import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
|
13
13
|
const { filter } = arrayUtilities;
|
|
14
14
|
|
|
15
15
|
export default define(class Term extends Element {
|
|
16
|
-
constructor(context, string, node, type) {
|
|
17
|
-
super(context, string, node);
|
|
16
|
+
constructor(context, string, node, lineIndex, type) {
|
|
17
|
+
super(context, string, node, lineIndex);
|
|
18
18
|
|
|
19
19
|
this.type = type;
|
|
20
20
|
}
|
|
@@ -236,9 +236,11 @@ export default define(class Term extends Element {
|
|
|
236
236
|
toJSON() {
|
|
237
237
|
const typeJSON = typeToTypeJSON(this.type),
|
|
238
238
|
string = this.getString(), ///
|
|
239
|
+
lineIndex = this.getLineIndex(),
|
|
239
240
|
type = typeJSON, ///
|
|
240
241
|
json = {
|
|
241
242
|
string,
|
|
243
|
+
lineIndex,
|
|
242
244
|
type
|
|
243
245
|
};
|
|
244
246
|
|
|
@@ -249,14 +251,14 @@ export default define(class Term extends Element {
|
|
|
249
251
|
|
|
250
252
|
static fromJSON(json, context) {
|
|
251
253
|
return instantiate((context) => {
|
|
252
|
-
const { string } = json,
|
|
254
|
+
const { string, lineIndex } = json,
|
|
253
255
|
termNode = instantiateTerm(string, context),
|
|
254
256
|
node = termNode, ///
|
|
255
257
|
type = typeFromJSON(json, context);
|
|
256
258
|
|
|
257
259
|
context = null;
|
|
258
260
|
|
|
259
|
-
const term = new Term(context, string, node, type);
|
|
261
|
+
const term = new Term(context, string, node, lineIndex, type);
|
|
260
262
|
|
|
261
263
|
return term;
|
|
262
264
|
}, context);
|
|
@@ -49,11 +49,9 @@ export default define(class Axiom extends TopLevelAssertion {
|
|
|
49
49
|
return comparesToSignature;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
async verify() {
|
|
52
|
+
async verify(context) {
|
|
53
53
|
let verifies;
|
|
54
54
|
|
|
55
|
-
const context = this.getContext();
|
|
56
|
-
|
|
57
55
|
await this.break(context);
|
|
58
56
|
|
|
59
57
|
const axiomString = this.getString(); ///
|
|
@@ -63,7 +61,7 @@ export default define(class Axiom extends TopLevelAssertion {
|
|
|
63
61
|
const signatureVerifies = this.verifySignature();
|
|
64
62
|
|
|
65
63
|
if (signatureVerifies) {
|
|
66
|
-
verifies = await super.verify();
|
|
64
|
+
verifies = await super.verify(context);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
if (verifies) {
|
|
@@ -12,18 +12,16 @@ export default define(class Conjecture extends TopLevelAssertion {
|
|
|
12
12
|
return conjectureNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
|
-
const context = this.getContext();
|
|
19
|
-
|
|
20
18
|
await this.break(context);
|
|
21
19
|
|
|
22
20
|
const conjectureString = this.getString(); ///
|
|
23
21
|
|
|
24
22
|
context.trace(`Verifying the '${conjectureString}' conjecture...`);
|
|
25
23
|
|
|
26
|
-
verifies = await super.verify();
|
|
24
|
+
verifies = await super.verify(context);
|
|
27
25
|
|
|
28
26
|
if (verifies) {
|
|
29
27
|
const conjecture = this; ///
|
|
@@ -12,11 +12,9 @@ export default define(class Lemma extends TopLevelAssertion {
|
|
|
12
12
|
return lemmaNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
|
-
const context = this.getContext();
|
|
19
|
-
|
|
20
18
|
await this.break(context);
|
|
21
19
|
|
|
22
20
|
const lemmaString = this.getString(); ///
|
|
@@ -25,7 +23,7 @@ export default define(class Lemma extends TopLevelAssertion {
|
|
|
25
23
|
context.trace(`Verifying a lemma...`) :
|
|
26
24
|
context.trace(`Verifying the '${lemmaString}' lemma...`);
|
|
27
25
|
|
|
28
|
-
verifies = await super.verify();
|
|
26
|
+
verifies = await super.verify(context);
|
|
29
27
|
|
|
30
28
|
if (verifies) {
|
|
31
29
|
const lemma = this; ///
|
|
@@ -12,18 +12,16 @@ export default define(class Theorem extends TopLevelAssertion {
|
|
|
12
12
|
return theoremNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
|
-
const context = this.getContext();
|
|
19
|
-
|
|
20
18
|
await this.break(context);
|
|
21
19
|
|
|
22
20
|
const theoremString = this.getString(); ///
|
|
23
21
|
|
|
24
22
|
context.trace(`Verifying the '${theoremString}' theorem...`);
|
|
25
23
|
|
|
26
|
-
verifies = await super.verify();
|
|
24
|
+
verifies = await super.verify(context);
|
|
27
25
|
|
|
28
26
|
if (verifies) {
|
|
29
27
|
const theorem = this; ///
|
|
@@ -20,8 +20,8 @@ const { reverse, correlate } = arrayUtilities,
|
|
|
20
20
|
{ asyncExtract, asyncForwardsEvery, asyncBackwardsEvery } = asynchronousUtilities;
|
|
21
21
|
|
|
22
22
|
export default class TopLevelAssertion extends Element {
|
|
23
|
-
constructor(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses) {
|
|
24
|
-
super(context, string, node);
|
|
23
|
+
constructor(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses) {
|
|
24
|
+
super(context, string, node, lineIndex);
|
|
25
25
|
|
|
26
26
|
this.labels = labels;
|
|
27
27
|
this.suppositions = suppositions;
|
|
@@ -120,11 +120,10 @@ export default class TopLevelAssertion extends Element {
|
|
|
120
120
|
return correlatesToHypotheses;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
async verify() {
|
|
123
|
+
async verify(context) {
|
|
124
124
|
let verifies = false;
|
|
125
125
|
|
|
126
|
-
const
|
|
127
|
-
topLevelAssertionString = this.getString(); ///
|
|
126
|
+
const topLevelAssertionString = this.getString(); ///
|
|
128
127
|
|
|
129
128
|
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion...`);
|
|
130
129
|
|
|
@@ -384,12 +383,16 @@ export default class TopLevelAssertion extends Element {
|
|
|
384
383
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
385
384
|
signatureJSON = signatureToSignatureJSON(this.signature),
|
|
386
385
|
hypothesesJSON = hypothesesToHypothesesJSON(this.hypotheses),
|
|
386
|
+
string = this.getString(),
|
|
387
|
+
lineIndex = this.getLineIndex(),
|
|
387
388
|
labels = labelsJSON, ///
|
|
388
389
|
deduction = deductionJSON, ///
|
|
389
390
|
suppositions = suppositionsJSON, ///
|
|
390
391
|
signature = signatureJSON, ///
|
|
391
392
|
hypotheses = hypothesesJSON, ///
|
|
392
393
|
json = {
|
|
394
|
+
string,
|
|
395
|
+
lineIndex,
|
|
393
396
|
labels,
|
|
394
397
|
deduction,
|
|
395
398
|
suppositions,
|
|
@@ -401,7 +404,8 @@ export default class TopLevelAssertion extends Element {
|
|
|
401
404
|
}
|
|
402
405
|
|
|
403
406
|
static fromJSON(Class, json, context) {
|
|
404
|
-
const
|
|
407
|
+
const { lineIndex } = json,
|
|
408
|
+
labels = labelsFromJSON(json, context),
|
|
405
409
|
deduction = deductionFromJSON(json, context),
|
|
406
410
|
suppositions = suppositionsFromJSON(json, context),
|
|
407
411
|
signature = signatureFromJSON(json, context),
|
|
@@ -410,7 +414,7 @@ export default class TopLevelAssertion extends Element {
|
|
|
410
414
|
node = null,
|
|
411
415
|
proof = null,
|
|
412
416
|
string = topLevelAssertionString, ///
|
|
413
|
-
topLevelAssertion = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
417
|
+
topLevelAssertion = new Class(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
414
418
|
|
|
415
419
|
return topLevelAssertion;
|
|
416
420
|
}
|
|
@@ -12,18 +12,16 @@ export default define(class MetaLemma extends TopLevelMetaAssertion {
|
|
|
12
12
|
return metaLemmaNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
|
-
const context = this.getContext();
|
|
19
|
-
|
|
20
18
|
await this.break(context);
|
|
21
19
|
|
|
22
20
|
const metaLemmaString = this.getString(); ///
|
|
23
21
|
|
|
24
22
|
context.trace(`Verifying the '${metaLemmaString}' meta-lemma...`);
|
|
25
23
|
|
|
26
|
-
verifies = super.verify();
|
|
24
|
+
verifies = super.verify(context);
|
|
27
25
|
|
|
28
26
|
if (verifies) {
|
|
29
27
|
const metaTheorem = this; ///
|
|
@@ -12,18 +12,16 @@ export default define(class Metatheorem extends TopLevelMetaAssertion {
|
|
|
12
12
|
return metatheoremNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async verify() {
|
|
15
|
+
async verify(context) {
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
|
-
const context = this.getContext();
|
|
19
|
-
|
|
20
18
|
await this.break(context);
|
|
21
19
|
|
|
22
20
|
const metaLemmaString = this.getString(); ///
|
|
23
21
|
|
|
24
22
|
context.trace(`Verifying the '${metaLemmaString}' metatheorem...`);
|
|
25
23
|
|
|
26
|
-
verifies = super.verify();
|
|
24
|
+
verifies = super.verify(context);
|
|
27
25
|
|
|
28
26
|
if (verifies) {
|
|
29
27
|
const metaTheorem = this; ///
|
|
@@ -16,8 +16,8 @@ import { labelFromJSON,
|
|
|
16
16
|
const { asyncForwardsEvery } = asynchronousUtilities;
|
|
17
17
|
|
|
18
18
|
export default class TopLevelMetaAssertion extends Element {
|
|
19
|
-
constructor(context, string, node, label, suppositions, deduction, proof, metaLevelAssumptions) {
|
|
20
|
-
super(context, string, node);
|
|
19
|
+
constructor(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions) {
|
|
20
|
+
super(context, string, node, lineIndex);
|
|
21
21
|
|
|
22
22
|
this.label = label;
|
|
23
23
|
this.suppositions = suppositions;
|
|
@@ -95,16 +95,15 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
95
95
|
return comparesToReference;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
async verify() {
|
|
98
|
+
async verify(context) {
|
|
99
99
|
let verifies = false;
|
|
100
100
|
|
|
101
|
-
const
|
|
102
|
-
topLevelMetaAssertionString = this.getString(); ///
|
|
101
|
+
const topLevelMetaAssertionString = this.getString(); ///
|
|
103
102
|
|
|
104
103
|
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta assertion...`);
|
|
105
104
|
|
|
106
105
|
await enclose(async (context) => {
|
|
107
|
-
const labelVerifies = this.verifyLabel();
|
|
106
|
+
const labelVerifies = this.verifyLabel(context);
|
|
108
107
|
|
|
109
108
|
if (labelVerifies) {
|
|
110
109
|
const suppositionsVerify = await this.verifySuppositions(context);
|
|
@@ -130,11 +129,10 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
130
129
|
return verifies;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
verifyLabel() {
|
|
132
|
+
verifyLabel(context) {
|
|
134
133
|
let labelVerifies;
|
|
135
134
|
|
|
136
|
-
const
|
|
137
|
-
topLevelMetaAssertionString = this.getString(), ///
|
|
135
|
+
const topLevelMetaAssertionString = this.getString(), ///
|
|
138
136
|
labelString = this.label.getString();
|
|
139
137
|
|
|
140
138
|
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's '${labelString}' label...`);
|
|
@@ -235,11 +233,15 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
235
233
|
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
236
234
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
237
235
|
metaLevelAssumptionsJSON = metaLevelAssumptionsToMetaLevelAssumptionsJSON(this.metaLevelAssumptions),
|
|
236
|
+
string = this.getString(),
|
|
237
|
+
lineIndex = this.getLineIndex(),
|
|
238
238
|
label = labelJSON, ///
|
|
239
239
|
deduction = deductionJSON, ///
|
|
240
240
|
suppositions = suppositionsJSON, ///
|
|
241
241
|
metaLevelAssumptions = metaLevelAssumptionsJSON, ///
|
|
242
242
|
json = {
|
|
243
|
+
string,
|
|
244
|
+
lineIndex,
|
|
243
245
|
label,
|
|
244
246
|
deduction,
|
|
245
247
|
suppositions,
|
|
@@ -250,14 +252,15 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
static fromJSON(Class, json, context) {
|
|
253
|
-
const
|
|
255
|
+
const { lineIndex } = json,
|
|
256
|
+
label = labelFromJSON(json, context),
|
|
254
257
|
deduction = deductionFromJSON(json, context),
|
|
255
258
|
suppositions = suppositionsFromJSON(json, context),
|
|
256
259
|
metaLevelAssumptions = metaLevelAssumptionsFromJSON(json, context),
|
|
257
260
|
node = null,
|
|
258
261
|
proof = null,
|
|
259
262
|
string = topLevelMetaAssertionStringFromLabelSuppositionsDeductionAndMetaLevelAssumptions(label, suppositions, deduction, metaLevelAssumptions),
|
|
260
|
-
topLevelMetaAssertion = new Class(context, string, node, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
263
|
+
topLevelMetaAssertion = new Class(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
261
264
|
|
|
262
265
|
return topLevelMetaAssertion;
|
|
263
266
|
}
|
package/src/element/type.js
CHANGED
|
@@ -13,8 +13,8 @@ import { superTypesFromJSON, provisionalFromJSON, propertiesFromJSON, provisiona
|
|
|
13
13
|
const { push, first } = arrayUtilities;
|
|
14
14
|
|
|
15
15
|
export default define(class Type extends Element {
|
|
16
|
-
constructor(context, string, node, name, prefixName, superTypes, properties, provisional) {
|
|
17
|
-
super(context, string, node);
|
|
16
|
+
constructor(context, string, node, lineIndex, name, prefixName, superTypes, properties, provisional) {
|
|
17
|
+
super(context, string, node, lineIndex);
|
|
18
18
|
|
|
19
19
|
this.name = name;
|
|
20
20
|
this.prefixName = prefixName;
|
|
@@ -303,8 +303,10 @@ export default define(class Type extends Element {
|
|
|
303
303
|
properties = propertiesJSON, ///
|
|
304
304
|
provisional = provisinoalJSOM, ///
|
|
305
305
|
string = this.getString(),
|
|
306
|
+
lineIndex = this.getLineIndex(),
|
|
306
307
|
json = {
|
|
307
308
|
string,
|
|
309
|
+
lineIndex,
|
|
308
310
|
superTypes,
|
|
309
311
|
properties,
|
|
310
312
|
provisional
|
|
@@ -317,7 +319,7 @@ export default define(class Type extends Element {
|
|
|
317
319
|
|
|
318
320
|
static fromJSON(json, context) {
|
|
319
321
|
return instantiate((context) => {
|
|
320
|
-
const { string } = json,
|
|
322
|
+
const { string, lineIndex } = json,
|
|
321
323
|
typeNode = instantiateType(string, context),
|
|
322
324
|
node = typeNode, ///
|
|
323
325
|
name = nameFromTypeNode(typeNode, context),
|
|
@@ -328,7 +330,7 @@ export default define(class Type extends Element {
|
|
|
328
330
|
|
|
329
331
|
context = null; ///
|
|
330
332
|
|
|
331
|
-
const type = new Type(context, string, node, name, prefixName, superTypes, properties, provisional);
|
|
333
|
+
const type = new Type(context, string, node, lineIndex, name, prefixName, superTypes, properties, provisional);
|
|
332
334
|
|
|
333
335
|
return type;
|
|
334
336
|
}, context);
|
|
@@ -337,6 +339,7 @@ export default define(class Type extends Element {
|
|
|
337
339
|
static fromName(name, context) {
|
|
338
340
|
const string = name, ///
|
|
339
341
|
node = null,
|
|
342
|
+
lineIndex = null,
|
|
340
343
|
prefixName = null,
|
|
341
344
|
superTypes = [],
|
|
342
345
|
properties = [],
|
|
@@ -344,7 +347,7 @@ export default define(class Type extends Element {
|
|
|
344
347
|
|
|
345
348
|
context = null;
|
|
346
349
|
|
|
347
|
-
const type = new Type(context, string, node, name, prefixName, superTypes, properties, provisional);
|
|
350
|
+
const type = new Type(context, string, node, lineIndex, name, prefixName, superTypes, properties, provisional);
|
|
348
351
|
|
|
349
352
|
return type;
|
|
350
353
|
}
|
|
@@ -8,8 +8,8 @@ import { instantiateTypePrefix } from "../process/instantiate";
|
|
|
8
8
|
import { nameFromTypePrefixNode } from "../utilities/element";
|
|
9
9
|
|
|
10
10
|
export default define(class TypePrefix extends Element {
|
|
11
|
-
constructor(context, string, node, name) {
|
|
12
|
-
super(context, string, node);
|
|
11
|
+
constructor(context, string, node, lineIndex, name) {
|
|
12
|
+
super(context, string, node, lineIndex);
|
|
13
13
|
|
|
14
14
|
this.name = name;
|
|
15
15
|
}
|
|
@@ -33,8 +33,10 @@ export default define(class TypePrefix extends Element {
|
|
|
33
33
|
|
|
34
34
|
toJSON() {
|
|
35
35
|
const string = this.getString(),
|
|
36
|
+
lineIndex = this.getLineIndex(),
|
|
36
37
|
json = {
|
|
37
|
-
string
|
|
38
|
+
string,
|
|
39
|
+
lineIndex
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
return json;
|
|
@@ -44,14 +46,14 @@ export default define(class TypePrefix extends Element {
|
|
|
44
46
|
|
|
45
47
|
static fromJSON(json, context) {
|
|
46
48
|
return instantiate((context) => {
|
|
47
|
-
const { string } = json,
|
|
49
|
+
const { string, lineIndex } = json,
|
|
48
50
|
typePrefixNode = instantiateTypePrefix(string, context),
|
|
49
51
|
node = typePrefixNode, ///
|
|
50
52
|
name = nameFromTypePrefixNode(typePrefixNode, context);
|
|
51
53
|
|
|
52
54
|
context = null; ///
|
|
53
55
|
|
|
54
|
-
const typePrefix = new TypePrefix(context, string, node, name);
|
|
56
|
+
const typePrefix = new TypePrefix(context, string, node, lineIndex, name);
|
|
55
57
|
|
|
56
58
|
return typePrefix;
|
|
57
59
|
}, context);
|
package/src/element/variable.js
CHANGED
|
@@ -11,8 +11,8 @@ import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
|
11
11
|
import { variableFromTermNode, identifierFromVarialbeNode } from "../utilities/element";
|
|
12
12
|
|
|
13
13
|
export default define(class Variable extends Element {
|
|
14
|
-
constructor(context, string, node, type, identifier) {
|
|
15
|
-
super(context, string, node);
|
|
14
|
+
constructor(context, string, node, lineIndex, type, identifier) {
|
|
15
|
+
super(context, string, node, lineIndex);
|
|
16
16
|
|
|
17
17
|
this.type = type;
|
|
18
18
|
this.identifier = identifier;
|
|
@@ -172,8 +172,10 @@ export default define(class Variable extends Element {
|
|
|
172
172
|
const typeJSON = typeToTypeJSON(this.type),
|
|
173
173
|
type = typeJSON, ///
|
|
174
174
|
string = this.getString(), ///
|
|
175
|
+
lineIndex = this.getLineIndex(),
|
|
175
176
|
json = {
|
|
176
177
|
string,
|
|
178
|
+
lineIndex,
|
|
177
179
|
type
|
|
178
180
|
};
|
|
179
181
|
|
|
@@ -184,7 +186,7 @@ export default define(class Variable extends Element {
|
|
|
184
186
|
|
|
185
187
|
static fromJSON(json, context) {
|
|
186
188
|
return instantiate((context) => {
|
|
187
|
-
const { string } = json,
|
|
189
|
+
const { string, lineIndex } = json,
|
|
188
190
|
variableNode = instantiateVariable(string, context),
|
|
189
191
|
node = variableNode, ///
|
|
190
192
|
type = typeFromJSON(json, context),
|
|
@@ -192,7 +194,7 @@ export default define(class Variable extends Element {
|
|
|
192
194
|
|
|
193
195
|
context = null;
|
|
194
196
|
|
|
195
|
-
const variable = new Variable(context, string, node, type, identifier);
|
|
197
|
+
const variable = new Variable(context, string, node, lineIndex, type, identifier);
|
|
196
198
|
|
|
197
199
|
return variable;
|
|
198
200
|
}, context);
|