occam-verify-cli 0.0.1245 → 0.0.1247

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 (74) hide show
  1. package/lib/context/file.js +172 -210
  2. package/lib/context/local.js +95 -125
  3. package/lib/dom/assertion/contained.js +44 -22
  4. package/lib/dom/assertion/defined.js +34 -17
  5. package/lib/dom/combinator/bracketed.js +167 -0
  6. package/lib/dom/combinator.js +163 -0
  7. package/lib/{constructor → dom/constructor}/bracketed.js +7 -7
  8. package/lib/dom/constructor.js +190 -0
  9. package/lib/dom/declaration/combinator.js +2 -8
  10. package/lib/dom/declaration/constructor.js +42 -7
  11. package/lib/dom/declaration.js +113 -71
  12. package/lib/dom/equality.js +3 -3
  13. package/lib/dom/frame.js +111 -76
  14. package/lib/dom/judgement.js +29 -3
  15. package/lib/dom/label.js +22 -15
  16. package/lib/dom/metaLemma.js +20 -41
  17. package/lib/dom/metatheorem.js +20 -41
  18. package/lib/dom/metavariable.js +7 -7
  19. package/lib/dom/reference.js +32 -18
  20. package/lib/dom/rule.js +3 -4
  21. package/lib/dom/statement.js +2 -2
  22. package/lib/dom/term.js +2 -2
  23. package/lib/dom/topLevelAssertion.js +50 -71
  24. package/lib/dom/type.js +3 -3
  25. package/lib/dom/variable.js +5 -5
  26. package/lib/equivalence.js +2 -2
  27. package/lib/index.js +7 -3
  28. package/lib/mixins/statement/verify.js +3 -3
  29. package/lib/mixins/term/verify.js +2 -3
  30. package/lib/substitution/statement.js +2 -2
  31. package/lib/unifier/{label.js → reference.js} +14 -14
  32. package/lib/utilities/json.js +5 -7
  33. package/lib/utilities/unification.js +25 -6
  34. package/lib/verifier/combinator.js +3 -3
  35. package/lib/verifier/constructor.js +3 -3
  36. package/package.json +5 -5
  37. package/src/context/file.js +166 -206
  38. package/src/context/local.js +73 -83
  39. package/src/dom/assertion/contained.js +60 -27
  40. package/src/dom/assertion/defined.js +44 -20
  41. package/src/{combinator → dom/combinator}/bracketed.js +6 -5
  42. package/src/{combinator.js → dom/combinator.js} +8 -7
  43. package/src/{constructor → dom/constructor}/bracketed.js +6 -5
  44. package/src/{constructor.js → dom/constructor.js} +8 -7
  45. package/src/dom/declaration/combinator.js +2 -3
  46. package/src/dom/declaration/constructor.js +3 -2
  47. package/src/dom/declaration.js +133 -101
  48. package/src/dom/equality.js +2 -2
  49. package/src/dom/frame.js +151 -95
  50. package/src/dom/judgement.js +36 -2
  51. package/src/dom/label.js +18 -13
  52. package/src/dom/metaLemma.js +23 -55
  53. package/src/dom/metatheorem.js +23 -55
  54. package/src/dom/metavariable.js +6 -6
  55. package/src/dom/reference.js +43 -25
  56. package/src/dom/rule.js +2 -2
  57. package/src/dom/statement.js +1 -1
  58. package/src/dom/term.js +1 -1
  59. package/src/dom/topLevelAssertion.js +53 -86
  60. package/src/dom/type.js +2 -2
  61. package/src/dom/variable.js +4 -4
  62. package/src/equivalence.js +1 -1
  63. package/src/index.js +4 -0
  64. package/src/mixins/statement/verify.js +3 -2
  65. package/src/mixins/term/verify.js +2 -3
  66. package/src/substitution/statement.js +1 -1
  67. package/src/unifier/{label.js → reference.js} +6 -6
  68. package/src/utilities/json.js +4 -4
  69. package/src/utilities/unification.js +43 -5
  70. package/src/verifier/combinator.js +2 -2
  71. package/src/verifier/constructor.js +2 -2
  72. package/lib/combinator/bracketed.js +0 -126
  73. package/lib/combinator.js +0 -122
  74. package/lib/constructor.js +0 -149
