occam-nominal 1.0.307 → 1.0.310

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 (73) hide show
  1. package/lib/context/file/nominal.js +2 -2
  2. package/lib/element/assertion/contained.js +5 -8
  3. package/lib/element/assertion/subproof.js +12 -15
  4. package/lib/element/combinator/bracketed.js +2 -2
  5. package/lib/element/combinator.js +2 -2
  6. package/lib/element/declaration/combinator.js +3 -3
  7. package/lib/element/declaration/metavariable.js +2 -2
  8. package/lib/element/declaration/variable.js +4 -4
  9. package/lib/element/deduction.js +5 -6
  10. package/lib/element/derivation.js +3 -3
  11. package/lib/element/equality.js +3 -4
  12. package/lib/element/frame.js +5 -5
  13. package/lib/element/goal.js +5 -8
  14. package/lib/element/judgement.js +4 -5
  15. package/lib/element/label.js +5 -6
  16. package/lib/element/metavariable.js +67 -67
  17. package/lib/element/procedureCall.js +25 -25
  18. package/lib/element/proofAssertion/premise.js +26 -19
  19. package/lib/element/proofAssertion/step.js +5 -5
  20. package/lib/element/proofAssertion/supposition.js +4 -5
  21. package/lib/element/proofAssertion.js +6 -13
  22. package/lib/element/rule.js +13 -13
  23. package/lib/element/statement.js +5 -5
  24. package/lib/element/subDerivation.js +3 -3
  25. package/lib/element/subproof.js +6 -6
  26. package/lib/element/substitution/frame.js +3 -5
  27. package/lib/element/substitution/term.js +3 -5
  28. package/lib/element/term.js +22 -22
  29. package/lib/element/topLevelAssertion.js +5 -5
  30. package/lib/pass/continuationZip.js +2 -2
  31. package/lib/process/unify.js +9 -9
  32. package/lib/process/validate.js +9 -9
  33. package/lib/process/validation.js +5 -5
  34. package/lib/process/verify.js +18 -18
  35. package/lib/utilities/compression.js +137 -0
  36. package/lib/utilities/continuation.js +5 -5
  37. package/package.json +3 -3
  38. package/src/context/file/nominal.js +1 -1
  39. package/src/element/assertion/contained.js +4 -10
  40. package/src/element/assertion/subproof.js +11 -17
  41. package/src/element/combinator/bracketed.js +1 -1
  42. package/src/element/combinator.js +1 -1
  43. package/src/element/declaration/combinator.js +2 -2
  44. package/src/element/declaration/metavariable.js +1 -1
  45. package/src/element/declaration/variable.js +3 -3
  46. package/src/element/deduction.js +4 -6
  47. package/src/element/derivation.js +2 -2
  48. package/src/element/equality.js +2 -4
  49. package/src/element/frame.js +4 -4
  50. package/src/element/goal.js +4 -10
  51. package/src/element/judgement.js +4 -6
  52. package/src/element/label.js +4 -6
  53. package/src/element/metavariable.js +79 -80
  54. package/src/element/procedureCall.js +28 -29
  55. package/src/element/proofAssertion/premise.js +32 -23
  56. package/src/element/proofAssertion/step.js +5 -5
  57. package/src/element/proofAssertion/supposition.js +5 -5
  58. package/src/element/proofAssertion.js +7 -19
  59. package/src/element/rule.js +12 -12
  60. package/src/element/statement.js +6 -4
  61. package/src/element/subDerivation.js +2 -2
  62. package/src/element/subproof.js +5 -5
  63. package/src/element/substitution/frame.js +4 -6
  64. package/src/element/substitution/term.js +4 -6
  65. package/src/element/term.js +25 -27
  66. package/src/element/topLevelAssertion.js +4 -4
  67. package/src/pass/continuationZip.js +1 -1
  68. package/src/process/unify.js +8 -9
  69. package/src/process/validate.js +8 -8
  70. package/src/process/validation.js +4 -4
  71. package/src/process/verify.js +17 -17
  72. package/src/utilities/compression.js +115 -0
  73. package/src/utilities/continuation.js +4 -4
