occam-verify-cli 1.0.983 → 1.0.985
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/action/verify.js +22 -27
- package/lib/constants.js +1 -41
- package/lib/index.js +1 -2
- package/lib/utilities/fileContext.js +3 -8
- package/lib/utilities/releaseContext.js +2 -2
- package/package.json +10 -11
- package/src/action/verify.js +8 -18
- package/src/constants.js +0 -10
- package/src/index.js +0 -2
- package/src/utilities/fileContext.js +1 -2
- package/src/utilities/releaseContext.js +1 -1
- package/lib/context/aphasic.js +0 -27
- package/lib/context/bounded.js +0 -244
- package/lib/context/branching.js +0 -61
- package/lib/context/file/nominal.js +0 -586
- package/lib/context/illative.js +0 -28
- package/lib/context/liminal.js +0 -200
- package/lib/context/literal.js +0 -44
- package/lib/context/mnemic.js +0 -454
- package/lib/context/nested.js +0 -31
- package/lib/context/nominal.js +0 -57
- package/lib/context/phaneric.js +0 -44
- package/lib/context/thetic.js +0 -28
- package/lib/context.js +0 -445
- package/lib/element/assertion/contained.js +0 -218
- package/lib/element/assertion/defined.js +0 -213
- package/lib/element/assertion/property.js +0 -176
- package/lib/element/assertion/signature.js +0 -170
- package/lib/element/assertion/subproof.js +0 -220
- package/lib/element/assertion/type.js +0 -227
- package/lib/element/assertion.js +0 -49
- package/lib/element/assumption/metaLevel.js +0 -244
- package/lib/element/assumption.js +0 -252
- package/lib/element/combinator/bracketed.js +0 -36
- package/lib/element/combinator.js +0 -104
- package/lib/element/conclusion.js +0 -131
- package/lib/element/constructor/bracketed.js +0 -57
- package/lib/element/constructor.js +0 -129
- package/lib/element/declaration/combinator.js +0 -58
- package/lib/element/declaration/complexType.js +0 -180
- package/lib/element/declaration/constructor.js +0 -93
- package/lib/element/declaration/metavariable.js +0 -77
- package/lib/element/declaration/property.js +0 -88
- package/lib/element/declaration/simpleType.js +0 -148
- package/lib/element/declaration/typePrefix.js +0 -53
- package/lib/element/declaration/variable.js +0 -99
- package/lib/element/declaration.js +0 -15
- package/lib/element/deduction.js +0 -131
- package/lib/element/derivation.js +0 -46
- package/lib/element/equality.js +0 -211
- package/lib/element/equivalence.js +0 -200
- package/lib/element/error.js +0 -27
- package/lib/element/frame.js +0 -238
- package/lib/element/hypothesis.js +0 -135
- package/lib/element/judgement.js +0 -212
- package/lib/element/label.js +0 -135
- package/lib/element/metaType.js +0 -57
- package/lib/element/metavariable.js +0 -452
- package/lib/element/parameter.js +0 -69
- package/lib/element/procedureCall.js +0 -116
- package/lib/element/procedureReference.js +0 -56
- package/lib/element/proof.js +0 -52
- package/lib/element/proofAssertion/premise.js +0 -238
- package/lib/element/proofAssertion/step.js +0 -235
- package/lib/element/proofAssertion/supposition.js +0 -249
- package/lib/element/proofAssertion.js +0 -56
- package/lib/element/property.js +0 -176
- package/lib/element/propertyRelation.js +0 -132
- package/lib/element/reference.js +0 -227
- package/lib/element/rule.js +0 -242
- package/lib/element/section.js +0 -64
- package/lib/element/signature.js +0 -195
- package/lib/element/statement.js +0 -228
- package/lib/element/subDerivation.js +0 -46
- package/lib/element/subproof.js +0 -91
- package/lib/element/substitution/frame.js +0 -256
- package/lib/element/substitution/reference.js +0 -192
- package/lib/element/substitution/statement.js +0 -294
- package/lib/element/substitution/term.js +0 -266
- package/lib/element/substitution.js +0 -183
- package/lib/element/term.js +0 -217
- package/lib/element/topLevelAssertion/axiom.js +0 -158
- package/lib/element/topLevelAssertion/conjecture.js +0 -42
- package/lib/element/topLevelAssertion/lemma.js +0 -39
- package/lib/element/topLevelAssertion/theorem.js +0 -42
- package/lib/element/topLevelAssertion.js +0 -286
- package/lib/element/topLevelMetaAssertion/metaLemma.js +0 -42
- package/lib/element/topLevelMetaAssertion/metatheorem.js +0 -42
- package/lib/element/topLevelMetaAssertion.js +0 -179
- package/lib/element/type.js +0 -240
- package/lib/element/typePrefix.js +0 -85
- package/lib/element/variable.js +0 -206
- package/lib/elements.js +0 -27
- package/lib/metaTypeNames.js +0 -26
- package/lib/metaTypes.js +0 -66
- package/lib/node/argument.js +0 -31
- package/lib/node/assertion/contained.js +0 -51
- package/lib/node/assertion/defined.js +0 -47
- package/lib/node/assertion/property.js +0 -36
- package/lib/node/assertion/signature.js +0 -32
- package/lib/node/assertion/subproof.js +0 -28
- package/lib/node/assertion/type.js +0 -32
- package/lib/node/assertion.js +0 -18
- package/lib/node/assumption/metaLevel.js +0 -27
- package/lib/node/assumption.js +0 -27
- package/lib/node/body/axiom.js +0 -23
- package/lib/node/body/conjecture.js +0 -23
- package/lib/node/body/lemma.js +0 -23
- package/lib/node/body/metaLemma.js +0 -23
- package/lib/node/body/metatheorem.js +0 -23
- package/lib/node/body/rule.js +0 -44
- package/lib/node/body/theorem.js +0 -23
- package/lib/node/body.js +0 -31
- package/lib/node/combinator.js +0 -23
- package/lib/node/conclusion.js +0 -27
- package/lib/node/constructor.js +0 -23
- package/lib/node/declaration/combinator.js +0 -28
- package/lib/node/declaration/complexType.js +0 -72
- package/lib/node/declaration/constructor.js +0 -47
- package/lib/node/declaration/metavariable.js +0 -36
- package/lib/node/declaration/property.js +0 -44
- package/lib/node/declaration/simpleType.js +0 -72
- package/lib/node/declaration/typePrefix.js +0 -32
- package/lib/node/declaration/variable.js +0 -51
- package/lib/node/declaration.js +0 -18
- package/lib/node/deduction.js +0 -27
- package/lib/node/derivation.js +0 -26
- package/lib/node/document.js +0 -18
- package/lib/node/equality.js +0 -33
- package/lib/node/equivalence.js +0 -23
- package/lib/node/equivalences.js +0 -18
- package/lib/node/error.js +0 -18
- package/lib/node/frame.js +0 -38
- package/lib/node/header/axiom.js +0 -28
- package/lib/node/header/conjecture.js +0 -23
- package/lib/node/header/lemma.js +0 -23
- package/lib/node/header/metaLemma.js +0 -23
- package/lib/node/header/metatheorem.js +0 -23
- package/lib/node/header/rule.js +0 -23
- package/lib/node/header/theorem.js +0 -23
- package/lib/node/header.js +0 -47
- package/lib/node/hypothesis.js +0 -27
- package/lib/node/judgement.js +0 -31
- package/lib/node/label.js +0 -23
- package/lib/node/labels.js +0 -23
- package/lib/node/metaArgument.js +0 -23
- package/lib/node/metaType.js +0 -30
- package/lib/node/metavariable.js +0 -39
- package/lib/node/parameter.js +0 -47
- package/lib/node/parenthesisedLabel.js +0 -23
- package/lib/node/parenthesisedLabels.js +0 -27
- package/lib/node/placeholder.js +0 -18
- package/lib/node/procedureCall.js +0 -31
- package/lib/node/procedureReference.js +0 -30
- package/lib/node/proof.js +0 -23
- package/lib/node/proofAssertion/premise.js +0 -28
- package/lib/node/proofAssertion/step.js +0 -52
- package/lib/node/proofAssertion/supposition.js +0 -28
- package/lib/node/proofAssertion.js +0 -27
- package/lib/node/property.js +0 -30
- package/lib/node/propertyRelation.js +0 -31
- package/lib/node/qualification.js +0 -27
- package/lib/node/reference.js +0 -23
- package/lib/node/rule.js +0 -43
- package/lib/node/section.js +0 -39
- package/lib/node/signature.js +0 -23
- package/lib/node/statement.js +0 -103
- package/lib/node/subDerivation.js +0 -26
- package/lib/node/subproof.js +0 -35
- package/lib/node/substitution/frame.js +0 -40
- package/lib/node/substitution/reference.js +0 -40
- package/lib/node/substitution/statement.js +0 -60
- package/lib/node/substitution/term.js +0 -40
- package/lib/node/substitution.js +0 -18
- package/lib/node/term.js +0 -60
- package/lib/node/topLevelAssertion/axiom.js +0 -26
- package/lib/node/topLevelAssertion/conjecture.js +0 -26
- package/lib/node/topLevelAssertion/lemma.js +0 -26
- package/lib/node/topLevelAssertion/theorem.js +0 -26
- package/lib/node/topLevelAssertion.js +0 -46
- package/lib/node/topLevelMetaAssertion/metaLemma.js +0 -26
- package/lib/node/topLevelMetaAssertion/metatheorem.js +0 -26
- package/lib/node/topLevelMetaAssertion.js +0 -42
- package/lib/node/type.js +0 -60
- package/lib/node/typePrefix.js +0 -30
- package/lib/node/types.js +0 -23
- package/lib/node/variable.js +0 -30
- package/lib/nominal/lexer.js +0 -15
- package/lib/nominal/parser.js +0 -24
- package/lib/nonTerminalNodeMap.js +0 -189
- package/lib/pass/zip.js +0 -23
- package/lib/preamble.js +0 -73
- package/lib/process/assign.js +0 -62
- package/lib/process/discharge.js +0 -38
- package/lib/process/equate.js +0 -73
- package/lib/process/instantiate.js +0 -261
- package/lib/process/unification.js +0 -228
- package/lib/process/unify.js +0 -336
- package/lib/process/validate.js +0 -135
- package/lib/process/validation.js +0 -291
- package/lib/process/verify.js +0 -205
- package/lib/ruleNames.js +0 -350
- package/lib/tokenTypes.js +0 -22
- package/lib/utilities/assignment.js +0 -47
- package/lib/utilities/bnf.js +0 -21
- package/lib/utilities/brackets.js +0 -77
- package/lib/utilities/breakPoint.js +0 -38
- package/lib/utilities/context.js +0 -220
- package/lib/utilities/element.js +0 -1851
- package/lib/utilities/equivalence.js +0 -27
- package/lib/utilities/equivalences.js +0 -134
- package/lib/utilities/instance.js +0 -44
- package/lib/utilities/json.js +0 -1109
- package/lib/utilities/string.js +0 -231
- package/lib/utilities/substitutions.js +0 -86
- package/lib/utilities/synoptic.js +0 -159
- package/lib/utilities/type.js +0 -27
- package/src/context/aphasic.js +0 -15
- package/src/context/bounded.js +0 -362
- package/src/context/branching.js +0 -69
- package/src/context/file/nominal.js +0 -955
- package/src/context/illative.js +0 -17
- package/src/context/liminal.js +0 -280
- package/src/context/literal.js +0 -42
- package/src/context/mnemic.js +0 -778
- package/src/context/nested.js +0 -21
- package/src/context/nominal.js +0 -62
- package/src/context/phaneric.js +0 -43
- package/src/context/thetic.js +0 -17
- package/src/context.js +0 -722
- package/src/element/assertion/contained.js +0 -313
- package/src/element/assertion/defined.js +0 -310
- package/src/element/assertion/property.js +0 -252
- package/src/element/assertion/signature.js +0 -239
- package/src/element/assertion/subproof.js +0 -335
- package/src/element/assertion/type.js +0 -328
- package/src/element/assertion.js +0 -65
- package/src/element/assumption/metaLevel.js +0 -373
- package/src/element/assumption.js +0 -374
- package/src/element/combinator/bracketed.js +0 -32
- package/src/element/combinator.js +0 -145
- package/src/element/conclusion.js +0 -185
- package/src/element/constructor/bracketed.js +0 -68
- package/src/element/constructor.js +0 -188
- package/src/element/declaration/combinator.js +0 -66
- package/src/element/declaration/complexType.js +0 -257
- package/src/element/declaration/constructor.js +0 -122
- package/src/element/declaration/metavariable.js +0 -93
- package/src/element/declaration/property.js +0 -108
- package/src/element/declaration/simpleType.js +0 -208
- package/src/element/declaration/typePrefix.js +0 -58
- package/src/element/declaration/variable.js +0 -130
- package/src/element/declaration.js +0 -7
- package/src/element/deduction.js +0 -185
- package/src/element/derivation.js +0 -57
- package/src/element/equality.js +0 -325
- package/src/element/equivalence.js +0 -276
- package/src/element/error.js +0 -26
- package/src/element/frame.js +0 -356
- package/src/element/hypothesis.js +0 -186
- package/src/element/judgement.js +0 -303
- package/src/element/label.js +0 -186
- package/src/element/metaType.js +0 -75
- package/src/element/metavariable.js +0 -662
- package/src/element/parameter.js +0 -90
- package/src/element/procedureCall.js +0 -159
- package/src/element/procedureReference.js +0 -71
- package/src/element/proof.js +0 -61
- package/src/element/proofAssertion/premise.js +0 -354
- package/src/element/proofAssertion/step.js +0 -271
- package/src/element/proofAssertion/supposition.js +0 -377
- package/src/element/proofAssertion.js +0 -74
- package/src/element/property.js +0 -258
- package/src/element/propertyRelation.js +0 -193
- package/src/element/reference.js +0 -345
- package/src/element/rule.js +0 -358
- package/src/element/section.js +0 -78
- package/src/element/signature.js +0 -292
- package/src/element/statement.js +0 -358
- package/src/element/subDerivation.js +0 -56
- package/src/element/subproof.js +0 -116
- package/src/element/substitution/frame.js +0 -392
- package/src/element/substitution/reference.js +0 -274
- package/src/element/substitution/statement.js +0 -452
- package/src/element/substitution/term.js +0 -407
- package/src/element/substitution.js +0 -261
- package/src/element/term.js +0 -339
- package/src/element/topLevelAssertion/axiom.js +0 -244
- package/src/element/topLevelAssertion/conjecture.js +0 -40
- package/src/element/topLevelAssertion/lemma.js +0 -42
- package/src/element/topLevelAssertion/theorem.js +0 -40
- package/src/element/topLevelAssertion.js +0 -436
- package/src/element/topLevelMetaAssertion/metaLemma.js +0 -40
- package/src/element/topLevelMetaAssertion/metatheorem.js +0 -40
- package/src/element/topLevelMetaAssertion.js +0 -276
- package/src/element/type.js +0 -374
- package/src/element/typePrefix.js +0 -113
- package/src/element/variable.js +0 -259
- package/src/elements.js +0 -13
- package/src/metaTypeNames.js +0 -5
- package/src/metaTypes.js +0 -71
- package/src/node/argument.js +0 -30
- package/src/node/assertion/contained.js +0 -53
- package/src/node/assertion/defined.js +0 -46
- package/src/node/assertion/property.js +0 -30
- package/src/node/assertion/signature.js +0 -23
- package/src/node/assertion/subproof.js +0 -16
- package/src/node/assertion/type.js +0 -23
- package/src/node/assertion.js +0 -7
- package/src/node/assumption/metaLevel.js +0 -23
- package/src/node/assumption.js +0 -23
- package/src/node/body/axiom.js +0 -7
- package/src/node/body/conjecture.js +0 -7
- package/src/node/body/lemma.js +0 -7
- package/src/node/body/metaLemma.js +0 -7
- package/src/node/body/metatheorem.js +0 -7
- package/src/node/body/rule.js +0 -42
- package/src/node/body/theorem.js +0 -7
- package/src/node/body.js +0 -30
- package/src/node/combinator.js +0 -16
- package/src/node/conclusion.js +0 -23
- package/src/node/constructor.js +0 -16
- package/src/node/declaration/combinator.js +0 -16
- package/src/node/declaration/complexType.js +0 -88
- package/src/node/declaration/constructor.js +0 -46
- package/src/node/declaration/metavariable.js +0 -30
- package/src/node/declaration/property.js +0 -42
- package/src/node/declaration/simpleType.js +0 -87
- package/src/node/declaration/typePrefix.js +0 -24
- package/src/node/declaration/variable.js +0 -53
- package/src/node/declaration.js +0 -7
- package/src/node/deduction.js +0 -23
- package/src/node/derivation.js +0 -19
- package/src/node/document.js +0 -7
- package/src/node/equality.js +0 -35
- package/src/node/equivalence.js +0 -16
- package/src/node/equivalences.js +0 -7
- package/src/node/error.js +0 -7
- package/src/node/frame.js +0 -40
- package/src/node/header/axiom.js +0 -16
- package/src/node/header/conjecture.js +0 -7
- package/src/node/header/lemma.js +0 -7
- package/src/node/header/metaLemma.js +0 -7
- package/src/node/header/metatheorem.js +0 -7
- package/src/node/header/rule.js +0 -7
- package/src/node/header/theorem.js +0 -7
- package/src/node/header.js +0 -54
- package/src/node/hypothesis.js +0 -23
- package/src/node/judgement.js +0 -30
- package/src/node/label.js +0 -16
- package/src/node/labels.js +0 -16
- package/src/node/metaArgument.js +0 -16
- package/src/node/metaType.js +0 -26
- package/src/node/metavariable.js +0 -42
- package/src/node/parameter.js +0 -51
- package/src/node/parenthesisedLabel.js +0 -16
- package/src/node/parenthesisedLabels.js +0 -23
- package/src/node/placeholder.js +0 -7
- package/src/node/procedureCall.js +0 -30
- package/src/node/procedureReference.js +0 -26
- package/src/node/proof.js +0 -16
- package/src/node/proofAssertion/premise.js +0 -16
- package/src/node/proofAssertion/step.js +0 -52
- package/src/node/proofAssertion/supposition.js +0 -16
- package/src/node/proofAssertion.js +0 -23
- package/src/node/property.js +0 -28
- package/src/node/propertyRelation.js +0 -30
- package/src/node/qualification.js +0 -23
- package/src/node/reference.js +0 -16
- package/src/node/rule.js +0 -51
- package/src/node/section.js +0 -44
- package/src/node/signature.js +0 -16
- package/src/node/statement.js +0 -167
- package/src/node/subDerivation.js +0 -19
- package/src/node/subproof.js +0 -35
- package/src/node/substitution/frame.js +0 -37
- package/src/node/substitution/reference.js +0 -38
- package/src/node/substitution/statement.js +0 -70
- package/src/node/substitution/term.js +0 -38
- package/src/node/substitution.js +0 -7
- package/src/node/term.js +0 -75
- package/src/node/topLevelAssertion/axiom.js +0 -13
- package/src/node/topLevelAssertion/conjecture.js +0 -13
- package/src/node/topLevelAssertion/lemma.js +0 -13
- package/src/node/topLevelAssertion/theorem.js +0 -13
- package/src/node/topLevelAssertion.js +0 -58
- package/src/node/topLevelMetaAssertion/metaLemma.js +0 -13
- package/src/node/topLevelMetaAssertion/metatheorem.js +0 -13
- package/src/node/topLevelMetaAssertion.js +0 -51
- package/src/node/type.js +0 -74
- package/src/node/typePrefix.js +0 -26
- package/src/node/types.js +0 -16
- package/src/node/variable.js +0 -26
- package/src/nominal/lexer.js +0 -5
- package/src/nominal/parser.js +0 -12
- package/src/nonTerminalNodeMap.js +0 -261
- package/src/pass/zip.js +0 -19
- package/src/preamble.js +0 -64
- package/src/process/assign.js +0 -53
- package/src/process/discharge.js +0 -33
- package/src/process/equate.js +0 -94
- package/src/process/instantiate.js +0 -198
- package/src/process/unification.js +0 -332
- package/src/process/unify.js +0 -504
- package/src/process/validate.js +0 -174
- package/src/process/validation.js +0 -410
- package/src/process/verify.js +0 -299
- package/src/ruleNames.js +0 -86
- package/src/tokenTypes.js +0 -4
- package/src/utilities/assignment.js +0 -57
- package/src/utilities/bnf.js +0 -20
- package/src/utilities/brackets.js +0 -87
- package/src/utilities/breakPoint.js +0 -29
- package/src/utilities/context.js +0 -223
- package/src/utilities/element.js +0 -2293
- package/src/utilities/equivalence.js +0 -25
- package/src/utilities/equivalences.js +0 -158
- package/src/utilities/instance.js +0 -40
- package/src/utilities/json.js +0 -1273
- package/src/utilities/string.js +0 -282
- package/src/utilities/substitutions.js +0 -93
- package/src/utilities/synoptic.js +0 -135
- package/src/utilities/type.js +0 -19
package/src/utilities/string.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { baseTypeFromNothing } from "../utilities/type";
|
|
4
|
-
import { EMPTY_STRING, PROVISIONAL, PROVISIONALLY } from "../constants";
|
|
5
|
-
|
|
6
|
-
export function termsStringFromTerms(terms) {
|
|
7
|
-
const termsString = terms.reduce((termsString, term) => {
|
|
8
|
-
const termString = term.getString();
|
|
9
|
-
|
|
10
|
-
termsString = (termsString !== null) ?
|
|
11
|
-
`${termsString}, ${termString}` :
|
|
12
|
-
termString;
|
|
13
|
-
|
|
14
|
-
return termsString;
|
|
15
|
-
}, null);
|
|
16
|
-
|
|
17
|
-
return termsString;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function labelsStringFromLabels(labels) {
|
|
21
|
-
const labelsString = labels.reduce((labelsString, label) => {
|
|
22
|
-
const labelString = label.getString();
|
|
23
|
-
|
|
24
|
-
labelsString = (labelsString === null) ?
|
|
25
|
-
labelString: ///
|
|
26
|
-
`${labelsString}, ${labelString}`;
|
|
27
|
-
|
|
28
|
-
return labelsString;
|
|
29
|
-
}, null);
|
|
30
|
-
|
|
31
|
-
return labelsString;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function premisesStringFromPremises(premises) {
|
|
35
|
-
const premisesString = premises.reduce((premisesString, premise) => {
|
|
36
|
-
const premiseString = premise.getString();
|
|
37
|
-
|
|
38
|
-
premisesString = (premisesString !== null) ?
|
|
39
|
-
`${premisesString}, ${premiseString}` :
|
|
40
|
-
premiseString; ///
|
|
41
|
-
|
|
42
|
-
return premisesString;
|
|
43
|
-
}, null);
|
|
44
|
-
|
|
45
|
-
return premisesString;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function hypothesesStringFromHypotheses(hypotheses) {
|
|
49
|
-
const hypothesesString = hypotheses.reduce((hypothesesString, hypothesis) => {
|
|
50
|
-
const hypothesisString = hypothesis.getString();
|
|
51
|
-
|
|
52
|
-
hypothesesString = (hypothesesString !== null) ?
|
|
53
|
-
`${hypothesesString}, ${hypothesisString}` :
|
|
54
|
-
hypothesisString; ///
|
|
55
|
-
|
|
56
|
-
return hypothesesString;
|
|
57
|
-
}, null);
|
|
58
|
-
|
|
59
|
-
return hypothesesString;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function superTypesStringFromSuperTypes(superTypes) {
|
|
63
|
-
let superTypesString;
|
|
64
|
-
|
|
65
|
-
const baseType = baseTypeFromNothing();
|
|
66
|
-
|
|
67
|
-
superTypesString = superTypes.reduce((superTypesString, superType) => {
|
|
68
|
-
if (superType !== baseType) {
|
|
69
|
-
const superTypeString = superType.getString();
|
|
70
|
-
|
|
71
|
-
superTypesString = (superTypesString === null) ?
|
|
72
|
-
`'${superTypeString}'` :
|
|
73
|
-
`${superTypesString}, '${superTypeString}'`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return superTypesString;
|
|
77
|
-
}, null);
|
|
78
|
-
|
|
79
|
-
superTypesString = (superTypesString !== null) ?
|
|
80
|
-
`:${superTypesString}` :
|
|
81
|
-
EMPTY_STRING;
|
|
82
|
-
|
|
83
|
-
return superTypesString;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function parametersStringFromParameters(parameters) {
|
|
87
|
-
const parametersString = parameters.reduce((parametersString, parameter) => {
|
|
88
|
-
const parameterString = parameter.getString();
|
|
89
|
-
|
|
90
|
-
parametersString = (parametersString === null) ?
|
|
91
|
-
parameterString : ///
|
|
92
|
-
`${parametersString}, ${parameterString}`;
|
|
93
|
-
|
|
94
|
-
return parametersString;
|
|
95
|
-
}, null);
|
|
96
|
-
|
|
97
|
-
return parametersString;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function provisinalStringFromProvisional(provisional) {
|
|
101
|
-
const provisinalString = provisional ?
|
|
102
|
-
`${PROVISIONAL} ` :
|
|
103
|
-
EMPTY_STRING;
|
|
104
|
-
|
|
105
|
-
return provisinalString;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function provisionallyStringFromProvisional(provisional) {
|
|
109
|
-
const provisinallyString = provisional ?
|
|
110
|
-
` ${PROVISIONALLY}` :
|
|
111
|
-
EMPTY_STRING;
|
|
112
|
-
|
|
113
|
-
return provisinallyString;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function suppositionsStringFromSuppositions(suppositions) {
|
|
117
|
-
const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
|
|
118
|
-
const suppositionString = supposition.getString();
|
|
119
|
-
|
|
120
|
-
suppositionsString = (suppositionsString === null) ?
|
|
121
|
-
suppositionString: ///
|
|
122
|
-
`${suppositionsString}, ${suppositionString}`;
|
|
123
|
-
|
|
124
|
-
return suppositionsString;
|
|
125
|
-
}, null);
|
|
126
|
-
|
|
127
|
-
return suppositionsString;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function equivalenceStringFromTerms(terms) {
|
|
131
|
-
const termsString = termsStringFromTerms(terms),
|
|
132
|
-
equivalenceString = `[${termsString}]`;
|
|
133
|
-
|
|
134
|
-
return equivalenceString;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function signatureStringFromSignature(signature) {
|
|
138
|
-
const signatureString = (signature !== null) ?
|
|
139
|
-
signature.getString() :
|
|
140
|
-
null;
|
|
141
|
-
|
|
142
|
-
return signatureString;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function typeStringFromNominalTypeName(nominalTypeName) {
|
|
146
|
-
const typeString = nominalTypeName; ///
|
|
147
|
-
|
|
148
|
-
return typeString;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function termSubstitutionStringFromTermAndVariable(term, variable) {
|
|
152
|
-
const termString = term.getString(),
|
|
153
|
-
variableString = variable.getString(),
|
|
154
|
-
termSubstitutionString = `[${termString} for ${variableString}]`;
|
|
155
|
-
|
|
156
|
-
return termSubstitutionString;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function rulsStringFromLabelsPremisesAndConclusion(labels, premises, conclusion) {
|
|
160
|
-
let ruleString = EMPTY_STRING;
|
|
161
|
-
|
|
162
|
-
const conclusionString = conclusion.getString(),
|
|
163
|
-
premisesString = premisesStringFromPremises(premises),
|
|
164
|
-
labelsString = labelsStringFromLabels(labels);
|
|
165
|
-
|
|
166
|
-
ruleString = `${ruleString}${labelsString} :: `;
|
|
167
|
-
|
|
168
|
-
ruleString = (premisesString !== null) ?
|
|
169
|
-
`${ruleString}[${premisesString}]...${conclusionString}` :
|
|
170
|
-
`${ruleString}${conclusionString}`;
|
|
171
|
-
|
|
172
|
-
return ruleString;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function subproofStringFromSuppositionsAndSubDerivation(suppositions, subDerivation) {
|
|
176
|
-
const lastStep = subDerivation.getLastStep(),
|
|
177
|
-
suppositionsString = suppositionsStringFromSuppositions(suppositions),
|
|
178
|
-
lastStepString = lastStep.getString(),
|
|
179
|
-
subproofString = `[${suppositionsString}]...${lastStepString}`;
|
|
180
|
-
|
|
181
|
-
return subproofString;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export function frameSubstitutionStringFromFrameAndMetavariable(frame, metavariable) {
|
|
185
|
-
const frameString = frame.getString(),
|
|
186
|
-
metavariableString = metavariable.getString(),
|
|
187
|
-
string = `[${frameString} for [${metavariableString}]]`;
|
|
188
|
-
|
|
189
|
-
return string;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function sectionStringFromHypothesesAndTopLevelAssertion(hypotheses, topLevelAssertion) {
|
|
193
|
-
const topLevelAssertionString = topLevelAssertion.getString(),
|
|
194
|
-
hypothesesString = hypothesesStringFromHypotheses(hypotheses),
|
|
195
|
-
sectionString = `[${hypothesesString}]::: ${topLevelAssertionString}`;
|
|
196
|
-
|
|
197
|
-
return sectionString;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export function metaLevelAssumptionStringFromReferenceAndStatement(reference, statement) {
|
|
201
|
-
const statementString = statement.getString(),
|
|
202
|
-
referneceString = reference.getString(),
|
|
203
|
-
metaLevelAssumptionString = `${referneceString} :: ${statementString}`;
|
|
204
|
-
|
|
205
|
-
return metaLevelAssumptionString;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function procedureCallStringFromProcedureReferenceAndParameters(procedureReference, parameters) {
|
|
209
|
-
const procedureReferenceName = procedureReference.getName(),
|
|
210
|
-
parametersString = parametersStringFromParameters(parameters),
|
|
211
|
-
procedureCallString = `@${procedureReferenceName}(${parametersString})`;
|
|
212
|
-
|
|
213
|
-
return procedureCallString;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export function statementSubstitutionStringFromStatementAndMetavariable(statement, metavariable) {
|
|
217
|
-
const statementString = statement.getString(),
|
|
218
|
-
metavariableString = metavariable.getString(),
|
|
219
|
-
statementSubstitutionString = `[${statementString} for ${metavariableString}]`;
|
|
220
|
-
|
|
221
|
-
return statementSubstitutionString;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export function referenceSubstitutionStringFromReferenceAndMetavariable(reference, metavariable) {
|
|
225
|
-
const referenceString = reference.getString(),
|
|
226
|
-
metavariableString = metavariable.getString(),
|
|
227
|
-
referenceSubstitutionString = `[${referenceString} for ${metavariableString}]`;
|
|
228
|
-
|
|
229
|
-
return referenceSubstitutionString;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function complexTypeDeclarationStringFromTypeSuperTypesAndProvisional(type, superTypes, provisional) {
|
|
233
|
-
const typeString = type.getString(),
|
|
234
|
-
superTypesString = superTypesStringFromSuperTypes(superTypes),
|
|
235
|
-
provisionalString = provisinalStringFromProvisional(provisional),
|
|
236
|
-
complexTypeDeclarationString = `${provisionalString}${typeString}${superTypesString}`;
|
|
237
|
-
|
|
238
|
-
return complexTypeDeclarationString;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export function topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction(label, suppositions, deduction) {
|
|
242
|
-
const labelString = label.getString(),
|
|
243
|
-
deductionString = deduction.getString(),
|
|
244
|
-
suppositionsString = suppositionsStringFromSuppositions(suppositions),
|
|
245
|
-
topLevelMetaAssertionString = (suppositionsString !== null) ?
|
|
246
|
-
`${labelString} :: [${suppositionsString}]...${deductionString}` :
|
|
247
|
-
`${labelString} :: ${deductionString}`;
|
|
248
|
-
|
|
249
|
-
return topLevelMetaAssertionString;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export function topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction(labels, signature, suppositions, deduction) {
|
|
253
|
-
let topLevelAssertionString = EMPTY_STRING;
|
|
254
|
-
|
|
255
|
-
const deductionString = deduction.getString(),
|
|
256
|
-
labelsString = labelsStringFromLabels(labels),
|
|
257
|
-
signatureString = signatureStringFromSignature(signature),
|
|
258
|
-
suppositionsString = suppositionsStringFromSuppositions(suppositions);
|
|
259
|
-
|
|
260
|
-
topLevelAssertionString = (labelsString !== null) ?
|
|
261
|
-
`${topLevelAssertionString}${labelsString}` :
|
|
262
|
-
`${topLevelAssertionString}`;
|
|
263
|
-
topLevelAssertionString = (signatureString !== null) ?
|
|
264
|
-
`${topLevelAssertionString}${signatureString}` :
|
|
265
|
-
`${topLevelAssertionString}`;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
topLevelAssertionString = (suppositionsString !== null) ?
|
|
269
|
-
`${topLevelAssertionString} :: [${suppositionsString}]...${deductionString}` :
|
|
270
|
-
`${topLevelAssertionString} :: ${deductionString}`;
|
|
271
|
-
|
|
272
|
-
return topLevelAssertionString;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export function statementSubstitutionStringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution) {
|
|
276
|
-
const statementString = statement.getString(),
|
|
277
|
-
metavariableString = metavariable.getString(),
|
|
278
|
-
substitutionString = substitution.getString(),
|
|
279
|
-
statementSubstitutionString = `[${statementString} for ${metavariableString}${substitutionString}]`;
|
|
280
|
-
|
|
281
|
-
return statementSubstitutionString;
|
|
282
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
|
|
5
|
-
const { compress } = arrayUtilities;
|
|
6
|
-
|
|
7
|
-
export function termFromTermAndSubstitutions(term, context) {
|
|
8
|
-
if (term !== null) {
|
|
9
|
-
const termNode = term.getNode(),
|
|
10
|
-
termSingular = term.isSingular();
|
|
11
|
-
|
|
12
|
-
term = null; ///
|
|
13
|
-
|
|
14
|
-
if (termSingular) {
|
|
15
|
-
const variableNode = termNode.getVariableNode(),
|
|
16
|
-
derivedSubstitution = context.findDerivedSubstitutionByVariableNode(variableNode);
|
|
17
|
-
|
|
18
|
-
if (derivedSubstitution !== null) {
|
|
19
|
-
const replacementTerm = derivedSubstitution.getReplacementTerm();
|
|
20
|
-
|
|
21
|
-
term = replacementTerm; ///
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return term;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function frameFromFrameAndSubstitutions(frame, context) {
|
|
30
|
-
if (frame !== null) {
|
|
31
|
-
const frameNode = frame.getNode(),
|
|
32
|
-
frameSingular = frame.isSingular();
|
|
33
|
-
|
|
34
|
-
frame = null; ///
|
|
35
|
-
|
|
36
|
-
if (frameSingular) {
|
|
37
|
-
const metavariableNode = frameNode.getMetavariableNode(),
|
|
38
|
-
derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
39
|
-
|
|
40
|
-
if (derivedSubstitution !== null) {
|
|
41
|
-
const replacementFrame = derivedSubstitution.getReplacementFrame();
|
|
42
|
-
|
|
43
|
-
frame = replacementFrame; ///
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return frame;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function statementFromStatementAndSubstitutions(statement, context) {
|
|
52
|
-
if (statement !== null) {
|
|
53
|
-
const statementNode = statement.getNode(),
|
|
54
|
-
statementSingular = statement.isSingular();
|
|
55
|
-
|
|
56
|
-
statement = null; ///
|
|
57
|
-
|
|
58
|
-
if (statementSingular) {
|
|
59
|
-
const metavariableNode = statementNode.getMetavariableNode(),
|
|
60
|
-
derivedSubstitution = context.findDerivedSubstitutionByMetavariableNode(metavariableNode);
|
|
61
|
-
|
|
62
|
-
if (derivedSubstitution !== null) {
|
|
63
|
-
const replacementStatement = derivedSubstitution.getReplacementStatement();
|
|
64
|
-
|
|
65
|
-
statement = replacementStatement; ///
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return statement;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function metavariableNodesFromDerivedSubstitutions(derivedSubstitutions) {
|
|
74
|
-
const metavariableNodes = [];
|
|
75
|
-
|
|
76
|
-
derivedSubstitutions.forEach((derivedSubstitution) => {
|
|
77
|
-
const metavariableNode = derivedSubstitution.getMetavariableNode();
|
|
78
|
-
|
|
79
|
-
if (metavariableNode !== null) {
|
|
80
|
-
metavariableNodes.push(metavariableNode);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
compress(metavariableNodes, (metavariableNodeA, metavariableNodeB) => {
|
|
85
|
-
const metavariableNodeAMatchesetavariableNodeB = metavariableNodeA.match(metavariableNodeB);
|
|
86
|
-
|
|
87
|
-
if (!metavariableNodeAMatchesetavariableNodeB) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return metavariableNodes;
|
|
93
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
|
|
5
|
-
const { compress } = arrayUtilities;
|
|
6
|
-
|
|
7
|
-
export function compressTerms(terms) {
|
|
8
|
-
compress(terms, (termA, termB) => {
|
|
9
|
-
const termAEqualToTermB = termA.isEqualTo(termB);
|
|
10
|
-
|
|
11
|
-
if (!termAEqualToTermB) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function compressFrames(frames) {
|
|
18
|
-
compress(frames, (frameA, frameB) => {
|
|
19
|
-
const frameAEqualToFrameB = frameA.isEqualTo(frameB);
|
|
20
|
-
|
|
21
|
-
if (!frameAEqualToFrameB) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function compressProperties(properties) {
|
|
28
|
-
compress(properties, (propertyA, propertyB) => {
|
|
29
|
-
const propertyAEqualToPropertyB = propertyA.isEqualTo(propertyB);
|
|
30
|
-
|
|
31
|
-
if (!propertyAEqualToPropertyB) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function compressEqualities(equalities) {
|
|
38
|
-
compress(equalities, (equalityA, equalityB) => {
|
|
39
|
-
const equalityAEqualToEqualityB = equalityA.isEqualTo(equalityB);
|
|
40
|
-
|
|
41
|
-
if (!equalityAEqualToEqualityB) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function compressJudgements(judgements) {
|
|
48
|
-
compress(judgements, (judgementA, judgementB) => {
|
|
49
|
-
const judgementAEqualToJudgementB = judgementA.isEqualTo(judgementB);
|
|
50
|
-
|
|
51
|
-
if (!judgementAEqualToJudgementB) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function compressAssertions(assertions) {
|
|
58
|
-
compress(assertions, (assertionA, assertionB) => {
|
|
59
|
-
const assertionAEqualToAssertionB = assertionA.isEqualTo(assertionB);
|
|
60
|
-
|
|
61
|
-
if (!assertionAEqualToAssertionB) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function compressStatements(statements) {
|
|
68
|
-
compress(statements, (statementA, statementB) => {
|
|
69
|
-
const statementAEqualToStatementB = statementA.isEqualTo(statementB);
|
|
70
|
-
|
|
71
|
-
if (!statementAEqualToStatementB) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function compressSignatures(signatures) {
|
|
78
|
-
compress(signatures, (signatureA, signatureB) => {
|
|
79
|
-
const signatureAEqualToSignatureB = signatureA.isEqualTo(signatureB);
|
|
80
|
-
|
|
81
|
-
if (!signatureAEqualToSignatureB) {
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function compressReferences(references) {
|
|
88
|
-
compress(references, (referenceA, referenceB) => {
|
|
89
|
-
const referenceAEqualToReferenceB = referenceA.isEqualTo(referenceB);
|
|
90
|
-
|
|
91
|
-
if (!referenceAEqualToReferenceB) {
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function compressAssumptions(assumptions) {
|
|
98
|
-
compress(assumptions, (assumptionA, assumptionB) => {
|
|
99
|
-
const assumptionAEqualToAssumptionB = assumptionA.isEqualTo(assumptionB);
|
|
100
|
-
|
|
101
|
-
if (!assumptionAEqualToAssumptionB) {
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function compressMetavariables(metavariables) {
|
|
108
|
-
compress(metavariables, (metavariableA, metavariableB) => {
|
|
109
|
-
const metavariableAEqualToMetavariableB = metavariableA.isEqualTo(metavariableB);
|
|
110
|
-
|
|
111
|
-
if (!metavariableAEqualToMetavariableB) {
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function compressSubstitutions(substitutions) {
|
|
118
|
-
compress(substitutions, (substitutionA, substitutionB) => {
|
|
119
|
-
const substitutionAEqualToSubstitutionB = substitutionA.isEqualTo(substitutionB);
|
|
120
|
-
|
|
121
|
-
if (!substitutionAEqualToSubstitutionB) {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function compressPropertyRelations(propertyRelations) {
|
|
128
|
-
compress(propertyRelations, (propertyRelationA, propertyRelationB) => {
|
|
129
|
-
const propertyRelationAEqualToPropertyRelationB = propertyRelationA.isEqualTo(propertyRelationB);
|
|
130
|
-
|
|
131
|
-
if (!propertyRelationAEqualToPropertyRelationB) {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
package/src/utilities/type.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import elements from "../elements";
|
|
4
|
-
|
|
5
|
-
import { BASE_TYPE_SYMBOL } from "../constants";
|
|
6
|
-
|
|
7
|
-
let baseType = null;
|
|
8
|
-
|
|
9
|
-
export function baseTypeFromNothing() {
|
|
10
|
-
if (baseType === null) {
|
|
11
|
-
const { Type } = elements,
|
|
12
|
-
name = BASE_TYPE_SYMBOL, ///
|
|
13
|
-
context = null;
|
|
14
|
-
|
|
15
|
-
baseType = Type.fromName(name, context);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return baseType;
|
|
19
|
-
}
|