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.
Files changed (51) hide show
  1. package/lib/context/file.js +44 -17
  2. package/lib/context/local.js +15 -2
  3. package/lib/context/release.js +33 -2
  4. package/lib/dom/declaration/combinator.js +2 -2
  5. package/lib/dom/declaration/complexType.js +25 -15
  6. package/lib/dom/declaration/constructor.js +2 -2
  7. package/lib/dom/declaration/simpleType.js +26 -16
  8. package/lib/dom/declaration/typePrefix.js +176 -0
  9. package/lib/dom/property.js +3 -3
  10. package/lib/dom/topLevelAssertion.js +1 -43
  11. package/lib/dom/type.js +53 -17
  12. package/lib/dom/typePrefix.js +100 -0
  13. package/lib/dom/variable.js +2 -2
  14. package/lib/index.js +3 -1
  15. package/lib/node/declaration/complexType.js +15 -1
  16. package/lib/node/declaration/simpleType.js +15 -1
  17. package/lib/node/declaration/typePrefix.js +123 -0
  18. package/lib/node/type.js +27 -17
  19. package/lib/node/typePrefix.js +6 -6
  20. package/lib/nonTerminalNodeMap.js +6 -4
  21. package/lib/ruleNames.js +11 -3
  22. package/lib/utilities/json.js +2 -2
  23. package/lib/utilities/node.js +10 -4
  24. package/lib/utilities/type.js +10 -5
  25. package/lib/verifier/topLevel.js +9 -2
  26. package/package.json +1 -1
  27. package/src/context/file.js +47 -24
  28. package/src/context/local.js +5 -1
  29. package/src/context/release.js +41 -1
  30. package/src/dom/declaration/combinator.js +1 -1
  31. package/src/dom/declaration/complexType.js +29 -19
  32. package/src/dom/declaration/constructor.js +1 -1
  33. package/src/dom/declaration/simpleType.js +29 -20
  34. package/src/dom/declaration/typePrefix.js +102 -0
  35. package/src/dom/property.js +1 -1
  36. package/src/dom/topLevelAssertion.js +3 -15
  37. package/src/dom/type.js +77 -20
  38. package/src/dom/typePrefix.js +54 -0
  39. package/src/dom/variable.js +1 -1
  40. package/src/index.js +2 -0
  41. package/src/node/declaration/complexType.js +14 -0
  42. package/src/node/declaration/simpleType.js +14 -0
  43. package/src/node/declaration/typePrefix.js +24 -0
  44. package/src/node/type.js +29 -17
  45. package/src/node/typePrefix.js +4 -4
  46. package/src/nonTerminalNodeMap.js +45 -39
  47. package/src/ruleNames.js +4 -2
  48. package/src/utilities/json.js +1 -1
  49. package/src/utilities/node.js +13 -4
  50. package/src/utilities/type.js +12 -5
  51. 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";
@@ -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; ///
@@ -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
- name = typeName, ///
16
- string = name, ///
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;
@@ -2,11 +2,18 @@
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; ///
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
  }
@@ -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) => {