@@ -164,9 +164,7 @@ export default define(class ContainedAssertion extends Assertion {
164
164
 
165
165
  context.debug(`The '${frameString}' frame is not singular.`);
166
166
 
167
- continuation(frameValidates);
168
-
169
- return;
167
+ return continuation(frameValidates);
170
168
  }
171
169
 
172
170
  this.frame.validate(context, (frame) => {
@@ -212,9 +210,7 @@ export default define(class ContainedAssertion extends Assertion {
212
210
  if (!stated) {
213
211
  const validatesWhenStated = false;
214
212
 
215
- continuation(validatesWhenStated);
216
-
217
- return;
213
+ return continuation(validatesWhenStated);
218
214
  }
219
215
 
220
216
  let validatesWhenStated;
@@ -229,7 +225,7 @@ export default define(class ContainedAssertion extends Assertion {
229
225
  context.debug(`...validated the '${containedAssertionString}' stated contained assertion.`);
230
226
  }
231
227
 
232
- continuation(validatesWhenStated);
228
+ return continuation(validatesWhenStated);
233
229
  }
234
230
 
235
231
  validateWhenDerived(context, continuation) {
@@ -238,9 +234,7 @@ export default define(class ContainedAssertion extends Assertion {
238
234
  if (stated) {
239
235
  const validatesWhenDerived = false;
240
236
 
241
- continuation(validatesWhenDerived);
242
-
243
- return;
237
+ return continuation(validatesWhenDerived);
244
238
  }
245
239
 
246
240
  const containedAssertionString = this.getString(); ///
@@ -65,9 +65,7 @@ export default define(class SubproofAssertion extends Assertion {
65
65
 
66
66
  context.debug(`...the '${subproofAssertionString}' subproof assertion is already valid.`);
67
67
 
68
- continuation(subproofAssertion);
69
-
70
- return;
68
+ return continuation(subproofAssertion);
71
69
  }
72
70
 
73
71
  let subproofAssertion = null;
@@ -91,12 +89,12 @@ export default define(class SubproofAssertion extends Assertion {
91
89
  context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
92
90
  }
93
91
 
94
- continuation(subproofAssertion);
92
+ return continuation(subproofAssertion);
95
93
  });
96
94
  }
97
95
 
98
96
  validateStatements(context, continuation) {
99
- every(this.statements, (statement, continuation) => {
97
+ return every(this.statements, (statement, continuation) => {
100
98
  descend((context) => {
101
99
  statement.validate(context, (statement) => {
102
100
  let statementValidates = false;
@@ -105,7 +103,7 @@ export default define(class SubproofAssertion extends Assertion {
105
103
  statementValidates = true;
106
104
  }
107
105
 
108
- continuation(statementValidates);
106
+ return continuation(statementValidates);
109
107
  });
110
108
  }, context);
111
109
  }, continuation);
@@ -152,9 +150,7 @@ export default define(class SubproofAssertion extends Assertion {
152
150
  let subproofUnifies = false;
153
151
 
154
152
  if (!lastStepUnifies) {
155
- continuation(subproofUnifies);
156
-
157
- return;
153
+ return continuation(subproofUnifies);
158
154
  }
159
155
 
160
156
  const suppositions = subproof.getSuppositions();
@@ -168,7 +164,7 @@ export default define(class SubproofAssertion extends Assertion {
168
164
  context.debug(`...unified the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion.`);
169
165
  }
170
166
 
171
- continuation(subproofUnifies);
167
+ return continuation(subproofUnifies);
172
168
  });
173
169
  });
174
170
  }
@@ -201,7 +197,7 @@ export default define(class SubproofAssertion extends Assertion {
201
197
  context.debug(`...unified the '${lastStepString}' last step with the '${deducedStatementString}' deduced statement.`)
202
198
  }
203
199
 
204
- continuation(lastStepUnifies);
200
+ return continuation(lastStepUnifies);
205
201
  });
206
202
  }, specificContext);
207
203
  }
@@ -266,7 +262,7 @@ export default define(class SubproofAssertion extends Assertion {
266
262
  context.debug(`...unified the '${suppositionString}' supposition with the '${supposedStatementString}' supposed statement.`)
267
263
  }
268
264
 
269
- continuation(suppositionUnifies);
265
+ return continuation(suppositionUnifies);
270
266
  });
271
267
  }, specificContext);
272
268
  }
@@ -279,17 +275,15 @@ export default define(class SubproofAssertion extends Assertion {
279
275
  if (suppositionsLength !== supposedStatementsLength) {
280
276
  const suppositionsUnify = false;
281
277
 
282
- continuation(suppositionsUnify);
283
-
284
- return;
278
+ return continuation(suppositionsUnify);
285
279
  }
286
280
 
287
281
  let index = -1;
288
282
 
289
- backwardsEvery(suppositions, (supposition, continuation) => {
283
+ return backwardsEvery(suppositions, (supposition, continuation) => {
290
284
  index++;
291
285
 
292
- this.unifySupposition(supposition, index, generalContext, specificContext, continuation);
286
+ return this.unifySupposition(supposition, index, generalContext, specificContext, continuation);
293
287
  }, continuation);
294
288
  }
295
289
 
@@ -22,7 +22,7 @@ export default define(class BracketedCombinator extends Combinator {
22
22
  context.debug(`...unified the '${statementString}' statement with the bracketed combinator.`);
23
23
  }
24
24
 
25
- continuation(statementUnifies);
25
+ return continuation(statementUnifies);
26
26
  });
27
27
  }
28
28
 
@@ -95,7 +95,7 @@ export default define(class Combinator extends Element {
95
95
  context.debug(`...unified the '${statementString}' statement with the '${combinatorString}' combinator.`);
96
96
  }
97
97
 
98
- continuation(statementUnifies);
98
+ return continuation(statementUnifies);
99
99
  });
100
100
  }
