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,410 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import elements from "../elements";
|
|
4
|
-
|
|
5
|
-
import { choose, descend } from "../utilities/context";
|
|
6
|
-
import { provisionallyStringFromProvisional } from "../utilities/string";
|
|
7
|
-
import { bracketedConstructorFromNothing, bracketedCombinatorFromNothing } from "../utilities/instance";
|
|
8
|
-
|
|
9
|
-
function validateTermAsVariable(term, context, validateForwards) {
|
|
10
|
-
let termValidatesAsVariable = false;
|
|
11
|
-
|
|
12
|
-
const { Variable } = elements;
|
|
13
|
-
|
|
14
|
-
let variable;
|
|
15
|
-
|
|
16
|
-
variable = Variable.fromTerm(term, context);
|
|
17
|
-
|
|
18
|
-
if (variable !== null) {
|
|
19
|
-
const termString = term.getString();
|
|
20
|
-
|
|
21
|
-
context.trace(`Validating the '${termString}' term as a variable...`);
|
|
22
|
-
|
|
23
|
-
variable = variable.validate(context);
|
|
24
|
-
|
|
25
|
-
if (variable !== null) {
|
|
26
|
-
const type = variable.getType(),
|
|
27
|
-
typeString = type.getString(),
|
|
28
|
-
provisional = variable.isProvisional(),
|
|
29
|
-
provisionallyString = provisionallyStringFromProvisional(provisional);
|
|
30
|
-
|
|
31
|
-
context.trace(`Setting the '${termString}' term's type to the '${typeString}' type${provisionallyString}.`);
|
|
32
|
-
|
|
33
|
-
term.setType(type);
|
|
34
|
-
|
|
35
|
-
term.setProvisional(provisional);
|
|
36
|
-
|
|
37
|
-
const validatesForwards = validateForwards(term, context);
|
|
38
|
-
|
|
39
|
-
if (validatesForwards) {
|
|
40
|
-
termValidatesAsVariable = true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (termValidatesAsVariable) {
|
|
45
|
-
context.debug(`...validated the '${termString}' term as a variable.`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return termValidatesAsVariable;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function unifyTermWithConstructors(term, context, validateForwards) {
|
|
53
|
-
let termUnifiesWithConstructors;
|
|
54
|
-
|
|
55
|
-
const constructors = context.getConstructors();
|
|
56
|
-
|
|
57
|
-
termUnifiesWithConstructors = constructors.some((constructor) => {
|
|
58
|
-
let termUnifiesWithConstructor = false;
|
|
59
|
-
|
|
60
|
-
choose((context) => {
|
|
61
|
-
const termUnifies = constructor.unifyTerm(term, context, validateForwards);
|
|
62
|
-
|
|
63
|
-
if (termUnifies) {
|
|
64
|
-
termUnifiesWithConstructor = true;
|
|
65
|
-
|
|
66
|
-
context.commit();
|
|
67
|
-
}
|
|
68
|
-
}, context);
|
|
69
|
-
|
|
70
|
-
if (termUnifiesWithConstructor) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
return termUnifiesWithConstructors;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function unifyTermWithBracketedConstructor(term, context, validateForwards) {
|
|
79
|
-
let termUnifiesWithBracketedConstructor;
|
|
80
|
-
|
|
81
|
-
const bracketedConstructor = bracketedConstructorFromNothing();
|
|
82
|
-
|
|
83
|
-
termUnifiesWithBracketedConstructor = bracketedConstructor.unifyTerm(term, context, validateForwards);
|
|
84
|
-
|
|
85
|
-
return termUnifiesWithBracketedConstructor;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function validateStatementAsMetavariable(statement, context) {
|
|
89
|
-
let statementValidatesAsMetavariable = false;
|
|
90
|
-
|
|
91
|
-
const { Metavariable } = elements;
|
|
92
|
-
|
|
93
|
-
let metavariable;
|
|
94
|
-
|
|
95
|
-
metavariable = Metavariable.fromStatement(statement, context);
|
|
96
|
-
|
|
97
|
-
if (metavariable !== null) {
|
|
98
|
-
const statementString = statement.getString();
|
|
99
|
-
|
|
100
|
-
context.trace(`Validating the '${statementString}' statement as a metavariable...`);
|
|
101
|
-
|
|
102
|
-
const strict = true; ///
|
|
103
|
-
|
|
104
|
-
metavariable = metavariable.validate(strict, context);
|
|
105
|
-
|
|
106
|
-
if (metavariable !== null) {
|
|
107
|
-
|
|
108
|
-
const { TermSubstitution, FrameSubstitution } = elements;
|
|
109
|
-
|
|
110
|
-
let substitution;
|
|
111
|
-
|
|
112
|
-
const termSubstitution = TermSubstitution.fromStatement(statement, context),
|
|
113
|
-
frameSubstitution = FrameSubstitution.fromStatement(statement, context);
|
|
114
|
-
|
|
115
|
-
substitution = (termSubstitution || frameSubstitution);
|
|
116
|
-
|
|
117
|
-
if (substitution === null) {
|
|
118
|
-
statementValidatesAsMetavariable = true;
|
|
119
|
-
} else {
|
|
120
|
-
substitution = substitution.validate(context); ///
|
|
121
|
-
|
|
122
|
-
if (substitution !== null) {
|
|
123
|
-
statementValidatesAsMetavariable = true;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (statementValidatesAsMetavariable) {
|
|
129
|
-
context.debug(`...validated the '${statementString}' statement as a metavariable.`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return statementValidatesAsMetavariable;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function unifyStatementWithCombinators(statement, context) {
|
|
137
|
-
let statementUnifiesWithCombinators = false;
|
|
138
|
-
|
|
139
|
-
const combinators = context.getCombinators();
|
|
140
|
-
|
|
141
|
-
combinators.some((combinator) => {
|
|
142
|
-
let statementUnifies;
|
|
143
|
-
|
|
144
|
-
descend((context) => {
|
|
145
|
-
statementUnifies = combinator.unifyStatement(statement, context);
|
|
146
|
-
}, context);
|
|
147
|
-
|
|
148
|
-
if (statementUnifies) {
|
|
149
|
-
statementUnifiesWithCombinators = true;
|
|
150
|
-
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
return statementUnifiesWithCombinators;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function unifyStatementWithBracketedCombinator(statement, context) {
|
|
159
|
-
let statementUnifiesWithBracketedCombinator;
|
|
160
|
-
|
|
161
|
-
const bracketedCombinator = bracketedCombinatorFromNothing();
|
|
162
|
-
|
|
163
|
-
statementUnifiesWithBracketedCombinator = bracketedCombinator.unifyStatement(statement, context);
|
|
164
|
-
|
|
165
|
-
return statementUnifiesWithBracketedCombinator;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function validateStatementAsEquality(statement, context) {
|
|
169
|
-
let statementValidatesAsEquality = false;
|
|
170
|
-
|
|
171
|
-
const { Equality } = elements;
|
|
172
|
-
|
|
173
|
-
let equality;
|
|
174
|
-
|
|
175
|
-
equality = Equality.fromStatement(statement, context);
|
|
176
|
-
|
|
177
|
-
if (equality !== null) {
|
|
178
|
-
const statementString = statement.getString();
|
|
179
|
-
|
|
180
|
-
context.trace(`Validating the '${statementString}' statement as an equality...`);
|
|
181
|
-
|
|
182
|
-
equality = equality.validate(context); ///
|
|
183
|
-
|
|
184
|
-
if (equality !== null) {
|
|
185
|
-
statementValidatesAsEquality = true;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (statementValidatesAsEquality) {
|
|
189
|
-
context.debug(`...validated the '${statementString}' statement as an equality.`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return statementValidatesAsEquality;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function validateStatementAsJudgement(statement, context) {
|
|
197
|
-
let validatesStatementAsJudgement = false;
|
|
198
|
-
|
|
199
|
-
let judgement;
|
|
200
|
-
|
|
201
|
-
const { Judgement } = elements;
|
|
202
|
-
|
|
203
|
-
judgement = Judgement.fromStatement(statement, context);
|
|
204
|
-
|
|
205
|
-
if (judgement !== null) {
|
|
206
|
-
const statementString = statement.getString();
|
|
207
|
-
|
|
208
|
-
context.trace(`Validating the '${statementString}' statement as a judgement...`);
|
|
209
|
-
|
|
210
|
-
judgement = judgement.validate(context); ///
|
|
211
|
-
|
|
212
|
-
if (judgement !== null) {
|
|
213
|
-
validatesStatementAsJudgement = true;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (validatesStatementAsJudgement) {
|
|
217
|
-
context.debug(`...validated the '${statementString}' statement as a judgement.`);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return validatesStatementAsJudgement;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function validateStatementAsTypeAssertion(statement, context) {
|
|
225
|
-
let validatesStatementAsTypeAssertion = false;
|
|
226
|
-
|
|
227
|
-
const { TypeAssertion } = elements;
|
|
228
|
-
|
|
229
|
-
let typeAssertion;
|
|
230
|
-
|
|
231
|
-
typeAssertion = TypeAssertion.fromStatement(statement, context);
|
|
232
|
-
|
|
233
|
-
if (typeAssertion !== null) {
|
|
234
|
-
const statementString = statement.getString();
|
|
235
|
-
|
|
236
|
-
context.trace(`Validating the '${statementString}' statement as a type assertion...`);
|
|
237
|
-
|
|
238
|
-
typeAssertion = typeAssertion.validate(context); ///
|
|
239
|
-
|
|
240
|
-
if (typeAssertion !== null) {
|
|
241
|
-
validatesStatementAsTypeAssertion = true;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (validatesStatementAsTypeAssertion) {
|
|
245
|
-
context.debug(`...validated the '${statementString}' statement as a type assertion.`);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return validatesStatementAsTypeAssertion;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function validateStatementAsDefinedAssertion(statement, context) {
|
|
253
|
-
let validatesStatementAsDefinedAssertion = false;
|
|
254
|
-
|
|
255
|
-
const { DefinedAssertion } = elements;
|
|
256
|
-
|
|
257
|
-
let definedAssertion;
|
|
258
|
-
|
|
259
|
-
definedAssertion = DefinedAssertion.fromStatement(statement, context);
|
|
260
|
-
|
|
261
|
-
if (definedAssertion !== null) {
|
|
262
|
-
const statementString = statement.getString();
|
|
263
|
-
|
|
264
|
-
context.trace(`Validating the '${statementString}' statement as a defined assertion...`);
|
|
265
|
-
|
|
266
|
-
definedAssertion = definedAssertion.validate(context); ///
|
|
267
|
-
|
|
268
|
-
if (definedAssertion !== null) {
|
|
269
|
-
validatesStatementAsDefinedAssertion = true;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (validatesStatementAsDefinedAssertion) {
|
|
273
|
-
context.debug(`...validated the '${statementString}' statement as a defined assertion.`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return validatesStatementAsDefinedAssertion;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function validateStatementAsPropertyAssertion(statement, context) {
|
|
281
|
-
let statementValidatesAsPropertyAssertion = false;
|
|
282
|
-
|
|
283
|
-
const { PropertyAssertion } = elements;
|
|
284
|
-
|
|
285
|
-
let propertyAssertion;
|
|
286
|
-
|
|
287
|
-
propertyAssertion = PropertyAssertion.fromStatement(statement, context);
|
|
288
|
-
|
|
289
|
-
if (propertyAssertion !== null) {
|
|
290
|
-
const statementString = statement.getString();
|
|
291
|
-
|
|
292
|
-
context.trace(`Validating the '${statementString}' statement as a property assertion...`);
|
|
293
|
-
|
|
294
|
-
propertyAssertion = propertyAssertion.validate(context); ///
|
|
295
|
-
|
|
296
|
-
if (propertyAssertion !== null) {
|
|
297
|
-
statementValidatesAsPropertyAssertion = true;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
if (statementValidatesAsPropertyAssertion) {
|
|
301
|
-
context.debug(`...validated the '${statementString}' statement as a property assertion.`);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return statementValidatesAsPropertyAssertion;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
function validateStatementAsSubproofAssertion(statement, context) {
|
|
309
|
-
let statementValidatesAsSubproofAssertion = false;
|
|
310
|
-
|
|
311
|
-
const { SubproofAssertion } = elements;
|
|
312
|
-
|
|
313
|
-
let subproofAssertion;
|
|
314
|
-
|
|
315
|
-
subproofAssertion = SubproofAssertion.fromStatement(statement, context);
|
|
316
|
-
|
|
317
|
-
if (subproofAssertion !== null) {
|
|
318
|
-
const statementString = statement.getString();
|
|
319
|
-
|
|
320
|
-
context.trace(`Validating the '${statementString}' statement as a subproof assertion...`);
|
|
321
|
-
|
|
322
|
-
subproofAssertion = subproofAssertion.validate(context); ///
|
|
323
|
-
|
|
324
|
-
if (subproofAssertion !== null) {
|
|
325
|
-
statementValidatesAsSubproofAssertion = true;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (statementValidatesAsSubproofAssertion) {
|
|
329
|
-
context.debug(`...validated the '${statementString}' statement as a subproof assertion.`);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
return statementValidatesAsSubproofAssertion;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function validateStatementAsContainedAssertion(statement, context) {
|
|
337
|
-
let validatesStatementAsContainedAssertion = false;
|
|
338
|
-
|
|
339
|
-
const { ContainedAssertion } = elements;
|
|
340
|
-
|
|
341
|
-
let containedAssertion;
|
|
342
|
-
|
|
343
|
-
containedAssertion = ContainedAssertion.fromStatement(statement, context);
|
|
344
|
-
|
|
345
|
-
if (containedAssertion !== null) {
|
|
346
|
-
const statementString = statement.getString();
|
|
347
|
-
|
|
348
|
-
context.trace(`Validating the '${statementString}' statement as a contained assertion...`);
|
|
349
|
-
|
|
350
|
-
containedAssertion = containedAssertion.validate(context); ///
|
|
351
|
-
|
|
352
|
-
if (containedAssertion !== null) {
|
|
353
|
-
validatesStatementAsContainedAssertion = true;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
if (validatesStatementAsContainedAssertion) {
|
|
357
|
-
context.debug(`...validated the '${statementString}' statement as a contained assertion.`);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return validatesStatementAsContainedAssertion;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
function validateStatementAsSignatureAssertion(statement, context) {
|
|
365
|
-
let validatesAStatementsSignatureAssertion = false;
|
|
366
|
-
|
|
367
|
-
const { SignatureAssertion } = elements;
|
|
368
|
-
|
|
369
|
-
let signatureAssertion;
|
|
370
|
-
|
|
371
|
-
signatureAssertion = SignatureAssertion.fromStatement(statement, context);
|
|
372
|
-
|
|
373
|
-
if (signatureAssertion !== null) {
|
|
374
|
-
const statementString = statement.getString();
|
|
375
|
-
|
|
376
|
-
context.trace(`Validating the '${statementString}' statement as a signature assertion...`);
|
|
377
|
-
|
|
378
|
-
signatureAssertion = signatureAssertion.validate(context); ///
|
|
379
|
-
|
|
380
|
-
if (signatureAssertion !== null) {
|
|
381
|
-
validatesAStatementsSignatureAssertion = true;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
if (validatesAStatementsSignatureAssertion) {
|
|
385
|
-
context.debug(`...validated the '${statementString}' statement as a signature assertion.`);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
return validatesAStatementsSignatureAssertion;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
export const validateTerms = [
|
|
393
|
-
validateTermAsVariable,
|
|
394
|
-
unifyTermWithConstructors,
|
|
395
|
-
unifyTermWithBracketedConstructor
|
|
396
|
-
];
|
|
397
|
-
|
|
398
|
-
export const validateStatements = [
|
|
399
|
-
validateStatementAsMetavariable,
|
|
400
|
-
unifyStatementWithCombinators,
|
|
401
|
-
unifyStatementWithBracketedCombinator,
|
|
402
|
-
validateStatementAsEquality,
|
|
403
|
-
validateStatementAsJudgement,
|
|
404
|
-
validateStatementAsTypeAssertion,
|
|
405
|
-
validateStatementAsDefinedAssertion,
|
|
406
|
-
validateStatementAsPropertyAssertion,
|
|
407
|
-
validateStatementAsSubproofAssertion,
|
|
408
|
-
validateStatementAsContainedAssertion,
|
|
409
|
-
validateStatementAsSignatureAssertion
|
|
410
|
-
];
|
package/src/process/verify.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { AsyncPass, queryUtilities } from "occam-languages"
|
|
4
|
-
|
|
5
|
-
import { ruleFromRuleNode,
|
|
6
|
-
errorFromErrorNode,
|
|
7
|
-
axiomFromAxiomNode,
|
|
8
|
-
lemmaFromLemmaNode,
|
|
9
|
-
sectionFromSectionNode,
|
|
10
|
-
theoremFromTheoremNode,
|
|
11
|
-
metaLemmaFromMetaLemmaNode,
|
|
12
|
-
conjectureFromConjectureNode,
|
|
13
|
-
metatheoremFromMetatheoremNode,
|
|
14
|
-
variableDeclarationFromVariableDeclarationNode,
|
|
15
|
-
simpleTypeDeclarationFromSimpleTypeDeclarationNode,
|
|
16
|
-
typePrefixDeclarationFromTypePrefixDeclarationNode,
|
|
17
|
-
combinatorDeclarationFromCombinatorDeclarationNode,
|
|
18
|
-
constructorDeclarationFromConstructorDeclarationNode,
|
|
19
|
-
complexTypeDeclarationFromComplexTypeDeclarationNode,
|
|
20
|
-
metavariableDeclarationFromMetavariableDeclarationNode } from "../utilities/element";
|
|
21
|
-
|
|
22
|
-
const { nodeQuery } = queryUtilities;
|
|
23
|
-
|
|
24
|
-
const ruleNodeQuery = nodeQuery("/rule"),
|
|
25
|
-
errorNodeQuery = nodeQuery("/error"),
|
|
26
|
-
axiomNodeQuery = nodeQuery("/axiom"),
|
|
27
|
-
lemmaNodeQuery = nodeQuery("/lemma"),
|
|
28
|
-
sectionNodeQuery = nodeQuery("/section"),
|
|
29
|
-
theoremNodeQuery = nodeQuery("/theorem"),
|
|
30
|
-
metaLemmaNodeQuery = nodeQuery("/metaLemma"),
|
|
31
|
-
conjectureNodeQuery = nodeQuery("/conjecture"),
|
|
32
|
-
metatheoremNodeQuery = nodeQuery("/metatheorem"),
|
|
33
|
-
variableDeclarationNodeQuery = nodeQuery("/variableDeclaration"),
|
|
34
|
-
combinatorDeclarationNodeQuery = nodeQuery("/combinatorDeclaration"),
|
|
35
|
-
simpleTypeDeclarationNodeQuery = nodeQuery("/simpleTypeDeclaration"),
|
|
36
|
-
typePrefixDeclarationNodeQuery = nodeQuery("/typePrefixDeclaration"),
|
|
37
|
-
constructorDeclarationNodeQuery = nodeQuery("/constructorDeclaration"),
|
|
38
|
-
complexTypeDeclarationNodeQuery = nodeQuery("/complexTypeDeclaration"),
|
|
39
|
-
metavariableDeclarationNodeQuery = nodeQuery("/metavariableDeclaration");
|
|
40
|
-
|
|
41
|
-
class TopLevelPass extends AsyncPass {
|
|
42
|
-
static maps = [
|
|
43
|
-
{
|
|
44
|
-
nodeQuery: errorNodeQuery,
|
|
45
|
-
run: async (errorNode, context) => {
|
|
46
|
-
let success = false;
|
|
47
|
-
|
|
48
|
-
const error = errorFromErrorNode(errorNode, context),
|
|
49
|
-
errorVerifies = await error.verify(context);
|
|
50
|
-
|
|
51
|
-
if (errorVerifies) {
|
|
52
|
-
success = true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return success;
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
nodeQuery: ruleNodeQuery,
|
|
60
|
-
run: async (ruleNode, context) => {
|
|
61
|
-
let success = false;
|
|
62
|
-
|
|
63
|
-
const rule = ruleFromRuleNode(ruleNode, context),
|
|
64
|
-
ruleVerifies = await rule.verify(context);
|
|
65
|
-
|
|
66
|
-
if (ruleVerifies) {
|
|
67
|
-
success = true;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return success;
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
nodeQuery: axiomNodeQuery,
|
|
75
|
-
run: async (axiomNode, context) => {
|
|
76
|
-
let success = false;
|
|
77
|
-
|
|
78
|
-
const axiom = axiomFromAxiomNode(axiomNode, context),
|
|
79
|
-
axiomVerifies = await axiom.verify(context);
|
|
80
|
-
|
|
81
|
-
if (axiomVerifies) {
|
|
82
|
-
success = true;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return success;
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
nodeQuery: lemmaNodeQuery,
|
|
90
|
-
run: async (lemmaNode, context) => {
|
|
91
|
-
let success = false;
|
|
92
|
-
|
|
93
|
-
const lemma = lemmaFromLemmaNode(lemmaNode, context),
|
|
94
|
-
lemmaVerifies = await lemma.verify(context);
|
|
95
|
-
|
|
96
|
-
if (lemmaVerifies) {
|
|
97
|
-
success = true;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return success;
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
nodeQuery: sectionNodeQuery,
|
|
105
|
-
run: async (sectionNode, context) => {
|
|
106
|
-
let success = false;
|
|
107
|
-
|
|
108
|
-
const section = sectionFromSectionNode(sectionNode, context),
|
|
109
|
-
sectionVerifies = await section.verify(context);
|
|
110
|
-
|
|
111
|
-
if (sectionVerifies) {
|
|
112
|
-
success = true;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return success;
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
nodeQuery: theoremNodeQuery,
|
|
120
|
-
run: async (theoremNode, context) => {
|
|
121
|
-
let success = false;
|
|
122
|
-
|
|
123
|
-
const theorem = theoremFromTheoremNode(theoremNode, context),
|
|
124
|
-
theoremVerifies = await theorem.verify(context);
|
|
125
|
-
|
|
126
|
-
if (theoremVerifies) {
|
|
127
|
-
success = true;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return success;
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
nodeQuery: metaLemmaNodeQuery,
|
|
135
|
-
run: async (metaLemmaNode, context) => {
|
|
136
|
-
let success = false;
|
|
137
|
-
|
|
138
|
-
const metaLemma = metaLemmaFromMetaLemmaNode(metaLemmaNode, context),
|
|
139
|
-
metaLemmaVerifies = await metaLemma.verify(context);
|
|
140
|
-
|
|
141
|
-
if (metaLemmaVerifies) {
|
|
142
|
-
success = true;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return success;
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
nodeQuery: conjectureNodeQuery,
|
|
150
|
-
run: async (conjectureNode, context) => {
|
|
151
|
-
let success = false;
|
|
152
|
-
|
|
153
|
-
const conjecture = conjectureFromConjectureNode(conjectureNode, context),
|
|
154
|
-
conjectureVerifies = await conjecture.verify(context);
|
|
155
|
-
|
|
156
|
-
if (conjectureVerifies) {
|
|
157
|
-
success = true;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return success;
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
nodeQuery: metatheoremNodeQuery,
|
|
165
|
-
run: async (metatheoremNode, context) => {
|
|
166
|
-
let success = false;
|
|
167
|
-
|
|
168
|
-
const metatheorem = metatheoremFromMetatheoremNode(metatheoremNode, context),
|
|
169
|
-
metatheoremVerifies = await metatheorem.verify(context);
|
|
170
|
-
|
|
171
|
-
if (metatheoremVerifies) {
|
|
172
|
-
success = true;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return success;
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
nodeQuery: variableDeclarationNodeQuery,
|
|
180
|
-
run: async (variableDeclarationNode, context) => {
|
|
181
|
-
let success = false;
|
|
182
|
-
|
|
183
|
-
const variableDeclaration = variableDeclarationFromVariableDeclarationNode(variableDeclarationNode, context),
|
|
184
|
-
variableDeclarationVerifies = await variableDeclaration.verify(context);
|
|
185
|
-
|
|
186
|
-
if (variableDeclarationVerifies) {
|
|
187
|
-
success = true;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return success;
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
nodeQuery: simpleTypeDeclarationNodeQuery,
|
|
195
|
-
run: async (simpleTypeDeclarationNode, context) => {
|
|
196
|
-
let success = false;
|
|
197
|
-
|
|
198
|
-
const simpleTypeDeclaration = simpleTypeDeclarationFromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
199
|
-
simpleTypeDeclarationVerifies = await simpleTypeDeclaration.verify(context);
|
|
200
|
-
|
|
201
|
-
if (simpleTypeDeclarationVerifies) {
|
|
202
|
-
success = true;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return success;
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
nodeQuery: typePrefixDeclarationNodeQuery,
|
|
210
|
-
run: async (typePrefixDeclarationNode, context) => {
|
|
211
|
-
let success = false;
|
|
212
|
-
|
|
213
|
-
const typePrefixDeclaration = typePrefixDeclarationFromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
|
|
214
|
-
typePrefixDeclarationVerifies = await typePrefixDeclaration.verify(context);
|
|
215
|
-
|
|
216
|
-
if (typePrefixDeclarationVerifies) {
|
|
217
|
-
success = true;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return success;
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
nodeQuery: combinatorDeclarationNodeQuery,
|
|
225
|
-
run: async (combinatorDeclarationNode, context) => {
|
|
226
|
-
let success = false;
|
|
227
|
-
|
|
228
|
-
const combinatorDeclaration = combinatorDeclarationFromCombinatorDeclarationNode(combinatorDeclarationNode, context),
|
|
229
|
-
combinatorDeclarationVerifies = await combinatorDeclaration.verify(context);
|
|
230
|
-
|
|
231
|
-
if (combinatorDeclarationVerifies) {
|
|
232
|
-
success = true;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return success;
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
nodeQuery: constructorDeclarationNodeQuery,
|
|
240
|
-
run: async (constructorDeclarationNode, context) => {
|
|
241
|
-
let success = false;
|
|
242
|
-
|
|
243
|
-
const constructorDeclaration = constructorDeclarationFromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
244
|
-
constructorDeclarationVerifies = await constructorDeclaration.verify(context);
|
|
245
|
-
|
|
246
|
-
if (constructorDeclarationVerifies) {
|
|
247
|
-
success = true;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return success;
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
nodeQuery: complexTypeDeclarationNodeQuery,
|
|
255
|
-
run: async (complexTypeDeclarationNode, context) => {
|
|
256
|
-
let success = false;
|
|
257
|
-
|
|
258
|
-
const complexTypeDeclaration = complexTypeDeclarationFromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
259
|
-
complexTypeDeclarationVerifies = await complexTypeDeclaration.verify(context);
|
|
260
|
-
|
|
261
|
-
if (complexTypeDeclarationVerifies) {
|
|
262
|
-
success = true;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return success;
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
nodeQuery: metavariableDeclarationNodeQuery,
|
|
270
|
-
run: async (metavariableDeclarationNode, context) => {
|
|
271
|
-
let success = false;
|
|
272
|
-
|
|
273
|
-
const metavariableDeclaration = metavariableDeclarationFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
274
|
-
metavariableDeclarationVerifies = await metavariableDeclaration.verify(context);
|
|
275
|
-
|
|
276
|
-
if (metavariableDeclarationVerifies) {
|
|
277
|
-
success = true;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return success;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
];
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const topLevelPass = new TopLevelPass();
|
|
287
|
-
|
|
288
|
-
export async function verifyFile(fileNode, context) {
|
|
289
|
-
let fileVerifies = false;
|
|
290
|
-
|
|
291
|
-
const node = fileNode, ///
|
|
292
|
-
sucess = await topLevelPass.run(node, context);
|
|
293
|
-
|
|
294
|
-
if (sucess) {
|
|
295
|
-
fileVerifies = true;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return fileVerifies;
|
|
299
|
-
}
|