occam-verify-cli 1.0.317 → 1.0.318
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/file.js +39 -6
- package/lib/context/local.js +13 -1
- package/lib/context/release.js +33 -2
- package/lib/dom/declaration/combinator.js +2 -2
- package/lib/dom/declaration/complexType.js +2 -2
- package/lib/dom/declaration/constructor.js +2 -2
- package/lib/dom/declaration/simpleType.js +4 -4
- package/lib/dom/declaration/typePrefix.js +170 -0
- package/lib/dom/typePrefix.js +100 -0
- package/lib/index.js +3 -1
- package/lib/node/declaration/typePrefix.js +123 -0
- package/lib/node/type.js +12 -14
- package/lib/node/typePrefix.js +6 -6
- package/lib/nonTerminalNodeMap.js +6 -4
- package/lib/ruleNames.js +11 -3
- package/lib/utilities/json.js +2 -2
- package/lib/verifier/topLevel.js +9 -2
- package/package.json +1 -1
- package/src/context/file.js +44 -6
- package/src/context/local.js +4 -0
- package/src/context/release.js +41 -1
- package/src/dom/declaration/combinator.js +1 -1
- package/src/dom/declaration/complexType.js +1 -1
- package/src/dom/declaration/constructor.js +1 -1
- package/src/dom/declaration/simpleType.js +3 -3
- package/src/dom/declaration/typePrefix.js +93 -0
- package/src/dom/typePrefix.js +54 -0
- package/src/index.js +2 -0
- package/src/node/declaration/typePrefix.js +24 -0
- package/src/node/type.js +12 -16
- package/src/node/typePrefix.js +4 -4
- package/src/nonTerminalNodeMap.js +45 -39
- package/src/ruleNames.js +4 -2
- package/src/utilities/json.js +1 -1
- package/src/verifier/topLevel.js +11 -0
|
@@ -22,7 +22,7 @@ import PropertyNode from "./node/property";
|
|
|
22
22
|
import MetaTypeNode from "./node/metaType";
|
|
23
23
|
import EqualityNode from "./node/equality";
|
|
24
24
|
import VariableNode from "./node/variable";
|
|
25
|
-
import
|
|
25
|
+
import RuleBodyNode from "./node/body/rule";
|
|
26
26
|
import StatementNode from "./node/statement";
|
|
27
27
|
import ReferenceNode from "./node/reference";
|
|
28
28
|
import DeductionNode from "./node/deduction";
|
|
@@ -30,37 +30,38 @@ import JudgementNode from "./node/judgement";
|
|
|
30
30
|
import MetaLemmaNode from "./node/metaLemma";
|
|
31
31
|
import ParameterNode from "./node/parameter";
|
|
32
32
|
import SignatureNode from "./node/signature";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
33
|
+
import AxiomBodyNode from "./node/body/axiom";
|
|
34
|
+
import LemmaBodyNode from "./node/body/lemma";
|
|
35
35
|
import DerivationNode from "./node/derivation";
|
|
36
36
|
import CombinatorNode from "./node/combinator";
|
|
37
37
|
import ConclusionNode from "./node/conclusion";
|
|
38
38
|
import ConjectureNode from "./node/conjecture";
|
|
39
39
|
import HypothesisNode from "./node/hypothesis";
|
|
40
|
-
import
|
|
40
|
+
import TypePrefixNode from "./node/typePrefix";
|
|
41
|
+
import RuleHeaderNode from "./node/header/rule";
|
|
41
42
|
import SuppositionNode from "./node/supposition";
|
|
42
43
|
import ConstructorNode from "./node/constructor";
|
|
43
44
|
import DeclarationNode from "./node/declaration";
|
|
44
45
|
import MetatheoremNode from "./node/metatheorem";
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
46
|
+
import TheoremBodyNode from "./node/body/theorem";
|
|
47
|
+
import AxiomHeaderNode from "./node/header/axiom";
|
|
48
|
+
import LemmaHeaderNode from "./node/header/lemma";
|
|
48
49
|
import MetaArgumentNode from "./node/metaArgument";
|
|
49
50
|
import MetavariableNode from "./node/metavariable";
|
|
50
51
|
import QualificationNode from "./node/qualification";
|
|
51
|
-
import theoremHeaderNode from "./node/header/theorem";
|
|
52
|
-
import metaLemmaBodyNode from "./node/body/metaLemma";
|
|
53
52
|
import ProcedureCallNode from "./node/procedureCall";
|
|
54
53
|
import SubDerivationNode from "./node/subDerivation";
|
|
54
|
+
import TheoremHeaderNode from "./node/header/theorem";
|
|
55
|
+
import MetaLemmaBodyNode from "./node/body/metaLemma";
|
|
55
56
|
import TypeAssertionNode from "./node/assertion/type";
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
57
|
+
import ConjectureBodyNode from "./node/body/conjecture";
|
|
58
|
+
import MetatheoremBodyNode from "./node/body/metatheorem";
|
|
59
|
+
import MetaLemmaHeaderNode from "./node/header/metaLemma";
|
|
59
60
|
import PropertyRelationNode from "./node/propertyRelation"
|
|
60
61
|
import DefinedAssertionNode from "./node/assertion/defined";
|
|
61
62
|
import TermSubstitutionNode from "./node/substitution/term";
|
|
62
|
-
import
|
|
63
|
-
import
|
|
63
|
+
import ConjectureHeaderNode from "./node/header/conjecture";
|
|
64
|
+
import MetatheoremHeaderNode from "./node/header/metatheorem";
|
|
64
65
|
import PropertyAssertionNode from "./node/assertion/property";
|
|
65
66
|
import SubproofAssertionNode from "./node/assertion/subproof";
|
|
66
67
|
import FrameSubstitutionNode from "./node/substitution/frame";
|
|
@@ -69,13 +70,14 @@ import ContainedAssertionNode from "./node/assertion/contained";
|
|
|
69
70
|
import SatisfiesAssertionNode from "./node/assertion/satisfies";
|
|
70
71
|
import ParenthesisedLabelsNode from "./node/parenthesisedLabels"
|
|
71
72
|
import PropertyDeclarationNode from "./node/declaration/property";
|
|
72
|
-
import
|
|
73
|
+
import VariableDeclarationNode from "./node/declaration/variable";
|
|
73
74
|
import StatementSubstitutionNode from "./node/substitution/statement";
|
|
74
75
|
import SimpleTypeDeclarationNode from "./node/declaration/simpleType";
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import
|
|
76
|
+
import CombinatorDeclarationNode from "./node/declaration/combinator";
|
|
77
|
+
import TypePrefixDeclarationNode from "./node/declaration/typePrefix";
|
|
78
|
+
import ComplexTypeDeclarationNode from "./node/declaration/complexType";
|
|
79
|
+
import DonstructorDeclarationNode from "./node/declaration/constructor";
|
|
80
|
+
import MetavariableDeclarationNode from "./node/declaration/metavariable";
|
|
79
81
|
|
|
80
82
|
import { RULE_RULE_NAME,
|
|
81
83
|
STEP_RULE_NAME,
|
|
@@ -114,10 +116,11 @@ import { RULE_RULE_NAME,
|
|
|
114
116
|
HYPOTHESIS_RULE_NAME,
|
|
115
117
|
AXIOM_BODY_RULE_NAME,
|
|
116
118
|
LEMMA_BODY_RULE_NAME,
|
|
119
|
+
TYPE_PREFIX_RULE_NAME,
|
|
120
|
+
SUPPOSITION_RULE_NAME,
|
|
117
121
|
RULE_HEADER_RULE_NAME,
|
|
118
122
|
CONSTRUCTOR_RULE_NAME,
|
|
119
123
|
DECLARATION_RULE_NAME,
|
|
120
|
-
SUPPOSITION_RULE_NAME,
|
|
121
124
|
METATHEOREM_RULE_NAME,
|
|
122
125
|
AXIOM_HEADER_RULE_NAME,
|
|
123
126
|
LEMMA_HEADER_RULE_NAME,
|
|
@@ -151,6 +154,7 @@ import { RULE_RULE_NAME,
|
|
|
151
154
|
COMBINATOR_DECLARATION_RULE_NAME,
|
|
152
155
|
SIMPLE_TYPE_DECLARATION_RULE_NAME,
|
|
153
156
|
CONSTRUCTOR_DECLARATION_RULE_NAME,
|
|
157
|
+
TYPE_PREFIX_DECLARATION_RULE_NAME,
|
|
154
158
|
COMPLEX_TYPE_DECLARATION_RULE_NAME,
|
|
155
159
|
METAVARIABLE_DECLARATION_RULE_NAME } from "./ruleNames";
|
|
156
160
|
|
|
@@ -176,7 +180,7 @@ const NonTerminalNodeMap = {
|
|
|
176
180
|
[EQUALITY_RULE_NAME]: EqualityNode,
|
|
177
181
|
[VARIABLE_RULE_NAME]: VariableNode,
|
|
178
182
|
[NONSENSE_RULE_NAME]: NonsenseNode,
|
|
179
|
-
[RULE_BODY_RULE_NAME]:
|
|
183
|
+
[RULE_BODY_RULE_NAME]: RuleBodyNode,
|
|
180
184
|
[META_TYPE_RULE_NAME]: MetaTypeNode,
|
|
181
185
|
[SIGNATURE_RULE_NAME]: SignatureNode,
|
|
182
186
|
[REFERENCE_RULE_NAME]: ReferenceNode,
|
|
@@ -184,38 +188,39 @@ const NonTerminalNodeMap = {
|
|
|
184
188
|
[DEDUCTION_RULE_NAME]: DeductionNode,
|
|
185
189
|
[PARAMETER_RULE_NAME]: ParameterNode,
|
|
186
190
|
[STATEMENT_RULE_NAME]: StatementNode,
|
|
187
|
-
[AXIOM_BODY_RULE_NAME]:
|
|
188
|
-
[LEMMA_BODY_RULE_NAME]:
|
|
191
|
+
[AXIOM_BODY_RULE_NAME]: AxiomBodyNode,
|
|
192
|
+
[LEMMA_BODY_RULE_NAME]: LemmaBodyNode,
|
|
189
193
|
[META_LEMMA_RULE_NAME]: MetaLemmaNode,
|
|
190
194
|
[COMBINATOR_RULE_NAME]: CombinatorNode,
|
|
191
195
|
[CONCLUSION_RULE_NAME]: ConclusionNode,
|
|
192
196
|
[CONJECTURE_RULE_NAME]: ConjectureNode,
|
|
193
197
|
[DERIVATION_RULE_NAME]: DerivationNode,
|
|
194
198
|
[HYPOTHESIS_RULE_NAME]: HypothesisNode,
|
|
195
|
-
[RULE_HEADER_RULE_NAME]:
|
|
199
|
+
[RULE_HEADER_RULE_NAME]: RuleHeaderNode,
|
|
200
|
+
[TYPE_PREFIX_RULE_NAME]: TypePrefixNode,
|
|
196
201
|
[SUPPOSITION_RULE_NAME]: SuppositionNode,
|
|
197
202
|
[CONSTRUCTOR_RULE_NAME]: ConstructorNode,
|
|
198
203
|
[DECLARATION_RULE_NAME]: DeclarationNode,
|
|
199
204
|
[METATHEOREM_RULE_NAME]: MetatheoremNode,
|
|
200
|
-
[AXIOM_HEADER_RULE_NAME]:
|
|
201
|
-
[LEMMA_HEADER_RULE_NAME]:
|
|
202
|
-
[THEOREM_BODY_RULE_NAME]:
|
|
205
|
+
[AXIOM_HEADER_RULE_NAME]: AxiomHeaderNode,
|
|
206
|
+
[LEMMA_HEADER_RULE_NAME]: LemmaHeaderNode,
|
|
207
|
+
[THEOREM_BODY_RULE_NAME]: TheoremBodyNode,
|
|
203
208
|
[METAVARIABLE_RULE_NAME]: MetavariableNode,
|
|
204
209
|
[META_ARGUMENT_RULE_NAME]: MetaArgumentNode,
|
|
205
210
|
[QUALIFICATION_RULE_NAME]: QualificationNode,
|
|
206
211
|
[TYPE_ASSERTION_RULE_NAME]: TypeAssertionNode,
|
|
207
212
|
[PROCEDURE_CALL_RULE_NAME]: ProcedureCallNode,
|
|
208
213
|
[SUB_DERIVATION_RULE_NAME]: SubDerivationNode,
|
|
209
|
-
[THEOREM_HEADER_RULE_NAME]:
|
|
210
|
-
[META_LEMMA_BODY_RULE_NAME]:
|
|
211
|
-
[CONJECTURE_BODY_RULE_NAME]:
|
|
212
|
-
[METATHEOREM_BODY_RULE_NAME]:
|
|
213
|
-
[META_LEMMA_HEADER_RULE_NAME]:
|
|
214
|
-
[CONJECTURE_HEADER_RULE_NAME]:
|
|
214
|
+
[THEOREM_HEADER_RULE_NAME]: TheoremHeaderNode,
|
|
215
|
+
[META_LEMMA_BODY_RULE_NAME]: MetaLemmaBodyNode,
|
|
216
|
+
[CONJECTURE_BODY_RULE_NAME]: ConjectureBodyNode,
|
|
217
|
+
[METATHEOREM_BODY_RULE_NAME]: MetatheoremBodyNode,
|
|
218
|
+
[META_LEMMA_HEADER_RULE_NAME]: MetaLemmaHeaderNode,
|
|
219
|
+
[CONJECTURE_HEADER_RULE_NAME]: ConjectureHeaderNode,
|
|
215
220
|
[PROPERTY_RELATION_RULE_NAME]: PropertyRelationNode,
|
|
216
221
|
[DEFINED_ASSERTION_RULE_NAME]: DefinedAssertionNode,
|
|
217
222
|
[TERM_SUBSTITUTION_RULE_NAME]: TermSubstitutionNode,
|
|
218
|
-
[METATHEOREM_HEADER_RULE_NAME]:
|
|
223
|
+
[METATHEOREM_HEADER_RULE_NAME]: MetatheoremHeaderNode,
|
|
219
224
|
[SUBPROOF_ASSERTION_RULE_NAME]: SubproofAssertionNode,
|
|
220
225
|
[PROPERTY_ASSERTION_RULE_NAME]: PropertyAssertionNode,
|
|
221
226
|
[FRAME_SUBSTITUTION_RULE_NAME]: FrameSubstitutionNode,
|
|
@@ -223,14 +228,15 @@ const NonTerminalNodeMap = {
|
|
|
223
228
|
[SATISFIES_ASSERTION_RULE_NAME]: SatisfiesAssertionNode,
|
|
224
229
|
[CONTAINED_ASSERTION_RULE_NAME]: ContainedAssertionNode,
|
|
225
230
|
[PARENTHESISED_LABELS_RULE_NAME]: ParenthesisedLabelsNode,
|
|
226
|
-
[VARIABLE_DECLARATION_RULE_NAME]:
|
|
231
|
+
[VARIABLE_DECLARATION_RULE_NAME]: VariableDeclarationNode,
|
|
227
232
|
[PROPERTY_DECLARATION_RULE_NAME]: PropertyDeclarationNode,
|
|
228
233
|
[STATEMENT_SUBSTITUTION_RULE_NAME]: StatementSubstitutionNode,
|
|
229
|
-
[COMBINATOR_DECLARATION_RULE_NAME]:
|
|
234
|
+
[COMBINATOR_DECLARATION_RULE_NAME]: CombinatorDeclarationNode,
|
|
230
235
|
[SIMPLE_TYPE_DECLARATION_RULE_NAME]: SimpleTypeDeclarationNode,
|
|
231
|
-
[
|
|
232
|
-
[
|
|
233
|
-
[
|
|
236
|
+
[TYPE_PREFIX_DECLARATION_RULE_NAME]: TypePrefixDeclarationNode,
|
|
237
|
+
[CONSTRUCTOR_DECLARATION_RULE_NAME]: DonstructorDeclarationNode,
|
|
238
|
+
[COMPLEX_TYPE_DECLARATION_RULE_NAME]: ComplexTypeDeclarationNode,
|
|
239
|
+
[METAVARIABLE_DECLARATION_RULE_NAME]: MetavariableDeclarationNode
|
|
234
240
|
};
|
|
235
241
|
|
|
236
242
|
export default NonTerminalNodeMap;
|
package/src/ruleNames.js
CHANGED
|
@@ -37,6 +37,7 @@ export const DERIVATION_RULE_NAME = "derivation";
|
|
|
37
37
|
export const HYPOTHESIS_RULE_NAME = "hypothesis";
|
|
38
38
|
export const AXIOM_BODY_RULE_NAME = "axiomBody";
|
|
39
39
|
export const LEMMA_BODY_RULE_NAME = "lemmaBody";
|
|
40
|
+
export const TYPE_PREFIX_RULE_NAME = "typePrefix";
|
|
40
41
|
export const SUPPOSITION_RULE_NAME = "supposition";
|
|
41
42
|
export const CONSTRUCTOR_RULE_NAME = "constructor";
|
|
42
43
|
export const DECLARATION_RULE_NAME = "declaration";
|
|
@@ -52,14 +53,14 @@ export const PROCEDURE_CALL_RULE_NAME = "procedureCall";
|
|
|
52
53
|
export const SUB_DERIVATION_RULE_NAME = "subDerivation";
|
|
53
54
|
export const TYPE_ASSERTION_RULE_NAME = "typeAssertion";
|
|
54
55
|
export const THEOREM_HEADER_RULE_NAME = "theoremHeader";
|
|
55
|
-
export const CONJECTURE_BODY_RULE_NAME = "conjectureBody";
|
|
56
56
|
export const META_LEMMA_BODY_RULE_NAME = "metaLemmaBody";
|
|
57
|
+
export const CONJECTURE_BODY_RULE_NAME = "conjectureBody";
|
|
57
58
|
export const METATHEOREM_BODY_RULE_NAME = "metatheoremBody";
|
|
59
|
+
export const META_LEMMA_HEADER_RULE_NAME = "metaLemmaHeader";
|
|
58
60
|
export const PROPERTY_RELATION_RULE_NAME = "propertyRelation";
|
|
59
61
|
export const DEFINED_ASSERTION_RULE_NAME = "definedAssertion";
|
|
60
62
|
export const TERM_SUBSTITUTION_RULE_NAME = "termSubstitution";
|
|
61
63
|
export const CONJECTURE_HEADER_RULE_NAME = "conjectureHeader";
|
|
62
|
-
export const META_LEMMA_HEADER_RULE_NAME = "metaLemmaHeader";
|
|
63
64
|
export const METATHEOREM_HEADER_RULE_NAME = "metatheoremHeader";
|
|
64
65
|
export const PROPERTY_ASSERTION_RULE_NAME = "propertyAssertion";
|
|
65
66
|
export const SUBPROOF_ASSERTION_RULE_NAME = "subproofAssertion";
|
|
@@ -72,6 +73,7 @@ export const PROPERTY_DECLARATION_RULE_NAME = "propertyDeclaration";
|
|
|
72
73
|
export const VARIABLE_DECLARATION_RULE_NAME = "variableDeclaration";
|
|
73
74
|
export const STATEMENT_SUBSTITUTION_RULE_NAME = "statementSubstitution";
|
|
74
75
|
export const COMBINATOR_DECLARATION_RULE_NAME = "combinatorDeclaration";
|
|
76
|
+
export const TYPE_PREFIX_DECLARATION_RULE_NAME = "typePrefixDeclaration";
|
|
75
77
|
export const SIMPLE_TYPE_DECLARATION_RULE_NAME = "simpleTypeDeclaration";
|
|
76
78
|
export const CONSTRUCTOR_DECLARATION_RULE_NAME = "constructorDeclaration";
|
|
77
79
|
export const COMPLEX_TYPE_DECLARATION_RULE_NAME = "complexTypeDeclaration";
|
package/src/utilities/json.js
CHANGED
|
@@ -373,7 +373,7 @@ export function combinatorsFromJSON(json, context) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
export function typePrefixesFromJSON(json, context) {
|
|
376
|
-
let { typePrefixes } = json;
|
|
376
|
+
let { typePrefixes = [] } = json;
|
|
377
377
|
|
|
378
378
|
const { TypePrefix } = dom,
|
|
379
379
|
typePrefixesJSON = typePrefixes; ///
|
package/src/verifier/topLevel.js
CHANGED
|
@@ -17,6 +17,7 @@ const errorNodeQuery = nodeQuery("/error"),
|
|
|
17
17
|
variableDeclarationNodeQuery = nodeQuery("/variableDeclaration"),
|
|
18
18
|
combinatorDeclarationNodeQuery = nodeQuery("/combinatorDeclaration"),
|
|
19
19
|
simpleTypeDeclarationNodeQuery = nodeQuery("/simpleTypeDeclaration"),
|
|
20
|
+
typePrefixDeclarationNodeQuery = nodeQuery("/typePrefixDeclaration"),
|
|
20
21
|
constructorDeclarationNodeQuery = nodeQuery("/constructorDeclaration"),
|
|
21
22
|
complexTypeDeclarationNodeQuery = nodeQuery("/complexTypeDeclaration"),
|
|
22
23
|
metavariableDeclarationNodeQuery = nodeQuery("/metavariableDeclaration");
|
|
@@ -145,6 +146,16 @@ class TopLevelVerifier extends Verifier {
|
|
|
145
146
|
return simpleTypeDeclarationVerifies;
|
|
146
147
|
}
|
|
147
148
|
},
|
|
149
|
+
{
|
|
150
|
+
nodeQuery: typePrefixDeclarationNodeQuery,
|
|
151
|
+
verify: (typePrefixDeclarationNode, context) => {
|
|
152
|
+
const { TypePrefixDeclaration } = dom,
|
|
153
|
+
typePrefixDeclaration = TypePrefixDeclaration.fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
|
|
154
|
+
typePrefixDeclarationVerifies = typePrefixDeclaration.verify();
|
|
155
|
+
|
|
156
|
+
return typePrefixDeclarationVerifies;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
148
159
|
{
|
|
149
160
|
nodeQuery: combinatorDeclarationNodeQuery,
|
|
150
161
|
verify: (combinatorDeclarationNode, context) => {
|