occam-verify-cli 1.0.444 → 1.0.448
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 +5 -5
- package/lib/context/local.js +27 -27
- package/lib/context/release.js +3 -7
- package/lib/context/temporary.js +13 -13
- package/lib/element/axiom.js +19 -19
- package/lib/element/axiomLemmaTheoremConjecture.js +25 -32
- package/lib/element/derivation.js +14 -14
- package/lib/element/hypothesis.js +14 -55
- package/lib/element/metaLemmaMetatheorem.js +2 -35
- package/lib/element/metavariable.js +9 -5
- package/lib/element/premise.js +67 -140
- package/lib/element/proof.js +7 -7
- package/lib/element/proofAssertion.js +203 -0
- package/lib/element/reference.js +5 -3
- package/lib/element/rule.js +26 -26
- package/lib/element/statement.js +8 -8
- package/lib/element/step.js +14 -93
- package/lib/element/subDerivation.js +14 -14
- package/lib/element/subproof.js +11 -11
- package/lib/element/supposition.js +62 -152
- package/lib/metaTypes.js +19 -8
- package/lib/node/subDerivation.js +1 -8
- package/lib/node/subproof.js +1 -8
- package/lib/utilities/brackets.js +6 -11
- package/lib/utilities/instance.js +24 -11
- package/lib/utilities/string.js +6 -6
- package/lib/utilities/unification.js +21 -21
- package/package.json +6 -6
- package/src/context/file.js +3 -3
- package/src/context/local.js +28 -28
- package/src/context/release.js +2 -9
- package/src/context/temporary.js +4 -4
- package/src/element/axiom.js +26 -26
- package/src/element/axiomLemmaTheoremConjecture.js +25 -44
- package/src/element/derivation.js +12 -12
- package/src/element/hypothesis.js +14 -16
- package/src/element/metaLemmaMetatheorem.js +1 -66
- package/src/element/metavariable.js +9 -4
- package/src/element/premise.js +94 -62
- package/src/element/proof.js +6 -6
- package/src/element/proofAssertion.js +76 -0
- package/src/element/reference.js +4 -2
- package/src/element/rule.js +22 -22
- package/src/element/statement.js +6 -6
- package/src/element/step.js +12 -50
- package/src/element/subDerivation.js +12 -12
- package/src/element/subproof.js +7 -7
- package/src/element/supposition.js +74 -73
- package/src/metaTypes.js +23 -10
- package/src/node/subDerivation.js +0 -7
- package/src/node/subproof.js +0 -7
- package/src/utilities/brackets.js +5 -8
- package/src/utilities/instance.js +24 -6
- package/src/utilities/string.js +7 -7
- package/src/utilities/unification.js +24 -24
package/src/context/temporary.js
CHANGED
|
@@ -235,11 +235,11 @@ export default class TemporaryContext {
|
|
|
235
235
|
|
|
236
236
|
getEquivalences() { return this.context.getEquivalences(); }
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
getProofAssertions() { return this.context.getProofAssertions(); }
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
getLastProofAssertion() { return this.context.getLastProofAssertion(); }
|
|
241
241
|
|
|
242
|
-
|
|
242
|
+
getSubproofOrProofAssertions() { return this.context.getSubproofOrProofAssertions(); }
|
|
243
243
|
|
|
244
244
|
getFilePath() { return this.context.getFilePath(); }
|
|
245
245
|
|
|
@@ -273,7 +273,7 @@ export default class TemporaryContext {
|
|
|
273
273
|
|
|
274
274
|
addJudgement(judgement) { return this.context.addJudgement(judgement); }
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
addSubproofOrProofAssertion(subproofOrProofAssertion) { this.context.addSubproofOrProofAssertion(subproofOrProofAssertion); }
|
|
277
277
|
|
|
278
278
|
findProcedureByName(name) { return this.context.findProcedureByName(name); }
|
|
279
279
|
|
package/src/element/axiom.js
CHANGED
|
@@ -110,29 +110,6 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
110
110
|
return stepUnifies;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
unifyLastStep(lastStep, substitutions, context) {
|
|
114
|
-
let lastStepUnifies = false;
|
|
115
|
-
|
|
116
|
-
const node = this.getNode(),
|
|
117
|
-
axiomString = this.getString(),
|
|
118
|
-
lastStepString = lastStep.getString();
|
|
119
|
-
|
|
120
|
-
context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`, node)
|
|
121
|
-
|
|
122
|
-
const statement = lastStep.getStatement(),
|
|
123
|
-
statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
|
|
124
|
-
|
|
125
|
-
if (statementUnifiesWithDeduction) {
|
|
126
|
-
lastStepUnifies = true;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (lastStepUnifies) {
|
|
130
|
-
context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`, node)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return lastStepUnifies;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
113
|
unifySubproof(subproof, substitutions, context) {
|
|
137
114
|
let subproofUnifies = false;
|
|
138
115
|
|
|
@@ -147,10 +124,10 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
147
124
|
if (unconditional) {
|
|
148
125
|
context.trace(`Unable to unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
|
|
149
126
|
} else {
|
|
150
|
-
const
|
|
151
|
-
|
|
127
|
+
const lastProofAssertion = subproof.getLastProofAssertion(),
|
|
128
|
+
lastProofAssertionUnifies = this.unifyLastProofAssertion(lastProofAssertion, substitutions, context);
|
|
152
129
|
|
|
153
|
-
if (
|
|
130
|
+
if (lastProofAssertionUnifies) {
|
|
154
131
|
const suppositions = subproof.getSuppositions(),
|
|
155
132
|
suppositionsUnify = this.unifySuppositions(suppositions, substitutions, context);
|
|
156
133
|
|
|
@@ -225,6 +202,29 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
225
202
|
return suppositionsUnify;
|
|
226
203
|
}
|
|
227
204
|
|
|
205
|
+
unifyLastProofAssertion(lastProofAssertion, substitutions, context) {
|
|
206
|
+
let lastProofAssertionUnifies = false;
|
|
207
|
+
|
|
208
|
+
const node = this.getNode(),
|
|
209
|
+
axiomString = this.getString(),
|
|
210
|
+
lastProofAssertionString = lastProofAssertion.getString();
|
|
211
|
+
|
|
212
|
+
context.trace(`Unifying the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom...`, node)
|
|
213
|
+
|
|
214
|
+
const statement = lastProofAssertion.getStatement(),
|
|
215
|
+
statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
|
|
216
|
+
|
|
217
|
+
if (statementUnifiesWithDeduction) {
|
|
218
|
+
lastProofAssertionUnifies = true;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (lastProofAssertionUnifies) {
|
|
222
|
+
context.debug(`...unified the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom.`, node)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return lastProofAssertionUnifies;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
228
|
unifyAxiomLemmaTheoremOrConjecture(axiomLemmaTheoremOrConjecture, substitutions, context) {
|
|
229
229
|
let axiomLemmaTheoremOrConjectureUnifies = false;
|
|
230
230
|
|
|
@@ -99,21 +99,21 @@ export default class AxiomLemmaTheoremConjecture extends Element {
|
|
|
99
99
|
const hypothetical = this.isHypothetical();
|
|
100
100
|
|
|
101
101
|
if (hypothetical) {
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const proofAssertions = context.getProofAssertions(),
|
|
103
|
+
axiomLemmaTheoremConjectureString = this.getString(); ///
|
|
104
104
|
|
|
105
|
-
context.trace(`Correlating the hypotheses of the '${
|
|
105
|
+
context.trace(`Correlating the hypotheses of the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`, this.node);
|
|
106
106
|
|
|
107
|
-
correlatesToHypotheses = correlate(this.hypotheses,
|
|
108
|
-
const
|
|
107
|
+
correlatesToHypotheses = correlate(this.hypotheses, proofAssertions, (hypothesis, proofAssertion) => {
|
|
108
|
+
const hypothesesComparesToStep = hypothesis.compareProofAssertion(proofAssertion, context);
|
|
109
109
|
|
|
110
|
-
if (
|
|
110
|
+
if (hypothesesComparesToStep) {
|
|
111
111
|
return true;
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
if (correlatesToHypotheses) {
|
|
116
|
-
context.debug(`...correlated the hypotheses of the '${
|
|
116
|
+
context.debug(`...correlated the hypotheses of the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture.`, this.node);
|
|
117
117
|
}
|
|
118
118
|
} else {
|
|
119
119
|
correlatesToHypotheses = true
|
|
@@ -212,7 +212,7 @@ export default class AxiomLemmaTheoremConjecture extends Element {
|
|
|
212
212
|
return statementUnifiesWithDeduction;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
unifyStatementAndStepsOrSubproofs(statement,
|
|
215
|
+
unifyStatementAndStepsOrSubproofs(statement, subproofOrProofAssertions, substitutions, context) {
|
|
216
216
|
let statementAndStepsOrSubproofsUnifies = false;
|
|
217
217
|
|
|
218
218
|
const correlatesToHypotheses = this.correlateHypotheses(context);
|
|
@@ -221,9 +221,9 @@ export default class AxiomLemmaTheoremConjecture extends Element {
|
|
|
221
221
|
const statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
|
|
222
222
|
|
|
223
223
|
if (statementUnifiesWithDeduction) {
|
|
224
|
-
const
|
|
224
|
+
const subproofOrProofAssertionsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, context);
|
|
225
225
|
|
|
226
|
-
if (
|
|
226
|
+
if (subproofOrProofAssertionsUnifyWithSuppositions) {
|
|
227
227
|
const substitutionsResolved = substitutions.areResolved();
|
|
228
228
|
|
|
229
229
|
if (substitutionsResolved) {
|
|
@@ -236,43 +236,43 @@ export default class AxiomLemmaTheoremConjecture extends Element {
|
|
|
236
236
|
return statementAndStepsOrSubproofsUnifies;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
unifyStepsOrSubproofsWithSupposition(
|
|
240
|
-
let
|
|
239
|
+
unifyStepsOrSubproofsWithSupposition(subproofOrProofAssertions, supposition, substitutions, generalContext, specificContext) {
|
|
240
|
+
let subproofOrProofAssertionsUnifiesWithSupposition = false;
|
|
241
241
|
|
|
242
242
|
const context = specificContext, ///
|
|
243
243
|
suppositionUnifiesIndependently = supposition.unifyIndependently(substitutions, context);
|
|
244
244
|
|
|
245
245
|
if (suppositionUnifiesIndependently) {
|
|
246
|
-
|
|
246
|
+
subproofOrProofAssertionsUnifiesWithSupposition = true;
|
|
247
247
|
} else {
|
|
248
|
-
const
|
|
249
|
-
const
|
|
248
|
+
const subproofOrProofAssertion = extract(subproofOrProofAssertions, (subproofOrProofAssertion) => {
|
|
249
|
+
const subproofOrProofAssertionUnifies = supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, substitutions, generalContext, specificContext);
|
|
250
250
|
|
|
251
|
-
if (
|
|
251
|
+
if (subproofOrProofAssertionUnifies) {
|
|
252
252
|
return true;
|
|
253
253
|
}
|
|
254
254
|
}) || null;
|
|
255
255
|
|
|
256
|
-
if (
|
|
257
|
-
|
|
256
|
+
if (subproofOrProofAssertion !== null) {
|
|
257
|
+
subproofOrProofAssertionsUnifiesWithSupposition = true;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
return
|
|
261
|
+
return subproofOrProofAssertionsUnifiesWithSupposition;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
unifyStepsOrSubproofsWithSuppositions(
|
|
265
|
-
|
|
264
|
+
unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, generalContext, specificContext) {
|
|
265
|
+
subproofOrProofAssertions = reverse(subproofOrProofAssertions); ///
|
|
266
266
|
|
|
267
|
-
const
|
|
268
|
-
const
|
|
267
|
+
const subproofOrProofAssertionsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
|
|
268
|
+
const subproofOrProofAssertionsUnifiesWithSupposition = this.unifyStepsOrSubproofsWithSupposition(subproofOrProofAssertions, supposition, substitutions, generalContext, specificContext);
|
|
269
269
|
|
|
270
|
-
if (
|
|
270
|
+
if (subproofOrProofAssertionsUnifiesWithSupposition) {
|
|
271
271
|
return true;
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
-
return
|
|
275
|
+
return subproofOrProofAssertionsUnifyWithSuppositions;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
toJSON() {
|
|
@@ -310,23 +310,4 @@ export default class AxiomLemmaTheoremConjecture extends Element {
|
|
|
310
310
|
|
|
311
311
|
return axiomLemmaTheoremConjecture;
|
|
312
312
|
}
|
|
313
|
-
|
|
314
|
-
static fromNode(Class, node, context) {
|
|
315
|
-
const topLevelAssertionNode = node, ///
|
|
316
|
-
proofNode = topLevelAssertionNode.getProofNode(),
|
|
317
|
-
labelNodes = topLevelAssertionNode.getLabelNodes(),
|
|
318
|
-
deductionNode = topLevelAssertionNode.getDeductionNode(),
|
|
319
|
-
suppositionNodes = topLevelAssertionNode.getSuppositionNodes(),
|
|
320
|
-
signatureNode = topLevelAssertionNode.getSignatureNode(),
|
|
321
|
-
proof = proofFromProofNode(proofNode, context),
|
|
322
|
-
labels = labelsFromLabelNodes(labelNodes, context),
|
|
323
|
-
deduction = deductionFromDeductionNode(deductionNode, context),
|
|
324
|
-
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context),
|
|
325
|
-
signature = signatureFromSignatureNode(signatureNode, context),
|
|
326
|
-
hypotheses = [],
|
|
327
|
-
string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
328
|
-
axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
329
|
-
|
|
330
|
-
return axiomLemmaTheoremConjecture;
|
|
331
|
-
}
|
|
332
313
|
}
|
|
@@ -10,35 +10,35 @@ import { define } from "../elements";
|
|
|
10
10
|
const { last } = arrayUtilities;
|
|
11
11
|
|
|
12
12
|
export default define(class Derivation extends Element {
|
|
13
|
-
constructor(context, string, node,
|
|
13
|
+
constructor(context, string, node, subproofOrProofAssertions) {
|
|
14
14
|
super(context, string, node);
|
|
15
15
|
|
|
16
|
-
this.
|
|
16
|
+
this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
return this.
|
|
19
|
+
getSubproofOrProofAssertions() {
|
|
20
|
+
return this.subproofOrProofAssertions;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
getLastProofAssertion() {
|
|
24
|
+
const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
|
|
25
|
+
lastProofAssertion = lastSubproofOrProofAssertion; ///
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return lastProofAssertion;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
verify(substitutions, context) {
|
|
31
31
|
let verifies;
|
|
32
32
|
|
|
33
|
-
verifies = this.
|
|
33
|
+
verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
|
|
34
34
|
const assignments = [],
|
|
35
|
-
|
|
35
|
+
subproofOrProofAssertionVerifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
|
|
36
36
|
|
|
37
|
-
if (
|
|
37
|
+
if (subproofOrProofAssertionVerifies) {
|
|
38
38
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
39
39
|
|
|
40
40
|
if (assignmentsAssigned) {
|
|
41
|
-
context.
|
|
41
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
42
42
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Element from "../element";
|
|
4
|
-
import elements from "../elements";
|
|
5
4
|
import assignAssignments from "../process/assign";
|
|
6
5
|
|
|
7
6
|
import { define } from "../elements";
|
|
@@ -36,11 +35,9 @@ export default define(class Hypothesis extends Element {
|
|
|
36
35
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
37
36
|
|
|
38
37
|
if (assignmentsAssigned) {
|
|
39
|
-
const
|
|
40
|
-
step = Step.fromStatement(this.statement, context),
|
|
41
|
-
stepOrSubproof = step; ///
|
|
38
|
+
const subproofOrProofAssertion = this; ///
|
|
42
39
|
|
|
43
|
-
context.
|
|
40
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
44
41
|
|
|
45
42
|
verifies = true;
|
|
46
43
|
}
|
|
@@ -56,26 +53,27 @@ export default define(class Hypothesis extends Element {
|
|
|
56
53
|
return verifies;
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
let
|
|
56
|
+
compareProofAssertion(proofAssertion, context) {
|
|
57
|
+
let comparesToProofAssertion = false;
|
|
61
58
|
|
|
62
|
-
const
|
|
63
|
-
hypothesisString = this.
|
|
59
|
+
const node = this.getNode(),
|
|
60
|
+
hypothesisString = this.getString(), ///
|
|
61
|
+
proofAssertionString = proofAssertion.getString();
|
|
64
62
|
|
|
65
|
-
context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${
|
|
63
|
+
context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${proofAssertionString}' proof assertion...`, node);
|
|
66
64
|
|
|
67
|
-
const
|
|
68
|
-
statementEqualToStepStatement = this.statement.isEqualTo(
|
|
65
|
+
const proofAssertionStatement = proofAssertion.getStatement(),
|
|
66
|
+
statementEqualToStepStatement = this.statement.isEqualTo(proofAssertionStatement);
|
|
69
67
|
|
|
70
68
|
if (statementEqualToStepStatement) {
|
|
71
|
-
|
|
69
|
+
comparesToProofAssertion = true;
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
if (
|
|
75
|
-
context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${
|
|
72
|
+
if (comparesToProofAssertion) {
|
|
73
|
+
context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${proofAssertionString}' proof assertion.`, node);
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
return
|
|
76
|
+
return comparesToProofAssertion;
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
toJSON() {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import Element from "../element";
|
|
4
|
-
import elements from "../elements";
|
|
5
4
|
import LocalContext from "../context/local";
|
|
6
5
|
|
|
7
|
-
import { proofFromProofNode, deductionFromDeductionNode, suppositionsFromSuppositionNodes } from "./axiomLemmaTheoremConjecture";
|
|
8
6
|
import { labelFromJSON,
|
|
9
7
|
labelToLabelJSON,
|
|
10
8
|
deductionFromJSON,
|
|
@@ -150,72 +148,9 @@ export default class MetaLemmaMetatheorem extends Element {
|
|
|
150
148
|
substitutions = substitutionsFromJSON(json, context),
|
|
151
149
|
node = null,
|
|
152
150
|
proof = null,
|
|
153
|
-
string =
|
|
151
|
+
string = metaLemmaMetatheoremStringFromLabelASuppositionsAndDeduction(label, suppositions, deduction),
|
|
154
152
|
metaLemmaMetatheorem = new Class(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
155
153
|
|
|
156
154
|
return metaLemmaMetatheorem;
|
|
157
155
|
}
|
|
158
|
-
|
|
159
|
-
static fromNode(Class, node, context) {
|
|
160
|
-
const { Substitutions } = elements,
|
|
161
|
-
topLevelAssertionNode = node, ///
|
|
162
|
-
proofNode = topLevelAssertionNode.getProofNode(),
|
|
163
|
-
labelNode = topLevelAssertionNode.getLabelNode(),
|
|
164
|
-
deductionNode = topLevelAssertionNode.getDeductionNode(),
|
|
165
|
-
suppositionNodes = topLevelAssertionNode.getSuppositionNodes(),
|
|
166
|
-
proof = proofFromProofNode(proofNode, context),
|
|
167
|
-
label = labelFromLabelNode(labelNode, context),
|
|
168
|
-
deduction = deductionFromDeductionNode(deductionNode, context),
|
|
169
|
-
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context),
|
|
170
|
-
substitutions = Substitutions.fromNothing(),
|
|
171
|
-
string = stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction),
|
|
172
|
-
metaLemmaMetatheorem = new Class(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
173
|
-
|
|
174
|
-
return metaLemmaMetatheorem;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function labelFromLabelNode(labelNode, context) {
|
|
179
|
-
let label = null;
|
|
180
|
-
|
|
181
|
-
const { Label } = elements;
|
|
182
|
-
|
|
183
|
-
if (labelNode !== null) {
|
|
184
|
-
label = Label.fromLabelNode(labelNode, context);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return label;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function labelStringFromLabel(label) {
|
|
191
|
-
const labelsString = (label !== null) ?
|
|
192
|
-
label.getString() :
|
|
193
|
-
null;
|
|
194
|
-
|
|
195
|
-
return labelsString;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function suppositionsStringFromSuppositions(suppositions) {
|
|
199
|
-
const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
|
|
200
|
-
const suppositionString = supposition.getString();
|
|
201
|
-
|
|
202
|
-
suppositionsString = (suppositionsString !== null) ?
|
|
203
|
-
`${suppositionsString}, ${suppositionString}` :
|
|
204
|
-
suppositionString; ///
|
|
205
|
-
|
|
206
|
-
return suppositionsString;
|
|
207
|
-
}, null);
|
|
208
|
-
|
|
209
|
-
return suppositionsString;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction) {
|
|
213
|
-
const suppositionsString = suppositionsStringFromSuppositions(suppositions),
|
|
214
|
-
deductionString = deduction.getString(),
|
|
215
|
-
labelString = labelStringFromLabel(label),
|
|
216
|
-
string = (labelString === null) ?
|
|
217
|
-
deductionString : ///
|
|
218
|
-
`${labelString} :: [${suppositionsString}] ... ${deductionString}`;
|
|
219
|
-
|
|
220
|
-
return string;
|
|
221
156
|
}
|
|
@@ -46,7 +46,8 @@ export default define(class Metavariable extends Element {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
compareMetavariableName(metavariableName) {
|
|
49
|
-
const
|
|
49
|
+
const nameMetavariableName = (this.name === metavariableName),
|
|
50
|
+
comparesToMetavariableName = nameMetavariableName; ///
|
|
50
51
|
|
|
51
52
|
return comparesToMetavariableName;
|
|
52
53
|
}
|
|
@@ -54,7 +55,7 @@ export default define(class Metavariable extends Element {
|
|
|
54
55
|
isMetaTypeEqualTo(metaType) { return this.metaType.isEqualTo(metaType); }
|
|
55
56
|
|
|
56
57
|
validate(context) {
|
|
57
|
-
let validates;
|
|
58
|
+
let validates = false;
|
|
58
59
|
|
|
59
60
|
const metavariableString = this.getString(); ///
|
|
60
61
|
|
|
@@ -63,7 +64,9 @@ export default define(class Metavariable extends Element {
|
|
|
63
64
|
const metavariable = this, ///
|
|
64
65
|
metavariablePresent = context.isMetavariablePresent(metavariable);
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
if (metavariablePresent) {
|
|
68
|
+
validates = true;
|
|
69
|
+
}
|
|
67
70
|
|
|
68
71
|
if (validates) {
|
|
69
72
|
context.debug(`...va;idated the '${metavariableString}' metavariable.`);
|
|
@@ -87,7 +90,9 @@ export default define(class Metavariable extends Element {
|
|
|
87
90
|
if (metavariable !== null) {
|
|
88
91
|
const metavariableMetaTypeEqualToMetaType = metavariable.isMetaTypeEqualTo(metaType);
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
if (metavariableMetaTypeEqualToMetaType) {
|
|
94
|
+
validatesGivenMetaType = true;
|
|
95
|
+
}
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
if (validatesGivenMetaType) {
|