occam-verify-cli 1.0.220 → 1.0.224

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 (161) hide show
  1. package/lib/context/file.js +19 -19
  2. package/lib/context/local.js +5 -43
  3. package/lib/context/release.js +11 -11
  4. package/lib/dom/assertion/contained.js +44 -44
  5. package/lib/dom/assertion/defined.js +40 -40
  6. package/lib/dom/assertion/property.js +37 -35
  7. package/lib/dom/assertion/satisfies.js +26 -25
  8. package/lib/dom/assertion/subproof.js +16 -16
  9. package/lib/dom/assertion/type.js +34 -32
  10. package/lib/dom/axiom.js +52 -52
  11. package/lib/dom/combinator/bracketed.js +5 -5
  12. package/lib/dom/combinator.js +6 -6
  13. package/lib/dom/conclusion.js +10 -10
  14. package/lib/dom/conjecture.js +5 -5
  15. package/lib/dom/constructor/bracketed.js +12 -12
  16. package/lib/dom/constructor.js +9 -9
  17. package/lib/dom/declaration/combinator.js +11 -11
  18. package/lib/dom/declaration/complexType.js +133 -63
  19. package/lib/dom/declaration/constructor.js +17 -17
  20. package/lib/dom/declaration/metavariable.js +17 -17
  21. package/lib/dom/declaration/simpleType.js +229 -0
  22. package/lib/dom/declaration/variable.js +17 -17
  23. package/lib/dom/declaration.js +54 -52
  24. package/lib/dom/deduction.js +15 -15
  25. package/lib/dom/derivation.js +8 -8
  26. package/lib/dom/equality.js +49 -34
  27. package/lib/dom/error.js +3 -3
  28. package/lib/dom/frame.js +38 -38
  29. package/lib/dom/judgement.js +31 -29
  30. package/lib/dom/label.js +5 -5
  31. package/lib/dom/lemma.js +5 -5
  32. package/lib/dom/metaLemma.js +5 -5
  33. package/lib/dom/metatheorem.js +5 -5
  34. package/lib/dom/metavariable.js +55 -55
  35. package/lib/dom/premise.js +36 -34
  36. package/lib/dom/procedureCall.js +9 -9
  37. package/lib/dom/proof.js +6 -6
  38. package/lib/dom/propertyRelation.js +18 -18
  39. package/lib/dom/reference.js +28 -28
  40. package/lib/dom/rule.js +63 -48
  41. package/lib/dom/signature.js +17 -17
  42. package/lib/dom/statement.js +36 -36
  43. package/lib/dom/step.js +32 -35
  44. package/lib/dom/subDerivation.js +8 -8
  45. package/lib/dom/subproof.js +27 -30
  46. package/lib/dom/substitution/statement.js +7 -7
  47. package/lib/dom/substitution/term.js +2 -16
  48. package/lib/dom/substitution.js +1 -15
  49. package/lib/dom/supposition.js +39 -39
  50. package/lib/dom/term.js +15 -15
  51. package/lib/dom/theorem.js +5 -5
  52. package/lib/dom/topLevelAssertion.js +60 -71
  53. package/lib/dom/topLevelMetaAssertion.js +28 -20
  54. package/lib/dom/type.js +18 -24
  55. package/lib/dom/variable.js +16 -16
  56. package/lib/equivalence.js +54 -33
  57. package/lib/equivalences.js +57 -101
  58. package/lib/index.js +2 -2
  59. package/lib/mixins/statement/verify.js +52 -52
  60. package/lib/mixins/step/unify.js +79 -61
  61. package/lib/mixins/term/verify.js +17 -17
  62. package/lib/substitutions.js +7 -7
  63. package/lib/unifier/equantional.js +170 -0
  64. package/lib/unifier/intrinsicLevel.js +8 -8
  65. package/lib/unifier/metaLevel.js +21 -21
  66. package/lib/unifier/metavariable.js +9 -9
  67. package/lib/unifier/statementWithCombinator.js +18 -18
  68. package/lib/unifier/termWithConstructor.js +10 -10
  69. package/lib/unifier.js +41 -41
  70. package/lib/utilities/brackets.js +2 -2
  71. package/lib/utilities/release.js +18 -17
  72. package/lib/utilities/subproof.js +2 -2
  73. package/lib/utilities/type.js +2 -2
  74. package/lib/utilities/unification.js +28 -34
  75. package/lib/verifier/combinator.js +14 -14
  76. package/lib/verifier/constructor.js +18 -18
  77. package/lib/verifier/topLevel.js +38 -38
  78. package/lib/verifier.js +30 -30
  79. package/package.json +1 -1
  80. package/src/context/file.js +18 -18
  81. package/src/context/local.js +5 -48
  82. package/src/context/release.js +11 -11
  83. package/src/dom/assertion/contained.js +46 -46
  84. package/src/dom/assertion/defined.js +41 -41
  85. package/src/dom/assertion/property.js +37 -35
  86. package/src/dom/assertion/satisfies.js +26 -25
  87. package/src/dom/assertion/subproof.js +15 -15
  88. package/src/dom/assertion/type.js +34 -32
  89. package/src/dom/axiom.js +56 -54
  90. package/src/dom/combinator/bracketed.js +4 -4
  91. package/src/dom/combinator.js +5 -5
  92. package/src/dom/conclusion.js +9 -9
  93. package/src/dom/conjecture.js +4 -4
  94. package/src/dom/constructor/bracketed.js +11 -11
  95. package/src/dom/constructor.js +8 -8
  96. package/src/dom/declaration/combinator.js +10 -10
  97. package/src/dom/declaration/complexType.js +129 -64
  98. package/src/dom/declaration/constructor.js +16 -16
  99. package/src/dom/declaration/metavariable.js +16 -16
  100. package/src/dom/declaration/simpleType.js +179 -0
  101. package/src/dom/declaration/variable.js +16 -16
  102. package/src/dom/declaration.js +54 -52
  103. package/src/dom/deduction.js +14 -14
  104. package/src/dom/derivation.js +7 -7
  105. package/src/dom/equality.js +55 -38
  106. package/src/dom/error.js +2 -2
  107. package/src/dom/frame.js +38 -38
  108. package/src/dom/judgement.js +31 -29
  109. package/src/dom/label.js +4 -4
  110. package/src/dom/lemma.js +4 -4
  111. package/src/dom/metaLemma.js +4 -4
  112. package/src/dom/metatheorem.js +4 -4
  113. package/src/dom/metavariable.js +54 -54
  114. package/src/dom/premise.js +35 -33
  115. package/src/dom/procedureCall.js +8 -8
  116. package/src/dom/proof.js +5 -5
  117. package/src/dom/propertyRelation.js +17 -17
  118. package/src/dom/reference.js +27 -27
  119. package/src/dom/rule.js +72 -49
  120. package/src/dom/signature.js +15 -15
  121. package/src/dom/statement.js +34 -34
  122. package/src/dom/step.js +42 -48
  123. package/src/dom/subDerivation.js +7 -7
  124. package/src/dom/subproof.js +30 -40
  125. package/src/dom/substitution/statement.js +6 -6
  126. package/src/dom/substitution/term.js +1 -19
  127. package/src/dom/substitution.js +0 -13
  128. package/src/dom/supposition.js +38 -38
  129. package/src/dom/term.js +14 -14
  130. package/src/dom/theorem.js +4 -4
  131. package/src/dom/topLevelAssertion.js +62 -81
  132. package/src/dom/topLevelMetaAssertion.js +35 -20
  133. package/src/dom/type.js +23 -33
  134. package/src/dom/variable.js +16 -15
  135. package/src/equivalence.js +69 -46
  136. package/src/equivalences.js +53 -115
  137. package/src/index.js +1 -1
  138. package/src/mixins/statement/verify.js +51 -51
  139. package/src/mixins/step/unify.js +88 -67
  140. package/src/mixins/term/verify.js +16 -16
  141. package/src/substitutions.js +5 -6
  142. package/src/unifier/equantional.js +90 -0
  143. package/src/unifier/intrinsicLevel.js +7 -7
  144. package/src/unifier/metaLevel.js +20 -21
  145. package/src/unifier/metavariable.js +8 -8
  146. package/src/unifier/statementWithCombinator.js +17 -17
  147. package/src/unifier/termWithConstructor.js +9 -9
  148. package/src/unifier.js +40 -40
  149. package/src/utilities/brackets.js +1 -1
  150. package/src/utilities/release.js +18 -18
  151. package/src/utilities/subproof.js +1 -1
  152. package/src/utilities/type.js +1 -1
  153. package/src/utilities/unification.js +27 -37
  154. package/src/verifier/combinator.js +13 -13
  155. package/src/verifier/constructor.js +17 -17
  156. package/src/verifier/topLevel.js +41 -41
  157. package/src/verifier.js +29 -29
  158. package/lib/dom/declaration/type.js +0 -209
  159. package/lib/unifier/equality.js +0 -155
  160. package/src/dom/declaration/type.js +0 -150
  161. package/src/unifier/equality.js +0 -70
