occam-verify-cli 1.0.230 → 1.0.233
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/context/local.js +1 -14
- package/lib/dom/axiom.js +22 -16
- package/lib/dom/combinator.js +5 -5
- package/lib/dom/conclusion.js +5 -5
- package/lib/dom/conjecture.js +9 -9
- package/lib/dom/constructor.js +5 -5
- package/lib/dom/declaration/combinator.js +14 -14
- package/lib/dom/declaration/complexType.js +35 -35
- package/lib/dom/declaration/constructor.js +19 -19
- package/lib/dom/declaration/metavariable.js +22 -22
- package/lib/dom/declaration/simpleType.js +23 -23
- package/lib/dom/declaration/variable.js +20 -20
- package/lib/dom/declaration.js +4 -2
- package/lib/dom/deduction.js +5 -5
- package/lib/dom/derivation.js +5 -5
- package/lib/dom/error.js +9 -9
- package/lib/dom/hypothesis.js +260 -0
- package/lib/dom/label.js +18 -24
- package/lib/dom/lemma.js +7 -7
- package/lib/dom/metaLemma.js +9 -9
- package/lib/dom/metaType.js +4 -10
- package/lib/dom/metatheorem.js +9 -9
- package/lib/dom/metavariable.js +7 -8
- package/lib/dom/parameter.js +2 -2
- package/lib/dom/premise.js +5 -5
- package/lib/dom/procedureCall.js +11 -10
- package/lib/dom/proof.js +3 -3
- package/lib/dom/property.js +9 -9
- package/lib/dom/reference.js +23 -22
- package/lib/dom/rule.js +25 -25
- package/lib/dom/section.js +146 -0
- package/lib/dom/signature.js +5 -5
- package/lib/dom/statement.js +25 -20
- package/lib/dom/step.js +3 -3
- package/lib/dom/subDerivation.js +5 -5
- package/lib/dom/subproof.js +7 -7
- package/lib/dom/substitution/statement.js +3 -3
- package/lib/dom/supposition.js +5 -5
- package/lib/dom/term.js +5 -6
- package/lib/dom/theorem.js +9 -9
- package/lib/dom/topLevelAssertion.js +22 -22
- package/lib/dom/topLevelMetaAssertion.js +14 -14
- package/lib/dom/type.js +21 -21
- package/lib/dom/variable.js +9 -15
- package/lib/index.js +3 -1
- package/lib/node/hypothesis.js +123 -0
- package/lib/node/section.js +116 -0
- package/lib/nonTerminalNodeMap.js +5 -3
- package/lib/ruleNames.js +9 -1
- package/lib/utilities/json.js +59 -59
- package/lib/utilities/subproof.js +10 -10
- package/lib/verifier/combinator.js +9 -10
- package/lib/verifier/constructor.js +10 -11
- package/lib/verifier/topLevel.js +38 -31
- package/package.json +2 -2
- package/src/context/local.js +0 -14
- package/src/dom/axiom.js +30 -29
- package/src/dom/combinator.js +4 -4
- package/src/dom/conclusion.js +5 -5
- package/src/dom/conjecture.js +8 -8
- package/src/dom/constructor.js +4 -4
- package/src/dom/declaration/combinator.js +14 -14
- package/src/dom/declaration/complexType.js +35 -35
- package/src/dom/declaration/constructor.js +20 -20
- package/src/dom/declaration/metavariable.js +22 -22
- package/src/dom/declaration/simpleType.js +22 -22
- package/src/dom/declaration/variable.js +21 -21
- package/src/dom/declaration.js +5 -3
- package/src/dom/deduction.js +5 -5
- package/src/dom/derivation.js +5 -5
- package/src/dom/error.js +8 -8
- package/src/dom/hypothesis.js +230 -0
- package/src/dom/label.js +17 -19
- package/src/dom/lemma.js +8 -8
- package/src/dom/metaLemma.js +8 -8
- package/src/dom/metaType.js +2 -6
- package/src/dom/metatheorem.js +8 -8
- package/src/dom/metavariable.js +9 -12
- package/src/dom/parameter.js +1 -1
- package/src/dom/premise.js +8 -8
- package/src/dom/procedureCall.js +9 -9
- package/src/dom/proof.js +2 -2
- package/src/dom/property.js +8 -8
- package/src/dom/reference.js +23 -27
- package/src/dom/rule.js +30 -30
- package/src/dom/section.js +70 -0
- package/src/dom/signature.js +4 -4
- package/src/dom/statement.js +24 -32
- package/src/dom/step.js +4 -4
- package/src/dom/subDerivation.js +5 -5
- package/src/dom/subproof.js +8 -8
- package/src/dom/substitution/statement.js +5 -5
- package/src/dom/supposition.js +7 -7
- package/src/dom/term.js +3 -8
- package/src/dom/theorem.js +7 -7
- package/src/dom/topLevelAssertion.js +29 -30
- package/src/dom/topLevelMetaAssertion.js +20 -20
- package/src/dom/type.js +22 -22
- package/src/dom/variable.js +8 -11
- package/src/index.js +2 -0
- package/src/node/hypothesis.js +23 -0
- package/src/node/section.js +16 -0
- package/src/nonTerminalNodeMap.js +7 -1
- package/src/ruleNames.js +2 -0
- package/src/utilities/json.js +58 -58
- package/src/utilities/subproof.js +10 -10
- package/src/verifier/combinator.js +6 -11
- package/src/verifier/constructor.js +9 -12
- package/src/verifier/topLevel.js +42 -30
package/src/verifier/topLevel.js
CHANGED
|
@@ -9,6 +9,7 @@ const errorNodeQuery = nodeQuery("/error"),
|
|
|
9
9
|
ruleNodeQuery = nodeQuery("/rule"),
|
|
10
10
|
axiomNodeQuery = nodeQuery("/axiom"),
|
|
11
11
|
lemmaNodeQuery = nodeQuery("/lemma"),
|
|
12
|
+
sectionNodeQuery = nodeQuery("/section"),
|
|
12
13
|
theoremNodeQuery = nodeQuery("/theorem"),
|
|
13
14
|
metaLemmaNodeQuery = nodeQuery("/metaLemma"),
|
|
14
15
|
conjectureNodeQuery = nodeQuery("/conjecture"),
|
|
@@ -24,8 +25,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
24
25
|
verify(node, fileContext) {
|
|
25
26
|
let verifiesAtTopLevel;
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const context = fileContext, ///
|
|
29
|
+
nonTerminalNode = node, ///
|
|
30
|
+
nonTerminalNodeVerifies = this.verifyNonTerminalNode(nonTerminalNode, context);
|
|
29
31
|
|
|
30
32
|
verifiesAtTopLevel = nonTerminalNodeVerifies; ///
|
|
31
33
|
|
|
@@ -35,9 +37,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
35
37
|
static maps = [
|
|
36
38
|
{
|
|
37
39
|
nodeQuery: errorNodeQuery,
|
|
38
|
-
verify: (errorNode,
|
|
40
|
+
verify: (errorNode, context) => {
|
|
39
41
|
const { Error } = dom,
|
|
40
|
-
error = Error.fromErrorNode(errorNode,
|
|
42
|
+
error = Error.fromErrorNode(errorNode, context),
|
|
41
43
|
errorVerifies = error.verify();
|
|
42
44
|
|
|
43
45
|
return errorVerifies;
|
|
@@ -45,9 +47,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
49
|
nodeQuery: ruleNodeQuery,
|
|
48
|
-
verify: (ruleNode,
|
|
50
|
+
verify: (ruleNode, context) => {
|
|
49
51
|
const { Rule } = dom,
|
|
50
|
-
rule = Rule.fromRuleNode(ruleNode,
|
|
52
|
+
rule = Rule.fromRuleNode(ruleNode, context),
|
|
51
53
|
ruleVerifies = rule.verify();
|
|
52
54
|
|
|
53
55
|
return ruleVerifies;
|
|
@@ -55,9 +57,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
55
57
|
},
|
|
56
58
|
{
|
|
57
59
|
nodeQuery: axiomNodeQuery,
|
|
58
|
-
verify: (axiomNode,
|
|
60
|
+
verify: (axiomNode, context) => {
|
|
59
61
|
const { Axiom } = dom,
|
|
60
|
-
axiom = Axiom.fromAxiomNode(axiomNode,
|
|
62
|
+
axiom = Axiom.fromAxiomNode(axiomNode, context),
|
|
61
63
|
axiomVerifies = axiom.verify();
|
|
62
64
|
|
|
63
65
|
return axiomVerifies;
|
|
@@ -65,19 +67,29 @@ class TopLevelVerifier extends Verifier {
|
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
nodeQuery: lemmaNodeQuery,
|
|
68
|
-
verify: (lemmaNode,
|
|
70
|
+
verify: (lemmaNode, context) => {
|
|
69
71
|
const { Lemma } = dom,
|
|
70
|
-
lemma = Lemma.fromLemmaNode(lemmaNode,
|
|
72
|
+
lemma = Lemma.fromLemmaNode(lemmaNode, context),
|
|
71
73
|
lemmaVerifies = lemma.verify();
|
|
72
74
|
|
|
73
75
|
return lemmaVerifies;
|
|
74
76
|
}
|
|
75
77
|
},
|
|
78
|
+
{
|
|
79
|
+
nodeQuery: sectionNodeQuery,
|
|
80
|
+
verify: (sectionNode, context) => {
|
|
81
|
+
const { Section } = dom,
|
|
82
|
+
section = Section.fromSectionNode(sectionNode, context),
|
|
83
|
+
sectionVerifies = section.verify();
|
|
84
|
+
|
|
85
|
+
return sectionVerifies;
|
|
86
|
+
}
|
|
87
|
+
},
|
|
76
88
|
{
|
|
77
89
|
nodeQuery: theoremNodeQuery,
|
|
78
|
-
verify: (theoremNode,
|
|
90
|
+
verify: (theoremNode, context) => {
|
|
79
91
|
const { Theorem } = dom,
|
|
80
|
-
theorem = Theorem.fromTheoremNode(theoremNode,
|
|
92
|
+
theorem = Theorem.fromTheoremNode(theoremNode, context),
|
|
81
93
|
theoremVerifies = theorem.verify();
|
|
82
94
|
|
|
83
95
|
return theoremVerifies;
|
|
@@ -85,9 +97,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
85
97
|
},
|
|
86
98
|
{
|
|
87
99
|
nodeQuery: metaLemmaNodeQuery,
|
|
88
|
-
verify: (metaLemmaNode,
|
|
100
|
+
verify: (metaLemmaNode, context) => {
|
|
89
101
|
const { MetaLemma } = dom,
|
|
90
|
-
metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode,
|
|
102
|
+
metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode, context),
|
|
91
103
|
metaLemmaVerifies = metaLemma.verify();
|
|
92
104
|
|
|
93
105
|
return metaLemmaVerifies;
|
|
@@ -95,9 +107,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
95
107
|
},
|
|
96
108
|
{
|
|
97
109
|
nodeQuery: conjectureNodeQuery,
|
|
98
|
-
verify: (conjectureNode,
|
|
110
|
+
verify: (conjectureNode, context) => {
|
|
99
111
|
const { Conjecture } = dom,
|
|
100
|
-
conjecture = Conjecture.fromConjectureNode(conjectureNode,
|
|
112
|
+
conjecture = Conjecture.fromConjectureNode(conjectureNode, context),
|
|
101
113
|
conjectureVerifies = conjecture.verify();
|
|
102
114
|
|
|
103
115
|
return conjectureVerifies;
|
|
@@ -105,9 +117,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
105
117
|
},
|
|
106
118
|
{
|
|
107
119
|
nodeQuery: metatheoremNodeQuery,
|
|
108
|
-
verify: (metatheoremNode,
|
|
120
|
+
verify: (metatheoremNode, context) => {
|
|
109
121
|
const { Metatheorem } = dom,
|
|
110
|
-
metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode,
|
|
122
|
+
metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode, context),
|
|
111
123
|
metatheoremVerifies = metatheorem.verify();
|
|
112
124
|
|
|
113
125
|
return metatheoremVerifies;
|
|
@@ -115,9 +127,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
115
127
|
},
|
|
116
128
|
{
|
|
117
129
|
nodeQuery: variableDeclarationNodeQuery,
|
|
118
|
-
verify: (variableDeclarationNode,
|
|
130
|
+
verify: (variableDeclarationNode, context) => {
|
|
119
131
|
const { VariableDeclaration } = dom,
|
|
120
|
-
variableDeclaration = VariableDeclaration.fromVariableDeclarationNode(variableDeclarationNode,
|
|
132
|
+
variableDeclaration = VariableDeclaration.fromVariableDeclarationNode(variableDeclarationNode, context),
|
|
121
133
|
variableDeclarationVerifies = variableDeclaration.verify();
|
|
122
134
|
|
|
123
135
|
return variableDeclarationVerifies;
|
|
@@ -125,9 +137,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
125
137
|
},
|
|
126
138
|
{
|
|
127
139
|
nodeQuery: simpleTypeDeclarationNodeQuery,
|
|
128
|
-
verify: (simpleTypeDeclarationNode,
|
|
140
|
+
verify: (simpleTypeDeclarationNode, context) => {
|
|
129
141
|
const { SimpleTypeDeclaration } = dom,
|
|
130
|
-
simpleTypeDeclaration = SimpleTypeDeclaration.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode,
|
|
142
|
+
simpleTypeDeclaration = SimpleTypeDeclaration.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
131
143
|
simpleTypeDeclarationVerifies = simpleTypeDeclaration.verify();
|
|
132
144
|
|
|
133
145
|
return simpleTypeDeclarationVerifies;
|
|
@@ -135,9 +147,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
135
147
|
},
|
|
136
148
|
{
|
|
137
149
|
nodeQuery: combinatorDeclarationNodeQuery,
|
|
138
|
-
verify: (combinatorDeclarationNode,
|
|
150
|
+
verify: (combinatorDeclarationNode, context) => {
|
|
139
151
|
const { CombinatorDeclaration } = dom,
|
|
140
|
-
combinatorDeclaration = CombinatorDeclaration.fromCombinatorDeclarationNode(combinatorDeclarationNode,
|
|
152
|
+
combinatorDeclaration = CombinatorDeclaration.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
|
|
141
153
|
combinatorDeclarationVerifies = combinatorDeclaration.verify();
|
|
142
154
|
|
|
143
155
|
return combinatorDeclarationVerifies;
|
|
@@ -145,9 +157,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
145
157
|
},
|
|
146
158
|
{
|
|
147
159
|
nodeQuery: constructorDeclarationNodeQuery,
|
|
148
|
-
verify: (constructorDeclarationNode,
|
|
160
|
+
verify: (constructorDeclarationNode, context) => {
|
|
149
161
|
const { ConstructorDeclaration } = dom,
|
|
150
|
-
constructorDeclaration = ConstructorDeclaration.fromConstructorDeclarationNode(constructorDeclarationNode,
|
|
162
|
+
constructorDeclaration = ConstructorDeclaration.fromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
151
163
|
constructorDeclarationVerifies = constructorDeclaration.verify();
|
|
152
164
|
|
|
153
165
|
return constructorDeclarationVerifies;
|
|
@@ -155,9 +167,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
155
167
|
},
|
|
156
168
|
{
|
|
157
169
|
nodeQuery: complexTypeDeclarationNodeQuery,
|
|
158
|
-
verify: (complexTypeDeclarationNode,
|
|
170
|
+
verify: (complexTypeDeclarationNode, context) => {
|
|
159
171
|
const { ComplexTypeDeclaration } = dom,
|
|
160
|
-
complexTypeDeclaration = ComplexTypeDeclaration.fromComplexTypeDeclarationNode(complexTypeDeclarationNode,
|
|
172
|
+
complexTypeDeclaration = ComplexTypeDeclaration.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
161
173
|
complexTypeDeclarationVerifies = complexTypeDeclaration.verify();
|
|
162
174
|
|
|
163
175
|
return complexTypeDeclarationVerifies;
|
|
@@ -165,9 +177,9 @@ class TopLevelVerifier extends Verifier {
|
|
|
165
177
|
},
|
|
166
178
|
{
|
|
167
179
|
nodeQuery: metavariableDeclarationNodeQuery,
|
|
168
|
-
verify: (metavariableDeclarationNode,
|
|
180
|
+
verify: (metavariableDeclarationNode, context) => {
|
|
169
181
|
const { MetavariableDeclaration } = dom,
|
|
170
|
-
metavariableDeclaration = MetavariableDeclaration.fromMetavariableDeclarationNode(metavariableDeclarationNode,
|
|
182
|
+
metavariableDeclaration = MetavariableDeclaration.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
171
183
|
metavariableDeclarationVerifies = metavariableDeclaration.verify();
|
|
172
184
|
|
|
173
185
|
return metavariableDeclarationVerifies;
|