101
101
 
@@ -44,7 +44,7 @@ export default define(class CombinatorDeclaration extends Declaration {
44
44
  context.debug(`...verified the '${combinatorDeclarationString}' combinator declaration.`);
45
45
  }
46
46
 
47
- continuation(verifies);
47
+ return continuation(verifies);
48
48
  });
49
49
  });
50
50
 
@@ -58,7 +58,7 @@ export default define(class CombinatorDeclaration extends Declaration {
58
58
  context.debug(`...verified the '${combinatorDeclarationString}' combinator declaration's combinator.`);
59
59
  }
60
60
 
61
- continuation(combinatorVerifies);
61
+ return continuation(combinatorVerifies);
62
62
  });
63
63
  }
64
64
 
@@ -49,7 +49,7 @@ export default define(class MetavariableDeclaration extends Declaration {
49
49
  context.debug(`...verified the '${metavariableDeclarationString}' metavariable declaration.`);
50
50
  }
51
51
 
52
- continuation(verifies);
52
+ return continuation(verifies);
53
53
  });
54
54
 
55
55
  verifyMetaType(context) {
@@ -59,7 +59,7 @@ export default define(class VariableDeclaration extends Declaration {
59
59
  context.debug(`...verified the '${variableDeclarationString}' variable declaration.`);
60
60
  }
61
61
 
62
- continuation(verifies);
62
+ return continuation(verifies);
63
63
  });
64
64
  });
65
65
 
@@ -100,7 +100,7 @@ export default define(class VariableDeclaration extends Declaration {
100
100
  context.debug(`...verified the '${variableDeclarationString}' variable declaration's type.`);
101
101
  }
102
102
 
103
- continuation(typeVerifies);
103
+ return continuation(typeVerifies);
104
104
  }
105
105
 
