occam-nominal 1.0.309 → 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 (37) hide show
  1. package/lib/context/file/nominal.js +2 -2
  2. package/lib/element/assertion/subproof.js +4 -4
  3. package/lib/element/derivation.js +3 -3
  4. package/lib/element/frame.js +3 -3
  5. package/lib/element/procedureCall.js +25 -25
  6. package/lib/element/proofAssertion/premise.js +26 -19
  7. package/lib/element/proofAssertion/step.js +4 -4
  8. package/lib/element/proofAssertion/supposition.js +4 -5
  9. package/lib/element/rule.js +12 -12
  10. package/lib/element/subDerivation.js +3 -3
  11. package/lib/element/subproof.js +5 -5
  12. package/lib/element/topLevelAssertion.js +5 -5
  13. package/lib/pass/continuationZip.js +2 -2
  14. package/lib/process/unify.js +9 -9
  15. package/lib/process/validate.js +9 -9
  16. package/lib/process/validation.js +4 -4
  17. package/lib/process/verify.js +18 -18
  18. package/lib/utilities/continuation.js +5 -5
  19. package/package.json +3 -3
  20. package/src/context/file/nominal.js +1 -1
  21. package/src/element/assertion/subproof.js +3 -3
  22. package/src/element/derivation.js +2 -2
  23. package/src/element/frame.js +2 -2
  24. package/src/element/procedureCall.js +28 -29
  25. package/src/element/proofAssertion/premise.js +32 -23
  26. package/src/element/proofAssertion/step.js +3 -3
  27. package/src/element/proofAssertion/supposition.js +5 -5
  28. package/src/element/rule.js +11 -11
  29. package/src/element/subDerivation.js +2 -2
  30. package/src/element/subproof.js +4 -4
  31. package/src/element/topLevelAssertion.js +4 -4
  32. package/src/pass/continuationZip.js +1 -1
  33. package/src/process/unify.js +8 -8
  34. package/src/process/validate.js +8 -8
  35. package/src/process/validation.js +3 -3
  36. package/src/process/verify.js +17 -17
  37. package/src/utilities/continuation.js +4 -4