@@ -6,16 +6,16 @@ import { domAssigned } from "../dom";
6
6
 
7
7
  export default domAssigned(class Theorem extends TopLevelAssertion {
8
8
  verify() {
9
- let verified;
9
+ let verifies;
10
10
 
11
11
  const fileContext = this.getFileContext(),
12
12
  theoremString = this.string; ///
13
13
 
14
14
  fileContext.trace(`Verifying the '${theoremString}' theorem...`);
15
15
 
16
- verified = super.verify();
16
+ verifies = super.verify();
17
17
 
18
- if (verified) {
18
+ if (verifies) {
19
19
  const theorem = this; ///
20
20
 
21
21
  fileContext.addTheorem(theorem);
@@ -23,7 +23,7 @@ export default domAssigned(class Theorem extends TopLevelAssertion {
23
23
  fileContext.debug(`...verified the '${theoremString}' theorem.`);
24
24
  }
25
25
 
26
- return verified;
26
+ return verifies;
27
27
  }
28
28
 
29
29
  static name = "Theorem";
@@ -64,13 +64,6 @@ export default class TopLevelAssertion {
64
64
  return supposition;
65
65
  }
66
66
 
67
- isUnconditional() {
68
- const suppositionsLength = this.suppositions.length,
69
- unconditional = (suppositionsLength === 0);
70
-
71
- return unconditional;
72
- }
73
-
74
67
  matchMetavariableName(metavariableName) {
75
68
  const metavariableNameMatches = this.labels.some((label) => {
76
69
  const metavariableNameMatches = label.matchMetavariableName(metavariableName);
@@ -84,150 +77,123 @@ export default class TopLevelAssertion {
84
77
  }
85
78
 
86
79
  verify() {
87
- let verified = false;
80
+ let verifies = false;
88
81
 
89
- const labelsVerified = this.verifyLabels();
82
+ const labelsVerify = this.verifyLabels();
90
83
 
91
- if (labelsVerified) {
84
+ if (labelsVerify) {
92
85
  const localContext = LocalContext.fromFileContext(this.fileContext),
93
86
  context = localContext, ///
94
- suppositionsVerified = this.suppositions.every((supposition) => {
95
- const suppositionVerified = supposition.verify(context);
87
+ suppositionsVerify = this.suppositions.every((supposition) => {
88
+ const suppositionVerifies = supposition.verify(context);
96
89
 
97
- if (suppositionVerified) {
90
+ if (suppositionVerifies) {
98
91
  return true;
99
92
  }
100
93
  });
101
94
 
102
- if (suppositionsVerified) {
103
- const deductionVerified = this.deduction.verify(context);
95
+ if (suppositionsVerify) {
96
+ const deductionVerifies = this.deduction.verify(context);
104
97
 
105
- if (deductionVerified) {
98
+ if (deductionVerifies) {
106
99
  if (this.proof === null) {
107
- verified = true;
100
+ verifies = true;
108
101
  } else {
109
102
  const substitutions = Substitutions.fromNothing(),
110
- proofVerified = this.proof.verify(substitutions, this.deduction, context);
103
+ proofVerifies = this.proof.verify(substitutions, this.deduction, context);
111
104
 
112
- verified = proofVerified; ///
105
+ verifies = proofVerifies; ///
113
106
  }
114
107
  }
115
108
  }
116
109
  }
117
110
 
118
- return verified;
111
+ return verifies;
119
112
  }
120
113
 
121
114
  verifyLabels() {
122
- const labelsVerified = this.labels.every((label) => {
115
+ const labelsVerify = this.labels.every((label) => {
123
116
  const nameOnly = true,
124
- labelVerified = label.verify(nameOnly);
117
+ labelVerifies = label.verify(nameOnly);
125
118
 
126
- if (labelVerified) {
119
+ if (labelVerifies) {
127
120
  return true;
128
121
  }
129
122
  });
130
123
 
131
- return labelsVerified;
132
- }
133
-
134
- unifyStatement(statement, context) {
135
- let statementUnified;
136
-
137
- const statementString = statement.getString(),
138
- axiomLemmaTheoremConjecture = this, ///
139
- axiomLemmaTheoremConjectureString = axiomLemmaTheoremConjecture.getString();
140
-
141
- context.trace(`Unifying the '${statementString}' statement with the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture...`);
142
-
143
- const suppositions = this.getSuppositions(),
144
- suppositionsLength = suppositions.length;
145
-
146
- if (suppositionsLength === 0) {
147
- const substitutions = Substitutions.fromNothing(),
148
- localContext = LocalContext.fromFileContext(this.fileContext),
149
- generalContext = localContext, ///
150
- specificContext = context, ///
151
- statementUnifiedWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext);
152
-
153
- statementUnified = statementUnifiedWithDeduction; ///
154
- }
155
-
156
- if (statementUnified) {
157
- context.debug(`...unified the '${statementString}' statement with the '${axiomLemmaTheoremConjectureString}' axiom, lemma, theorem or conjecture.`);
158
- }
159
-
160
- return statementUnified;
124
+ return labelsVerify;
161
125
  }
162
126
 
163
127
  unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext) {
164
- let deductionUnified;
128
+ let deductionUnifies;
165
129
 
166
- const statementUnified = this.deduction.unifyStatement(statement, substitutions, generalContext, specificContext); ///
130
+ const statementUnifies = this.deduction.unifyStatement(statement, substitutions, generalContext, specificContext); ///
167
131
 
168
- deductionUnified = statementUnified; ///
132
+ deductionUnifies = statementUnifies; ///
169
133
 
170
- return deductionUnified;
134
+ return deductionUnifies;
171
135
  }
172
136
 
173
137
  unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context) {
174
- let statementAndStepsOrSubproofsUnified = false;
138
+ let statementAndStepsOrSubproofsUnify = false;
175
139
 
176
140
  const localContext = LocalContext.fromFileContext(this.fileContext),
177
141
  generalContext = localContext, ///
178
142
  specificContext = context, ///
179
- statementUnifiedWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext);
143
+ statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext);
180
144
 
181
- if (statementUnifiedWithDeduction) {
182
- const stepsOrSubproofsUnifiedWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, generalContext, specificContext);
145
+ if (statementUnifiesWithDeduction) {
146
+ const stepsOrSubproofsUnifyWithSuppositions = this.unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, generalContext, specificContext);
183
147
 
184
- if (stepsOrSubproofsUnifiedWithSuppositions) {
148
+ if (stepsOrSubproofsUnifyWithSuppositions) {
185
149
  const substitutionsResolved = substitutions.areResolved();
186
150
 
187
- statementAndStepsOrSubproofsUnified = substitutionsResolved; ///
151
+ if (substitutionsResolved) {
152
+ statementAndStepsOrSubproofsUnify = true;
153
+ }
188
154
  }
189
155
  }
190
156
 
191
- return statementAndStepsOrSubproofsUnified;
157
+ return statementAndStepsOrSubproofsUnify;
192
158
  }
193
159
 
194
160
  unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext) {
195
- let stepsOrSubproofsUnifiedWithSupposition = false;
161
+ let stepsOrSubproofsUnifyWithSupposition = false;
196
162
 
197
163
  const context = specificContext, ///
198
- suppositionUnifiedIndependently = supposition.unifyIndependently(substitutions, context);
164
+ suppositionUnifiesIndependently = supposition.unifyIndependently(substitutions, context);
199
165
 
200
- if (suppositionUnifiedIndependently) {
201
- stepsOrSubproofsUnifiedWithSupposition = true;
166
+ if (suppositionUnifiesIndependently) {
167
+ stepsOrSubproofsUnifyWithSupposition = true;
202
168
  } else {
203
169
  const stepOrSubproof = extract(stepsOrSubproofs, (stepOrSubproof) => {
204
- const stepOrSubproofUnified = supposition.unifyStepOrSubproof(stepOrSubproof, substitutions, generalContext, specificContext);
170
+ const stepOrSubproofUnifies = supposition.unifyStepOrSubproof(stepOrSubproof, substitutions, generalContext, specificContext);
205
171
 
206
- if (stepOrSubproofUnified) {
172
+ if (stepOrSubproofUnifies) {
207
173
  return true;
208
174
  }
209
175
  }) || null;
210
176
 
211
177
  if (stepOrSubproof !== null) {
212
- stepsOrSubproofsUnifiedWithSupposition = true;
178
+ stepsOrSubproofsUnifyWithSupposition = true;
213
179
  }
214
180
  }
215
181
 
216
- return stepsOrSubproofsUnifiedWithSupposition;
182
+ return stepsOrSubproofsUnifyWithSupposition;
217
183
  }
218
184
 
219
185
  unifyStepsOrSubproofsWithSuppositions(stepsOrSubproofs, substitutions, generalContext, specificContext) {
220
186
  stepsOrSubproofs = reverse(stepsOrSubproofs); ///
221
187
 
222
- const stepsOrSubproofsUnifiedWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
223
- const stepsOrSubproofsUnifiedWithSupposition = this.unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext);
188
+ const stepsOrSubproofsUnifyWithSuppositions = backwardsEvery(this.suppositions, (supposition) => {
189
+ const stepsOrSubproofsUnifyWithSupposition = this.unifyStepsOrSubproofsWithSupposition(stepsOrSubproofs, supposition, substitutions, generalContext, specificContext);
224
190
 
225
- if (stepsOrSubproofsUnifiedWithSupposition) {
191
+ if (stepsOrSubproofsUnifyWithSupposition) {
226
192
  return true;
227
193
  }
228
194
  });
229
195
 
230
- return stepsOrSubproofsUnifiedWithSuppositions;
196
+ return stepsOrSubproofsUnifyWithSuppositions;
231
197
  }
232
198
 
233
199
  toJSON() {
@@ -255,7 +221,7 @@ export default class TopLevelAssertion {
255
221
  suppositions = suppositionsFromJSON(json, fileContext),
256
222
  signature = signatureFromJSON(json, fileContext),
257
223
  proof = null,
258
- string = stringFromLabelsAndDeduction(labels, deduction),
224
+ string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
259
225
  topLevelAssertion = new Class(fileContext, string, labels, suppositions, deduction, proof, signature);
260
226
 
261
227
  return topLevelAssertion;
@@ -273,7 +239,7 @@ export default class TopLevelAssertion {
273
239
  deduction = deductionFromDeductionNode(deductionNode, fileContext),
274
240
  suppositions = suppositionsFromSuppositionNodes(suppositionNodes, fileContext),
275
241
  signature = signatureFromSignatureNode(signatureNode, fileContext),
276
- string = stringFromLabelsAndDeduction(labels, deduction),
242
+ string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
277
243
  topLevelAssertion = new Class(fileContext, string, labels, suppositions, deduction, proof, signature);
278
244
 
279
245
  return topLevelAssertion;
@@ -342,12 +308,27 @@ export function labelsStringFromLabels(labels) {
342
308
  return labelsString;
343
309
  }
344
310
 
345
- export function stringFromLabelsAndDeduction(labels, deduction) {
346
- const deductionString = deduction.getString(),
311
+ export function suppositionsStringFromSuppositions(suppositions) {
312
+ const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
313
+ const suppositionString = supposition.getString();
314
+
315
+ suppositionsString = (suppositionsString !== null) ?
316
+ `${suppositionsString}, ${suppositionString}` :
317
+ suppositionString; ///
318
+
319
+ return suppositionsString;
320
+ }, null);
321
+
322
+ return suppositionsString;
323
+ }
324
+
325
+ export function stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction) {
326
+ const suppositionsString = suppositionsStringFromSuppositions(suppositions),
327
+ deductionString = deduction.getString(),
347
328
  labelsString = labelsStringFromLabels(labels),
348
329
  string = (labelsString === null) ?
349
330
  deductionString : ///
350
- `${labelsString} :: ${deductionString}`;
331
+ `${labelsString} :: [${suppositionsString}] ... ${deductionString}`;
351
332
 
352
333
  return string;
353
334
  }
@@ -63,44 +63,44 @@ export default class TopLevelMetaAssertion {
63
63
  }
64
64
 
65
65
  verify() {
66
- let verified = false;
66
+ let verifies = false;
67
67
 
68
- const labelVerified = this.verifyLabel();
68
+ const labelVerifies = this.verifyLabel();
69
69
 
70
- if (labelVerified) {
70
+ if (labelVerifies) {
71
71
  const localContext = LocalContext.fromFileContext(this.fileContext),
72
72
  context = localContext, ///
73
- suppositionsVerified = this.suppositions.every((supposition) => {
74
- const suppositionVerified = supposition.verify(context);
73
+ suppositionsVerify = this.suppositions.every((supposition) => {
74
+ const suppositionVerifies = supposition.verify(context);
75
75
 
76
- if (suppositionVerified) {
76
+ if (suppositionVerifies) {
77
77
  return true;
78
78
  }
79
79
  });
80
80
 
81
- if (suppositionsVerified) {
82
- const deductionVerified = this.deduction.verify(context);
81
+ if (suppositionsVerify) {
82
+ const deductionVerifies = this.deduction.verify(context);
83
83
 
84
- if (deductionVerified) {
84
+ if (deductionVerifies) {
85
85
  if (this.proof === null) {
86
- verified = true;
86
+ verifies = true;
87
87
  } else {
88
- const proofVerified = this.proof.verify(this.substitutions, this.deduction, context);
88
+ const proofVerifies = this.proof.verify(this.substitutions, this.deduction, context);
89
89
 
90
- verified = proofVerified; ///
90
+ verifies = proofVerifies; ///
91
91
  }
92
92
  }
93
93
  }
94
94
  }
95
95
 
96
- return verified;
96
+ return verifies;
97
97
  }
98
98
 
99
99
  verifyLabel() {
100
100
  const nameOnly = false,
101
- labelVerified = this.label.verify(nameOnly);
101
+ labelVerifies = this.label.verify(nameOnly);
102
102
 
103
- return labelVerified;
103
+ return labelVerifies;
104
104
  }
105
105
 
106
106
  toJSON() {
@@ -128,7 +128,7 @@ export default class TopLevelMetaAssertion {
128
128
  suppositions = suppositionsFromJSON(json, fileContext),
129
129
  substitutions = substitutionsFromJSON(json, fileContext),
130
130
  proof = null,
131
- string = stringFromLabelAndDeduction(label, deduction),
131
+ string = stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction),
132
132
  topLevelMetaAssertion = new Class(fileContext, string, label, suppositions, deduction, proof, substitutions);
133
133
 
134
134
  return topLevelMetaAssertion;
@@ -145,7 +145,7 @@ export default class TopLevelMetaAssertion {
145
145
  deduction = deductionFromDeductionNode(deductionNode, fileContext),
146
146
  suppositions = suppositionsFromSuppositionNodes(suppositionNodes, fileContext),
147
147
  substitutions = Substitutions.fromNothing(),
148
- string = stringFromLabelAndDeduction(label, deduction),
148
+ string = stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction),
149
149
  topLevelMetaAssertion = new Class(fileContext, string, label, suppositions, deduction, proof, substitutions);
150
150
 
151
151
  return topLevelMetaAssertion;
@@ -172,12 +172,27 @@ function labelStringFromLabel(label) {
172
172
  return labelsString;
173
173
  }
174
174
 
175
- function stringFromLabelAndDeduction(label, deduction) {
176
- const deductionString = deduction.getString(),
175
+ function suppositionsStringFromSuppositions(suppositions) {
176
+ const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
177
+ const suppositionString = supposition.getString();
178
+
179
+ suppositionsString = (suppositionsString !== null) ?
180
+ `${suppositionsString}, ${suppositionString}` :
181
+ suppositionString; ///
182
+
183
+ return suppositionsString;
184
+ }, null);
185
+
186
+ return suppositionsString;
187
+ }
188
+
189
+ function stringFromLabelASuppositionsAndDeduction(label, suppositions, deduction) {
190
+ const suppositionsString = suppositionsStringFromSuppositions(suppositions),
191
+ deductionString = deduction.getString(),
177
192
  labelString = labelStringFromLabel(label),
178
193
  string = (labelString === null) ?
179
194
  deductionString : ///
180
- `${labelString} :: ${deductionString}`;
195
+ `${labelString} :: [${suppositionsString}] ... ${deductionString}`;
181
196
 
182
197
  return string;
183
198
  }
package/src/dom/type.js CHANGED
@@ -248,21 +248,33 @@ class Type {
248
248
  return type;
249
249
  }
250
250
 
251
- static fromTypeDeclarationNode(typeDeclarationNode, fileContext) {
251
+ static fromPropertyDeclarationNode(propertyDeclarationNode, fileContext) {
252
+ const typeNode = propertyDeclarationNode.getTypeNode(),
253
+ type = typeFromTypeNode(typeNode, fileContext);
254
+
255
+ return type;
256
+ }
257
+
258
+ static fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, fileContext) {
252
259
  const properties = [],
253
- provisional = typeDeclarationNode.isProvisional(),
254
- typeName = typeDeclarationNode.getTypeName(),
260
+ provisional = simpleTypeDeclarationNode.isProvisional(),
261
+ typeName = simpleTypeDeclarationNode.getTypeName(),
255
262
  name = typeName, ///
256
- superTypes = superTypesFromTypeDeclarationNode(typeDeclarationNode, fileContext),
263
+ superTypes = superTypesFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, fileContext),
257
264
  string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
258
265
  type = new Type(string, name, superTypes, properties, provisional);
259
266
 
260
267
  return type;
261
268
  }
262
269
 
263
- static fromPropertyDeclarationNode(propertyDeclarationNode, fileContext) {
264
- const typeNode = propertyDeclarationNode.getTypeNode(),
265
- type = typeFromTypeNode(typeNode, fileContext);
270
+ static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext) {
271
+ const provisional = complexTypeDeclarationNode.isProvisional(),
272
+ typeName = complexTypeDeclarationNode.getTypeName(),
273
+ name = typeName,
274
+ superTypes = superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
275
+ properties = propertiesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
276
+ string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
277
+ type = new Type(string, name, superTypes, properties, provisional);
266
278
 
267
279
  return type;
268
280
  }
@@ -284,34 +296,17 @@ class Type {
284
296
 
285
297
  return type;
286
298
  }
287
-
288
- static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext) {
289
- const provisional = complexTypeDeclarationNode.isProvisional(),
290
- typeName = complexTypeDeclarationNode.getTypeName(),
291
- name = typeName,
292
- superTypes = superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
293
- properties = propertiesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
294
- string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
295
- type = new Type(string, name, superTypes, properties, provisional);
296
-
297
- return type;
298
- }
299
299
  }
300
300
 
301
301
  export default domAssigned(Type);
302
302
 
303
- function superTypesFromTypeDeclarationNode(typeDeclarationNode, fileContext) {
304
- const superTypeNodes = typeDeclarationNode.getSuperTypeNodes(),
303
+ function superTypesFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, fileContext) {
304
+ const superTypeNodes = simpleTypeDeclarationNode.getSuperTypeNodes(),
305
305
  superTypes = superTypeNodes.map((superTypeNode) => {
306
306
  const superType = Type.fromTypeNode(superTypeNode, fileContext);
307
307
 
308
308
  return superType;
309
- }),
310
- superTypesLength = superTypes.length;
311
-
312
- if (superTypesLength === 0) {
313
- superTypes.push(objectType);
314
- }
309
+ });
315
310
 
316
311
  return superTypes;
317
312
  }
@@ -322,12 +317,7 @@ function superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fi
322
317
  const superType = Type.fromTypeNode(superTypeNode, fileContext);
323
318
 
324
319
  return superType;
325
- }),
326
- superTypesLength = superTypes.length;
327
-
328
- if (superTypesLength === 0) {
329
- superTypes.push(objectType);
330
- }
320
+ });
331
321
 
332
322
  return superTypes;
333
323
  }
@@ -62,7 +62,7 @@ export default domAssigned(class Variable {
62
62
  }
63
63
 
64
64
  verify(context) {
65
- let verified;
65
+ let verifies;
66
66
 
67
67
  const variableString = this.string; ///
68
68
 
@@ -76,20 +76,20 @@ export default domAssigned(class Variable {
76
76
 
77
77
  this.type = type;
78
78
 
79
- verified = true;
79
+ verifies = true;
80
80
  } else {
81
81
  context.debug(`The '${variableString}' variable is not present.`);
82
82
  }
83
83
 
84
- if (verified) {
84
+ if (verifies) {
85
85
  context.debug(`...verified the '${variableString}' variable.`);
86
86
  }
87
87
 
88
- return verified;
88
+ return verifies;
89
89
  }
90
90
 
91
91
  verifyType(fileContext) {
92
- let typeVerified = false;
92
+ let typeVerifies = false;
93
93
 
94
94
  const typeString = this.type.getString();
95
95
 
@@ -102,18 +102,18 @@ export default domAssigned(class Variable {
102
102
  } else {
103
103
  this.type = type; ///
104
104
 
105
- typeVerified = true;
105
+ typeVerifies = true;
106
106
  }
107
107
 
108
- if (typeVerified) {
108
+ if (typeVerifies) {
109
109
  fileContext.debug(`...verified the '${typeString}' type.`);
110
110
  }
111
111
 
112
- return typeVerified;
112
+ return typeVerifies;
113
113
  }
114
114
 
115
115
  unifyTerm(term, substitutions, generalContext, specificContext) {
116
- let termUnified = false;
116
+ let termUnifies = false;
117
117
 
118
118
  const termString = term.getString(),
119
119
  variableString = this.string; ///
@@ -124,11 +124,12 @@ export default domAssigned(class Variable {
124
124
  substitutionPresent = substitutions.isSubstitutionPresentByVariable(variable);
125
125
 
126
126
  if (substitutionPresent) {
127
- const substitution = substitutions.findSubstitutionByVariable(variable),
128
- substitutionTermEqualToTerm = substitution.isTermEqualTo(term);
127
+ const context = specificContext, ///
128
+ substitution = substitutions.findSubstitutionByVariable(variable),
129
+ substitutionTermEqualToTerm = substitution.isTermEqualTo(term, context);
129
130
 
130
131
  if (substitutionTermEqualToTerm) {
131
- termUnified = true;
132
+ termUnifies = true;
132
133
  }
133
134
  } else {
134
135
  const { TermSubstitution } = dom,
@@ -139,14 +140,14 @@ export default domAssigned(class Variable {
139
140
 
140
141
  substitutions.addSubstitution(substitution, specificContext);
141
142
 
142
- termUnified = true;
143
+ termUnifies = true;
143
144
  }
144
145
 
145
- if (termUnified) {
146
+ if (termUnifies) {
146
147
  specificContext.debug(`...unified the '${termString}' term with the '${variableString}' variable.`);
147
148
  }
148
149
 
149
- return termUnified;
150
+ return termUnifies;
150
151
  }
151
152
 
152
153
  toJSON() {