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.
Files changed (55) hide show
  1. package/lib/context/file.js +5 -5
  2. package/lib/context/local.js +27 -27
  3. package/lib/context/release.js +3 -7
  4. package/lib/context/temporary.js +13 -13
  5. package/lib/element/axiom.js +19 -19
  6. package/lib/element/axiomLemmaTheoremConjecture.js +25 -32
  7. package/lib/element/derivation.js +14 -14
  8. package/lib/element/hypothesis.js +14 -55
  9. package/lib/element/metaLemmaMetatheorem.js +2 -35
  10. package/lib/element/metavariable.js +9 -5
  11. package/lib/element/premise.js +67 -140
  12. package/lib/element/proof.js +7 -7
  13. package/lib/element/proofAssertion.js +203 -0
  14. package/lib/element/reference.js +5 -3
  15. package/lib/element/rule.js +26 -26
  16. package/lib/element/statement.js +8 -8
  17. package/lib/element/step.js +14 -93
  18. package/lib/element/subDerivation.js +14 -14
  19. package/lib/element/subproof.js +11 -11
  20. package/lib/element/supposition.js +62 -152
  21. package/lib/metaTypes.js +19 -8
  22. package/lib/node/subDerivation.js +1 -8
  23. package/lib/node/subproof.js +1 -8
  24. package/lib/utilities/brackets.js +6 -11
  25. package/lib/utilities/instance.js +24 -11
  26. package/lib/utilities/string.js +6 -6
  27. package/lib/utilities/unification.js +21 -21
  28. package/package.json +6 -6
  29. package/src/context/file.js +3 -3
  30. package/src/context/local.js +28 -28
  31. package/src/context/release.js +2 -9
  32. package/src/context/temporary.js +4 -4
  33. package/src/element/axiom.js +26 -26
  34. package/src/element/axiomLemmaTheoremConjecture.js +25 -44
  35. package/src/element/derivation.js +12 -12
  36. package/src/element/hypothesis.js +14 -16
  37. package/src/element/metaLemmaMetatheorem.js +1 -66
  38. package/src/element/metavariable.js +9 -4
  39. package/src/element/premise.js +94 -62
  40. package/src/element/proof.js +6 -6
  41. package/src/element/proofAssertion.js +76 -0
  42. package/src/element/reference.js +4 -2
  43. package/src/element/rule.js +22 -22
  44. package/src/element/statement.js +6 -6
  45. package/src/element/step.js +12 -50
  46. package/src/element/subDerivation.js +12 -12
  47. package/src/element/subproof.js +7 -7
  48. package/src/element/supposition.js +74 -73
  49. package/src/metaTypes.js +23 -10
  50. package/src/node/subDerivation.js +0 -7
  51. package/src/node/subproof.js +0 -7
  52. package/src/utilities/brackets.js +5 -8
  53. package/src/utilities/instance.js +24 -6
  54. package/src/utilities/string.js +7 -7
  55. package/src/utilities/unification.js +24 -24
