occam-nominal 1.0.310 → 1.0.317
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.
- package/lib/context/liminal.js +17 -15
- package/lib/context/phaneric.js +3 -3
- package/lib/context.js +3 -3
- package/lib/element/assertion/contained.js +19 -17
- package/lib/element/assertion/defined.js +16 -14
- package/lib/element/conclusion.js +10 -11
- package/lib/element/declaration/variable.js +2 -2
- package/lib/element/deduction.js +7 -7
- package/lib/element/equality.js +3 -3
- package/lib/element/frame.js +8 -3
- package/lib/element/goal.js +7 -8
- package/lib/element/judgement.js +8 -10
- package/lib/element/metavariable.js +44 -40
- package/lib/element/proof.js +2 -2
- package/lib/element/proofAssertion/premise.js +17 -21
- package/lib/element/proofAssertion/step.js +5 -5
- package/lib/element/proofAssertion/supposition.js +39 -35
- package/lib/element/rule.js +24 -22
- package/lib/element/statement.js +56 -32
- package/lib/element/substitution/frame.js +71 -62
- package/lib/element/substitution/reference.js +21 -21
- package/lib/element/substitution/statement.js +81 -98
- package/lib/element/substitution/term.js +76 -67
- package/lib/element/substitution.js +5 -5
- package/lib/element/term.js +2 -2
- package/lib/element/topLevelAssertion/axiom.js +4 -5
- package/lib/element/topLevelAssertion/conjecture.js +3 -3
- package/lib/element/topLevelAssertion/lemma.js +3 -3
- package/lib/element/topLevelAssertion/theorem.js +3 -3
- package/lib/element/topLevelAssertion.js +59 -69
- package/lib/node/metavariable.js +18 -1
- package/lib/process/unify.js +5 -7
- package/lib/process/validation.js +5 -2
- package/lib/utilities/element.js +34 -56
- package/package.json +2 -2
- package/src/context/liminal.js +18 -16
- package/src/context/phaneric.js +3 -3
- package/src/context.js +2 -2
- package/src/element/assertion/contained.js +19 -18
- package/src/element/assertion/defined.js +16 -16
- package/src/element/conclusion.js +9 -11
- package/src/element/declaration/variable.js +1 -1
- package/src/element/deduction.js +6 -6
- package/src/element/equality.js +2 -2
- package/src/element/frame.js +10 -2
- package/src/element/goal.js +6 -8
- package/src/element/judgement.js +7 -11
- package/src/element/metavariable.js +56 -52
- package/src/element/proof.js +1 -1
- package/src/element/proofAssertion/premise.js +17 -25
- package/src/element/proofAssertion/step.js +4 -4
- package/src/element/proofAssertion/supposition.js +44 -43
- package/src/element/rule.js +27 -25
- package/src/element/statement.js +71 -41
- package/src/element/substitution/frame.js +88 -82
- package/src/element/substitution/reference.js +30 -32
- package/src/element/substitution/statement.js +97 -132
- package/src/element/substitution/term.js +95 -89
- package/src/element/substitution.js +6 -6
- package/src/element/term.js +1 -1
- package/src/element/topLevelAssertion/axiom.js +3 -5
- package/src/element/topLevelAssertion/conjecture.js +2 -2
- package/src/element/topLevelAssertion/lemma.js +2 -2
- package/src/element/topLevelAssertion/theorem.js +2 -2
- package/src/element/topLevelAssertion.js +61 -80
- package/src/node/metavariable.js +28 -1
- package/src/process/unify.js +7 -16
- package/src/process/validation.js +5 -4
- package/src/utilities/element.js +49 -64
|
@@ -7,7 +7,6 @@ import elements from "../elements";
|
|
|
7
7
|
import { all } from "../utilities/continuation";
|
|
8
8
|
import { define } from "../elements";
|
|
9
9
|
import { instantiate } from "../utilities/context";
|
|
10
|
-
import { EMPTY_STRING } from "../constants";
|
|
11
10
|
import { instantiateMetavariable } from "../process/instantiate";
|
|
12
11
|
import { metaTypeFromJSON, metaTypeToMetaTypeJSON } from "../utilities/json";
|
|
13
12
|
import { unifyMetavariable, unifyMetavariableIntrinsically } from "../process/unify";
|
|
@@ -199,7 +198,7 @@ export default define(class Metavariable extends Element {
|
|
|
199
198
|
validateTerm = this.validateTerm.bind(this),
|
|
200
199
|
validateType = this.validateType.bind(this);
|
|
201
200
|
|
|
202
|
-
all([
|
|
201
|
+
return all([
|
|
203
202
|
validateName,
|
|
204
203
|
validateTerm,
|
|
205
204
|
validateType
|
|
@@ -219,7 +218,7 @@ export default define(class Metavariable extends Element {
|
|
|
219
218
|
context.debug(`...validated the '${metavariableString}' metavariable.`);
|
|
220
219
|
}
|
|
221
220
|
|
|
222
|
-
continuation(metavariable);
|
|
221
|
+
return continuation(metavariable);
|
|
223
222
|
});
|
|
224
223
|
}
|
|
225
224
|
|
|
@@ -250,22 +249,22 @@ export default define(class Metavariable extends Element {
|
|
|
250
249
|
context.debug(`...validated the '${metavariableString}' metavariable's name.`);
|
|
251
250
|
}
|
|
252
251
|
|
|
253
|
-
continuation(nameValidates);
|
|
252
|
+
return continuation(nameValidates);
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
validateTerm(strict, context, continuation) {
|
|
257
256
|
if (this.term === null) {
|
|
258
257
|
const termValidates = true;
|
|
259
258
|
|
|
260
|
-
continuation(termValidates);
|
|
261
|
-
|
|
262
|
-
return;
|
|
259
|
+
return continuation(termValidates);
|
|
263
260
|
}
|
|
264
261
|
|
|
265
262
|
const metavariableString = this.getString(); ///
|
|
266
263
|
|
|
267
264
|
context.trace(`Validating the '${metavariableString}' metavariable's term...`);
|
|
268
265
|
|
|
266
|
+
debugger
|
|
267
|
+
|
|
269
268
|
let termValidates = false;
|
|
270
269
|
|
|
271
270
|
const metavariableName = this.getMetavariableName(),
|
|
@@ -304,9 +303,7 @@ export default define(class Metavariable extends Element {
|
|
|
304
303
|
if (this.type === null) {
|
|
305
304
|
const typeValidates = true;
|
|
306
305
|
|
|
307
|
-
continuation(typeValidates);
|
|
308
|
-
|
|
309
|
-
return;
|
|
306
|
+
return continuation(typeValidates);
|
|
310
307
|
}
|
|
311
308
|
|
|
312
309
|
let typeValidates;
|
|
@@ -325,7 +322,7 @@ export default define(class Metavariable extends Element {
|
|
|
325
322
|
context.trace(`...validated the '${metavariableString}' metavariable's type.`);
|
|
326
323
|
}
|
|
327
324
|
|
|
328
|
-
continuation(typeValidates);
|
|
325
|
+
return continuation(typeValidates);
|
|
329
326
|
}
|
|
330
327
|
|
|
331
328
|
unifyFrame(frame, generalContext, specificContext, continuation) {
|
|
@@ -366,7 +363,7 @@ export default define(class Metavariable extends Element {
|
|
|
366
363
|
const { FrameSubstitution } = elements,
|
|
367
364
|
frameSubstitution = FrameSubstitution.fromFrameAndMetavariable(frame, metavariable, generalContext, specificContext);
|
|
368
365
|
|
|
369
|
-
frameSubstitution.validate(context, (frameSubstitution) => {
|
|
366
|
+
return frameSubstitution.validate(context, (frameSubstitution) => {
|
|
370
367
|
let frameUnifies = false;
|
|
371
368
|
|
|
372
369
|
if (frameSubstitution !== null) {
|
|
@@ -385,63 +382,70 @@ export default define(class Metavariable extends Element {
|
|
|
385
382
|
});
|
|
386
383
|
}
|
|
387
384
|
|
|
388
|
-
unifyStatement(statement,
|
|
385
|
+
unifyStatement(statement, generalContext, specificContext, continuation) {
|
|
389
386
|
const context = specificContext, ///
|
|
390
387
|
statementString = statement.getString(),
|
|
391
|
-
metavariableString = this.getString()
|
|
392
|
-
substitutionString = (substitution !== null) ?
|
|
393
|
-
substitution.getString() :
|
|
394
|
-
EMPTY_STRING;
|
|
388
|
+
metavariableString = this.getString();
|
|
395
389
|
|
|
396
|
-
context.trace(`Unifying the '${statementString}' statement with the '${metavariableString}
|
|
390
|
+
context.trace(`Unifying the '${statementString}' statement with the '${metavariableString}}' metavariable...`);
|
|
397
391
|
|
|
398
|
-
this.compareStatementMetavariable(statement, generalContext, specificContext
|
|
399
|
-
if (statementMetavariableCompares) {
|
|
400
|
-
const statementUnifies = true;
|
|
392
|
+
const statementMetavariableCompares = this.compareStatementMetavariable(statement, generalContext, specificContext);
|
|
401
393
|
|
|
402
|
-
|
|
403
|
-
|
|
394
|
+
if (statementMetavariableCompares) {
|
|
395
|
+
const statementUnifies = true;
|
|
404
396
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
derivedSubstitution = (substitution !== null) ?
|
|
408
|
-
context.findDerivedSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
|
|
409
|
-
context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
397
|
+
return continuation(statementUnifies);
|
|
398
|
+
}
|
|
410
399
|
|
|
411
|
-
|
|
412
|
-
|
|
400
|
+
const metavariable = this, ///
|
|
401
|
+
metavariableNode = metavariable.getNode(),
|
|
402
|
+
sublingSubstitutionNode = metavariableNode.getSiblingSubstitutionNode(),
|
|
403
|
+
substitutionNode = sublingSubstitutionNode, ///
|
|
404
|
+
derivedSubstitution = (substitutionNode !== null) ?
|
|
405
|
+
context.findDerivedSubstitutionByMetavariableNodeAndSubstitutionNode(metavariableNode, substitutionNode) :
|
|
406
|
+
context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
413
407
|
|
|
414
|
-
|
|
408
|
+
if (derivedSubstitution !== null) {
|
|
409
|
+
let statementUnifies = false;
|
|
415
410
|
|
|
416
|
-
|
|
417
|
-
const derivedSubstitutionString = derivedSubstitution.getString();
|
|
411
|
+
const derivedSubstitutionComparesToStatement = derivedSubstitution.compareStatement(statement, context);
|
|
418
412
|
|
|
419
|
-
|
|
413
|
+
if (derivedSubstitutionComparesToStatement) {
|
|
414
|
+
const derivedSubstitutionString = derivedSubstitution.getString();
|
|
420
415
|
|
|
421
|
-
|
|
422
|
-
}
|
|
416
|
+
context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
|
|
423
417
|
|
|
424
|
-
|
|
418
|
+
statementUnifies = true;
|
|
425
419
|
}
|
|
426
420
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, generalContext, specificContext) :
|
|
430
|
-
StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, generalContext, specificContext);
|
|
421
|
+
return continuation(statementUnifies);
|
|
422
|
+
}
|
|
431
423
|
|
|
432
|
-
|
|
433
|
-
const derivedSubstitution = statementSubstitution; ///
|
|
424
|
+
const { StatementSubstitution } = elements;
|
|
434
425
|
|
|
435
|
-
|
|
426
|
+
let statementSubstitution;
|
|
436
427
|
|
|
437
|
-
|
|
428
|
+
if (substitutionNode !== null) {
|
|
429
|
+
const context = generalContext, ///
|
|
430
|
+
substitution = context.findSubstitutionBySubstitutionNode(substitutionNode);
|
|
438
431
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
432
|
+
statementSubstitution = StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, generalContext, specificContext);
|
|
433
|
+
} else {
|
|
434
|
+
statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, generalContext, specificContext);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
statementSubstitution.validate(context, (statementSubstitution) => {
|
|
438
|
+
const derivedSubstitution = statementSubstitution; ///
|
|
439
|
+
|
|
440
|
+
context.addDerivedSubstitution(derivedSubstitution);
|
|
441
|
+
|
|
442
|
+
const statementUnifies = true;
|
|
443
|
+
|
|
444
|
+
if (statementUnifies) {
|
|
445
|
+
context.debug(`...unified the '${statementString}' statement with the '${metavariableString}' metavariable.`);
|
|
446
|
+
}
|
|
442
447
|
|
|
443
|
-
|
|
444
|
-
});
|
|
448
|
+
return continuation(statementUnifies);
|
|
445
449
|
});
|
|
446
450
|
}
|
|
447
451
|
|
|
@@ -592,7 +596,7 @@ export default define(class Metavariable extends Element {
|
|
|
592
596
|
return referenceMetavariableCompares;
|
|
593
597
|
}
|
|
594
598
|
|
|
595
|
-
compareStatementMetavariable(statement, generalContext, specificContext
|
|
599
|
+
compareStatementMetavariable(statement, generalContext, specificContext) {
|
|
596
600
|
let statementMetavariableCompares = false;
|
|
597
601
|
|
|
598
602
|
const context = specificContext, ///
|
|
@@ -617,7 +621,7 @@ export default define(class Metavariable extends Element {
|
|
|
617
621
|
context.debug(`...compared the '${statementString}' statement's metavariable to the '${metavariableString}' metavariable.`);
|
|
618
622
|
}
|
|
619
623
|
|
|
620
|
-
|
|
624
|
+
return statementMetavariableCompares;
|
|
621
625
|
}
|
|
622
626
|
|
|
623
627
|
toJSON() {
|
package/src/element/proof.js
CHANGED
|
@@ -35,7 +35,7 @@ export default define(class Proof extends Element {
|
|
|
35
35
|
|
|
36
36
|
verify(statement, context, continuation) {
|
|
37
37
|
enclose((context) => {
|
|
38
|
-
this.derivation.verify(context, (derivationVerifies) => {
|
|
38
|
+
return this.derivation.verify(context, (derivationVerifies) => {
|
|
39
39
|
let verifies = false;
|
|
40
40
|
|
|
41
41
|
if (derivationVerifies) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { breakPointUtilities
|
|
3
|
+
import { breakPointUtilities } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import ProofAssertion from "../proofAssertion";
|
|
6
6
|
|
|
@@ -75,13 +75,11 @@ export default define(class Premise extends ProofAssertion {
|
|
|
75
75
|
|
|
76
76
|
context.debug(`Unable to verify the '${premiseString}' premise because it is nonsense.`);
|
|
77
77
|
|
|
78
|
-
continuation(verifies);
|
|
79
|
-
|
|
80
|
-
return;
|
|
78
|
+
return continuation(verifies);
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
declare((context) => {
|
|
84
|
-
this.validate(context, (validates) => {
|
|
82
|
+
return this.validate(context, (validates) => {
|
|
85
83
|
let verifies = false;
|
|
86
84
|
|
|
87
85
|
if (validates) {
|
|
@@ -92,7 +90,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
92
90
|
context.debug(`...verified the '${premiseString}' premise.`);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
continuation(verifies);
|
|
93
|
+
return continuation(verifies);
|
|
96
94
|
});
|
|
97
95
|
}, context);
|
|
98
96
|
});
|
|
@@ -106,7 +104,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
106
104
|
const validateStatement = this.validateStatement.bind(this),
|
|
107
105
|
validateProcedureCall = this.validateProcedureCall.bind(this);
|
|
108
106
|
|
|
109
|
-
exists([
|
|
107
|
+
return exists([
|
|
110
108
|
validateStatement,
|
|
111
109
|
validateProcedureCall
|
|
112
110
|
], context, (validates) => {
|
|
@@ -118,7 +116,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
118
116
|
context.debug(`...validated the '${premiseString}' premise.`);
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
continuation(validates);
|
|
119
|
+
return continuation(validates);
|
|
122
120
|
});
|
|
123
121
|
}, context);
|
|
124
122
|
}
|
|
@@ -129,16 +127,14 @@ export default define(class Premise extends ProofAssertion {
|
|
|
129
127
|
if (statement === null) {
|
|
130
128
|
const statementValidates = false;
|
|
131
129
|
|
|
132
|
-
continuation(statementValidates);
|
|
133
|
-
|
|
134
|
-
return;
|
|
130
|
+
return continuation(statementValidates);
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
const premiseString = this.getString();
|
|
138
134
|
|
|
139
135
|
context.trace(`Validating the '${premiseString}' premise's statsement...`);
|
|
140
136
|
|
|
141
|
-
statement.validate(context, (statement) => {
|
|
137
|
+
return statement.validate(context, (statement) => {
|
|
142
138
|
let statementValidates = false;
|
|
143
139
|
|
|
144
140
|
if (statement !== null) {
|
|
@@ -149,7 +145,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
149
145
|
context.debug(`...validated the '${premiseString}' premise's statement.`);
|
|
150
146
|
}
|
|
151
147
|
|
|
152
|
-
continuation(statementValidates);
|
|
148
|
+
return continuation(statementValidates);
|
|
153
149
|
});
|
|
154
150
|
}
|
|
155
151
|
|
|
@@ -159,21 +155,19 @@ export default define(class Premise extends ProofAssertion {
|
|
|
159
155
|
if (procedureCall === null) {
|
|
160
156
|
const procedureCallValidates = false;
|
|
161
157
|
|
|
162
|
-
continuation(procedureCallValidates);
|
|
163
|
-
|
|
164
|
-
return;
|
|
158
|
+
return continuation(procedureCallValidates);
|
|
165
159
|
}
|
|
166
160
|
|
|
167
161
|
const premiseString = this.getString();
|
|
168
162
|
|
|
169
163
|
context.trace(`Validatting the '${premiseString}' premise's procedure call...`);
|
|
170
164
|
|
|
171
|
-
|
|
165
|
+
return procedureCall.validate(context, (procedureCallValidates) => {
|
|
172
166
|
if (procedureCallValidates) {
|
|
173
167
|
context.debug(`...validated the '${premiseString}' premise's procedure call.`);
|
|
174
168
|
}
|
|
175
169
|
|
|
176
|
-
continuation(procedureCallValidates);
|
|
170
|
+
return continuation(procedureCallValidates);
|
|
177
171
|
});
|
|
178
172
|
}
|
|
179
173
|
|
|
@@ -235,9 +229,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
235
229
|
if (subproofAssertion === null) {
|
|
236
230
|
const subproofUnifies = false;
|
|
237
231
|
|
|
238
|
-
continuation(subproofUnifies);
|
|
239
|
-
|
|
240
|
-
return;
|
|
232
|
+
return continuation(subproofUnifies);
|
|
241
233
|
}
|
|
242
234
|
|
|
243
235
|
const premiseContext = this.getContext(), ///
|
|
@@ -245,7 +237,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
245
237
|
specificContext = context; ///
|
|
246
238
|
|
|
247
239
|
reconcile((context) => {
|
|
248
|
-
subproofAssertion.unifySubproof(subproof, generalContext, specificContext, (subproofUnifies) => {
|
|
240
|
+
return subproofAssertion.unifySubproof(subproof, generalContext, specificContext, (subproofUnifies) => {
|
|
249
241
|
if (subproofUnifies) {
|
|
250
242
|
context.commit();
|
|
251
243
|
}
|
|
@@ -254,7 +246,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
254
246
|
context.debug(`...unified the '${subproofString}' subproof with the '${premiseString}' premise.`);
|
|
255
247
|
}
|
|
256
248
|
|
|
257
|
-
continuation(subproofUnifies);
|
|
249
|
+
return continuation(subproofUnifies);
|
|
258
250
|
});
|
|
259
251
|
}, context);
|
|
260
252
|
}
|
|
@@ -273,7 +265,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
273
265
|
reconcile((specificContext) => {
|
|
274
266
|
const statement = proofAssertion.getStatement();
|
|
275
267
|
|
|
276
|
-
this.unifyStatement(statement, generalContext, specificContext, (statementUnifies) => {
|
|
268
|
+
return this.unifyStatement(statement, generalContext, specificContext, (statementUnifies) => {
|
|
277
269
|
let proofAssertionUnifies = false;
|
|
278
270
|
|
|
279
271
|
if (statementUnifies) {
|
|
@@ -286,7 +278,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
286
278
|
context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${premiseString}' premise.`);
|
|
287
279
|
}
|
|
288
280
|
|
|
289
|
-
continuation(proofAssertionUnifies);
|
|
281
|
+
return continuation(proofAssertionUnifies);
|
|
290
282
|
});
|
|
291
283
|
}, specificContext);
|
|
292
284
|
}
|
|
@@ -143,7 +143,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
143
143
|
const unify = this.unify.bind(this),
|
|
144
144
|
validate = this.validate.bind(this);
|
|
145
145
|
|
|
146
|
-
all([
|
|
146
|
+
return all([
|
|
147
147
|
validate,
|
|
148
148
|
unify
|
|
149
149
|
], context, (verifies) => {
|
|
@@ -151,7 +151,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
151
151
|
context.debug(`...verified the '${stepString}' step.`);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
continuation(verifies);
|
|
154
|
+
return continuation(verifies);
|
|
155
155
|
});
|
|
156
156
|
}, context);
|
|
157
157
|
});
|
|
@@ -166,7 +166,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
166
166
|
validateReference = this.validateReference.bind(this),
|
|
167
167
|
validateSignatureAssertion = this.validateSignatureAssertion.bind(this);
|
|
168
168
|
|
|
169
|
-
all([
|
|
169
|
+
return all([
|
|
170
170
|
validateStatement,
|
|
171
171
|
validateReference,
|
|
172
172
|
validateSignatureAssertion
|
|
@@ -179,7 +179,7 @@ export default define(class Step extends ProofAssertion {
|
|
|
179
179
|
context.debug(`...validated the '${stepString}' step.`);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
continuation(validates);
|
|
182
|
+
return continuation(validates);
|
|
183
183
|
});
|
|
184
184
|
}, context);
|
|
185
185
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { breakPointUtilities
|
|
3
|
+
import { breakPointUtilities } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import ProofAssertion from "../proofAssertion";
|
|
6
6
|
|
|
@@ -75,13 +75,11 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
75
75
|
|
|
76
76
|
context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense.`);
|
|
77
77
|
|
|
78
|
-
continuation(verifies);
|
|
79
|
-
|
|
80
|
-
return;
|
|
78
|
+
return continuation(verifies);
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
declare((context) => {
|
|
84
|
-
this.validate(context, (validates) => {
|
|
82
|
+
return this.validate(context, (validates) => {
|
|
85
83
|
let verifies = false;
|
|
86
84
|
|
|
87
85
|
if (validates) {
|
|
@@ -92,7 +90,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
92
90
|
context.debug(`...verified the '${suppositionString}' supposition.`);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
continuation(verifies);
|
|
93
|
+
return continuation(verifies);
|
|
96
94
|
});
|
|
97
95
|
}, context);
|
|
98
96
|
});
|
|
@@ -106,7 +104,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
106
104
|
const validateStatement = this.validateStatement.bind(this),
|
|
107
105
|
validateProcedureCall = this.validateProcedureCall.bind(this);
|
|
108
106
|
|
|
109
|
-
exists([
|
|
107
|
+
return exists([
|
|
110
108
|
validateStatement,
|
|
111
109
|
validateProcedureCall
|
|
112
110
|
], context, (validates) => {
|
|
@@ -118,7 +116,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
118
116
|
context.debug(`...validated the '${suppositionString}' supposition.`);
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
continuation(validates);
|
|
119
|
+
return continuation(validates);
|
|
122
120
|
});
|
|
123
121
|
}, context);
|
|
124
122
|
}
|
|
@@ -129,16 +127,14 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
129
127
|
if (statement === null) {
|
|
130
128
|
const statementValidates = false;
|
|
131
129
|
|
|
132
|
-
continuation(statementValidates);
|
|
133
|
-
|
|
134
|
-
return;
|
|
130
|
+
return continuation(statementValidates);
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
const suppositionString = this.getString();
|
|
138
134
|
|
|
139
135
|
context.trace(`Validating the '${suppositionString}' supposition's statsement...`);
|
|
140
136
|
|
|
141
|
-
statement.validate(context, (statement) => {
|
|
137
|
+
return statement.validate(context, (statement) => {
|
|
142
138
|
let statementValidates = false;
|
|
143
139
|
|
|
144
140
|
if (statement !== null) {
|
|
@@ -149,7 +145,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
149
145
|
context.debug(`...validated the '${suppositionString}' supposition's statement.`);
|
|
150
146
|
}
|
|
151
147
|
|
|
152
|
-
continuation(statementValidates);
|
|
148
|
+
return continuation(statementValidates);
|
|
153
149
|
});
|
|
154
150
|
}
|
|
155
151
|
|
|
@@ -159,27 +155,23 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
159
155
|
if (procedureCall === null) {
|
|
160
156
|
const procedureCallValidates = false;
|
|
161
157
|
|
|
162
|
-
continuation(procedureCallValidates);
|
|
163
|
-
|
|
164
|
-
return;
|
|
158
|
+
return continuation(procedureCallValidates);
|
|
165
159
|
}
|
|
166
160
|
|
|
167
161
|
const suppositionString = this.getString();
|
|
168
162
|
|
|
169
163
|
context.trace(`Validatting the '${suppositionString}' supposition's procedure call...`);
|
|
170
164
|
|
|
171
|
-
|
|
165
|
+
procedureCall.validate(context, (procedureCallValidates) => {
|
|
172
166
|
if (procedureCallValidates) {
|
|
173
167
|
context.debug(`...validated the '${suppositionString}' supposition's procedure call.`);
|
|
174
168
|
}
|
|
175
169
|
|
|
176
|
-
continuation(procedureCallValidates);
|
|
170
|
+
return continuation(procedureCallValidates);
|
|
177
171
|
});
|
|
178
172
|
}
|
|
179
173
|
|
|
180
|
-
unifyIndependently(context) {
|
|
181
|
-
let unifiesIndependently = false;
|
|
182
|
-
|
|
174
|
+
unifyIndependently(context, continuation) {
|
|
183
175
|
const suppositionString = this.getString(); ///
|
|
184
176
|
|
|
185
177
|
context.trace(`Unifying the '${suppositionString}' supposition independently...`);
|
|
@@ -191,28 +183,39 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
191
183
|
if (statement !== null) {
|
|
192
184
|
const suppositionContext = this.getContext(), ///
|
|
193
185
|
generalContext = suppositionContext, ///
|
|
194
|
-
specificContext = context
|
|
195
|
-
statementUnifiesIndependently = statement.unifyIndependently(generalContext, specificContext);
|
|
186
|
+
specificContext = context; ///
|
|
196
187
|
|
|
197
|
-
|
|
198
|
-
unifiesIndependently =
|
|
199
|
-
|
|
188
|
+
return statement.unifyIndependently(generalContext, specificContext, (statementUnifiesIndependently) => {
|
|
189
|
+
let unifiesIndependently = false;
|
|
190
|
+
|
|
191
|
+
if (statementUnifiesIndependently) {
|
|
192
|
+
unifiesIndependently = true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (unifiesIndependently) {
|
|
196
|
+
context.debug(`...unified the '${suppositionString}' supposition independently.`);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return continuation(unifiesIndependently);
|
|
200
|
+
});
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
if (procedureCall !== null) {
|
|
203
|
-
|
|
204
|
+
return procedureCall.unifyIndependently(context, (procedureCallResolvedIndependently) => {
|
|
205
|
+
let unifiesIndependently = false;
|
|
204
206
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
}, context);
|
|
207
|
+
if (procedureCallResolvedIndependently) {
|
|
208
|
+
unifiesIndependently = true;
|
|
209
|
+
}
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
if (unifiesIndependently) {
|
|
212
|
+
context.debug(`...unified the '${suppositionString}' supposition independently.`);
|
|
213
|
+
}
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
return continuation(unifiesIndependently);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}, context);
|
|
216
219
|
}
|
|
217
220
|
|
|
218
221
|
unifySubproof(subproof, context, continuation) {
|
|
@@ -226,9 +229,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
226
229
|
if (subproofAssertion === null) {
|
|
227
230
|
const subproofUnifies = false;
|
|
228
231
|
|
|
229
|
-
continuation(subproofUnifies);
|
|
230
|
-
|
|
231
|
-
return;
|
|
232
|
+
return continuation(subproofUnifies);
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
const suppositionContext = this.getContext(), ///
|
|
@@ -236,7 +237,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
236
237
|
specificContext = context; ///
|
|
237
238
|
|
|
238
239
|
reconcile((context) => {
|
|
239
|
-
subproofAssertion.unifySubproof(subproof, generalContext, specificContext, (subproofUnifies) => {
|
|
240
|
+
return subproofAssertion.unifySubproof(subproof, generalContext, specificContext, (subproofUnifies) => {
|
|
240
241
|
if (subproofUnifies) {
|
|
241
242
|
context.commit();
|
|
242
243
|
}
|
|
@@ -245,7 +246,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
245
246
|
context.debug(`...unified the '${subproofString}' subproof with the '${suppositionString}' supposition.`);
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
continuation(subproofUnifies);
|
|
249
|
+
return continuation(subproofUnifies);
|
|
249
250
|
});
|
|
250
251
|
}, context);
|
|
251
252
|
}
|
|
@@ -264,7 +265,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
264
265
|
reconcile((specificContext) => {
|
|
265
266
|
const statement = proofAssertion.getStatement();
|
|
266
267
|
|
|
267
|
-
this.unifyStatement(statement, generalContext, specificContext, (statementUnifies) => {
|
|
268
|
+
return this.unifyStatement(statement, generalContext, specificContext, (statementUnifies) => {
|
|
268
269
|
let proofAssertionUnifies = false;
|
|
269
270
|
|
|
270
271
|
if (statementUnifies) {
|
|
@@ -277,7 +278,7 @@ export default define(class Supposition extends ProofAssertion {
|
|
|
277
278
|
context.debug(`...unified the '${proofAssertionString}' proof assertion with the '${suppositionString}' supposition.`);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
continuation(proofAssertionUnifies);
|
|
281
|
+
return continuation(proofAssertionUnifies);
|
|
281
282
|
});
|
|
282
283
|
}, specificContext);
|
|
283
284
|
}
|