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
|
@@ -1,955 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { FileContext } from "occam-languages";
|
|
4
|
-
import { arrayUtilities } from "necessary";
|
|
5
|
-
import { lexersUtilities, parsersUtilities } from "occam-nominal";
|
|
6
|
-
|
|
7
|
-
import NominalLexer from "../../nominal/lexer";
|
|
8
|
-
import NominalParser from "../../nominal/parser";
|
|
9
|
-
|
|
10
|
-
import { verifyFile } from "../../process/verify";
|
|
11
|
-
import { baseTypeFromNothing } from "../../utilities/type";
|
|
12
|
-
import { findMetaTypeByMetaTypeName } from "../../metaTypes";
|
|
13
|
-
import { typesFromJSON,
|
|
14
|
-
rulesFromJSON,
|
|
15
|
-
axiomsFromJSON,
|
|
16
|
-
typesToTypesJSON,
|
|
17
|
-
theoremsFromJSON,
|
|
18
|
-
rulesToRulesJSON,
|
|
19
|
-
axiomsToAxiomsJSON,
|
|
20
|
-
conjecturesFromJSON,
|
|
21
|
-
combinatorsFromJSON,
|
|
22
|
-
typePrefixesFromJSON,
|
|
23
|
-
constructorsFromJSON,
|
|
24
|
-
metatheoremsFromJSON,
|
|
25
|
-
theoremsToTheoremsJSON,
|
|
26
|
-
declaredVariablesFromJSON,
|
|
27
|
-
conjecturesToConjecturesJSON,
|
|
28
|
-
combinatorsToCombinatorsJSON,
|
|
29
|
-
declaredMetavariablesFromJSON,
|
|
30
|
-
typePrefixesToTypePrefixesJSON,
|
|
31
|
-
constructorsToConstructorsJSON,
|
|
32
|
-
metatheoremsToMetatheoremsJSON,
|
|
33
|
-
declaredVariablesToDeclaredVariablesJSON,
|
|
34
|
-
declaredMetavariablesToDeclaredMetavariablesJSON } from "../../utilities/json";
|
|
35
|
-
|
|
36
|
-
const { push, filter } = arrayUtilities,
|
|
37
|
-
{ nominalLexerFromCombinedCustomGrammar } = lexersUtilities,
|
|
38
|
-
{ nominalParserFromCombinedCustomGrammar } = parsersUtilities;
|
|
39
|
-
|
|
40
|
-
export default class NominalFileContext extends FileContext {
|
|
41
|
-
constructor(context, fileContent, filePath, tokens, node, json, lexer, parser, types, rules, axioms, lemmas, theorems, metaLemmas, conjectures, combinators, typePrefixes, constructors, metatheorems, declaredVariables, declaredMetavariables) {
|
|
42
|
-
super(context, fileContent, filePath, tokens, node, json);
|
|
43
|
-
|
|
44
|
-
this.lexer = lexer;
|
|
45
|
-
this.parser = parser;
|
|
46
|
-
this.context = context;
|
|
47
|
-
this.filePath = filePath;
|
|
48
|
-
this.tokens = tokens;
|
|
49
|
-
this.node = node;
|
|
50
|
-
this.types = types;
|
|
51
|
-
this.rules = rules;
|
|
52
|
-
this.axioms = axioms;
|
|
53
|
-
this.lemmas = lemmas;
|
|
54
|
-
this.theorems = theorems;
|
|
55
|
-
this.metaLemmas = metaLemmas;
|
|
56
|
-
this.conjectures = conjectures;
|
|
57
|
-
this.combinators = combinators;
|
|
58
|
-
this.typePrefixes = typePrefixes;
|
|
59
|
-
this.constructors = constructors;
|
|
60
|
-
this.metatheorems = metatheorems;
|
|
61
|
-
this.declaredVariables = declaredVariables;
|
|
62
|
-
this.declaredMetavariables = declaredMetavariables;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
getLexer() {
|
|
66
|
-
return this.lexer;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
getParser() {
|
|
70
|
-
return this.parser;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
getEquivalences() {
|
|
74
|
-
const equivalences = [];
|
|
75
|
-
|
|
76
|
-
return equivalences;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
getSubproofOrProofAssertions() {
|
|
80
|
-
const subproofOrProofAssertions = [];
|
|
81
|
-
|
|
82
|
-
return subproofOrProofAssertions;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
getLabels(includeRelease = true) {
|
|
86
|
-
const labels = [];
|
|
87
|
-
|
|
88
|
-
if (includeRelease) {
|
|
89
|
-
const releaseContextLabels = this.context.getLabels();
|
|
90
|
-
|
|
91
|
-
push(labels, releaseContextLabels);
|
|
92
|
-
} else {
|
|
93
|
-
this.rules.forEach((rule) => {
|
|
94
|
-
const ruleLabels = rule.getLabels();
|
|
95
|
-
|
|
96
|
-
push(labels, ruleLabels);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
this.axioms.forEach((axiom) => {
|
|
100
|
-
const axiomLabels = axiom.getLabels();
|
|
101
|
-
|
|
102
|
-
push(labels, axiomLabels);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
this.lemmas.forEach((lemma) => {
|
|
106
|
-
const lemmaLabels = lemma.getLabels();
|
|
107
|
-
|
|
108
|
-
push(labels, lemmaLabels);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
this.theorems.forEach((theorem) => {
|
|
112
|
-
const theoremLabels = theorem.getLabels();
|
|
113
|
-
|
|
114
|
-
push(labels, theoremLabels);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
this.conjectures.forEach((conjecture) => {
|
|
118
|
-
const conjectureLabels = conjecture.getLabels();
|
|
119
|
-
|
|
120
|
-
push(labels, conjectureLabels);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
this.metatheorems.forEach((metatheorem) => {
|
|
124
|
-
const metatheoremLabel = metatheorem.getLabel();
|
|
125
|
-
|
|
126
|
-
labels.push(metatheoremLabel);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return labels;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
getTypes(includeRelease = true) {
|
|
134
|
-
const types = includeRelease ?
|
|
135
|
-
this.context.getTypes() :
|
|
136
|
-
this.types;
|
|
137
|
-
|
|
138
|
-
return types;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
getRules(includeRelease = true) {
|
|
142
|
-
const rules = includeRelease ?
|
|
143
|
-
this.context.getRules() :
|
|
144
|
-
this.rules;
|
|
145
|
-
|
|
146
|
-
return rules;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
getAxioms(includeRelease = true) {
|
|
150
|
-
const axioms = includeRelease ?
|
|
151
|
-
this.context.getAxioms() :
|
|
152
|
-
this.axioms;
|
|
153
|
-
|
|
154
|
-
return axioms;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
getLemmas(includeRelease = true) {
|
|
158
|
-
const lemmas = includeRelease ?
|
|
159
|
-
this.context.getLemmas() :
|
|
160
|
-
this.lemmas;
|
|
161
|
-
|
|
162
|
-
return lemmas;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
getTheorems(includeRelease = true) {
|
|
166
|
-
const theorems = includeRelease ?
|
|
167
|
-
this.context.getTheorems() :
|
|
168
|
-
this.theorems;
|
|
169
|
-
|
|
170
|
-
return theorems;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
getProcedures(includeRelease = true) {
|
|
174
|
-
const procedures = includeRelease ?
|
|
175
|
-
this.context.getProcedures() :
|
|
176
|
-
null; ///
|
|
177
|
-
|
|
178
|
-
return procedures;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
getMetaLemmas(includeRelease = true) {
|
|
182
|
-
const metaLemmas = includeRelease ?
|
|
183
|
-
this.context.getMetaLemmas() :
|
|
184
|
-
this.metaLemmas;
|
|
185
|
-
|
|
186
|
-
return metaLemmas;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
getConjectures(includeRelease = true) {
|
|
190
|
-
const conjectures = includeRelease ?
|
|
191
|
-
this.context.getConjectures() :
|
|
192
|
-
this.conjectures;
|
|
193
|
-
|
|
194
|
-
return conjectures;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
getCombinators(includeRelease = true) {
|
|
198
|
-
const combinators = includeRelease ?
|
|
199
|
-
this.context.getCombinators() :
|
|
200
|
-
this.combinators;
|
|
201
|
-
|
|
202
|
-
return combinators;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
getTypePrefixes(includeRelease = true) {
|
|
206
|
-
const typePrefixes = includeRelease ?
|
|
207
|
-
this.context.getTypePrefixes() :
|
|
208
|
-
this.typePrefixes;
|
|
209
|
-
|
|
210
|
-
return typePrefixes;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
getConstructors(includeRelease = true) {
|
|
214
|
-
const constructors = includeRelease ?
|
|
215
|
-
this.context.getConstructors() :
|
|
216
|
-
this.constructors;
|
|
217
|
-
|
|
218
|
-
return constructors;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
getMetatheorems(includeRelease = true) {
|
|
222
|
-
const metatheorems = includeRelease ?
|
|
223
|
-
this.context.getMetatheorems() :
|
|
224
|
-
this.metatheorems;
|
|
225
|
-
|
|
226
|
-
return metatheorems;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
getDeclaredVariables() {
|
|
230
|
-
return this.declaredVariables;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
getDeclaredMetavariables() {
|
|
234
|
-
return this.declaredMetavariables;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
getDeclaredJudgements() {
|
|
238
|
-
const declaredJudgements = [];
|
|
239
|
-
|
|
240
|
-
return declaredJudgements;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
getTerms(terms = []) {
|
|
244
|
-
return terms;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
getFrames(frames = []) {
|
|
248
|
-
return frames;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
getProperties(properties = []) {
|
|
252
|
-
return properties;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
getEqualities(equalities = []) {
|
|
256
|
-
return equalities;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
getJudgements(judgements = []) {
|
|
260
|
-
return judgements;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
getAssertions(assertions = []) {
|
|
264
|
-
return assertions;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
getStatements(statements = []) {
|
|
268
|
-
return statements;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
getSignatures(signatures = []) {
|
|
272
|
-
return signatures;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
getReferences(references = []) {
|
|
276
|
-
return references;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
getAssumptions(assumptions = []) {
|
|
280
|
-
return assumptions;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
getMetavariables(metavariables = []) {
|
|
284
|
-
return metavariables;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
getSubstitutions(substitutions = []) {
|
|
288
|
-
return substitutions;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
getPropertyRelations(propertyRelations = []) {
|
|
292
|
-
return propertyRelations;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
getDerivedSubstitutions(derivedSubstitutions = []) {
|
|
296
|
-
return derivedSubstitutions;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
addType(type) {
|
|
300
|
-
this.types.push(type);
|
|
301
|
-
|
|
302
|
-
const filePath = this.getFilePath(),
|
|
303
|
-
typeString = type.getString();
|
|
304
|
-
|
|
305
|
-
this.trace(`Added the '${typeString}' type to the '${filePath}' file context.`)
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
addRule(rule) {
|
|
309
|
-
this.rules.push(rule);
|
|
310
|
-
|
|
311
|
-
const filePath = this.getFilePath(),
|
|
312
|
-
ruleString = rule.getString();
|
|
313
|
-
|
|
314
|
-
this.trace(`Added the '${ruleString}' rule to the '${filePath}' file context.`)
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
addAxiom(axiom) {
|
|
318
|
-
this.axioms.push(axiom);
|
|
319
|
-
|
|
320
|
-
const filePath = this.getFilePath(),
|
|
321
|
-
axiomString = axiom.getString();
|
|
322
|
-
|
|
323
|
-
this.trace(`Added the '${axiomString}' axiom to the '${filePath}' file context.`)
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
addLemma(lemma) {
|
|
327
|
-
this.lemmas.push(lemma);
|
|
328
|
-
|
|
329
|
-
const filePath = this.getFilePath(),
|
|
330
|
-
lemmaString = lemma.getString();
|
|
331
|
-
|
|
332
|
-
this.trace(`Added the '${lemmaString}' lemma to the '${filePath}' file context.`)
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
addTheorem(theorem) {
|
|
336
|
-
this.theorems.push(theorem);
|
|
337
|
-
|
|
338
|
-
const filePath = this.getFilePath(),
|
|
339
|
-
theoremString = theorem.getString();
|
|
340
|
-
|
|
341
|
-
this.trace(`Added the '${theoremString}' theorem to the '${filePath}' file context.`)
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
addMetaLemma(metaLemma) {
|
|
345
|
-
this.metaLemmas.push(metaLemma);
|
|
346
|
-
|
|
347
|
-
const filePath = this.getFilePath(),
|
|
348
|
-
metaLemmaString = metaLemma.getString();
|
|
349
|
-
|
|
350
|
-
this.trace(`Added the '${metaLemmaString}' meta-lemma to the '${filePath}' file context.`)
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
addConjecture(conjecture) {
|
|
354
|
-
this.conjectures.push(conjecture);
|
|
355
|
-
|
|
356
|
-
const filePath = this.getFilePath(),
|
|
357
|
-
ocnjectureString = conjecture.getString();
|
|
358
|
-
|
|
359
|
-
this.trace(`Added the '${ocnjectureString}' ocnjecture to the '${filePath}' file context.`)
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
addCombinator(combinator) {
|
|
363
|
-
this.combinators.push(combinator);
|
|
364
|
-
|
|
365
|
-
const filePath = this.getFilePath(),
|
|
366
|
-
combinatorString = combinator.getString();
|
|
367
|
-
|
|
368
|
-
this.trace(`Added the '${combinatorString}' combinator to the '${filePath}' file context.`)
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
addTypePrefix(typePrefix) {
|
|
372
|
-
this.typePrefixes.push(typePrefix);
|
|
373
|
-
|
|
374
|
-
const filePath = this.getFilePath(),
|
|
375
|
-
typePrefixString = typePrefix.getString();
|
|
376
|
-
|
|
377
|
-
this.trace(`Added the '${typePrefixString}' type-prefix to the '${filePath}' file context.`)
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
addConstructor(constructor) {
|
|
381
|
-
this.constructors.push(constructor);
|
|
382
|
-
|
|
383
|
-
const filePath = this.getFilePath(),
|
|
384
|
-
constructorString = constructor.getString();
|
|
385
|
-
|
|
386
|
-
this.trace(`Added the '${constructorString}' constructor to the '${filePath}' file context.`)
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
addMetatheorem(metatheorem) {
|
|
390
|
-
this.metatheorems.push(metatheorem);
|
|
391
|
-
|
|
392
|
-
const filePath = this.getFilePath(),
|
|
393
|
-
metatheoremString = metatheorem.getString();
|
|
394
|
-
|
|
395
|
-
this.trace(`Added the '${metatheoremString}' metatheorem to the '${filePath}' file context.`)
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
addDeclaredVariable(declaredVariable) {
|
|
399
|
-
this.declaredVariables.push(declaredVariable);
|
|
400
|
-
|
|
401
|
-
const filePath = this.getFilePath(),
|
|
402
|
-
declaredVariableString = declaredVariable.getString();
|
|
403
|
-
|
|
404
|
-
this.trace(`Added the '${declaredVariableString}' declared variable to the '${filePath}' file context.`)
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
addDeclaredMetavariable(declaredMetavariable) {
|
|
408
|
-
this.declaredMetavariables.push(declaredMetavariable);
|
|
409
|
-
|
|
410
|
-
const filePath = this.getFilePath(),
|
|
411
|
-
declaredMetavariableString = declaredMetavariable.getString();
|
|
412
|
-
|
|
413
|
-
this.trace(`Added the '${declaredMetavariableString}' declared metavariable to the '${filePath}' file context.`)
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
findMetavariable(metavariable, context) {
|
|
417
|
-
const declaredMetavariables = this.getDeclaredMetavariables();
|
|
418
|
-
|
|
419
|
-
metavariable = declaredMetavariables.find((declaredMetavariable) => {
|
|
420
|
-
const metavariableUnifies = declaredMetavariable.unifyMetavariable(metavariable, context);
|
|
421
|
-
|
|
422
|
-
if (metavariableUnifies) {
|
|
423
|
-
return true;
|
|
424
|
-
}
|
|
425
|
-
}) || null;
|
|
426
|
-
|
|
427
|
-
return metavariable;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
findRuleByReference(reference) {
|
|
431
|
-
const rules = this.getRules(),
|
|
432
|
-
metavariableNode = reference.getMetavariableNode(),
|
|
433
|
-
rule = rules.find((rule) => {
|
|
434
|
-
const metavariableNodeMatches = rule.matchMetavariableNode(metavariableNode);
|
|
435
|
-
|
|
436
|
-
if (metavariableNodeMatches) {
|
|
437
|
-
return true;
|
|
438
|
-
}
|
|
439
|
-
}) || null;
|
|
440
|
-
|
|
441
|
-
return rule;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
findAxiomByReference(reference) {
|
|
445
|
-
const axioms = this.getAxioms(),
|
|
446
|
-
metavariableNode = reference.getMetavariableNode(),
|
|
447
|
-
axiom = axioms.find((axiom) => {
|
|
448
|
-
const metavariableNodeMatches = axiom.matchMetavariableNode(metavariableNode);
|
|
449
|
-
|
|
450
|
-
if (metavariableNodeMatches) {
|
|
451
|
-
return true;
|
|
452
|
-
}
|
|
453
|
-
}) || null;
|
|
454
|
-
|
|
455
|
-
return axiom;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
findLemmaByReference(reference) {
|
|
459
|
-
const lemmas = this.getLemmas(),
|
|
460
|
-
metavariableNode = reference.getMetavariableNode(),
|
|
461
|
-
lemma = lemmas.find((lemma) => {
|
|
462
|
-
const metavariableNodeMatches = lemma.matchMetavariableNode(metavariableNode);
|
|
463
|
-
|
|
464
|
-
if (metavariableNodeMatches) {
|
|
465
|
-
return true;
|
|
466
|
-
}
|
|
467
|
-
}) || null;
|
|
468
|
-
|
|
469
|
-
return lemma;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
findTheoremByReference(reference) {
|
|
473
|
-
const theorems = this.getTheorems(),
|
|
474
|
-
metavariableNode = reference.getMetavariableNode(),
|
|
475
|
-
theorem = theorems.find((theorem) => {
|
|
476
|
-
const metavariableNodeMatches = theorem.matchMetavariableNode(metavariableNode);
|
|
477
|
-
|
|
478
|
-
if (metavariableNodeMatches) {
|
|
479
|
-
return true;
|
|
480
|
-
}
|
|
481
|
-
}) || null;
|
|
482
|
-
|
|
483
|
-
return theorem;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
findConjectureByReference(reference) {
|
|
487
|
-
const conjectures = this.getConjectures(),
|
|
488
|
-
metavariableNode = reference.getMetavariableNode(),
|
|
489
|
-
conjecture = conjectures.find((conjecture) => {
|
|
490
|
-
const metavariableNodeMatches = conjecture.matchMetavariableNode(metavariableNode);
|
|
491
|
-
|
|
492
|
-
if (metavariableNodeMatches) {
|
|
493
|
-
return true;
|
|
494
|
-
}
|
|
495
|
-
}) || null;
|
|
496
|
-
|
|
497
|
-
return conjecture;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
findMetaLemmasByReference(reference) {
|
|
501
|
-
const metaLemmas = this.getMetaLemmas();
|
|
502
|
-
|
|
503
|
-
filter(metaLemmas, (metaLemma) => {
|
|
504
|
-
const topLevelMetaAssertion = metaLemma, ///
|
|
505
|
-
topLevelMetaAssertionCompares = reference.compareTopLevelMetaAssertion(topLevelMetaAssertion);
|
|
506
|
-
|
|
507
|
-
if (topLevelMetaAssertionCompares) {
|
|
508
|
-
return true;
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
return metaLemmas;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
findMetatheoremsByReference(reference) {
|
|
516
|
-
const metatheorems = this.getMetatheorems();
|
|
517
|
-
|
|
518
|
-
filter(metatheorems, (metatheorem) => {
|
|
519
|
-
const topLevelMetaAssertion = metatheorem, ///
|
|
520
|
-
topLevelMetaAssertionCompares = reference.compareTopLevelMetaAssertion(topLevelMetaAssertion);
|
|
521
|
-
|
|
522
|
-
if (topLevelMetaAssertionCompares) {
|
|
523
|
-
return true;
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
return metatheorems;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
findTopLevelAssertionByReference(reference) {
|
|
531
|
-
const axiom = this.findAxiomByReference(reference),
|
|
532
|
-
lemma = this.findLemmaByReference(reference),
|
|
533
|
-
theorem = this.findTheoremByReference(reference),
|
|
534
|
-
conjecture = this.findConjectureByReference(reference),
|
|
535
|
-
topLevelAssertion = (axiom || lemma || theorem || conjecture);
|
|
536
|
-
|
|
537
|
-
return topLevelAssertion;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
findTopLevelMetaAssertionByReference(reference) {
|
|
541
|
-
const metaLemma = this.findMetaLemmaByReference(reference),
|
|
542
|
-
metatheorem = this.findMetatheoremByReference(reference),
|
|
543
|
-
topLevelMetaAssertion = (metaLemma || metatheorem); ///
|
|
544
|
-
|
|
545
|
-
return topLevelMetaAssertion;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
findTopLevelMetaAssertionsByReference(reference) {
|
|
549
|
-
const metaLemmas = this.findMetaLemmasByReference(reference),
|
|
550
|
-
metatheorems = this.findMetatheoremsByReference(reference),
|
|
551
|
-
topLevelMetaAssertions = [
|
|
552
|
-
...metaLemmas,
|
|
553
|
-
...metatheorems
|
|
554
|
-
];
|
|
555
|
-
|
|
556
|
-
return topLevelMetaAssertions;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
findTypeByTypeName(typeName, includeRelease = true) {
|
|
560
|
-
let types = this.getTypes(includeRelease);
|
|
561
|
-
|
|
562
|
-
const baseType = baseTypeFromNothing();
|
|
563
|
-
|
|
564
|
-
types = [
|
|
565
|
-
...types,
|
|
566
|
-
baseType
|
|
567
|
-
];
|
|
568
|
-
|
|
569
|
-
const type = types.find((type) => {
|
|
570
|
-
const typeComparesToTypeName = type.compareTypeName(typeName);
|
|
571
|
-
|
|
572
|
-
if (typeComparesToTypeName) {
|
|
573
|
-
return true;
|
|
574
|
-
}
|
|
575
|
-
}) || null;
|
|
576
|
-
|
|
577
|
-
return type;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
findTypeByNominalTypeName(nominalTypeName) {
|
|
581
|
-
let types = this.getTypes();
|
|
582
|
-
|
|
583
|
-
const baseType = baseTypeFromNothing();
|
|
584
|
-
|
|
585
|
-
types = [
|
|
586
|
-
...types,
|
|
587
|
-
baseType
|
|
588
|
-
];
|
|
589
|
-
|
|
590
|
-
const type = types.find((type) => {
|
|
591
|
-
const typeComparesToNominalTypeName = type.compareNominalTypeName(nominalTypeName);
|
|
592
|
-
|
|
593
|
-
if (typeComparesToNominalTypeName) {
|
|
594
|
-
return true;
|
|
595
|
-
}
|
|
596
|
-
}) || null;
|
|
597
|
-
|
|
598
|
-
return type;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
findTypeByPrefixedTypeName(prefixedTypeName) {
|
|
602
|
-
let types = this.getTypes();
|
|
603
|
-
|
|
604
|
-
const baseType = baseTypeFromNothing();
|
|
605
|
-
|
|
606
|
-
types = [
|
|
607
|
-
...types,
|
|
608
|
-
baseType
|
|
609
|
-
];
|
|
610
|
-
|
|
611
|
-
const type = types.find((type) => {
|
|
612
|
-
const typeComparesToPrefixedTypeName = type.comparePrefixedTypeName(prefixedTypeName);
|
|
613
|
-
|
|
614
|
-
if (typeComparesToPrefixedTypeName) {
|
|
615
|
-
return true;
|
|
616
|
-
}
|
|
617
|
-
}) || null;
|
|
618
|
-
|
|
619
|
-
return type;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
findTypePrefixByTypePrefixName(typePrefixName) {
|
|
623
|
-
const typePrefixes = this.getTypePrefixes(),
|
|
624
|
-
typePrefix = typePrefixes.find((typePrefix) => {
|
|
625
|
-
const typePrefixComparesToTypePrefixName = typePrefix.compareTypePrefixName(typePrefixName);
|
|
626
|
-
|
|
627
|
-
if (typePrefixComparesToTypePrefixName) {
|
|
628
|
-
return true;
|
|
629
|
-
}
|
|
630
|
-
}) || null;
|
|
631
|
-
|
|
632
|
-
return typePrefix;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
findDeclaredVariableByVariableIdentifier(VariableIdentitifer) {
|
|
636
|
-
const declaredVariables = this.getDeclaredVariables(),
|
|
637
|
-
declaredVariable = declaredVariables.find((declaredVariable) => {
|
|
638
|
-
const declaredVariableComparesToVariableIdentitifer = declaredVariable.compareVariableIdentifier(VariableIdentitifer);
|
|
639
|
-
|
|
640
|
-
if (declaredVariableComparesToVariableIdentitifer) {
|
|
641
|
-
return true;
|
|
642
|
-
}
|
|
643
|
-
}) || null;
|
|
644
|
-
|
|
645
|
-
return declaredVariable;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
findDeclaredMetavariableByMetavariableName(metavariableName) {
|
|
649
|
-
const declaredMetavariables = this.getDeclaredMetavariables(),
|
|
650
|
-
declaredMetavariable = declaredMetavariables.find((declaredMetavariable) => {
|
|
651
|
-
const declaredMetavariableComparesToMetavariableName = declaredMetavariable.compareMetavariableName(metavariableName);
|
|
652
|
-
|
|
653
|
-
if (declaredMetavariableComparesToMetavariableName) {
|
|
654
|
-
return true;
|
|
655
|
-
}
|
|
656
|
-
}) || null;
|
|
657
|
-
|
|
658
|
-
return declaredMetavariable;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
findTermByTermNode(termNode) {
|
|
662
|
-
const term = null;
|
|
663
|
-
|
|
664
|
-
return term;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
findStatementByStatementNode(statementNode) {
|
|
668
|
-
const statement = null;
|
|
669
|
-
|
|
670
|
-
return statement;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
findMetavariableByMetavariableNode(metavariableNode) {
|
|
674
|
-
const metavariable = null;
|
|
675
|
-
|
|
676
|
-
return metavariable;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
findSubstitutionBySubstitutionNode(substitutionNode) {
|
|
680
|
-
const substitution = null;
|
|
681
|
-
|
|
682
|
-
return substitution;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
findMetaLevelAssumptionByMetaLevelAssumptionNode(metaLevelAssumptionNode) {
|
|
686
|
-
const metaLevelAssumption = null;
|
|
687
|
-
|
|
688
|
-
return metaLevelAssumption;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
findProcedureByProcedureName(procedureName) {
|
|
692
|
-
const procedures = this.getProcedures(),
|
|
693
|
-
procedure = procedures.find((procedure) => {
|
|
694
|
-
const procedureComparesToProcedureName = procedure.compareProcedureName(procedureName);
|
|
695
|
-
|
|
696
|
-
if (procedureComparesToProcedureName) {
|
|
697
|
-
return true;
|
|
698
|
-
}
|
|
699
|
-
}) || null;
|
|
700
|
-
|
|
701
|
-
return procedure;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
findMetaTypeByMetaTypeName(metaTypeName) { return findMetaTypeByMetaTypeName(metaTypeName); }
|
|
705
|
-
|
|
706
|
-
isMetavariablePresent(metavariable, context) {
|
|
707
|
-
metavariable = this.findMetavariable(metavariable, context); ///
|
|
708
|
-
|
|
709
|
-
const metavariablePresent = (metavariable !== null);
|
|
710
|
-
|
|
711
|
-
return metavariablePresent;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
isLabelPresentByReference(reference, context = null) {
|
|
715
|
-
const labels = this.getLabels(),
|
|
716
|
-
labelPresent = labels.some((label) => {
|
|
717
|
-
const labelUnifies = reference.unifyLabel(label, context);
|
|
718
|
-
|
|
719
|
-
if (labelUnifies) {
|
|
720
|
-
return true;
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
return labelPresent;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
isTopLevelMetaAssertionPresentByReference(reference) {
|
|
728
|
-
const topLevelMetaAssertion = this.findTopLevelMetaAssertionByReference(reference),
|
|
729
|
-
topLevelMetaAssertionPresent = (topLevelMetaAssertion !== null);
|
|
730
|
-
|
|
731
|
-
return topLevelMetaAssertionPresent;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
isLabelPresentByLabelNode(labelNode) {
|
|
735
|
-
const labels = this.getLabels(),
|
|
736
|
-
labelPresent = labels.some((label) => {
|
|
737
|
-
const labelNodeMatches = label.matchLabelNode(labelNode);
|
|
738
|
-
|
|
739
|
-
if (labelNodeMatches) {
|
|
740
|
-
return true;
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
|
|
744
|
-
return labelPresent;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
isTypePresentByTypeName(typeName, includeRelease = true) {
|
|
748
|
-
const type = this.findTypeByTypeName(typeName, includeRelease),
|
|
749
|
-
typePresent = (type !== null);
|
|
750
|
-
|
|
751
|
-
return typePresent;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
isTypePresentByNominalTypeName(nominalTypeName) {
|
|
755
|
-
const type = this.findTypeByNominalTypeName(nominalTypeName),
|
|
756
|
-
typePresent = (type !== null);
|
|
757
|
-
|
|
758
|
-
return typePresent;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
isTypePresentByPrefixedTypeName(prefixedTypeName) {
|
|
762
|
-
const type = this.findTypeByPrefixedTypeName(prefixedTypeName),
|
|
763
|
-
typePresent = (type !== null);
|
|
764
|
-
|
|
765
|
-
return typePresent;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
isTypePrefixPresentByTypePrefixName(typePrefixName) {
|
|
769
|
-
const typePrefix = this.findTypePrefixByTypePrefixName(typePrefixName),
|
|
770
|
-
typePrefixPresent = (typePrefix !== null);
|
|
771
|
-
|
|
772
|
-
return typePrefixPresent;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
isDeclaredVariablePresentByVariableIdentifier(variableIdentifier) {
|
|
776
|
-
const declaredVariable = this.findDeclaredVariableByVariableIdentifier(variableIdentifier),
|
|
777
|
-
declaredVariablePresent = (declaredVariable !== null);
|
|
778
|
-
|
|
779
|
-
return declaredVariablePresent;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
isDeclaredMetavariablePresentByMetavariableName(metavariableName) {
|
|
783
|
-
const declaredMetavariable = this.findDeclaredMetavariableByMetavariableName(metavariableName),
|
|
784
|
-
declaredMetavariablePresent = (declaredMetavariable !== null);
|
|
785
|
-
|
|
786
|
-
return declaredMetavariablePresent;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
isProcedurePresentByProcedureName(procedureName) {
|
|
790
|
-
const procedure = this.findProcedureByProcedureName(procedureName),
|
|
791
|
-
procedurePresent = (procedure !== null);
|
|
792
|
-
|
|
793
|
-
return procedurePresent;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
isMetaLevel() {
|
|
797
|
-
const metaLEvel = false;
|
|
798
|
-
|
|
799
|
-
return metaLEvel;
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
clear() {
|
|
803
|
-
this.types = [];
|
|
804
|
-
this.rules = [];
|
|
805
|
-
this.axioms = [];
|
|
806
|
-
this.lemmas = [];
|
|
807
|
-
this.theorems = [];
|
|
808
|
-
this.metaLemmas = [];
|
|
809
|
-
this.conjectures = [];
|
|
810
|
-
this.combinators = [];
|
|
811
|
-
this.typePrefixes = [];
|
|
812
|
-
this.constructors = [];
|
|
813
|
-
this.metatheorems = [];
|
|
814
|
-
this.declaredVariables = [];
|
|
815
|
-
this.declaredMetavariables = [];
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
complete() {
|
|
819
|
-
///
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
async verifyFile() {
|
|
823
|
-
const node = this.getNode(),
|
|
824
|
-
context = this, ///
|
|
825
|
-
fileNode = node, ///
|
|
826
|
-
fileVerifies = await verifyFile(fileNode, context);
|
|
827
|
-
|
|
828
|
-
return fileVerifies;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
initialise() {
|
|
832
|
-
const json = this.getJSON();
|
|
833
|
-
|
|
834
|
-
if (json === null) {
|
|
835
|
-
super.initialise();
|
|
836
|
-
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
const fileContext = this; ///
|
|
841
|
-
|
|
842
|
-
this.types = [];
|
|
843
|
-
|
|
844
|
-
typesFromJSON(json, this.types, fileContext);
|
|
845
|
-
|
|
846
|
-
this.lemmas = [];
|
|
847
|
-
this.metaLemmas = [];
|
|
848
|
-
|
|
849
|
-
this.declaredMetavariables = declaredMetavariablesFromJSON(json, fileContext);
|
|
850
|
-
this.declaredVariables = declaredVariablesFromJSON(json, fileContext);
|
|
851
|
-
this.typePrefixes = typePrefixesFromJSON(json, fileContext);
|
|
852
|
-
this.combinators = combinatorsFromJSON(json, fileContext);
|
|
853
|
-
this.constructors = constructorsFromJSON(json, fileContext);
|
|
854
|
-
|
|
855
|
-
this.rules = rulesFromJSON(json, fileContext);
|
|
856
|
-
this.axioms = axiomsFromJSON(json, fileContext);
|
|
857
|
-
this.theorems = theoremsFromJSON(json, fileContext);
|
|
858
|
-
this.conjectures = conjecturesFromJSON(json, fileContext);
|
|
859
|
-
this.metatheorems = metatheoremsFromJSON(json, fileContext);
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
toJSON() {
|
|
863
|
-
const typesJSON = typesToTypesJSON(this.types),
|
|
864
|
-
rulesJSON = rulesToRulesJSON(this.rules),
|
|
865
|
-
axiomsJSON = axiomsToAxiomsJSON(this.axioms),
|
|
866
|
-
theoremsJSON = theoremsToTheoremsJSON(this.theorems),
|
|
867
|
-
conjecturesJSON = conjecturesToConjecturesJSON(this.conjectures),
|
|
868
|
-
combinatorsJSON = combinatorsToCombinatorsJSON(this.combinators),
|
|
869
|
-
typePrefixesJSON = typePrefixesToTypePrefixesJSON(this.typePrefixes),
|
|
870
|
-
constructorsJSON = constructorsToConstructorsJSON(this.constructors),
|
|
871
|
-
metatheoremsJSON = metatheoremsToMetatheoremsJSON(this.metatheorems),
|
|
872
|
-
declaredVariablesJSON = declaredVariablesToDeclaredVariablesJSON(this.declaredVariables),
|
|
873
|
-
declaredMetavariablesJSON = declaredMetavariablesToDeclaredMetavariablesJSON(this.declaredMetavariables),
|
|
874
|
-
fileContent = this.fileContent,
|
|
875
|
-
filePath = this.filePath,
|
|
876
|
-
types = typesJSON, ///
|
|
877
|
-
rules = rulesJSON, ///
|
|
878
|
-
axioms = axiomsJSON, ///
|
|
879
|
-
theorems = theoremsJSON, ///
|
|
880
|
-
conjectures = conjecturesJSON, ///
|
|
881
|
-
combinators = combinatorsJSON, ///
|
|
882
|
-
typePrefixes = typePrefixesJSON, ///
|
|
883
|
-
constructors = constructorsJSON, ///
|
|
884
|
-
metatheorems = metatheoremsJSON, ///
|
|
885
|
-
declaredVariables = declaredVariablesJSON, ///
|
|
886
|
-
declaredMetavariables = declaredMetavariablesJSON, ///
|
|
887
|
-
json = {
|
|
888
|
-
fileContent,
|
|
889
|
-
filePath,
|
|
890
|
-
types,
|
|
891
|
-
rules,
|
|
892
|
-
axioms,
|
|
893
|
-
theorems,
|
|
894
|
-
conjectures,
|
|
895
|
-
combinators,
|
|
896
|
-
typePrefixes,
|
|
897
|
-
constructors,
|
|
898
|
-
metatheorems,
|
|
899
|
-
declaredVariables,
|
|
900
|
-
declaredMetavariables
|
|
901
|
-
};
|
|
902
|
-
|
|
903
|
-
return json;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
static fromFile(file, context) {
|
|
907
|
-
const releaseContext = context, ///
|
|
908
|
-
combinedCustomGrammar = releaseContext.getCombinedCustomGrammar(),
|
|
909
|
-
nominalLexer = nominalLexerFromCombinedCustomGrammar(NominalLexer, combinedCustomGrammar),
|
|
910
|
-
nominalParser = nominalParserFromCombinedCustomGrammar(NominalParser, combinedCustomGrammar),
|
|
911
|
-
lexer = nominalLexer, ///
|
|
912
|
-
parser = nominalParser, ///
|
|
913
|
-
types = [],
|
|
914
|
-
rules = [],
|
|
915
|
-
axioms = [],
|
|
916
|
-
lemmas = [],
|
|
917
|
-
theorems = [],
|
|
918
|
-
metaLemmas = [],
|
|
919
|
-
conjectures = [],
|
|
920
|
-
combinators = [],
|
|
921
|
-
typePrefixes = [],
|
|
922
|
-
constructors = [],
|
|
923
|
-
metatheorems = [],
|
|
924
|
-
declaredVariables = [],
|
|
925
|
-
declaredMetavariables = [],
|
|
926
|
-
nominalFileContext = FileContext.fromFile(NominalFileContext, file, lexer, parser, types, rules, axioms, lemmas, theorems, metaLemmas, conjectures, combinators, typePrefixes, constructors, metatheorems, declaredVariables, declaredMetavariables, context);
|
|
927
|
-
|
|
928
|
-
return nominalFileContext;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
static fromJSON(json, context) {
|
|
932
|
-
const releaseContext = context, ///
|
|
933
|
-
combinedCustomGrammar = releaseContext.getCombinedCustomGrammar(),
|
|
934
|
-
nominalLexer = nominalLexerFromCombinedCustomGrammar(NominalLexer, combinedCustomGrammar),
|
|
935
|
-
nominalParser = nominalParserFromCombinedCustomGrammar(NominalParser, combinedCustomGrammar),
|
|
936
|
-
lexer = nominalLexer, ///
|
|
937
|
-
parser = nominalParser, ///
|
|
938
|
-
types = null,
|
|
939
|
-
rules = null,
|
|
940
|
-
axioms = null,
|
|
941
|
-
lemmas = null,
|
|
942
|
-
theorems = null,
|
|
943
|
-
metaLemmas = null,
|
|
944
|
-
conjectures = null,
|
|
945
|
-
combinators = null,
|
|
946
|
-
typePrefixes = null,
|
|
947
|
-
constructors = null,
|
|
948
|
-
metatheorems = null,
|
|
949
|
-
declaredVariables = null,
|
|
950
|
-
declaredMetavariables = null,
|
|
951
|
-
nominalFileContext = FileContext.fromJSON(NominalFileContext, json, lexer, parser, types, rules, axioms, lemmas, theorems, metaLemmas, conjectures, combinators, typePrefixes, constructors, metatheorems, declaredVariables, declaredMetavariables, context);
|
|
952
|
-
|
|
953
|
-
return nominalFileContext;
|
|
954
|
-
}
|
|
955
|
-
}
|