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/utilities/element.js
DELETED
|
@@ -1,2293 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import elements from "../elements";
|
|
4
|
-
|
|
5
|
-
import { baseTypeFromNothing } from "../utilities/type";
|
|
6
|
-
import { equivalenceStringFromTerms,
|
|
7
|
-
typeStringFromNominalTypeName,
|
|
8
|
-
rulsStringFromLabelsPremisesAndConclusion,
|
|
9
|
-
subproofStringFromSuppositionsAndSubDerivation,
|
|
10
|
-
sectionStringFromHypothesesAndTopLevelAssertion,
|
|
11
|
-
procedureCallStringFromProcedureReferenceAndParameters,
|
|
12
|
-
topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction,
|
|
13
|
-
complexTypeDeclarationStringFromTypeSuperTypesAndProvisional,
|
|
14
|
-
topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction } from "../utilities/string";
|
|
15
|
-
|
|
16
|
-
export function typeFromTypeNode(typeNode, context) {
|
|
17
|
-
let type;
|
|
18
|
-
|
|
19
|
-
if (typeNode === null) {
|
|
20
|
-
const baseType = baseTypeFromNothing();
|
|
21
|
-
|
|
22
|
-
type = baseType; ///
|
|
23
|
-
} else {
|
|
24
|
-
const { Type } = elements,
|
|
25
|
-
node = typeNode, ///
|
|
26
|
-
name = nameFromTypeNode(typeNode, context),
|
|
27
|
-
prefixName = prefixNameFromTypeNode(typeNode, context),
|
|
28
|
-
superTypes = superTypesFromTypeNode(typeNode, context),
|
|
29
|
-
properties = propertiesFromTypeNode(typeNode, context),
|
|
30
|
-
provisional = provisionalFromTypeNode(typeNode, context),
|
|
31
|
-
nominalTypeName = nominalTypeNameFromTypeNode(typeNode, context),
|
|
32
|
-
typeString = typeStringFromNominalTypeName(nominalTypeName),
|
|
33
|
-
string = typeString, ///
|
|
34
|
-
breakPoint = null;
|
|
35
|
-
|
|
36
|
-
context = null;
|
|
37
|
-
|
|
38
|
-
type = new Type(context, string, node, breakPoint, name, prefixName, superTypes, properties, provisional);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return type;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function termFromTermNode(termNode, context) {
|
|
45
|
-
const { Term } = elements,
|
|
46
|
-
node = termNode, ///
|
|
47
|
-
string = context.nodeAsString(node),
|
|
48
|
-
breakPoint = null,
|
|
49
|
-
type = typeFromTermNode(termNode, context),
|
|
50
|
-
provisional = provisionalFromTermNode(termNode, context);
|
|
51
|
-
|
|
52
|
-
context = null;
|
|
53
|
-
|
|
54
|
-
const term = new Term(context, string, node, breakPoint, type, provisional);
|
|
55
|
-
|
|
56
|
-
return term;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function stepFromStepNode(stepNode, context) {
|
|
60
|
-
const { Step } = elements,
|
|
61
|
-
node = stepNode, ///
|
|
62
|
-
string = context.nodeAsString(node),
|
|
63
|
-
breakPoint = null,
|
|
64
|
-
statement = statementFromStepNode(stepNode, context),
|
|
65
|
-
reference = referenceFromStepNode(stepNode, context),
|
|
66
|
-
signatureAssertion = signatureAssertionFromStepNode(stepNode, context);
|
|
67
|
-
|
|
68
|
-
context = null;
|
|
69
|
-
|
|
70
|
-
const step = new Step(context, string, node, breakPoint, statement, reference, signatureAssertion);
|
|
71
|
-
|
|
72
|
-
return step;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function ruleFromRuleNode(ruleNode, context) {
|
|
76
|
-
const { Rule } = elements,
|
|
77
|
-
proof = proofFromRuleNode(ruleNode, context),
|
|
78
|
-
labels = labelsFromRuleNode(ruleNode, context),
|
|
79
|
-
premises = premisesFromRuleNode(ruleNode, context),
|
|
80
|
-
conclusion = conclusionFromRuleNode(ruleNode, context),
|
|
81
|
-
ruleString = rulsStringFromLabelsPremisesAndConclusion(labels, premises, conclusion),
|
|
82
|
-
node = ruleNode, ///
|
|
83
|
-
string = ruleString, ///
|
|
84
|
-
breakPoint = null;
|
|
85
|
-
|
|
86
|
-
context = null;
|
|
87
|
-
|
|
88
|
-
const rule = new Rule(context, string, node, breakPoint, proof, labels, premises, conclusion);
|
|
89
|
-
|
|
90
|
-
return rule;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function labelFromLabelNode(labelNode, context) {
|
|
94
|
-
const { Label } = elements,
|
|
95
|
-
node = labelNode, ///
|
|
96
|
-
string = context.nodeAsString(node),
|
|
97
|
-
breakPoint = null,
|
|
98
|
-
metavariable = metavariableFromLabelNode(labelNode, context),
|
|
99
|
-
label = new Label(context, string, node, breakPoint, metavariable);
|
|
100
|
-
|
|
101
|
-
return label;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function errorFromErrorNode(errorNode, context) {
|
|
105
|
-
const { Error } = elements,
|
|
106
|
-
node = errorNode, ///
|
|
107
|
-
string = context.nodeAsString(node),
|
|
108
|
-
breakPoint = null;
|
|
109
|
-
|
|
110
|
-
context = null;
|
|
111
|
-
|
|
112
|
-
const error = new Error(context, string, node, breakPoint);
|
|
113
|
-
|
|
114
|
-
return error;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function lemmaFromLemmaNode(lemmaNode, context) {
|
|
118
|
-
const { Lemma } = elements,
|
|
119
|
-
topLevelAsssertionNode = lemmaNode, ///
|
|
120
|
-
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
121
|
-
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
122
|
-
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
123
|
-
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
124
|
-
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
125
|
-
hypotheses = hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
126
|
-
topLevelAsssertionString = topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction),
|
|
127
|
-
node = lemmaNode, ///
|
|
128
|
-
string = topLevelAsssertionString, ///
|
|
129
|
-
breakPoint = null;
|
|
130
|
-
|
|
131
|
-
context = null;
|
|
132
|
-
|
|
133
|
-
const lemma = new Lemma(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
134
|
-
|
|
135
|
-
return lemma;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function frameFromFrameNode(frameNode, context) {
|
|
139
|
-
const { Frame } = elements,
|
|
140
|
-
node = frameNode, ///
|
|
141
|
-
string = context.nodeAsString(node),
|
|
142
|
-
breakPoint = null,
|
|
143
|
-
assumptions = assumptionsFromFrameNode(frameNode, context),
|
|
144
|
-
metavariable = metavariableFromFrameNode(frameNode, context);
|
|
145
|
-
|
|
146
|
-
context = null;
|
|
147
|
-
|
|
148
|
-
const frame = new Frame(context, string, node, breakPoint, assumptions, metavariable);
|
|
149
|
-
|
|
150
|
-
return frame;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function proofFromProofNode(proofNode, context) {
|
|
154
|
-
const { Proof } = elements,
|
|
155
|
-
node = proofNode, ///
|
|
156
|
-
string = null,
|
|
157
|
-
breakPoint = null,
|
|
158
|
-
derivation = derivationFromProofNode(proofNode, context);
|
|
159
|
-
|
|
160
|
-
context = null;
|
|
161
|
-
|
|
162
|
-
const proof = new Proof(context, string, node, breakPoint, derivation);
|
|
163
|
-
|
|
164
|
-
return proof;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function axiomFromAxiomNode(axiomNode, context) {
|
|
168
|
-
const { Axiom } = elements,
|
|
169
|
-
topLevelAsssertionNode = axiomNode, ///
|
|
170
|
-
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
171
|
-
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
172
|
-
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
173
|
-
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
174
|
-
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
175
|
-
hypotheses = hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
176
|
-
topLevelAsssertionString = topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction),
|
|
177
|
-
node = axiomNode, ///
|
|
178
|
-
string = topLevelAsssertionString, ///
|
|
179
|
-
breakPoint = null;
|
|
180
|
-
|
|
181
|
-
context = null;
|
|
182
|
-
|
|
183
|
-
const axiom = new Axiom(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
184
|
-
|
|
185
|
-
return axiom;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function sectionFromSectionNode(sectionNode, context) {
|
|
189
|
-
const { Section } = elements,
|
|
190
|
-
hypothesisNodes = sectionNode.getHypothesisNodes(),
|
|
191
|
-
hypotheses = hypothesesFromHypothesisNodes(hypothesisNodes, context),
|
|
192
|
-
topLevelAssertion = topLevelAssertionFromSectionNode(sectionNode, context),
|
|
193
|
-
sectionString = sectionStringFromHypothesesAndTopLevelAssertion(hypotheses, topLevelAssertion),
|
|
194
|
-
node = sectionNode, ///
|
|
195
|
-
string = sectionString, ///
|
|
196
|
-
breakPoint = null;
|
|
197
|
-
|
|
198
|
-
context = null;
|
|
199
|
-
|
|
200
|
-
const section = new Section(context, string, node, breakPoint, hypotheses, topLevelAssertion);
|
|
201
|
-
|
|
202
|
-
return section;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export function premiseFromPremiseNode(premiseNode, context) {
|
|
206
|
-
const { Premise } = elements,
|
|
207
|
-
node = premiseNode, ///
|
|
208
|
-
string = context.nodeAsString(node),
|
|
209
|
-
breakPoint = null,
|
|
210
|
-
statement = statementFromPremiseNode(premiseNode, context),
|
|
211
|
-
procedureCall = procedureCallFromPremiseNode(premiseNode, context),
|
|
212
|
-
premise = new Premise(context, string, node, breakPoint, statement, procedureCall);
|
|
213
|
-
|
|
214
|
-
return premise
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function theoremFromTheoremNode(theoremNode, context) {
|
|
218
|
-
const { Theorem } = elements,
|
|
219
|
-
topLevelAsssertionNode = theoremNode, ///
|
|
220
|
-
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
221
|
-
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
222
|
-
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
223
|
-
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
224
|
-
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
225
|
-
hypotheses = hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
226
|
-
topLevelAsssertionString = topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction),
|
|
227
|
-
node = theoremNode, ///
|
|
228
|
-
string = topLevelAsssertionString, ///
|
|
229
|
-
breakPoint = null;
|
|
230
|
-
|
|
231
|
-
context = null;
|
|
232
|
-
|
|
233
|
-
const theorem = new Theorem(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
234
|
-
|
|
235
|
-
return theorem;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export function propertyFromPropertyNode(propertyNode, context) {
|
|
239
|
-
let property = null;
|
|
240
|
-
|
|
241
|
-
if (propertyNode != null) {
|
|
242
|
-
const { Property } = elements,
|
|
243
|
-
node = propertyNode, ///
|
|
244
|
-
string = context.nodeAsString(node),
|
|
245
|
-
breakPoint = null,
|
|
246
|
-
name = nameFromPropertyNode(propertyNode, context),
|
|
247
|
-
type = typeFromPropertyNode(propertyNode, context);
|
|
248
|
-
|
|
249
|
-
context = null;
|
|
250
|
-
|
|
251
|
-
property = new Property(context, string, node, breakPoint, name, type);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return property;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export function variableFromVariableNode(variableNode, context) {
|
|
258
|
-
const { Variable } = elements,
|
|
259
|
-
node = variableNode, ///
|
|
260
|
-
string = context.nodeAsString(node),
|
|
261
|
-
breakPoint = null,
|
|
262
|
-
type = typeFromVariableNode(variableNode, context),
|
|
263
|
-
identifier = identifierFromVariableNode(variableNode, context),
|
|
264
|
-
provisional = provisionalFromVariableNode(variableNode, context);
|
|
265
|
-
|
|
266
|
-
context = null;
|
|
267
|
-
|
|
268
|
-
const variable = new Variable(context, string, node, breakPoint, type, identifier, provisional);
|
|
269
|
-
|
|
270
|
-
return variable;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export function subproofFromSubproofNode(subproofNode, context) {
|
|
274
|
-
const { Subproof } = elements,
|
|
275
|
-
node = subproofNode, ///
|
|
276
|
-
breakPoint = null,
|
|
277
|
-
suppositions = suppositionsFromSubproofNode(subproofNode, context),
|
|
278
|
-
subDerivation = subDerivationFromSubproofNode(subproofNode, context),
|
|
279
|
-
subproofString = subproofStringFromSuppositionsAndSubDerivation(suppositions, subDerivation, context),
|
|
280
|
-
string = subproofString; ///
|
|
281
|
-
|
|
282
|
-
context = null;
|
|
283
|
-
|
|
284
|
-
const subproof = new Subproof(context, string, node, breakPoint, suppositions, subDerivation);
|
|
285
|
-
|
|
286
|
-
return subproof;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export function equalityFromEqualityNode(equalityNode, context) {
|
|
290
|
-
const { Equality } = elements,
|
|
291
|
-
node = equalityNode, ///
|
|
292
|
-
string = context.nodeAsString(node),
|
|
293
|
-
breakPoint = null,
|
|
294
|
-
leftTerm = leftTermFromEqualityNode(equalityNode, context),
|
|
295
|
-
rightTerm = rightTermFromEqualityNode(equalityNode, context);
|
|
296
|
-
|
|
297
|
-
context = null;
|
|
298
|
-
|
|
299
|
-
const equality = new Equality(context, string, node, breakPoint, leftTerm, rightTerm);
|
|
300
|
-
|
|
301
|
-
return equality;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export function deductionFromDeductionNode(deductionNode, context) {
|
|
305
|
-
const { Deduction } = elements,
|
|
306
|
-
node = deductionNode, ///
|
|
307
|
-
string = context.nodeAsString(node),
|
|
308
|
-
breakPoint = null,
|
|
309
|
-
statement = statementFromDeductionNode(deductionNode, context),
|
|
310
|
-
deduction = new Deduction(context, string, node, breakPoint, statement);
|
|
311
|
-
|
|
312
|
-
return deduction;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export function statementFromStatementNode(statementNode, context) {
|
|
316
|
-
const { Statement } = elements,
|
|
317
|
-
node = statementNode, ///
|
|
318
|
-
string = context.nodeAsString(node),
|
|
319
|
-
breakPoint = null;
|
|
320
|
-
|
|
321
|
-
context = null;
|
|
322
|
-
|
|
323
|
-
const statement = new Statement(context, string, node, breakPoint);
|
|
324
|
-
|
|
325
|
-
return statement;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export function signatureFromSignatureNode(signatureNode, context) {
|
|
329
|
-
const { Signature } = elements,
|
|
330
|
-
node = signatureNode, ///
|
|
331
|
-
string = context.nodeAsString(node),
|
|
332
|
-
breakPoint = null,
|
|
333
|
-
terms = termsFromSignatureNode(signatureNode, context),
|
|
334
|
-
signature = new Signature(context, string, node, breakPoint, terms);
|
|
335
|
-
|
|
336
|
-
return signature;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export function referenceFromReferenceNode(referenceNode, context) {
|
|
340
|
-
const { Reference } = elements,
|
|
341
|
-
node = referenceNode, ///
|
|
342
|
-
string = context.nodeAsString(node),
|
|
343
|
-
breakPoint = null,
|
|
344
|
-
metavariable = metavariableFromReferenceNode(referenceNode, context),
|
|
345
|
-
topLevelMetaAssertion = topLevelMetaAssertionFromReferenceNode(referenceNode, context),
|
|
346
|
-
reference = new Reference(context, string, node, breakPoint, metavariable, topLevelMetaAssertion);
|
|
347
|
-
|
|
348
|
-
return reference;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export function judgementFromJudgementNode(judgementNode, context) {
|
|
352
|
-
const { Judgement } = elements,
|
|
353
|
-
node = judgementNode, ///
|
|
354
|
-
string = context.nodeAsString(node),
|
|
355
|
-
breakPoint = null,
|
|
356
|
-
frame = frameFromJudgementNode(judgementNode, context),
|
|
357
|
-
assumption = assumptionFromJudgementNode(judgementNode, context);
|
|
358
|
-
|
|
359
|
-
context = null;
|
|
360
|
-
|
|
361
|
-
const judgement = new Judgement(context, string, node, breakPoint, frame, assumption);
|
|
362
|
-
|
|
363
|
-
return judgement;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
export function metaLemmaFromMetaLemmaNode(metaLemmaNode, context) {
|
|
367
|
-
const { MetaLemma } = elements,
|
|
368
|
-
metaLemmaMetathoremNode = metaLemmaNode, ///
|
|
369
|
-
proof = proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
370
|
-
label = labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
371
|
-
deduction = deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
372
|
-
suppositions = suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
373
|
-
metaLevelAssumptions = metaLevelAssumptionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
374
|
-
topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
375
|
-
node = metaLemmaMetathoremNode, ///
|
|
376
|
-
string = topLevelMetaAssertionString, ///
|
|
377
|
-
breakPoint = null;
|
|
378
|
-
|
|
379
|
-
context = null;
|
|
380
|
-
|
|
381
|
-
const metaLemma = new MetaLemma(context, string, node, breakPoint, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
382
|
-
|
|
383
|
-
return metaLemma;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export function parameterFromParameterNode(parameterNode, context) {
|
|
387
|
-
const { Parameter } = elements,
|
|
388
|
-
node = parameterNode, ///
|
|
389
|
-
string = context.nodeAsString(node),
|
|
390
|
-
breakPoint = null,
|
|
391
|
-
name = nameFromParamterNode(parameterNode, context),
|
|
392
|
-
identifier = identifierFromParamterNode(parameterNode, context);
|
|
393
|
-
|
|
394
|
-
context = null;
|
|
395
|
-
|
|
396
|
-
const parameter = new Parameter(context, string, node, breakPoint, name, identifier);
|
|
397
|
-
|
|
398
|
-
return parameter;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export function hypothesisFromHypothesisNode(hypotheseNode, context) {
|
|
402
|
-
const { Hypothesis } = elements,
|
|
403
|
-
node = hypotheseNode, ///
|
|
404
|
-
string = context.nodeAsString(node),
|
|
405
|
-
breakPoint = null,
|
|
406
|
-
statement = statementFromHypothesisNode(hypotheseNode, context);
|
|
407
|
-
|
|
408
|
-
context = null;
|
|
409
|
-
|
|
410
|
-
const hypohtesis = new Hypothesis(context, string, node, breakPoint, statement);
|
|
411
|
-
|
|
412
|
-
return hypohtesis;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
export function conjectureFromConjectureNode(conjectureNode, context) {
|
|
416
|
-
const { Conjecture } = elements,
|
|
417
|
-
topLevelAsssertionNode = conjectureNode, ///
|
|
418
|
-
proof = proofFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
419
|
-
labels = labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
420
|
-
deduction = deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
421
|
-
suppositions = suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
422
|
-
signature = signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
423
|
-
hypotheses = hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context),
|
|
424
|
-
topLevelAsssertionString = topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction),
|
|
425
|
-
node = conjectureNode, ///
|
|
426
|
-
string = topLevelAsssertionString, ///
|
|
427
|
-
breakPoint = null;
|
|
428
|
-
|
|
429
|
-
context = null;
|
|
430
|
-
|
|
431
|
-
const conjecture = new Conjecture(context, string, node, breakPoint, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
432
|
-
|
|
433
|
-
return conjecture;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export function combinatorFromCombinatorNode(combinatorNode, context) {
|
|
437
|
-
const { Combinator } = elements,
|
|
438
|
-
node = combinatorNode, ///
|
|
439
|
-
string = context.nodeAsString(node),
|
|
440
|
-
breakPoint = null,
|
|
441
|
-
statement = statementFromCombinatorNode(combinatorNode, context);
|
|
442
|
-
|
|
443
|
-
context = null;
|
|
444
|
-
|
|
445
|
-
const combinator = new Combinator(context, string, node, breakPoint, statement);
|
|
446
|
-
|
|
447
|
-
return combinator;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export function conclusionFromConclusionNode(conclusionNode, context) {
|
|
451
|
-
const { Conclusion } = elements,
|
|
452
|
-
node = conclusionNode, ///
|
|
453
|
-
string = context.nodeAsString(node),
|
|
454
|
-
breakPoint = null,
|
|
455
|
-
statement = statementFromConclusionNode(conclusionNode, context),
|
|
456
|
-
conclusion = new Conclusion(context, string, node, breakPoint, statement);
|
|
457
|
-
|
|
458
|
-
return conclusion;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export function derivationFromDerivationNode(derivationNode, context) {
|
|
462
|
-
const { Derivation } = elements,
|
|
463
|
-
node = derivationNode, ///
|
|
464
|
-
string = null,
|
|
465
|
-
breakPoint = null,
|
|
466
|
-
stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context);
|
|
467
|
-
|
|
468
|
-
context = null;
|
|
469
|
-
|
|
470
|
-
const derivation = new Derivation(context, string, node, breakPoint, stepsOrSubproofs);
|
|
471
|
-
|
|
472
|
-
return derivation;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export function typePrefixFromTypePrefixNode(typePrefixNode, context) {
|
|
476
|
-
const { TypePrefix } = elements,
|
|
477
|
-
node = typePrefixNode, ///
|
|
478
|
-
string = context.nodeAsString(node),
|
|
479
|
-
breakPoint = null,
|
|
480
|
-
name = nameFromTypePrefixNode(typePrefixNode, context);
|
|
481
|
-
|
|
482
|
-
context = null;
|
|
483
|
-
|
|
484
|
-
const typePrefix = new TypePrefix(context, string, node, breakPoint, name);
|
|
485
|
-
|
|
486
|
-
return typePrefix;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
490
|
-
const { Assumption } = elements,
|
|
491
|
-
node = assumptionNode, ///
|
|
492
|
-
string = context.nodeAsString(node),
|
|
493
|
-
breakPoint = null,
|
|
494
|
-
reference = referenceFromAssumptionNode(assumptionNode, context),
|
|
495
|
-
statement = statementFromAssumptionNode(assumptionNode, context),
|
|
496
|
-
assumption = new Assumption(context, string, node, breakPoint, reference, statement);
|
|
497
|
-
|
|
498
|
-
return assumption;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
export function constructorFromConstructorNode(constructorNode, context) {
|
|
502
|
-
const { Constructor } = elements,
|
|
503
|
-
node = constructorNode, ///
|
|
504
|
-
string = context.nodeAsString(node),
|
|
505
|
-
breakPoint = null,
|
|
506
|
-
term = termFromConstructorNode(constructorNode, context),
|
|
507
|
-
type = typeFromConstructorNode(constructorNode, context);
|
|
508
|
-
|
|
509
|
-
context = null;
|
|
510
|
-
|
|
511
|
-
const constructor = new Constructor(context, string, node, breakPoint, term, type);
|
|
512
|
-
|
|
513
|
-
return constructor;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export function suppositionFromSuppositionNode(suppositionNode, context) {
|
|
517
|
-
const { Supposition } = elements,
|
|
518
|
-
node = suppositionNode, ///
|
|
519
|
-
string = context.nodeAsString(node),
|
|
520
|
-
breakPoint = null,
|
|
521
|
-
statement = statementFromSuppositionNode(suppositionNode, context),
|
|
522
|
-
procedureCall = procedureCallFromSuppositionNode(suppositionNode, context),
|
|
523
|
-
supposition = new Supposition(context, string, node, breakPoint, statement, procedureCall);
|
|
524
|
-
|
|
525
|
-
return supposition
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
export function equivalenceFromEquivalenceNode(equivalenceNode, context) {
|
|
529
|
-
const { Equivalence } = elements,
|
|
530
|
-
node = equivalenceNode, ///
|
|
531
|
-
breakPoint = null,
|
|
532
|
-
type = typeFromEquivalenceNode(equivalenceNode, context),
|
|
533
|
-
terms = termsFromEquivalenceNode(equivalenceNode, context),
|
|
534
|
-
equivalenceString = equivalenceStringFromTerms(terms),
|
|
535
|
-
string = equivalenceString; ///
|
|
536
|
-
|
|
537
|
-
context = null;
|
|
538
|
-
|
|
539
|
-
const equivalence = new Equivalence(context, string, node, breakPoint, type, terms);
|
|
540
|
-
|
|
541
|
-
return equivalence;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
export function metatheoremFromMetatheoremNode(metatheoremNode, context) {
|
|
545
|
-
const { Metatheorem } = elements,
|
|
546
|
-
metaLemmaMetathoremNode = metatheoremNode, ///
|
|
547
|
-
proof = proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
548
|
-
label = labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
549
|
-
deduction = deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
550
|
-
suppositions = suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
551
|
-
metaLevelAssumptions = metaLevelAssumptionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
552
|
-
topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
553
|
-
node = metaLemmaMetathoremNode, ///
|
|
554
|
-
string = topLevelMetaAssertionString, ///
|
|
555
|
-
breakPoint = null;
|
|
556
|
-
|
|
557
|
-
context = null;
|
|
558
|
-
|
|
559
|
-
const metatheorem = new Metatheorem(context, string, node, breakPoint, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
560
|
-
|
|
561
|
-
return metatheorem;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
export function metavariableFromMetavariableNode(metavariableNode, context) {
|
|
565
|
-
const { Metavariable } = elements,
|
|
566
|
-
node = metavariableNode, ///
|
|
567
|
-
string = context.nodeAsString(node),
|
|
568
|
-
breakPoint = null,
|
|
569
|
-
name = nameFromMetavariableNode(metavariableNode, context),
|
|
570
|
-
term = termFromMetavariableNode(metavariableNode, context),
|
|
571
|
-
type = typeFromMetavariableNode(metavariableNode, context),
|
|
572
|
-
metaType = null;
|
|
573
|
-
|
|
574
|
-
context = null;
|
|
575
|
-
|
|
576
|
-
const metavariable = new Metavariable(context, string, node, breakPoint, name, term, type, metaType);
|
|
577
|
-
|
|
578
|
-
return metavariable;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
export function subDerivationFromSubDerivationNode(subDerivationNode, context) {
|
|
582
|
-
const { SubDerivation } = elements,
|
|
583
|
-
node = subDerivationNode, ///
|
|
584
|
-
string = null,
|
|
585
|
-
breakPoint = null,
|
|
586
|
-
stepsOrSubproofs = stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context);
|
|
587
|
-
|
|
588
|
-
context = null;
|
|
589
|
-
|
|
590
|
-
const subDerivation = new SubDerivation(context, string, node, breakPoint, stepsOrSubproofs);
|
|
591
|
-
|
|
592
|
-
return subDerivation;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
export function typeAssertionFromTypeAssertionNode(typeAssertionNode, context) {
|
|
596
|
-
const { TypeAssertion } = elements,
|
|
597
|
-
node = typeAssertionNode, ///
|
|
598
|
-
string = context.nodeAsString(node),
|
|
599
|
-
breakPoint = null,
|
|
600
|
-
term = termFromTypeAssertionNode(typeAssertionNode, context),
|
|
601
|
-
type = typeFromTypeAssertionNode(typeAssertionNode, context);
|
|
602
|
-
|
|
603
|
-
context = null;
|
|
604
|
-
|
|
605
|
-
const typeAssertion = new TypeAssertion(context, string, node, breakPoint, term, type);
|
|
606
|
-
|
|
607
|
-
return typeAssertion;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
export function procedureCallFromProcedureCallNode(procedureCallNode, context) {
|
|
611
|
-
const { ProcedureCall } = elements,
|
|
612
|
-
parameters = parametersFromProcedureCallNode(procedureCallNode, context),
|
|
613
|
-
procedureReference = procedureReferenceFromProcedureCallNode(procedureCallNode, context),
|
|
614
|
-
procedureCallString = procedureCallStringFromProcedureReferenceAndParameters(procedureReference, parameters),
|
|
615
|
-
node = procedureCallNode, ///
|
|
616
|
-
string = procedureCallString, ///
|
|
617
|
-
breakPoint = null;
|
|
618
|
-
|
|
619
|
-
context = null;
|
|
620
|
-
|
|
621
|
-
const procedureCall = new ProcedureCall(context, string, node, breakPoint, parameters, procedureReference);
|
|
622
|
-
|
|
623
|
-
return procedureCall;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
export function stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context) {
|
|
627
|
-
const step = stepFromStepOrSubproofNode(stepOrSubproofNode, context),
|
|
628
|
-
subproof = subproofFromStepOrSubproofNode(stepOrSubproofNode, context),
|
|
629
|
-
stepOrSubproof = (step || subproof);
|
|
630
|
-
|
|
631
|
-
return stepOrSubproof;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export function definedAssertionFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
635
|
-
const { DefinedAssertion } = elements,
|
|
636
|
-
node = definedAssertionNode, ///
|
|
637
|
-
string = context.nodeAsString(node),
|
|
638
|
-
breakPoint = null,
|
|
639
|
-
negated = definedAssertionNode.isNegated(),
|
|
640
|
-
term = termFromDefinedAssertionNode(definedAssertionNode, context),
|
|
641
|
-
frame = frameFromDefinedAssertionNode(definedAssertionNode, context);
|
|
642
|
-
|
|
643
|
-
context = null;
|
|
644
|
-
|
|
645
|
-
const definedAssertion = new DefinedAssertion(context, string, node, breakPoint, term, frame, negated);
|
|
646
|
-
|
|
647
|
-
return definedAssertion;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
export function propertyRelationFromPropertyRelationNode(propertyRelationNode, context) {
|
|
651
|
-
const { PropertyRelation } = elements,
|
|
652
|
-
node = propertyRelationNode, ///
|
|
653
|
-
string = context.nodeAsString(node),
|
|
654
|
-
breakPoint = null,
|
|
655
|
-
term = termFromPropertyRelationNode(propertyRelationNode, context),
|
|
656
|
-
property = propertyFromPropertyRelationNode(propertyRelationNode, context);
|
|
657
|
-
|
|
658
|
-
context = null;
|
|
659
|
-
|
|
660
|
-
const propertyRelation = new PropertyRelation(context, string, node, breakPoint, term, property);
|
|
661
|
-
|
|
662
|
-
return propertyRelation;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
export function termSubstitutionFromTermSubstitutionNode(termSubstitutionNode, generalContext, specificContext) {
|
|
666
|
-
const { TermSubstitution } = elements,
|
|
667
|
-
node = termSubstitutionNode, ///
|
|
668
|
-
context = specificContext, ///
|
|
669
|
-
contexts = [
|
|
670
|
-
generalContext,
|
|
671
|
-
specificContext
|
|
672
|
-
],
|
|
673
|
-
string = context.nodeAsString(node),
|
|
674
|
-
breakPoint = null,
|
|
675
|
-
targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
676
|
-
replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
677
|
-
termSubstitution = new TermSubstitution(contexts, string, node, breakPoint, targetTerm, replacementTerm);
|
|
678
|
-
|
|
679
|
-
return termSubstitution;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
export function frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, generalContext, specificContext) {
|
|
683
|
-
const { FrameSubstitution } = elements,
|
|
684
|
-
node = frameSubstitutionNode, ///
|
|
685
|
-
context = specificContext, ///
|
|
686
|
-
contexts = [
|
|
687
|
-
generalContext,
|
|
688
|
-
specificContext
|
|
689
|
-
],
|
|
690
|
-
string = context.nodeAsString(node),
|
|
691
|
-
breakPoint = null,
|
|
692
|
-
targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
693
|
-
replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
694
|
-
frameSubstitution = new FrameSubstitution(contexts, string, node, breakPoint, targetFrame, replacementFrame);
|
|
695
|
-
|
|
696
|
-
return frameSubstitution;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export function propertyAssertionFromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
700
|
-
const { PropertyAssertion } = elements,
|
|
701
|
-
node = propertyAssertionNode, ///
|
|
702
|
-
string = context.nodeAsString(node),
|
|
703
|
-
breakPoint = null,
|
|
704
|
-
term = termFromPropertyAssertionNode(propertyAssertionNode, context),
|
|
705
|
-
propertyRelation = propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context);
|
|
706
|
-
|
|
707
|
-
context = null;
|
|
708
|
-
|
|
709
|
-
const propertyAssertion = new PropertyAssertion(context, string, node, breakPoint, term, propertyRelation);
|
|
710
|
-
|
|
711
|
-
return propertyAssertion;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
export function subproofAssertionFromSubproofAssertionNode(subproofAssertionNode, context) {
|
|
715
|
-
const { SubproofAssertion } = elements,
|
|
716
|
-
node = subproofAssertionNode, ///
|
|
717
|
-
string = context.nodeAsString(node),
|
|
718
|
-
breakPoint = null,
|
|
719
|
-
statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context);
|
|
720
|
-
|
|
721
|
-
context = null;
|
|
722
|
-
|
|
723
|
-
const subproofAssertion = new SubproofAssertion(context, string, node, breakPoint, statements);
|
|
724
|
-
|
|
725
|
-
return subproofAssertion;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export function containedAssertionFromContainedAssertionNode(containedAssertionNode, context) {
|
|
729
|
-
const { ContainedAssertion } = elements,
|
|
730
|
-
node = containedAssertionNode, ///
|
|
731
|
-
string = context.nodeAsString(node),
|
|
732
|
-
breakPoint = null,
|
|
733
|
-
term = termFromContainedAssertionNode(containedAssertionNode, context),
|
|
734
|
-
frame = frameFromContainedAssertionNode(containedAssertionNode, context),
|
|
735
|
-
negated = negatedFromContainedAssertionNode(containedAssertionNode, context),
|
|
736
|
-
statement = statementFromContainedAssertionNode(containedAssertionNode, context);
|
|
737
|
-
|
|
738
|
-
context = null;
|
|
739
|
-
|
|
740
|
-
const containedAssertion = new ContainedAssertion(context, string, node, breakPoint, term, frame, negated, statement);
|
|
741
|
-
|
|
742
|
-
return containedAssertion;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
export function signatureAssertionFromSignatureAssertionNode(signatureAssertionNode, context) {
|
|
746
|
-
const { SignatureAssertion } = elements,
|
|
747
|
-
node = signatureAssertionNode, ///
|
|
748
|
-
string = context.nodeAsString(node),
|
|
749
|
-
breakPoint = null,
|
|
750
|
-
signature = signatureFromSignatureAssertionNode(signatureAssertionNode, context),
|
|
751
|
-
reference = referenceFromSignatureAssertionNode(signatureAssertionNode, context);
|
|
752
|
-
|
|
753
|
-
context = null;
|
|
754
|
-
|
|
755
|
-
const signatureAssertion = new SignatureAssertion(context, string, node, breakPoint, signature, reference);
|
|
756
|
-
|
|
757
|
-
return signatureAssertion;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
export function procedureReferenceFromProcedureReferenceNode(procedureReferenceNode, context) {
|
|
761
|
-
const { ProcedureReference } = elements,
|
|
762
|
-
node = procedureReferenceNode, ///
|
|
763
|
-
string = context.nodeAsString(node),
|
|
764
|
-
breakPoint = null,
|
|
765
|
-
name = nameFromProcedureReferenceNode(procedureReferenceNode, context);
|
|
766
|
-
|
|
767
|
-
context = null;
|
|
768
|
-
|
|
769
|
-
const procedureRefereence = new ProcedureReference(context, string, node, breakPoint, name);
|
|
770
|
-
|
|
771
|
-
return procedureRefereence;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
export function propertyDeclarationFromPropertyDeclarationNode(propertyDeclarationNode, context) {
|
|
775
|
-
const { PropertyDeclaration } = elements,
|
|
776
|
-
node = propertyDeclarationNode, ///
|
|
777
|
-
string = context.nodeAsString(node),
|
|
778
|
-
breakPoint = null,
|
|
779
|
-
type = typeFromPropertyDeclarationNode(propertyDeclarationNode, context),
|
|
780
|
-
property = propertyFromPropertyDeclarationNode(propertyDeclarationNode, context);
|
|
781
|
-
|
|
782
|
-
context = null;
|
|
783
|
-
|
|
784
|
-
const propertyDeclaration = new PropertyDeclaration(context, string, node, breakPoint, property, type);
|
|
785
|
-
|
|
786
|
-
return propertyDeclaration;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
export function variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
790
|
-
const { VariableDeclaration } = elements,
|
|
791
|
-
node = variableDeclarationNode, ///
|
|
792
|
-
string = context.nodeAsString(node),
|
|
793
|
-
breakPoint = null,
|
|
794
|
-
type = typeFromVariableDeclarationNode(variableDeclarationNode, context),
|
|
795
|
-
variable = variableFromVariableDeclarationNode(variableDeclarationNode, context),
|
|
796
|
-
provisional = provisionalFromVariableDeclarationNode(variableDeclarationNode, context);
|
|
797
|
-
|
|
798
|
-
context = null;
|
|
799
|
-
|
|
800
|
-
const variableDeclaration = new VariableDeclaration(context, string, node, breakPoint, type, variable, provisional);
|
|
801
|
-
|
|
802
|
-
return variableDeclaration;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
export function metaLevelAssumptionFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
806
|
-
const { MetaLevelAssumption } = elements,
|
|
807
|
-
node = metaLevelAssumptionNode, ///
|
|
808
|
-
string = context.nodeAsString(node),
|
|
809
|
-
breakPoint = null,
|
|
810
|
-
reference = referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context),
|
|
811
|
-
statement = statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context),
|
|
812
|
-
metaLevelAssumption = new MetaLevelAssumption(context, string, node, breakPoint, reference, statement);
|
|
813
|
-
|
|
814
|
-
return metaLevelAssumption;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
export function bracketedCombinatorFromBracketedCombinatorNode(bracketedCombinatorNode, context) {
|
|
818
|
-
const { BracketedCombinator } = elements,
|
|
819
|
-
node = bracketedCombinatorNode, ///
|
|
820
|
-
string = context.nodeAsString(node),
|
|
821
|
-
breakPoint = null,
|
|
822
|
-
statement = statementFromBracketedCombinatorNode(bracketedCombinatorNode, context),
|
|
823
|
-
bracketedCombinator = new BracketedCombinator(context, string, node, breakPoint, statement);
|
|
824
|
-
|
|
825
|
-
return bracketedCombinator;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
export function bracketedConstructorFromBracketedConstructorNode(bracketedConstructorNode, context) {
|
|
829
|
-
const { BracketedConstructor } = elements,
|
|
830
|
-
node = bracketedConstructorNode, ///
|
|
831
|
-
string = context.nodeAsString(node),
|
|
832
|
-
breakPoint = null,
|
|
833
|
-
term = termFromBracketedConstructorNode(bracketedConstructorNode, context),
|
|
834
|
-
type = typeFromBracketedConstructorNode(bracketedConstructorNode, context),
|
|
835
|
-
bracketedConstructor = new BracketedConstructor(context, string, node, breakPoint, term, type);
|
|
836
|
-
|
|
837
|
-
return bracketedConstructor;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
export function typePrefixDeclarationFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
|
|
841
|
-
const { TypePrefixDeclaration } = elements,
|
|
842
|
-
node = typePrefixDeclarationNode, ///
|
|
843
|
-
string = context.nodeAsString(node), ///
|
|
844
|
-
breakPoint = null,
|
|
845
|
-
typePrefix = typePrefixFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context);
|
|
846
|
-
|
|
847
|
-
context = null;
|
|
848
|
-
|
|
849
|
-
const typePrefixDeclaration = new TypePrefixDeclaration(context, string, node, breakPoint, typePrefix);
|
|
850
|
-
|
|
851
|
-
return typePrefixDeclaration;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
export function combinatorDeclarationFromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
|
|
855
|
-
const { CombinatorDeclaration } = elements,
|
|
856
|
-
node = combinatorDeclarationNode, ///
|
|
857
|
-
string = context.nodeAsString(node),
|
|
858
|
-
breakPoint = null,
|
|
859
|
-
combinator = combinatorFromCombinatorDeclarationNode(combinatorDeclarationNode, context);
|
|
860
|
-
|
|
861
|
-
context = null;
|
|
862
|
-
|
|
863
|
-
const combinatorDeclaration = new CombinatorDeclaration(context, string, node, breakPoint, combinator);
|
|
864
|
-
|
|
865
|
-
return combinatorDeclaration;
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
export function simpleTypeDeclarationFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
869
|
-
const { SimpleTypeDeclaration } = elements,
|
|
870
|
-
node = simpleTypeDeclarationNode, ///
|
|
871
|
-
string = context.nodeAsString(node),
|
|
872
|
-
breakPoint = null,
|
|
873
|
-
type = typeFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
874
|
-
superTypes = superTypesFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
875
|
-
provisional = provisionalFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context);
|
|
876
|
-
|
|
877
|
-
context = null;
|
|
878
|
-
|
|
879
|
-
const simpleTypeDeclaration = new SimpleTypeDeclaration(context, string, node, breakPoint, type, superTypes, provisional);
|
|
880
|
-
|
|
881
|
-
return simpleTypeDeclaration;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
export function referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, generalContext, specificContext) {
|
|
885
|
-
const { ReferenceSubstitution } = elements,
|
|
886
|
-
node = referenceSubstitutionNode, ///
|
|
887
|
-
context = specificContext, ///
|
|
888
|
-
contexts = [
|
|
889
|
-
generalContext,
|
|
890
|
-
specificContext
|
|
891
|
-
],
|
|
892
|
-
string = context.nodeAsString(node),
|
|
893
|
-
breakPoint = null,
|
|
894
|
-
targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
895
|
-
replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
896
|
-
referenceSubstitution = new ReferenceSubstitution(contexts, string, node, breakPoint, targetReference, replacementReference);
|
|
897
|
-
|
|
898
|
-
return referenceSubstitution;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
export function statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext) {
|
|
902
|
-
const { StatementSubstitution } = elements,
|
|
903
|
-
node = statementSubstitutionNode, ///
|
|
904
|
-
context = specificContext, ///
|
|
905
|
-
contexts = [
|
|
906
|
-
generalContext,
|
|
907
|
-
specificContext
|
|
908
|
-
],
|
|
909
|
-
string = context.nodeAsString(node),
|
|
910
|
-
breakPoint = null,
|
|
911
|
-
resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
912
|
-
substitution = substitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext),
|
|
913
|
-
targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
914
|
-
replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
915
|
-
statementSubstitution = new StatementSubstitution(contexts, string, node, breakPoint, resolved, substitution, targetStatement, replacementStatement);
|
|
916
|
-
|
|
917
|
-
return statementSubstitution;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
export function constructorDeclarationFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
921
|
-
const { ConstructorDeclaration } = elements,
|
|
922
|
-
node = constructorDeclarationNode, ///
|
|
923
|
-
string = context.nodeAsString(node),
|
|
924
|
-
breakPoint = null,
|
|
925
|
-
type = typeFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
926
|
-
provisional = provisionalFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
927
|
-
constructor = constructorFromConstructorDeclarationNode(constructorDeclarationNode, context);
|
|
928
|
-
|
|
929
|
-
context = null;
|
|
930
|
-
|
|
931
|
-
const constructorDeclaration = new ConstructorDeclaration(context, string, node, breakPoint, type, provisional, constructor);
|
|
932
|
-
|
|
933
|
-
return constructorDeclaration;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
export function complexTypeDeclarationFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
937
|
-
const { ComplexTypeDeclaration } = elements,
|
|
938
|
-
node = complexTypeDeclarationNode, ///
|
|
939
|
-
breakPoint = null,
|
|
940
|
-
type = typeFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
941
|
-
superTypes = superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
942
|
-
provisional = provisionalFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
943
|
-
propertyDeclarations = propertyDeclarationsFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
944
|
-
complexTypeDeclarationString = complexTypeDeclarationStringFromTypeSuperTypesAndProvisional(type, superTypes, provisional),
|
|
945
|
-
string = complexTypeDeclarationString; ///
|
|
946
|
-
|
|
947
|
-
context = null;
|
|
948
|
-
|
|
949
|
-
const complexTypeDeclaration = new ComplexTypeDeclaration(context, string, node, breakPoint, type, superTypes, provisional, propertyDeclarations);
|
|
950
|
-
|
|
951
|
-
return complexTypeDeclaration;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
export function metavariableDeclarationFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
955
|
-
const { MetavariableDeclaration } = elements,
|
|
956
|
-
node = metavariableDeclarationNode, ///
|
|
957
|
-
string = context.nodeAsString(node),
|
|
958
|
-
breakPoint = null,
|
|
959
|
-
metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
960
|
-
metavariable = metavariableFromMetavariableDeclarationNode(metavariableDeclarationNode, context);
|
|
961
|
-
|
|
962
|
-
context = null;
|
|
963
|
-
|
|
964
|
-
const metavariableDeclaration = new MetavariableDeclaration(context, string, node, breakPoint, metaType, metavariable);
|
|
965
|
-
|
|
966
|
-
return metavariableDeclaration;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
export function nameFromTypeNode(typeNode, context) {
|
|
970
|
-
const typeName = typeNode.getTypeName(),
|
|
971
|
-
name = typeName; ///
|
|
972
|
-
|
|
973
|
-
return name;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
export function typeFromTermNode(termNode, context) {
|
|
977
|
-
const type = null;
|
|
978
|
-
|
|
979
|
-
return type;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
export function proofFromRuleNode(ruleNode, context) {
|
|
983
|
-
let proof = null;
|
|
984
|
-
|
|
985
|
-
const proofNode = ruleNode.getProofNode();
|
|
986
|
-
|
|
987
|
-
if (proofNode !== null) {
|
|
988
|
-
proof = proofFromProofNode(proofNode, context);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
return proof;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
export function labelsFromRuleNode(ruleNode, context) {
|
|
995
|
-
const labelNodes = ruleNode.getLabelNodes(),
|
|
996
|
-
labels = labelsFromLabelNodes(labelNodes, context);
|
|
997
|
-
|
|
998
|
-
return labels;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
export function variableFromTermNode(termNode, context) {
|
|
1002
|
-
let variable = null;
|
|
1003
|
-
|
|
1004
|
-
const variableNode = termNode.getVariableNode();
|
|
1005
|
-
|
|
1006
|
-
if (variableNode !== null) {
|
|
1007
|
-
variable = variableFromVariableNode(variableNode, context);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
return variable;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
export function premisesFromRuleNode(ruleNode, context) {
|
|
1014
|
-
const premiseNodes = ruleNode.getPremiseNodes(),
|
|
1015
|
-
premises = premisesFromPremiseNodes(premiseNodes, context);
|
|
1016
|
-
|
|
1017
|
-
return premises;
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
export function axiomFromSectionNode(sectionNode, context) {
|
|
1021
|
-
let axiom = null;
|
|
1022
|
-
|
|
1023
|
-
const axiomNode = sectionNode.getAxiomNode();
|
|
1024
|
-
|
|
1025
|
-
if (axiomNode !== null) {
|
|
1026
|
-
axiom = axiomFromAxiomNode(axiomNode, context);
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
return axiom;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
export function lemmaFromSectionNode(sectionNode, context) {
|
|
1033
|
-
let lemma = null;
|
|
1034
|
-
|
|
1035
|
-
const lemmaNode = sectionNode.getLemmaNode();
|
|
1036
|
-
|
|
1037
|
-
if (lemmaNode !== null) {
|
|
1038
|
-
lemma = lemmaFromLemmaNode(lemmaNode, context);
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
return lemma;
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
export function nameFromPropertyNode(propertyNode, context) {
|
|
1045
|
-
const propertyName = propertyNode.getPropertyName(),
|
|
1046
|
-
name = propertyName;
|
|
1047
|
-
|
|
1048
|
-
return name;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
export function typeFromPropertyNode(propertyNode, context) {
|
|
1052
|
-
const type = null; ///
|
|
1053
|
-
|
|
1054
|
-
return type;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
export function typeFromVariableNode(variableNode, context) {
|
|
1058
|
-
const type = null;
|
|
1059
|
-
|
|
1060
|
-
return type;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
export function nameFromParamterNode(parameterNode, context) {
|
|
1064
|
-
const name = parameterNode.getName();
|
|
1065
|
-
|
|
1066
|
-
return name;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
export function statementFromStepNode(stepNode, context) {
|
|
1070
|
-
let statement = null;
|
|
1071
|
-
|
|
1072
|
-
const statementNode = stepNode.getStatementNode();
|
|
1073
|
-
|
|
1074
|
-
if (statementNode !== null) {
|
|
1075
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
return statement;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
export function referenceFromStepNode(stepNode, context) {
|
|
1082
|
-
let reference = null;
|
|
1083
|
-
|
|
1084
|
-
const referenceNode = stepNode.getReferenceNode();
|
|
1085
|
-
|
|
1086
|
-
if (referenceNode !== null) {
|
|
1087
|
-
const { Reference } = elements,
|
|
1088
|
-
referenceString = context.nodeAsString(referenceNode);
|
|
1089
|
-
|
|
1090
|
-
reference = Reference.fromReferenceString(referenceString, context);
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
return reference;
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
export function nameFromParaneterNode(parameterNode, context) {
|
|
1097
|
-
const name = parameterNode.getName();
|
|
1098
|
-
|
|
1099
|
-
return name;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
export function superTypesFromTypeNode(typeNode, context) {
|
|
1103
|
-
const superTypes = null;
|
|
1104
|
-
|
|
1105
|
-
return superTypes;
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
export function propertiesFromTypeNode(typeNode, context) {
|
|
1109
|
-
const properties = null;
|
|
1110
|
-
|
|
1111
|
-
return properties;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
export function prefixNameFromTypeNode(typeNode, context) {
|
|
1115
|
-
const typePrefixName = typeNode.getTypePrefixName(),
|
|
1116
|
-
prefixName = typePrefixName; ///
|
|
1117
|
-
|
|
1118
|
-
return prefixName;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
export function conclusionFromRuleNode(ruleNode, context) {
|
|
1122
|
-
const conclusionNode = ruleNode.getConclusionNode(),
|
|
1123
|
-
conclusion = conclusionFromConclusionNode(conclusionNode, context);
|
|
1124
|
-
|
|
1125
|
-
return conclusion;
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
export function theoremFromSectionNode(sectionNode, context) {
|
|
1129
|
-
let theorem = null;
|
|
1130
|
-
|
|
1131
|
-
const theoremNode = sectionNode.getTheoremNode();
|
|
1132
|
-
|
|
1133
|
-
if (theoremNode !== null) {
|
|
1134
|
-
theorem = theoremFromTheoremNode(theoremNode, context);
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
return theorem;
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
export function frameFromJudgementNode(judgementNode, context) {
|
|
1141
|
-
const frameNode = judgementNode.getFrameNode(),
|
|
1142
|
-
frame = frameFromFrameNode(frameNode, context);
|
|
1143
|
-
|
|
1144
|
-
return frame;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
export function termsFromSignatureNode(signatureNode, context) {
|
|
1148
|
-
const termNodes = signatureNode.getTermNodes(),
|
|
1149
|
-
terms = termsFromTermNodes(termNodes, context);
|
|
1150
|
-
|
|
1151
|
-
return terms;
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
export function nameFromTypePrefixNode(typePrefixNode, context) {
|
|
1155
|
-
const typePrefixName = typePrefixNode.getTypePrefixName(),
|
|
1156
|
-
name = typePrefixName; ///
|
|
1157
|
-
|
|
1158
|
-
return name;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
export function provisionalFromTypeNode(typeNode, context) {
|
|
1162
|
-
const provisional = null;
|
|
1163
|
-
|
|
1164
|
-
return provisional;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
export function provisionalFromTermNode(termNode, context) {
|
|
1168
|
-
const provisional = null;
|
|
1169
|
-
|
|
1170
|
-
return provisional;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
export function derivationFromProofNode(proofNode, context) {
|
|
1174
|
-
const derivationNode = proofNode.getDerivationNode(),
|
|
1175
|
-
derivation = derivationFromDerivationNode(derivationNode, context);
|
|
1176
|
-
|
|
1177
|
-
return derivation;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
export function termFromConstructorNode(ocnstructorNode, context) {
|
|
1181
|
-
const termNode = ocnstructorNode.getTermNode(),
|
|
1182
|
-
term = termFromTermNode(termNode, context);
|
|
1183
|
-
|
|
1184
|
-
return term;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
export function typeFromConstructorNode(ocnstructorNode, context) {
|
|
1188
|
-
const type = null;
|
|
1189
|
-
|
|
1190
|
-
return type;
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
export function typeFromEquivalenceNode(equivalenceNode, context) {
|
|
1194
|
-
const type = null;
|
|
1195
|
-
|
|
1196
|
-
return type;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
export function assumptionsFromFrameNode(frameNode, context) {
|
|
1200
|
-
const assumptionNodes = frameNode.getAssumptionNodes(),
|
|
1201
|
-
assumptions = assumptionsFromAssumptionNodes(assumptionNodes, context);
|
|
1202
|
-
|
|
1203
|
-
return assumptions;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
export function statementFromPremiseNode(premiseNode, context) {
|
|
1207
|
-
let statement = null;
|
|
1208
|
-
|
|
1209
|
-
const statementNode = premiseNode.getStatementNode();
|
|
1210
|
-
|
|
1211
|
-
if (statementNode !== null) {
|
|
1212
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
return statement;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
export function leftTermFromEqualityNode(equalityNode, context) {
|
|
1219
|
-
const leftTermNode = equalityNode.getLeftTermNode(),
|
|
1220
|
-
leftTerm = termFromTermNode(leftTermNode, context);
|
|
1221
|
-
|
|
1222
|
-
return leftTerm;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
export function termsFromEquivalenceNode(equivalenceNode, context) {
|
|
1226
|
-
const termNodes = equivalenceNode.getTermNodes(),
|
|
1227
|
-
terms = termsFromTermNodes(termNodes, context);
|
|
1228
|
-
|
|
1229
|
-
return terms;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
export function nameFromMetavariableNode(metavariableNode, context) {
|
|
1233
|
-
const metavaraibleName = metavariableNode.getMetavariableName(),
|
|
1234
|
-
name = metavaraibleName; ///
|
|
1235
|
-
|
|
1236
|
-
return name;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
export function termFromMetavariableNode(metavariableNode, context) {
|
|
1240
|
-
let term = null;
|
|
1241
|
-
|
|
1242
|
-
const termNode = metavariableNode.getTermNode();
|
|
1243
|
-
|
|
1244
|
-
if (termNode !== null) {
|
|
1245
|
-
term = termFromTermNode(termNode, context);
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
return term;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
export function typeFromMetavariableNode(metavariableNode, context) {
|
|
1252
|
-
let type = null;
|
|
1253
|
-
|
|
1254
|
-
const typemNode = metavariableNode.getTypeNode();
|
|
1255
|
-
|
|
1256
|
-
if (typemNode !== null) {
|
|
1257
|
-
type = typeFromTypeNode(typemNode, context);
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
return type;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
export function metavariableFromFrameNode(frameNode, context) {
|
|
1264
|
-
let metavariable = null;
|
|
1265
|
-
|
|
1266
|
-
const metavariableNode = frameNode.getMetavariableNode();
|
|
1267
|
-
|
|
1268
|
-
if (metavariableNode !== null) {
|
|
1269
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
return metavariable;
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
export function metavariableFromLabelNode(labelNode, context) {
|
|
1276
|
-
const metavariableNode = labelNode.getMetavariableNode(),
|
|
1277
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
1278
|
-
|
|
1279
|
-
return metavariable;
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
export function conjectureFromSectionNode(sectionNode, context) {
|
|
1283
|
-
let conjecture = null;
|
|
1284
|
-
|
|
1285
|
-
const conjectureNode = sectionNode.getConjectureNode();
|
|
1286
|
-
|
|
1287
|
-
if (conjectureNode !== null) {
|
|
1288
|
-
conjecture = conjectureFromConjectureNode(conjectureNode, context);
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
return conjecture;
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
export function rightTermFromEqualityNode(equalityNode, context) {
|
|
1295
|
-
const rightTermNode = equalityNode.getRightTermNode(),
|
|
1296
|
-
rightTerm = termFromTermNode(rightTermNode, context);
|
|
1297
|
-
|
|
1298
|
-
return rightTerm;
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
export function equalityFromStatementNode(statementNode, context) {
|
|
1302
|
-
let equality = null;
|
|
1303
|
-
|
|
1304
|
-
const equalityNode = statementNode.getEqualityNode();
|
|
1305
|
-
|
|
1306
|
-
if (equalityNode !== null) {
|
|
1307
|
-
equality = equalityFromEqualityNode(equalityNode, context);
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
return equality;
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
export function termFromTypeAssertionNode(typeAssertionNode, context) {
|
|
1314
|
-
const termNode = typeAssertionNode.getTermNode(),
|
|
1315
|
-
term = termFromTermNode(termNode, context);
|
|
1316
|
-
|
|
1317
|
-
return term;
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
export function typeFromTypeAssertionNode(typeAssertionNode, context) {
|
|
1321
|
-
const typeNode = typeAssertionNode.getTypeNode(),
|
|
1322
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1323
|
-
|
|
1324
|
-
return type;
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
export function identifierFromVariableNode(variableNode, context) {
|
|
1328
|
-
const variableIdentifier = variableNode.getVariableIdentifier(),
|
|
1329
|
-
identifier = variableIdentifier; ///
|
|
1330
|
-
|
|
1331
|
-
return identifier;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
export function identifierFromParamterNode(parameterNode, context) {
|
|
1335
|
-
const identifier = parameterNode.getIdentifier();
|
|
1336
|
-
|
|
1337
|
-
return identifier;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
export function statementFromDeductionNode(deductionNode, context) {
|
|
1341
|
-
let statement = null;
|
|
1342
|
-
|
|
1343
|
-
const statementNode = deductionNode.getStatementNode();
|
|
1344
|
-
|
|
1345
|
-
if (statementNode !== null) {
|
|
1346
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
return statement;
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
export function judgementFromStatementNode(statementNode, context) {
|
|
1353
|
-
let judgement = null;
|
|
1354
|
-
|
|
1355
|
-
const judgementNode = statementNode.getJudgementNode();
|
|
1356
|
-
|
|
1357
|
-
if (judgementNode !== null) {
|
|
1358
|
-
judgement = judgementFromJudgementNode(judgementNode, context);
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
return judgement;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
export function stepFromStepOrSubproofNode(stepOrSubproofNode, context) {
|
|
1365
|
-
let step = null;
|
|
1366
|
-
|
|
1367
|
-
const stepOrSubproofNodeStepNode = stepOrSubproofNode.isStepNode();
|
|
1368
|
-
|
|
1369
|
-
if (stepOrSubproofNodeStepNode) {
|
|
1370
|
-
const stepNode = stepOrSubproofNode; ///
|
|
1371
|
-
|
|
1372
|
-
step = stepFromStepNode(stepNode, context);
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
return step;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
export function nominalTypeNameFromTypeNode(typeNode, context) {
|
|
1379
|
-
const nominalTypeName = typeNode.getNominalTypeName();
|
|
1380
|
-
|
|
1381
|
-
return nominalTypeName;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
export function provisionalFromVariableNode(variableNode, context) {
|
|
1385
|
-
const provisional = null;
|
|
1386
|
-
|
|
1387
|
-
return provisional;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
export function assumptionFromJudgementNode(judgementNode, context) {
|
|
1391
|
-
const assumptionNode = judgementNode.getAssumptionNode(),
|
|
1392
|
-
assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
1393
|
-
|
|
1394
|
-
return assumption;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
export function identifierFromParameterNode(parameterNode, context) {
|
|
1398
|
-
const identifier = parameterNode.getIdentifier();
|
|
1399
|
-
|
|
1400
|
-
return identifier;
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
1404
|
-
const metavariableNode = assumptionNode.getMetavariableNode(),
|
|
1405
|
-
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
1406
|
-
|
|
1407
|
-
return reference;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
export function statementFromAssumptionNode(assumptionNode, context) {
|
|
1411
|
-
const statesmentNode = assumptionNode.getStatementNode(),
|
|
1412
|
-
statement = statementFromStatementNode(statesmentNode, context);
|
|
1413
|
-
|
|
1414
|
-
return statement;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
export function statementFromCombinatorNode(combinatorNode, context) {
|
|
1418
|
-
const statementNode = combinatorNode.getStatementNode(),
|
|
1419
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1420
|
-
|
|
1421
|
-
return statement;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
export function statementFromConclusionNode(conclusinoNode, context) {
|
|
1425
|
-
let statement = null;
|
|
1426
|
-
|
|
1427
|
-
const statementNode = conclusinoNode.getStatementNode();
|
|
1428
|
-
|
|
1429
|
-
if (statementNode !== null) {
|
|
1430
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
return statement;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
export function statementFromHypothesisNode(hypothesisNode, context) {
|
|
1437
|
-
let statement = null;
|
|
1438
|
-
|
|
1439
|
-
const statementNode = hypothesisNode.getStatementNode();
|
|
1440
|
-
|
|
1441
|
-
if (statementNode !== null) {
|
|
1442
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
return statement;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
export function procedureCallFromPremiseNode(premiseNode, context) {
|
|
1449
|
-
let procedureCall = null;
|
|
1450
|
-
|
|
1451
|
-
const procedureCallNode = premiseNode.getProcedureCallNode();
|
|
1452
|
-
|
|
1453
|
-
if (procedureCallNode !== null) {
|
|
1454
|
-
procedureCall = procedureCallFromProcedureCallNode(procedureCallNode, context);
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
return procedureCall;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
export function suppositionsFromSubproofNode(subproofNode, context) {
|
|
1461
|
-
const suppositionNodes = subproofNode.getSuppositionNodes(),
|
|
1462
|
-
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
|
1463
|
-
|
|
1464
|
-
return suppositions;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
export function statementFromSuppositionNode(suppositionNode, context) {
|
|
1468
|
-
let statement = null;
|
|
1469
|
-
|
|
1470
|
-
const statementNode = suppositionNode.getStatementNode();
|
|
1471
|
-
|
|
1472
|
-
if (statementNode !== null) {
|
|
1473
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
return statement; ///
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
export function termFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
1480
|
-
let term = null;
|
|
1481
|
-
|
|
1482
|
-
const termNode = definedAssertionNode.getTermNode();
|
|
1483
|
-
|
|
1484
|
-
if (termNode !== null) {
|
|
1485
|
-
term = termFromTermNode(termNode, context);
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
return term;
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
export function termFromPropertyRelationNode(propertyRelationNode, context) {
|
|
1492
|
-
const termNode = propertyRelationNode.getTermNode(),
|
|
1493
|
-
term = termFromTermNode(termNode, context);
|
|
1494
|
-
|
|
1495
|
-
return term;
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
export function subDerivationFromSubproofNode(subproofNode, context) {
|
|
1499
|
-
const subDerivationNode = subproofNode.getSubDerivationNode(),
|
|
1500
|
-
subDerviation = subDerivationFromSubDerivationNode(subDerivationNode, context);
|
|
1501
|
-
|
|
1502
|
-
return subDerviation;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
export function metavariableFromStatementNode(statementNode, context) {
|
|
1506
|
-
let metavariable = null;
|
|
1507
|
-
|
|
1508
|
-
const metavariableNode = statementNode.getMetavariableNode();
|
|
1509
|
-
|
|
1510
|
-
if (metavariableNode !== null) {
|
|
1511
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
return metavariable;
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
export function metavariableFromReferenceNode(referenceNode, context) {
|
|
1518
|
-
const metavariableNode = referenceNode.getMetavariableNode(),
|
|
1519
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
1520
|
-
|
|
1521
|
-
return metavariable;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
export function referenceFromMetavariableNode(metavariableNode, context) {
|
|
1525
|
-
const { Reference } = elements,
|
|
1526
|
-
metavariableString = context.nodeAsString(metavariableNode),
|
|
1527
|
-
referenceString = metavariableString, ///
|
|
1528
|
-
reference = Reference.fromReferenceString(referenceString, context);
|
|
1529
|
-
|
|
1530
|
-
return reference;
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
export function termFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1534
|
-
let term = null;
|
|
1535
|
-
|
|
1536
|
-
const termNode = definedAssertionNode.getTermNode();
|
|
1537
|
-
|
|
1538
|
-
if (termNode !== null) {
|
|
1539
|
-
term = termFromTermNode(termNode, context);
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
return term
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
export function frameFromDefinedAssertionNode(definedAssertionNode, context) {
|
|
1546
|
-
let frame = null;
|
|
1547
|
-
|
|
1548
|
-
const frameNode = definedAssertionNode.getFrameNode();
|
|
1549
|
-
|
|
1550
|
-
if (frameNode !== null) {
|
|
1551
|
-
frame = frameFromFrameNode(frameNode, context);
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
return frame;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
export function termFromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
1558
|
-
const termNode = propertyAssertionNode.getTermNode(),
|
|
1559
|
-
term = termFromTermNode(termNode, context);
|
|
1560
|
-
|
|
1561
|
-
return term;
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
export function signatureAssertionFromStepNode(stepNode, context) {
|
|
1565
|
-
let signatureAssertion = null;
|
|
1566
|
-
|
|
1567
|
-
const signatureAssertionNode = stepNode.getSignatureAssertionNode();
|
|
1568
|
-
|
|
1569
|
-
if (signatureAssertionNode !== null) {
|
|
1570
|
-
signatureAssertion = signatureAssertionFromSignatureAssertionNode(signatureAssertionNode, context);
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
return signatureAssertion;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
export function typeAssertionFromStatementNode(statementNode, context) {
|
|
1577
|
-
let typeAssertion = null;
|
|
1578
|
-
|
|
1579
|
-
const typeAssertionNode = statementNode.getTypeAssertionNode();
|
|
1580
|
-
|
|
1581
|
-
if (typeAssertionNode !== null) {
|
|
1582
|
-
typeAssertion = typeAssertionFromTypeAssertionNode(typeAssertionNode, context);
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
return typeAssertion;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
export function frameFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1589
|
-
let frame = null;
|
|
1590
|
-
|
|
1591
|
-
const frameNode = definedAssertionNode.getFrameNode();
|
|
1592
|
-
|
|
1593
|
-
if (frameNode !== null) {
|
|
1594
|
-
frame = frameFromFrameNode(frameNode, context);
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
return frame
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
export function proofFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1601
|
-
let proof = null;
|
|
1602
|
-
|
|
1603
|
-
const proofNode = topLevelAsssertionNode.getProofNode();
|
|
1604
|
-
|
|
1605
|
-
if (proofNode !== null) {
|
|
1606
|
-
proof = proofFromProofNode(proofNode, context);
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
return proof;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
export function subproofFromStepOrSubproofNode(subproofOrSubproofNode, context) {
|
|
1613
|
-
let subproof = null;
|
|
1614
|
-
|
|
1615
|
-
const subproofOrSubproofNodeSubproofNode = subproofOrSubproofNode.isSubproofNode();
|
|
1616
|
-
|
|
1617
|
-
if (subproofOrSubproofNodeSubproofNode) {
|
|
1618
|
-
const subproofNode = subproofOrSubproofNode; ///
|
|
1619
|
-
|
|
1620
|
-
subproof = subproofFromSubproofNode(subproofNode, context);
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
return subproof;
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
export function termFromContainedAssertionNode(containedAssertionNode, context) {
|
|
1627
|
-
let term = null;
|
|
1628
|
-
|
|
1629
|
-
const termNode = containedAssertionNode.getTermNode();
|
|
1630
|
-
|
|
1631
|
-
if (termNode !== null) {
|
|
1632
|
-
term = termFromTermNode(termNode, context);
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
return term;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
export function nameFromProcedureReferenceNode(procedureReferenceNode, context) {
|
|
1639
|
-
const name = procedureReferenceNode.getName();
|
|
1640
|
-
|
|
1641
|
-
return name;
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
export function parametersFromProcedureCallNode(procedureCallNode, context) {
|
|
1645
|
-
const parameterNodes = procedureCallNode.getParameterNodes(),
|
|
1646
|
-
parameters = parametersFromParameterNodes(parameterNodes, context);
|
|
1647
|
-
|
|
1648
|
-
return parameters;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
export function frameFromContainedAssertionNode(containedAssertionNode, context) {
|
|
1652
|
-
let frame = null;
|
|
1653
|
-
|
|
1654
|
-
const frameNode = containedAssertionNode.getFrameNode();
|
|
1655
|
-
|
|
1656
|
-
if (frameNode !== null) {
|
|
1657
|
-
frame = frameFromFrameNode(frameNode, context)
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
return frame;
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
export function labelsFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1664
|
-
const labelNodes = topLevelAsssertionNode.getLabelNodes(),
|
|
1665
|
-
labels = labelsFromLabelNodes(labelNodes, context);
|
|
1666
|
-
|
|
1667
|
-
return labels;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
export function typeFromPropertyDeclarationNode(propertyDeclarationNode, context) {
|
|
1671
|
-
const typeNode = propertyDeclarationNode.getTypeNode(),
|
|
1672
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1673
|
-
|
|
1674
|
-
return type;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
export function typeFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
1678
|
-
const typeNode = variableDeclarationNode.getTypeNode(),
|
|
1679
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1680
|
-
|
|
1681
|
-
return type;
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
export function topLevelAssertionFromSectionNode(sectionNode, context) {
|
|
1685
|
-
const axiom = axiomFromSectionNode(sectionNode, context),
|
|
1686
|
-
lemma = lemmaFromSectionNode(sectionNode, context),
|
|
1687
|
-
theorem = theoremFromSectionNode(sectionNode, context),
|
|
1688
|
-
conjecture = conjectureFromSectionNode(sectionNode, context),
|
|
1689
|
-
topLevelAssertion = (axiom || lemma || theorem || conjecture);
|
|
1690
|
-
|
|
1691
|
-
return topLevelAssertion;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
export function procedureCallFromSuppositionNode(suppositionNode, context) {
|
|
1695
|
-
let procedureCall = null;
|
|
1696
|
-
|
|
1697
|
-
const procedureCallNode = suppositionNode.getProcedureCallNode();
|
|
1698
|
-
|
|
1699
|
-
if (procedureCallNode !== null) {
|
|
1700
|
-
procedureCall = procedureCallFromProcedureCallNode(procedureCallNode, context);
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
return procedureCall;
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
export function negatedFromJDefinedAssertionNode(definedAssertionNode, context) {
|
|
1707
|
-
const negated = definedAssertionNode.isNegated();
|
|
1708
|
-
|
|
1709
|
-
return negated
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
export function propertyFromPropertyRelationNode(propertyRelationNode, context) {
|
|
1713
|
-
const propertyNode = propertyRelationNode.getPropertyNode(),
|
|
1714
|
-
property = propertyFromPropertyNode(propertyNode, context);
|
|
1715
|
-
|
|
1716
|
-
return property;
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
|
-
export function termFromBracketedConstructorNode(bracketedCcnstructorNode, context) {
|
|
1720
|
-
const termNode = bracketedCcnstructorNode.getTermNode(),
|
|
1721
|
-
term = termFromTermNode(termNode, context);
|
|
1722
|
-
|
|
1723
|
-
return term;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
export function typeFromBracketedConstructorNode(bracketedCcnstructorNode, context) {
|
|
1727
|
-
const baseType = baseTypeFromNothing(),
|
|
1728
|
-
type = baseType; ///
|
|
1729
|
-
|
|
1730
|
-
return type;
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
export function definedAssertionFromStatementNode(statementNode, context) {
|
|
1734
|
-
let definedAssertion = null;
|
|
1735
|
-
|
|
1736
|
-
const definedAssertionNode = statementNode.getDefinedAssertionNode();
|
|
1737
|
-
|
|
1738
|
-
if (definedAssertionNode !== null) {
|
|
1739
|
-
definedAssertion = definedAssertionFromDefinedAssertionNode(definedAssertionNode, context);
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
return definedAssertion;
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
export function negatedFromContainedAssertionNode(containedAssertionNode, context) {
|
|
1746
|
-
const negated = containedAssertionNode.isNegated();
|
|
1747
|
-
|
|
1748
|
-
return negated;
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
export function typeFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1752
|
-
const typeNode = simpleTypeDeclarationNode.getTypeNode(),
|
|
1753
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1754
|
-
|
|
1755
|
-
return type;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
export function targetTermFromTermSubstitutionNode(termSubstitutionNode, context) {
|
|
1759
|
-
const targetTermNode = termSubstitutionNode.getTargetTermNode(),
|
|
1760
|
-
targetTerm = termFromTermNode(targetTermNode, context);
|
|
1761
|
-
|
|
1762
|
-
return targetTerm;
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
export function deductionFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1766
|
-
const deductionNode = topLevelAsssertionNode.getDeductionNode(),
|
|
1767
|
-
deduction = deductionFromDeductionNode(deductionNode, context);
|
|
1768
|
-
|
|
1769
|
-
return deduction;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
export function signatureFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1773
|
-
let signature = null;
|
|
1774
|
-
|
|
1775
|
-
const signatureNode = topLevelAsssertionNode.getSignatureNode();
|
|
1776
|
-
|
|
1777
|
-
if (signatureNode !== null) {
|
|
1778
|
-
const { Signature } = elements,
|
|
1779
|
-
signatureString = context.nodeAsString(signatureNode);
|
|
1780
|
-
|
|
1781
|
-
signature = Signature.fromSignatureString(signatureString, context);
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
return signature;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
export function proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1788
|
-
const proofNode = metaLemmaMetathoremNode.getProofNode(),
|
|
1789
|
-
proof = proofFromProofNode(proofNode, context);
|
|
1790
|
-
|
|
1791
|
-
return proof;
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
export function labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1795
|
-
const { Label } = elements,
|
|
1796
|
-
labelNode = metaLemmaMetathoremNode.getLabelNode(),
|
|
1797
|
-
labelString = context.nodeAsString(labelNode),
|
|
1798
|
-
label = Label.fromLabelString(labelString, context);
|
|
1799
|
-
|
|
1800
|
-
return label;
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
export function propertyAssertionFromStatementNode(statementNode, context) {
|
|
1804
|
-
let propertyAssertion = null;
|
|
1805
|
-
|
|
1806
|
-
const propertyAssertionNode = statementNode.getPropertyAssertionNode();
|
|
1807
|
-
|
|
1808
|
-
if (propertyAssertionNode !== null) {
|
|
1809
|
-
propertyAssertion = propertyAssertionFromPropertyAssertionNode(propertyAssertionNode, context);
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
return propertyAssertion;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
export function subproofAssertionFromStatementNode(statementNode, context) {
|
|
1816
|
-
let subproofAssertion = null;
|
|
1817
|
-
|
|
1818
|
-
const subproofAssertionNode = statementNode.getSubproofAssertionNode();
|
|
1819
|
-
|
|
1820
|
-
if (subproofAssertionNode !== null) {
|
|
1821
|
-
subproofAssertion = subproofAssertionFromSubproofAssertionNode(subproofAssertionNode, context);
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
return subproofAssertion;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
export function typeFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
1828
|
-
const typeNode = complexTypeDeclarationNode.getTypeNode(),
|
|
1829
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1830
|
-
|
|
1831
|
-
return type;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
export function typeFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
1835
|
-
const typeNode = constructorDeclarationNode.getTypeNode(),
|
|
1836
|
-
type = typeFromTypeNode(typeNode, context);
|
|
1837
|
-
|
|
1838
|
-
return type;
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
export function containedAssertionFromStatementNode(statementNode, context) {0
|
|
1842
|
-
let containedAssertion = null;
|
|
1843
|
-
|
|
1844
|
-
const containedAssertionNode = statementNode.getContainedAssertionNode();
|
|
1845
|
-
|
|
1846
|
-
if (containedAssertionNode !== null) {
|
|
1847
|
-
containedAssertion = containedAssertionFromContainedAssertionNode(containedAssertionNode, context);
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
return containedAssertion;
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
export function signatureAssertionFromStatementNode(statementNode, context) {
|
|
1854
|
-
let signatureAssertion = null;
|
|
1855
|
-
|
|
1856
|
-
const signatureAssertionNode = statementNode.getSignatureAssertionNode();
|
|
1857
|
-
|
|
1858
|
-
if (signatureAssertionNode !== null) {
|
|
1859
|
-
signatureAssertion = signatureAssertionFromSignatureAssertionNode(signatureAssertionNode, context);
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
return signatureAssertion;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
export function statementsFromSubproofAssertionNode(subproofAssertionNode, context) {
|
|
1866
|
-
const statementNodes = subproofAssertionNode.getStatementNodes(),
|
|
1867
|
-
statements = statementsFromStatementNodes(statementNodes, context);
|
|
1868
|
-
|
|
1869
|
-
return statements;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
export function statementFromContainedAssertionNode(containedAssertionNode, context) {
|
|
1873
|
-
const statementNode = containedAssertionNode.getStatementNode(),
|
|
1874
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1875
|
-
|
|
1876
|
-
return statement;
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
export function signatureFromSignatureAssertionNode(signatureAssertionNode, context) {
|
|
1880
|
-
const { Signature } = elements,
|
|
1881
|
-
signatureNode = signatureAssertionNode.getSignatureNode(),
|
|
1882
|
-
signatureString = context.nodeAsString(signatureNode),
|
|
1883
|
-
signature = Signature.fromSignatureString(signatureString, context);
|
|
1884
|
-
|
|
1885
|
-
return signature;
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
export function referenceFromSignatureAssertionNode(signatureAssertionNode, context) {
|
|
1889
|
-
const metavariableNode = signatureAssertionNode.getMetavariableNode(),
|
|
1890
|
-
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
1891
|
-
|
|
1892
|
-
return reference;
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
export function hypothesesFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1896
|
-
const ypotheses = [];
|
|
1897
|
-
|
|
1898
|
-
return ypotheses;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
export function propertyFromPropertyDeclarationNode(propertyDeclarationNode, context) {
|
|
1902
|
-
const propertyNode = propertyDeclarationNode.getPropertyNode(),
|
|
1903
|
-
property = propertyFromPropertyNode(propertyNode, context);
|
|
1904
|
-
|
|
1905
|
-
return property;
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
export function variableFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
1909
|
-
const variableNode = variableDeclarationNode.getVariableNode(),
|
|
1910
|
-
variable = variableFromVariableNode(variableNode, context);
|
|
1911
|
-
|
|
1912
|
-
return variable;
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
export function statementFromBracketedCombinatorNode(bracketedCombinatorNode, context) {
|
|
1916
|
-
const statementNode = bracketedCombinatorNode.getStatementNode(),
|
|
1917
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1918
|
-
|
|
1919
|
-
return statement;
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
export function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
1923
|
-
const targetFrameNode = frameSubstitutionNode.getTargetFrameNode(),
|
|
1924
|
-
targetFrame = frameFromFrameNode(targetFrameNode, context);
|
|
1925
|
-
|
|
1926
|
-
return targetFrame;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
export function referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
1930
|
-
const { Reference } = elements,
|
|
1931
|
-
referenceNode = metaLevelAssumptionNode.getReferenceNode(),
|
|
1932
|
-
referenceString = context.nodeAsString(referenceNode),
|
|
1933
|
-
reference = Reference.fromReferenceString(referenceString, context);
|
|
1934
|
-
|
|
1935
|
-
return reference;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
export function statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
1939
|
-
const statementNode = metaLevelAssumptionNode.getStatementNode(),
|
|
1940
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1941
|
-
|
|
1942
|
-
return statement;
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
export function suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1946
|
-
const suppositionNodes = topLevelAsssertionNode.getSuppositionNodes(),
|
|
1947
|
-
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
|
1948
|
-
|
|
1949
|
-
return suppositions;
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
export function resolvedFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
1953
|
-
const resolved = statementSubstitutionNode.isResolved();
|
|
1954
|
-
|
|
1955
|
-
return resolved;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
export function topLevelMetaAssertionFromReferenceNode(referenceNode, context) {
|
|
1959
|
-
const topLevelMetaAssertion = null;
|
|
1960
|
-
|
|
1961
|
-
return topLevelMetaAssertion;
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
export function deductionFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1965
|
-
const deductionNode = metaLemmaMetathoremNode.getDeductionNode(),
|
|
1966
|
-
deduction = deductionFromDeductionNode(deductionNode, context);
|
|
1967
|
-
|
|
1968
|
-
return deduction;
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
export function provisionalFromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
1972
|
-
const provisional = variableDeclarationNode.isProvisional();
|
|
1973
|
-
|
|
1974
|
-
return provisional;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
export function procedureReferenceFromProcedureCallNode(procedureCallNode, context) {
|
|
1978
|
-
const procedureReferenceNode = procedureCallNode.getProcedureReferenceNode(),
|
|
1979
|
-
procedureReference = procedureReferenceFromProcedureReferenceNode(procedureReferenceNode, context);
|
|
1980
|
-
|
|
1981
|
-
return procedureReference;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
export function replacementTermFromTermSubstitutionNode(termSubstitutionNode, context) {
|
|
1985
|
-
const replacementTermNode = termSubstitutionNode.getReplacementTermNode(),
|
|
1986
|
-
replacementTerm = termFromTermNode(replacementTermNode, context);
|
|
1987
|
-
|
|
1988
|
-
return replacementTerm;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
export function superTypesFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
1992
|
-
let superTypes = [];
|
|
1993
|
-
|
|
1994
|
-
const typesNode = simpleTypeDeclarationNode.getTypesNode();
|
|
1995
|
-
|
|
1996
|
-
if (typesNode !== null) {
|
|
1997
|
-
const types = typesFromTypesNode(typesNode, context);
|
|
1998
|
-
|
|
1999
|
-
superTypes = types; ///
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
return superTypes;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
export function typePrefixFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
|
|
2006
|
-
const typePrefixNode = typePrefixDeclarationNode.getTypePrefixNode(),
|
|
2007
|
-
typePrefix = typePrefixFromTypePrefixNode(typePrefixNode, context);
|
|
2008
|
-
|
|
2009
|
-
return typePrefix;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
export function combinatorFromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
|
|
2013
|
-
const combinatorNode = combinatorDeclarationNode.getCombinatorNode(),
|
|
2014
|
-
combinator = combinatorFromCombinatorNode(combinatorNode, context);
|
|
2015
|
-
|
|
2016
|
-
return combinator;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
export function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
2020
|
-
const metaTypeName = metavariableDeclarationNode.getMetaTypeName(),
|
|
2021
|
-
metaType = context.findMetaTypeByMetaTypeName(metaTypeName);
|
|
2022
|
-
|
|
2023
|
-
return metaType;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
export function provisionalFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
2027
|
-
const provisional = simpleTypeDeclarationNode.isProvisional();
|
|
2028
|
-
|
|
2029
|
-
return provisional;
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
export function superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
2033
|
-
let superTypes = [];
|
|
2034
|
-
|
|
2035
|
-
const typesNode = complexTypeDeclarationNode.getTypesNode();
|
|
2036
|
-
|
|
2037
|
-
if (typesNode !== null) {
|
|
2038
|
-
const types = typesFromTypesNode(typesNode, context);
|
|
2039
|
-
|
|
2040
|
-
superTypes = types; ///
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
return superTypes;
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
export function replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context) {
|
|
2047
|
-
const replacementFrameNode = frameSubstitutionNode.getReplacementFrameNode(),
|
|
2048
|
-
replacementFrame = frameFromFrameNode(replacementFrameNode, context);
|
|
2049
|
-
|
|
2050
|
-
return replacementFrame;
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
export function propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
2054
|
-
const propertyRelationNode = propertyAssertionNode.getPropertyRelationNode(),
|
|
2055
|
-
propertyRelation = propertyRelationFromPropertyRelationNode(propertyRelationNode, context);
|
|
2056
|
-
|
|
2057
|
-
return propertyRelation;
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
export function suppositionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
2061
|
-
const suppositionNodes = metaLemmaMetathoremNode.getSuppositionNodes(),
|
|
2062
|
-
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
|
2063
|
-
|
|
2064
|
-
return suppositions;
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
export function substitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContxt, specificContext) {
|
|
2068
|
-
const frameSubstitution = frameSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContxt, specificContext),
|
|
2069
|
-
termSubstitution = termSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContxt, specificContext),
|
|
2070
|
-
substitution = (frameSubstitution || termSubstitution);
|
|
2071
|
-
|
|
2072
|
-
return substitution;
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
export function constructorFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
2076
|
-
const constructorNode = constructorDeclarationNode.getConstructorNode(),
|
|
2077
|
-
constructor = constructorFromConstructorNode(constructorNode, context);
|
|
2078
|
-
|
|
2079
|
-
return constructor;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
export function provisionalFromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
2083
|
-
const provisional = constructorDeclarationNode.isProvisional();
|
|
2084
|
-
|
|
2085
|
-
return provisional;
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
export function provisionalFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
2089
|
-
const provisional = complexTypeDeclarationNode.isProvisional();
|
|
2090
|
-
|
|
2091
|
-
return provisional;
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
export function metavariableFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
2095
|
-
const metavariableNode = metavariableDeclarationNode.getMetavariableNode(),
|
|
2096
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
2097
|
-
|
|
2098
|
-
return metavariable;
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
export function targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
2102
|
-
const { Reference } = elements,
|
|
2103
|
-
targetReferenceNode = referenceSubstitutionNode.getTargetReferenceNode(),
|
|
2104
|
-
targetReferenceString = context.nodeAsString(targetReferenceNode),
|
|
2105
|
-
targetReference = Reference.fromReferenceString(targetReferenceString, context);
|
|
2106
|
-
|
|
2107
|
-
return targetReference;
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
export function targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
2111
|
-
const targetStatementNode = statementSubstitutionNode.getTargetStatementNode(),
|
|
2112
|
-
targetStatement = statementFromStatementNode(targetStatementNode, context);
|
|
2113
|
-
|
|
2114
|
-
return targetStatement;
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
export function termSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext) {
|
|
2118
|
-
let termSubstitution = null;
|
|
2119
|
-
|
|
2120
|
-
const termSubstitutionNode = statementSubstitutionNode.getTermSubstitutionNode();
|
|
2121
|
-
|
|
2122
|
-
if (termSubstitutionNode !== null) {
|
|
2123
|
-
termSubstitution = termSubstitutionFromTermSubstitutionNode(termSubstitutionNode, generalContext, specificContext);
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
return termSubstitution;
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2129
|
-
export function frameSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext) {
|
|
2130
|
-
let frameSubstitution = null;
|
|
2131
|
-
|
|
2132
|
-
const frameSubstitutionNode = statementSubstitutionNode.getFrameSubstitutionNode();
|
|
2133
|
-
|
|
2134
|
-
if (frameSubstitutionNode !== null) {
|
|
2135
|
-
frameSubstitution = frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, generalContext, specificContext);
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
return frameSubstitution;
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
export function metaLevelAssumptionsFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
2142
|
-
const metaLevelAssumptions = [];
|
|
2143
|
-
|
|
2144
|
-
return metaLevelAssumptions;
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
export function replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
2148
|
-
const { Reference } = elements,
|
|
2149
|
-
replacementReferenceNode = referenceSubstitutionNode.getReplacementReferenceNode(),
|
|
2150
|
-
replacementReferenceString = context.nodeAsString(replacementReferenceNode),
|
|
2151
|
-
replacementReference = Reference.fromReferenceString(replacementReferenceString, context);
|
|
2152
|
-
|
|
2153
|
-
return replacementReference;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
export function replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context) {
|
|
2157
|
-
const replacementStatementNode = statementSubstitutionNode.getReplacementStatementNode(),
|
|
2158
|
-
replacementStatement = statementFromStatementNode(replacementStatementNode, context);
|
|
2159
|
-
|
|
2160
|
-
return replacementStatement;
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
export function propertyDeclarationsFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
2164
|
-
const propertyDeclarationnNodes = complexTypeDeclarationNode.getPropertyDeclarationNodes(),
|
|
2165
|
-
propertyDeclarations = propertyDeclarationsFromPropertyDeclarationNodes(propertyDeclarationnNodes, context);
|
|
2166
|
-
|
|
2167
|
-
return propertyDeclarations;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
export function termsFromTermNodes(termNodes, context) {
|
|
2171
|
-
const terms = termNodes.map((termNode) => {
|
|
2172
|
-
const term = termFromTermNode(termNode, context);
|
|
2173
|
-
|
|
2174
|
-
return term;
|
|
2175
|
-
});
|
|
2176
|
-
|
|
2177
|
-
return terms;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
export function typesFromTypesNode(typesNode, context) {
|
|
2181
|
-
const typeNodes = typesNode.getTypeNodes(),
|
|
2182
|
-
types = typeNodes.map((typeNode) => {
|
|
2183
|
-
const type = typeFromTypeNode(typeNode, context);
|
|
2184
|
-
|
|
2185
|
-
return type;
|
|
2186
|
-
});
|
|
2187
|
-
|
|
2188
|
-
return types;
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
export function labelsFromLabelNodes(labelNodes, context) {
|
|
2192
|
-
const labels = labelNodes.map((labelNode) => {
|
|
2193
|
-
const { Label } = elements,
|
|
2194
|
-
labelString = context.nodeAsString(labelNode),
|
|
2195
|
-
label = Label.fromLabelString(labelString, context);
|
|
2196
|
-
|
|
2197
|
-
return label;
|
|
2198
|
-
});
|
|
2199
|
-
|
|
2200
|
-
return labels;
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
export function premisesFromPremiseNodes(premiseNodes, context) {
|
|
2204
|
-
const premises = premiseNodes.map((premiseNode) => {
|
|
2205
|
-
const premise = premiseFromPremiseNode(premiseNode, context);
|
|
2206
|
-
|
|
2207
|
-
return premise;
|
|
2208
|
-
});
|
|
2209
|
-
|
|
2210
|
-
return premises;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
export function statementsFromStatementNodes(statementNodes, context) {
|
|
2214
|
-
const statements = statementNodes.map((statementNode) => {
|
|
2215
|
-
const statement = statementFromStatementNode(statementNode, context);
|
|
2216
|
-
|
|
2217
|
-
return statement;
|
|
2218
|
-
});
|
|
2219
|
-
|
|
2220
|
-
return statements;
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
|
-
export function parametersFromParameterNodes(parameterNodes, context) {
|
|
2224
|
-
const parameters = parameterNodes.map((parameterNode) => {
|
|
2225
|
-
const parameter = parameterFromParameterNode(parameterNode, context);
|
|
2226
|
-
|
|
2227
|
-
return parameter;
|
|
2228
|
-
});
|
|
2229
|
-
|
|
2230
|
-
return parameters;
|
|
2231
|
-
}
|
|
2232
|
-
|
|
2233
|
-
export function hypothesesFromHypothesisNodes(hypothesisNodes, context) {
|
|
2234
|
-
const hypotheses = hypothesisNodes.map((hypotheseNode) => {
|
|
2235
|
-
const hypothesis = hypothesisFromHypothesisNode(hypotheseNode, context);
|
|
2236
|
-
|
|
2237
|
-
return hypothesis;
|
|
2238
|
-
});
|
|
2239
|
-
|
|
2240
|
-
return hypotheses;
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
export function assumptionsFromAssumptionNodes(assumptionNodes, context) {
|
|
2244
|
-
const assumptions = assumptionNodes.map((assumptionNode) => {
|
|
2245
|
-
const assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
2246
|
-
|
|
2247
|
-
return assumption;
|
|
2248
|
-
});
|
|
2249
|
-
|
|
2250
|
-
return assumptions;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
export function suppositionsFromSuppositionNodes(suppositionNodes, context) {
|
|
2254
|
-
const suppositions = suppositionNodes.map((suppositionNode) => {
|
|
2255
|
-
const supposition = suppositionFromSuppositionNode(suppositionNode, context);
|
|
2256
|
-
|
|
2257
|
-
return supposition;
|
|
2258
|
-
});
|
|
2259
|
-
|
|
2260
|
-
return suppositions;
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
export function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
2264
|
-
const stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
2265
|
-
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
2266
|
-
const stepOrSubproof = stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
2267
|
-
|
|
2268
|
-
return stepOrSubproof;
|
|
2269
|
-
});
|
|
2270
|
-
|
|
2271
|
-
return stepsOrSubproofs;
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
export function stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context) {
|
|
2275
|
-
const stepOrSubproofNodes = subDerivationNode.getStepOrSubproofNodes(),
|
|
2276
|
-
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
2277
|
-
const stepOrSubproof = stepOrSubproofFromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
2278
|
-
|
|
2279
|
-
return stepOrSubproof;
|
|
2280
|
-
});
|
|
2281
|
-
|
|
2282
|
-
return stepsOrSubproofs;
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
export function propertyDeclarationsFromPropertyDeclarationNodes(propertyDeclarationnNodes, context) {
|
|
2286
|
-
const propertyDeclrations = propertyDeclarationnNodes.map((propertyDeclarationNode) => {
|
|
2287
|
-
const propertyDeclcaration = propertyDeclarationFromPropertyDeclarationNode(propertyDeclarationNode, context);
|
|
2288
|
-
|
|
2289
|
-
return propertyDeclcaration;
|
|
2290
|
-
});
|
|
2291
|
-
|
|
2292
|
-
return propertyDeclrations;
|
|
2293
|
-
}
|