occam-verify-cli 1.0.984 → 1.0.985
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/action/verify.js +22 -27
- package/lib/constants.js +1 -41
- package/lib/index.js +1 -2
- package/lib/utilities/fileContext.js +3 -8
- package/lib/utilities/releaseContext.js +2 -2
- package/package.json +5 -6
- package/src/action/verify.js +8 -18
- package/src/constants.js +0 -10
- package/src/index.js +0 -2
- package/src/utilities/fileContext.js +1 -2
- package/src/utilities/releaseContext.js +1 -1
- package/lib/context/aphasic.js +0 -27
- package/lib/context/bounded.js +0 -244
- package/lib/context/branching.js +0 -61
- package/lib/context/file/nominal.js +0 -586
- package/lib/context/illative.js +0 -28
- package/lib/context/liminal.js +0 -200
- package/lib/context/literal.js +0 -44
- package/lib/context/mnemic.js +0 -454
- package/lib/context/nested.js +0 -31
- package/lib/context/nominal.js +0 -57
- package/lib/context/phaneric.js +0 -44
- package/lib/context/thetic.js +0 -28
- package/lib/context.js +0 -445
- package/lib/element/assertion/contained.js +0 -218
- package/lib/element/assertion/defined.js +0 -213
- package/lib/element/assertion/property.js +0 -176
- package/lib/element/assertion/signature.js +0 -170
- package/lib/element/assertion/subproof.js +0 -220
- package/lib/element/assertion/type.js +0 -227
- package/lib/element/assertion.js +0 -49
- package/lib/element/assumption/metaLevel.js +0 -244
- package/lib/element/assumption.js +0 -252
- package/lib/element/combinator/bracketed.js +0 -36
- package/lib/element/combinator.js +0 -104
- package/lib/element/conclusion.js +0 -131
- package/lib/element/constructor/bracketed.js +0 -57
- package/lib/element/constructor.js +0 -129
- package/lib/element/declaration/combinator.js +0 -58
- package/lib/element/declaration/complexType.js +0 -180
- package/lib/element/declaration/constructor.js +0 -93
- package/lib/element/declaration/metavariable.js +0 -77
- package/lib/element/declaration/property.js +0 -88
- package/lib/element/declaration/simpleType.js +0 -148
- package/lib/element/declaration/typePrefix.js +0 -53
- package/lib/element/declaration/variable.js +0 -99
- package/lib/element/declaration.js +0 -15
- package/lib/element/deduction.js +0 -131
- package/lib/element/derivation.js +0 -46
- package/lib/element/equality.js +0 -211
- package/lib/element/equivalence.js +0 -200
- package/lib/element/error.js +0 -27
- package/lib/element/frame.js +0 -238
- package/lib/element/hypothesis.js +0 -135
- package/lib/element/judgement.js +0 -212
- package/lib/element/label.js +0 -135
- package/lib/element/metaType.js +0 -57
- package/lib/element/metavariable.js +0 -452
- package/lib/element/parameter.js +0 -69
- package/lib/element/procedureCall.js +0 -116
- package/lib/element/procedureReference.js +0 -56
- package/lib/element/proof.js +0 -52
- package/lib/element/proofAssertion/premise.js +0 -238
- package/lib/element/proofAssertion/step.js +0 -235
- package/lib/element/proofAssertion/supposition.js +0 -249
- package/lib/element/proofAssertion.js +0 -56
- package/lib/element/property.js +0 -176
- package/lib/element/propertyRelation.js +0 -132
- package/lib/element/reference.js +0 -227
- package/lib/element/rule.js +0 -242
- package/lib/element/section.js +0 -64
- package/lib/element/signature.js +0 -195
- package/lib/element/statement.js +0 -228
- package/lib/element/subDerivation.js +0 -46
- package/lib/element/subproof.js +0 -91
- package/lib/element/substitution/frame.js +0 -256
- package/lib/element/substitution/reference.js +0 -192
- package/lib/element/substitution/statement.js +0 -294
- package/lib/element/substitution/term.js +0 -266
- package/lib/element/substitution.js +0 -183
- package/lib/element/term.js +0 -217
- package/lib/element/topLevelAssertion/axiom.js +0 -158
- package/lib/element/topLevelAssertion/conjecture.js +0 -42
- package/lib/element/topLevelAssertion/lemma.js +0 -39
- package/lib/element/topLevelAssertion/theorem.js +0 -42
- package/lib/element/topLevelAssertion.js +0 -286
- package/lib/element/topLevelMetaAssertion/metaLemma.js +0 -42
- package/lib/element/topLevelMetaAssertion/metatheorem.js +0 -42
- package/lib/element/topLevelMetaAssertion.js +0 -179
- package/lib/element/type.js +0 -240
- package/lib/element/typePrefix.js +0 -85
- package/lib/element/variable.js +0 -206
- package/lib/elements.js +0 -27
- package/lib/metaTypeNames.js +0 -26
- package/lib/metaTypes.js +0 -66
- package/lib/node/argument.js +0 -31
- package/lib/node/assertion/contained.js +0 -51
- package/lib/node/assertion/defined.js +0 -47
- package/lib/node/assertion/property.js +0 -36
- package/lib/node/assertion/signature.js +0 -32
- package/lib/node/assertion/subproof.js +0 -28
- package/lib/node/assertion/type.js +0 -32
- package/lib/node/assertion.js +0 -18
- package/lib/node/assumption/metaLevel.js +0 -27
- package/lib/node/assumption.js +0 -27
- package/lib/node/body/axiom.js +0 -23
- package/lib/node/body/conjecture.js +0 -23
- package/lib/node/body/lemma.js +0 -23
- package/lib/node/body/metaLemma.js +0 -23
- package/lib/node/body/metatheorem.js +0 -23
- package/lib/node/body/rule.js +0 -44
- package/lib/node/body/theorem.js +0 -23
- package/lib/node/body.js +0 -31
- package/lib/node/combinator.js +0 -23
- package/lib/node/conclusion.js +0 -27
- package/lib/node/constructor.js +0 -23
- package/lib/node/declaration/combinator.js +0 -28
- package/lib/node/declaration/complexType.js +0 -72
- package/lib/node/declaration/constructor.js +0 -47
- package/lib/node/declaration/metavariable.js +0 -36
- package/lib/node/declaration/property.js +0 -44
- package/lib/node/declaration/simpleType.js +0 -72
- package/lib/node/declaration/typePrefix.js +0 -32
- package/lib/node/declaration/variable.js +0 -51
- package/lib/node/declaration.js +0 -18
- package/lib/node/deduction.js +0 -27
- package/lib/node/derivation.js +0 -26
- package/lib/node/document.js +0 -18
- package/lib/node/equality.js +0 -33
- package/lib/node/equivalence.js +0 -23
- package/lib/node/equivalences.js +0 -18
- package/lib/node/error.js +0 -18
- package/lib/node/frame.js +0 -38
- package/lib/node/header/axiom.js +0 -28
- package/lib/node/header/conjecture.js +0 -23
- package/lib/node/header/lemma.js +0 -23
- package/lib/node/header/metaLemma.js +0 -23
- package/lib/node/header/metatheorem.js +0 -23
- package/lib/node/header/rule.js +0 -23
- package/lib/node/header/theorem.js +0 -23
- package/lib/node/header.js +0 -47
- package/lib/node/hypothesis.js +0 -27
- package/lib/node/judgement.js +0 -31
- package/lib/node/label.js +0 -23
- package/lib/node/labels.js +0 -23
- package/lib/node/metaArgument.js +0 -23
- package/lib/node/metaType.js +0 -30
- package/lib/node/metavariable.js +0 -39
- package/lib/node/parameter.js +0 -47
- package/lib/node/parenthesisedLabel.js +0 -23
- package/lib/node/parenthesisedLabels.js +0 -27
- package/lib/node/placeholder.js +0 -18
- package/lib/node/procedureCall.js +0 -31
- package/lib/node/procedureReference.js +0 -30
- package/lib/node/proof.js +0 -23
- package/lib/node/proofAssertion/premise.js +0 -28
- package/lib/node/proofAssertion/step.js +0 -52
- package/lib/node/proofAssertion/supposition.js +0 -28
- package/lib/node/proofAssertion.js +0 -27
- package/lib/node/property.js +0 -30
- package/lib/node/propertyRelation.js +0 -31
- package/lib/node/qualification.js +0 -27
- package/lib/node/reference.js +0 -23
- package/lib/node/rule.js +0 -43
- package/lib/node/section.js +0 -39
- package/lib/node/signature.js +0 -23
- package/lib/node/statement.js +0 -103
- package/lib/node/subDerivation.js +0 -26
- package/lib/node/subproof.js +0 -35
- package/lib/node/substitution/frame.js +0 -40
- package/lib/node/substitution/reference.js +0 -40
- package/lib/node/substitution/statement.js +0 -60
- package/lib/node/substitution/term.js +0 -40
- package/lib/node/substitution.js +0 -18
- package/lib/node/term.js +0 -60
- package/lib/node/topLevelAssertion/axiom.js +0 -26
- package/lib/node/topLevelAssertion/conjecture.js +0 -26
- package/lib/node/topLevelAssertion/lemma.js +0 -26
- package/lib/node/topLevelAssertion/theorem.js +0 -26
- package/lib/node/topLevelAssertion.js +0 -46
- package/lib/node/topLevelMetaAssertion/metaLemma.js +0 -26
- package/lib/node/topLevelMetaAssertion/metatheorem.js +0 -26
- package/lib/node/topLevelMetaAssertion.js +0 -42
- package/lib/node/type.js +0 -60
- package/lib/node/typePrefix.js +0 -30
- package/lib/node/types.js +0 -23
- package/lib/node/variable.js +0 -30
- package/lib/nominal/lexer.js +0 -15
- package/lib/nominal/parser.js +0 -24
- package/lib/nonTerminalNodeMap.js +0 -189
- package/lib/pass/zip.js +0 -23
- package/lib/preamble.js +0 -73
- package/lib/process/assign.js +0 -62
- package/lib/process/discharge.js +0 -38
- package/lib/process/equate.js +0 -73
- package/lib/process/instantiate.js +0 -261
- package/lib/process/unification.js +0 -228
- package/lib/process/unify.js +0 -336
- package/lib/process/validate.js +0 -135
- package/lib/process/validation.js +0 -291
- package/lib/process/verify.js +0 -205
- package/lib/ruleNames.js +0 -350
- package/lib/tokenTypes.js +0 -22
- package/lib/utilities/assignment.js +0 -47
- package/lib/utilities/bnf.js +0 -21
- package/lib/utilities/brackets.js +0 -77
- package/lib/utilities/breakPoint.js +0 -38
- package/lib/utilities/context.js +0 -220
- package/lib/utilities/element.js +0 -1851
- package/lib/utilities/equivalence.js +0 -27
- package/lib/utilities/equivalences.js +0 -134
- package/lib/utilities/instance.js +0 -44
- package/lib/utilities/json.js +0 -1109
- package/lib/utilities/string.js +0 -231
- package/lib/utilities/substitutions.js +0 -86
- package/lib/utilities/synoptic.js +0 -159
- package/lib/utilities/type.js +0 -27
- package/src/context/aphasic.js +0 -15
- package/src/context/bounded.js +0 -362
- package/src/context/branching.js +0 -69
- package/src/context/file/nominal.js +0 -955
- package/src/context/illative.js +0 -17
- package/src/context/liminal.js +0 -280
- package/src/context/literal.js +0 -42
- package/src/context/mnemic.js +0 -778
- package/src/context/nested.js +0 -21
- package/src/context/nominal.js +0 -62
- package/src/context/phaneric.js +0 -43
- package/src/context/thetic.js +0 -17
- package/src/context.js +0 -722
- package/src/element/assertion/contained.js +0 -313
- package/src/element/assertion/defined.js +0 -310
- package/src/element/assertion/property.js +0 -252
- package/src/element/assertion/signature.js +0 -239
- package/src/element/assertion/subproof.js +0 -335
- package/src/element/assertion/type.js +0 -328
- package/src/element/assertion.js +0 -65
- package/src/element/assumption/metaLevel.js +0 -373
- package/src/element/assumption.js +0 -374
- package/src/element/combinator/bracketed.js +0 -32
- package/src/element/combinator.js +0 -145
- package/src/element/conclusion.js +0 -185
- package/src/element/constructor/bracketed.js +0 -68
- package/src/element/constructor.js +0 -188
- package/src/element/declaration/combinator.js +0 -66
- package/src/element/declaration/complexType.js +0 -257
- package/src/element/declaration/constructor.js +0 -122
- package/src/element/declaration/metavariable.js +0 -93
- package/src/element/declaration/property.js +0 -108
- package/src/element/declaration/simpleType.js +0 -208
- package/src/element/declaration/typePrefix.js +0 -58
- package/src/element/declaration/variable.js +0 -130
- package/src/element/declaration.js +0 -7
- package/src/element/deduction.js +0 -185
- package/src/element/derivation.js +0 -57
- package/src/element/equality.js +0 -325
- package/src/element/equivalence.js +0 -276
- package/src/element/error.js +0 -26
- package/src/element/frame.js +0 -356
- package/src/element/hypothesis.js +0 -186
- package/src/element/judgement.js +0 -303
- package/src/element/label.js +0 -186
- package/src/element/metaType.js +0 -75
- package/src/element/metavariable.js +0 -662
- package/src/element/parameter.js +0 -90
- package/src/element/procedureCall.js +0 -159
- package/src/element/procedureReference.js +0 -71
- package/src/element/proof.js +0 -61
- package/src/element/proofAssertion/premise.js +0 -354
- package/src/element/proofAssertion/step.js +0 -271
- package/src/element/proofAssertion/supposition.js +0 -377
- package/src/element/proofAssertion.js +0 -74
- package/src/element/property.js +0 -258
- package/src/element/propertyRelation.js +0 -193
- package/src/element/reference.js +0 -345
- package/src/element/rule.js +0 -358
- package/src/element/section.js +0 -78
- package/src/element/signature.js +0 -292
- package/src/element/statement.js +0 -358
- package/src/element/subDerivation.js +0 -56
- package/src/element/subproof.js +0 -116
- package/src/element/substitution/frame.js +0 -392
- package/src/element/substitution/reference.js +0 -274
- package/src/element/substitution/statement.js +0 -452
- package/src/element/substitution/term.js +0 -407
- package/src/element/substitution.js +0 -261
- package/src/element/term.js +0 -339
- package/src/element/topLevelAssertion/axiom.js +0 -244
- package/src/element/topLevelAssertion/conjecture.js +0 -40
- package/src/element/topLevelAssertion/lemma.js +0 -42
- package/src/element/topLevelAssertion/theorem.js +0 -40
- package/src/element/topLevelAssertion.js +0 -436
- package/src/element/topLevelMetaAssertion/metaLemma.js +0 -40
- package/src/element/topLevelMetaAssertion/metatheorem.js +0 -40
- package/src/element/topLevelMetaAssertion.js +0 -276
- package/src/element/type.js +0 -374
- package/src/element/typePrefix.js +0 -113
- package/src/element/variable.js +0 -259
- package/src/elements.js +0 -13
- package/src/metaTypeNames.js +0 -5
- package/src/metaTypes.js +0 -71
- package/src/node/argument.js +0 -30
- package/src/node/assertion/contained.js +0 -53
- package/src/node/assertion/defined.js +0 -46
- package/src/node/assertion/property.js +0 -30
- package/src/node/assertion/signature.js +0 -23
- package/src/node/assertion/subproof.js +0 -16
- package/src/node/assertion/type.js +0 -23
- package/src/node/assertion.js +0 -7
- package/src/node/assumption/metaLevel.js +0 -23
- package/src/node/assumption.js +0 -23
- package/src/node/body/axiom.js +0 -7
- package/src/node/body/conjecture.js +0 -7
- package/src/node/body/lemma.js +0 -7
- package/src/node/body/metaLemma.js +0 -7
- package/src/node/body/metatheorem.js +0 -7
- package/src/node/body/rule.js +0 -42
- package/src/node/body/theorem.js +0 -7
- package/src/node/body.js +0 -30
- package/src/node/combinator.js +0 -16
- package/src/node/conclusion.js +0 -23
- package/src/node/constructor.js +0 -16
- package/src/node/declaration/combinator.js +0 -16
- package/src/node/declaration/complexType.js +0 -88
- package/src/node/declaration/constructor.js +0 -46
- package/src/node/declaration/metavariable.js +0 -30
- package/src/node/declaration/property.js +0 -42
- package/src/node/declaration/simpleType.js +0 -87
- package/src/node/declaration/typePrefix.js +0 -24
- package/src/node/declaration/variable.js +0 -53
- package/src/node/declaration.js +0 -7
- package/src/node/deduction.js +0 -23
- package/src/node/derivation.js +0 -19
- package/src/node/document.js +0 -7
- package/src/node/equality.js +0 -35
- package/src/node/equivalence.js +0 -16
- package/src/node/equivalences.js +0 -7
- package/src/node/error.js +0 -7
- package/src/node/frame.js +0 -40
- package/src/node/header/axiom.js +0 -16
- package/src/node/header/conjecture.js +0 -7
- package/src/node/header/lemma.js +0 -7
- package/src/node/header/metaLemma.js +0 -7
- package/src/node/header/metatheorem.js +0 -7
- package/src/node/header/rule.js +0 -7
- package/src/node/header/theorem.js +0 -7
- package/src/node/header.js +0 -54
- package/src/node/hypothesis.js +0 -23
- package/src/node/judgement.js +0 -30
- package/src/node/label.js +0 -16
- package/src/node/labels.js +0 -16
- package/src/node/metaArgument.js +0 -16
- package/src/node/metaType.js +0 -26
- package/src/node/metavariable.js +0 -42
- package/src/node/parameter.js +0 -51
- package/src/node/parenthesisedLabel.js +0 -16
- package/src/node/parenthesisedLabels.js +0 -23
- package/src/node/placeholder.js +0 -7
- package/src/node/procedureCall.js +0 -30
- package/src/node/procedureReference.js +0 -26
- package/src/node/proof.js +0 -16
- package/src/node/proofAssertion/premise.js +0 -16
- package/src/node/proofAssertion/step.js +0 -52
- package/src/node/proofAssertion/supposition.js +0 -16
- package/src/node/proofAssertion.js +0 -23
- package/src/node/property.js +0 -28
- package/src/node/propertyRelation.js +0 -30
- package/src/node/qualification.js +0 -23
- package/src/node/reference.js +0 -16
- package/src/node/rule.js +0 -51
- package/src/node/section.js +0 -44
- package/src/node/signature.js +0 -16
- package/src/node/statement.js +0 -167
- package/src/node/subDerivation.js +0 -19
- package/src/node/subproof.js +0 -35
- package/src/node/substitution/frame.js +0 -37
- package/src/node/substitution/reference.js +0 -38
- package/src/node/substitution/statement.js +0 -70
- package/src/node/substitution/term.js +0 -38
- package/src/node/substitution.js +0 -7
- package/src/node/term.js +0 -75
- package/src/node/topLevelAssertion/axiom.js +0 -13
- package/src/node/topLevelAssertion/conjecture.js +0 -13
- package/src/node/topLevelAssertion/lemma.js +0 -13
- package/src/node/topLevelAssertion/theorem.js +0 -13
- package/src/node/topLevelAssertion.js +0 -58
- package/src/node/topLevelMetaAssertion/metaLemma.js +0 -13
- package/src/node/topLevelMetaAssertion/metatheorem.js +0 -13
- package/src/node/topLevelMetaAssertion.js +0 -51
- package/src/node/type.js +0 -74
- package/src/node/typePrefix.js +0 -26
- package/src/node/types.js +0 -16
- package/src/node/variable.js +0 -26
- package/src/nominal/lexer.js +0 -5
- package/src/nominal/parser.js +0 -12
- package/src/nonTerminalNodeMap.js +0 -261
- package/src/pass/zip.js +0 -19
- package/src/preamble.js +0 -64
- package/src/process/assign.js +0 -53
- package/src/process/discharge.js +0 -33
- package/src/process/equate.js +0 -94
- package/src/process/instantiate.js +0 -198
- package/src/process/unification.js +0 -332
- package/src/process/unify.js +0 -504
- package/src/process/validate.js +0 -174
- package/src/process/validation.js +0 -410
- package/src/process/verify.js +0 -299
- package/src/ruleNames.js +0 -86
- package/src/tokenTypes.js +0 -4
- package/src/utilities/assignment.js +0 -57
- package/src/utilities/bnf.js +0 -20
- package/src/utilities/brackets.js +0 -87
- package/src/utilities/breakPoint.js +0 -29
- package/src/utilities/context.js +0 -223
- package/src/utilities/element.js +0 -2293
- package/src/utilities/equivalence.js +0 -25
- package/src/utilities/equivalences.js +0 -158
- package/src/utilities/instance.js +0 -40
- package/src/utilities/json.js +0 -1273
- package/src/utilities/string.js +0 -282
- package/src/utilities/substitutions.js +0 -93
- package/src/utilities/synoptic.js +0 -135
- package/src/utilities/type.js +0 -19
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Element, asynchronousUtilities } from "occam-languages";
|
|
4
|
-
|
|
5
|
-
import { encapsulate } from "../utilities/context";
|
|
6
|
-
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
7
|
-
import { topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
|
|
8
|
-
import { labelFromJSON,
|
|
9
|
-
labelToLabelJSON,
|
|
10
|
-
deductionFromJSON,
|
|
11
|
-
suppositionsFromJSON,
|
|
12
|
-
deductionToDeductionJSON,
|
|
13
|
-
metaLevelAssumptionsFromJSON,
|
|
14
|
-
suppositionsToSuppositionsJSON,
|
|
15
|
-
metaLevelAssumptionsToMetaLevelAssumptionsJSON } from "../utilities/json";
|
|
16
|
-
|
|
17
|
-
const { asyncForwardsEvery } = asynchronousUtilities;
|
|
18
|
-
|
|
19
|
-
export default class TopLevelMetaAssertion extends Element {
|
|
20
|
-
constructor(context, string, node, breakPoint, label, suppositions, deduction, proof, metaLevelAssumptions) {
|
|
21
|
-
super(context, string, node, breakPoint);
|
|
22
|
-
|
|
23
|
-
this.label = label;
|
|
24
|
-
this.suppositions = suppositions;
|
|
25
|
-
this.deduction = deduction;
|
|
26
|
-
this.proof = proof;
|
|
27
|
-
this.metaLevelAssumptions = metaLevelAssumptions;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getLabel() {
|
|
31
|
-
return this.label;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
getSuppositions() {
|
|
35
|
-
return this.suppositions;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
getDeduction() {
|
|
39
|
-
return this.deduction;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
getProof() {
|
|
43
|
-
return this.proof;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getMetaLevelAssumptions() {
|
|
47
|
-
return this.metaLevelAssumptions;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
getStatement() {
|
|
51
|
-
let statement = null;
|
|
52
|
-
|
|
53
|
-
const unconditional = this.isUnconditional();
|
|
54
|
-
|
|
55
|
-
if (unconditional) {
|
|
56
|
-
statement = this.deduction.getStatement();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return statement;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
getStatements() {
|
|
63
|
-
let statements = null;
|
|
64
|
-
|
|
65
|
-
const unconditional = this.isUnconditional();
|
|
66
|
-
|
|
67
|
-
if (!unconditional) {
|
|
68
|
-
const suppositionStatements = this.suppositions.map((supposition) => {
|
|
69
|
-
const suppositionStatement = supposition.getStatement();
|
|
70
|
-
|
|
71
|
-
return suppositionStatement;
|
|
72
|
-
}),
|
|
73
|
-
deductionStatement = this.deduction.getStatement();
|
|
74
|
-
|
|
75
|
-
statements = [
|
|
76
|
-
...suppositionStatements,
|
|
77
|
-
deductionStatement
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return statements;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
isUnconditional() {
|
|
85
|
-
const suppositionsLength = this.suppositions.length,
|
|
86
|
-
unconditional = (suppositionsLength === 0);
|
|
87
|
-
|
|
88
|
-
return unconditional;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
compareReference(reference) {
|
|
92
|
-
const label = this.getLabel(),
|
|
93
|
-
labelComparesToRefference = label.compareReference(reference),
|
|
94
|
-
comparesToReference = labelComparesToRefference; ///
|
|
95
|
-
|
|
96
|
-
return comparesToReference;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async verify(context) {
|
|
100
|
-
let verifies = false;
|
|
101
|
-
|
|
102
|
-
const topLevelMetaAssertionString = this.getString(); ///
|
|
103
|
-
|
|
104
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta assertion...`);
|
|
105
|
-
|
|
106
|
-
await encapsulate(async (context) => {
|
|
107
|
-
const labelVerifies = this.verifyLabel(context);
|
|
108
|
-
|
|
109
|
-
if (labelVerifies) {
|
|
110
|
-
const suppositionsVerify = await this.verifySuppositions(context);
|
|
111
|
-
|
|
112
|
-
if (suppositionsVerify) {
|
|
113
|
-
const deductionVerifies = await this.verifyDeduction(context);
|
|
114
|
-
|
|
115
|
-
if (deductionVerifies) {
|
|
116
|
-
const proofVerifies = await this.verifyProof(context);
|
|
117
|
-
|
|
118
|
-
if (proofVerifies) {
|
|
119
|
-
verifies = true;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}, this.metaLevelAssumptions, context);
|
|
125
|
-
|
|
126
|
-
if (verifies) {
|
|
127
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta assertion.`);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return verifies;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
verifyLabel(context) {
|
|
134
|
-
let labelVerifies;
|
|
135
|
-
|
|
136
|
-
const topLevelMetaAssertionString = this.getString(), ///
|
|
137
|
-
labelString = this.label.getString();
|
|
138
|
-
|
|
139
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's '${labelString}' label...`);
|
|
140
|
-
|
|
141
|
-
labelVerifies = this.label.verify();
|
|
142
|
-
|
|
143
|
-
if (labelVerifies) {
|
|
144
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's '${labelString}' label.`);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return labelVerifies;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
async verifyProof(context) {
|
|
151
|
-
let proofVerifies;
|
|
152
|
-
|
|
153
|
-
const topLevelMetaAssertionString = this.getString(); ///
|
|
154
|
-
|
|
155
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's proof...`);
|
|
156
|
-
|
|
157
|
-
const statement = this.deduction.getStatement();
|
|
158
|
-
|
|
159
|
-
proofVerifies = await this.proof.verify(statement, context);
|
|
160
|
-
|
|
161
|
-
if (proofVerifies) {
|
|
162
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's proof.`);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return proofVerifies;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
async verifyDeduction(context) {
|
|
169
|
-
let deductionVerifies;
|
|
170
|
-
|
|
171
|
-
const deductionString = this.deduction.getString(),
|
|
172
|
-
topLevelMetaAssertionString = this.getString(); ///
|
|
173
|
-
|
|
174
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta assertion's '${deductionString}' deduction...`);
|
|
175
|
-
|
|
176
|
-
deductionVerifies = await this.deduction.verify(context);
|
|
177
|
-
|
|
178
|
-
if (deductionVerifies) {
|
|
179
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta assertion's '${deductionString}' deduction.`);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return deductionVerifies;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
async verifySupposition(supposition, context) {
|
|
186
|
-
let suppositionVerifies;
|
|
187
|
-
|
|
188
|
-
const suppositionString = supposition.getString(),
|
|
189
|
-
topLevelMetaAssertionString = this.getString(); ///
|
|
190
|
-
|
|
191
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's '${suppositionString}' supposition...`);
|
|
192
|
-
|
|
193
|
-
suppositionVerifies = await supposition.verify(context)
|
|
194
|
-
|
|
195
|
-
if (suppositionVerifies) {
|
|
196
|
-
const subproofOrProofAssertion = supposition; ////
|
|
197
|
-
|
|
198
|
-
context.assignAssignments();
|
|
199
|
-
|
|
200
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (suppositionVerifies) {
|
|
204
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's '${suppositionString}' supposition.`);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return suppositionVerifies;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
async verifySuppositions(context) {
|
|
211
|
-
let suppositionsVerify;
|
|
212
|
-
|
|
213
|
-
const topLevelMetaAssertionString = this.getString(); ///
|
|
214
|
-
|
|
215
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's suppositions...`);
|
|
216
|
-
|
|
217
|
-
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
218
|
-
const suppositionVerifies = await this.verifySupposition(supposition, context);
|
|
219
|
-
|
|
220
|
-
if (suppositionVerifies) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
if (suppositionsVerify) {
|
|
226
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's suppositions.`);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return suppositionsVerify;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
toJSON() {
|
|
233
|
-
const labelJSON = labelToLabelJSON(this.label),
|
|
234
|
-
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
235
|
-
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
236
|
-
metaLevelAssumptionsJSON = metaLevelAssumptionsToMetaLevelAssumptionsJSON(this.metaLevelAssumptions),
|
|
237
|
-
string = this.getString();
|
|
238
|
-
|
|
239
|
-
let breakPoint;
|
|
240
|
-
|
|
241
|
-
breakPoint = this.getBreakPoint();
|
|
242
|
-
|
|
243
|
-
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
244
|
-
|
|
245
|
-
breakPoint = breakPointJSON; ///
|
|
246
|
-
|
|
247
|
-
const label = labelJSON, ///
|
|
248
|
-
deduction = deductionJSON, ///
|
|
249
|
-
suppositions = suppositionsJSON, ///
|
|
250
|
-
metaLevelAssumptions = metaLevelAssumptionsJSON, ///
|
|
251
|
-
json = {
|
|
252
|
-
string,
|
|
253
|
-
breakPoint,
|
|
254
|
-
label,
|
|
255
|
-
deduction,
|
|
256
|
-
suppositions,
|
|
257
|
-
metaLevelAssumptions
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
return json;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
static fromJSON(Class, json, context) {
|
|
264
|
-
const label = labelFromJSON(json, context),
|
|
265
|
-
deduction = deductionFromJSON(json, context),
|
|
266
|
-
suppositions = suppositionsFromJSON(json, context),
|
|
267
|
-
metaLevelAssumptions = metaLevelAssumptionsFromJSON(json, context),
|
|
268
|
-
string = topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction),
|
|
269
|
-
node = null,
|
|
270
|
-
breakPoint = breakPointFromJSON(json),
|
|
271
|
-
proof = null,
|
|
272
|
-
topLevelMetaAssertion = new Class(context, string, node, breakPoint, label, suppositions, deduction, proof, metaLevelAssumptions);
|
|
273
|
-
|
|
274
|
-
return topLevelMetaAssertion;
|
|
275
|
-
}
|
|
276
|
-
}
|
package/src/element/type.js
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Element } from "occam-languages";
|
|
4
|
-
import { arrayUtilities } from "necessary";
|
|
5
|
-
|
|
6
|
-
import { define } from "../elements";
|
|
7
|
-
import { instantiate } from "../utilities/context";
|
|
8
|
-
import { instantiateType } from "../process/instantiate";
|
|
9
|
-
import { nameFromTypeNode } from "../utilities/element";
|
|
10
|
-
import { baseTypeFromNothing } from "../utilities/type";
|
|
11
|
-
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
12
|
-
import { propertiesFromJSON,
|
|
13
|
-
prefixNameFromJSON,
|
|
14
|
-
superTypesFromJSON,
|
|
15
|
-
provisionalFromJSON,
|
|
16
|
-
prefixnameToPrevixNameJSON,
|
|
17
|
-
superTypesToSuperTypesJSON,
|
|
18
|
-
propertiesToPropertiesJSON,
|
|
19
|
-
provisionalToProvisionalJSON } from "../utilities/json";
|
|
20
|
-
|
|
21
|
-
const { push, first } = arrayUtilities;
|
|
22
|
-
|
|
23
|
-
export default define(class Type extends Element {
|
|
24
|
-
constructor(context, string, node, breakPoint, name, prefixName, superTypes, properties, provisional) {
|
|
25
|
-
super(context, string, node, breakPoint);
|
|
26
|
-
|
|
27
|
-
this.name = name;
|
|
28
|
-
this.prefixName = prefixName;
|
|
29
|
-
this.superTypes = superTypes;
|
|
30
|
-
this.properties = properties;
|
|
31
|
-
this.provisional = provisional;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
getName() {
|
|
35
|
-
return this.name;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
getPrefixName() {
|
|
39
|
-
return this.prefixName;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
getSuperTypes() {
|
|
43
|
-
return this.superTypes;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getTypeNode() {
|
|
47
|
-
const node = this.getNode(),
|
|
48
|
-
typeNode = node; ///
|
|
49
|
-
|
|
50
|
-
return typeNode;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
getProperties(includeSuperTypes = true) {
|
|
54
|
-
const properties = [];
|
|
55
|
-
|
|
56
|
-
push(properties, this.properties);
|
|
57
|
-
|
|
58
|
-
if (includeSuperTypes) {
|
|
59
|
-
this.superTypes.forEach((superType) => {
|
|
60
|
-
const superTypeProperties = superType.getProperties();
|
|
61
|
-
|
|
62
|
-
push(properties, superTypeProperties);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return properties;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
isProvisional(includeSuperTypes = true) {
|
|
70
|
-
let provisional = this.provisional;
|
|
71
|
-
|
|
72
|
-
if (includeSuperTypes) {
|
|
73
|
-
if (!provisional) {
|
|
74
|
-
provisional = this.superTypes.some((superType) => {
|
|
75
|
-
const superTypeProvisional = superType.isProvisional();
|
|
76
|
-
|
|
77
|
-
if (superTypeProvisional) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return provisional;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
setName(name) {
|
|
88
|
-
this.name = name;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
setPrefixName(prefixName) {
|
|
92
|
-
this.prefixName = prefixName;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
setSuperTypes(superTypes) {
|
|
96
|
-
this.superTypes = superTypes;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
setProperties(properties) {
|
|
100
|
-
this.properties = properties;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
setProvisional(provisional) {
|
|
104
|
-
this.provisional = provisional;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
isEstablished(includeSuperTypes = true) {
|
|
108
|
-
const provisional = this.isProvisional(includeSuperTypes),
|
|
109
|
-
established = !provisional;
|
|
110
|
-
|
|
111
|
-
return established;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
isPrefixed() {
|
|
115
|
-
const prefixed = (this.prefixName !== null);
|
|
116
|
-
|
|
117
|
-
return prefixed;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
getPrefixedName() {
|
|
121
|
-
let prefixedName = null;
|
|
122
|
-
|
|
123
|
-
const prefixed = this.isPrefixed();
|
|
124
|
-
|
|
125
|
-
if (prefixed) {
|
|
126
|
-
prefixedName = `${this.prefixName}${this.name}`;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return prefixedName;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
getNominalTypeName() {
|
|
133
|
-
const prefixed = this.isPrefixed(),
|
|
134
|
-
nominalTypeName = prefixed ?
|
|
135
|
-
`${this.prefixName}${this.name}` :
|
|
136
|
-
this.name;
|
|
137
|
-
|
|
138
|
-
return nominalTypeName;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
isBasic() {
|
|
142
|
-
let basic = false;
|
|
143
|
-
|
|
144
|
-
const superTypesLength = this.superTypes.length;
|
|
145
|
-
|
|
146
|
-
if (superTypesLength === 1) {
|
|
147
|
-
const firstSuperType = first(this.superTypes),
|
|
148
|
-
superType = firstSuperType, ///
|
|
149
|
-
baseType = baseTypeFromNothing();
|
|
150
|
-
|
|
151
|
-
if (superType === baseType) {
|
|
152
|
-
basic = true;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return basic;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
isRefined() {
|
|
160
|
-
let refined = false;
|
|
161
|
-
|
|
162
|
-
const superTypesLength = this.superTypes.length;
|
|
163
|
-
|
|
164
|
-
if (superTypesLength === 1) {
|
|
165
|
-
const firstSuperType = first(this.superTypes),
|
|
166
|
-
superType = firstSuperType, ///
|
|
167
|
-
superTypeName = superType.getName();
|
|
168
|
-
|
|
169
|
-
if (superTypeName === this.name) {
|
|
170
|
-
refined = true;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return refined;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
isEqualTo(type) {
|
|
178
|
-
const equalTo = (this === type);
|
|
179
|
-
|
|
180
|
-
return equalTo;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
isSubTypeOf(type) {
|
|
184
|
-
let subTypeOf;
|
|
185
|
-
|
|
186
|
-
const baseType = baseTypeFromNothing();
|
|
187
|
-
|
|
188
|
-
if (this === baseType) {
|
|
189
|
-
subTypeOf = false;
|
|
190
|
-
} else {
|
|
191
|
-
subTypeOf = this.superTypes.some((superType) => { ///
|
|
192
|
-
if (superType === type) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const superTypeSubTypeOfType = superType.isSubTypeOf(type);
|
|
197
|
-
|
|
198
|
-
if (superTypeSubTypeOfType) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
})
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return subTypeOf;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
isSuperTypeOf(type) {
|
|
208
|
-
const subTypeOf = type.isSubTypeOf(this),
|
|
209
|
-
superTypeOf = subTypeOf; ///
|
|
210
|
-
|
|
211
|
-
return superTypeOf;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
isEqualToOrSubTypeOf(type) {
|
|
215
|
-
const equalTo = this.isEqualTo(type),
|
|
216
|
-
subTypeOf = this.isSubTypeOf(type),
|
|
217
|
-
equalToOrSubTypeOf = (equalTo || subTypeOf);
|
|
218
|
-
|
|
219
|
-
return equalToOrSubTypeOf;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
isEqualToOrSuperTypeOf(type) {
|
|
223
|
-
const equalTo = this.isEqualTo(type),
|
|
224
|
-
superTypeOf = this.isSuperTypeOf(type),
|
|
225
|
-
equalToOrSuperTypeOf = (equalTo || superTypeOf);
|
|
226
|
-
|
|
227
|
-
return equalToOrSuperTypeOf;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
isEqualToSubTypeOrSuperTypeOf(type) {
|
|
231
|
-
const equalTo = this.isEqualTo(type),
|
|
232
|
-
subTypeOf = this.isSubTypeOf(type),
|
|
233
|
-
superTypeOf = this.isSuperTypeOf(type),
|
|
234
|
-
equalToSubTypeOrSuperTypeOf = (equalTo || subTypeOf || superTypeOf);
|
|
235
|
-
|
|
236
|
-
return equalToSubTypeOrSuperTypeOf;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
compareTypeName(typeName) {
|
|
240
|
-
const nameTypeName = (this.name === typeName),
|
|
241
|
-
comparesToTypeName = nameTypeName; ///
|
|
242
|
-
|
|
243
|
-
return comparesToTypeName;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
compareProvisional(provisional, includeSupertypes = true) {
|
|
247
|
-
let comparesToProvisional;
|
|
248
|
-
|
|
249
|
-
const provisionalA = provisional; ///
|
|
250
|
-
|
|
251
|
-
provisional = this.isProvisional(includeSupertypes);
|
|
252
|
-
|
|
253
|
-
const provisionalB = provisional; ///
|
|
254
|
-
|
|
255
|
-
comparesToProvisional = (provisionalA === provisionalB);
|
|
256
|
-
|
|
257
|
-
return comparesToProvisional;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
compareNominalTypeName(nominalTypeName) {
|
|
261
|
-
let comparesToNominalTypeName = false;
|
|
262
|
-
|
|
263
|
-
const nameNominalTypeName = (this.name === nominalTypeName);
|
|
264
|
-
|
|
265
|
-
if (nameNominalTypeName) {
|
|
266
|
-
comparesToNominalTypeName = true;
|
|
267
|
-
} else {
|
|
268
|
-
const prefixed = this.isPrefixed();
|
|
269
|
-
|
|
270
|
-
if (prefixed) {
|
|
271
|
-
const prefixedName = this.getPrefixedName(),
|
|
272
|
-
prefixedNameNominalTypeName = (prefixedName === nominalTypeName);
|
|
273
|
-
|
|
274
|
-
if (prefixedNameNominalTypeName) {
|
|
275
|
-
comparesToNominalTypeName = true;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return comparesToNominalTypeName;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
comparePrefixedTypeName(prefixedTypeName) {
|
|
284
|
-
let comparesToPrefixedTypeName = false;
|
|
285
|
-
|
|
286
|
-
const prefixed = this.isPrefixed();
|
|
287
|
-
|
|
288
|
-
if (prefixed) {
|
|
289
|
-
const prefixedName = this.getPrefixedName(),
|
|
290
|
-
prefixedTypeNamePrefixedName = (prefixedTypeName === prefixedName);
|
|
291
|
-
|
|
292
|
-
if (prefixedTypeNamePrefixedName) {
|
|
293
|
-
comparesToPrefixedTypeName = true;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return comparesToPrefixedTypeName;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
toJSON(abridged = false) {
|
|
301
|
-
const string = this.getString();
|
|
302
|
-
|
|
303
|
-
let breakPoint;
|
|
304
|
-
|
|
305
|
-
breakPoint = this.getBreakPoint();
|
|
306
|
-
|
|
307
|
-
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
308
|
-
|
|
309
|
-
breakPoint = breakPointJSON; ///
|
|
310
|
-
|
|
311
|
-
const json = {
|
|
312
|
-
string,
|
|
313
|
-
breakPoint
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
if (!abridged) {
|
|
317
|
-
const prefixNameJSON = prefixnameToPrevixNameJSON(this.prefixName),
|
|
318
|
-
superTypesJSON = superTypesToSuperTypesJSON(this.superTypes),
|
|
319
|
-
propertiesJSON = propertiesToPropertiesJSON(this.properties),
|
|
320
|
-
provisinoalJSOM = provisionalToProvisionalJSON(this.provisional),
|
|
321
|
-
prefixName = prefixNameJSON, ///
|
|
322
|
-
superTypes = superTypesJSON, ///
|
|
323
|
-
properties = propertiesJSON, ///
|
|
324
|
-
provisional = provisinoalJSOM; ///
|
|
325
|
-
|
|
326
|
-
Object.assign(json, {
|
|
327
|
-
prefixName,
|
|
328
|
-
superTypes,
|
|
329
|
-
properties,
|
|
330
|
-
provisional
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return json;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
static name = "Type";
|
|
338
|
-
|
|
339
|
-
static fromJSON(json, context) {
|
|
340
|
-
return instantiate((context) => {
|
|
341
|
-
const { string } = json,
|
|
342
|
-
typeNode = instantiateType(string, context),
|
|
343
|
-
node = typeNode, ///
|
|
344
|
-
breakPoint = breakPointFromJSON(json),
|
|
345
|
-
name = nameFromTypeNode(typeNode, context),
|
|
346
|
-
prefixName = prefixNameFromJSON(json, context),
|
|
347
|
-
superTypes = superTypesFromJSON(json, context),
|
|
348
|
-
properties = propertiesFromJSON(json, context),
|
|
349
|
-
provisional = provisionalFromJSON(json);
|
|
350
|
-
|
|
351
|
-
context = null; ///
|
|
352
|
-
|
|
353
|
-
const type = new Type(context, string, node, breakPoint, name, prefixName, superTypes, properties, provisional);
|
|
354
|
-
|
|
355
|
-
return type;
|
|
356
|
-
}, context);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
static fromName(name, context) {
|
|
360
|
-
const string = name, ///
|
|
361
|
-
node = null,
|
|
362
|
-
breakPoint = null,
|
|
363
|
-
prefixName = null,
|
|
364
|
-
superTypes = [],
|
|
365
|
-
properties = [],
|
|
366
|
-
provisional = false;
|
|
367
|
-
|
|
368
|
-
context = null;
|
|
369
|
-
|
|
370
|
-
const type = new Type(context, string, node, breakPoint, name, prefixName, superTypes, properties, provisional);
|
|
371
|
-
|
|
372
|
-
return type;
|
|
373
|
-
}
|
|
374
|
-
});
|