106
106
  verifyVariable(context, continuation) {
@@ -124,7 +124,7 @@ export default define(class VariableDeclaration extends Declaration {
124
124
  context.debug(`...verified the '${variableDeclarationString}' variable declaration's '${variableString}' variable.`);
125
125
  }
126
126
 
127
- continuation(variableVerifies);
127
+ return continuation(variableVerifies);
128
128
  }
129
129
 
130
130
  static name = "VariableDeclaration";
@@ -44,9 +44,7 @@ export default define(class Deduction extends Element {
44
44
 
45
45
  context.debug(`Unable to verify the '${deductionString}' deduction because it is nonsense.`);
46
46
 
47
- continuation(verifies);
48
-
49
- return;
47
+ return continuation(verifies);
50
48
  }
51
49
 
52
50
  declare((context) => {
@@ -62,7 +60,7 @@ export default define(class Deduction extends Element {
62
60
  context.debug(`...verified the '${deductionString}' deduction.`);
63
61
  }
64
62
 
65
- continuation(verifies);
63
+ return continuation(verifies);
66
64
  });
67
65
  }, context);
68
66
  }, context);
@@ -89,7 +87,7 @@ export default define(class Deduction extends Element {
89
87
  context.debug(`...validated the '${deductionString}' deduction.`);
90
88
  }
91
89
 
92
- continuation(validates);
90
+ return continuation(validates);
93
91
  });
94
92
  }, context);
95
93
  }
@@ -158,7 +156,7 @@ export default define(class Deduction extends Element {
158
156
  context.debug(`...unified the '${statementString}' statement with the '${deductionString}' deduction's statement.`);
159
157
  }
160
158
 
161
- continuation(statementUnifies);
159
+ return continuation(statementUnifies);
162
160
  });
163
161
  }
164
162
 