@@ -235,11 +235,11 @@ export default class TemporaryContext {
235
235
 
236
236
  getEquivalences() { return this.context.getEquivalences(); }
237
237
 
238
- getSteps() { return this.context.getSteps(); }
238
+ getProofAssertions() { return this.context.getProofAssertions(); }
239
239
 
240
- getLastStep() { return this.context.getLastStep(); }
240
+ getLastProofAssertion() { return this.context.getLastProofAssertion(); }
241
241
 
242
- getStepsOrSubproofs() { return this.context.getStepsOrSubproofs(); }
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
- addStepOrSubproof(stepOrSubproof) { this.context.addStepOrSubproof(stepOrSubproof); }
276
+ addSubproofOrProofAssertion(subproofOrProofAssertion) { this.context.addSubproofOrProofAssertion(subproofOrProofAssertion); }
277
277
 
278
278
  findProcedureByName(name) { return this.context.findProcedureByName(name); }
279
279
 
@@ -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 lastStep = subproof.getLastStep(),
151
- lastStepUnifies = this.unifyLastStep(lastStep, substitutions, context);
127
+ const lastProofAssertion = subproof.getLastProofAssertion(),
128
+ lastProofAssertionUnifies = this.unifyLastProofAssertion(lastProofAssertion, substitutions, context);
152
129
 
153
- if (lastStepUnifies) {
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 steps = context.getSteps(),
103
- topLevelAssertionString = this.getString(); ///
102
+ const proofAssertions = context.getProofAssertions(),
103
+ axiomLemmaTheoremConjectureString = this.getString(); ///
104
104
 
105
- context.trace(`Correlating the hypotheses of the '${topLevelAssertionString}' axiom, lemma, theorem or conjecture...`, this.node);
105
+ context.trace(`Correlating the hypotheses of the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`, this.node);
106
106
 
107
- correlatesToHypotheses = correlate(this.hypotheses, steps, (hypothesis, step) => {
108
- const hypothesesEqualToStep = hypothesis.isEqualToStep(step, context);
107
+ correlatesToHypotheses = correlate(this.hypotheses, proofAssertions, (hypothesis, proofAssertion) => {
108
+ const hypothesesComparesToStep = hypothesis.compareProofAssertion(proofAssertion, context);
109
109
 
110
- if (hypothesesEqualToStep) {
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 '${topLevelAssertionString}' axiom, lemma, theorem or conjecture.`, this.node);
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, stepsOrSubproofs, substitutions, context) {
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 stepsOrSubproofsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, context);
224
+ const subproofOrProofAssertionsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, context);
225
225
 
226
- if (stepsOrSubproofsUnifyWithSuppositions) {
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(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext) {
240
- let stepsOrSubproofsUnifiesWithSupposition = false;
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
- stepsOrSubproofsUnifiesWithSupposition = true;
246
+ subproofOrProofAssertionsUnifiesWithSupposition = true;
247
247
  } else {
248
- const stepOrSubproof = extract(stepsOrSubproofs, (stepOrSubproof) => {
249
- const stepOrSubproofUnifies = supposition.unifyStepOrSubproof(stepOrSubproof, substitutions, generalContext, specificContext);
248
+ const subproofOrProofAssertion = extract(subproofOrProofAssertions, (subproofOrProofAssertion) => {
249
+ const subproofOrProofAssertionUnifies = supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, substitutions, generalContext, specificContext);
250
250
 
251
- if (stepOrSubproofUnifies) {
251
+ if (subproofOrProofAssertionUnifies) {
252
252
  return true;
253
253
  }
254
254
  }) || null;
255
255
 
256
- if (stepOrSubproof !== null) {
257
- stepsOrSubproofsUnifiesWithSupposition = true;
256
+ if (subproofOrProofAssertion !== null) {
257
+ subproofOrProofAssertionsUnifiesWithSupposition = true;
258
258
  }
259
259
  }
260
260
 
261
- return stepsOrSubproofsUnifiesWithSupposition;
261
+ return subproofOrProofAssertionsUnifiesWithSupposition;
262
262
  }
263
263
 
264
- unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, generalContext, specificContext) {
265
- stepsOrSubproofs = reverse(stepsOrSubproofs); ///
264
+ unifyStepsOrSubproofsWithSuppositions(subproofOrProofAssertions, substitutions, generalContext, specificContext) {
265
+ subproofOrProofAssertions = reverse(subproofOrProofAssertions); ///
266
266
 
267
- const stepsOrSubproofsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
268
- const stepsOrSubproofsUnifiesWithSupposition = this.unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext);
267
+ const subproofOrProofAssertionsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
268
+ const subproofOrProofAssertionsUnifiesWithSupposition = this.unifyStepsOrSubproofsWithSupposition(subproofOrProofAssertions, supposition, substitutions, generalContext, specificContext);
269
269
 
270
- if (stepsOrSubproofsUnifiesWithSupposition) {
270
+ if (subproofOrProofAssertionsUnifiesWithSupposition) {
271
271
  return true;
272
272
  }
273
273
  });
274
274
 
275
- return stepsOrSubproofsUnifyWithSuppositions;
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, stepsOrSubproofs) {
13
+ constructor(context, string, node, subproofOrProofAssertions) {
14
14
  super(context, string, node);
15
15
 
16
- this.stepsOrSubproofs = stepsOrSubproofs;
16
+ this.subproofOrProofAssertions = subproofOrProofAssertions;
17
17
  }
18
18
 
19
- getStepsOrSubproofs() {
20
- return this.stepsOrSubproofs;
19
+ getSubproofOrProofAssertions() {
20
+ return this.subproofOrProofAssertions;
21
21
  }
22
22
 
23
- getLastStep() {
24
- const lastStepOrSubproof = last(this.stepsOrSubproofs),
25
- lastStep = lastStepOrSubproof; ///
23
+ getLastProofAssertion() {
24
+ const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
25
+ lastProofAssertion = lastSubproofOrProofAssertion; ///
26
26
 
27
- return lastStep;
27
+ return lastProofAssertion;
28
28
  }
29
29
 
30
30
  verify(substitutions, context) {
31
31
  let verifies;
32
32
 
33
- verifies = this.stepsOrSubproofs.every((stepOrSubproof) => { ///
33
+ verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
34
34
  const assignments = [],
35
- stepOrSubproofVerifies = stepOrSubproof.verify(substitutions, assignments, context);
35
+ subproofOrProofAssertionVerifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
36
36
 
37
- if (stepOrSubproofVerifies) {
37
+ if (subproofOrProofAssertionVerifies) {
38
38
  const assignmentsAssigned = assignAssignments(assignments, context);
39
39
 
40
40
  if (assignmentsAssigned) {
41
- context.addStepOrSubproof(stepOrSubproof);
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 { Step } = elements,
40
- step = Step.fromStatement(this.statement, context),
41
- stepOrSubproof = step; ///
38
+ const subproofOrProofAssertion = this; ///
42
39
 
43
- context.addStepOrSubproof(stepOrSubproof);
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
- isEqualToStep(step, context) {
60
- let equalToStep = false;
56
+ compareProofAssertion(proofAssertion, context) {
57
+ let comparesToProofAssertion = false;
61
58
 
62
- const stepString = step.getString(),
63
- hypothesisString = this.string; ///
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 '${stepString}' step...`, this.node);
63
+ context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${proofAssertionString}' proof assertion...`, node);
66
64
 
67
- const stepStatement = step.getStatement(),
68
- statementEqualToStepStatement = this.statement.isEqualTo(stepStatement);
65
+ const proofAssertionStatement = proofAssertion.getStatement(),
66
+ statementEqualToStepStatement = this.statement.isEqualTo(proofAssertionStatement);
69
67
 
70
68
  if (statementEqualToStepStatement) {
71
- equalToStep = true;
69
+ comparesToProofAssertion = true;
72
70
  }
73
71
 
74
- if (equalToStep) {
75
- context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${stepString}' step.`, this.node);
72
+ if (comparesToProofAssertion) {
73
+ context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${proofAssertionString}' proof assertion.`, node);
76
74
  }
77
75
 
78
- return equalToStep;
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 = stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction),
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 comparesToMetavariableName = (metavariableName === this.name);
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
- validates = metavariablePresent; ///
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
- validatesGivenMetaType = metavariableMetaTypeEqualToMetaType; ///
93
+ if (metavariableMetaTypeEqualToMetaType) {
94
+ validatesGivenMetaType = true;
95
+ }
91
96
  }
92
97
 
93
98
  if (validatesGivenMetaType) {