occam-verify-cli 0.0.1135 → 0.0.1137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/file.js +9 -9
- package/lib/context/local.js +24 -23
- package/lib/dom/conclusion.js +5 -5
- package/lib/dom/consequent.js +5 -5
- package/lib/dom/derivation.js +15 -15
- package/lib/dom/premise.js +37 -28
- package/lib/dom/proofStep.js +38 -48
- package/lib/dom/proofStep.old.js +246 -0
- package/lib/dom/reference.js +2 -2
- package/lib/dom/rule.js +23 -23
- package/lib/dom/statement.js +5 -5
- package/lib/dom/subDerivation.js +15 -15
- package/lib/dom/subproof.js +53 -5
- package/lib/dom/supposition.js +37 -28
- package/lib/dom/topLevelAssertion.js +23 -23
- package/lib/mixins/proofStep/unify.js +6 -6
- package/lib/utilities/subproof.js +3 -8
- package/package.json +1 -1
- package/src/context/file.js +6 -6
- package/src/context/local.js +28 -26
- package/src/dom/conclusion.js +6 -5
- package/src/dom/consequent.js +6 -6
- package/src/dom/derivation.js +19 -16
- package/src/dom/premise.js +53 -36
- package/src/dom/proofStep.js +44 -57
- package/src/dom/proofStep.old.js +183 -0
- package/src/dom/reference.js +1 -1
- package/src/dom/rule.js +19 -19
- package/src/dom/statement.js +3 -3
- package/src/dom/subDerivation.js +19 -16
- package/src/dom/subproof.js +62 -3
- package/src/dom/supposition.js +49 -32
- package/src/dom/topLevelAssertion.js +19 -19
- package/src/mixins/proofStep/unify.js +8 -8
- package/src/utilities/subproof.js +4 -11
package/src/dom/subDerivation.js
CHANGED
|
@@ -9,19 +9,20 @@ import { domAssigned } from "../dom";
|
|
|
9
9
|
|
|
10
10
|
const { last } = arrayUtilities;
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const proofStepSubproofNodesQuery = nodesQuery("/subDerivation/proofStep|subproof");
|
|
13
13
|
|
|
14
14
|
export default domAssigned(class SubDerivation {
|
|
15
|
-
constructor(
|
|
16
|
-
this.
|
|
15
|
+
constructor(proofStepSubproofs) {
|
|
16
|
+
this.proofStepSubproofs = proofStepSubproofs;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
return this.
|
|
19
|
+
getProofStepSubproofs() {
|
|
20
|
+
return this.proofStepSubproofs;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
getLastProofStep() {
|
|
24
|
-
const
|
|
24
|
+
const lastProofStepSubproof = last(this.proofStepSubproofs),
|
|
25
|
+
lastProofStep = lastProofStepSubproof; ///
|
|
25
26
|
|
|
26
27
|
return lastProofStep;
|
|
27
28
|
}
|
|
@@ -29,10 +30,10 @@ export default domAssigned(class SubDerivation {
|
|
|
29
30
|
verify(substitutions, context) {
|
|
30
31
|
let verified;
|
|
31
32
|
|
|
32
|
-
verified = this.
|
|
33
|
-
const
|
|
33
|
+
verified = this.proofStepSubproofs.every((proofStepSubproof) => { ///
|
|
34
|
+
const proofStepSubproofVerifiedAndUnified = proofStepSubproof.verifyAndUnify(substitutions, context);
|
|
34
35
|
|
|
35
|
-
if (
|
|
36
|
+
if (proofStepSubproofVerifiedAndUnified) {
|
|
36
37
|
return true;
|
|
37
38
|
}
|
|
38
39
|
});
|
|
@@ -43,14 +44,16 @@ export default domAssigned(class SubDerivation {
|
|
|
43
44
|
static name = "SubDerivation";
|
|
44
45
|
|
|
45
46
|
static fromSubDerivationNode(subDerivationNode, fileContext) {
|
|
46
|
-
const { ProofStep } = dom,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const { ProofStep, Subproof } = dom,
|
|
48
|
+
proofStepSubproofNodes = proofStepSubproofNodesQuery(subDerivationNode),
|
|
49
|
+
proofStepSubproofs = proofStepSubproofNodes.map((proofStepSubproofNode) => {
|
|
50
|
+
const subproof = Subproof.fromProofStepSubproofNode(proofStepSubproofNode, fileContext),
|
|
51
|
+
proofStep = ProofStep.fromProofStepSubproofNode(proofStepSubproofNode, fileContext),
|
|
52
|
+
proofStepSubproof = (proofStep || subproof);
|
|
53
|
+
|
|
54
|
+
return proofStepSubproof;
|
|
52
55
|
}),
|
|
53
|
-
subDerivation = new SubDerivation(
|
|
56
|
+
subDerivation = new SubDerivation(proofStepSubproofs);
|
|
54
57
|
|
|
55
58
|
return subDerivation;
|
|
56
59
|
}
|
package/src/dom/subproof.js
CHANGED
|
@@ -6,8 +6,11 @@ import LocalContext from "../context/local";
|
|
|
6
6
|
import { domAssigned } from "../dom";
|
|
7
7
|
import { nodeQuery, nodesQuery } from "../utilities/query";
|
|
8
8
|
import { subproofStringFromSubproofNode } from "../utilities/subproof";
|
|
9
|
+
import unifyMixins from "../mixins/proofStep/unify";
|
|
10
|
+
import Substitutions from "../substitutions";
|
|
11
|
+
import {assignAssignments} from "../utilities/assignments";
|
|
9
12
|
|
|
10
|
-
const subproofNodeQuery = nodeQuery("/
|
|
13
|
+
const subproofNodeQuery = nodeQuery("/subproof"),
|
|
11
14
|
suppositionNodesQuery = nodesQuery("/subproof/supposition"),
|
|
12
15
|
subDerivationNodeQuery = nodeQuery("/subproof/subDerivation");
|
|
13
16
|
|
|
@@ -52,6 +55,42 @@ export default domAssigned(class Subproof {
|
|
|
52
55
|
return statements;
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
isProofStep() {
|
|
59
|
+
const proofStep = false;
|
|
60
|
+
|
|
61
|
+
return proofStep;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
unifyStatement(statement, context) {
|
|
65
|
+
let statementUnified;
|
|
66
|
+
|
|
67
|
+
const specificContext = context, ///
|
|
68
|
+
generalContext = context, ///
|
|
69
|
+
substitutions = Substitutions.fromNothing(),
|
|
70
|
+
subproof = this;
|
|
71
|
+
|
|
72
|
+
const subproofUnified = statement.unifySubproof(subproof, substitutions, generalContext, specificContext);
|
|
73
|
+
|
|
74
|
+
statementUnified = subproofUnified; ///
|
|
75
|
+
|
|
76
|
+
if (statementUnified) {
|
|
77
|
+
const equivalences = context.getEquivalences(),
|
|
78
|
+
substitutionsUnified = equivalences.unifySubstitutions(substitutions);
|
|
79
|
+
|
|
80
|
+
statementUnified = substitutionsUnified; ///
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return statementUnified;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
unify(substitutions, context) {
|
|
87
|
+
let unified;
|
|
88
|
+
|
|
89
|
+
unified = true;
|
|
90
|
+
|
|
91
|
+
return unified;
|
|
92
|
+
}
|
|
93
|
+
|
|
55
94
|
verify(substitutions, context) {
|
|
56
95
|
let subproofVerified = false;
|
|
57
96
|
|
|
@@ -78,12 +117,32 @@ export default domAssigned(class Subproof {
|
|
|
78
117
|
return subproofVerified;
|
|
79
118
|
}
|
|
80
119
|
|
|
120
|
+
verifyAndUnify(substitutions, context) {
|
|
121
|
+
let verifiedAndUnified = false;
|
|
122
|
+
|
|
123
|
+
const verified = this.verify(substitutions, context);
|
|
124
|
+
|
|
125
|
+
if (verified) {
|
|
126
|
+
const unified = this.unify(substitutions, context);
|
|
127
|
+
|
|
128
|
+
if (unified) {
|
|
129
|
+
const proofStepSubproof = this; ///
|
|
130
|
+
|
|
131
|
+
context.addProofStepSubproof(proofStepSubproof);
|
|
132
|
+
|
|
133
|
+
verifiedAndUnified = true; ///
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return verifiedAndUnified;
|
|
138
|
+
}
|
|
139
|
+
|
|
81
140
|
static name = "Subproof";
|
|
82
141
|
|
|
83
|
-
static
|
|
142
|
+
static fromProofStepSubproofNode(proofStepSubproofNode, fileContext) {
|
|
84
143
|
let subproof = null;
|
|
85
144
|
|
|
86
|
-
const subproofNode = subproofNodeQuery(
|
|
145
|
+
const subproofNode = subproofNodeQuery(proofStepSubproofNode);
|
|
87
146
|
|
|
88
147
|
if (subproofNode !== null) {
|
|
89
148
|
const { Supposition, SubDerivation } = dom,
|
package/src/dom/supposition.js
CHANGED
|
@@ -31,55 +31,53 @@ export default domAssigned(class Supposition {
|
|
|
31
31
|
return unifiedIndependently;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
let
|
|
34
|
+
unifyProofStepSubproof(proofStepSubproof, substitutions, generalContext, specificContext) {
|
|
35
|
+
let proofStepSubproofUnified = false;
|
|
36
36
|
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const proofStepSubProofProofStep = proofStepSubproof.isProofStep(),
|
|
38
|
+
subproof = proofStepSubProofProofStep ?
|
|
39
|
+
null :
|
|
40
|
+
proofStepSubproof,
|
|
41
|
+
proofStep = proofStepSubProofProofStep ?
|
|
42
|
+
proofStepSubproof :
|
|
43
|
+
null;
|
|
39
44
|
|
|
40
45
|
substitutions.snapshot();
|
|
41
46
|
|
|
42
47
|
if (subproof !== null) {
|
|
43
48
|
const subproofUnified = this.unifySubproof(subproof, substitutions, generalContext, specificContext);
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
proofStepSubproofUnified = subproofUnified; ///
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
if (
|
|
49
|
-
const statementUnified = this.
|
|
53
|
+
if (proofStep !== null) {
|
|
54
|
+
const statementUnified = this.unifyProofStep(proofStep, substitutions, generalContext, specificContext);
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
proofStepSubproofUnified = statementUnified; ///
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
if (
|
|
59
|
+
if (proofStepSubproofUnified) {
|
|
55
60
|
substitutions.resolve(generalContext, specificContext);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
const context = specificContext; ///
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
proofStepSubproofUnified ?
|
|
61
66
|
substitutions.continue() :
|
|
62
67
|
substitutions.rollback(context);
|
|
63
68
|
|
|
64
|
-
return
|
|
69
|
+
return proofStepSubproofUnified;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
const supposition = this, ///
|
|
71
|
-
suppositionString = supposition.getString(),
|
|
72
|
-
statementString = statement.getString();
|
|
72
|
+
unifyProofStep(proofStep, substitutions, generalContext, specificContext) {
|
|
73
|
+
let proofStepUnified;
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
const statement = proofStep.getStatement(),
|
|
76
|
+
statementUnified = this.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
proofStepUnified = statementUnified; ///
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
specificContext.debug(`...unified the '${statementString}' statement with the '${suppositionString}' supposition.`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return statementUnified;
|
|
80
|
+
return proofStepUnified;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
unifySubproof(subproof, substitutions, generalContext, specificContext) {
|
|
@@ -106,14 +104,32 @@ export default domAssigned(class Supposition {
|
|
|
106
104
|
return subproofUnified;
|
|
107
105
|
}
|
|
108
106
|
|
|
107
|
+
unifyStatement(statement, substitutions, generalContext, specificContext) {
|
|
108
|
+
let statementUnified;
|
|
109
|
+
|
|
110
|
+
const supposition = this, ///
|
|
111
|
+
suppositionString = supposition.getString(),
|
|
112
|
+
statementString = statement.getString();
|
|
113
|
+
|
|
114
|
+
specificContext.trace(`Unifying the '${statementString}' statement with the '${suppositionString}' supposition...`);
|
|
115
|
+
|
|
116
|
+
statementUnified = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
117
|
+
|
|
118
|
+
if (statementUnified) {
|
|
119
|
+
specificContext.debug(`...unified the '${statementString}' statement with the '${suppositionString}' supposition.`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return statementUnified;
|
|
123
|
+
}
|
|
124
|
+
|
|
109
125
|
verify(context) {
|
|
110
126
|
let verified = false;
|
|
111
127
|
|
|
112
128
|
const suppositionString = this.string; ///
|
|
113
129
|
|
|
114
|
-
|
|
115
|
-
context.trace(`Verifying the '${suppositionString}' supposition...`);
|
|
130
|
+
context.trace(`Verifying the '${suppositionString}' supposition...`);
|
|
116
131
|
|
|
132
|
+
if (this.statement !== null) {
|
|
117
133
|
const stated = true,
|
|
118
134
|
assignments = [],
|
|
119
135
|
statementVerified = this.statement.verify(assignments, stated, context);
|
|
@@ -123,21 +139,22 @@ export default domAssigned(class Supposition {
|
|
|
123
139
|
|
|
124
140
|
if (assignmentsAssigned) {
|
|
125
141
|
const { ProofStep } = dom,
|
|
126
|
-
proofStep = ProofStep.fromStatement(this.statement, context)
|
|
142
|
+
proofStep = ProofStep.fromStatement(this.statement, context),
|
|
143
|
+
proofStepSubproof = proofStep; ///
|
|
127
144
|
|
|
128
|
-
context.
|
|
145
|
+
context.addProofStepSubproof(proofStepSubproof);
|
|
129
146
|
|
|
130
147
|
verified = true;
|
|
131
148
|
}
|
|
132
149
|
}
|
|
133
|
-
|
|
134
|
-
if (verified) {
|
|
135
|
-
context.debug(`...verified the '${suppositionString}' supposition.`);
|
|
136
|
-
}
|
|
137
150
|
} else {
|
|
138
151
|
context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense.`);
|
|
139
152
|
}
|
|
140
153
|
|
|
154
|
+
if (verified) {
|
|
155
|
+
context.debug(`...verified the '${suppositionString}' supposition.`);
|
|
156
|
+
}
|
|
157
|
+
|
|
141
158
|
return verified;
|
|
142
159
|
}
|
|
143
160
|
|
|
@@ -139,8 +139,8 @@ export default class TopLevelAssertion {
|
|
|
139
139
|
return statementUnified;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
let
|
|
142
|
+
unifyStatementAndProofStepSubproofs(statement, proofStepSubproofs, context) {
|
|
143
|
+
let statementAndProofStepSubproofsUnified = false;
|
|
144
144
|
|
|
145
145
|
const localContext = LocalContext.fromFileContext(this.fileContext),
|
|
146
146
|
generalContext = localContext, ///
|
|
@@ -150,16 +150,16 @@ export default class TopLevelAssertion {
|
|
|
150
150
|
statementUnifiedWithConsequent = this.unifyStatementWithConsequent(statement, substitutions, generalContext, specificContext);
|
|
151
151
|
|
|
152
152
|
if (statementUnifiedWithConsequent) {
|
|
153
|
-
const
|
|
153
|
+
const proofStepSubproofsUnifiedWithSuppositions = this.unifyProofStepSubproofsWithSuppositions(proofStepSubproofs, substitutions, generalContext, specificContext);
|
|
154
154
|
|
|
155
|
-
if (
|
|
155
|
+
if (proofStepSubproofsUnifiedWithSuppositions) {
|
|
156
156
|
const substitutionsResolved = substitutions.areResolved();
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
statementAndProofStepSubproofsUnified = substitutionsResolved; ///
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
return
|
|
162
|
+
return statementAndProofStepSubproofsUnified;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
unifyStatementWithConsequent(statement, substitutions, generalContext, specificContext) {
|
|
@@ -172,30 +172,30 @@ export default class TopLevelAssertion {
|
|
|
172
172
|
return consequentUnified;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
unifyProofStepSubproofsWithSuppositions(proofStepSubproofs, substitutions, generalContext, specificContext) {
|
|
176
|
+
proofStepSubproofs = reverse(proofStepSubproofs); ///
|
|
177
177
|
|
|
178
|
-
const
|
|
179
|
-
const
|
|
178
|
+
const proofStepSubproofsUnifiedWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
|
|
179
|
+
const proofStepSubproofsUnifiedWithSupposition = this.unifyProofStepSubproofsWithSupposition(proofStepSubproofs, supposition, substitutions, generalContext, specificContext);
|
|
180
180
|
|
|
181
|
-
if (
|
|
181
|
+
if (proofStepSubproofsUnifiedWithSupposition) {
|
|
182
182
|
return true;
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
return
|
|
186
|
+
return proofStepSubproofsUnifiedWithSuppositions;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
let
|
|
189
|
+
unifyProofStepSubproofsWithSupposition(proofStepSubproofs, supposition, substitutions, generalContext, specificContext) {
|
|
190
|
+
let proofStepSubproofsUnifiedWithSupposition =false;
|
|
191
191
|
|
|
192
192
|
const suppositionUnifiedIndependently = supposition.unifyIndependently(substitutions, generalContext, specificContext);
|
|
193
193
|
|
|
194
194
|
if (suppositionUnifiedIndependently) {
|
|
195
|
-
|
|
195
|
+
proofStepSubproofsUnifiedWithSupposition = true;
|
|
196
196
|
} else {
|
|
197
|
-
const proofStep = extract(
|
|
198
|
-
const proofStepUnified = supposition.
|
|
197
|
+
const proofStep = extract(proofStepSubproofs, (proofStepSubproof) => {
|
|
198
|
+
const proofStepUnified = supposition.unifyProofStepSubproof(proofStepSubproof, substitutions, generalContext, specificContext);
|
|
199
199
|
|
|
200
200
|
if (proofStepUnified) {
|
|
201
201
|
return true;
|
|
@@ -203,11 +203,11 @@ export default class TopLevelAssertion {
|
|
|
203
203
|
}) || null;
|
|
204
204
|
|
|
205
205
|
if (proofStep !== null) {
|
|
206
|
-
|
|
206
|
+
proofStepSubproofsUnifiedWithSupposition = true;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
return
|
|
210
|
+
return proofStepSubproofsUnifiedWithSupposition;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
verify() {
|
|
@@ -16,8 +16,8 @@ function unifyAWithRule(statement, reference, substitutions, context) {
|
|
|
16
16
|
|
|
17
17
|
context.trace(`Unifying the '${statementString}' statement with the '${ruleString}' rule...`);
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
statementAndProofStepsUnified = rule.
|
|
19
|
+
const proofStepSubproofs = context.getProofStepSubproofs(),
|
|
20
|
+
statementAndProofStepsUnified = rule.unifyStatementAndProofStepSubproofs(statement, proofStepSubproofs, context);
|
|
21
21
|
|
|
22
22
|
unifiedWithRule = statementAndProofStepsUnified; ///
|
|
23
23
|
|
|
@@ -71,8 +71,8 @@ function unifyAWithAxiomLemmaTheoremOrConjecture(statement, reference, substitut
|
|
|
71
71
|
|
|
72
72
|
context.trace(`Unifying the '${statementString}' statement with the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`);
|
|
73
73
|
|
|
74
|
-
const
|
|
75
|
-
statementAndProofStepsUnified = axiomLemmaTheoremConjecture.
|
|
74
|
+
const proofStepSubproofs = context.getProofStepSubproofs(),
|
|
75
|
+
statementAndProofStepsUnified = axiomLemmaTheoremConjecture.unifyStatementAndProofStepSubproofs(statement, proofStepSubproofs, context);
|
|
76
76
|
|
|
77
77
|
if (statementAndProofStepsUnified) {
|
|
78
78
|
const metavariable = reference.getMetavariable(),
|
|
@@ -153,12 +153,12 @@ function unifyAsTypeAssertion(statement, reference, substitutions, context) {
|
|
|
153
153
|
return unifiedAsTypeAssertion;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
function
|
|
156
|
+
function unifyWithProofStepSubproofs(statement, reference, substitutions, context) {
|
|
157
157
|
let unifiedWithProofSteps = false;
|
|
158
158
|
|
|
159
159
|
if (reference === null) {
|
|
160
|
-
const
|
|
161
|
-
statementUnifiedWithProofSteps = statement.
|
|
160
|
+
const proofStepSubproofs = context.getProofStepSubproofs(),
|
|
161
|
+
statementUnifiedWithProofSteps = statement.unifyWithProofStepSubproofs(proofStepSubproofs, context);
|
|
162
162
|
|
|
163
163
|
unifiedWithProofSteps = statementUnifiedWithProofSteps; ///
|
|
164
164
|
}
|
|
@@ -173,7 +173,7 @@ const unifyMixins = [
|
|
|
173
173
|
unifyAsEquality,
|
|
174
174
|
unifyAsJudgement,
|
|
175
175
|
unifyAsTypeAssertion,
|
|
176
|
-
|
|
176
|
+
unifyWithProofStepSubproofs
|
|
177
177
|
];
|
|
178
178
|
|
|
179
179
|
export default unifyMixins;
|
|
@@ -4,22 +4,15 @@ import { nodeQuery, nodesQuery } from "./query";
|
|
|
4
4
|
import { nodeAsString, nodesAsString } from "./string";
|
|
5
5
|
|
|
6
6
|
const suppositionStatementNodesQuery = nodesQuery("/subproof/supposition/statement"),
|
|
7
|
-
lastProofStepStatementNodeQuery = nodeQuery("/subproof/subDerivation/
|
|
7
|
+
lastProofStepStatementNodeQuery = nodeQuery("/subproof/subDerivation/proofStep[-1]/statement");
|
|
8
8
|
|
|
9
9
|
export function subproofStringFromSubproofNode(subproofNode, fileContext) {
|
|
10
|
-
let subproofString = null;
|
|
11
|
-
|
|
12
10
|
const tokens = fileContext.getTokens(),
|
|
13
11
|
suppositionStatementNodes = suppositionStatementNodesQuery(subproofNode),
|
|
14
12
|
lastProofStepStatementNode = lastProofStepStatementNodeQuery(subproofNode),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const suppositionStatementsString = nodesAsString(suppositionStatementNodes, tokens),
|
|
19
|
-
lastProofStepStatementString = nodeAsString(lastProofStepStatementNode, tokens);
|
|
20
|
-
|
|
21
|
-
subproofString = `[${suppositionStatementsString}]...${lastProofStepStatementString}`;
|
|
22
|
-
}
|
|
13
|
+
suppositionStatementsString = nodesAsString(suppositionStatementNodes, tokens),
|
|
14
|
+
lastProofStepStatementString = nodeAsString(lastProofStepStatementNode, tokens),
|
|
15
|
+
subproofString = `[${suppositionStatementsString}]...${lastProofStepStatementString}`;
|
|
23
16
|
|
|
24
17
|
return subproofString;
|
|
25
18
|
}
|