occam-verify-cli 1.0.984 → 1.0.985
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/action/verify.js +22 -27
- package/lib/constants.js +1 -41
- package/lib/index.js +1 -2
- package/lib/utilities/fileContext.js +3 -8
- package/lib/utilities/releaseContext.js +2 -2
- package/package.json +5 -6
- package/src/action/verify.js +8 -18
- package/src/constants.js +0 -10
- package/src/index.js +0 -2
- package/src/utilities/fileContext.js +1 -2
- package/src/utilities/releaseContext.js +1 -1
- package/lib/context/aphasic.js +0 -27
- package/lib/context/bounded.js +0 -244
- package/lib/context/branching.js +0 -61
- package/lib/context/file/nominal.js +0 -586
- package/lib/context/illative.js +0 -28
- package/lib/context/liminal.js +0 -200
- package/lib/context/literal.js +0 -44
- package/lib/context/mnemic.js +0 -454
- package/lib/context/nested.js +0 -31
- package/lib/context/nominal.js +0 -57
- package/lib/context/phaneric.js +0 -44
- package/lib/context/thetic.js +0 -28
- package/lib/context.js +0 -445
- package/lib/element/assertion/contained.js +0 -218
- package/lib/element/assertion/defined.js +0 -213
- package/lib/element/assertion/property.js +0 -176
- package/lib/element/assertion/signature.js +0 -170
- package/lib/element/assertion/subproof.js +0 -220
- package/lib/element/assertion/type.js +0 -227
- package/lib/element/assertion.js +0 -49
- package/lib/element/assumption/metaLevel.js +0 -244
- package/lib/element/assumption.js +0 -252
- package/lib/element/combinator/bracketed.js +0 -36
- package/lib/element/combinator.js +0 -104
- package/lib/element/conclusion.js +0 -131
- package/lib/element/constructor/bracketed.js +0 -57
- package/lib/element/constructor.js +0 -129
- package/lib/element/declaration/combinator.js +0 -58
- package/lib/element/declaration/complexType.js +0 -180
- package/lib/element/declaration/constructor.js +0 -93
- package/lib/element/declaration/metavariable.js +0 -77
- package/lib/element/declaration/property.js +0 -88
- package/lib/element/declaration/simpleType.js +0 -148
- package/lib/element/declaration/typePrefix.js +0 -53
- package/lib/element/declaration/variable.js +0 -99
- package/lib/element/declaration.js +0 -15
- package/lib/element/deduction.js +0 -131
- package/lib/element/derivation.js +0 -46
- package/lib/element/equality.js +0 -211
- package/lib/element/equivalence.js +0 -200
- package/lib/element/error.js +0 -27
- package/lib/element/frame.js +0 -238
- package/lib/element/hypothesis.js +0 -135
- package/lib/element/judgement.js +0 -212
- package/lib/element/label.js +0 -135
- package/lib/element/metaType.js +0 -57
- package/lib/element/metavariable.js +0 -452
- package/lib/element/parameter.js +0 -69
- package/lib/element/procedureCall.js +0 -116
- package/lib/element/procedureReference.js +0 -56
- package/lib/element/proof.js +0 -52
- package/lib/element/proofAssertion/premise.js +0 -238
- package/lib/element/proofAssertion/step.js +0 -235
- package/lib/element/proofAssertion/supposition.js +0 -249
- package/lib/element/proofAssertion.js +0 -56
- package/lib/element/property.js +0 -176
- package/lib/element/propertyRelation.js +0 -132
- package/lib/element/reference.js +0 -227
- package/lib/element/rule.js +0 -242
- package/lib/element/section.js +0 -64
- package/lib/element/signature.js +0 -195
- package/lib/element/statement.js +0 -228
- package/lib/element/subDerivation.js +0 -46
- package/lib/element/subproof.js +0 -91
- package/lib/element/substitution/frame.js +0 -256
- package/lib/element/substitution/reference.js +0 -192
- package/lib/element/substitution/statement.js +0 -294
- package/lib/element/substitution/term.js +0 -266
- package/lib/element/substitution.js +0 -183
- package/lib/element/term.js +0 -217
- package/lib/element/topLevelAssertion/axiom.js +0 -158
- package/lib/element/topLevelAssertion/conjecture.js +0 -42
- package/lib/element/topLevelAssertion/lemma.js +0 -39
- package/lib/element/topLevelAssertion/theorem.js +0 -42
- package/lib/element/topLevelAssertion.js +0 -286
- package/lib/element/topLevelMetaAssertion/metaLemma.js +0 -42
- package/lib/element/topLevelMetaAssertion/metatheorem.js +0 -42
- package/lib/element/topLevelMetaAssertion.js +0 -179
- package/lib/element/type.js +0 -240
- package/lib/element/typePrefix.js +0 -85
- package/lib/element/variable.js +0 -206
- package/lib/elements.js +0 -27
- package/lib/metaTypeNames.js +0 -26
- package/lib/metaTypes.js +0 -66
- package/lib/node/argument.js +0 -31
- package/lib/node/assertion/contained.js +0 -51
- package/lib/node/assertion/defined.js +0 -47
- package/lib/node/assertion/property.js +0 -36
- package/lib/node/assertion/signature.js +0 -32
- package/lib/node/assertion/subproof.js +0 -28
- package/lib/node/assertion/type.js +0 -32
- package/lib/node/assertion.js +0 -18
- package/lib/node/assumption/metaLevel.js +0 -27
- package/lib/node/assumption.js +0 -27
- package/lib/node/body/axiom.js +0 -23
- package/lib/node/body/conjecture.js +0 -23
- package/lib/node/body/lemma.js +0 -23
- package/lib/node/body/metaLemma.js +0 -23
- package/lib/node/body/metatheorem.js +0 -23
- package/lib/node/body/rule.js +0 -44
- package/lib/node/body/theorem.js +0 -23
- package/lib/node/body.js +0 -31
- package/lib/node/combinator.js +0 -23
- package/lib/node/conclusion.js +0 -27
- package/lib/node/constructor.js +0 -23
- package/lib/node/declaration/combinator.js +0 -28
- package/lib/node/declaration/complexType.js +0 -72
- package/lib/node/declaration/constructor.js +0 -47
- package/lib/node/declaration/metavariable.js +0 -36
- package/lib/node/declaration/property.js +0 -44
- package/lib/node/declaration/simpleType.js +0 -72
- package/lib/node/declaration/typePrefix.js +0 -32
- package/lib/node/declaration/variable.js +0 -51
- package/lib/node/declaration.js +0 -18
- package/lib/node/deduction.js +0 -27
- package/lib/node/derivation.js +0 -26
- package/lib/node/document.js +0 -18
- package/lib/node/equality.js +0 -33
- package/lib/node/equivalence.js +0 -23
- package/lib/node/equivalences.js +0 -18
- package/lib/node/error.js +0 -18
- package/lib/node/frame.js +0 -38
- package/lib/node/header/axiom.js +0 -28
- package/lib/node/header/conjecture.js +0 -23
- package/lib/node/header/lemma.js +0 -23
- package/lib/node/header/metaLemma.js +0 -23
- package/lib/node/header/metatheorem.js +0 -23
- package/lib/node/header/rule.js +0 -23
- package/lib/node/header/theorem.js +0 -23
- package/lib/node/header.js +0 -47
- package/lib/node/hypothesis.js +0 -27
- package/lib/node/judgement.js +0 -31
- package/lib/node/label.js +0 -23
- package/lib/node/labels.js +0 -23
- package/lib/node/metaArgument.js +0 -23
- package/lib/node/metaType.js +0 -30
- package/lib/node/metavariable.js +0 -39
- package/lib/node/parameter.js +0 -47
- package/lib/node/parenthesisedLabel.js +0 -23
- package/lib/node/parenthesisedLabels.js +0 -27
- package/lib/node/placeholder.js +0 -18
- package/lib/node/procedureCall.js +0 -31
- package/lib/node/procedureReference.js +0 -30
- package/lib/node/proof.js +0 -23
- package/lib/node/proofAssertion/premise.js +0 -28
- package/lib/node/proofAssertion/step.js +0 -52
- package/lib/node/proofAssertion/supposition.js +0 -28
- package/lib/node/proofAssertion.js +0 -27
- package/lib/node/property.js +0 -30
- package/lib/node/propertyRelation.js +0 -31
- package/lib/node/qualification.js +0 -27
- package/lib/node/reference.js +0 -23
- package/lib/node/rule.js +0 -43
- package/lib/node/section.js +0 -39
- package/lib/node/signature.js +0 -23
- package/lib/node/statement.js +0 -103
- package/lib/node/subDerivation.js +0 -26
- package/lib/node/subproof.js +0 -35
- package/lib/node/substitution/frame.js +0 -40
- package/lib/node/substitution/reference.js +0 -40
- package/lib/node/substitution/statement.js +0 -60
- package/lib/node/substitution/term.js +0 -40
- package/lib/node/substitution.js +0 -18
- package/lib/node/term.js +0 -60
- package/lib/node/topLevelAssertion/axiom.js +0 -26
- package/lib/node/topLevelAssertion/conjecture.js +0 -26
- package/lib/node/topLevelAssertion/lemma.js +0 -26
- package/lib/node/topLevelAssertion/theorem.js +0 -26
- package/lib/node/topLevelAssertion.js +0 -46
- package/lib/node/topLevelMetaAssertion/metaLemma.js +0 -26
- package/lib/node/topLevelMetaAssertion/metatheorem.js +0 -26
- package/lib/node/topLevelMetaAssertion.js +0 -42
- package/lib/node/type.js +0 -60
- package/lib/node/typePrefix.js +0 -30
- package/lib/node/types.js +0 -23
- package/lib/node/variable.js +0 -30
- package/lib/nominal/lexer.js +0 -15
- package/lib/nominal/parser.js +0 -24
- package/lib/nonTerminalNodeMap.js +0 -189
- package/lib/pass/zip.js +0 -23
- package/lib/preamble.js +0 -73
- package/lib/process/assign.js +0 -62
- package/lib/process/discharge.js +0 -38
- package/lib/process/equate.js +0 -73
- package/lib/process/instantiate.js +0 -261
- package/lib/process/unification.js +0 -228
- package/lib/process/unify.js +0 -336
- package/lib/process/validate.js +0 -135
- package/lib/process/validation.js +0 -291
- package/lib/process/verify.js +0 -205
- package/lib/ruleNames.js +0 -350
- package/lib/tokenTypes.js +0 -22
- package/lib/utilities/assignment.js +0 -47
- package/lib/utilities/bnf.js +0 -21
- package/lib/utilities/brackets.js +0 -77
- package/lib/utilities/breakPoint.js +0 -38
- package/lib/utilities/context.js +0 -220
- package/lib/utilities/element.js +0 -1851
- package/lib/utilities/equivalence.js +0 -27
- package/lib/utilities/equivalences.js +0 -134
- package/lib/utilities/instance.js +0 -44
- package/lib/utilities/json.js +0 -1109
- package/lib/utilities/string.js +0 -231
- package/lib/utilities/substitutions.js +0 -86
- package/lib/utilities/synoptic.js +0 -159
- package/lib/utilities/type.js +0 -27
- package/src/context/aphasic.js +0 -15
- package/src/context/bounded.js +0 -362
- package/src/context/branching.js +0 -69
- package/src/context/file/nominal.js +0 -955
- package/src/context/illative.js +0 -17
- package/src/context/liminal.js +0 -280
- package/src/context/literal.js +0 -42
- package/src/context/mnemic.js +0 -778
- package/src/context/nested.js +0 -21
- package/src/context/nominal.js +0 -62
- package/src/context/phaneric.js +0 -43
- package/src/context/thetic.js +0 -17
- package/src/context.js +0 -722
- package/src/element/assertion/contained.js +0 -313
- package/src/element/assertion/defined.js +0 -310
- package/src/element/assertion/property.js +0 -252
- package/src/element/assertion/signature.js +0 -239
- package/src/element/assertion/subproof.js +0 -335
- package/src/element/assertion/type.js +0 -328
- package/src/element/assertion.js +0 -65
- package/src/element/assumption/metaLevel.js +0 -373
- package/src/element/assumption.js +0 -374
- package/src/element/combinator/bracketed.js +0 -32
- package/src/element/combinator.js +0 -145
- package/src/element/conclusion.js +0 -185
- package/src/element/constructor/bracketed.js +0 -68
- package/src/element/constructor.js +0 -188
- package/src/element/declaration/combinator.js +0 -66
- package/src/element/declaration/complexType.js +0 -257
- package/src/element/declaration/constructor.js +0 -122
- package/src/element/declaration/metavariable.js +0 -93
- package/src/element/declaration/property.js +0 -108
- package/src/element/declaration/simpleType.js +0 -208
- package/src/element/declaration/typePrefix.js +0 -58
- package/src/element/declaration/variable.js +0 -130
- package/src/element/declaration.js +0 -7
- package/src/element/deduction.js +0 -185
- package/src/element/derivation.js +0 -57
- package/src/element/equality.js +0 -325
- package/src/element/equivalence.js +0 -276
- package/src/element/error.js +0 -26
- package/src/element/frame.js +0 -356
- package/src/element/hypothesis.js +0 -186
- package/src/element/judgement.js +0 -303
- package/src/element/label.js +0 -186
- package/src/element/metaType.js +0 -75
- package/src/element/metavariable.js +0 -662
- package/src/element/parameter.js +0 -90
- package/src/element/procedureCall.js +0 -159
- package/src/element/procedureReference.js +0 -71
- package/src/element/proof.js +0 -61
- package/src/element/proofAssertion/premise.js +0 -354
- package/src/element/proofAssertion/step.js +0 -271
- package/src/element/proofAssertion/supposition.js +0 -377
- package/src/element/proofAssertion.js +0 -74
- package/src/element/property.js +0 -258
- package/src/element/propertyRelation.js +0 -193
- package/src/element/reference.js +0 -345
- package/src/element/rule.js +0 -358
- package/src/element/section.js +0 -78
- package/src/element/signature.js +0 -292
- package/src/element/statement.js +0 -358
- package/src/element/subDerivation.js +0 -56
- package/src/element/subproof.js +0 -116
- package/src/element/substitution/frame.js +0 -392
- package/src/element/substitution/reference.js +0 -274
- package/src/element/substitution/statement.js +0 -452
- package/src/element/substitution/term.js +0 -407
- package/src/element/substitution.js +0 -261
- package/src/element/term.js +0 -339
- package/src/element/topLevelAssertion/axiom.js +0 -244
- package/src/element/topLevelAssertion/conjecture.js +0 -40
- package/src/element/topLevelAssertion/lemma.js +0 -42
- package/src/element/topLevelAssertion/theorem.js +0 -40
- package/src/element/topLevelAssertion.js +0 -436
- package/src/element/topLevelMetaAssertion/metaLemma.js +0 -40
- package/src/element/topLevelMetaAssertion/metatheorem.js +0 -40
- package/src/element/topLevelMetaAssertion.js +0 -276
- package/src/element/type.js +0 -374
- package/src/element/typePrefix.js +0 -113
- package/src/element/variable.js +0 -259
- package/src/elements.js +0 -13
- package/src/metaTypeNames.js +0 -5
- package/src/metaTypes.js +0 -71
- package/src/node/argument.js +0 -30
- package/src/node/assertion/contained.js +0 -53
- package/src/node/assertion/defined.js +0 -46
- package/src/node/assertion/property.js +0 -30
- package/src/node/assertion/signature.js +0 -23
- package/src/node/assertion/subproof.js +0 -16
- package/src/node/assertion/type.js +0 -23
- package/src/node/assertion.js +0 -7
- package/src/node/assumption/metaLevel.js +0 -23
- package/src/node/assumption.js +0 -23
- package/src/node/body/axiom.js +0 -7
- package/src/node/body/conjecture.js +0 -7
- package/src/node/body/lemma.js +0 -7
- package/src/node/body/metaLemma.js +0 -7
- package/src/node/body/metatheorem.js +0 -7
- package/src/node/body/rule.js +0 -42
- package/src/node/body/theorem.js +0 -7
- package/src/node/body.js +0 -30
- package/src/node/combinator.js +0 -16
- package/src/node/conclusion.js +0 -23
- package/src/node/constructor.js +0 -16
- package/src/node/declaration/combinator.js +0 -16
- package/src/node/declaration/complexType.js +0 -88
- package/src/node/declaration/constructor.js +0 -46
- package/src/node/declaration/metavariable.js +0 -30
- package/src/node/declaration/property.js +0 -42
- package/src/node/declaration/simpleType.js +0 -87
- package/src/node/declaration/typePrefix.js +0 -24
- package/src/node/declaration/variable.js +0 -53
- package/src/node/declaration.js +0 -7
- package/src/node/deduction.js +0 -23
- package/src/node/derivation.js +0 -19
- package/src/node/document.js +0 -7
- package/src/node/equality.js +0 -35
- package/src/node/equivalence.js +0 -16
- package/src/node/equivalences.js +0 -7
- package/src/node/error.js +0 -7
- package/src/node/frame.js +0 -40
- package/src/node/header/axiom.js +0 -16
- package/src/node/header/conjecture.js +0 -7
- package/src/node/header/lemma.js +0 -7
- package/src/node/header/metaLemma.js +0 -7
- package/src/node/header/metatheorem.js +0 -7
- package/src/node/header/rule.js +0 -7
- package/src/node/header/theorem.js +0 -7
- package/src/node/header.js +0 -54
- package/src/node/hypothesis.js +0 -23
- package/src/node/judgement.js +0 -30
- package/src/node/label.js +0 -16
- package/src/node/labels.js +0 -16
- package/src/node/metaArgument.js +0 -16
- package/src/node/metaType.js +0 -26
- package/src/node/metavariable.js +0 -42
- package/src/node/parameter.js +0 -51
- package/src/node/parenthesisedLabel.js +0 -16
- package/src/node/parenthesisedLabels.js +0 -23
- package/src/node/placeholder.js +0 -7
- package/src/node/procedureCall.js +0 -30
- package/src/node/procedureReference.js +0 -26
- package/src/node/proof.js +0 -16
- package/src/node/proofAssertion/premise.js +0 -16
- package/src/node/proofAssertion/step.js +0 -52
- package/src/node/proofAssertion/supposition.js +0 -16
- package/src/node/proofAssertion.js +0 -23
- package/src/node/property.js +0 -28
- package/src/node/propertyRelation.js +0 -30
- package/src/node/qualification.js +0 -23
- package/src/node/reference.js +0 -16
- package/src/node/rule.js +0 -51
- package/src/node/section.js +0 -44
- package/src/node/signature.js +0 -16
- package/src/node/statement.js +0 -167
- package/src/node/subDerivation.js +0 -19
- package/src/node/subproof.js +0 -35
- package/src/node/substitution/frame.js +0 -37
- package/src/node/substitution/reference.js +0 -38
- package/src/node/substitution/statement.js +0 -70
- package/src/node/substitution/term.js +0 -38
- package/src/node/substitution.js +0 -7
- package/src/node/term.js +0 -75
- package/src/node/topLevelAssertion/axiom.js +0 -13
- package/src/node/topLevelAssertion/conjecture.js +0 -13
- package/src/node/topLevelAssertion/lemma.js +0 -13
- package/src/node/topLevelAssertion/theorem.js +0 -13
- package/src/node/topLevelAssertion.js +0 -58
- package/src/node/topLevelMetaAssertion/metaLemma.js +0 -13
- package/src/node/topLevelMetaAssertion/metatheorem.js +0 -13
- package/src/node/topLevelMetaAssertion.js +0 -51
- package/src/node/type.js +0 -74
- package/src/node/typePrefix.js +0 -26
- package/src/node/types.js +0 -16
- package/src/node/variable.js +0 -26
- package/src/nominal/lexer.js +0 -5
- package/src/nominal/parser.js +0 -12
- package/src/nonTerminalNodeMap.js +0 -261
- package/src/pass/zip.js +0 -19
- package/src/preamble.js +0 -64
- package/src/process/assign.js +0 -53
- package/src/process/discharge.js +0 -33
- package/src/process/equate.js +0 -94
- package/src/process/instantiate.js +0 -198
- package/src/process/unification.js +0 -332
- package/src/process/unify.js +0 -504
- package/src/process/validate.js +0 -174
- package/src/process/validation.js +0 -410
- package/src/process/verify.js +0 -299
- package/src/ruleNames.js +0 -86
- package/src/tokenTypes.js +0 -4
- package/src/utilities/assignment.js +0 -57
- package/src/utilities/bnf.js +0 -20
- package/src/utilities/brackets.js +0 -87
- package/src/utilities/breakPoint.js +0 -29
- package/src/utilities/context.js +0 -223
- package/src/utilities/element.js +0 -2293
- package/src/utilities/equivalence.js +0 -25
- package/src/utilities/equivalences.js +0 -158
- package/src/utilities/instance.js +0 -40
- package/src/utilities/json.js +0 -1273
- package/src/utilities/string.js +0 -282
- package/src/utilities/substitutions.js +0 -93
- package/src/utilities/synoptic.js +0 -135
- package/src/utilities/type.js +0 -19
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
import { Element, asynchronousUtilities } from "occam-languages";
|
|
5
|
-
|
|
6
|
-
import { enclose } from "../utilities/context";
|
|
7
|
-
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
8
|
-
import { topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction } from "../utilities/string";
|
|
9
|
-
import { labelsFromJSON,
|
|
10
|
-
deductionFromJSON,
|
|
11
|
-
signatureFromJSON,
|
|
12
|
-
labelsToLabelsJSON,
|
|
13
|
-
hypothesesFromJSON,
|
|
14
|
-
suppositionsFromJSON,
|
|
15
|
-
deductionToDeductionJSON,
|
|
16
|
-
signatureToSignatureJSON,
|
|
17
|
-
hypothesesToHypothesesJSON,
|
|
18
|
-
suppositionsToSuppositionsJSON } from "../utilities/json";
|
|
19
|
-
|
|
20
|
-
const { reverse } = arrayUtilities,
|
|
21
|
-
{ asyncEvery, asyncExtract, asyncForwardsEvery, asyncBackwardsEvery } = asynchronousUtilities;
|
|
22
|
-
|
|
23
|
-
export default class TopLevelAssertion extends Element {
|
|
24
|
-
constructor(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses) {
|
|
25
|
-
super(context, string, node, breakPoint);
|
|
26
|
-
|
|
27
|
-
this.labels = labels;
|
|
28
|
-
this.suppositions = suppositions;
|
|
29
|
-
this.deduction = deduction;
|
|
30
|
-
this.proof = proof;
|
|
31
|
-
this.signature = signature;
|
|
32
|
-
this.hypotheses = hypotheses;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getLabels() {
|
|
36
|
-
return this.labels;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getSuppositions() {
|
|
40
|
-
return this.suppositions;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getDeduction() {
|
|
44
|
-
return this.deduction;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getProof() {
|
|
48
|
-
return this.proof;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
getSignature() {
|
|
52
|
-
return this.signature;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
getHypotheses() {
|
|
56
|
-
return this.hypotheses;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
setHypotheses(hypotheses) {
|
|
60
|
-
this.hypotheses = hypotheses;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getSupposition(index) {
|
|
64
|
-
const supposition = this.suppositions[index] || null;
|
|
65
|
-
|
|
66
|
-
return supposition;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
isSatisfiable() {
|
|
70
|
-
const satisfiable = false;
|
|
71
|
-
|
|
72
|
-
return satisfiable;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
isHypothetical() {
|
|
76
|
-
const hypothesesLength = this.hypotheses.length,
|
|
77
|
-
hypothetical = (hypothesesLength > 0);
|
|
78
|
-
|
|
79
|
-
return hypothetical;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
isUnconditional() {
|
|
83
|
-
const suppositionsLength = this.suppositions.length,
|
|
84
|
-
unconditional = (suppositionsLength === 0);
|
|
85
|
-
|
|
86
|
-
return unconditional;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
matchMetavariableNode(metavariableNode) {
|
|
90
|
-
const metavariableNodeMatches = this.labels.some((label) => {
|
|
91
|
-
const metavariableNodeMatches = label.matchMetavariableNode(metavariableNode);
|
|
92
|
-
|
|
93
|
-
if (metavariableNodeMatches) {
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
return metavariableNodeMatches;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async verify(context) {
|
|
102
|
-
let verifies = false;
|
|
103
|
-
|
|
104
|
-
const topLevelAssertionString = this.getString(); ///
|
|
105
|
-
|
|
106
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion...`);
|
|
107
|
-
|
|
108
|
-
await enclose(async (context) => {
|
|
109
|
-
const labelsVerify = this.verifyLabels(context);
|
|
110
|
-
|
|
111
|
-
if (labelsVerify) {
|
|
112
|
-
const suppositionsVerify = await this.verifySuppositions(context);
|
|
113
|
-
|
|
114
|
-
if (suppositionsVerify) {
|
|
115
|
-
const deductionVerifies = await this.verifyDeduction(context);
|
|
116
|
-
|
|
117
|
-
if (deductionVerifies) {
|
|
118
|
-
const proofVerifies = await this.verifyProof(context);
|
|
119
|
-
|
|
120
|
-
if (proofVerifies) {
|
|
121
|
-
verifies = true;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, context);
|
|
127
|
-
|
|
128
|
-
if (verifies) {
|
|
129
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion.`);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return verifies;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
verifyLabels(context) {
|
|
136
|
-
let labelsVerify;
|
|
137
|
-
|
|
138
|
-
const topLevelAssertionString = this.getString(); ///
|
|
139
|
-
|
|
140
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's labels...`);
|
|
141
|
-
|
|
142
|
-
labelsVerify = this.labels.every((label) => {
|
|
143
|
-
const labelVerifies = this.verifyLabel(label, context);
|
|
144
|
-
|
|
145
|
-
if (labelVerifies) {
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
if (labelsVerify) {
|
|
151
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's labels.`);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return labelsVerify;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
verifyLabel(label, context) {
|
|
158
|
-
let labelVerifies;
|
|
159
|
-
|
|
160
|
-
const labelString = label.getString(),
|
|
161
|
-
topLevelAssertionString = this.getString(); ///
|
|
162
|
-
|
|
163
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's '${labelString}' label...`);
|
|
164
|
-
|
|
165
|
-
labelVerifies = label.verify();
|
|
166
|
-
|
|
167
|
-
if (labelVerifies) {
|
|
168
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's '${labelString}' label.`);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return labelVerifies;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async verifyProof(context) {
|
|
175
|
-
let proofVerifies;
|
|
176
|
-
|
|
177
|
-
if (this.proof === null) {
|
|
178
|
-
proofVerifies = true;
|
|
179
|
-
} else {
|
|
180
|
-
const topLevelAssertionString = this.getString(); ///
|
|
181
|
-
|
|
182
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's proof...`);
|
|
183
|
-
|
|
184
|
-
const statement = this.deduction.getStatement();
|
|
185
|
-
|
|
186
|
-
proofVerifies = await this.proof.verify(statement, context);
|
|
187
|
-
|
|
188
|
-
if (proofVerifies) {
|
|
189
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's proof.`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return proofVerifies;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
async verifyDeduction(context) {
|
|
197
|
-
let deductionVerifies;
|
|
198
|
-
|
|
199
|
-
const deductionString = this.deduction.getString(),
|
|
200
|
-
topLevelAssertionString = this.getString(); ///
|
|
201
|
-
|
|
202
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's '${deductionString}' deduction...`);
|
|
203
|
-
|
|
204
|
-
deductionVerifies = await this.deduction.verify(context);
|
|
205
|
-
|
|
206
|
-
if (deductionVerifies) {
|
|
207
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's '${deductionString}' deduction.`);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return deductionVerifies;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async verifySupposition(supposition, context) {
|
|
214
|
-
let suppositionVerifies;
|
|
215
|
-
|
|
216
|
-
const suppositionString = supposition.getString(),
|
|
217
|
-
topLevelAssertionString = this.getString(); ///
|
|
218
|
-
|
|
219
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's '${suppositionString}' supposition...`);
|
|
220
|
-
|
|
221
|
-
suppositionVerifies = await supposition.verify(context)
|
|
222
|
-
|
|
223
|
-
if (suppositionVerifies) {
|
|
224
|
-
const subproofOrProofAssertion = supposition; ////
|
|
225
|
-
|
|
226
|
-
context.assignAssignments();
|
|
227
|
-
|
|
228
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (suppositionVerifies) {
|
|
232
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's '${suppositionString}' supposition.`);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return suppositionVerifies;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
async verifySuppositions(context) {
|
|
239
|
-
let suppositionsVerify;
|
|
240
|
-
|
|
241
|
-
const topLevelAssertionString = this.getString(); ///
|
|
242
|
-
|
|
243
|
-
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's suppositions...`);
|
|
244
|
-
|
|
245
|
-
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
246
|
-
const suppositionVerifies = await this.verifySupposition(supposition, context);
|
|
247
|
-
|
|
248
|
-
if (suppositionVerifies) {
|
|
249
|
-
return true;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
if (suppositionsVerify) {
|
|
254
|
-
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's suppositions.`);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return suppositionsVerify;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
async dischargeHypothesis(hypothesis, context) {
|
|
261
|
-
let hypothesisDischarged;
|
|
262
|
-
|
|
263
|
-
await this.break(context);
|
|
264
|
-
|
|
265
|
-
const hypothesisString = hypothesis.getString(),
|
|
266
|
-
topLevelAssertionString = this.getString(); ///
|
|
267
|
-
|
|
268
|
-
context.trace(`Discharding the '${topLevelAssertionString}' top level assertion's '${hypothesisString}' hypothesis... `);
|
|
269
|
-
|
|
270
|
-
hypothesisDischarged = hypothesis.discharge(context);
|
|
271
|
-
|
|
272
|
-
if (hypothesisDischarged) {
|
|
273
|
-
context.trace(`...discharged the '${topLevelAssertionString}' top level assertion's '${hypothesisString}' hypothesis. `);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return hypothesisDischarged;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
async dischargeHypotheses(context) {
|
|
280
|
-
const hypotheses = this.getHypotheses(),
|
|
281
|
-
hypothesesDischarged = await asyncEvery(hypotheses, async (hypothesis) => {
|
|
282
|
-
const hypothesisDischarged = await this.dischargeHypothesis(hypothesis, context);
|
|
283
|
-
|
|
284
|
-
if (hypothesisDischarged) {
|
|
285
|
-
return true;
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
return hypothesesDischarged;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
async unifyStepWithDeduction(step, context) {
|
|
293
|
-
let stepUnifiesWithDeduction = false;
|
|
294
|
-
|
|
295
|
-
await this.break(context);
|
|
296
|
-
|
|
297
|
-
const stepString = step.getString(),
|
|
298
|
-
topLevelAssertionString = this.getString(); ///
|
|
299
|
-
|
|
300
|
-
context.trace(`Unifying the '${stepString}' step with the '${topLevelAssertionString}' top level assertion's deduction...`);
|
|
301
|
-
|
|
302
|
-
const stepUnifies = this.deduction.unifyStep(step, context);
|
|
303
|
-
|
|
304
|
-
if (stepUnifies) {
|
|
305
|
-
stepUnifiesWithDeduction = true;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (stepUnifiesWithDeduction) {
|
|
309
|
-
context.debug(`...unified the '${stepString}' step with the '${topLevelAssertionString}' top level assertion's deduction.`);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return stepUnifiesWithDeduction;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
async unifyStepAndSubproofOrProofAssertions(step, subproofOrProofAssertions, context) {
|
|
316
|
-
let stepAndSubproofOrProofAssertionsUnify = false;
|
|
317
|
-
|
|
318
|
-
const stepUnifiesWithDeduction = await this.unifyStepWithDeduction(step, context);
|
|
319
|
-
|
|
320
|
-
if (stepUnifiesWithDeduction) {
|
|
321
|
-
const hypothesesDischarged = await this.dischargeHypotheses(context);
|
|
322
|
-
|
|
323
|
-
if (hypothesesDischarged) {
|
|
324
|
-
const subproofOrProofAssertionsUnifiesWithSuppositions = await this.unifySubproofOrProofAssertionsWithSuppositions(subproofOrProofAssertions, context);
|
|
325
|
-
|
|
326
|
-
if (subproofOrProofAssertionsUnifiesWithSuppositions) {
|
|
327
|
-
const derivedSubstitutionsResolved = context.areDerivedSubstitutionsResolved();
|
|
328
|
-
|
|
329
|
-
if (derivedSubstitutionsResolved) {
|
|
330
|
-
stepAndSubproofOrProofAssertionsUnify = true;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
return stepAndSubproofOrProofAssertionsUnify;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
async unifySubproofOrProofAssertionsWithSupposition(subproofOrProofAssertions, supposition, context) {
|
|
340
|
-
let subproofOrProofAssertionsUnifiesWithSupposition = false;
|
|
341
|
-
|
|
342
|
-
await this.break(context);
|
|
343
|
-
|
|
344
|
-
if (!subproofOrProofAssertionsUnifiesWithSupposition) {
|
|
345
|
-
const subproofOrProofAssertion = await asyncExtract(subproofOrProofAssertions, async (subproofOrProofAssertion) => {
|
|
346
|
-
const subproofOrProofAssertionUnifies = await supposition.unifySubproofOrProofAssertion(subproofOrProofAssertion, context);
|
|
347
|
-
|
|
348
|
-
if (subproofOrProofAssertionUnifies) {
|
|
349
|
-
context.resolveDerivedSubstitutions();
|
|
350
|
-
|
|
351
|
-
return true;
|
|
352
|
-
}
|
|
353
|
-
}) || null;
|
|
354
|
-
|
|
355
|
-
if (subproofOrProofAssertion !== null) {
|
|
356
|
-
subproofOrProofAssertionsUnifiesWithSupposition = true;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (!subproofOrProofAssertionsUnifiesWithSupposition) {
|
|
361
|
-
const suppositionUnifiesIndependently = await supposition.unifyIndependently(context);
|
|
362
|
-
|
|
363
|
-
if (suppositionUnifiesIndependently) {
|
|
364
|
-
subproofOrProofAssertionsUnifiesWithSupposition = true;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
return subproofOrProofAssertionsUnifiesWithSupposition;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
async unifySubproofOrProofAssertionsWithSuppositions(subproofOrProofAssertions, context) {
|
|
372
|
-
let subproofOrProofAssertionsUnifiesWithSuppositions;
|
|
373
|
-
|
|
374
|
-
subproofOrProofAssertions = reverse(subproofOrProofAssertions); ///
|
|
375
|
-
|
|
376
|
-
subproofOrProofAssertionsUnifiesWithSuppositions = await asyncBackwardsEvery(this.suppositions, async (supposition) => {
|
|
377
|
-
const stepUnifiesWithSupposition = await this.unifySubproofOrProofAssertionsWithSupposition(subproofOrProofAssertions, supposition, context);
|
|
378
|
-
|
|
379
|
-
if (stepUnifiesWithSupposition) {
|
|
380
|
-
return true;
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
return subproofOrProofAssertionsUnifiesWithSuppositions;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
toJSON() {
|
|
388
|
-
const labelsJSON = labelsToLabelsJSON(this.labels),
|
|
389
|
-
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
390
|
-
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
391
|
-
signatureJSON = signatureToSignatureJSON(this.signature),
|
|
392
|
-
hypothesesJSON = hypothesesToHypothesesJSON(this.hypotheses),
|
|
393
|
-
string = this.getString();
|
|
394
|
-
|
|
395
|
-
let breakPoint;
|
|
396
|
-
|
|
397
|
-
breakPoint = this.getBreakPoint();
|
|
398
|
-
|
|
399
|
-
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
400
|
-
|
|
401
|
-
breakPoint = breakPointJSON; ///
|
|
402
|
-
|
|
403
|
-
const labels = labelsJSON, ///
|
|
404
|
-
deduction = deductionJSON, ///
|
|
405
|
-
suppositions = suppositionsJSON, ///
|
|
406
|
-
signature = signatureJSON, ///
|
|
407
|
-
hypotheses = hypothesesJSON, ///
|
|
408
|
-
json = {
|
|
409
|
-
string,
|
|
410
|
-
breakPoint,
|
|
411
|
-
labels,
|
|
412
|
-
deduction,
|
|
413
|
-
suppositions,
|
|
414
|
-
signature,
|
|
415
|
-
hypotheses
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
return json;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
static fromJSON(Class, json, context) {
|
|
422
|
-
const labels = labelsFromJSON(json, context),
|
|
423
|
-
deduction = deductionFromJSON(json, context),
|
|
424
|
-
suppositions = suppositionsFromJSON(json, context),
|
|
425
|
-
signature = signatureFromJSON(json, context),
|
|
426
|
-
hypotheses = hypothesesFromJSON(json, context),
|
|
427
|
-
topLevelAssertionString = topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction),
|
|
428
|
-
string = topLevelAssertionString, ///
|
|
429
|
-
node = null,
|
|
430
|
-
breakPoint = breakPointFromJSON(json),
|
|
431
|
-
proof = null,
|
|
432
|
-
topLevelAssertion = new Class(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
433
|
-
|
|
434
|
-
return topLevelAssertion;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TopLevelMetaAssertion from "./../topLevelMetaAssertion";
|
|
4
|
-
|
|
5
|
-
import { define } from "../../elements";
|
|
6
|
-
|
|
7
|
-
export default define(class MetaLemma extends TopLevelMetaAssertion {
|
|
8
|
-
getMetaLemmaNode() {
|
|
9
|
-
const node = this.getNode(),
|
|
10
|
-
metaLemmaNode = node; ///
|
|
11
|
-
|
|
12
|
-
return metaLemmaNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async verify(context) {
|
|
16
|
-
let verifies;
|
|
17
|
-
|
|
18
|
-
await this.break(context);
|
|
19
|
-
|
|
20
|
-
const metaLemmaString = this.getString(); ///
|
|
21
|
-
|
|
22
|
-
context.trace(`Verifying the '${metaLemmaString}' meta-lemma...`);
|
|
23
|
-
|
|
24
|
-
verifies = super.verify(context);
|
|
25
|
-
|
|
26
|
-
if (verifies) {
|
|
27
|
-
const metaTheorem = this; ///
|
|
28
|
-
|
|
29
|
-
context.addMetatheorem(metaTheorem);
|
|
30
|
-
|
|
31
|
-
context.debug(`...verified the '${metaLemmaString}' meta-lemma.`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return verifies;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static name = "MetaLemma";
|
|
38
|
-
|
|
39
|
-
static fromJSON(json, context) { return TopLevelMetaAssertion.fromJSON(MetaLemma, json, context); }
|
|
40
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TopLevelMetaAssertion from "../topLevelMetaAssertion";
|
|
4
|
-
|
|
5
|
-
import { define } from "../../elements";
|
|
6
|
-
|
|
7
|
-
export default define(class Metatheorem extends TopLevelMetaAssertion {
|
|
8
|
-
getMetatheoremNode() {
|
|
9
|
-
const node = this.getNode(),
|
|
10
|
-
metatheoremNode = node; ///
|
|
11
|
-
|
|
12
|
-
return metatheoremNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async verify(context) {
|
|
16
|
-
let verifies;
|
|
17
|
-
|
|
18
|
-
await this.break(context);
|
|
19
|
-
|
|
20
|
-
const metaLemmaString = this.getString(); ///
|
|
21
|
-
|
|
22
|
-
context.trace(`Verifying the '${metaLemmaString}' metatheorem...`);
|
|
23
|
-
|
|
24
|
-
verifies = super.verify(context);
|
|
25
|
-
|
|
26
|
-
if (verifies) {
|
|
27
|
-
const metaTheorem = this; ///
|
|
28
|
-
|
|
29
|
-
context.addMetatheorem(metaTheorem);
|
|
30
|
-
|
|
31
|
-
context.debug(`...verified the '${metaLemmaString}' metatheorem.`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return verifies;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static name = "Metatheorem";
|
|
38
|
-
|
|
39
|
-
static fromJSON(json, context) { return TopLevelMetaAssertion.fromJSON(Metatheorem, json, context); }
|
|
40
|
-
});
|