occam-verify-cli 1.0.852 → 1.0.857
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/file/nominal.js +18 -3
- package/lib/context/liminal.js +101 -102
- package/lib/context/mnemic.js +511 -0
- package/lib/context.js +23 -11
- package/lib/element/assertion/contained.js +8 -8
- package/lib/element/assertion/defined.js +6 -6
- package/lib/element/assertion/satisfies.js +4 -4
- package/lib/element/assertion/type.js +5 -4
- package/lib/element/assumption/metaLevel.js +7 -7
- package/lib/element/assumption.js +23 -15
- package/lib/element/combinator.js +4 -4
- package/lib/element/conclusion.js +4 -4
- package/lib/element/constructor.js +4 -4
- package/lib/element/declaration/combinator.js +4 -4
- package/lib/element/declaration/complexType.js +3 -3
- package/lib/element/declaration/constructor.js +6 -4
- package/lib/element/declaration/metavariable.js +7 -7
- package/lib/element/declaration/variable.js +6 -4
- package/lib/element/deduction.js +4 -4
- package/lib/element/frame.js +60 -48
- package/lib/element/judgement.js +16 -29
- package/lib/element/label.js +4 -4
- package/lib/element/metavariable.js +59 -58
- package/lib/element/proofAssertion/premise.js +4 -4
- package/lib/element/reference.js +20 -20
- package/lib/element/rule.js +4 -4
- package/lib/element/substitution/frame.js +9 -8
- package/lib/element/substitution/reference.js +7 -7
- package/lib/element/substitution/statement.js +12 -11
- package/lib/element/substitution/term.js +9 -8
- package/lib/element/topLevelAssertion.js +4 -4
- package/lib/element/topLevelMetaAssertion.js +2 -2
- package/lib/element/variable.js +8 -8
- package/lib/utilities/context.js +6 -6
- package/lib/utilities/element.js +3 -3
- package/lib/utilities/json.js +16 -16
- package/lib/utilities/string.js +7 -29
- package/lib/utilities/substitutions.js +6 -6
- package/package.json +1 -1
- package/src/context/file/nominal.js +24 -2
- package/src/context/liminal.js +116 -117
- package/src/context/{ephemeral.js → mnemic.js} +38 -40
- package/src/context.js +32 -12
- package/src/element/assertion/contained.js +7 -7
- package/src/element/assertion/defined.js +5 -5
- package/src/element/assertion/satisfies.js +3 -4
- package/src/element/assertion/type.js +5 -4
- package/src/element/assumption/metaLevel.js +6 -8
- package/src/element/assumption.js +28 -17
- package/src/element/combinator.js +3 -4
- package/src/element/conclusion.js +3 -4
- package/src/element/constructor.js +3 -4
- package/src/element/declaration/combinator.js +3 -4
- package/src/element/declaration/complexType.js +2 -2
- package/src/element/declaration/constructor.js +7 -4
- package/src/element/declaration/metavariable.js +6 -8
- package/src/element/declaration/variable.js +7 -4
- package/src/element/deduction.js +3 -4
- package/src/element/frame.js +81 -64
- package/src/element/judgement.js +21 -43
- package/src/element/label.js +3 -4
- package/src/element/metavariable.js +66 -73
- package/src/element/proofAssertion/premise.js +3 -4
- package/src/element/reference.js +21 -25
- package/src/element/rule.js +3 -3
- package/src/element/substitution/frame.js +7 -7
- package/src/element/substitution/reference.js +4 -6
- package/src/element/substitution/statement.js +9 -10
- package/src/element/substitution/term.js +7 -7
- package/src/element/topLevelAssertion.js +3 -3
- package/src/element/topLevelMetaAssertion.js +2 -2
- package/src/element/variable.js +7 -8
- package/src/utilities/context.js +9 -9
- package/src/utilities/element.js +3 -3
- package/src/utilities/json.js +9 -9
- package/src/utilities/string.js +11 -40
- package/src/utilities/substitutions.js +3 -3
- package/lib/context/ephemeral.js +0 -513
|
@@ -148,10 +148,9 @@ export default define(class Metavariable extends Element {
|
|
|
148
148
|
let typeVerifies = true; ///
|
|
149
149
|
|
|
150
150
|
if (this.type !== null) {
|
|
151
|
-
const
|
|
152
|
-
metavariableString = this.getString();
|
|
151
|
+
const metavariableString = this.getString();
|
|
153
152
|
|
|
154
|
-
context.trace(`Verifying the '${metavariableString}' metavariable's
|
|
153
|
+
context.trace(`Verifying the '${metavariableString}' metavariable's type...`);
|
|
155
154
|
|
|
156
155
|
const typeName = this.type.getName(),
|
|
157
156
|
type = context.findTypeByTypeName(typeName);
|
|
@@ -163,7 +162,7 @@ export default define(class Metavariable extends Element {
|
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
if (typeVerifies) {
|
|
166
|
-
context.debug(`...verifieds the '${metavariableString}' metavariable's
|
|
165
|
+
context.debug(`...verifieds the '${metavariableString}' metavariable's type.`);
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
168
|
|
|
@@ -193,15 +192,15 @@ export default define(class Metavariable extends Element {
|
|
|
193
192
|
} else {
|
|
194
193
|
let validates = false;
|
|
195
194
|
|
|
196
|
-
const
|
|
195
|
+
const nameValidates = this.validateName(strict, context);
|
|
197
196
|
|
|
198
|
-
if (
|
|
197
|
+
if (nameValidates) {
|
|
199
198
|
const termValidates = this.validateTerm(strict, context);
|
|
200
199
|
|
|
201
200
|
if (termValidates) {
|
|
202
|
-
const
|
|
201
|
+
const typeValidates = this.validateType(strict, context);
|
|
203
202
|
|
|
204
|
-
if (
|
|
203
|
+
if (typeValidates) {
|
|
205
204
|
validates = true;
|
|
206
205
|
}
|
|
207
206
|
}
|
|
@@ -223,38 +222,45 @@ export default define(class Metavariable extends Element {
|
|
|
223
222
|
return metavariable;
|
|
224
223
|
}
|
|
225
224
|
|
|
226
|
-
|
|
227
|
-
let
|
|
225
|
+
validateName(strict, context) {
|
|
226
|
+
let nameValidates = true; ///
|
|
228
227
|
|
|
229
228
|
const metavariableString = this.getString(); ///
|
|
230
229
|
|
|
231
|
-
context.trace(`Validating
|
|
230
|
+
context.trace(`Validating the '${metavariableString}' metavariable's name...`);
|
|
232
231
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
} else {
|
|
236
|
-
const typeString = this.type.getString();
|
|
232
|
+
const metavariableName = this.getMetavariableName(), ///
|
|
233
|
+
declaredMetavariable = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
237
234
|
|
|
238
|
-
|
|
235
|
+
if (declaredMetavariable !== null) {
|
|
236
|
+
const metaType = declaredMetavariable.getMetaType(),
|
|
237
|
+
metaTypeString = metaType.getString();
|
|
238
|
+
|
|
239
|
+
this.metaType = metaType;
|
|
240
|
+
|
|
241
|
+
context.trace(`Setting the '${metavariableString}' metavariable's meta-type to the '${metaTypeString}' meta-type.`);
|
|
242
|
+
} else {
|
|
243
|
+
if (strict) {
|
|
244
|
+
nameValidates = false;
|
|
245
|
+
}
|
|
239
246
|
}
|
|
240
247
|
|
|
241
|
-
if (
|
|
242
|
-
context.
|
|
248
|
+
if (nameValidates) {
|
|
249
|
+
context.debug(`...validated the '${metavariableString}' metavariable's name.`);
|
|
243
250
|
}
|
|
244
251
|
|
|
245
|
-
return
|
|
252
|
+
return nameValidates;
|
|
246
253
|
}
|
|
247
254
|
|
|
248
255
|
validateTerm(strict, context) {
|
|
249
|
-
let termValidates =
|
|
256
|
+
let termValidates = false;
|
|
250
257
|
|
|
251
|
-
if (this.term
|
|
252
|
-
termValidates =
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
metavariableString = this.getString();
|
|
258
|
+
if (this.term === null) {
|
|
259
|
+
termValidates = true;
|
|
260
|
+
} else {
|
|
261
|
+
const metavariableString = this.getString();
|
|
256
262
|
|
|
257
|
-
context.trace(`Validating the '${metavariableString}' metavariable's
|
|
263
|
+
context.trace(`Validating the '${metavariableString}' metavariable's term...`);
|
|
258
264
|
|
|
259
265
|
const metavariableName = this.getMetavariableName(),
|
|
260
266
|
declaredMetavaraible = context.findDeclaredMetavariableByMetavariableName(metavariableName);
|
|
@@ -284,41 +290,35 @@ export default define(class Metavariable extends Element {
|
|
|
284
290
|
}
|
|
285
291
|
|
|
286
292
|
if (termValidates) {
|
|
287
|
-
context.debug(`...validated the '${metavariableString}' metavariable's
|
|
293
|
+
context.debug(`...validated the '${metavariableString}' metavariable's term.`);
|
|
288
294
|
}
|
|
289
295
|
}
|
|
290
296
|
|
|
291
297
|
return termValidates;
|
|
292
298
|
}
|
|
293
299
|
|
|
294
|
-
|
|
295
|
-
let
|
|
300
|
+
validateType(strict, context) {
|
|
301
|
+
let typeValidates;
|
|
296
302
|
|
|
297
|
-
|
|
298
|
-
|
|
303
|
+
if (this.type === null) {
|
|
304
|
+
typeValidates = true;
|
|
305
|
+
} else {
|
|
306
|
+
const metavariableString = this.getString(); ///
|
|
299
307
|
|
|
300
|
-
|
|
308
|
+
context.trace(`Validating the '${metavariableString}' metavariable's type...`);
|
|
301
309
|
|
|
302
|
-
|
|
310
|
+
typeValidates = false;
|
|
303
311
|
|
|
304
|
-
|
|
305
|
-
const metaType = declaredMetavariable.getMetaType(),
|
|
306
|
-
metaTypeString = metaType.getString();
|
|
312
|
+
const typeString = this.type.getString();
|
|
307
313
|
|
|
308
|
-
|
|
314
|
+
context.trace(`A '${typeString}' type is present in the '${metavariableString}' metavariable.`);
|
|
309
315
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (strict) {
|
|
313
|
-
nameValidates = false;
|
|
316
|
+
if (typeValidates) {
|
|
317
|
+
context.trace(`...validated the '${metavariableString}' metavariable's type.`);
|
|
314
318
|
}
|
|
315
319
|
}
|
|
316
320
|
|
|
317
|
-
|
|
318
|
-
context.debug(`...validated the '${metavariableString}' metavariable's '${metavariableName}' name.`);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return nameValidates;
|
|
321
|
+
return typeValidates;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
unifyFrame(frame, generalContext, specificContext) {
|
|
@@ -337,16 +337,15 @@ export default define(class Metavariable extends Element {
|
|
|
337
337
|
frameUnifies = true;
|
|
338
338
|
} else {
|
|
339
339
|
const metavariableNode = metavariable.getNode(),
|
|
340
|
-
|
|
340
|
+
derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
341
341
|
|
|
342
|
-
if (
|
|
343
|
-
const
|
|
342
|
+
if (derivedSubstitution !== null) {
|
|
343
|
+
const derivedSubstitutionFrameComparesToFrame = derivedSubstitution.compareFrame(frame, context);
|
|
344
344
|
|
|
345
|
-
if (
|
|
346
|
-
const
|
|
347
|
-
frameSubstitutionString = frameSubstitution.getString();
|
|
345
|
+
if (derivedSubstitutionFrameComparesToFrame) {
|
|
346
|
+
const derivedSubstitutionString = derivedSubstitution.getString();
|
|
348
347
|
|
|
349
|
-
context.trace(`The '${
|
|
348
|
+
context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
|
|
350
349
|
|
|
351
350
|
frameUnifies = true;
|
|
352
351
|
}
|
|
@@ -386,22 +385,17 @@ export default define(class Metavariable extends Element {
|
|
|
386
385
|
statementUnifies = true;
|
|
387
386
|
} else {
|
|
388
387
|
const metavariableNode = metavariable.getNode(),
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
if (substitutionPresent) {
|
|
394
|
-
substitution = (substitution !== null) ?
|
|
395
|
-
context.findSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
|
|
396
|
-
context.findSubstitutionByMetavariableNode(metavariableNode);
|
|
388
|
+
derivedSubstitution = (substitution !== null) ?
|
|
389
|
+
context.findDerivedSubstitutionByMetavariableNodeAndSubstitution(metavariableNode, substitution) :
|
|
390
|
+
context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
397
391
|
|
|
398
|
-
|
|
392
|
+
if (derivedSubstitution !== null) {
|
|
393
|
+
const derivedSubstitutionComparesToStatement = derivedSubstitution.compareStatement(statement, context);
|
|
399
394
|
|
|
400
|
-
if (
|
|
401
|
-
const
|
|
402
|
-
statementSubstitutionString = statementSubstitution.getString();
|
|
395
|
+
if (derivedSubstitutionComparesToStatement) {
|
|
396
|
+
const derivedSubstitutionString = derivedSubstitution.getString();
|
|
403
397
|
|
|
404
|
-
context.trace(`The '${
|
|
398
|
+
context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
|
|
405
399
|
|
|
406
400
|
statementUnifies = true;
|
|
407
401
|
}
|
|
@@ -440,16 +434,15 @@ export default define(class Metavariable extends Element {
|
|
|
440
434
|
referenceUnifies = true;
|
|
441
435
|
} else {
|
|
442
436
|
const metavariableNode = metavariable.getNode(),
|
|
443
|
-
|
|
437
|
+
derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
444
438
|
|
|
445
|
-
if (
|
|
446
|
-
const
|
|
439
|
+
if (derivedSubstitution !== null) {
|
|
440
|
+
const derivedSubstitutionReferenceComparesToReference = derivedSubstitution.compareReference(reference, context);
|
|
447
441
|
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
referenceSubstitutionString = referenceSubstitution.getString();
|
|
442
|
+
if (derivedSubstitutionReferenceComparesToReference) {
|
|
443
|
+
const derivedSubstitutionString = derivedSubstitution.getString();
|
|
451
444
|
|
|
452
|
-
context.trace(`The '${
|
|
445
|
+
context.trace(`The '${derivedSubstitutionString}' derived substitution is already present.`);
|
|
453
446
|
|
|
454
447
|
referenceUnifies = true;
|
|
455
448
|
}
|
|
@@ -118,10 +118,9 @@ export default define(class Premise extends ProofAssertion {
|
|
|
118
118
|
validateProcedureCall(context) {
|
|
119
119
|
let procedureCallValidates = false;
|
|
120
120
|
|
|
121
|
-
const premiseString = this.getString()
|
|
122
|
-
procedureCallString = this.procedureCall.getString();
|
|
121
|
+
const premiseString = this.getString(); ///
|
|
123
122
|
|
|
124
|
-
context.trace(`Validatting the '${premiseString}' premise's
|
|
123
|
+
context.trace(`Validatting the '${premiseString}' premise's procedure call...`);
|
|
125
124
|
|
|
126
125
|
const procedureCall = this.procedureCall.validate(context);
|
|
127
126
|
|
|
@@ -130,7 +129,7 @@ export default define(class Premise extends ProofAssertion {
|
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
if (procedureCallValidates) {
|
|
133
|
-
context.debug(`...validated the '${premiseString}' premise's
|
|
132
|
+
context.debug(`...validated the '${premiseString}' premise's procedure call.`);
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
return procedureCallValidates;
|
package/src/element/reference.js
CHANGED
|
@@ -6,8 +6,8 @@ import { define } from "../elements";
|
|
|
6
6
|
import { instantiateReference } from "../process/instantiate";
|
|
7
7
|
import { REFERENCE_META_TYPE_NAME } from "../metaTypeNames";
|
|
8
8
|
import { referenceFromReferenceNode } from "../utilities/element";
|
|
9
|
-
import { ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
|
|
10
9
|
import { metavariableFromReferenceNode, topLevelMetaAssertionFromReferenceNode } from "../utilities/element";
|
|
10
|
+
import { join, ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
|
|
11
11
|
|
|
12
12
|
export default define(class Reference extends Element {
|
|
13
13
|
constructor(context, string, node, lineIndex, metavariable, topLevelMetaAssertion) {
|
|
@@ -106,7 +106,7 @@ export default define(class Reference extends Element {
|
|
|
106
106
|
context.trace(`Comparing the '${topLevelMetaAssertionString}' top level meta-assertion to the '${referenceString}' reference...`);
|
|
107
107
|
|
|
108
108
|
const label = topLevelMetaAssertion.getLabel(),
|
|
109
|
-
labelUnifies = this.unifyLabel(label);
|
|
109
|
+
labelUnifies = this.unifyLabel(label, context);
|
|
110
110
|
|
|
111
111
|
if (labelUnifies) {
|
|
112
112
|
topLevelMetaAssertionCompares = true;
|
|
@@ -155,7 +155,7 @@ export default define(class Reference extends Element {
|
|
|
155
155
|
|
|
156
156
|
if (metaType === null) {
|
|
157
157
|
const reference = this, ///
|
|
158
|
-
labelPresent = context.isLabelPresentByReference(reference);
|
|
158
|
+
labelPresent = context.isLabelPresentByReference(reference, context);
|
|
159
159
|
|
|
160
160
|
if (labelPresent) {
|
|
161
161
|
validates = true;
|
|
@@ -197,10 +197,9 @@ export default define(class Reference extends Element {
|
|
|
197
197
|
validateMetavariable(context) {
|
|
198
198
|
let metavariableValidates = false;
|
|
199
199
|
|
|
200
|
-
const referenceString = this.getString()
|
|
201
|
-
metavariableString = this.metavariable.getString();
|
|
200
|
+
const referenceString = this.getString(); ///
|
|
202
201
|
|
|
203
|
-
context.trace(`Validating the '${referenceString}' reference's
|
|
202
|
+
context.trace(`Validating the '${referenceString}' reference's metavariable...'`);
|
|
204
203
|
|
|
205
204
|
const metavariable = this.metavariable.validate(context);
|
|
206
205
|
|
|
@@ -211,30 +210,25 @@ export default define(class Reference extends Element {
|
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
if (metavariableValidates) {
|
|
214
|
-
context.debug(`...validated the '${referenceString}' reference's
|
|
213
|
+
context.debug(`...validated the '${referenceString}' reference's metavariable.'`);
|
|
215
214
|
}
|
|
216
215
|
|
|
217
216
|
return metavariableValidates;
|
|
218
217
|
}
|
|
219
218
|
|
|
220
|
-
unifyLabel(label) {
|
|
219
|
+
unifyLabel(label, context) {
|
|
221
220
|
let labelUnifies = false;
|
|
222
221
|
|
|
223
|
-
let context;
|
|
224
|
-
|
|
225
222
|
const labelString = label.getString(),
|
|
226
|
-
labelContext = label.getContext(),
|
|
227
223
|
referenceString = this.getString(); ///
|
|
228
224
|
|
|
229
|
-
context = labelContext; ///
|
|
230
|
-
|
|
231
225
|
context.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
|
|
232
226
|
|
|
233
|
-
const
|
|
227
|
+
const generalContext = context; ///
|
|
234
228
|
|
|
235
|
-
context =
|
|
229
|
+
context = label.getContext();
|
|
236
230
|
|
|
237
|
-
const
|
|
231
|
+
const specificContext = context; ///
|
|
238
232
|
|
|
239
233
|
reconcile((specificContext) => {
|
|
240
234
|
const metavariable = label.getMetavariable(),
|
|
@@ -293,18 +287,20 @@ export default define(class Reference extends Element {
|
|
|
293
287
|
|
|
294
288
|
context = temporaryContext; ///
|
|
295
289
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
290
|
+
join((specificContext) => {
|
|
291
|
+
reconcile((specificContext) => {
|
|
292
|
+
const metavariable = label.getMetavariable(),
|
|
293
|
+
metavariableUnifies = this.unifyMetavariable(metavariable, generalContext, specificContext);
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
if (metavariableUnifies) {
|
|
296
|
+
this.topLevelMetaAssertion = topLevelMetaAssertion;
|
|
302
297
|
|
|
303
|
-
|
|
298
|
+
specificContext.commit(context);
|
|
304
299
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
300
|
+
topLevelMetaAssertionUUnifies = true;
|
|
301
|
+
}
|
|
302
|
+
}, specificContext);
|
|
303
|
+
}, specificContext, context);
|
|
308
304
|
|
|
309
305
|
if (topLevelMetaAssertionUUnifies) {
|
|
310
306
|
context.debug(`...unified the '${topLevelMetaAssertionString}' top level meta-assertion with the '${referenceString}' reference.`);
|
package/src/element/rule.js
CHANGED
|
@@ -253,9 +253,9 @@ export default define(class Rule extends Element {
|
|
|
253
253
|
const subproofOrProofAssertionsUnifiesWithPremises = await this.unifySubproofOrProofAssertionsWithPremises(subproofOrProofAssertions, context);
|
|
254
254
|
|
|
255
255
|
if (subproofOrProofAssertionsUnifiesWithPremises) {
|
|
256
|
-
const
|
|
256
|
+
const derivedSubstitutionsResolved = context.areDerivedSubstitutionsResolved();
|
|
257
257
|
|
|
258
|
-
if (
|
|
258
|
+
if (derivedSubstitutionsResolved) {
|
|
259
259
|
stepAndSubproofOrProofAssertionsUnify = true;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -274,7 +274,7 @@ export default define(class Rule extends Element {
|
|
|
274
274
|
const subproofOrProofAssertionUnifies = await premise.unifySubproofOrProofAssertion(subproofOrProofAssertion, context);
|
|
275
275
|
|
|
276
276
|
if (subproofOrProofAssertionUnifies) {
|
|
277
|
-
context.
|
|
277
|
+
context.resolveDerivedSubstitutions();
|
|
278
278
|
|
|
279
279
|
return true;
|
|
280
280
|
}
|
|
@@ -127,10 +127,9 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
127
127
|
let targetFrameValidates = false;
|
|
128
128
|
|
|
129
129
|
const context = generalContext, ///
|
|
130
|
-
targetFrameString = this.targetFrame.getString(),
|
|
131
130
|
frameSubstitutionString = this.getString(); ///
|
|
132
131
|
|
|
133
|
-
context.trace(`Validating the '${frameSubstitutionString}' frame substitution's
|
|
132
|
+
context.trace(`Validating the '${frameSubstitutionString}' frame substitution's target frame...`);
|
|
134
133
|
|
|
135
134
|
const targetFrameSingular = this.targetFrame.isSingular();
|
|
136
135
|
|
|
@@ -145,11 +144,13 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
145
144
|
}
|
|
146
145
|
}, context);
|
|
147
146
|
} else {
|
|
148
|
-
|
|
147
|
+
const targetFrameString = this.targetFrame.getString();
|
|
148
|
+
|
|
149
|
+
context.debug(`The '${targetFrameString}' target frame is not singular.`);
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
if (targetFrameValidates) {
|
|
152
|
-
context.debug(`...validated the
|
|
153
|
+
context.debug(`...validated the frame substitution's target frame...`);
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
return targetFrameValidates;
|
|
@@ -159,10 +160,9 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
159
160
|
let replacementFrameValidates = false;
|
|
160
161
|
|
|
161
162
|
const context = specificContext, ///
|
|
162
|
-
replacementFrameString = this.replacementFrame.getString(),
|
|
163
163
|
frameSubstitutionString = this.getString(); ///
|
|
164
164
|
|
|
165
|
-
context.trace(`Validating the '${frameSubstitutionString}' frame substitution's
|
|
165
|
+
context.trace(`Validating the '${frameSubstitutionString}' frame substitution's replacement frame...`);
|
|
166
166
|
|
|
167
167
|
descend((context) => {
|
|
168
168
|
const replacementFrame = this.replacementFrame.validate(context);
|
|
@@ -175,7 +175,7 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
175
175
|
}, context);
|
|
176
176
|
|
|
177
177
|
if (replacementFrameValidates) {
|
|
178
|
-
context.debug(`...validated the '${frameSubstitutionString}' frame substitution's
|
|
178
|
+
context.debug(`...validated the '${frameSubstitutionString}' frame substitution's replacement frame.`);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
return replacementFrameValidates;
|
|
@@ -144,10 +144,9 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
144
144
|
let targetReferenceValidates = false;
|
|
145
145
|
|
|
146
146
|
const context = generalContext, ///
|
|
147
|
-
targetReferenceString = this.targetReference.getString(),
|
|
148
147
|
referenceSubstitutionString = this.getString(); ///
|
|
149
148
|
|
|
150
|
-
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's
|
|
149
|
+
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's target reference...`);
|
|
151
150
|
|
|
152
151
|
descend((context) => {
|
|
153
152
|
const targetReference = this.targetReference.validate(context);
|
|
@@ -158,7 +157,7 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
158
157
|
}, context);
|
|
159
158
|
|
|
160
159
|
if (targetReferenceValidates) {
|
|
161
|
-
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's
|
|
160
|
+
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's target reference...`);
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
return targetReferenceValidates;
|
|
@@ -168,10 +167,9 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
168
167
|
let replacementReferenceValidates = false;
|
|
169
168
|
|
|
170
169
|
const context = specificContext, ///
|
|
171
|
-
replacementReferenceString = this.replacementReference.getString(),
|
|
172
170
|
referenceSubstitutionString = this.getString(); ///
|
|
173
171
|
|
|
174
|
-
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's
|
|
172
|
+
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution's replacement reference...`);
|
|
175
173
|
|
|
176
174
|
descend((context) => {
|
|
177
175
|
const replacementReference = this.replacementReference.validate(context);
|
|
@@ -182,7 +180,7 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
182
180
|
}, context);
|
|
183
181
|
|
|
184
182
|
if (replacementReferenceValidates) {
|
|
185
|
-
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's
|
|
183
|
+
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution's replacement reference.`);
|
|
186
184
|
}
|
|
187
185
|
|
|
188
186
|
return replacementReferenceValidates;
|
|
@@ -163,17 +163,16 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
163
163
|
|
|
164
164
|
if (substitution !== null) {
|
|
165
165
|
const context = generalContext, ///
|
|
166
|
-
substitutionString = this.substitution.getString(),
|
|
167
166
|
statementSubstitutionString = this.getString();
|
|
168
167
|
|
|
169
|
-
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's
|
|
168
|
+
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's substitution...`);
|
|
170
169
|
|
|
171
170
|
this.substitution = substitution;
|
|
172
171
|
|
|
173
172
|
substitutionValidates = true;
|
|
174
173
|
|
|
175
174
|
if (substitutionValidates) {
|
|
176
|
-
context.debug(`...validatewd the '${statementSubstitutionString}' statement substitution's
|
|
175
|
+
context.debug(`...validatewd the '${statementSubstitutionString}' statement substitution's substitution.`);
|
|
177
176
|
}
|
|
178
177
|
}
|
|
179
178
|
|
|
@@ -184,10 +183,9 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
184
183
|
let targetStatementValidates = false;
|
|
185
184
|
|
|
186
185
|
const context = generalContext, ///
|
|
187
|
-
targetStatementString = this.targetStatement.getString(),
|
|
188
186
|
statementSubstitutionString = this.getString(); ///
|
|
189
187
|
|
|
190
|
-
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's
|
|
188
|
+
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's target statement...`);
|
|
191
189
|
|
|
192
190
|
const targetStatementSingular = this.targetStatement.isSingular();
|
|
193
191
|
|
|
@@ -200,11 +198,13 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
200
198
|
}
|
|
201
199
|
}, context);
|
|
202
200
|
} else {
|
|
203
|
-
|
|
201
|
+
const targetStatementString = this.targetStatement.getString();
|
|
202
|
+
|
|
203
|
+
context.debug(`The '${targetStatementString}' target statement is not singular.`);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
if (targetStatementValidates) {
|
|
207
|
-
context.debug(`...validated the '${statementSubstitutionString}' statement substitution's
|
|
207
|
+
context.debug(`...validated the '${statementSubstitutionString}' statement substitution's target statement...`);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
return targetStatementValidates;
|
|
@@ -214,10 +214,9 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
214
214
|
let replacementStatementValidates = false;
|
|
215
215
|
|
|
216
216
|
const context = specificContext, ///
|
|
217
|
-
replacementStatementString = this.replacementStatement.getString(),
|
|
218
217
|
statementSubstitutionString = this.getString(); ///
|
|
219
218
|
|
|
220
|
-
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's
|
|
219
|
+
context.trace(`Validating the '${statementSubstitutionString}' statement substitution's replacement statement...`);
|
|
221
220
|
|
|
222
221
|
descend((context) => {
|
|
223
222
|
const replacementStatement = this.replacementStatement.validate(context);
|
|
@@ -228,7 +227,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
228
227
|
}, context);
|
|
229
228
|
|
|
230
229
|
if (replacementStatementValidates) {
|
|
231
|
-
context.debug(`...validated the '${statementSubstitutionString}' statement substitution's
|
|
230
|
+
context.debug(`...validated the '${statementSubstitutionString}' statement substitution's replacement statement.`);
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
return replacementStatementValidates;
|
|
@@ -130,10 +130,9 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
130
130
|
let targetTermValidates = false;
|
|
131
131
|
|
|
132
132
|
const context = generalContext, ///
|
|
133
|
-
targetTermString = this.targetTerm.getString(),
|
|
134
133
|
termSubstitutionString = this.getString(); ///
|
|
135
134
|
|
|
136
|
-
context.trace(`Validating the '${termSubstitutionString}' term substitution's
|
|
135
|
+
context.trace(`Validating the '${termSubstitutionString}' term substitution's target term...`);
|
|
137
136
|
|
|
138
137
|
const targetTermSingular = this.targetTerm.isSingular();
|
|
139
138
|
|
|
@@ -152,11 +151,13 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
152
151
|
}
|
|
153
152
|
}, context);
|
|
154
153
|
} else {
|
|
155
|
-
|
|
154
|
+
const targetTermString = this.targetTerm.getString();
|
|
155
|
+
|
|
156
|
+
context.debug(`The '${targetTermString}' target term is not singular.`);
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
if (targetTermValidates) {
|
|
159
|
-
context.debug(`...validated the '${termSubstitutionString}' term substitution's
|
|
160
|
+
context.debug(`...validated the '${termSubstitutionString}' term substitution's target term...`);
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
return targetTermValidates;
|
|
@@ -166,10 +167,9 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
166
167
|
let replacementTermValidates = false;
|
|
167
168
|
|
|
168
169
|
const context = specificContext, ///
|
|
169
|
-
replacementTermString = this.replacementTerm.getString(),
|
|
170
170
|
termSubstitutionString = this.getString(); ///
|
|
171
171
|
|
|
172
|
-
context.trace(`Validating the '${termSubstitutionString}' term substitution's
|
|
172
|
+
context.trace(`Validating the '${termSubstitutionString}' term substitution's replacement term...`);
|
|
173
173
|
|
|
174
174
|
descend((context) => {
|
|
175
175
|
const replacementTerm = this.replacementTerm.validate(context, (replacementTerm) => {
|
|
@@ -186,7 +186,7 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
186
186
|
}, context);
|
|
187
187
|
|
|
188
188
|
if (replacementTermValidates) {
|
|
189
|
-
context.debug(`...validated the '${termSubstitutionString}' term substitution's
|
|
189
|
+
context.debug(`...validated the '${termSubstitutionString}' term substitution's replacement term...`);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return replacementTermValidates;
|
|
@@ -315,9 +315,9 @@ export default class TopLevelAssertion extends Element {
|
|
|
315
315
|
const subproofOrProofAssertionsUnifiesWithSuppositions = await this.unifySubproofOrProofAssertionsWithSuppositions(subproofOrProofAssertions, context);
|
|
316
316
|
|
|
317
317
|
if (subproofOrProofAssertionsUnifiesWithSuppositions) {
|
|
318
|
-
const
|
|
318
|
+
const derivedSubstitutionsResolved = context.areDerivedSubstitutionsResolved();
|
|
319
319
|
|
|
320
|
-
if (
|
|
320
|
+
if (derivedSubstitutionsResolved) {
|
|
321
321
|
stepAndSubproofOrProofAssertionsUnify = true;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
@@ -337,7 +337,7 @@ export default class TopLevelAssertion extends Element {
|
|
|
337
337
|
const subproofOrProofAssertionUnifies = await supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, context);
|
|
338
338
|
|
|
339
339
|
if (subproofOrProofAssertionUnifies) {
|
|
340
|
-
context.
|
|
340
|
+
context.resolveDerivedSubstitutions();
|
|
341
341
|
|
|
342
342
|
return true;
|
|
343
343
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Element, asynchronousUtilities } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import { enclose } from "../utilities/context";
|
|
6
|
-
import {
|
|
6
|
+
import { topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
|
|
7
7
|
import { labelFromJSON,
|
|
8
8
|
labelToLabelJSON,
|
|
9
9
|
deductionFromJSON,
|
|
@@ -259,7 +259,7 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
259
259
|
metaLevelAssumptions = metaLevelAssumptionsFromJSON(json, context),
|
|
260
260
|
node = null,
|
|
261
261
|
proof = null,
|
|
262
|
-
string =
|
|
262
|
+
string = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
263
263
|
topLevelMetaAssertion = new Class(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
264
264
|
|
|
265
265
|
return topLevelMetaAssertion;
|