occam-verify-cli 1.0.824 → 1.0.826
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/nominal.js +26 -22
- 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 +3 -3
- package/lib/element/declaration/complexType.js +3 -3
- package/lib/element/declaration/constructor.js +3 -3
- package/lib/element/declaration/metavariable.js +3 -3
- package/lib/element/declaration/simpleType.js +3 -3
- package/lib/element/declaration/typePrefix.js +3 -3
- package/lib/element/declaration/variable.js +3 -3
- 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 +8 -1
- 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.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 +6 -6
- package/lib/element/section.js +10 -3
- 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.js +7 -5
- package/lib/element/topLevelMetaAssertion.js +7 -5
- package/lib/element/type.js +9 -8
- package/lib/element/typePrefix.js +8 -7
- package/lib/element/variable.js +7 -6
- package/lib/utilities/element.js +101 -113
- package/lib/utilities/json.js +89 -1
- package/package.json +4 -4
- package/src/context/file/nominal.js +39 -24
- 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 +2 -2
- package/src/element/declaration/complexType.js +2 -2
- package/src/element/declaration/constructor.js +2 -2
- package/src/element/declaration/metavariable.js +2 -2
- package/src/element/declaration/simpleType.js +2 -2
- package/src/element/declaration/typePrefix.js +2 -2
- package/src/element/declaration/variable.js +2 -2
- 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 +11 -0
- 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.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 +8 -8
- package/src/element/section.js +13 -2
- 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.js +9 -4
- package/src/element/topLevelMetaAssertion.js +9 -4
- package/src/element/type.js +8 -5
- package/src/element/typePrefix.js +7 -5
- package/src/element/variable.js +6 -4
- package/src/utilities/element.js +195 -154
- package/src/utilities/json.js +104 -0
- package/lib/process/initialise.js +0 -57
- package/src/process/initialise.js +0 -72
|
@@ -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);
|
|
@@ -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;
|
|
@@ -384,12 +384,16 @@ export default class TopLevelAssertion extends Element {
|
|
|
384
384
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
385
385
|
signatureJSON = signatureToSignatureJSON(this.signature),
|
|
386
386
|
hypothesesJSON = hypothesesToHypothesesJSON(this.hypotheses),
|
|
387
|
+
string = this.getString(),
|
|
388
|
+
lineIndex = this.getLineIndex(),
|
|
387
389
|
labels = labelsJSON, ///
|
|
388
390
|
deduction = deductionJSON, ///
|
|
389
391
|
suppositions = suppositionsJSON, ///
|
|
390
392
|
signature = signatureJSON, ///
|
|
391
393
|
hypotheses = hypothesesJSON, ///
|
|
392
394
|
json = {
|
|
395
|
+
string,
|
|
396
|
+
lineIndex,
|
|
393
397
|
labels,
|
|
394
398
|
deduction,
|
|
395
399
|
suppositions,
|
|
@@ -401,7 +405,8 @@ export default class TopLevelAssertion extends Element {
|
|
|
401
405
|
}
|
|
402
406
|
|
|
403
407
|
static fromJSON(Class, json, context) {
|
|
404
|
-
const
|
|
408
|
+
const { lineIndex } = json,
|
|
409
|
+
labels = labelsFromJSON(json, context),
|
|
405
410
|
deduction = deductionFromJSON(json, context),
|
|
406
411
|
suppositions = suppositionsFromJSON(json, context),
|
|
407
412
|
signature = signatureFromJSON(json, context),
|
|
@@ -410,7 +415,7 @@ export default class TopLevelAssertion extends Element {
|
|
|
410
415
|
node = null,
|
|
411
416
|
proof = null,
|
|
412
417
|
string = topLevelAssertionString, ///
|
|
413
|
-
topLevelAssertion = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
418
|
+
topLevelAssertion = new Class(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
414
419
|
|
|
415
420
|
return topLevelAssertion;
|
|
416
421
|
}
|
|
@@ -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;
|
|
@@ -235,11 +235,15 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
235
235
|
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
236
236
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
237
237
|
metaLevelAssumptionsJSON = metaLevelAssumptionsToMetaLevelAssumptionsJSON(this.metaLevelAssumptions),
|
|
238
|
+
string = this.getString(),
|
|
239
|
+
lineIndex = this.getLineIndex(),
|
|
238
240
|
label = labelJSON, ///
|
|
239
241
|
deduction = deductionJSON, ///
|
|
240
242
|
suppositions = suppositionsJSON, ///
|
|
241
243
|
metaLevelAssumptions = metaLevelAssumptionsJSON, ///
|
|
242
244
|
json = {
|
|
245
|
+
string,
|
|
246
|
+
lineIndex,
|
|
243
247
|
label,
|
|
244
248
|
deduction,
|
|
245
249
|
suppositions,
|
|
@@ -250,14 +254,15 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
static fromJSON(Class, json, context) {
|
|
253
|
-
const
|
|
257
|
+
const { lineIndex } = json,
|
|
258
|
+
label = labelFromJSON(json, context),
|
|
254
259
|
deduction = deductionFromJSON(json, context),
|
|
255
260
|
suppositions = suppositionsFromJSON(json, context),
|
|
256
261
|
metaLevelAssumptions = metaLevelAssumptionsFromJSON(json, context),
|
|
257
262
|
node = null,
|
|
258
263
|
proof = null,
|
|
259
264
|
string = topLevelMetaAssertionStringFromLabelSuppositionsDeductionAndMetaLevelAssumptions(label, suppositions, deduction, metaLevelAssumptions),
|
|
260
|
-
topLevelMetaAssertion = new Class(context, string, node, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
265
|
+
topLevelMetaAssertion = new Class(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
261
266
|
|
|
262
267
|
return topLevelMetaAssertion;
|
|
263
268
|
}
|
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);
|