@@ -35,7 +35,7 @@ export default define(class Derivation extends Element {
35
35
  }
36
36
 
37
37
  verify(context, continuation) {
38
- every(this.subproofOrProofAssertions, (subproofOrProofAssertion, continuation) => {
38
+ return every(this.subproofOrProofAssertions, (subproofOrProofAssertion, continuation) => {
39
39
  subproofOrProofAssertion.verify(context, (subproofOrProofAssertionVerifies) => {
40
40
  if (subproofOrProofAssertionVerifies) {
41
41
  context.assignAssignments();
@@ -43,7 +43,7 @@ export default define(class Derivation extends Element {
43
43
  context.addSubproofOrProofAssertion(subproofOrProofAssertion);
44
44
  }
45
45
 
46
- continuation(subproofOrProofAssertionVerifies);
46
+ return continuation(subproofOrProofAssertionVerifies);
47
47
  });
48
48
  }, continuation);
49
49
  }
@@ -227,9 +227,7 @@ export default define(class Equality extends Element {
227
227
  if (!stated) {
228
228
  const validatesWhenStated = false;
229
229
 
230
- continuation(validatesWhenStated);
231
-
232
- return;
230
+ return continuation(validatesWhenStated);
233
231
  }
234
232
 
235
233
  let validatesWhenStated;
@@ -244,7 +242,7 @@ export default define(class Equality extends Element {
244
242
  context.debug(`...validated the '${equalityString}' stated equality.`);
245
243
  }
246
244
 
247
- continuation(validatesWhenStated);
245
+ return continuation(validatesWhenStated);
248
246
  }
249
247
 
250
248
  validateWhenDerived(context, continuation) {
@@ -221,8 +221,8 @@ export default define(class Frame extends Element {
221
221
 
222
222
  const assumptions = [];
223
223
 
224
- every(this.assumptions, (assumption) => {
225
- this.validateAssumption(assumption, assumptions, context, continuation);
224
+ return every(this.assumptions, (assumption) => {
225
+ return this.validateAssumption(assumption, assumptions, context, continuation);
226
226
  }, (assumptionsValidate) => {
227
227
  if (assumptionsValidate) {
228
228
  this.assumptions = assumptions;
@@ -235,8 +235,8 @@ export default define(class Frame extends Element {
235
235
  }
236
236
 
237
237
  validatMetavariable(context, continuation) {
238
- if (this.metavariable !== null) {
239
- const metavariableValidates = true;
238
+ if (this.metavariable === null) {
239
+ const metavariableValidates = true; ///
240
240
 
241
241
  return continuation(metavariableValidates);
242
242
  }
@@ -89,9 +89,7 @@ export default define(class Goal extends Element {
89
89
 
90
90
  context.debug(`...the '${goalString}' goal is already valid.`);
91
91
 
92
- continuation(goal);
93
-
94
- return;
92
+ return continuation(goal);
95
93
  }
96
94
 
97
95
  const validateStatement = this.validateStatement.bind(this),
@@ -104,9 +102,7 @@ export default define(class Goal extends Element {
104
102
  if (!validates) {
105
103
  const goal = null;
106
104
 
107
- continuation(goal);
108
-
109
- return;
105
+ return continuation(goal);
110
106
  }
111
107
 
112
108
  const validatesWhenStated = this.validateWhenStated.bind(this),
@@ -181,9 +177,7 @@ export default define(class Goal extends Element {
181
177
  if (!stated) {
182
178
  const validatesWhenStated = false;
183
179
 
184
- continuation(validatesWhenStated);
185
-
186
- return;
180
+ return continuation(validatesWhenStated);
187
181
  }
188
182
 
189
183
  let validatesWhenStated;
@@ -198,7 +192,7 @@ export default define(class Goal extends Element {
198
192
  context.debug(`...validated the '${goalString}' stated goal.`);
199
193
  }
200
194
 
201
- continuation(validatesWhenStated);
195
+ return continuation(validatesWhenStated);
202
196
  }
203
197
 
204
198
  validateWhenDerived(context, continuation) {
@@ -167,8 +167,8 @@ export default define(class Judgement extends Element {
167
167
  return;
168
168
  }
169
169
 
170
- const validateFrame = this.validateFrame.bind(this),
171
- validateGoal = this.validateGoal.bind(this);
170
+ const validateGoal = this.validateGoal.bind(this),
171
+ validateFrame = this.validateFrame.bind(this);
172
172
 
173
173
  all([
174
174
  validateFrame,
@@ -256,9 +256,7 @@ export default define(class Judgement extends Element {
256
256
  if (!stated) {
257
257
  const validatesWhenStated = false;
258
258
 
259
- continuation(validatesWhenStated);
260
-
261
- return;
259
+ return continuation(validatesWhenStated);
262
260
  }
263
261
 
264
262
  let validatesWhenStated;
@@ -273,7 +271,7 @@ export default define(class Judgement extends Element {
273
271
  context.debug(`...validated the '${judgementString}' stated judgement.`);
274
272
  }
275
273
 
276
- continuation(validatesWhenStated);
274
+ return continuation(validatesWhenStated);
277
275
  }
278
276
 
279
277
  validateWhenDerived(context, continuation) {
@@ -63,9 +63,7 @@ export default define(class Label extends Element {
63
63
 
64
64
  context.debug(`The '${labelString}' label is already present.`);
65
65
 
66
- continuation(verifies);
67
-
68
- return;
66
+ return continuation(verifies);
69
67
  }
70
68
 
71
69
  this.validate((validates) => {
@@ -79,7 +77,7 @@ export default define(class Label extends Element {
79
77
  context.debug(`...verified the '${labelString}' label.`);
80
78
  }
81
79
 
82
- continuation(verifies);
80
+ return continuation(verifies);
83
81
  });
84
82
  }
85
83
 
@@ -103,7 +101,7 @@ export default define(class Label extends Element {
103
101
  context.debug(`...validated the '${labelString}' label.`);
104
102
  }
105
103
 
106
- continuation(validates);
104
+ return continuation(validates);
107
105
  });
108
106
  }, context);
109
107
  }
@@ -126,7 +124,7 @@ export default define(class Label extends Element {
126
124
  context.debug(`...validated the '${labelString}' label's metavariable.'`);
127
125
  }
128
126
 
129
- continuation(metavariableValidates);
127
+ return continuation(metavariableValidates);
130
128
  });
131
129
  }
132
130