@@ -94,7 +94,7 @@ export default define(class Subproof extends Element {
94
94
  const verifySuppositions = this.verifySuppositions.bind(this),
95
95
  verifySubDerivation = this.verifySubDerivation.bind(this);
96
96
 
97
- all([
97
+ return all([
98
98
  verifySuppositions,
99
99
  verifySubDerivation
100
100
  ], context, continuation);
@@ -116,13 +116,13 @@ export default define(class Subproof extends Element {
116
116
  }
117
117
 
118
118
  verifySuppositions(context, continuation) {
119
- every(this.suppositions, (supposition, continuation) => {
120
- this.verifySupposition(supposition, context, continuation);
119
+ return every(this.suppositions, (supposition, continuation) => {
120
+ return this.verifySupposition(supposition, context, continuation);
121
121
  }, continuation);
122
122
  }
123
123
 
124
124
  verifySubDerivation(context, continuation) {
125
- this.subDerivation.verify(context, continuation);
125
+ return this.subDerivation.verify(context, continuation);
126
126
  }
127
127
 
128
128
  static name = "Subproof";
@@ -123,8 +123,8 @@ export default class TopLevelAssertion extends Element {
123
123
 
124
124
  context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's labels...`);
125
125
 
126
- every(this.labels, (label, continuation) => {
127
- this.verifyLabel(label, context, continuation);
126
+ return every(this.labels, (label, continuation) => {
127
+ return this.verifyLabel(label, context, continuation);
128
128
  }, (labelsVerify) => {
129
129
  if (labelsVerify) {
130
130
  context.debug(`...verified the '${topLevelAssertionString}' top level assertion's labels.`);
@@ -216,8 +216,8 @@ export default class TopLevelAssertion extends Element {
216
216
 
217
217
  context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's suppositions...`);
218
218
 
219
- forwardsEvery(this.suppositions, (supposition, continuation) => {
220
- this.verifySupposition(supposition, context, continuation);
219
+ return forwardsEvery(this.suppositions, (supposition, continuation) => {
220
+ return this.verifySupposition(supposition, context, continuation);
221
221
  }, (suppositionsVerify) => {
222
222
  if (suppositionsVerify) {
223
223
  context.debug(`...verified the '${topLevelAssertionString}' top level assertion's suppositions.`);
@@ -8,6 +8,6 @@ export default class ContinuationZipPass extends ContinuationZipPassBase {
8
8
  generalChildNodes = generalNonTerminalNode.getChildNodes(), ///
9
9
  specificChildNodes = specificNonTerminalNode.getChildNodes(); ///
10
10
 
11
- this.descend(generalChildNodes, specificChildNodes, ...remainingArguments, continuation);
11
+ return this.descend(generalChildNodes, specificChildNodes, ...remainingArguments, continuation);
12
12
  }
13
13
  }
@@ -488,14 +488,14 @@ export function unifyStatement(generalStatement, specificStatement, generalConte
488
488
  generalNode = generalStatementNode, ///
489
489
  specificNode = specificStatementNode; ///
490
490
 
491
- metaLevelPass.run(generalNode, specificNode, generalContext, specificContext, continuation);
491
+ return metaLevelPass.run(generalNode, specificNode, generalContext, specificContext, continuation);
492
492
  }
493
493
 
494
494
  export function unifyMetavariable(generalMetavariable, specificMetavariable, generalContext, specificContext, continuation) {
495
495
  const generalMetavariableNode = generalMetavariable.getNode(),
496
496
  specificMetavariableNode = specificMetavariable.getNode();
497
497
 
498
- metavariablePass.run(generalMetavariableNode, specificMetavariableNode, generalContext, specificContext, continuation);
498
+ return metavariablePass.run(generalMetavariableNode, specificMetavariableNode, generalContext, specificContext, continuation);
499
499
  }
500
500
 
501
501
  export function unifyTermWithProperty(term, property, generalContext, specificContext, continuation) {
@@ -503,7 +503,7 @@ export function unifyTermWithProperty(term, property, generalContext, specificCo
503
503
  propertyTerm = property.getTerm(),
504
504
  propertyTermNode = propertyTerm.getNode();
505
505
 
506
- propertyPass.run(propertyTermNode, termNode, generalContext, specificContext, continuation);
506
+ return propertyPass.run(propertyTermNode, termNode, generalContext, specificContext, continuation);
507
507
  }
508
508
 
509
509
  export function unifyTermWithGenerator(term, generator, generalContext, specificContext, continuation) {
@@ -511,7 +511,7 @@ export function unifyTermWithGenerator(term, generator, generalContext, specific
511
511
  generatorTerm = generator.getTerm(),
512
512
  generatorTermNode = generatorTerm.getNode();
513
513
 
514
- generatorPass.run(generatorTermNode, termNode, generalContext, specificContext, continuation);
514
+ return generatorPass.run(generatorTermNode, termNode, generalContext, specificContext, continuation);
515
515
  }
516
516
 
517
517
  export function unifyTermWithConstructor(term, constructor, generalContext, specificContext, continuation) {
@@ -519,7 +519,7 @@ export function unifyTermWithConstructor(term, constructor, generalContext, spec
519
519
  constructorTerm = constructor.getTerm(),
520
520
  constructorTermNode = constructorTerm.getNode();
521
521
 
522
- constructorPass.run(constructorTermNode, termNode, generalContext, specificContext, continuation);
522
+ return constructorPass.run(constructorTermNode, termNode, generalContext, specificContext, continuation);
523
523
  }
524
524
 
525
525
  export function unifyStatementWithCombinator(statement, combinator, generalContext, specificContext, continuation) {
@@ -527,7 +527,7 @@ export function unifyStatementWithCombinator(statement, combinator, generalConte
527
527
  combinatorStatement = combinator.getStatement(),
528
528
  combinatorStatementNode = combinatorStatement.getNode();
529
529
 
530
- combinatorPass.run(combinatorStatementNode, statementNode, generalContext, specificContext, continuation);
530
+ return combinatorPass.run(combinatorStatementNode, statementNode, generalContext, specificContext, continuation);
531
531
  }
532
532
 
533
533
  export function unifyTermIntrinsically(generalTerm, specificTerm, generalContext, specificContext, continuation) {
@@ -536,7 +536,7 @@ export function unifyTermIntrinsically(generalTerm, specificTerm, generalContext
536
536
  generalNode = generalTermNode, ///
537
537
  specificNode = specificTermNode; ///
538
538
 
539
- intrinsicTermPass.run(generalNode, specificNode, generalContext, specificContext, continuation);
539
+ return intrinsicTermPass.run(generalNode, specificNode, generalContext, specificContext, continuation);
540
540
  }
541
541
 
542
542
  export function unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, generalContext, specificContext, continuation) {
@@ -545,5 +545,5 @@ export function unifyMetavariableIntrinsically(generalMetavariable, specificMeta
545
545
  generalNode = generalMetavariableNode, ///
546
546
  specificNode = specificMetavariableNode;
547
547
 
548
- intrinsicMetavariablePass.run(generalNode, specificNode, generalContext, specificContext, continuation);
548
+ return intrinsicMetavariablePass.run(generalNode, specificNode, generalContext, specificContext, continuation);
549
549
  }
@@ -17,7 +17,7 @@ class PropertyPass extends ContinuationPass {
17
17
  const nonTerminalNode = termNode, ///
18
18
  childNodes = nonTerminalNode.getChildNodes();
19
19
 
20
- this.descend(childNodes, context, continuation);
20
+ return this.descend(childNodes, context, continuation);
21
21
  }
22
22
 
23
23
  static maps = [
@@ -60,7 +60,7 @@ class GeneratorPass extends ContinuationPass {
60
60
  const nonTerminalNode = termNode, ///
61
61
  childNodes = nonTerminalNode.getChildNodes();
62
62
 
63
- this.descend(childNodes, context, continuation);
63
+ return this.descend(childNodes, context, continuation);
64
64
  }
65
65
 
66
66
  static maps = [
@@ -103,7 +103,7 @@ class CombinatorPass extends ContinuationPass {
103
103
  const nonTerminalNode = statementNode, ///
104
104
  childNodes = nonTerminalNode.getChildNodes();
105
105
 
106
- this.descend(childNodes, context, continuation);
106
+ return this.descend(childNodes, context, continuation);
107
107
  }
108
108
 
109
109
  static maps = [
@@ -164,7 +164,7 @@ class ConstructorPass extends ContinuationPass {
164
164
  const nonTerminalNode = termNode, ///
165
165
  childNodes = nonTerminalNode.getChildNodes();
166
166
 
167
- this.descend(childNodes, context, continuation);
167
+ return this.descend(childNodes, context, continuation);
168
168
  }
169
169
 
170
170
  static maps = [
@@ -210,23 +210,23 @@ const propertyPass = new PropertyPass(),
210
210
  export function validateTermAsProperty(term, context, continuation) {
211
211
  const termNode = term.getNode();
212
212
 
213
- propertyPass.run(termNode, context, continuation);
213
+ return propertyPass.run(termNode, context, continuation);
214
214
  }
215
215
 
216
216
  export function validateTermAsGenerator(term, context, continuation) {
217
217
  const termNode = term.getNode();
218
218
 
219
- generatorPass.run(termNode, context, continuation);
219
+ return generatorPass.run(termNode, context, continuation);
220
220
  }
221
221
 
222
222
  export function validateTermAsConstructor(term, context, continuation) {
223
223
  const termNode = term.getNode();
224
224
 
225
- constructorPass.run(termNode, context, continuation);
225
+ return constructorPass.run(termNode, context, continuation);
226
226
  }
227
227
 
228
228
  export function validateStatementAsCombinator(statement, context, continuation) {
229
229
  const statementNode = statement.getNode();
230
230
 
231
- combinatorPass.run(statementNode, context, continuation);
231
+ return combinatorPass.run(statementNode, context, continuation);
232
232
  }
@@ -165,9 +165,9 @@ function validateStatementAsMetavariable(statement, context, continuation) {
165
165
  function unifyStatementWithCombinators(statement, context, continuation) {
166
166
  const combinators = context.getCombinators();
167
167
 
168
- some(combinators, (combinator, continuation) => {
168
+ return some(combinators, (combinator, continuation) => {
169
169
  descend((context) => {
170
- combinator.unifyStatement(statement, context, continuation);
170
+ return combinator.unifyStatement(statement, context, continuation);
171
171
  }, context);
172
172
  }, continuation);
173
173
  }
@@ -175,7 +175,7 @@ function unifyStatementWithCombinators(statement, context, continuation) {
175
175
  function unifyStatementWithBracketedCombinator(statement, context, continuation) {
176
176
  const bracketedCombinator = bracketedCombinatorFromNothing();
177
177
 
178
- bracketedCombinator.unifyStatement(statement, context, continuation);
178
+ return bracketedCombinator.unifyStatement(statement, context, continuation);
179
179
  }
180
180
 
181
181
  function validateStatementAsEquality(statement, context, continuation) {
@@ -46,7 +46,7 @@ class TopLevelPass extends ContinuationPass {
46
46
  run: (errorNode, context, continuation) => {
47
47
  const error = errorFromErrorNode(errorNode, context);
48
48
 
49
- error.verify(context, continuation);
49
+ return error.verify(context, continuation);
50
50
  }
51
51
  },
52
52
  {
@@ -54,7 +54,7 @@ class TopLevelPass extends ContinuationPass {
54
54
  run: (ruleNode, context, continuation) => {
55
55
  const rule = ruleFromRuleNode(ruleNode, context);
56
56
 
57
- rule.verify(context, continuation);
57
+ return rule.verify(context, continuation);
58
58
  }
59
59
  },
60
60
  {
@@ -62,7 +62,7 @@ class TopLevelPass extends ContinuationPass {
62
62
  run: (axiomNode, context, continuation) => {
63
63
  const axiom = axiomFromAxiomNode(axiomNode, context);
64
64
 
65
- axiom.verify(context, continuation);
65
+ return axiom.verify(context, continuation);
66
66
  }
67
67
  },
68
68
  {
@@ -70,7 +70,7 @@ class TopLevelPass extends ContinuationPass {
70
70
  run: (lemmaNode, context, continuation) => {
71
71
  const lemma = lemmaFromLemmaNode(lemmaNode, context);
72
72
 
73
- lemma.verify(context, continuation);
73
+ return lemma.verify(context, continuation);
74
74
  }
75
75
  },
76
76
  {
@@ -78,7 +78,7 @@ class TopLevelPass extends ContinuationPass {
78
78
  run: (schemaNode, context, continuation) => {
79
79
  const schema = schemaFromSchemaNode(schemaNode, context);
80
80
 
81
- schema.verify(context, continuation);
81
+ return schema.verify(context, continuation);
82
82
  }
83
83
  },
84
84
  {
@@ -86,7 +86,7 @@ class TopLevelPass extends ContinuationPass {
86
86
  run: (sectionNode, context, continuation) => {
87
87
  const section = sectionFromSectionNode(sectionNode, context);
88
88
 
89
- section.verify(context, continuation);
89
+ return section.verify(context, continuation);
90
90
  }
91
91
  },
92
92
  {
@@ -94,7 +94,7 @@ class TopLevelPass extends ContinuationPass {
94
94
  run: (theoremNode, context, continuation) => {
95
95
  const theorem = theoremFromTheoremNode(theoremNode, context);
96
96
 
97
- theorem.verify(context, continuation);
97
+ return theorem.verify(context, continuation);
98
98
  }
99
99
  },
100
100
  {
@@ -102,7 +102,7 @@ class TopLevelPass extends ContinuationPass {
102
102
  run: (conjectureNode, context, continuation) => {
103
103
  const conjecture = conjectureFromConjectureNode(conjectureNode, context);
104
104
 
105
- conjecture.verify(context, continuation);
105
+ return conjecture.verify(context, continuation);
106
106
  }
107
107
  },
108
108
  {
@@ -110,7 +110,7 @@ class TopLevelPass extends ContinuationPass {
110
110
  run: (typeDeclarationNode, context, continuation) => {
111
111
  const typeDeclaration = typeDeclarationFromTypeDeclarationNode(typeDeclarationNode, context);
112
112
 
113
- typeDeclaration.verify(context, continuation);
113
+ return typeDeclaration.verify(context, continuation);
114
114
  }
115
115
  },
116
116
  {
@@ -118,7 +118,7 @@ class TopLevelPass extends ContinuationPass {
118
118
  run: (cotypeDeclarationNode, context, continuation) => {
119
119
  const cotypeDeclaration = cotypeDeclarationFromCotypeDeclarationNode(cotypeDeclarationNode, context);
120
120
 
121
- cotypeDeclaration.verify(context, continuation);
121
+ return cotypeDeclaration.verify(context, continuation);
122
122
  }
123
123
  },
124
124
  {
@@ -126,7 +126,7 @@ class TopLevelPass extends ContinuationPass {
126
126
  run: (variableDeclarationNode, context, continuation) => {
127
127
  const variableDeclaration = variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context);
128
128
 
129
- variableDeclaration.verify(context, continuation);
129
+ return variableDeclaration.verify(context, continuation);
130
130
  }
131
131
  },
132
132
  {
@@ -134,7 +134,7 @@ class TopLevelPass extends ContinuationPass {
134
134
  run: (generatorDeclarationNode, context, continuation) => {
135
135
  const generatorDeclaration = generatorDeclarationFromGeneratorDeclarationNode(generatorDeclarationNode, context);
136
136
 
137
- generatorDeclaration.verify(context, continuation);
137
+ return generatorDeclaration.verify(context, continuation);
138
138
  }
139
139
  },
140
140
  {
@@ -142,7 +142,7 @@ class TopLevelPass extends ContinuationPass {
142
142
  run: (typePrefixDeclarationNode, context, continuation) => {
143
143
  const typePrefixDeclaration = typePrefixDeclarationFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context);
144
144
 
145
- typePrefixDeclaration.verify(context, continuation);
145
+ return typePrefixDeclaration.verify(context, continuation);
146
146
  }
147
147
  },
148
148
  {
@@ -150,7 +150,7 @@ class TopLevelPass extends ContinuationPass {
150
150
  run: (combinatorDeclarationNode, context, continuation) => {
151
151
  const combinatorDeclaration = combinatorDeclarationFromCombinatorDeclarationNode(combinatorDeclarationNode, context);
152
152
 
153
- combinatorDeclaration.verify(context, continuation);
153
+ return combinatorDeclaration.verify(context, continuation);
154
154
  }
155
155
  },
156
156
  {
@@ -158,7 +158,7 @@ class TopLevelPass extends ContinuationPass {
158
158
  run: (constructorDeclarationNode, context, continuation) => {
159
159
  const constructorDeclaration = constructorDeclarationFromConstructorDeclarationNode(constructorDeclarationNode, context);
160
160
 
161
- constructorDeclaration.verify(context, continuation);
161
+ return constructorDeclaration.verify(context, continuation);
162
162
  }
163
163
  },
164
164
  {
@@ -166,7 +166,7 @@ class TopLevelPass extends ContinuationPass {
166
166
  run: (metavariableDeclarationNode, context, continuation) => {
167
167
  const metavariableDeclaration = metavariableDeclarationFromMetavariableDeclarationNode(metavariableDeclarationNode, context);
168
168
 
169
- metavariableDeclaration.verify(context, continuation);
169
+ return metavariableDeclaration.verify(context, continuation);
170
170
  }
171
171
  }
172
172
  ];
@@ -177,5 +177,5 @@ const topLevelPass = new TopLevelPass();
177
177
  export function verifyFile(fileNode, context, continuation) {
178
178
  const node = fileNode; ///
179
179
 
180
- topLevelPass.run(node, context, continuation);
180
+ return topLevelPass.run(node, context, continuation);
181
181
  }
@@ -7,15 +7,15 @@ export const { some, every, match, reduce, forEach, extract, resolve, forwardsEv
7
7
  export function all(callbacks, ...remainingArguments) {
8
8
  const continuation = remainingArguments.pop();
9
9
 
10
- every(callbacks, (callback, continuation) => {
11
- callback(...remainingArguments, continuation);
10
+ return every(callbacks, (callback, continuation) => {
11
+ return callback(...remainingArguments, continuation);
12
12
  }, continuation);
13
13
  }
14
14
 
15
15
  export function exists(callbacks, ...remainingArguments) {
16
16
  const continuation = remainingArguments.pop();
17
17
 
18
- some(callbacks, (callback, continuation) => {
19
- callback(...remainingArguments, continuation);
18
+ return some(callbacks, (callback, continuation) => {
19
+ return callback(...remainingArguments, continuation);
20
20
  }, continuation);
21
21
  }