package/src/dom/label.js CHANGED
@@ -7,14 +7,19 @@ import { domAssigned } from "../dom";
7
7
  import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
8
8
 
9
9
  export default domAssigned(class Label {
10
- constructor(metavariable) {
10
+ constructor(metavariable, fileContext) {
11
11
  this.metavariable = metavariable;
12
+ this.fileContext = fileContext;
12
13
  }
13
14
 
14
15
  getMetavariable() {
15
16
  return this.metavariable;
16
17
  }
17
18
 
19
+ getFileContext() {
20
+ return this.fileContext;
21
+ }
22
+
18
23
  getString() { return this.metavariable.getString(); }
19
24
 
20
25
  getMetavariableName() {
@@ -33,36 +38,36 @@ export default domAssigned(class Label {
33
38
 
34
39
  matchMetavariableNode(metavariableNode) { return this.metavariable.matchMetavariableNode(metavariableNode); }
35
40
 
36
- verifyWhenDeclared(fileContext, nameOnly) {
37
- let verifiedWhenDeclared = false;
41
+ verify(nameOnly) {
42
+ let verified = false;
38
43
 
39
44
  const labelString = this.getString(); ///
40
45
 
41
- fileContext.trace(`Verifying the '${labelString}' label when declared...`);
46
+ this.fileContext.trace(`Verifying the '${labelString}' label when declared...`);
42
47
 
43
48
  let labelPresent;
44
49
 
45
50
  if (nameOnly) {
46
51
  const metavariableName = this.getMetavariableName();
47
52
 
48
- labelPresent = fileContext.isLabelPresentByMetavariableName(metavariableName);
53
+ labelPresent = this.fileContext.isLabelPresentByMetavariableName(metavariableName);
49
54
  } else {
50
55
  const metavariableNode = this.getMetavariableNode();
51
56
 
52
- labelPresent = fileContext.isLabelPresentByMetavariableNode(metavariableNode);
57
+ labelPresent = this.fileContext.isLabelPresentByMetavariableNode(metavariableNode);
53
58
  }
54
59
 
55
60
  if (labelPresent) {
56
- fileContext.debug(`The '${labelString}' label is already present.`);
61
+ this.fileContext.debug(`The '${labelString}' label is already present.`);
57
62
  } else {
58
- verifiedWhenDeclared = true;
63
+ verified = true;
59
64
  }
60
65
 
61
- if (verifiedWhenDeclared) {
62
- fileContext.debug(`...verified the '${labelString}' label when declared.`);
66
+ if (verified) {
67
+ this.fileContext.debug(`...verified the '${labelString}' label when declared.`);
63
68
  }
64
69
 
65
- return verifiedWhenDeclared;
70
+ return verified;
66
71
  }
67
72
 
68
73
  toJSON() {
@@ -79,7 +84,7 @@ export default domAssigned(class Label {
79
84
 
80
85
  static fromJSON(json, fileContext) {
81
86
  const metavariable = metavariableFromJSON(json, fileContext),
82
- label = new Label(metavariable);
87
+ label = new Label(metavariable, fileContext);
83
88
 
84
89
  return label;
85
90
  }
@@ -88,7 +93,7 @@ export default domAssigned(class Label {
88
93
  const { Metavariable } = dom,
89
94
  localContext = LocalContext.fromFileContext(fileContext),
90
95
  metavariable = Metavariable.fromLabelNode(labelNode, localContext),
91
- label = new Label(metavariable);
96
+ label = new Label(metavariable, fileContext);
92
97
 
93
98
  return label;
94
99
  }
@@ -6,36 +6,39 @@ import TopLevelAssertion from "./topLevelAssertion";
6
6
  import { domAssigned } from "../dom";
7
7
 
8
8
  export default domAssigned(class MetaLemma extends TopLevelAssertion {
9
- unifyReference(reference, substitutions, context) {
10
- let referenceUnified;
9
+ verify() {
10
+ let verified;
11
11
 
12
12
  const metaLemma = this, ///
13
- referenceString = reference.getString(),
13
+ fileContext = this.getFileContext(),
14
14
  metaLemmaString = metaLemma.getString();
15
15
 
16
- context.trace(`Unifying the '${referenceString}' reference with the '${metaLemmaString}' meta-lemma...`);
17
-
18
- const fileContext = this.getFileContext(),
19
- localContext = LocalContext.fromFileContext(fileContext),
20
- generalContext = localContext, ///
21
- specificContext = context, ///
22
- labelUnified = this.labels.some((label) => {
23
- substitutions.clear();
16
+ fileContext.trace(`Verifying the '${metaLemmaString}' meta-lemma...`);
24
17
 
25
- const referenceUnified = reference.unifyLabel(label, substitutions, generalContext, specificContext);
18
+ verified = super.verify();
26
19
 
27
- if (referenceUnified) {
28
- return true;
29
- }
30
- });
20
+ if (verified) {
21
+ const metaTheorem = this; ///
31
22
 
32
- referenceUnified = labelUnified; ///
23
+ fileContext.addMetatheorem(metaTheorem);
33
24
 
34
- if (referenceUnified) {
35
- context.debug(`...unified the '${referenceString}' reference with the '${metaLemmaString}' meta-lemma.`);
25
+ fileContext.debug(`...verified the '${metaLemmaString}' meta-lemma.`);
36
26
  }
37
27
 
38
- return referenceUnified;
28
+ return verified;
29
+ }
30
+
31
+ verifyLabels() {
32
+ const labelsVerified = this.labels.every((label) => {
33
+ const nameOnly = false,
34
+ labelVerified = label.verify(nameOnly);
35
+
36
+ if (labelVerified) {
37
+ return true;
38
+ }
39
+ });
40
+
41
+ return labelsVerified;
39
42
  }
40
43
 
41
44
  unifyStatement(statement, substitutions, context) {
@@ -67,41 +70,6 @@ export default domAssigned(class MetaLemma extends TopLevelAssertion {
67
70
  return statementUnified;
68
71
  }
69
72
 
70
- verify() {
71
- let verified;
72
-
73
- const metaLemma = this, ///
74
- fileContext = this.getFileContext(),
75
- metaLemmaString = metaLemma.getString();
76
-
77
- fileContext.trace(`Verifying the '${metaLemmaString}' meta-lemma...`);
78
-
79
- verified = super.verify();
80
-
81
- if (verified) {
82
- const metaTheorem = this; ///
83
-
84
- fileContext.addMetatheorem(metaTheorem);
85
-
86
- fileContext.debug(`...verified the '${metaLemmaString}' meta-lemma.`);
87
- }
88
-
89
- return verified;
90
- }
91
-
92
- verifyLabels() {
93
- const labelsVerified = this.labels.every((label) => {
94
- const nameOnly = false,
95
- labelVVerifiedWhenDeclared = label.verifyWhenDeclared(this.fileContext, nameOnly);
96
-
97
- if (labelVVerifiedWhenDeclared) {
98
- return true;
99
- }
100
- });
101
-
102
- return labelsVerified;
103
- }
104
-
105
73
  static name = "MetaLemma";
106
74
 
107
75
  static fromMetaLemmaNode(metaLemmaNode, fileContext) { return TopLevelAssertion.fromNode(MetaLemma, metaLemmaNode, fileContext); }
@@ -15,36 +15,39 @@ import { labelsFromJSON,
15
15
  substitutionsToSubstitutionsJSON } from "../utilities/json";
16
16
 
17
17
  export default domAssigned(class Metatheorem extends TopLevelAssertion {
18
- unifyReference(reference, substitutions, context) {
19
- let referenceUnified;
18
+ verify() {
19
+ let verified;
20
20
 
21
21
  const metatheorem = this, ///
22
- referenceString = reference.getString(),
22
+ fileContext = this.getFileContext(),
23
23
  metatheoremString = metatheorem.getString();
24
24
 
25
- context.trace(`Unifying the '${referenceString}' reference with the '${metatheoremString}' metatheorem...`);
26
-
27
- const fileContext = this.getFileContext(),
28
- localContext = LocalContext.fromFileContext(fileContext),
29
- generalContext = localContext, ///
30
- specificContext = context, ///
31
- labelUnified = this.labels.some((label) => {
32
- substitutions.clear();
25
+ fileContext.trace(`Verifying the '${metatheoremString}' metatheorem...`);
33
26
 
34
- const referenceUnified = reference.unifyLabel(label, substitutions, generalContext, specificContext);
27
+ verified = super.verify();
35
28
 
36
- if (referenceUnified) {
37
- return true;
38
- }
39
- });
29
+ if (verified) {
30
+ const metaTheorem = this; ///
40
31
 
41
- referenceUnified = labelUnified; ///
32
+ fileContext.addMetatheorem(metaTheorem);
42
33
 
43
- if (referenceUnified) {
44
- context.debug(`...unified the '${referenceString}' reference with the '${metatheoremString}' metatheorem.`);
34
+ fileContext.debug(`...verified the '${metatheoremString}' metatheorem.`);
45
35
  }
46
36
 
47
- return referenceUnified;
37
+ return verified;
38
+ }
39
+
40
+ verifyLabels() {
41
+ const labelsVerified = this.labels.every((label) => {
42
+ const nameOnly = false,
43
+ labelVerified = label.verify(nameOnly);
44
+
45
+ if (labelVerified) {
46
+ return true;
47
+ }
48
+ });
49
+
50
+ return labelsVerified;
48
51
  }
49
52
 
50
53
  unifyStatement(statement, substitutions, context) {
@@ -76,41 +79,6 @@ export default domAssigned(class Metatheorem extends TopLevelAssertion {
76
79
  return statementUnified;
77
80
  }
78
81
 
79
- verify() {
80
- let verified;
81
-
82
- const metatheorem = this, ///
83
- fileContext = this.getFileContext(),
84
- metatheoremString = metatheorem.getString();
85
-
86
- fileContext.trace(`Verifying the '${metatheoremString}' metatheorem...`);
87
-
88
- verified = super.verify();
89
-
90
- if (verified) {
91
- const metaTheorem = this; ///
92
-
93
- fileContext.addMetatheorem(metaTheorem);
94
-
95
- fileContext.debug(`...verified the '${metatheoremString}' metatheorem.`);
96
- }
97
-
98
- return verified;
99
- }
100
-
101
- verifyLabels() {
102
- const labelsVerified = this.labels.every((label) => {
103
- const nameOnly = false,
104
- labelVVerifiedWhenDeclared = label.verifyWhenDeclared(this.fileContext, nameOnly);
105
-
106
- if (labelVVerifiedWhenDeclared) {
107
- return true;
108
- }
109
- });
110
-
111
- return labelsVerified;
112
- }
113
-
114
82
  toJSON() {
115
83
  const labelsJSON = labelsToLabelsJSON(this.labels),
116
84
  consequentJSON = consequentToConsequentJSON(this.consequent),
@@ -380,9 +380,9 @@ export default domAssigned(class Metavariable {
380
380
  const metavariable = this, ///
381
381
  generalContext = context, ///
382
382
  specificContext = context, ///
383
- metavariableDeclared = generalContext.isMetavariableDeclared(metavariable, generalContext, specificContext);
383
+ metavariablePresent = generalContext.isMetavariablePresent(metavariable, generalContext, specificContext);
384
384
 
385
- verified = metavariableDeclared; ///
385
+ verified = metavariablePresent; ///
386
386
 
387
387
  if (verified) {
388
388
  context.debug(`...verified the '${metavariableString}' metavariable.`);
@@ -437,15 +437,15 @@ export default domAssigned(class Metavariable {
437
437
  fileContext.debug(`A term was found in the '${metavariableString}' metavariable when a type should have been present.`);
438
438
  } else {
439
439
  const metavariableName = this.name, ///
440
- metavariableDeclared = fileContext.isMetavariableDeclaredByMetavariableName(metavariableName);
440
+ metavariablePresent = fileContext.isMetavariablePresentByMetavariableName(metavariableName);
441
441
 
442
- if (metavariableDeclared) {
442
+ if (metavariablePresent) {
443
443
  fileContext.debug(`The '${metavariableName}' metavariable has already been declared.`);
444
444
  } else {
445
445
  const variableName = this.name, ///
446
- variableDeclared = fileContext.isVariableDeclaredByVariableName(variableName);
446
+ variablePresent = fileContext.isVariablePresentByVariableName(variableName);
447
447
 
448
- if (variableDeclared) {
448
+ if (variablePresent) {
449
449
  fileContext.debug(`A '${metavariableName}' variable has already been declared.`);
450
450
  } else {
451
451
  const typeVerified = this.verifyType(fileContext);
@@ -6,8 +6,8 @@ import LocalContext from "../context/local";
6
6
  import { nodeQuery } from "../utilities/query";
7
7
  import { domAssigned } from "../dom";
8
8
  import { referenceMetaType } from "../dom/metaType";
9
- import { unifyLabelWithReference } from "../utilities/unification";
10
9
  import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
10
+ import { unifyLabelWithReference, unifyMetavariableWithReference } from "../utilities/unification";
11
11
 
12
12
  const proofStepReferenceNodeQuery = nodeQuery("/proofStep/reference"),
13
13
  procedureCallReferenceNodeQuery = nodeQuery("/procedureCall/reference"),
@@ -42,26 +42,6 @@ export default domAssigned(class Reference {
42
42
 
43
43
  matchMetavariableNode(metavariableNode) { return this.metavariable.matchMetavariableNode(metavariableNode); }
44
44
 
45
- unifyLabel(label, substitutions, generalContext, specificContext) {
46
- let labelUnified;
47
-
48
- const reference = this, ///
49
- labelString = label.getString(),
50
- referenceString = reference.getString();
51
-
52
- specificContext.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
53
-
54
- const labelUnifiedWithReference = unifyLabelWithReference(label, reference, substitutions, generalContext, specificContext);
55
-
56
- labelUnified = labelUnifiedWithReference; ///
57
-
58
- if (labelUnified) {
59
- specificContext.debug(`...unified the '${labelString}' label with the '${referenceString}' reference.`);
60
- }
61
-
62
- return labelUnified;
63
- }
64
-
65
45
  verify(context) {
66
46
  let verified = false;
67
47
 
@@ -77,11 +57,9 @@ export default domAssigned(class Reference {
77
57
 
78
58
  if (!verified) {
79
59
  const reference = this, ///
80
- rulePresent = context.isRulePresentByReference(reference),
81
- metaLemmasMetaTheoremsPresent = context.areMetaLemmasMetaTheoremsPresentByReference(reference),
82
- axiomLemmaTheoremConjecturePresent = context.isAxiomLemmaTheoremConjecturePresentByReference(reference);
60
+ labelPresent = context.isLabelPresentByReference(reference);
83
61
 
84
- verified = (rulePresent || metaLemmasMetaTheoremsPresent || axiomLemmaTheoremConjecturePresent);
62
+ verified = labelPresent; ///
85
63
  }
86
64
 
87
65
  if (verified) {
@@ -102,6 +80,46 @@ export default domAssigned(class Reference {
102
80
  return metavariableVerified;
103
81
  }
104
82
 
83
+ unifyLabel(label, substitutions, context) {
84
+ let labelUnified;
85
+
86
+ const reference = this, ///
87
+ labelString = label.getString(),
88
+ referenceString = reference.getString();
89
+
90
+ context.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
91
+
92
+ const labelUnifiedWithReference = unifyLabelWithReference(label, reference, substitutions, context);
93
+
94
+ labelUnified = labelUnifiedWithReference; ///
95
+
96
+ if (labelUnified) {
97
+ context.debug(`...unified the '${labelString}' label with the '${referenceString}' reference.`);
98
+ }
99
+
100
+ return labelUnified;
101
+ }
102
+
103
+ unifyMetavariable(metavariable, context) {
104
+ let metavariableUnified;
105
+
106
+ const reference = this, ///
107
+ metavariableString = metavariable.getString(),
108
+ referenceString = reference.getString();
109
+
110
+ context.trace(`Unifying the '${metavariableString}' metavariable with the '${referenceString}' reference...`);
111
+
112
+ const metavariableUnifiedWithReference = unifyMetavariableWithReference(metavariable, reference, context);
113
+
114
+ metavariableUnified = metavariableUnifiedWithReference; ///
115
+
116
+ if (metavariableUnified) {
117
+ context.debug(`...unified the '${metavariableString}' metavariable with the '${referenceString}' reference.`);
118
+ }
119
+
120
+ return metavariableUnified;
121
+ }
122
+
105
123
  toJSON() {
106
124
  const metavariableJSON = metavariableToMetavariableJSON(this.metavariable),
107
125
  metavariable = metavariableJSON, ///
package/src/dom/rule.js CHANGED
@@ -195,9 +195,9 @@ export default domAssigned(class Rule {
195
195
  verifyLabels() {
196
196
  const labelsVerified = this.labels.every((label) => {
197
197
  const nameOnly = true,
198
- labelVVerifiedWhenDeclared = label.verifyWhenDeclared(this.fileContext, nameOnly);
198
+ labelVerified = label.verify(nameOnly);
199
199
 
200
- if (labelVVerifiedWhenDeclared) {
200
+ if (labelVerified) {
201
201
  return true;
202
202
  }
203
203
  });
@@ -168,7 +168,7 @@ export default domAssigned(class Statement {
168
168
  let unifiedIndependently = false;
169
169
 
170
170
  const statement = this, ///
171
- statementString = this.string;
171
+ statementString = this.string; ///
172
172
 
173
173
  context.trace(`Unifying the '${statementString}' statement independently...`);
174
174
 
package/src/dom/term.js CHANGED
@@ -181,7 +181,7 @@ export default domAssigned(class Term {
181
181
  let verifiedGivenType;
182
182
 
183
183
  const typeName = type.getName(),
184
- termString = this.getString();
184
+ termString = this.getString(); ///
185
185
 
186
186
  specificContext.trace(`Verifying the '${termString}' term given the '${typeName}' type...`);
187
187
 
@@ -77,37 +77,51 @@ export default class TopLevelAssertion {
77
77
  return metavariableNameMatches;
78
78
  }
79
79
 
80
- unifyReference(reference, context) {
81
- let referenceUnified;
82
-
83
- const referenceString = reference.getString(),
84
- axiomLemmaTheoremConjecture = this, ///
85
- axiomLemmaTheoremConjectureString = axiomLemmaTheoremConjecture.getString();
80
+ verify() {
81
+ let verified = false;
86
82
 
87
- context.trace(`Unifying the '${referenceString}' reference with the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`);
83
+ const labelsVerified = this.verifyLabels();
88
84
 
89
- const substitutions = Substitutions.fromNothing(),
90
- fileContext = this.getFileContext(),
91
- localContext = LocalContext.fromFileContext(fileContext),
92
- generalContext = localContext, ///
93
- specificContext = context, ///
94
- labelUnified = this.labels.some((label) => {
95
- substitutions.clear();
85
+ if (labelsVerified) {
86
+ const localContext = LocalContext.fromFileContext(this.fileContext),
87
+ context = localContext, ///
88
+ suppositionsVerified = this.suppositions.every((supposition) => {
89
+ const suppositionVerified = supposition.verify(context);
96
90
 
97
- const referenceUnified = reference.unifyLabel(label, substitutions, generalContext, specificContext);
91
+ if (suppositionVerified) {
92
+ return true;
93
+ }
94
+ });
98
95
 
99
- if (referenceUnified) {
100
- return true;
101
- }
102
- });
96
+ if (suppositionsVerified) {
97
+ const consequentVerified = this.consequent.verify(context);
103
98
 
104
- referenceUnified = labelUnified; ///
99
+ if (consequentVerified) {
100
+ if (this.proof === null) {
101
+ verified = true;
102
+ } else {
103
+ const proofVerified = this.proof.verify(this.substitutions, this.consequent, context);
105
104
 
106
- if (referenceUnified) {
107
- context.debug(`...unified the '${referenceString}' reference with the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture.`);
105
+ verified = proofVerified; ///
106
+ }
107
+ }
108
+ }
108
109
  }
109
110
 
110
- return referenceUnified;
111
+ return verified;
112
+ }
113
+
114
+ verifyLabels() {
115
+ const labelsVerified = this.labels.every((label) => {
116
+ const nameOnly = true,
117
+ labelVerified = label.verify(nameOnly);
118
+
119
+ if (labelVerified) {
120
+ return true;
121
+ }
122
+ });
123
+
124
+ return labelsVerified;
111
125
  }
112
126
 
113
127
  unifyStatement(statement, context) {
@@ -139,6 +153,16 @@ export default class TopLevelAssertion {
139
153
  return statementUnified;
140
154
  }
141
155
 
156
+ unifyStatementWithConsequent(statement, substitutions, generalContext, specificContext) {
157
+ let consequentUnified;
158
+
159
+ const statementUnified = this.consequent.unifyStatement(statement, substitutions, generalContext, specificContext); ///
160
+
161
+ consequentUnified = statementUnified; ///
162
+
163
+ return consequentUnified;
164
+ }
165
+
142
166
  unifyStatementAndProofStepSubproofs(statement, proofStepSubproofs, context) {
143
167
  let statementAndProofStepSubproofsUnified = false;
144
168
 
@@ -162,30 +186,6 @@ export default class TopLevelAssertion {
162
186
  return statementAndProofStepSubproofsUnified;
163
187
  }
164
188
 
165
- unifyStatementWithConsequent(statement, substitutions, generalContext, specificContext) {
166
- let consequentUnified;
167
-
168
- const statementUnified = this.consequent.unifyStatement(statement, substitutions, generalContext, specificContext); ///
169
-
170
- consequentUnified = statementUnified; ///
171
-
172
- return consequentUnified;
173
- }
174
-
175
- unifyProofStepSubproofsWithSuppositions(proofStepSubproofs, substitutions, generalContext, specificContext) {
176
- proofStepSubproofs = reverse(proofStepSubproofs); ///
177
-
178
- const proofStepSubproofsUnifiedWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
179
- const proofStepSubproofsUnifiedWithSupposition = this.unifyProofStepSubproofsWithSupposition(proofStepSubproofs, supposition, substitutions, generalContext, specificContext);
180
-
181
- if (proofStepSubproofsUnifiedWithSupposition) {
182
- return true;
183
- }
184
- });
185
-
186
- return proofStepSubproofsUnifiedWithSuppositions;
187
- }
188
-
189
189
  unifyProofStepSubproofsWithSupposition(proofStepSubproofs, supposition, substitutions, generalContext, specificContext) {
190
190
  let proofStepSubproofsUnifiedWithSupposition =false;
191
191
 
@@ -211,51 +211,18 @@ export default class TopLevelAssertion {
211
211
  return proofStepSubproofsUnifiedWithSupposition;
212
212
  }
213
213
 
214
- verify() {
215
- let verified = false;
216
-
217
- const labelsVerified = this.verifyLabels();
218
-
219
- if (labelsVerified) {
220
- const localContext = LocalContext.fromFileContext(this.fileContext),
221
- context = localContext, ///
222
- suppositionsVerified = this.suppositions.every((supposition) => {
223
- const suppositionVerified = supposition.verify(context);
224
-
225
- if (suppositionVerified) {
226
- return true;
227
- }
228
- });
229
-
230
- if (suppositionsVerified) {
231
- const consequentVerified = this.consequent.verify(context);
232
-
233
- if (consequentVerified) {
234
- if (this.proof === null) {
235
- verified = true;
236
- } else {
237
- const proofVerified = this.proof.verify(this.substitutions, this.consequent, context);
238
-
239
- verified = proofVerified; ///
240
- }
241
- }
242
- }
243
- }
244
-
245
- return verified;
246
- }
214
+ unifyProofStepSubproofsWithSuppositions(proofStepSubproofs, substitutions, generalContext, specificContext) {
215
+ proofStepSubproofs = reverse(proofStepSubproofs); ///
247
216
 
248
- verifyLabels() {
249
- const labelsVerified = this.labels.every((label) => {
250
- const nameOnly = true,
251
- labelVVerifiedWhenDeclared = label.verifyWhenDeclared(this.fileContext, nameOnly);
217
+ const proofStepSubproofsUnifiedWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
218
+ const proofStepSubproofsUnifiedWithSupposition = this.unifyProofStepSubproofsWithSupposition(proofStepSubproofs, supposition, substitutions, generalContext, specificContext);
252
219
 
253
- if (labelVVerifiedWhenDeclared) {
220
+ if (proofStepSubproofsUnifiedWithSupposition) {
254
221
  return true;
255
222
  }
256
223
  });
257
224
 
258
- return labelsVerified;
225
+ return proofStepSubproofsUnifiedWithSuppositions;
259
226
  }
260
227
 
261
228
  toJSON() {
package/src/dom/type.js CHANGED
@@ -110,9 +110,9 @@ class Type {
110
110
 
111
111
  fileContext.trace(`Verifying the '${typeString}' type when declared...`);
112
112
 
113
- const typeDeclared = fileContext.isTypeDeclaredByTypeName(this.name);
113
+ const typePresent = fileContext.isTypePresentByTypeName(this.name);
114
114
 
115
- if (typeDeclared) {
115
+ if (typePresent) {
116
116
  fileContext.debug(`The type '${typeString}' has already been declared.`);
117
117
  } else {
118
118
  const superTypeName = this.superType.getName(),
@@ -142,15 +142,15 @@ export default domAssigned(class Variable {
142
142
  fileContext.trace(`Verifying the '${variableString}' variable when declared...`);
143
143
 
144
144
  const variableName = this.name, ///
145
- variableDeclared = fileContext.isVariableDeclaredByVariableName(variableName);
145
+ variablePresent = fileContext.isVariablePresentByVariableName(variableName);
146
146
 
147
- if (variableDeclared) {
147
+ if (variablePresent) {
148
148
  fileContext.debug(`The '${variableName}' variable has already been declared.`);
149
149
  } else {
150
150
  const metavariableName = this.name, ///
151
- metavariableDeclared = fileContext.isMetavariableDeclaredByMetavariableName(metavariableName);
151
+ metavariablePresent = fileContext.isMetavariablePresentByMetavariableName(metavariableName);
152
152
 
153
- if (metavariableDeclared) {
153
+ if (metavariablePresent) {
154
154
  fileContext.debug(`A '${metavariableName}' variable has already been declared.`);
155
155
  } else {
156
156
  const typeVerified = this.verifyType(fileContext);
@@ -16,7 +16,7 @@ export default class Equivalence {
16
16
 
17
17
  addTerm(term, context) {
18
18
  const termString = term.getString(),
19
- equivalenceString = this.getString();
19
+ equivalenceString = this.getString(); ///
20
20
 
21
21
  context.trace(`Adding the '${termString}' term to the '${equivalenceString}' equivalence.`);
22
22