occam-verify-cli 1.0.983 → 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 +10 -11
- 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
package/src/element/term.js
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Element } from "occam-languages";
|
|
4
|
-
import { arrayUtilities } from "necessary";
|
|
5
|
-
|
|
6
|
-
import { define } from "../elements";
|
|
7
|
-
import { instantiate } from "../utilities/context";
|
|
8
|
-
import { validateTerms } from "../process/validation";
|
|
9
|
-
import { instantiateTerm } from "../process/instantiate";
|
|
10
|
-
import { variablesFromTerm } from "../utilities/equivalence";
|
|
11
|
-
import { unifyTermIntrinsically } from "../process/unify";
|
|
12
|
-
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
13
|
-
import { typeFromJSON, typeToTypeJSON, provisionalFromJSON, provisionalToProvisionalJSON } from "../utilities/json";
|
|
14
|
-
|
|
15
|
-
const { filter } = arrayUtilities;
|
|
16
|
-
|
|
17
|
-
export default define(class Term extends Element {
|
|
18
|
-
constructor(context, string, node, breakPoint, type, provisional) {
|
|
19
|
-
super(context, string, node, breakPoint, provisional);
|
|
20
|
-
|
|
21
|
-
this.type = type;
|
|
22
|
-
this.provisional = provisional;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
getType() {
|
|
26
|
-
return this.type;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
isProvisional() {
|
|
30
|
-
return this.provisional;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
setType(type) {
|
|
34
|
-
this.type = type;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
setProvisional(provisional) {
|
|
38
|
-
this.provisional = provisional;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
getTermNode() {
|
|
42
|
-
const node = this.getNode(),
|
|
43
|
-
termNode = node; ///
|
|
44
|
-
|
|
45
|
-
return termNode;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
getVariableNode() {
|
|
49
|
-
const termNode = this.getTermNode(),
|
|
50
|
-
variableNode = termNode.getVariableNode();
|
|
51
|
-
|
|
52
|
-
return variableNode;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
getVariableIdentifier() {
|
|
56
|
-
const termNode = this.getTermNode(),
|
|
57
|
-
variableIdentifier = termNode.getVariableIdentifier();
|
|
58
|
-
|
|
59
|
-
return variableIdentifier;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
isEstablished() {
|
|
63
|
-
const provisional = this.isProvisional(),
|
|
64
|
-
established = !provisional;
|
|
65
|
-
|
|
66
|
-
return established;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
isEqualTo(term) {
|
|
70
|
-
const termNode = term.getNode(),
|
|
71
|
-
termNodeMatches = this.matchTermNode(termNode),
|
|
72
|
-
equalTo = termNodeMatches; ///
|
|
73
|
-
|
|
74
|
-
return equalTo;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
isGrounded(definedVariables, context) {
|
|
78
|
-
const term = this, ///
|
|
79
|
-
variables = variablesFromTerm(term, context);
|
|
80
|
-
|
|
81
|
-
filter(variables, (variable) => {
|
|
82
|
-
const definedVariablesIncludesVariable = definedVariables.includes(variable);
|
|
83
|
-
|
|
84
|
-
if (!definedVariablesIncludesVariable) {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const undefinedVariables = variables, ///
|
|
90
|
-
undefinedVariablesLength = undefinedVariables.length,
|
|
91
|
-
grounded = (undefinedVariablesLength <= 1);
|
|
92
|
-
|
|
93
|
-
return grounded;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
isSingular() {
|
|
97
|
-
const termNode = this.getTermNode(),
|
|
98
|
-
singular = termNode.isSingular();
|
|
99
|
-
|
|
100
|
-
return singular;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
isInitiallyGrounded(context) {
|
|
104
|
-
const term = this, ///
|
|
105
|
-
variables = variablesFromTerm(term, context),
|
|
106
|
-
variablesLength = variables.length,
|
|
107
|
-
initiallyGrounded = (variablesLength === 0);
|
|
108
|
-
|
|
109
|
-
return initiallyGrounded;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
isImplicitlyGrounded(definedVariables, context) {
|
|
113
|
-
const grounded = this.isGrounded(definedVariables, context),
|
|
114
|
-
implicitlyGrounded = grounded; ///
|
|
115
|
-
|
|
116
|
-
return implicitlyGrounded;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
matchTermNode(termNode) {
|
|
120
|
-
const node = termNode, ///
|
|
121
|
-
nodeMatches = this.matchNode(node),
|
|
122
|
-
termNodeMatches = nodeMatches; ///
|
|
123
|
-
|
|
124
|
-
return termNodeMatches;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
matchVariableNode(variableNode) {
|
|
128
|
-
let variableNodeMatches = false;
|
|
129
|
-
|
|
130
|
-
const singular = this.isSingular();
|
|
131
|
-
|
|
132
|
-
if (singular) {
|
|
133
|
-
const variableNodeA = variableNode; ///
|
|
134
|
-
|
|
135
|
-
variableNode = this.getVariableNode();
|
|
136
|
-
|
|
137
|
-
const variableNodeB = variableNode, ///
|
|
138
|
-
variableNodeAMatchesVariableNodeB = variableNodeA.match(variableNodeB);
|
|
139
|
-
|
|
140
|
-
if (variableNodeAMatchesVariableNodeB) {
|
|
141
|
-
variableNodeMatches = true; ///
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return variableNodeMatches;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
compareTerm(term) {
|
|
149
|
-
const termNode = term.getNode(),
|
|
150
|
-
termNodeMatches = this.matchNode(termNode),
|
|
151
|
-
comparesTo = termNodeMatches; ///
|
|
152
|
-
|
|
153
|
-
return comparesTo;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
compareParameter(parameter) {
|
|
157
|
-
let comparesToParamter = false;
|
|
158
|
-
|
|
159
|
-
const singular = this.isSingular();
|
|
160
|
-
|
|
161
|
-
if (singular) {
|
|
162
|
-
const parameterIdentifier = parameter.getIdentifier();
|
|
163
|
-
|
|
164
|
-
if (parameterIdentifier !== null) {
|
|
165
|
-
const variableIdentifier = this.getVariableIdentifier();
|
|
166
|
-
|
|
167
|
-
if (parameterIdentifier === variableIdentifier) {
|
|
168
|
-
comparesToParamter = true;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return comparesToParamter;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
findValidTerm(context) {
|
|
177
|
-
const termNode = this.getTermNode(),
|
|
178
|
-
term = context.findTermByTermNode(termNode),
|
|
179
|
-
validTerm = term; ///
|
|
180
|
-
|
|
181
|
-
return validTerm;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
validate(context, validateForwards) {
|
|
185
|
-
let term = null;
|
|
186
|
-
|
|
187
|
-
const termString = this.getString(); ///
|
|
188
|
-
|
|
189
|
-
context.trace(`Validating the '${termString}' term...`);
|
|
190
|
-
|
|
191
|
-
let validates = false;
|
|
192
|
-
|
|
193
|
-
const validTerm = this.findValidTerm(context);
|
|
194
|
-
|
|
195
|
-
if (validTerm !== null) {
|
|
196
|
-
term = validTerm; ///
|
|
197
|
-
|
|
198
|
-
const validatesForward = validateForwards(term, context);
|
|
199
|
-
|
|
200
|
-
if (validatesForward) {
|
|
201
|
-
validates = true;
|
|
202
|
-
|
|
203
|
-
context.debug(`...the '${termString}' term is already valid.`);
|
|
204
|
-
} else {
|
|
205
|
-
term = null;
|
|
206
|
-
}
|
|
207
|
-
} else {
|
|
208
|
-
validates = validateTerms.some((validateTerm) => { ///
|
|
209
|
-
const term = this, ///
|
|
210
|
-
termValidates = validateTerm(term, context, validateForwards);
|
|
211
|
-
|
|
212
|
-
if (termValidates) {
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
if (validates) {
|
|
218
|
-
term = this; ///
|
|
219
|
-
|
|
220
|
-
context.addTerm(term);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (validates) {
|
|
225
|
-
context.debug(`...validated the '${termString}' term.`);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return term;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
validateGivenType(type, context) {
|
|
232
|
-
let term;
|
|
233
|
-
|
|
234
|
-
const typeString = type.getString(),
|
|
235
|
-
termString = this.getString(); ///
|
|
236
|
-
|
|
237
|
-
context.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
|
|
238
|
-
|
|
239
|
-
let validatesGivenType = false;
|
|
240
|
-
|
|
241
|
-
term = this.validate(context, (term, context) => {
|
|
242
|
-
let validatesForwards = false;
|
|
243
|
-
|
|
244
|
-
const termType = term.getType(),
|
|
245
|
-
termTypeEqualToOrSubTypeOfType = termType.isEqualToOrSubTypeOf(type);
|
|
246
|
-
|
|
247
|
-
if (termTypeEqualToOrSubTypeOfType) {
|
|
248
|
-
validatesForwards = true;
|
|
249
|
-
|
|
250
|
-
const typeEstablished = type.isEstablished(),
|
|
251
|
-
termProvisional = term.isProvisional();
|
|
252
|
-
|
|
253
|
-
if (typeEstablished && termProvisional) {
|
|
254
|
-
validatesForwards = false;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return validatesForwards;
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
if (term !== null) {
|
|
262
|
-
validatesGivenType = true;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (validatesGivenType) {
|
|
266
|
-
context.debug(`...validated the '${termString}' term given the '${typeString}' type.`);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return term;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
unifyTerm(term, generalContext, specificContext) {
|
|
273
|
-
let termUnifies = false;
|
|
274
|
-
|
|
275
|
-
const context = specificContext, ///
|
|
276
|
-
generalTerm = this,
|
|
277
|
-
specificTerm = term,
|
|
278
|
-
generalTermString = generalTerm.getString(),
|
|
279
|
-
specifixTermString = specificTerm.getString();
|
|
280
|
-
|
|
281
|
-
context.trace(`Unifying the '${specifixTermString}' term with the '${generalTermString}' term...`);
|
|
282
|
-
|
|
283
|
-
const termUnifiesIntrinsically = unifyTermIntrinsically(generalTerm, specificTerm, generalContext, specificContext);
|
|
284
|
-
|
|
285
|
-
if (termUnifiesIntrinsically) {
|
|
286
|
-
termUnifies = true;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (termUnifies) {
|
|
290
|
-
context.debug(`...unified the '${specifixTermString}' term with the '${generalTermString}' term.`);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return termUnifies;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
toJSON() {
|
|
297
|
-
const typeJSON = typeToTypeJSON(this.type),
|
|
298
|
-
provisionalJSON = provisionalToProvisionalJSON(this.provisional),
|
|
299
|
-
string = this.getString();
|
|
300
|
-
|
|
301
|
-
let breakPoint;
|
|
302
|
-
|
|
303
|
-
breakPoint = this.getBreakPoint();
|
|
304
|
-
|
|
305
|
-
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
306
|
-
|
|
307
|
-
breakPoint = breakPointJSON; ///
|
|
308
|
-
|
|
309
|
-
const type = typeJSON, ///
|
|
310
|
-
provisional = provisionalJSON, ///
|
|
311
|
-
json = {
|
|
312
|
-
string,
|
|
313
|
-
breakPoint,
|
|
314
|
-
type,
|
|
315
|
-
provisional
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
return json;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
static name = "Term";
|
|
322
|
-
|
|
323
|
-
static fromJSON(json, context) {
|
|
324
|
-
return instantiate((context) => {
|
|
325
|
-
const { string } = json,
|
|
326
|
-
termNode = instantiateTerm(string, context),
|
|
327
|
-
node = termNode, ///
|
|
328
|
-
breakPoint = breakPointFromJSON(json),
|
|
329
|
-
type = typeFromJSON(json, context),
|
|
330
|
-
provisional = provisionalFromJSON(json, context);
|
|
331
|
-
|
|
332
|
-
context = null;
|
|
333
|
-
|
|
334
|
-
const term = new Term(context, string, node, breakPoint, type, provisional);
|
|
335
|
-
|
|
336
|
-
return term;
|
|
337
|
-
}, context);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { asynchronousUtilities } from "occam-languages";
|
|
4
|
-
|
|
5
|
-
import TopLevelAssertion from "../topLevelAssertion";
|
|
6
|
-
|
|
7
|
-
import { define } from "../../elements";
|
|
8
|
-
import { reconcile } from "../../utilities/context";
|
|
9
|
-
|
|
10
|
-
const { asyncMatch } = asynchronousUtilities;
|
|
11
|
-
|
|
12
|
-
export default define(class Axiom extends TopLevelAssertion {
|
|
13
|
-
getAxiomNode() {
|
|
14
|
-
const node = this.getNode(),
|
|
15
|
-
axiomNode = node; ///
|
|
16
|
-
|
|
17
|
-
return axiomNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
isSatisfiable() {
|
|
21
|
-
const signature = this.getSignature(),
|
|
22
|
-
satisfiable = (signature !== null);
|
|
23
|
-
|
|
24
|
-
return satisfiable;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async verify(context) {
|
|
28
|
-
let verifies;
|
|
29
|
-
|
|
30
|
-
await this.break(context);
|
|
31
|
-
|
|
32
|
-
const axiomString = this.getString(); ///
|
|
33
|
-
|
|
34
|
-
context.trace(`Verifying the '${axiomString}' axiom...`);
|
|
35
|
-
|
|
36
|
-
const signatureVerifies = this.verifySignature(context);
|
|
37
|
-
|
|
38
|
-
if (signatureVerifies) {
|
|
39
|
-
verifies = await super.verify(context);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (verifies) {
|
|
43
|
-
const axiom = this; ///
|
|
44
|
-
|
|
45
|
-
context.addAxiom(axiom);
|
|
46
|
-
|
|
47
|
-
context.debug(`...verified the '${axiomString}' axiom.`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return verifies;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
verifySignature(context) {
|
|
54
|
-
let signatureVerifies;
|
|
55
|
-
|
|
56
|
-
const satisfiable = this.isSatisfiable();
|
|
57
|
-
|
|
58
|
-
if (satisfiable) {
|
|
59
|
-
const axiomString = this.getString(); ///
|
|
60
|
-
|
|
61
|
-
context.trace(`Verifying the '${axiomString}' axiom's signature...`);
|
|
62
|
-
|
|
63
|
-
const signature = this.getSignature();
|
|
64
|
-
|
|
65
|
-
signatureVerifies = signature.verify(context);
|
|
66
|
-
|
|
67
|
-
if (signatureVerifies) {
|
|
68
|
-
context.trace(`...verified the '${axiomString}' axiom's signature.`);
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
signatureVerifies = true
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return signatureVerifies;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
unifySignature(signature, context) {
|
|
78
|
-
let signatureUnifies;
|
|
79
|
-
|
|
80
|
-
const axiomString = this.getString(), ///
|
|
81
|
-
signatureString = signature.getString();
|
|
82
|
-
|
|
83
|
-
context.trace(`Unifying the '${signatureString}' signature with the '${axiomString}' axiom...`);
|
|
84
|
-
|
|
85
|
-
const specificSignature = signature; ///
|
|
86
|
-
|
|
87
|
-
signature = this.getSignature();
|
|
88
|
-
|
|
89
|
-
const generalSignature = signature; ///
|
|
90
|
-
|
|
91
|
-
signatureUnifies = generalSignature.unifySignature(specificSignature, context);
|
|
92
|
-
|
|
93
|
-
if (signatureUnifies) {
|
|
94
|
-
context.debug(`...unified the '${signatureString}' signature with the '${axiomString}' axiom.`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return signatureUnifies;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async unifyDeduction(deduction, context) {
|
|
101
|
-
let deductionUnifies;
|
|
102
|
-
|
|
103
|
-
await this.break(context);
|
|
104
|
-
|
|
105
|
-
const axiomString = this.getString(), ///
|
|
106
|
-
generalDeduction = this.deduction, ///
|
|
107
|
-
specificDeduction = deduction, ///
|
|
108
|
-
generalDeductionString = generalDeduction.getString(),
|
|
109
|
-
specificDeductionString = specificDeduction.getString();
|
|
110
|
-
|
|
111
|
-
context.trace(`Unifying the '${specificDeductionString}' deduction with the '${axiomString}' axiom's '${generalDeductionString}' deduction...`);
|
|
112
|
-
|
|
113
|
-
const generalDeductionContext = generalDeduction.getContext(),
|
|
114
|
-
specificDeductionContext = specificDeduction.getContext(),
|
|
115
|
-
generalContext = generalDeductionContext, ///
|
|
116
|
-
specificContext = specificDeductionContext; ///
|
|
117
|
-
|
|
118
|
-
reconcile((specificContext) => {
|
|
119
|
-
let statement;
|
|
120
|
-
|
|
121
|
-
statement = specificDeduction.getStatement();
|
|
122
|
-
|
|
123
|
-
const specificStatement = statement; ///
|
|
124
|
-
|
|
125
|
-
statement = generalDeduction.getStatement();
|
|
126
|
-
|
|
127
|
-
const generalStatement = statement, ///
|
|
128
|
-
statementUnifies = generalStatement.unifyStatement(specificStatement, generalContext, specificContext);
|
|
129
|
-
|
|
130
|
-
if (statementUnifies) {
|
|
131
|
-
specificContext.commit(context);
|
|
132
|
-
|
|
133
|
-
deductionUnifies = true;
|
|
134
|
-
}
|
|
135
|
-
}, specificContext);
|
|
136
|
-
|
|
137
|
-
if (deductionUnifies) {
|
|
138
|
-
context.debug(`...unified the '${specificDeductionString}' deduction with the '${axiomString}' axiom's '${generalDeductionString}' deduction.`);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return deductionUnifies;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async unifySupposition(supposition, index, context) {
|
|
145
|
-
let suppositionUnifies = false;
|
|
146
|
-
|
|
147
|
-
const specificSupposition = supposition; ///
|
|
148
|
-
|
|
149
|
-
supposition = this.getSupposition(index);
|
|
150
|
-
|
|
151
|
-
const axiomString = this.getString(), ///
|
|
152
|
-
generalSupposition = supposition, ///
|
|
153
|
-
generalSuppositionString = generalSupposition.getString(),
|
|
154
|
-
specificSuppositionString = specificSupposition.getString();
|
|
155
|
-
|
|
156
|
-
context.trace(`Unifying the '${specificSuppositionString}' supposition with the '${axiomString}' axiom's '${generalSuppositionString}' supposition...`);
|
|
157
|
-
|
|
158
|
-
const generalSuppositionContext = generalSupposition.getContext(),
|
|
159
|
-
specificSuppositionContext = specificSupposition.getContext(),
|
|
160
|
-
generalContext = generalSuppositionContext, ///
|
|
161
|
-
specificContext = specificSuppositionContext; ///
|
|
162
|
-
|
|
163
|
-
reconcile((specificContext) => {
|
|
164
|
-
let statement;
|
|
165
|
-
|
|
166
|
-
statement = specificSupposition.getStatement();
|
|
167
|
-
|
|
168
|
-
const specificStatement = statement; ///
|
|
169
|
-
|
|
170
|
-
statement = generalSupposition.getStatement();
|
|
171
|
-
|
|
172
|
-
const generalStatement = statement, ///
|
|
173
|
-
statementUnifies = generalStatement.unifyStatement(specificStatement, generalContext, specificContext);
|
|
174
|
-
|
|
175
|
-
if (statementUnifies) {
|
|
176
|
-
specificContext.commit(context);
|
|
177
|
-
|
|
178
|
-
suppositionUnifies = true;
|
|
179
|
-
}
|
|
180
|
-
}, specificContext);
|
|
181
|
-
|
|
182
|
-
if (suppositionUnifies) {
|
|
183
|
-
context.debug(`...unified the '${specificSuppositionString}' supposition with the '${axiomString}' axiom's '${generalSuppositionString}' supposition...`);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return suppositionUnifies;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async unifySuppositions(suppositions, context) {
|
|
190
|
-
let suppositionsUnify;
|
|
191
|
-
|
|
192
|
-
const specificSuppositions = suppositions; ///
|
|
193
|
-
|
|
194
|
-
suppositions = this.getSuppositions();
|
|
195
|
-
|
|
196
|
-
const generalSuppositions = suppositions; ///
|
|
197
|
-
|
|
198
|
-
suppositionsUnify = await asyncMatch(generalSuppositions, specificSuppositions, async (generalSupposition, specificSupposition, index) => {
|
|
199
|
-
const supposition = specificSupposition, ///
|
|
200
|
-
suppositionUnifies = await this.unifySupposition(supposition, index, context);
|
|
201
|
-
|
|
202
|
-
if (suppositionUnifies) {
|
|
203
|
-
return true;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
return suppositionsUnify;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
async unifyTopLevelAssertion(topLevelAssertion, context) {
|
|
211
|
-
let topLevelAssertionUnifies = false;
|
|
212
|
-
|
|
213
|
-
const axiomString = this.getString(), ///
|
|
214
|
-
topLevelAssertionString = topLevelAssertion.getString();
|
|
215
|
-
|
|
216
|
-
context.trace(`Unifying the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom...`);
|
|
217
|
-
|
|
218
|
-
const deduction = topLevelAssertion.getDeduction(),
|
|
219
|
-
deductionUnifies = await this.unifyDeduction(deduction, context);
|
|
220
|
-
|
|
221
|
-
if (deductionUnifies) {
|
|
222
|
-
const hypothesesDischarged = await topLevelAssertion.dischargeHypotheses(context);
|
|
223
|
-
|
|
224
|
-
if (hypothesesDischarged) {
|
|
225
|
-
const suppositions = topLevelAssertion.getSuppositions(),
|
|
226
|
-
suppositionsUnify = await this.unifySuppositions(suppositions, context);
|
|
227
|
-
|
|
228
|
-
if (suppositionsUnify) {
|
|
229
|
-
topLevelAssertionUnifies = true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (topLevelAssertionUnifies) {
|
|
235
|
-
context.debug(`...unified the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom.`);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return topLevelAssertionUnifies;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
static name = "Axiom";
|
|
242
|
-
|
|
243
|
-
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Axiom, json, context); }
|
|
244
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
|
-
|
|
5
|
-
import { define } from "../../elements";
|
|
6
|
-
|
|
7
|
-
export default define(class Conjecture extends TopLevelAssertion {
|
|
8
|
-
getConjectureNode() {
|
|
9
|
-
const node = this.getNode(),
|
|
10
|
-
conjectureNode = node; ///
|
|
11
|
-
|
|
12
|
-
return conjectureNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async verify(context) {
|
|
16
|
-
let verifies;
|
|
17
|
-
|
|
18
|
-
await this.break(context);
|
|
19
|
-
|
|
20
|
-
const conjectureString = this.getString(); ///
|
|
21
|
-
|
|
22
|
-
context.trace(`Verifying the '${conjectureString}' conjecture...`);
|
|
23
|
-
|
|
24
|
-
verifies = await super.verify(context);
|
|
25
|
-
|
|
26
|
-
if (verifies) {
|
|
27
|
-
const conjecture = this; ///
|
|
28
|
-
|
|
29
|
-
context.addConjecture(conjecture);
|
|
30
|
-
|
|
31
|
-
context.debug(`...verified the '${conjectureString}' conjecture.`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return verifies;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static name = "Conjecture";
|
|
38
|
-
|
|
39
|
-
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Conjecture, json, context); }
|
|
40
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
|
-
|
|
5
|
-
import { define } from "../../elements";
|
|
6
|
-
|
|
7
|
-
export default define(class Lemma extends TopLevelAssertion {
|
|
8
|
-
getLemmaNode() {
|
|
9
|
-
const node = this.getNode(),
|
|
10
|
-
lemmaNode = node; ///
|
|
11
|
-
|
|
12
|
-
return lemmaNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async verify(context) {
|
|
16
|
-
let verifies;
|
|
17
|
-
|
|
18
|
-
await this.break(context);
|
|
19
|
-
|
|
20
|
-
const lemmaString = this.getString(); ///
|
|
21
|
-
|
|
22
|
-
(lemmaString === null) ?
|
|
23
|
-
context.trace(`Verifying a lemma...`) :
|
|
24
|
-
context.trace(`Verifying the '${lemmaString}' lemma...`);
|
|
25
|
-
|
|
26
|
-
verifies = await super.verify(context);
|
|
27
|
-
|
|
28
|
-
if (verifies) {
|
|
29
|
-
const lemma = this; ///
|
|
30
|
-
|
|
31
|
-
context.addLemma(lemma);
|
|
32
|
-
|
|
33
|
-
(lemmaString === null) ?
|
|
34
|
-
context.debug(`...verified a lemma.`) :
|
|
35
|
-
context.debug(`...verified the '${lemmaString}' lemma.`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return verifies;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
static name = "Lemma";
|
|
42
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
|
-
|
|
5
|
-
import { define } from "../../elements";
|
|
6
|
-
|
|
7
|
-
export default define(class Theorem extends TopLevelAssertion {
|
|
8
|
-
getThoeremNode() {
|
|
9
|
-
const node = this.getNode(),
|
|
10
|
-
theoremNode = node; ///
|
|
11
|
-
|
|
12
|
-
return theoremNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async verify(context) {
|
|
16
|
-
let verifies;
|
|
17
|
-
|
|
18
|
-
await this.break(context);
|
|
19
|
-
|
|
20
|
-
const theoremString = this.getString(); ///
|
|
21
|
-
|
|
22
|
-
context.trace(`Verifying the '${theoremString}' theorem...`);
|
|
23
|
-
|
|
24
|
-
verifies = await super.verify(context);
|
|
25
|
-
|
|
26
|
-
if (verifies) {
|
|
27
|
-
const theorem = this; ///
|
|
28
|
-
|
|
29
|
-
context.addTheorem(theorem);
|
|
30
|
-
|
|
31
|
-
context.debug(`...verified the '${theoremString}' theorem.`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return verifies;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static name = "Theorem";
|
|
38
|
-
|
|
39
|
-
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Theorem, json, context); }
|
|
40
|
-
});
|