occam-verify-cli 1.0.317 → 1.0.320
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 +44 -17
- package/lib/context/local.js +15 -2
- package/lib/context/release.js +33 -2
- package/lib/dom/declaration/combinator.js +2 -2
- package/lib/dom/declaration/complexType.js +25 -15
- package/lib/dom/declaration/constructor.js +2 -2
- package/lib/dom/declaration/simpleType.js +26 -16
- package/lib/dom/declaration/typePrefix.js +176 -0
- package/lib/dom/property.js +3 -3
- package/lib/dom/topLevelAssertion.js +1 -43
- package/lib/dom/type.js +53 -17
- package/lib/dom/typePrefix.js +100 -0
- package/lib/dom/variable.js +2 -2
- package/lib/index.js +3 -1
- package/lib/node/declaration/complexType.js +15 -1
- package/lib/node/declaration/simpleType.js +15 -1
- package/lib/node/declaration/typePrefix.js +123 -0
- package/lib/node/type.js +27 -17
- 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/utilities/node.js +10 -4
- package/lib/utilities/type.js +10 -5
- package/lib/verifier/topLevel.js +9 -2
- package/package.json +1 -1
- package/src/context/file.js +47 -24
- package/src/context/local.js +5 -1
- package/src/context/release.js +41 -1
- package/src/dom/declaration/combinator.js +1 -1
- package/src/dom/declaration/complexType.js +29 -19
- package/src/dom/declaration/constructor.js +1 -1
- package/src/dom/declaration/simpleType.js +29 -20
- package/src/dom/declaration/typePrefix.js +102 -0
- package/src/dom/property.js +1 -1
- package/src/dom/topLevelAssertion.js +3 -15
- package/src/dom/type.js +77 -20
- package/src/dom/typePrefix.js +54 -0
- package/src/dom/variable.js +1 -1
- package/src/index.js +2 -0
- package/src/node/declaration/complexType.js +14 -0
- package/src/node/declaration/simpleType.js +14 -0
- package/src/node/declaration/typePrefix.js +24 -0
- package/src/node/type.js +29 -17
- 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/utilities/node.js +13 -4
- package/src/utilities/type.js +12 -5
- package/src/verifier/topLevel.js +11 -0
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/utilities/node.js
CHANGED
|
@@ -4,7 +4,7 @@ import dom from "../dom";
|
|
|
4
4
|
|
|
5
5
|
import { objectType } from "../dom/type";
|
|
6
6
|
|
|
7
|
-
export function typeFromTypeNode(typeNode) {
|
|
7
|
+
export function typeFromTypeNode(typeNode, context) {
|
|
8
8
|
let type;
|
|
9
9
|
|
|
10
10
|
if (typeNode === null) {
|
|
@@ -12,13 +12,22 @@ export function typeFromTypeNode(typeNode) {
|
|
|
12
12
|
} else {
|
|
13
13
|
const { Type } = dom,
|
|
14
14
|
typeName = typeNode.getTypeName(),
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
typePrefixName = typeNode.getTypePrefixName();
|
|
16
|
+
|
|
17
|
+
let string;
|
|
18
|
+
|
|
19
|
+
string = typeName; ///
|
|
20
|
+
|
|
21
|
+
if (typePrefixName !== null) {
|
|
22
|
+
string = `${typePrefixName}${string}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const name = typeName, ///
|
|
17
26
|
superTypes = null,
|
|
18
27
|
properties = null,
|
|
19
28
|
provisional = null;
|
|
20
29
|
|
|
21
|
-
type = new Type(string, name, superTypes, properties, provisional);
|
|
30
|
+
type = new Type(context, string, name, superTypes, properties, provisional);
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
return type;
|
package/src/utilities/type.js
CHANGED
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import { objectType } from "../dom/type";
|
|
4
4
|
|
|
5
|
-
export function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export function stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes) {
|
|
6
|
+
let string;
|
|
7
|
+
|
|
8
|
+
string = (typePrefixName !== null) ?
|
|
9
|
+
`${typePrefixName}${typeName}`:
|
|
10
|
+
typeName;
|
|
11
|
+
|
|
12
|
+
const superTypesString = superTypesStringFromSuperTypes(superTypes);
|
|
13
|
+
|
|
14
|
+
if (superTypesString !== null) {
|
|
15
|
+
string = `${string}:${superTypesString}`;
|
|
16
|
+
}
|
|
10
17
|
|
|
11
18
|
return string;
|
|
12
19
|
}
|
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) => {
|