occam-verify-cli 1.0.220 → 1.0.224
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/file.js +19 -19
- package/lib/context/local.js +5 -43
- package/lib/context/release.js +11 -11
- package/lib/dom/assertion/contained.js +44 -44
- package/lib/dom/assertion/defined.js +40 -40
- package/lib/dom/assertion/property.js +37 -35
- package/lib/dom/assertion/satisfies.js +26 -25
- package/lib/dom/assertion/subproof.js +16 -16
- package/lib/dom/assertion/type.js +34 -32
- package/lib/dom/axiom.js +52 -52
- package/lib/dom/combinator/bracketed.js +5 -5
- package/lib/dom/combinator.js +6 -6
- package/lib/dom/conclusion.js +10 -10
- package/lib/dom/conjecture.js +5 -5
- package/lib/dom/constructor/bracketed.js +12 -12
- package/lib/dom/constructor.js +9 -9
- package/lib/dom/declaration/combinator.js +11 -11
- package/lib/dom/declaration/complexType.js +133 -63
- package/lib/dom/declaration/constructor.js +17 -17
- package/lib/dom/declaration/metavariable.js +17 -17
- package/lib/dom/declaration/simpleType.js +229 -0
- package/lib/dom/declaration/variable.js +17 -17
- package/lib/dom/declaration.js +54 -52
- package/lib/dom/deduction.js +15 -15
- package/lib/dom/derivation.js +8 -8
- package/lib/dom/equality.js +49 -34
- package/lib/dom/error.js +3 -3
- package/lib/dom/frame.js +38 -38
- package/lib/dom/judgement.js +31 -29
- package/lib/dom/label.js +5 -5
- package/lib/dom/lemma.js +5 -5
- package/lib/dom/metaLemma.js +5 -5
- package/lib/dom/metatheorem.js +5 -5
- package/lib/dom/metavariable.js +55 -55
- package/lib/dom/premise.js +36 -34
- package/lib/dom/procedureCall.js +9 -9
- package/lib/dom/proof.js +6 -6
- package/lib/dom/propertyRelation.js +18 -18
- package/lib/dom/reference.js +28 -28
- package/lib/dom/rule.js +63 -48
- package/lib/dom/signature.js +17 -17
- package/lib/dom/statement.js +36 -36
- package/lib/dom/step.js +32 -35
- package/lib/dom/subDerivation.js +8 -8
- package/lib/dom/subproof.js +27 -30
- package/lib/dom/substitution/statement.js +7 -7
- package/lib/dom/substitution/term.js +2 -16
- package/lib/dom/substitution.js +1 -15
- package/lib/dom/supposition.js +39 -39
- package/lib/dom/term.js +15 -15
- package/lib/dom/theorem.js +5 -5
- package/lib/dom/topLevelAssertion.js +60 -71
- package/lib/dom/topLevelMetaAssertion.js +28 -20
- package/lib/dom/type.js +18 -24
- package/lib/dom/variable.js +16 -16
- package/lib/equivalence.js +54 -33
- package/lib/equivalences.js +57 -101
- package/lib/index.js +2 -2
- package/lib/mixins/statement/verify.js +52 -52
- package/lib/mixins/step/unify.js +79 -61
- package/lib/mixins/term/verify.js +17 -17
- package/lib/substitutions.js +7 -7
- package/lib/unifier/equantional.js +170 -0
- package/lib/unifier/intrinsicLevel.js +8 -8
- package/lib/unifier/metaLevel.js +21 -21
- package/lib/unifier/metavariable.js +9 -9
- package/lib/unifier/statementWithCombinator.js +18 -18
- package/lib/unifier/termWithConstructor.js +10 -10
- package/lib/unifier.js +41 -41
- package/lib/utilities/brackets.js +2 -2
- package/lib/utilities/release.js +18 -17
- package/lib/utilities/subproof.js +2 -2
- package/lib/utilities/type.js +2 -2
- package/lib/utilities/unification.js +28 -34
- package/lib/verifier/combinator.js +14 -14
- package/lib/verifier/constructor.js +18 -18
- package/lib/verifier/topLevel.js +38 -38
- package/lib/verifier.js +30 -30
- package/package.json +1 -1
- package/src/context/file.js +18 -18
- package/src/context/local.js +5 -48
- package/src/context/release.js +11 -11
- package/src/dom/assertion/contained.js +46 -46
- package/src/dom/assertion/defined.js +41 -41
- package/src/dom/assertion/property.js +37 -35
- package/src/dom/assertion/satisfies.js +26 -25
- package/src/dom/assertion/subproof.js +15 -15
- package/src/dom/assertion/type.js +34 -32
- package/src/dom/axiom.js +56 -54
- package/src/dom/combinator/bracketed.js +4 -4
- package/src/dom/combinator.js +5 -5
- package/src/dom/conclusion.js +9 -9
- package/src/dom/conjecture.js +4 -4
- package/src/dom/constructor/bracketed.js +11 -11
- package/src/dom/constructor.js +8 -8
- package/src/dom/declaration/combinator.js +10 -10
- package/src/dom/declaration/complexType.js +129 -64
- package/src/dom/declaration/constructor.js +16 -16
- package/src/dom/declaration/metavariable.js +16 -16
- package/src/dom/declaration/simpleType.js +179 -0
- package/src/dom/declaration/variable.js +16 -16
- package/src/dom/declaration.js +54 -52
- package/src/dom/deduction.js +14 -14
- package/src/dom/derivation.js +7 -7
- package/src/dom/equality.js +55 -38
- package/src/dom/error.js +2 -2
- package/src/dom/frame.js +38 -38
- package/src/dom/judgement.js +31 -29
- package/src/dom/label.js +4 -4
- package/src/dom/lemma.js +4 -4
- package/src/dom/metaLemma.js +4 -4
- package/src/dom/metatheorem.js +4 -4
- package/src/dom/metavariable.js +54 -54
- package/src/dom/premise.js +35 -33
- package/src/dom/procedureCall.js +8 -8
- package/src/dom/proof.js +5 -5
- package/src/dom/propertyRelation.js +17 -17
- package/src/dom/reference.js +27 -27
- package/src/dom/rule.js +72 -49
- package/src/dom/signature.js +15 -15
- package/src/dom/statement.js +34 -34
- package/src/dom/step.js +42 -48
- package/src/dom/subDerivation.js +7 -7
- package/src/dom/subproof.js +30 -40
- package/src/dom/substitution/statement.js +6 -6
- package/src/dom/substitution/term.js +1 -19
- package/src/dom/substitution.js +0 -13
- package/src/dom/supposition.js +38 -38
- package/src/dom/term.js +14 -14
- package/src/dom/theorem.js +4 -4
- package/src/dom/topLevelAssertion.js +62 -81
- package/src/dom/topLevelMetaAssertion.js +35 -20
- package/src/dom/type.js +23 -33
- package/src/dom/variable.js +16 -15
- package/src/equivalence.js +69 -46
- package/src/equivalences.js +53 -115
- package/src/index.js +1 -1
- package/src/mixins/statement/verify.js +51 -51
- package/src/mixins/step/unify.js +88 -67
- package/src/mixins/term/verify.js +16 -16
- package/src/substitutions.js +5 -6
- package/src/unifier/equantional.js +90 -0
- package/src/unifier/intrinsicLevel.js +7 -7
- package/src/unifier/metaLevel.js +20 -21
- package/src/unifier/metavariable.js +8 -8
- package/src/unifier/statementWithCombinator.js +17 -17
- package/src/unifier/termWithConstructor.js +9 -9
- package/src/unifier.js +40 -40
- package/src/utilities/brackets.js +1 -1
- package/src/utilities/release.js +18 -18
- package/src/utilities/subproof.js +1 -1
- package/src/utilities/type.js +1 -1
- package/src/utilities/unification.js +27 -37
- package/src/verifier/combinator.js +13 -13
- package/src/verifier/constructor.js +17 -17
- package/src/verifier/topLevel.js +41 -41
- package/src/verifier.js +29 -29
- package/lib/dom/declaration/type.js +0 -209
- package/lib/unifier/equality.js +0 -155
- package/src/dom/declaration/type.js +0 -150
- package/src/unifier/equality.js +0 -70
package/src/dom/metavariable.js
CHANGED
|
@@ -113,7 +113,7 @@ export default domAssigned(class Metavariable {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
verify(context) {
|
|
116
|
-
let
|
|
116
|
+
let verifies;
|
|
117
117
|
|
|
118
118
|
const metavariableString = this.string; ///
|
|
119
119
|
|
|
@@ -124,17 +124,17 @@ export default domAssigned(class Metavariable {
|
|
|
124
124
|
specificContext = context, ///
|
|
125
125
|
metavariablePresent = generalContext.isMetavariablePresent(metavariable, generalContext, specificContext);
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
verifies = metavariablePresent; ///
|
|
128
128
|
|
|
129
|
-
if (
|
|
129
|
+
if (verifies) {
|
|
130
130
|
context.debug(`...verified the '${metavariableString}' metavariable.`);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
return
|
|
133
|
+
return verifies;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
verifyGivenMetaType(metaType, context) {
|
|
137
|
-
let
|
|
137
|
+
let verifiesGivenMetaType = false;
|
|
138
138
|
|
|
139
139
|
const metavariableString = this.string, ///
|
|
140
140
|
metaTypeString = metaType.getString();
|
|
@@ -151,28 +151,28 @@ export default domAssigned(class Metavariable {
|
|
|
151
151
|
if (metavariable !== null) {
|
|
152
152
|
const metavariableMetaTypeEqualToMetaType = metavariable.isMetaTypeEqualTo(metaType);
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
verifiesGivenMetaType = metavariableMetaTypeEqualToMetaType; ///
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
if (
|
|
157
|
+
if (verifiesGivenMetaType) {
|
|
158
158
|
context.debug(`...verified the '${metavariableString}' metavariable given the '${metaTypeString}' meta-type.`);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
return
|
|
161
|
+
return verifiesGivenMetaType;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
unifyFrame(frame, substitutions, generalContext, specificContext) {
|
|
165
|
-
let
|
|
165
|
+
let frameUnifies = false;
|
|
166
166
|
|
|
167
167
|
const frameString = frame.getString(),
|
|
168
168
|
metavariableString = this.string; ///
|
|
169
169
|
|
|
170
170
|
specificContext.trace(`Unifying the '${frameString}' frame with the '${metavariableString}' metavariable...`);
|
|
171
171
|
|
|
172
|
-
const
|
|
172
|
+
const frameMetavariableUnifies = this.unifyFrameMetavariable(frame, substitutions, generalContext, specificContext);
|
|
173
173
|
|
|
174
|
-
if (
|
|
175
|
-
|
|
174
|
+
if (frameMetavariableUnifies) {
|
|
175
|
+
frameUnifies = true;
|
|
176
176
|
} else {
|
|
177
177
|
const metavariable = this, ///
|
|
178
178
|
simpleSubstitutionPresent = substitutions.isSimpleSubstitutionPresentByMetavariable(metavariable);
|
|
@@ -183,7 +183,7 @@ export default domAssigned(class Metavariable {
|
|
|
183
183
|
substitutionFrameEqualToFrame = substitution.isFrameEqualTo(frame);
|
|
184
184
|
|
|
185
185
|
if (substitutionFrameEqualToFrame) {
|
|
186
|
-
|
|
186
|
+
frameUnifies = true;
|
|
187
187
|
}
|
|
188
188
|
} else {
|
|
189
189
|
const { FrameSubstitution } = dom,
|
|
@@ -194,29 +194,29 @@ export default domAssigned(class Metavariable {
|
|
|
194
194
|
|
|
195
195
|
substitutions.addSubstitution(substitution, specificContext);
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
frameUnifies = true;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
if (
|
|
201
|
+
if (frameUnifies) {
|
|
202
202
|
specificContext.debug(`...unified the '${frameString}' frame with the '${metavariableString}' metavariable.`);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
return
|
|
205
|
+
return frameUnifies;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
unifyReference(reference, substitutions, generalContext, specificContext) {
|
|
209
|
-
let
|
|
209
|
+
let referenceUnifies = false;
|
|
210
210
|
|
|
211
211
|
const referenceString = reference.getString(),
|
|
212
212
|
metavariableString = this.string; ///
|
|
213
213
|
|
|
214
214
|
specificContext.trace(`Unifying the '${referenceString}' reference with the '${metavariableString}' metavariable...`);
|
|
215
215
|
|
|
216
|
-
const
|
|
216
|
+
const referenceMetavariableUnifies = this.unifyReferenceMetavariable(reference, substitutions, generalContext, specificContext);
|
|
217
217
|
|
|
218
|
-
if (
|
|
219
|
-
|
|
218
|
+
if (referenceMetavariableUnifies) {
|
|
219
|
+
referenceUnifies = true;
|
|
220
220
|
} else {
|
|
221
221
|
const metavariable = this, ///
|
|
222
222
|
simpleSubstitutionPresent = substitutions.isSimpleSubstitutionPresentByMetavariable(metavariable);
|
|
@@ -227,7 +227,7 @@ export default domAssigned(class Metavariable {
|
|
|
227
227
|
substitutionReferenceEqualToReference = substitution.isReferenceEqualTo(reference);
|
|
228
228
|
|
|
229
229
|
if (substitutionReferenceEqualToReference) {
|
|
230
|
-
|
|
230
|
+
referenceUnifies = true;
|
|
231
231
|
}
|
|
232
232
|
} else {
|
|
233
233
|
const { ReferenceSubstitution } = dom,
|
|
@@ -238,19 +238,19 @@ export default domAssigned(class Metavariable {
|
|
|
238
238
|
|
|
239
239
|
substitutions.addSubstitution(substitution, specificContext);
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
referenceUnifies = true;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
if (
|
|
245
|
+
if (referenceUnifies) {
|
|
246
246
|
specificContext.debug(`...unified the '${referenceString}' reference with the '${metavariableString}' metavariable.`);
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
return
|
|
249
|
+
return referenceUnifies;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
unifyStatement(statement, substitution, substitutions, generalContext, specificContext) {
|
|
253
|
-
let
|
|
253
|
+
let statementUnifies = false;
|
|
254
254
|
|
|
255
255
|
const statementString = statement.getString(),
|
|
256
256
|
metavariableString = this.string, ///
|
|
@@ -260,10 +260,10 @@ export default domAssigned(class Metavariable {
|
|
|
260
260
|
|
|
261
261
|
specificContext.trace(`Unifying the '${statementString}' statement with the '${metavariableString}${substitutionString}' metavariable...`);
|
|
262
262
|
|
|
263
|
-
const
|
|
263
|
+
const statementMetavariableUnifies = this.unifyStatementMetavariable(statement, substitutions, generalContext, specificContext);
|
|
264
264
|
|
|
265
|
-
if (
|
|
266
|
-
|
|
265
|
+
if (statementMetavariableUnifies) {
|
|
266
|
+
statementUnifies = true;
|
|
267
267
|
} else {
|
|
268
268
|
const context = specificContext, ///
|
|
269
269
|
metavariable = this, ///
|
|
@@ -275,7 +275,7 @@ export default domAssigned(class Metavariable {
|
|
|
275
275
|
const substitutionStatementEqualToStatement = substitution.isStatementEqualTo(statement, context);
|
|
276
276
|
|
|
277
277
|
if (substitutionStatementEqualToStatement) {
|
|
278
|
-
|
|
278
|
+
statementUnifies = true;
|
|
279
279
|
}
|
|
280
280
|
} else {
|
|
281
281
|
const { StatementSubstitution } = dom,
|
|
@@ -286,19 +286,19 @@ export default domAssigned(class Metavariable {
|
|
|
286
286
|
|
|
287
287
|
substitutions.addSubstitution(substitution, specificContext);
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
statementUnifies = true;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
if (
|
|
293
|
+
if (statementUnifies) {
|
|
294
294
|
specificContext.debug(`...unified the '${statementString}' statement with the '${metavariableString}${substitutionString}' metavariable.`);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
return
|
|
297
|
+
return statementUnifies;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
unifyMetavariable(metavariable, generalContext, specificContext) {
|
|
301
|
-
let
|
|
301
|
+
let metavariableUnifies;
|
|
302
302
|
|
|
303
303
|
const generalMetavariable = this, ///
|
|
304
304
|
specificMetavariable = metavariable, ///
|
|
@@ -307,17 +307,17 @@ export default domAssigned(class Metavariable {
|
|
|
307
307
|
|
|
308
308
|
specificContext.trace(`Unifying the '${specificMetavariableString}' metavariable with the '${generalMetavariableString}' metavariable...`);
|
|
309
309
|
|
|
310
|
-
|
|
310
|
+
metavariableUnifies = unifyMetavariable(generalMetavariable, specificMetavariable, generalContext, specificContext);
|
|
311
311
|
|
|
312
|
-
if (
|
|
312
|
+
if (metavariableUnifies) {
|
|
313
313
|
specificContext.debug(`...unified the '${specificMetavariableString}' metavariable with the '${generalMetavariableString}' metavariable.`);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
return
|
|
316
|
+
return metavariableUnifies;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
unifyFrameMetavariable(frame, substitutions, generalContext, specificContext) {
|
|
320
|
-
let
|
|
320
|
+
let frameMetavariableUnifies = false;
|
|
321
321
|
|
|
322
322
|
const generalContextFilePath = generalContext.getFilePath(),
|
|
323
323
|
specificContextFilePath = specificContext.getFilePath();
|
|
@@ -326,7 +326,7 @@ export default domAssigned(class Metavariable {
|
|
|
326
326
|
const frameString = frame.getString();
|
|
327
327
|
|
|
328
328
|
if (frameString === this.string) {
|
|
329
|
-
|
|
329
|
+
frameMetavariableUnifies = true;
|
|
330
330
|
} else {
|
|
331
331
|
const context = specificContext, ///
|
|
332
332
|
metavariable = metavariableFromFrame(frame, context);
|
|
@@ -340,22 +340,22 @@ export default domAssigned(class Metavariable {
|
|
|
340
340
|
|
|
341
341
|
const specificMetavariable = frameMetavariable, ///
|
|
342
342
|
generalMetavariable = this, ///
|
|
343
|
-
|
|
343
|
+
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, substitutions, generalContext, specificContext);
|
|
344
344
|
|
|
345
|
-
|
|
345
|
+
frameMetavariableUnifies = metavariableUnifiesIntrinsically; ///
|
|
346
346
|
|
|
347
|
-
if (
|
|
347
|
+
if (frameMetavariableUnifies) {
|
|
348
348
|
specificContext.debug(`...unified the frame's '${frameMetavariableString}' metavariable with the '${metavariableString}' metavariable.`);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
return
|
|
354
|
+
return frameMetavariableUnifies;
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
unifyReferenceMetavariable(reference, substitutions, generalContext, specificContext) {
|
|
358
|
-
let
|
|
358
|
+
let referenceMetavariableUnifies = false;
|
|
359
359
|
|
|
360
360
|
const generalContextFilePath = generalContext.getFilePath(),
|
|
361
361
|
specificContextFilePath = specificContext.getFilePath();
|
|
@@ -364,7 +364,7 @@ export default domAssigned(class Metavariable {
|
|
|
364
364
|
const referenceString = reference.getString();
|
|
365
365
|
|
|
366
366
|
if (referenceString === this.string) {
|
|
367
|
-
|
|
367
|
+
referenceMetavariableUnifies = true;
|
|
368
368
|
} else {
|
|
369
369
|
const metavariableString = this.string, ///
|
|
370
370
|
referenceMetavariable = reference.getMetavariable(),
|
|
@@ -374,21 +374,21 @@ export default domAssigned(class Metavariable {
|
|
|
374
374
|
|
|
375
375
|
const specificMetavariable = referenceMetavariable, ///
|
|
376
376
|
generalMetavariable = this, ///
|
|
377
|
-
|
|
377
|
+
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, substitutions, generalContext, specificContext);
|
|
378
378
|
|
|
379
|
-
|
|
379
|
+
referenceMetavariableUnifies = metavariableUnifiesIntrinsically; ///
|
|
380
380
|
|
|
381
|
-
if (
|
|
381
|
+
if (referenceMetavariableUnifies) {
|
|
382
382
|
specificContext.debug(`...unified the reference's '${referenceMetavariableString}' metavariable with the '${metavariableString}' metavariable.`);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
return
|
|
387
|
+
return referenceMetavariableUnifies;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
unifyStatementMetavariable(statement, substitutions, generalContext, specificContext) {
|
|
391
|
-
let
|
|
391
|
+
let statementMetavariableUnifies = false;
|
|
392
392
|
|
|
393
393
|
const generalContextFilePath = generalContext.getFilePath(),
|
|
394
394
|
specificContextFilePath = specificContext.getFilePath();
|
|
@@ -397,7 +397,7 @@ export default domAssigned(class Metavariable {
|
|
|
397
397
|
const statementString = statement.getString();
|
|
398
398
|
|
|
399
399
|
if (statementString === this.string) {
|
|
400
|
-
|
|
400
|
+
statementMetavariableUnifies = true;
|
|
401
401
|
} else {
|
|
402
402
|
const context = specificContext, ///
|
|
403
403
|
metavariable = metavariableFromStatement(statement, context);
|
|
@@ -411,18 +411,18 @@ export default domAssigned(class Metavariable {
|
|
|
411
411
|
|
|
412
412
|
const specificMetavariable = statementMetavariable, ///
|
|
413
413
|
generalMetavariable = this, ///
|
|
414
|
-
|
|
414
|
+
metavariableUnifiesIntrinsically = unifyMetavariableIntrinsically(generalMetavariable, specificMetavariable, substitutions, generalContext, specificContext);
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
statementMetavariableUnifies = metavariableUnifiesIntrinsically; ///
|
|
417
417
|
|
|
418
|
-
if (
|
|
418
|
+
if (statementMetavariableUnifies) {
|
|
419
419
|
specificContext.debug(`...unified the statement's '${statementMetavariableString}' metavariable with the '${metavariableString}' metavariable.`);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
return
|
|
425
|
+
return statementMetavariableUnifies;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
toJSON() {
|
package/src/dom/premise.js
CHANGED
|
@@ -27,7 +27,7 @@ export default domAssigned(class Premise {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
verify(context) {
|
|
30
|
-
let
|
|
30
|
+
let verifies = false;
|
|
31
31
|
|
|
32
32
|
const premiseString = this.string; ///
|
|
33
33
|
|
|
@@ -38,9 +38,9 @@ export default domAssigned(class Premise {
|
|
|
38
38
|
} else if (this.statement !== null) {
|
|
39
39
|
const stated = true,
|
|
40
40
|
assignments = [],
|
|
41
|
-
|
|
41
|
+
statementVerifies = this.statement.verify(assignments, stated, context);
|
|
42
42
|
|
|
43
|
-
if (
|
|
43
|
+
if (statementVerifies) {
|
|
44
44
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
45
45
|
|
|
46
46
|
if (assignmentsAssigned) {
|
|
@@ -50,48 +50,48 @@ export default domAssigned(class Premise {
|
|
|
50
50
|
|
|
51
51
|
context.addStepOrSubproof(stepOrSubproof);
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
verifies = true;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
} else if (this.procedureCall !== null) {
|
|
57
57
|
const stated = true,
|
|
58
58
|
assignments = null,
|
|
59
|
-
|
|
59
|
+
procedureCallVerifies = this.procedureCall.verify(assignments, stated, context);
|
|
60
60
|
|
|
61
|
-
if (
|
|
62
|
-
|
|
61
|
+
if (procedureCallVerifies) {
|
|
62
|
+
verifies = true;
|
|
63
63
|
}
|
|
64
64
|
} else {
|
|
65
65
|
context.debug(`Unable to verify the '${premiseString}' premise because it is nonsense.`);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
if (
|
|
68
|
+
if (verifies) {
|
|
69
69
|
context.debug(`...verified the '${premiseString}' premise.`);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
return
|
|
72
|
+
return verifies;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
unifyIndependently(substitutions, context) {
|
|
76
|
-
let
|
|
76
|
+
let unifiesIndependently;
|
|
77
77
|
|
|
78
78
|
if (this.statement !== null) {
|
|
79
79
|
const statementResolvedIndependently = this.statement.unifyIndependently(substitutions, context);
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
unifiesIndependently = statementResolvedIndependently; ///
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (this.procedureCall !== null) {
|
|
85
85
|
const procedureCallResolvedIndependently = this.procedureCall.unifyIndependently(substitutions, context);
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
unifiesIndependently = procedureCallResolvedIndependently; ///
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return unifiesIndependently;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
unifyStepOrSubproof(stepOrSubproof, substitutions, generalContext, specificContext) {
|
|
94
|
-
let
|
|
94
|
+
let stepOrSubproofUnifies = false;
|
|
95
95
|
|
|
96
96
|
const stepOrSubProofStep = stepOrSubproof.isStep(),
|
|
97
97
|
subproof = stepOrSubProofStep ?
|
|
@@ -104,41 +104,43 @@ export default domAssigned(class Premise {
|
|
|
104
104
|
substitutions.snapshot();
|
|
105
105
|
|
|
106
106
|
if (subproof !== null) {
|
|
107
|
-
const
|
|
107
|
+
const subproofUnifies = this.unifySubproof(subproof, substitutions, generalContext, specificContext);
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
stepOrSubproofUnifies = subproofUnifies; ///
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
if (step !== null) {
|
|
113
|
-
const
|
|
113
|
+
const statementUnifies = this.unifyStep(step, substitutions, generalContext, specificContext);
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
stepOrSubproofUnifies = statementUnifies; ///
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
if (
|
|
118
|
+
if (stepOrSubproofUnifies) {
|
|
119
119
|
substitutions.resolve(generalContext, specificContext);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
stepOrSubproofUnifies ?
|
|
123
123
|
substitutions.continue() :
|
|
124
124
|
substitutions.rollback(specificContext);
|
|
125
125
|
|
|
126
|
-
return
|
|
126
|
+
return stepOrSubproofUnifies;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
unifyStep(step, substitutions, generalContext, specificContext) {
|
|
130
|
-
let
|
|
130
|
+
let stepUnifies = false;
|
|
131
131
|
|
|
132
132
|
const statement = step.getStatement(),
|
|
133
|
-
|
|
133
|
+
statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
if (statementUnifies) {
|
|
136
|
+
stepUnifies = true;
|
|
137
|
+
}
|
|
136
138
|
|
|
137
|
-
return
|
|
139
|
+
return stepUnifies;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
unifySubproof(subproof, substitutions, generalContext, specificContext) {
|
|
141
|
-
let
|
|
143
|
+
let subproofUnifies = false;
|
|
142
144
|
|
|
143
145
|
const premise = this, ///
|
|
144
146
|
subproofString = subproof.getString(),
|
|
@@ -152,19 +154,19 @@ export default domAssigned(class Premise {
|
|
|
152
154
|
subproofAssertion = subproofAssertionFromStatement(this.statement, context);
|
|
153
155
|
|
|
154
156
|
if (subproofAssertion !== null) {
|
|
155
|
-
|
|
157
|
+
subproofUnifies = subproofAssertion.unifySubproof(subproof, substitutions, generalContext, specificContext);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
if (
|
|
161
|
+
if (subproofUnifies) {
|
|
160
162
|
specificContext.debug(`...unified the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement.`);
|
|
161
163
|
}
|
|
162
164
|
|
|
163
|
-
return
|
|
165
|
+
return subproofUnifies;
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
unifyStatement(statement, substitutions, generalContext, specificContext) {
|
|
167
|
-
let
|
|
169
|
+
let statementUnifies;
|
|
168
170
|
|
|
169
171
|
const premise = this, ///
|
|
170
172
|
premiseString = premise.getString(),
|
|
@@ -173,14 +175,14 @@ export default domAssigned(class Premise {
|
|
|
173
175
|
specificContext.trace(`Unifying the '${statementString}' statement with the '${premiseString}' premise...`);
|
|
174
176
|
|
|
175
177
|
if (this.statement !== null) {
|
|
176
|
-
|
|
178
|
+
statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
177
179
|
}
|
|
178
180
|
|
|
179
|
-
if (
|
|
181
|
+
if (statementUnifies) {
|
|
180
182
|
specificContext.debug(`...unified the '${statementString}' statement with the '${premiseString}' premise.`);
|
|
181
183
|
}
|
|
182
184
|
|
|
183
|
-
return
|
|
185
|
+
return statementUnifies;
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
toJSON() {
|
package/src/dom/procedureCall.js
CHANGED
|
@@ -38,7 +38,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
verify(assignments, stated, context) {
|
|
41
|
-
let
|
|
41
|
+
let verifies = false;
|
|
42
42
|
|
|
43
43
|
const procedureCallString = this.string; ///
|
|
44
44
|
|
|
@@ -50,7 +50,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
50
50
|
const procedureBoolean = procedure.isBoolean();
|
|
51
51
|
|
|
52
52
|
if (procedureBoolean) {
|
|
53
|
-
|
|
53
|
+
verifies = true;
|
|
54
54
|
} else {
|
|
55
55
|
context.trace(`The '${procedureCallString}' procedure is not boolean.`);
|
|
56
56
|
}
|
|
@@ -58,15 +58,15 @@ export default domAssigned(class ProcedureCall {
|
|
|
58
58
|
context.trace(`The '${procedureCallString}' procedure is not present.`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
if (
|
|
61
|
+
if (verifies) {
|
|
62
62
|
context.debug(`...verified the '${procedureCallString}' procedure call.`);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
return
|
|
65
|
+
return verifies;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
unifyIndependently(substitutions, context) {
|
|
69
|
-
let
|
|
69
|
+
let unifiesIndependently = false;
|
|
70
70
|
|
|
71
71
|
const procedureCallString = this.string; ///
|
|
72
72
|
|
|
@@ -80,18 +80,18 @@ export default domAssigned(class ProcedureCall {
|
|
|
80
80
|
const value = procedure.call(expressions, context),
|
|
81
81
|
boolean = value.getBoolean();
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
unifiesIndependently = boolean; ///
|
|
84
84
|
} catch (exception) {
|
|
85
85
|
const message = exception.getMessage();
|
|
86
86
|
|
|
87
87
|
context.info(message);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
if (
|
|
90
|
+
if (unifiesIndependently) {
|
|
91
91
|
context.debug(`...unified the '${procedureCallString}' procedure call independently.`);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
return
|
|
94
|
+
return unifiesIndependently;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
toJSON() {
|
package/src/dom/proof.js
CHANGED
|
@@ -25,15 +25,15 @@ export default domAssigned(class Proof {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
verify(substitutions, conclusion, context) {
|
|
28
|
-
let
|
|
28
|
+
let verifies = false;
|
|
29
29
|
|
|
30
30
|
const localContext = LocalContext.fromContext(context); ///
|
|
31
31
|
|
|
32
32
|
context = localContext; ///
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const derivationVerifies = this.derivation.verify(substitutions, context);
|
|
35
35
|
|
|
36
|
-
if (
|
|
36
|
+
if (derivationVerifies) {
|
|
37
37
|
const lastStep = context.getLastStep();
|
|
38
38
|
|
|
39
39
|
if (lastStep !== null) {
|
|
@@ -42,12 +42,12 @@ export default domAssigned(class Proof {
|
|
|
42
42
|
conclusionStatementEqualToStatement = conclusionStatement.isEqualTo(statement);
|
|
43
43
|
|
|
44
44
|
if (conclusionStatementEqualToStatement) {
|
|
45
|
-
|
|
45
|
+
verifies = true;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
return
|
|
50
|
+
return verifies;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
static name = "Proof";
|
|
@@ -43,49 +43,49 @@ export default domAssigned(class PropertyRelation {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
verify(context) {
|
|
46
|
-
let
|
|
46
|
+
let verifies = false;
|
|
47
47
|
|
|
48
48
|
const propertyRelationString = this.string; ///
|
|
49
49
|
|
|
50
50
|
context.trace(`Verifying the '${propertyRelationString}' property relation...`);
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const termVerifies = this.verifyTerm(context);
|
|
53
53
|
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
54
|
+
if (termVerifies) {
|
|
55
|
+
const propertyVerifies = this.verifyProperty(context);
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
verifies = propertyVerifies;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (
|
|
60
|
+
if (verifies) {
|
|
61
61
|
context.debug(`...verified the '${propertyRelationString}' property relation.`);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return verifies;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
verifyTerm(context) {
|
|
68
|
-
let
|
|
68
|
+
let termVerifies;
|
|
69
69
|
|
|
70
70
|
const termString = this.term.getString();
|
|
71
71
|
|
|
72
72
|
context.trace(`Verifying the '${termString}' term...`);
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
const
|
|
74
|
+
termVerifies = this.term.verify(context, () => {
|
|
75
|
+
const verifiesAhead = true;
|
|
76
76
|
|
|
77
|
-
return
|
|
77
|
+
return verifiesAhead;
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
if (
|
|
80
|
+
if (termVerifies) {
|
|
81
81
|
context.debug(`...verified the '${termString}' term.`);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
return
|
|
84
|
+
return termVerifies;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
verifyProperty(context) {
|
|
88
|
-
let
|
|
88
|
+
let propertyVerifies;
|
|
89
89
|
|
|
90
90
|
const propertyString = this.property.getString();
|
|
91
91
|
|
|
@@ -112,14 +112,14 @@ export default domAssigned(class PropertyRelation {
|
|
|
112
112
|
|
|
113
113
|
this.property.setType(type);
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
propertyVerifies = true;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
if (
|
|
118
|
+
if (propertyVerifies) {
|
|
119
119
|
context.debug(`...verified the '${propertyString}' property.`);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
return
|
|
122
|
+
return propertyVerifies;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
static name = "PropertyRelation";
|