occam-verify-cli 1.0.185 → 1.0.198
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/constants.js +5 -1
- package/lib/context/file.js +3 -3
- package/lib/dom/assertion/contained.js +12 -24
- package/lib/dom/assertion/defined.js +9 -21
- package/lib/dom/assertion/property.js +8 -10
- package/lib/dom/assertion/satisfies.js +6 -8
- package/lib/dom/assertion/subproof.js +3 -5
- package/lib/dom/assertion/type.js +6 -8
- package/lib/dom/axiom.js +15 -100
- package/lib/dom/conjecture.js +5 -4
- package/lib/dom/constructor/bracketed.js +6 -7
- package/lib/dom/declaration/complexType.js +6 -6
- package/lib/dom/declaration/constructor.js +6 -6
- package/lib/dom/declaration/metavariable.js +3 -5
- package/lib/dom/declaration/type.js +2 -2
- package/lib/dom/declaration/variable.js +6 -6
- package/lib/dom/declaration.js +14 -16
- package/lib/dom/derivation.js +2 -4
- package/lib/dom/equality.js +9 -11
- package/lib/dom/frame.js +14 -18
- package/lib/dom/judgement.js +8 -10
- package/lib/dom/lemma.js +5 -4
- package/lib/dom/metaLemma.js +5 -4
- package/lib/dom/metaType.js +2 -4
- package/lib/dom/metatheorem.js +5 -4
- package/lib/dom/metavariable.js +12 -15
- package/lib/dom/parameter.js +2 -4
- package/lib/dom/procedureCall.js +6 -10
- package/lib/dom/proof.js +2 -4
- package/lib/dom/property.js +16 -51
- package/lib/dom/propertyRelation.js +14 -16
- package/lib/dom/reference.js +7 -11
- package/lib/dom/rule.js +6 -8
- package/lib/dom/statement.js +27 -31
- package/lib/dom/step.js +4 -6
- package/lib/dom/subDerivation.js +2 -4
- package/lib/dom/subproof.js +6 -8
- package/lib/dom/term.js +12 -20
- package/lib/dom/theorem.js +5 -4
- package/lib/dom/topLevelAssertion.js +30 -24
- package/lib/dom/topLevelMetaAssertion.js +76 -140
- package/lib/dom/type.js +8 -25
- package/lib/dom/variable.js +5 -11
- package/lib/equivalence.js +4 -6
- package/lib/mixins/term/verify.js +4 -8
- package/lib/node/argument.js +116 -0
- package/lib/node/assertion/contained.js +48 -53
- package/lib/node/assertion/defined.js +41 -53
- package/lib/node/assertion/property.js +23 -53
- package/lib/node/assertion/satisfies.js +23 -53
- package/lib/node/assertion/subproof.js +16 -53
- package/lib/node/assertion/type.js +23 -53
- package/lib/node/axiom.js +6 -52
- package/lib/node/combinator.js +6 -52
- package/lib/node/conclusion.js +16 -53
- package/lib/node/conjecture.js +6 -52
- package/lib/node/constructor.js +6 -52
- package/lib/node/declaration/combinator.js +8 -56
- package/lib/node/declaration/complexType.js +42 -86
- package/lib/node/declaration/constructor.js +26 -77
- package/lib/node/declaration/metavariable.js +30 -53
- package/lib/node/declaration/property.js +19 -69
- package/lib/node/declaration/type.js +45 -78
- package/lib/node/declaration/variable.js +21 -81
- package/lib/node/declaration.js +23 -53
- package/lib/node/deduction.js +16 -53
- package/lib/node/derivation.js +42 -51
- package/lib/node/equality.js +32 -53
- package/lib/node/error.js +6 -52
- package/lib/node/frame.js +30 -53
- package/lib/node/judgement.js +23 -53
- package/lib/node/label.js +16 -53
- package/lib/node/labels.js +116 -0
- package/lib/node/lemma.js +6 -52
- package/lib/node/metaArgument.js +116 -0
- package/lib/node/metaLemma.js +6 -52
- package/lib/node/metaType.js +14 -55
- package/lib/node/metatheorem.js +6 -52
- package/lib/node/metavariable.js +30 -56
- package/lib/node/nonTerminal.js +200 -0
- package/lib/node/parameter.js +22 -53
- package/lib/node/parenthesisedLabel.js +116 -0
- package/lib/node/parenthesisedLabels.js +123 -0
- package/lib/node/premise.js +23 -53
- package/lib/node/procedureCall.js +23 -53
- package/lib/node/proof.js +16 -53
- package/lib/node/property.js +18 -57
- package/lib/node/propertyRelation.js +30 -53
- package/lib/node/reference.js +16 -53
- package/lib/node/rule.js +44 -53
- package/lib/node/statement.js +139 -53
- package/lib/node/step.js +37 -53
- package/lib/node/subDerivation.js +49 -51
- package/lib/node/subproof.js +44 -53
- package/lib/node/substitution/frame.js +123 -0
- package/lib/node/substitution/reference.js +123 -0
- package/lib/node/substitution/statement.js +123 -0
- package/lib/node/substitution/term.js +123 -0
- package/lib/node/supposition.js +23 -53
- package/lib/node/term.js +41 -53
- package/lib/node/theorem.js +6 -52
- package/lib/node/topLevelAssertion.js +66 -54
- package/lib/node/topLevelMetaAssertion.js +45 -54
- package/lib/node/type.js +14 -55
- package/lib/{node.js → node/types.js} +22 -24
- package/lib/node/variable.js +14 -55
- package/lib/nominal/parser.js +3 -3
- package/lib/nonTerminalNodeMap.js +14 -4
- package/lib/ruleNames.js +42 -2
- package/lib/substitution/frame.js +5 -7
- package/lib/substitution/reference.js +5 -7
- package/lib/substitution/term.js +5 -7
- package/lib/unifier/metaLevel.js +4 -4
- package/lib/utilities/brackets.js +5 -5
- package/lib/utilities/json.js +18 -1
- package/lib/utilities/node.js +1 -37
- package/lib/utilities/subproof.js +13 -4
- package/lib/utilities/type.js +16 -4
- package/lib/verifier/topLevel.js +6 -6
- package/package.json +2 -2
- package/src/constants.js +1 -0
- package/src/context/file.js +2 -2
- package/src/dom/assertion/contained.js +12 -34
- package/src/dom/assertion/defined.js +9 -30
- package/src/dom/assertion/property.js +7 -12
- package/src/dom/assertion/satisfies.js +5 -10
- package/src/dom/assertion/subproof.js +2 -6
- package/src/dom/assertion/type.js +7 -10
- package/src/dom/axiom.js +7 -77
- package/src/dom/conjecture.js +6 -1
- package/src/dom/constructor/bracketed.js +6 -8
- package/src/dom/declaration/complexType.js +8 -7
- package/src/dom/declaration/constructor.js +6 -7
- package/src/dom/declaration/metavariable.js +2 -6
- package/src/dom/declaration/type.js +4 -2
- package/src/dom/declaration/variable.js +6 -7
- package/src/dom/declaration.js +12 -20
- package/src/dom/derivation.js +1 -4
- package/src/dom/equality.js +13 -17
- package/src/dom/frame.js +11 -25
- package/src/dom/judgement.js +7 -12
- package/src/dom/lemma.js +6 -1
- package/src/dom/metaLemma.js +6 -1
- package/src/dom/metaType.js +1 -5
- package/src/dom/metatheorem.js +6 -1
- package/src/dom/metavariable.js +11 -25
- package/src/dom/parameter.js +2 -6
- package/src/dom/procedureCall.js +5 -14
- package/src/dom/proof.js +1 -4
- package/src/dom/property.js +21 -78
- package/src/dom/propertyRelation.js +16 -22
- package/src/dom/reference.js +6 -18
- package/src/dom/rule.js +6 -12
- package/src/dom/statement.js +26 -46
- package/src/dom/step.js +3 -5
- package/src/dom/subDerivation.js +1 -4
- package/src/dom/subproof.js +8 -12
- package/src/dom/term.js +14 -33
- package/src/dom/theorem.js +6 -1
- package/src/dom/topLevelAssertion.js +30 -25
- package/src/dom/topLevelMetaAssertion.js +87 -55
- package/src/dom/type.js +11 -37
- package/src/dom/variable.js +4 -12
- package/src/equivalence.js +3 -6
- package/src/mixins/term/verify.js +5 -11
- package/src/node/argument.js +16 -0
- package/src/node/assertion/contained.js +49 -3
- package/src/node/assertion/defined.js +42 -3
- package/src/node/assertion/property.js +19 -3
- package/src/node/assertion/satisfies.js +19 -3
- package/src/node/assertion/subproof.js +12 -3
- package/src/node/assertion/type.js +19 -3
- package/src/node/axiom.js +3 -3
- package/src/node/combinator.js +3 -3
- package/src/node/conclusion.js +12 -3
- package/src/node/conjecture.js +3 -3
- package/src/node/constructor.js +3 -3
- package/src/node/declaration/combinator.js +7 -8
- package/src/node/declaration/complexType.js +40 -43
- package/src/node/declaration/constructor.js +25 -30
- package/src/node/declaration/metavariable.js +26 -3
- package/src/node/declaration/property.js +17 -23
- package/src/node/declaration/type.js +43 -32
- package/src/node/declaration/variable.js +19 -37
- package/src/node/declaration.js +19 -3
- package/src/node/deduction.js +12 -3
- package/src/node/derivation.js +15 -3
- package/src/node/equality.js +32 -3
- package/src/node/error.js +3 -3
- package/src/node/frame.js +26 -3
- package/src/node/judgement.js +19 -3
- package/src/node/label.js +12 -3
- package/src/node/labels.js +16 -0
- package/src/node/lemma.js +3 -3
- package/src/node/metaArgument.js +16 -0
- package/src/node/metaLemma.js +3 -3
- package/src/node/metaType.js +15 -8
- package/src/node/metatheorem.js +3 -3
- package/src/node/metavariable.js +32 -9
- package/src/node/nonTerminal.js +112 -0
- package/src/node/parameter.js +20 -3
- package/src/node/parenthesisedLabel.js +16 -0
- package/src/node/parenthesisedLabels.js +23 -0
- package/src/node/premise.js +19 -3
- package/src/node/procedureCall.js +19 -3
- package/src/node/proof.js +12 -3
- package/src/node/property.js +18 -12
- package/src/node/propertyRelation.js +26 -3
- package/src/node/reference.js +12 -3
- package/src/node/rule.js +40 -3
- package/src/node/statement.js +151 -3
- package/src/node/step.js +31 -3
- package/src/node/subDerivation.js +22 -3
- package/src/node/subproof.js +38 -3
- package/src/node/substitution/frame.js +23 -0
- package/src/node/substitution/reference.js +23 -0
- package/src/node/substitution/statement.js +23 -0
- package/src/node/substitution/term.js +23 -0
- package/src/node/supposition.js +19 -3
- package/src/node/term.js +38 -3
- package/src/node/theorem.js +3 -3
- package/src/node/topLevelAssertion.js +69 -3
- package/src/node/topLevelMetaAssertion.js +40 -3
- package/src/node/type.js +15 -8
- package/src/node/types.js +16 -0
- package/src/node/variable.js +15 -8
- package/src/nominal/parser.js +1 -1
- package/src/nonTerminalNodeMap.js +67 -37
- package/src/ruleNames.js +11 -1
- package/src/substitution/frame.js +7 -10
- package/src/substitution/reference.js +7 -10
- package/src/substitution/term.js +7 -9
- package/src/unifier/metaLevel.js +2 -3
- package/src/utilities/brackets.js +8 -8
- package/src/utilities/json.js +19 -0
- package/src/utilities/node.js +0 -27
- package/src/utilities/subproof.js +22 -6
- package/src/utilities/type.js +9 -0
- package/src/verifier/topLevel.js +5 -10
- package/lib/defaultTerminalNode.js +0 -20
- package/lib/mixins/node.js +0 -145
- package/src/defaultTerminalNode.js +0 -7
- package/src/mixins/node.js +0 -201
- package/src/node.js +0 -29
package/src/node/variable.js
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import NonTerminalNode from "../node/nonTerminal";
|
|
4
4
|
|
|
5
|
-
export default class VariableNode extends
|
|
5
|
+
export default class VariableNode extends NonTerminalNode {
|
|
6
6
|
getVariableName() {
|
|
7
|
-
|
|
8
|
-
const nameTerminalNode = firstChildNode, ///
|
|
9
|
-
content = nameTerminalNode.getContent(),
|
|
10
|
-
variableName = content; ///
|
|
7
|
+
let variableName;
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
this.someChildNode((childNode) => {
|
|
10
|
+
const childNodeTerminalNode = childNode.isTerminalNode();
|
|
11
|
+
|
|
12
|
+
if (childNodeTerminalNode) {
|
|
13
|
+
const terminalNode = childNode, ///
|
|
14
|
+
content = terminalNode.getContent();
|
|
15
|
+
|
|
16
|
+
variableName = content; ///
|
|
17
|
+
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
13
20
|
});
|
|
14
21
|
|
|
15
22
|
return variableName;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
|
-
static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return
|
|
25
|
+
static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return NonTerminalNode.fromRuleNameChildNodesOpacityAndPrecedence(VariableNode, ruleName, childNodes, opacity, precedence); }
|
|
19
26
|
}
|
package/src/nominal/parser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NominalParser as NominalParserBase } from "occam-grammars";
|
|
4
|
+
import { NonTerminalNode as defaultNonTerminalNode } from "occam-parsers";
|
|
4
5
|
|
|
5
6
|
import NonTerminalNodeMap from "../nonTerminalNodeMap";
|
|
6
|
-
import defaultNonTerminalNode from "../defaultTerminalNode";
|
|
7
7
|
|
|
8
8
|
export default class NominalParser extends NominalParserBase {
|
|
9
9
|
static NonTerminalNodeMap = NonTerminalNodeMap;
|
|
@@ -1,49 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import TermNode from "./node/term"
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import LemmaNode from "./node/lemma"
|
|
12
|
-
import ProofNode from "./node/proof"
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
3
|
+
import TermNode from "./node/term";
|
|
4
|
+
import RuleNode from "./node/rule";
|
|
5
|
+
import StepNode from "./node/step";
|
|
6
|
+
import TypeNode from "./node/type";
|
|
7
|
+
import TypesNode from "./node/types";
|
|
8
|
+
import ErrorNode from "./node/error";
|
|
9
|
+
import FrameNode from "./node/frame";
|
|
10
|
+
import AxiomNode from "./node/axiom";
|
|
11
|
+
import LemmaNode from "./node/lemma";
|
|
12
|
+
import ProofNode from "./node/proof";
|
|
13
|
+
import LabelNode from "./node/label";
|
|
14
|
+
import LabelsNode from "./node/labels";
|
|
15
|
+
import PremiseNode from "./node/premise";
|
|
16
|
+
import TheoremNode from "./node/theorem";
|
|
17
|
+
import ArgumentNode from "./node/argument";
|
|
18
|
+
import SubproofNode from "./node/subproof";
|
|
19
|
+
import PropertyNode from "./node/property";
|
|
20
|
+
import MetaTypeNode from "./node/metaType";
|
|
21
|
+
import EqualityNode from "./node/equality";
|
|
22
|
+
import VariableNode from "./node/variable";
|
|
23
|
+
import StatementNode from "./node/statement";
|
|
24
|
+
import ReferenceNode from "./node/reference";
|
|
25
|
+
import DeductionNode from "./node/deduction";
|
|
26
|
+
import JudgementNode from "./node/judgement";
|
|
27
|
+
import MetaLemmaNode from "./node/metaLemma";
|
|
28
|
+
import ParameterNode from "./node/parameter";
|
|
29
|
+
import DerivationNode from "./node/derivation";
|
|
30
|
+
import CombinatorNode from "./node/combinator";
|
|
31
|
+
import ConclusionNode from "./node/conclusion";
|
|
32
|
+
import ConjectureNode from "./node/conjecture";
|
|
33
|
+
import SuppositionNode from "./node/supposition";
|
|
34
|
+
import ConstructorNode from "./node/constructor";
|
|
35
|
+
import DeclarationNode from "./node/declaration";
|
|
36
|
+
import MetatheoremNode from "./node/metatheorem";
|
|
37
|
+
import MetaArgumentNode from "./node/metaArgument";
|
|
38
|
+
import MetavariableNode from "./node/metavariable";
|
|
39
|
+
import ProcedureCallNode from "./node/procedureCall";
|
|
40
|
+
import SubDerivationNode from "./node/subDerivation";
|
|
37
41
|
import TypeAssertionNode from "./node/assertion/type";
|
|
38
42
|
import typeDeclarationNode from "./node/declaration/type";
|
|
39
43
|
import PropertyRelationNode from "./node/propertyRelation"
|
|
40
44
|
import DefinedAssertionNode from "./node/assertion/defined";
|
|
45
|
+
import TermSubstitutionNode from "./node/substitution/term";
|
|
41
46
|
import PropertyAssertionNode from "./node/assertion/property";
|
|
42
47
|
import SubproofAssertionNode from "./node/assertion/subproof";
|
|
48
|
+
import FrameSubstitutionNode from "./node/substitution/frame";
|
|
49
|
+
import ParenthesisedLabelNode from "./node/parenthesisedLabel";
|
|
43
50
|
import ContainedAssertionNode from "./node/assertion/contained";
|
|
44
51
|
import SatisfiesAssertionNode from "./node/assertion/satisfies";
|
|
52
|
+
import ParenthesisedLabelsNode from "./node/parenthesisedLabels"
|
|
45
53
|
import PropertyDeclarationNode from "./node/declaration/property";
|
|
46
54
|
import variableDeclarationNode from "./node/declaration/variable";
|
|
55
|
+
import StatementSubstitutionNode from "./node/substitution/statement";
|
|
56
|
+
import ReferenceSubstitutionNode from "./node/substitution/reference";
|
|
47
57
|
import combinatorDeclarationNode from "./node/declaration/combinator";
|
|
48
58
|
import complexTypeDeclarationNode from "./node/declaration/complexType";
|
|
49
59
|
import constructorDeclarationNode from "./node/declaration/constructor";
|
|
@@ -53,14 +63,17 @@ import { RULE_RULE_NAME,
|
|
|
53
63
|
STEP_RULE_NAME,
|
|
54
64
|
TERM_RULE_NAME,
|
|
55
65
|
TYPE_RULE_NAME,
|
|
66
|
+
TYPES_RULE_NAME,
|
|
56
67
|
PROOF_RULE_NAME,
|
|
57
68
|
ERROR_RULE_NAME,
|
|
58
69
|
FRAME_RULE_NAME,
|
|
59
70
|
AXIOM_RULE_NAME,
|
|
60
|
-
LABEL_RULE_NAME,
|
|
61
71
|
LEMMA_RULE_NAME,
|
|
72
|
+
LABEL_RULE_NAME,
|
|
73
|
+
LABELS_RULE_NAME,
|
|
62
74
|
THEOREM_RULE_NAME,
|
|
63
75
|
PREMISE_RULE_NAME,
|
|
76
|
+
ARGUMENT_RULE_NAME,
|
|
64
77
|
SUBPROOF_RULE_NAME,
|
|
65
78
|
PROPERTY_RULE_NAME,
|
|
66
79
|
EQUALITY_RULE_NAME,
|
|
@@ -81,18 +94,25 @@ import { RULE_RULE_NAME,
|
|
|
81
94
|
SUPPOSITION_RULE_NAME,
|
|
82
95
|
METATHEOREM_RULE_NAME,
|
|
83
96
|
METAVARIABLE_RULE_NAME,
|
|
97
|
+
META_ARGUMENT_RULE_NAME,
|
|
84
98
|
SUB_DERIVATION_RULE_NAME,
|
|
85
99
|
TYPE_ASSERTION_RULE_NAME,
|
|
86
100
|
PROCEDURE_CALL_RULE_NAME,
|
|
87
101
|
TYPE_DECLARATION_RULE_NAME,
|
|
88
102
|
PROPERTY_RELATION_RULE_NAME,
|
|
89
103
|
DEFINED_ASSERTION_RULE_NAME,
|
|
104
|
+
TERM_SUBSTITUTION_RULE_NAME,
|
|
90
105
|
SUBPROOF_ASSERTION_RULE_NAME,
|
|
91
106
|
PROPERTY_ASSERTION_RULE_NAME,
|
|
107
|
+
FRAME_SUBSTITUTION_RULE_NAME,
|
|
92
108
|
CONTAINED_ASSERTION_RULE_NAME,
|
|
93
109
|
SATISFIES_ASSERTION_RULE_NAME,
|
|
110
|
+
PARENTHESISED_LABEL_RULE_NAME,
|
|
111
|
+
PARENTHESISED_LABELS_RULE_NAME,
|
|
94
112
|
PROPERTY_DECLARATION_RULE_NAME,
|
|
95
113
|
VARIABLE_DECLARATION_RULE_NAME,
|
|
114
|
+
STATEMENT_SUBSTITUTION_RULE_NAME,
|
|
115
|
+
REFERENCE_SUBSTITUTION_RULE_NAME,
|
|
96
116
|
COMBINATOR_DECLARATION_RULE_NAME,
|
|
97
117
|
CONSTRUCTOR_DECLARATION_RULE_NAME,
|
|
98
118
|
COMPLEX_TYPE_DECLARATION_RULE_NAME,
|
|
@@ -103,14 +123,17 @@ const nonTerminalNodeMap = {
|
|
|
103
123
|
[STEP_RULE_NAME]: StepNode,
|
|
104
124
|
[TERM_RULE_NAME]: TermNode,
|
|
105
125
|
[TYPE_RULE_NAME]: TypeNode,
|
|
126
|
+
[TYPES_RULE_NAME]: TypesNode,
|
|
106
127
|
[ERROR_RULE_NAME]: ErrorNode,
|
|
107
128
|
[FRAME_RULE_NAME]: FrameNode,
|
|
108
|
-
[LABEL_RULE_NAME]: LabelNode,
|
|
109
129
|
[LEMMA_RULE_NAME]: LemmaNode,
|
|
110
130
|
[AXIOM_RULE_NAME]: AxiomNode,
|
|
111
131
|
[PROOF_RULE_NAME]: ProofNode,
|
|
132
|
+
[LABEL_RULE_NAME]: LabelNode,
|
|
133
|
+
[LABELS_RULE_NAME]: LabelsNode,
|
|
112
134
|
[THEOREM_RULE_NAME]: TheoremNode,
|
|
113
135
|
[PREMISE_RULE_NAME]: PremiseNode,
|
|
136
|
+
[ARGUMENT_RULE_NAME]: ArgumentNode,
|
|
114
137
|
[PROPERTY_RULE_NAME]: PropertyNode,
|
|
115
138
|
[SUBPROOF_RULE_NAME]: SubproofNode,
|
|
116
139
|
[EQUALITY_RULE_NAME]: EqualityNode,
|
|
@@ -121,28 +144,35 @@ const nonTerminalNodeMap = {
|
|
|
121
144
|
[DEDUCTION_RULE_NAME]: DeductionNode,
|
|
122
145
|
[PARAMETER_RULE_NAME]: ParameterNode,
|
|
123
146
|
[STATEMENT_RULE_NAME]: StatementNode,
|
|
147
|
+
[META_LEMMA_RULE_NAME]: MetaLemmaNode,
|
|
124
148
|
[COMBINATOR_RULE_NAME]: CombinatorNode,
|
|
125
149
|
[CONCLUSION_RULE_NAME]: ConclusionNode,
|
|
126
150
|
[CONJECTURE_RULE_NAME]: ConjectureNode,
|
|
127
151
|
[DERIVATION_RULE_NAME]: DerivationNode,
|
|
128
|
-
[META_LEMMA_RULE_NAME]: MetaLemmaNode,
|
|
129
152
|
[SUPPOSITION_RULE_NAME]: SuppositionNode,
|
|
130
153
|
[CONSTRUCTOR_RULE_NAME]: ConstructorNode,
|
|
131
154
|
[DECLARATION_RULE_NAME]: DeclarationNode,
|
|
132
155
|
[METATHEOREM_RULE_NAME]: MetatheoremNode,
|
|
133
156
|
[METAVARIABLE_RULE_NAME]: MetavariableNode,
|
|
157
|
+
[META_ARGUMENT_RULE_NAME]: MetaArgumentNode,
|
|
134
158
|
[TYPE_ASSERTION_RULE_NAME]: TypeAssertionNode,
|
|
135
159
|
[PROCEDURE_CALL_RULE_NAME]: ProcedureCallNode,
|
|
136
160
|
[SUB_DERIVATION_RULE_NAME]: SubDerivationNode,
|
|
137
161
|
[TYPE_DECLARATION_RULE_NAME]: typeDeclarationNode,
|
|
138
162
|
[PROPERTY_RELATION_RULE_NAME]: PropertyRelationNode,
|
|
139
163
|
[DEFINED_ASSERTION_RULE_NAME]: DefinedAssertionNode,
|
|
164
|
+
[TERM_SUBSTITUTION_RULE_NAME]: TermSubstitutionNode,
|
|
140
165
|
[SUBPROOF_ASSERTION_RULE_NAME]: SubproofAssertionNode,
|
|
141
166
|
[PROPERTY_ASSERTION_RULE_NAME]: PropertyAssertionNode,
|
|
167
|
+
[FRAME_SUBSTITUTION_RULE_NAME]: FrameSubstitutionNode,
|
|
168
|
+
[PARENTHESISED_LABEL_RULE_NAME]: ParenthesisedLabelNode,
|
|
142
169
|
[SATISFIES_ASSERTION_RULE_NAME]: SatisfiesAssertionNode,
|
|
143
170
|
[CONTAINED_ASSERTION_RULE_NAME]: ContainedAssertionNode,
|
|
171
|
+
[PARENTHESISED_LABELS_RULE_NAME]: ParenthesisedLabelsNode,
|
|
144
172
|
[VARIABLE_DECLARATION_RULE_NAME]: variableDeclarationNode,
|
|
145
173
|
[PROPERTY_DECLARATION_RULE_NAME]: PropertyDeclarationNode,
|
|
174
|
+
[STATEMENT_SUBSTITUTION_RULE_NAME]: StatementSubstitutionNode,
|
|
175
|
+
[REFERENCE_SUBSTITUTION_RULE_NAME]: ReferenceSubstitutionNode,
|
|
146
176
|
[COMBINATOR_DECLARATION_RULE_NAME]: combinatorDeclarationNode,
|
|
147
177
|
[CONSTRUCTOR_DECLARATION_RULE_NAME]: constructorDeclarationNode,
|
|
148
178
|
[COMPLEX_TYPE_DECLARATION_RULE_NAME]: complexTypeDeclarationNode,
|
package/src/ruleNames.js
CHANGED
|
@@ -4,14 +4,17 @@ export const RULE_RULE_NAME = "rule";
|
|
|
4
4
|
export const STEP_RULE_NAME = "step";
|
|
5
5
|
export const TERM_RULE_NAME = "term";
|
|
6
6
|
export const TYPE_RULE_NAME = "type";
|
|
7
|
-
export const
|
|
7
|
+
export const TYPES_RULE_NAME = "types";
|
|
8
8
|
export const LEMMA_RULE_NAME = "lemma";
|
|
9
9
|
export const AXIOM_RULE_NAME = "axiom";
|
|
10
10
|
export const ERROR_RULE_NAME = "error";
|
|
11
11
|
export const FRAME_RULE_NAME = "frame";
|
|
12
12
|
export const PROOF_RULE_NAME = "proof";
|
|
13
|
+
export const LABEL_RULE_NAME = "label";
|
|
14
|
+
export const LABELS_RULE_NAME = "labels";
|
|
13
15
|
export const THEOREM_RULE_NAME = "theorem";
|
|
14
16
|
export const PREMISE_RULE_NAME = "premise";
|
|
17
|
+
export const ARGUMENT_RULE_NAME = "argument";
|
|
15
18
|
export const PROPERTY_RULE_NAME = "property";
|
|
16
19
|
export const EQUALITY_RULE_NAME = "equality";
|
|
17
20
|
export const VARIABLE_RULE_NAME = "variable";
|
|
@@ -32,18 +35,25 @@ export const CONSTRUCTOR_RULE_NAME = "constructor";
|
|
|
32
35
|
export const DECLARATION_RULE_NAME = "declaration";
|
|
33
36
|
export const METATHEOREM_RULE_NAME = "metatheorem";
|
|
34
37
|
export const METAVARIABLE_RULE_NAME = "metavariable";
|
|
38
|
+
export const META_ARGUMENT_RULE_NAME = "metaArgument";
|
|
35
39
|
export const PROCEDURE_CALL_RULE_NAME = "procedureCall";
|
|
36
40
|
export const SUB_DERIVATION_RULE_NAME = "subDerivation";
|
|
37
41
|
export const TYPE_ASSERTION_RULE_NAME = "typeAssertion";
|
|
38
42
|
export const TYPE_DECLARATION_RULE_NAME = "typeDeclaration";
|
|
39
43
|
export const PROPERTY_RELATION_RULE_NAME = "propertyRelation";
|
|
40
44
|
export const DEFINED_ASSERTION_RULE_NAME = "definedAssertion";
|
|
45
|
+
export const TERM_SUBSTITUTION_RULE_NAME = "termSubstitution";
|
|
41
46
|
export const PROPERTY_ASSERTION_RULE_NAME = "propertyAssertion";
|
|
42
47
|
export const SUBPROOF_ASSERTION_RULE_NAME = "subproofAssertion";
|
|
48
|
+
export const FRAME_SUBSTITUTION_RULE_NAME = "frameSubstitution";
|
|
43
49
|
export const CONTAINED_ASSERTION_RULE_NAME = "containedAssertion";
|
|
44
50
|
export const SATISFIES_ASSERTION_RULE_NAME = "satisfiesAssertion";
|
|
51
|
+
export const PARENTHESISED_LABEL_RULE_NAME = "parenthesisedLabel";
|
|
52
|
+
export const PARENTHESISED_LABELS_RULE_NAME = "parenthesisedLabels";
|
|
45
53
|
export const PROPERTY_DECLARATION_RULE_NAME = "propertyDeclaration";
|
|
46
54
|
export const VARIABLE_DECLARATION_RULE_NAME = "variableDeclaration";
|
|
55
|
+
export const STATEMENT_SUBSTITUTION_RULE_NAME = "statementSubstitution";
|
|
56
|
+
export const REFERENCE_SUBSTITUTION_RULE_NAME = "referenceSubstitution";
|
|
47
57
|
export const COMBINATOR_DECLARATION_RULE_NAME = "combinatorDeclaration";
|
|
48
58
|
export const CONSTRUCTOR_DECLARATION_RULE_NAME = "constructorDeclaration";
|
|
49
59
|
export const COMPLEX_TYPE_DECLARATION_RULE_NAME = "complexTypeDeclaration";
|
|
@@ -4,12 +4,6 @@ import dom from "../dom";
|
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
5
|
import FrameSubstitutionPartialContext from "../context/partial/substitution/frame";
|
|
6
6
|
|
|
7
|
-
import { nodeQuery } from "../utilities/query";
|
|
8
|
-
|
|
9
|
-
const frameNodeQuery = nodeQuery("/frameSubstitution/frame[0]"),
|
|
10
|
-
metavariableNodeQuery = nodeQuery("/frameSubstitution/frame[1]/metavariable!"),
|
|
11
|
-
frameSubstitutionNodeQuery = nodeQuery("/statement/frameSubstitution");
|
|
12
|
-
|
|
13
7
|
export default class FrameSubstitution extends Substitution {
|
|
14
8
|
constructor(string, node, tokens, frame, metavariable) {
|
|
15
9
|
super(string, node, tokens);
|
|
@@ -42,14 +36,17 @@ export default class FrameSubstitution extends Substitution {
|
|
|
42
36
|
static fromStatementNode(statementNode, context) {
|
|
43
37
|
let frameSubstitution = null;
|
|
44
38
|
|
|
45
|
-
const frameSubstitutionNode =
|
|
39
|
+
const frameSubstitutionNode = statementNode.getFrameSubstitutionNode();
|
|
46
40
|
|
|
47
41
|
if (frameSubstitutionNode !== null) {
|
|
48
|
-
const
|
|
49
|
-
|
|
42
|
+
const lastFrameNode = frameSubstitutionNode.getLastFrameNode(),
|
|
43
|
+
firstFrameNode = frameSubstitutionNode.getFirstFrameNode(),
|
|
44
|
+
singularMetavariableNode = lastFrameNode.getSingularMetavariableNode();
|
|
50
45
|
|
|
51
|
-
if (
|
|
46
|
+
if (singularMetavariableNode !== null) {
|
|
52
47
|
const { Frame, Metavariable } = dom,
|
|
48
|
+
frameNode = firstFrameNode, ///
|
|
49
|
+
metavariableNode = singularMetavariableNode, ///
|
|
53
50
|
frame = Frame.fromFrameNode(frameNode, context),
|
|
54
51
|
metavariable = Metavariable.fromMetavariableNode(metavariableNode, context),
|
|
55
52
|
node = frameSubstitutionNode, ///
|
|
@@ -4,12 +4,6 @@ import dom from "../dom";
|
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
5
|
import ReferenceSubstitutionPartialContext from "../context/partial/substitution/reference";
|
|
6
6
|
|
|
7
|
-
import { nodeQuery } from "../utilities/query";
|
|
8
|
-
|
|
9
|
-
const referenceNodeQuery = nodeQuery("/referenceSubstitution/reference[0]"),
|
|
10
|
-
metavariableNodeQuery = nodeQuery("/referenceSubstitution/reference[1]/metavariable!"),
|
|
11
|
-
referenceSubstitutionNodeQuery = nodeQuery("/statement/referenceSubstitution");
|
|
12
|
-
|
|
13
7
|
export default class ReferenceSubstitution extends Substitution {
|
|
14
8
|
constructor(string, node, tokens, reference, metavariable) {
|
|
15
9
|
super(string, node, tokens);
|
|
@@ -33,14 +27,17 @@ export default class ReferenceSubstitution extends Substitution {
|
|
|
33
27
|
static fromStatementNode(statementNode, context) {
|
|
34
28
|
let referenceSubstitution = null;
|
|
35
29
|
|
|
36
|
-
const referenceSubstitutionNode =
|
|
30
|
+
const referenceSubstitutionNode = statementNode.getReferenceSubstitutionNode();
|
|
37
31
|
|
|
38
32
|
if (referenceSubstitutionNode !== null) {
|
|
39
|
-
const
|
|
40
|
-
|
|
33
|
+
const lastReferenceNode = referenceSubstitutionNode.getLastReferenceNode(),
|
|
34
|
+
firstReferenceNode = referenceSubstitutionNode.getFirstReferenceNode(),
|
|
35
|
+
singularMetavariableNode = lastReferenceNode.getSingularMetavariableNode();
|
|
41
36
|
|
|
42
|
-
if (
|
|
37
|
+
if (singularMetavariableNode !== null) {
|
|
43
38
|
const { Reference, Metavariable } = dom,
|
|
39
|
+
referenceNode = firstReferenceNode, ///
|
|
40
|
+
metavariableNode = singularMetavariableNode, ///
|
|
44
41
|
reference = Reference.fromReferenceNode(referenceNode, context),
|
|
45
42
|
metavariable = Metavariable.fromMetavariableNode(metavariableNode, context),
|
|
46
43
|
node = referenceSubstitutionNode, ///
|
package/src/substitution/term.js
CHANGED
|
@@ -4,14 +4,9 @@ import dom from "../dom";
|
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
5
|
import TermSubstitutionPartialContext from "../context/partial/substitution/term";
|
|
6
6
|
|
|
7
|
-
import { nodeQuery } from "../utilities/query";
|
|
8
7
|
import { stripBracketsFromTerm } from "../utilities/brackets";
|
|
9
8
|
import { stripBracketsFromTermNode } from "../utilities/brackets";
|
|
10
9
|
|
|
11
|
-
const termNodeQuery = nodeQuery("/termSubstitution/term[0]"),
|
|
12
|
-
variableNodeQuery = nodeQuery("/termSubstitution/term[1]/variable!"),
|
|
13
|
-
termSubstitutionNodeQuery = nodeQuery("/statement/termSubstitution");
|
|
14
|
-
|
|
15
10
|
export default class TermSubstitution extends Substitution {
|
|
16
11
|
constructor(string, node, tokens, term, variable) {
|
|
17
12
|
super(string, node, tokens);
|
|
@@ -68,14 +63,17 @@ export default class TermSubstitution extends Substitution {
|
|
|
68
63
|
static fromStatementNode(statementNode, context) {
|
|
69
64
|
let termSubstitution = null;
|
|
70
65
|
|
|
71
|
-
const termSubstitutionNode =
|
|
66
|
+
const termSubstitutionNode = statementNode.getTermSubstitutionNode();
|
|
72
67
|
|
|
73
68
|
if (termSubstitutionNode !== null) {
|
|
74
|
-
const
|
|
75
|
-
|
|
69
|
+
const lastTermNode = termSubstitutionNode.getLastTermNode(),
|
|
70
|
+
firstTermNode = termSubstitutionNode.getFirstTermNode(),
|
|
71
|
+
singularVariableNode = lastTermNode.getSingularVariableNode(lastTermNode);
|
|
76
72
|
|
|
77
|
-
if (
|
|
73
|
+
if (singularVariableNode !== null) {
|
|
78
74
|
const { Term, Variable } = dom,
|
|
75
|
+
termNode = firstTermNode, ///
|
|
76
|
+
variableNode = singularVariableNode, ///
|
|
79
77
|
term = Term.fromTermNode(termNode, context),
|
|
80
78
|
variable = Variable.fromVariableNode(variableNode, context),
|
|
81
79
|
node = termSubstitutionNode, ///
|
package/src/unifier/metaLevel.js
CHANGED
|
@@ -12,7 +12,6 @@ const termNodeQuery = nodeQuery("/term"),
|
|
|
12
12
|
statementNodeQuery = nodeQuery("/statement"),
|
|
13
13
|
termVariableNodeQuery = nodeQuery("/term/variable!"),
|
|
14
14
|
frameMetavariableNodeQuery = nodeQuery("/frame/metavariable!"),
|
|
15
|
-
statementMetavariableNodeQuery = nodeQuery("/statement/metavariable!"),
|
|
16
15
|
declarationMetavariableNodeQuery = nodeQuery("/declaration/metavariable!");
|
|
17
16
|
|
|
18
17
|
class MetaLevelUnifier extends Unifier {
|
|
@@ -34,9 +33,9 @@ class MetaLevelUnifier extends Unifier {
|
|
|
34
33
|
let statementUnified;
|
|
35
34
|
|
|
36
35
|
const statementNode = generalStatementNode, ///
|
|
37
|
-
|
|
36
|
+
singularMetavariableNode = statementNode.getSingularMetavariableNode();
|
|
38
37
|
|
|
39
|
-
if (
|
|
38
|
+
if (singularMetavariableNode !== null) {
|
|
40
39
|
const { Metavariable, Statement } = dom; ///
|
|
41
40
|
|
|
42
41
|
let context,
|
|
@@ -5,12 +5,8 @@ import LocalContext from "../context/local";
|
|
|
5
5
|
import combinatorBracketedContext from "../context/bracketed/combinator";
|
|
6
6
|
import constructorBracketedContext from "../context/bracketed/constructor";
|
|
7
7
|
|
|
8
|
-
import { nodeQuery } from "../utilities/query";
|
|
9
8
|
import { BRACKETED_TERM_DEPTH, BRACKETED_STATEMENT_DEPTH } from "../constants";
|
|
10
9
|
|
|
11
|
-
const bracketedTermChildNodeQuery = nodeQuery("/term/argument/term"),
|
|
12
|
-
bracketedStatementChildNodeQuery = nodeQuery("/statement/metaArgument/statement");
|
|
13
|
-
|
|
14
10
|
export function stripBracketsFromTerm(term, context) {
|
|
15
11
|
const termNode = term.getNode(),
|
|
16
12
|
bracketedTermChildNode = bracketedTermChildNodeFromTermNode(termNode);
|
|
@@ -69,7 +65,9 @@ export function bracketedTermChildNodeFromTermNode(termNode) {
|
|
|
69
65
|
termNodeMatchBracketedTermNode = termNode.match(bracketedTermNode, depth);
|
|
70
66
|
|
|
71
67
|
if (termNodeMatchBracketedTermNode) {
|
|
72
|
-
|
|
68
|
+
const singularTermNode = termNode.getSingularTermNode();
|
|
69
|
+
|
|
70
|
+
bracketedTermChildNode = singularTermNode; ///
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
return bracketedTermChildNode;
|
|
@@ -83,7 +81,9 @@ export function bracketedStatementChildNodeFromStatementNode(statementNode) {
|
|
|
83
81
|
statementNodeMatchBracketedStatementNode = statementNode.match(bracketedStatementNode, depth);
|
|
84
82
|
|
|
85
83
|
if (statementNodeMatchBracketedStatementNode) {
|
|
86
|
-
|
|
84
|
+
const singularStatementNode = statementNode.getSingularStatementNode();
|
|
85
|
+
|
|
86
|
+
bracketedStatementChildNode = singularStatementNode; ///
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return bracketedStatementChildNode;
|
|
@@ -91,8 +91,8 @@ export function bracketedStatementChildNodeFromStatementNode(statementNode) {
|
|
|
91
91
|
|
|
92
92
|
function contextFromStatement(statement, context) {
|
|
93
93
|
const statementTokens = statement.getTokens(),
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
tokens = statementTokens, ///
|
|
95
|
+
localContext = LocalContext.fromContextAndTokens(context, tokens);
|
|
96
96
|
|
|
97
97
|
context = localContext; ///
|
|
98
98
|
|
package/src/utilities/json.js
CHANGED
|
@@ -160,6 +160,19 @@ export function rulesFromJSON(json, fileContext) {
|
|
|
160
160
|
return rules;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
export function labelFromJSON(json, fileContext) {
|
|
164
|
+
let { label } = json;
|
|
165
|
+
|
|
166
|
+
const { Label } = dom,
|
|
167
|
+
labelJSON = label; ///
|
|
168
|
+
|
|
169
|
+
json = labelJSON; ///
|
|
170
|
+
|
|
171
|
+
label = Label.fromJSON(json, fileContext);
|
|
172
|
+
|
|
173
|
+
return label;
|
|
174
|
+
}
|
|
175
|
+
|
|
163
176
|
export function labelsFromJSON(json, fileContext) {
|
|
164
177
|
let { labels } = json;
|
|
165
178
|
|
|
@@ -425,6 +438,12 @@ export function typeToTypeJSON(type) {
|
|
|
425
438
|
return typeJSON;
|
|
426
439
|
}
|
|
427
440
|
|
|
441
|
+
export function labelToLabelJSON(label) {
|
|
442
|
+
const labelJSON = label.toJSON();
|
|
443
|
+
|
|
444
|
+
return labelJSON;
|
|
445
|
+
}
|
|
446
|
+
|
|
428
447
|
export function metaTypeToMetaTypeJSON(metaType) {
|
|
429
448
|
const metaTypeJSON = (metaType !== null) ?
|
|
430
449
|
metaType.toJSON() :
|
package/src/utilities/node.js
CHANGED
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
import dom from "../dom";
|
|
4
4
|
|
|
5
5
|
import { objectType } from "../dom/type";
|
|
6
|
-
import { TYPE_RULE_NAME, VARIABLE_RULE_NAME, PROPERTY_RULE_NAME, PROPERTY_DECLARATION_RULE_NAME } from "../ruleNames";
|
|
7
|
-
|
|
8
|
-
export function isNodeTypeNode(node) { return isNodeRuleNode(node, TYPE_RULE_NAME); }
|
|
9
|
-
|
|
10
|
-
export function isNodeVariableNode(node) { return isNodeRuleNode(node, VARIABLE_RULE_NAME); }
|
|
11
|
-
|
|
12
|
-
export function isNodePropertyNode(node) { return isNodeRuleNode(node, PROPERTY_RULE_NAME); }
|
|
13
|
-
|
|
14
|
-
export function isNodePropertyDeclarationNode(node) { return isNodeRuleNode(node, PROPERTY_DECLARATION_RULE_NAME); }
|
|
15
6
|
|
|
16
7
|
export function typeFromTypeNode(typeNode) {
|
|
17
8
|
let type;
|
|
@@ -52,21 +43,3 @@ export function statementFromStatementNode(statementNode, context) {
|
|
|
52
43
|
|
|
53
44
|
return statement;
|
|
54
45
|
}
|
|
55
|
-
|
|
56
|
-
function isNodeRuleNode(node, ruleName) {
|
|
57
|
-
let nodeRuleNode = false;
|
|
58
|
-
|
|
59
|
-
const nodeNonTerminalNode = node.isNonTerminalNode();
|
|
60
|
-
|
|
61
|
-
if (nodeNonTerminalNode) {
|
|
62
|
-
const nonTerminalNode = node, ///
|
|
63
|
-
nonTerminalNodeRuleName = nonTerminalNode.getRuleName(),
|
|
64
|
-
nonTerminalNodeRuleNameRuleName = (nonTerminalNodeRuleName === ruleName);
|
|
65
|
-
|
|
66
|
-
if (nonTerminalNodeRuleNameRuleName) {
|
|
67
|
-
nodeRuleNode = true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return nodeRuleNode;
|
|
72
|
-
}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { nodeQuery, nodesQuery } from "./query";
|
|
4
3
|
import { nodeAsString, nodesAsString } from "./string";
|
|
5
4
|
|
|
6
|
-
const lastStepStatementNodeQuery = nodeQuery("/subproof/subDerivation/step[-1]/statement"),
|
|
7
|
-
suppositionStatementNodesQuery = nodesQuery("/subproof/supposition/statement");
|
|
8
|
-
|
|
9
5
|
export function subproofStringFromSubproofNode(subproofNode, fileContext) {
|
|
10
6
|
const tokens = fileContext.getTokens(),
|
|
11
|
-
suppositionStatementNodes =
|
|
12
|
-
lastStepStatementNode =
|
|
7
|
+
suppositionStatementNodes = suppositionStatementNodesFromSubproofNode(subproofNode),
|
|
8
|
+
lastStepStatementNode = lastStepStatementNodeFromSubproofNode(subproofNode),
|
|
13
9
|
suppositionStatementsString = nodesAsString(suppositionStatementNodes, tokens),
|
|
14
10
|
lastStepStatementString = nodeAsString(lastStepStatementNode, tokens),
|
|
15
11
|
subproofString = `[${suppositionStatementsString}]...${lastStepStatementString}`;
|
|
16
12
|
|
|
17
13
|
return subproofString;
|
|
18
14
|
}
|
|
15
|
+
|
|
16
|
+
function lastStepStatementNodeFromSubproofNode(subproofNode) {
|
|
17
|
+
const lastStepNode = subproofNode.getLastStepNode(),
|
|
18
|
+
lastStepNodeStatementNode = lastStepNode.getStatementNode(),
|
|
19
|
+
lastStepStatementNode = lastStepNodeStatementNode; ///
|
|
20
|
+
|
|
21
|
+
return lastStepStatementNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function suppositionStatementNodesFromSubproofNode(subproofNode) {
|
|
25
|
+
const suppositionNodes = subproofNode.getSuppositionNodes(),
|
|
26
|
+
suppositionNodeStatementNodes = suppositionNodes.map((suppositionNode) => {
|
|
27
|
+
const suppositionNodeStatementNode = suppositionNode.getStatementNode();
|
|
28
|
+
|
|
29
|
+
return suppositionNodeStatementNode;
|
|
30
|
+
}),
|
|
31
|
+
suppositionStatementNodes = suppositionNodeStatementNodes; ///
|
|
32
|
+
|
|
33
|
+
return suppositionStatementNodes;
|
|
34
|
+
}
|
package/src/utilities/type.js
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { objectType } from "../dom/type";
|
|
4
4
|
|
|
5
|
+
export function stringFromTypeNameNameAndSuperTypes(typeName, superTypes) {
|
|
6
|
+
const superTypesString = superTypesStringFromSuperTypes(superTypes),
|
|
7
|
+
string = (superTypesString !== null) ?
|
|
8
|
+
`${typeName}:${superTypesString}` :
|
|
9
|
+
typeName; ///
|
|
10
|
+
|
|
11
|
+
return string;
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
export function superTypesStringFromSuperTypes(superTypes) {
|
|
6
15
|
const superTypesString = superTypes.reduce((superTypesString, superType) => {
|
|
7
16
|
if (superType !== objectType) {
|
package/src/verifier/topLevel.js
CHANGED
|
@@ -67,8 +67,7 @@ class TopLevelVerifier extends Verifier {
|
|
|
67
67
|
nodeQuery: lemmaNodeQuery,
|
|
68
68
|
verify: (lemmaNode, fileContext) => {
|
|
69
69
|
const { Lemma } = dom,
|
|
70
|
-
|
|
71
|
-
lemma = Lemma.fromNode(node, fileContext),
|
|
70
|
+
lemma = Lemma.fromLemmaNode(lemmaNode, fileContext),
|
|
72
71
|
lemmaVerified = lemma.verify();
|
|
73
72
|
|
|
74
73
|
return lemmaVerified;
|
|
@@ -78,8 +77,7 @@ class TopLevelVerifier extends Verifier {
|
|
|
78
77
|
nodeQuery: theoremNodeQuery,
|
|
79
78
|
verify: (theoremNode, fileContext) => {
|
|
80
79
|
const { Theorem } = dom,
|
|
81
|
-
|
|
82
|
-
theorem = Theorem.fromNode(node, fileContext),
|
|
80
|
+
theorem = Theorem.fromTheoremNode(theoremNode, fileContext),
|
|
83
81
|
theoremVerified = theorem.verify();
|
|
84
82
|
|
|
85
83
|
return theoremVerified;
|
|
@@ -89,8 +87,7 @@ class TopLevelVerifier extends Verifier {
|
|
|
89
87
|
nodeQuery: metaLemmaNodeQuery,
|
|
90
88
|
verify: (metaLemmaNode, fileContext) => {
|
|
91
89
|
const { MetaLemma } = dom,
|
|
92
|
-
|
|
93
|
-
metaLemma = MetaLemma.fromNode(node, fileContext),
|
|
90
|
+
metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode, fileContext),
|
|
94
91
|
metaLemmaVerified = metaLemma.verify();
|
|
95
92
|
|
|
96
93
|
return metaLemmaVerified;
|
|
@@ -100,8 +97,7 @@ class TopLevelVerifier extends Verifier {
|
|
|
100
97
|
nodeQuery: conjectureNodeQuery,
|
|
101
98
|
verify: (conjectureNode, fileContext) => {
|
|
102
99
|
const { Conjecture } = dom,
|
|
103
|
-
|
|
104
|
-
conjecture = Conjecture.fromNode(node, fileContext),
|
|
100
|
+
conjecture = Conjecture.fromConjectureNode(conjectureNode, fileContext),
|
|
105
101
|
conjectureVerified = conjecture.verify();
|
|
106
102
|
|
|
107
103
|
return conjectureVerified;
|
|
@@ -111,8 +107,7 @@ class TopLevelVerifier extends Verifier {
|
|
|
111
107
|
nodeQuery: metatheoremNodeQuery,
|
|
112
108
|
verify: (metatheoremNode, fileContext) => {
|
|
113
109
|
const { Metatheorem } = dom,
|
|
114
|
-
|
|
115
|
-
metatheorem = Metatheorem.fromNode(node, fileContext),
|
|
110
|
+
metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode, fileContext),
|
|
116
111
|
metatheoremVerified = metatheorem.verify();
|
|
117
112
|
|
|
118
113
|
return metatheoremVerified;
|