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,261 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import TermNode from "./node/term";
|
|
4
|
-
import RuleNode from "./node/rule";
|
|
5
|
-
import StepNode from "./node/proofAssertion/step";
|
|
6
|
-
import TypeNode from "./node/type";
|
|
7
|
-
import TypesNode from "./node/types";
|
|
8
|
-
import ErrorNode from "./node/error";
|
|
9
|
-
import FrameNode from "./node/frame";
|
|
10
|
-
import AxiomNode from "./node/topLevelAssertion/axiom";
|
|
11
|
-
import LemmaNode from "./node/topLevelAssertion/lemma";
|
|
12
|
-
import ProofNode from "./node/proof";
|
|
13
|
-
import LabelNode from "./node/label";
|
|
14
|
-
import LabelsNode from "./node/labels";
|
|
15
|
-
import SectionNode from "./node/section";
|
|
16
|
-
import PremiseNode from "./node/proofAssertion/premise";
|
|
17
|
-
import TheoremNode from "./node/topLevelAssertion/theorem";
|
|
18
|
-
import ArgumentNode from "./node/argument";
|
|
19
|
-
import SubproofNode from "./node/subproof";
|
|
20
|
-
import PropertyNode from "./node/property";
|
|
21
|
-
import MetaTypeNode from "./node/metaType";
|
|
22
|
-
import EqualityNode from "./node/equality";
|
|
23
|
-
import VariableNode from "./node/variable";
|
|
24
|
-
import DocumentNode from "./node/document";
|
|
25
|
-
import RuleBodyNode from "./node/body/rule";
|
|
26
|
-
import StatementNode from "./node/statement";
|
|
27
|
-
import ReferenceNode from "./node/reference";
|
|
28
|
-
import DeductionNode from "./node/deduction";
|
|
29
|
-
import JudgementNode from "./node/judgement";
|
|
30
|
-
import MetaLemmaNode from "./node/topLevelMetaAssertion/metaLemma";
|
|
31
|
-
import ParameterNode from "./node/parameter";
|
|
32
|
-
import SignatureNode from "./node/signature";
|
|
33
|
-
import AxiomBodyNode from "./node/body/axiom";
|
|
34
|
-
import LemmaBodyNode from "./node/body/lemma";
|
|
35
|
-
import DerivationNode from "./node/derivation";
|
|
36
|
-
import CombinatorNode from "./node/combinator";
|
|
37
|
-
import ConclusionNode from "./node/conclusion";
|
|
38
|
-
import ConjectureNode from "./node/topLevelAssertion/conjecture";
|
|
39
|
-
import HypothesisNode from "./node/hypothesis";
|
|
40
|
-
import TypePrefixNode from "./node/typePrefix";
|
|
41
|
-
import AssumptionNode from "./node/assumption";
|
|
42
|
-
import RuleHeaderNode from "./node/header/rule";
|
|
43
|
-
import SuppositionNode from "./node/proofAssertion/supposition";
|
|
44
|
-
import PlaceholderNode from "./node/placeholder";
|
|
45
|
-
import ConstructorNode from "./node/constructor";
|
|
46
|
-
import MetatheoremNode from "./node/topLevelMetaAssertion/metatheorem";
|
|
47
|
-
import EquivalenceNode from "./node/equivalence";
|
|
48
|
-
import TheoremBodyNode from "./node/body/theorem";
|
|
49
|
-
import AxiomHeaderNode from "./node/header/axiom";
|
|
50
|
-
import LemmaHeaderNode from "./node/header/lemma";
|
|
51
|
-
import EquivalencesNode from "./node/equivalences";
|
|
52
|
-
import MetaArgumentNode from "./node/metaArgument";
|
|
53
|
-
import MetavariableNode from "./node/metavariable";
|
|
54
|
-
import QualificationNode from "./node/qualification";
|
|
55
|
-
import ProcedureCallNode from "./node/procedureCall";
|
|
56
|
-
import SubDerivationNode from "./node/subDerivation";
|
|
57
|
-
import TheoremHeaderNode from "./node/header/theorem";
|
|
58
|
-
import MetaLemmaBodyNode from "./node/body/metaLemma";
|
|
59
|
-
import TypeAssertionNode from "./node/assertion/type";
|
|
60
|
-
import ConjectureBodyNode from "./node/body/conjecture";
|
|
61
|
-
import MetatheoremBodyNode from "./node/body/metatheorem";
|
|
62
|
-
import MetaLemmaHeaderNode from "./node/header/metaLemma";
|
|
63
|
-
import PropertyRelationNode from "./node/propertyRelation"
|
|
64
|
-
import DefinedAssertionNode from "./node/assertion/defined";
|
|
65
|
-
import TermSubstitutionNode from "./node/substitution/term";
|
|
66
|
-
import ConjectureHeaderNode from "./node/header/conjecture";
|
|
67
|
-
import MetatheoremHeaderNode from "./node/header/metatheorem";
|
|
68
|
-
import PropertyAssertionNode from "./node/assertion/property";
|
|
69
|
-
import SubproofAssertionNode from "./node/assertion/subproof";
|
|
70
|
-
import FrameSubstitutionNode from "./node/substitution/frame";
|
|
71
|
-
import ParenthesisedLabelNode from "./node/parenthesisedLabel";
|
|
72
|
-
import ProcedureReferenceNode from "./node/procedureReference";
|
|
73
|
-
import ContainedAssertionNode from "./node/assertion/contained";
|
|
74
|
-
import SignatureAssertionNode from "./node/assertion/signature";
|
|
75
|
-
import ParenthesisedLabelsNode from "./node/parenthesisedLabels"
|
|
76
|
-
import PropertyDeclarationNode from "./node/declaration/property";
|
|
77
|
-
import VariableDeclarationNode from "./node/declaration/variable";
|
|
78
|
-
import MetaLevelAssumptionpNode from "./node/assumption/metaLevel";
|
|
79
|
-
import SimpleTypeDeclarationNode from "./node/declaration/simpleType";
|
|
80
|
-
import CombinatorDeclarationNode from "./node/declaration/combinator";
|
|
81
|
-
import ReferenceSubstitutionNode from "./node/substitution/reference";
|
|
82
|
-
import StatementSubstitutionNode from "./node/substitution/statement";
|
|
83
|
-
import TypePrefixDeclarationNode from "./node/declaration/typePrefix";
|
|
84
|
-
import ComplexTypeDeclarationNode from "./node/declaration/complexType";
|
|
85
|
-
import DonstructorDeclarationNode from "./node/declaration/constructor";
|
|
86
|
-
import MetavariableDeclarationNode from "./node/declaration/metavariable";
|
|
87
|
-
|
|
88
|
-
import {
|
|
89
|
-
RULE_RULE_NAME,
|
|
90
|
-
STEP_RULE_NAME,
|
|
91
|
-
TERM_RULE_NAME,
|
|
92
|
-
TYPE_RULE_NAME,
|
|
93
|
-
TYPES_RULE_NAME,
|
|
94
|
-
PROOF_RULE_NAME,
|
|
95
|
-
ERROR_RULE_NAME,
|
|
96
|
-
FRAME_RULE_NAME,
|
|
97
|
-
AXIOM_RULE_NAME,
|
|
98
|
-
LEMMA_RULE_NAME,
|
|
99
|
-
LABEL_RULE_NAME,
|
|
100
|
-
LABELS_RULE_NAME,
|
|
101
|
-
THEOREM_RULE_NAME,
|
|
102
|
-
PREMISE_RULE_NAME,
|
|
103
|
-
SECTION_RULE_NAME,
|
|
104
|
-
ARGUMENT_RULE_NAME,
|
|
105
|
-
SUBPROOF_RULE_NAME,
|
|
106
|
-
PROPERTY_RULE_NAME,
|
|
107
|
-
EQUALITY_RULE_NAME,
|
|
108
|
-
VARIABLE_RULE_NAME,
|
|
109
|
-
DOCUMENT_RULE_NAME,
|
|
110
|
-
META_TYPE_RULE_NAME,
|
|
111
|
-
SIGNATURE_RULE_NAME,
|
|
112
|
-
DEDUCTION_RULE_NAME,
|
|
113
|
-
JUDGEMENT_RULE_NAME,
|
|
114
|
-
PARAMETER_RULE_NAME,
|
|
115
|
-
REFERENCE_RULE_NAME,
|
|
116
|
-
STATEMENT_RULE_NAME,
|
|
117
|
-
RULE_BODY_RULE_NAME,
|
|
118
|
-
META_LEMMA_RULE_NAME,
|
|
119
|
-
DERIVATION_RULE_NAME,
|
|
120
|
-
COMBINATOR_RULE_NAME,
|
|
121
|
-
CONCLUSION_RULE_NAME,
|
|
122
|
-
CONJECTURE_RULE_NAME,
|
|
123
|
-
HYPOTHESIS_RULE_NAME,
|
|
124
|
-
AXIOM_BODY_RULE_NAME,
|
|
125
|
-
LEMMA_BODY_RULE_NAME,
|
|
126
|
-
ASSUMPTION_RULE_NAME,
|
|
127
|
-
PLACEHOLDER_RULE_NAME,
|
|
128
|
-
TYPE_PREFIX_RULE_NAME,
|
|
129
|
-
SUPPOSITION_RULE_NAME,
|
|
130
|
-
RULE_HEADER_RULE_NAME,
|
|
131
|
-
CONSTRUCTOR_RULE_NAME,
|
|
132
|
-
METATHEOREM_RULE_NAME,
|
|
133
|
-
EQUIVALENCE_RULE_NAME,
|
|
134
|
-
EQUIVALENCES_RULE_NAME,
|
|
135
|
-
AXIOM_HEADER_RULE_NAME,
|
|
136
|
-
LEMMA_HEADER_RULE_NAME,
|
|
137
|
-
THEOREM_BODY_RULE_NAME,
|
|
138
|
-
METAVARIABLE_RULE_NAME,
|
|
139
|
-
QUALIFICATION_RULE_NAME,
|
|
140
|
-
META_ARGUMENT_RULE_NAME,
|
|
141
|
-
THEOREM_HEADER_RULE_NAME,
|
|
142
|
-
SUB_DERIVATION_RULE_NAME,
|
|
143
|
-
TYPE_ASSERTION_RULE_NAME,
|
|
144
|
-
PROCEDURE_CALL_RULE_NAME,
|
|
145
|
-
CONJECTURE_BODY_RULE_NAME,
|
|
146
|
-
META_LEMMA_BODY_RULE_NAME,
|
|
147
|
-
METATHEOREM_BODY_RULE_NAME,
|
|
148
|
-
CONJECTURE_HEADER_RULE_NAME,
|
|
149
|
-
META_LEMMA_HEADER_RULE_NAME,
|
|
150
|
-
PROPERTY_RELATION_RULE_NAME,
|
|
151
|
-
DEFINED_ASSERTION_RULE_NAME,
|
|
152
|
-
TERM_SUBSTITUTION_RULE_NAME,
|
|
153
|
-
METATHEOREM_HEADER_RULE_NAME,
|
|
154
|
-
SUBPROOF_ASSERTION_RULE_NAME,
|
|
155
|
-
PROPERTY_ASSERTION_RULE_NAME,
|
|
156
|
-
FRAME_SUBSTITUTION_RULE_NAME,
|
|
157
|
-
PROCEDURE_REFERENCE_RULE_NAME,
|
|
158
|
-
CONTAINED_ASSERTION_RULE_NAME,
|
|
159
|
-
SIGNATURE_ASSERTION_RULE_NAME,
|
|
160
|
-
PARENTHESISED_LABEL_RULE_NAME,
|
|
161
|
-
PARENTHESISED_LABELS_RULE_NAME,
|
|
162
|
-
PROPERTY_DECLARATION_RULE_NAME,
|
|
163
|
-
VARIABLE_DECLARATION_RULE_NAME,
|
|
164
|
-
META_LEVEL_ASSUMPTION_RULE_NAME,
|
|
165
|
-
COMBINATOR_DECLARATION_RULE_NAME,
|
|
166
|
-
REFERENCE_SUBSTITUTION_RULE_NAME,
|
|
167
|
-
STATEMENT_SUBSTITUTION_RULE_NAME,
|
|
168
|
-
SIMPLE_TYPE_DECLARATION_RULE_NAME,
|
|
169
|
-
CONSTRUCTOR_DECLARATION_RULE_NAME,
|
|
170
|
-
TYPE_PREFIX_DECLARATION_RULE_NAME,
|
|
171
|
-
COMPLEX_TYPE_DECLARATION_RULE_NAME,
|
|
172
|
-
METAVARIABLE_DECLARATION_RULE_NAME } from "./ruleNames";
|
|
173
|
-
|
|
174
|
-
const NonTerminalNodeMap = {
|
|
175
|
-
[RULE_RULE_NAME]: RuleNode,
|
|
176
|
-
[STEP_RULE_NAME]: StepNode,
|
|
177
|
-
[TERM_RULE_NAME]: TermNode,
|
|
178
|
-
[TYPE_RULE_NAME]: TypeNode,
|
|
179
|
-
[TYPES_RULE_NAME]: TypesNode,
|
|
180
|
-
[ERROR_RULE_NAME]: ErrorNode,
|
|
181
|
-
[FRAME_RULE_NAME]: FrameNode,
|
|
182
|
-
[LEMMA_RULE_NAME]: LemmaNode,
|
|
183
|
-
[AXIOM_RULE_NAME]: AxiomNode,
|
|
184
|
-
[PROOF_RULE_NAME]: ProofNode,
|
|
185
|
-
[LABEL_RULE_NAME]: LabelNode,
|
|
186
|
-
[LABELS_RULE_NAME]: LabelsNode,
|
|
187
|
-
[THEOREM_RULE_NAME]: TheoremNode,
|
|
188
|
-
[PREMISE_RULE_NAME]: PremiseNode,
|
|
189
|
-
[SECTION_RULE_NAME]: SectionNode,
|
|
190
|
-
[ARGUMENT_RULE_NAME]: ArgumentNode,
|
|
191
|
-
[PROPERTY_RULE_NAME]: PropertyNode,
|
|
192
|
-
[SUBPROOF_RULE_NAME]: SubproofNode,
|
|
193
|
-
[EQUALITY_RULE_NAME]: EqualityNode,
|
|
194
|
-
[VARIABLE_RULE_NAME]: VariableNode,
|
|
195
|
-
[DOCUMENT_RULE_NAME]: DocumentNode,
|
|
196
|
-
[RULE_BODY_RULE_NAME]: RuleBodyNode,
|
|
197
|
-
[META_TYPE_RULE_NAME]: MetaTypeNode,
|
|
198
|
-
[SIGNATURE_RULE_NAME]: SignatureNode,
|
|
199
|
-
[REFERENCE_RULE_NAME]: ReferenceNode,
|
|
200
|
-
[JUDGEMENT_RULE_NAME]: JudgementNode,
|
|
201
|
-
[DEDUCTION_RULE_NAME]: DeductionNode,
|
|
202
|
-
[PARAMETER_RULE_NAME]: ParameterNode,
|
|
203
|
-
[STATEMENT_RULE_NAME]: StatementNode,
|
|
204
|
-
[AXIOM_BODY_RULE_NAME]: AxiomBodyNode,
|
|
205
|
-
[LEMMA_BODY_RULE_NAME]: LemmaBodyNode,
|
|
206
|
-
[META_LEMMA_RULE_NAME]: MetaLemmaNode,
|
|
207
|
-
[COMBINATOR_RULE_NAME]: CombinatorNode,
|
|
208
|
-
[CONCLUSION_RULE_NAME]: ConclusionNode,
|
|
209
|
-
[CONJECTURE_RULE_NAME]: ConjectureNode,
|
|
210
|
-
[DERIVATION_RULE_NAME]: DerivationNode,
|
|
211
|
-
[HYPOTHESIS_RULE_NAME]: HypothesisNode,
|
|
212
|
-
[ASSUMPTION_RULE_NAME]: AssumptionNode,
|
|
213
|
-
[RULE_HEADER_RULE_NAME]: RuleHeaderNode,
|
|
214
|
-
[TYPE_PREFIX_RULE_NAME]: TypePrefixNode,
|
|
215
|
-
[PLACEHOLDER_RULE_NAME]: PlaceholderNode,
|
|
216
|
-
[SUPPOSITION_RULE_NAME]: SuppositionNode,
|
|
217
|
-
[CONSTRUCTOR_RULE_NAME]: ConstructorNode,
|
|
218
|
-
[METATHEOREM_RULE_NAME]: MetatheoremNode,
|
|
219
|
-
[EQUIVALENCE_RULE_NAME]: EquivalenceNode,
|
|
220
|
-
[AXIOM_HEADER_RULE_NAME]: AxiomHeaderNode,
|
|
221
|
-
[LEMMA_HEADER_RULE_NAME]: LemmaHeaderNode,
|
|
222
|
-
[THEOREM_BODY_RULE_NAME]: TheoremBodyNode,
|
|
223
|
-
[METAVARIABLE_RULE_NAME]: MetavariableNode,
|
|
224
|
-
[EQUIVALENCES_RULE_NAME]: EquivalencesNode,
|
|
225
|
-
[META_ARGUMENT_RULE_NAME]: MetaArgumentNode,
|
|
226
|
-
[QUALIFICATION_RULE_NAME]: QualificationNode,
|
|
227
|
-
[TYPE_ASSERTION_RULE_NAME]: TypeAssertionNode,
|
|
228
|
-
[PROCEDURE_CALL_RULE_NAME]: ProcedureCallNode,
|
|
229
|
-
[SUB_DERIVATION_RULE_NAME]: SubDerivationNode,
|
|
230
|
-
[THEOREM_HEADER_RULE_NAME]: TheoremHeaderNode,
|
|
231
|
-
[META_LEMMA_BODY_RULE_NAME]: MetaLemmaBodyNode,
|
|
232
|
-
[CONJECTURE_BODY_RULE_NAME]: ConjectureBodyNode,
|
|
233
|
-
[METATHEOREM_BODY_RULE_NAME]: MetatheoremBodyNode,
|
|
234
|
-
[META_LEMMA_HEADER_RULE_NAME]: MetaLemmaHeaderNode,
|
|
235
|
-
[CONJECTURE_HEADER_RULE_NAME]: ConjectureHeaderNode,
|
|
236
|
-
[PROPERTY_RELATION_RULE_NAME]: PropertyRelationNode,
|
|
237
|
-
[DEFINED_ASSERTION_RULE_NAME]: DefinedAssertionNode,
|
|
238
|
-
[TERM_SUBSTITUTION_RULE_NAME]: TermSubstitutionNode,
|
|
239
|
-
[METATHEOREM_HEADER_RULE_NAME]: MetatheoremHeaderNode,
|
|
240
|
-
[SUBPROOF_ASSERTION_RULE_NAME]: SubproofAssertionNode,
|
|
241
|
-
[PROPERTY_ASSERTION_RULE_NAME]: PropertyAssertionNode,
|
|
242
|
-
[FRAME_SUBSTITUTION_RULE_NAME]: FrameSubstitutionNode,
|
|
243
|
-
[PROCEDURE_REFERENCE_RULE_NAME]: ProcedureReferenceNode,
|
|
244
|
-
[PARENTHESISED_LABEL_RULE_NAME]: ParenthesisedLabelNode,
|
|
245
|
-
[SIGNATURE_ASSERTION_RULE_NAME]: SignatureAssertionNode,
|
|
246
|
-
[CONTAINED_ASSERTION_RULE_NAME]: ContainedAssertionNode,
|
|
247
|
-
[PARENTHESISED_LABELS_RULE_NAME]: ParenthesisedLabelsNode,
|
|
248
|
-
[VARIABLE_DECLARATION_RULE_NAME]: VariableDeclarationNode,
|
|
249
|
-
[PROPERTY_DECLARATION_RULE_NAME]: PropertyDeclarationNode,
|
|
250
|
-
[META_LEVEL_ASSUMPTION_RULE_NAME]: MetaLevelAssumptionpNode,
|
|
251
|
-
[COMBINATOR_DECLARATION_RULE_NAME]: CombinatorDeclarationNode,
|
|
252
|
-
[STATEMENT_SUBSTITUTION_RULE_NAME]: StatementSubstitutionNode,
|
|
253
|
-
[REFERENCE_SUBSTITUTION_RULE_NAME]: ReferenceSubstitutionNode,
|
|
254
|
-
[SIMPLE_TYPE_DECLARATION_RULE_NAME]: SimpleTypeDeclarationNode,
|
|
255
|
-
[TYPE_PREFIX_DECLARATION_RULE_NAME]: TypePrefixDeclarationNode,
|
|
256
|
-
[CONSTRUCTOR_DECLARATION_RULE_NAME]: DonstructorDeclarationNode,
|
|
257
|
-
[COMPLEX_TYPE_DECLARATION_RULE_NAME]: ComplexTypeDeclarationNode,
|
|
258
|
-
[METAVARIABLE_DECLARATION_RULE_NAME]: MetavariableDeclarationNode
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export default NonTerminalNodeMap;
|
package/src/pass/zip.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { ZipPass as ZipPassBase } from "occam-languages";
|
|
4
|
-
|
|
5
|
-
export default class ZipPass extends ZipPassBase {
|
|
6
|
-
run(generalNonTerminalNode, specificNonTerminalNode, ...remainingArguments) {
|
|
7
|
-
let success = false;
|
|
8
|
-
|
|
9
|
-
const generalChildNodes = generalNonTerminalNode.getChildNodes(), ///
|
|
10
|
-
specificChildNodes = specificNonTerminalNode.getChildNodes(), ///
|
|
11
|
-
descended = this.descend(generalChildNodes, specificChildNodes, ...remainingArguments);
|
|
12
|
-
|
|
13
|
-
if (descended) {
|
|
14
|
-
success = true;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return success;
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/preamble.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Type from "./element/type";
|
|
4
|
-
import Term from "./element/term";
|
|
5
|
-
import Rule from "./element/rule";
|
|
6
|
-
import Step from "./element/proofAssertion/step";
|
|
7
|
-
import Label from "./element/label";
|
|
8
|
-
import Axiom from "./element/topLevelAssertion/axiom";
|
|
9
|
-
import Lemma from "./element/topLevelAssertion/lemma";
|
|
10
|
-
import Frame from "./element/frame";
|
|
11
|
-
import Proof from "./element/proof";
|
|
12
|
-
import Error from "./element/error";
|
|
13
|
-
import Premise from "./element/proofAssertion/premise";
|
|
14
|
-
import Theorem from "./element/topLevelAssertion/theorem";
|
|
15
|
-
import Section from "./element/section";
|
|
16
|
-
import Equality from "./element/equality";
|
|
17
|
-
import MetaType from "./element/metaType";
|
|
18
|
-
import Subproof from "./element/subproof";
|
|
19
|
-
import Variable from "./element/variable";
|
|
20
|
-
import Property from "./element/property";
|
|
21
|
-
import Parameter from "./element/parameter";
|
|
22
|
-
import Reference from "./element/reference";
|
|
23
|
-
import Statement from "./element/statement";
|
|
24
|
-
import Judgement from "./element/judgement";
|
|
25
|
-
import MetaLemma from "./element/topLevelMetaAssertion/metaLemma";
|
|
26
|
-
import Deduction from "./element/deduction";
|
|
27
|
-
import Signature from "./element/signature";
|
|
28
|
-
import TypePrefix from "./element/typePrefix";
|
|
29
|
-
import Conjecture from "./element/topLevelAssertion/conjecture";
|
|
30
|
-
import Conclusion from "./element/conclusion";
|
|
31
|
-
import Derivation from "./element/derivation";
|
|
32
|
-
import Hypothesis from "./element/hypothesis";
|
|
33
|
-
import Assumption from "./element/assumption";
|
|
34
|
-
import Combinator from "./element/combinator";
|
|
35
|
-
import Constructor from "./element/constructor";
|
|
36
|
-
import Supposition from "./element/proofAssertion/supposition";
|
|
37
|
-
import Metatheorem from "./element/topLevelMetaAssertion/metatheorem";
|
|
38
|
-
import Equivalence from "./element/equivalence";
|
|
39
|
-
import Metavariable from "./element/metavariable";
|
|
40
|
-
import ProcedureCall from "./element/procedureCall";
|
|
41
|
-
import SubDerivation from "./element/subDerivation";
|
|
42
|
-
import TypeAssertion from "./element/assertion/type";
|
|
43
|
-
import PropertyRelation from "./element/propertyRelation";
|
|
44
|
-
import DefinedAssertion from "./element/assertion/defined";
|
|
45
|
-
import TermSubstitution from "./element/substitution/term";
|
|
46
|
-
import FrameSubstitution from "./element/substitution/frame";
|
|
47
|
-
import SubproofAssertion from "./element/assertion/subproof";
|
|
48
|
-
import PropertyAssertion from "./element/assertion/property";
|
|
49
|
-
import ProcedureReference from "./element/procedureReference";
|
|
50
|
-
import ContainedAssertion from "./element/assertion/contained";
|
|
51
|
-
import signatureAssertion from "./element/assertion/signature";
|
|
52
|
-
import MetaLevelAssumption from "./element/assumption/metaLevel";
|
|
53
|
-
import PropertyDeclaration from "./element/declaration/property";
|
|
54
|
-
import VariableDeclaration from "./element/declaration/variable";
|
|
55
|
-
import BracketedCombinator from "./element/combinator/bracketed";
|
|
56
|
-
import BracketedConstructor from "./element/constructor/bracketed";
|
|
57
|
-
import SimpleTypeDeclaration from "./element/declaration/simpleType";
|
|
58
|
-
import StatementSubstitution from "./element/substitution/statement";
|
|
59
|
-
import ReferenceSubstitution from "./element/substitution/reference";
|
|
60
|
-
import CombinatorDeclaration from "./element/declaration/combinator";
|
|
61
|
-
import TypePrefixDeclaration from "./element/declaration/typePrefix";
|
|
62
|
-
import ConstructorDeclaration from "./element/declaration/constructor";
|
|
63
|
-
import ComplexTypeDeclaration from "./element/declaration/complexType";
|
|
64
|
-
import MetavariableDeclaration from "./element/declaration/metavariable";
|
package/src/process/assign.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { variableAssignmentFromTermAndType } from "../utilities/assignment";
|
|
4
|
-
|
|
5
|
-
export function equalityAssignmentFromEquality(equality, context) {
|
|
6
|
-
const equalityAssignment = (context) => {
|
|
7
|
-
context.addEquality(equality);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
return equalityAssignment;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function judgementAssignmentFromJudgement(judgement, context) {
|
|
14
|
-
const judgementAssignment = (context) => {
|
|
15
|
-
const declaredJudgement = judgement; ///
|
|
16
|
-
|
|
17
|
-
context.addDeclaredJudgement(declaredJudgement);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return judgementAssignment;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function leftVariableAssignmentFromEquality(equality, context) {
|
|
24
|
-
const type = equality.getType(),
|
|
25
|
-
leftTerm = equality.getLeftTerm(),
|
|
26
|
-
leftVariableAssignment = variableAssignmentFromTermAndType(leftTerm, type, context);
|
|
27
|
-
|
|
28
|
-
return leftVariableAssignment;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function rightVariableAssignmentFromEquality(equality, context) {
|
|
32
|
-
const type = equality.getType(),
|
|
33
|
-
rightTerm = equality.getRightTerm(),
|
|
34
|
-
rightVariableAssignment = variableAssignmentFromTermAndType(rightTerm, type, context);
|
|
35
|
-
|
|
36
|
-
return rightVariableAssignment;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function variableAssignmentFromTypeAssertion(typeAssertion, context) {
|
|
40
|
-
const term = typeAssertion.getTerm(),
|
|
41
|
-
type = typeAssertion.getType(),
|
|
42
|
-
variableAssignment = variableAssignmentFromTermAndType(term, type, context);
|
|
43
|
-
|
|
44
|
-
return variableAssignment;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function variableAssignmentFromPrepertyAssertion(propertyAssertion, context) {
|
|
48
|
-
const term = propertyAssertion.getTerm(),
|
|
49
|
-
type = propertyAssertion.getType(),
|
|
50
|
-
variableAssignment = variableAssignmentFromTermAndType(term, type, context);
|
|
51
|
-
|
|
52
|
-
return variableAssignment;
|
|
53
|
-
}
|
package/src/process/discharge.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import elements from "../elements";
|
|
4
|
-
|
|
5
|
-
function dischargeStatementAsTypeAssertion(statement, context) {
|
|
6
|
-
let dischargesStatementAsTypeAssertion = false;
|
|
7
|
-
|
|
8
|
-
const { TypeAssertion } = elements;
|
|
9
|
-
|
|
10
|
-
const typeAssertion = TypeAssertion.fromStatement(statement, context);
|
|
11
|
-
|
|
12
|
-
if (typeAssertion !== null) {
|
|
13
|
-
const statementString = statement.getString();
|
|
14
|
-
|
|
15
|
-
context.trace(`Validating the '${statementString}' statement as a type assertion...`);
|
|
16
|
-
|
|
17
|
-
const discharges = typeAssertion.discharge(context); ///
|
|
18
|
-
|
|
19
|
-
if (discharges !== null) {
|
|
20
|
-
dischargesStatementAsTypeAssertion = true;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (dischargesStatementAsTypeAssertion) {
|
|
24
|
-
context.debug(`...discharged the '${statementString}' statement as a type assertion.`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return dischargesStatementAsTypeAssertion;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const dischargeStatements = [
|
|
32
|
-
dischargeStatementAsTypeAssertion
|
|
33
|
-
];
|
package/src/process/equate.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { queryUtilities, EquivalencePass } from "occam-languages";
|
|
4
|
-
|
|
5
|
-
import { findEquivalenceByTermNodes } from "../utilities/equivalences";
|
|
6
|
-
|
|
7
|
-
const { nodeQuery } = queryUtilities;
|
|
8
|
-
|
|
9
|
-
const termNodeQuery = nodeQuery("/term");
|
|
10
|
-
|
|
11
|
-
class EquationalPass extends EquivalencePass {
|
|
12
|
-
static maps = [
|
|
13
|
-
{
|
|
14
|
-
leftNodeQuery: termNodeQuery, ///
|
|
15
|
-
rightNodeQuery: termNodeQuery, ///
|
|
16
|
-
run: (leftTermNode, rightTermNode, context) => {
|
|
17
|
-
let success = false;
|
|
18
|
-
|
|
19
|
-
if (!success) {
|
|
20
|
-
const depth = Infinity,
|
|
21
|
-
leftTermNodeMatchesRightTermNode = leftTermNode.match(rightTermNode, depth);
|
|
22
|
-
|
|
23
|
-
if (leftTermNodeMatchesRightTermNode) {
|
|
24
|
-
success = true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!success) {
|
|
29
|
-
const equivalences = context.getEquivalences(),
|
|
30
|
-
termNodes = [
|
|
31
|
-
leftTermNode,
|
|
32
|
-
rightTermNode
|
|
33
|
-
],
|
|
34
|
-
equivalence = findEquivalenceByTermNodes(equivalences, termNodes);
|
|
35
|
-
|
|
36
|
-
if (equivalence !== null) {
|
|
37
|
-
success = true;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!success) {
|
|
42
|
-
const depth = 1,
|
|
43
|
-
leftTermNodeMatchesRightTermNode = leftTermNode.match(rightTermNode, depth);
|
|
44
|
-
|
|
45
|
-
if (leftTermNodeMatchesRightTermNode) {
|
|
46
|
-
const leftNonTerminalNode = leftTermNode, ///
|
|
47
|
-
rightNonTerminalNode = rightTermNode, ///
|
|
48
|
-
leftNonTerminalNodeChildNodes = leftNonTerminalNode.getChildNodes(),
|
|
49
|
-
rightNonTerminalNodeChildNodes = rightNonTerminalNode.getChildNodes(),
|
|
50
|
-
leftChildNodes = leftNonTerminalNodeChildNodes, ///
|
|
51
|
-
rightChildNodes = rightNonTerminalNodeChildNodes, ///
|
|
52
|
-
descended = equationalPass.descend(leftChildNodes, rightChildNodes, context);
|
|
53
|
-
|
|
54
|
-
if (descended) {
|
|
55
|
-
success = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return success;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const equationalPass = new EquationalPass();
|
|
67
|
-
|
|
68
|
-
export function equateTerms(leftTerm, rightTerm, context) {
|
|
69
|
-
let termsEquate;
|
|
70
|
-
|
|
71
|
-
const leftTermNode = leftTerm.getNode(),
|
|
72
|
-
rightTermNode = rightTerm.getNode(),
|
|
73
|
-
leftNode = leftTermNode, ///
|
|
74
|
-
rightNode = rightTermNode, ///
|
|
75
|
-
success = equationalPass.run(leftNode, rightNode, context);
|
|
76
|
-
|
|
77
|
-
termsEquate = success; ///
|
|
78
|
-
|
|
79
|
-
return termsEquate;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function equateStatements(leftStatement, rightStatement, context) {
|
|
83
|
-
let statementsEquate;
|
|
84
|
-
|
|
85
|
-
const leftStatementNode = leftStatement.getNode(),
|
|
86
|
-
rightStatementNode = rightStatement.getNode(),
|
|
87
|
-
leftNode = leftStatementNode, ///
|
|
88
|
-
rightNode = rightStatementNode, ///
|
|
89
|
-
success = equationalPass.run(leftNode, rightNode, context);
|
|
90
|
-
|
|
91
|
-
statementsEquate = success; ///
|
|
92
|
-
|
|
93
|
-
return statementsEquate;
|
|
94
|
-
}
|