occam-verify-cli 1.0.166 → 1.0.168

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 (147) hide show
  1. package/lib/assignment/variable.js +3 -3
  2. package/lib/context/file.js +6 -4
  3. package/lib/context/release.js +32 -3
  4. package/lib/dom/assertion/type.js +10 -15
  5. package/lib/dom/combinator/bracketed.js +25 -4
  6. package/lib/dom/constructor.js +6 -29
  7. package/lib/dom/declaration/complexType.js +26 -60
  8. package/lib/dom/declaration/constructor.js +10 -15
  9. package/lib/dom/declaration/metavariable.js +10 -15
  10. package/lib/dom/declaration/type.js +20 -46
  11. package/lib/dom/declaration/variable.js +19 -19
  12. package/lib/dom/property.js +3 -3
  13. package/lib/dom/propertyRelation.js +3 -3
  14. package/lib/dom/term.js +4 -4
  15. package/lib/dom/type.js +80 -68
  16. package/lib/dom/variable.js +24 -52
  17. package/lib/equivalence.js +3 -3
  18. package/lib/node/assertion/contained.js +131 -0
  19. package/lib/node/assertion/defined.js +131 -0
  20. package/lib/node/assertion/property.js +131 -0
  21. package/lib/node/assertion/satisfies.js +131 -0
  22. package/lib/node/assertion/subproof.js +131 -0
  23. package/lib/node/assertion/type.js +131 -0
  24. package/lib/node/axiom.js +131 -0
  25. package/lib/node/combinator.js +131 -0
  26. package/lib/node/conclusion.js +131 -0
  27. package/lib/node/conjecture.js +131 -0
  28. package/lib/node/constructor.js +131 -0
  29. package/lib/node/declaration/combinator.js +131 -0
  30. package/lib/node/declaration/complexType.js +131 -0
  31. package/lib/node/declaration/constructor.js +131 -0
  32. package/lib/node/declaration/metavariable.js +131 -0
  33. package/lib/node/declaration/type.js +131 -0
  34. package/lib/node/declaration/variable.js +131 -0
  35. package/lib/node/declaration.js +131 -0
  36. package/lib/node/deduction.js +131 -0
  37. package/lib/node/derivation.js +131 -0
  38. package/lib/node/equality.js +131 -0
  39. package/lib/node/error.js +131 -0
  40. package/lib/node/frame.js +131 -0
  41. package/lib/node/judgement.js +131 -0
  42. package/lib/node/label.js +131 -0
  43. package/lib/node/lemma.js +131 -0
  44. package/lib/node/metaLemma.js +131 -0
  45. package/lib/node/metaType.js +131 -0
  46. package/lib/node/metatheorem.js +131 -0
  47. package/lib/node/metavariable.js +131 -0
  48. package/lib/node/parameter.js +131 -0
  49. package/lib/node/premise.js +131 -0
  50. package/lib/node/procedureCall.js +131 -0
  51. package/lib/node/proof.js +131 -0
  52. package/lib/node/property.js +131 -0
  53. package/lib/node/propertyRelation.js +131 -0
  54. package/lib/node/reference.js +131 -0
  55. package/lib/node/rule.js +131 -0
  56. package/lib/node/statement.js +131 -0
  57. package/lib/node/step.js +131 -0
  58. package/lib/node/subDerivation.js +131 -0
  59. package/lib/node/subproof.js +131 -0
  60. package/lib/node/supposition.js +131 -0
  61. package/lib/node/term.js +131 -0
  62. package/lib/node/theorem.js +131 -0
  63. package/lib/node/topLevelAssertion.js +131 -0
  64. package/lib/node/topLevelMetaAssertion.js +131 -0
  65. package/lib/node/type.js +131 -0
  66. package/lib/node/variable.js +131 -0
  67. package/lib/node.js +80 -0
  68. package/lib/nodeMap.js +80 -0
  69. package/lib/nominal/lexer.js +114 -0
  70. package/lib/nominal/parser.js +128 -0
  71. package/lib/ruleNames.js +198 -0
  72. package/lib/utilities/parser.js +21 -0
  73. package/lib/utilities/type.js +23 -0
  74. package/package.json +3 -2
  75. package/src/assignment/variable.js +4 -4
  76. package/src/context/file.js +10 -7
  77. package/src/context/release.js +8 -3
  78. package/src/dom/assertion/type.js +11 -16
  79. package/src/dom/combinator/bracketed.js +1 -6
  80. package/src/dom/constructor.js +5 -36
  81. package/src/dom/declaration/complexType.js +41 -52
  82. package/src/dom/declaration/constructor.js +11 -15
  83. package/src/dom/declaration/metavariable.js +11 -15
  84. package/src/dom/declaration/type.js +19 -44
  85. package/src/dom/declaration/variable.js +29 -21
  86. package/src/dom/property.js +2 -2
  87. package/src/dom/propertyRelation.js +2 -2
  88. package/src/dom/term.js +3 -3
  89. package/src/dom/type.js +120 -89
  90. package/src/dom/variable.js +27 -64
  91. package/src/equivalence.js +2 -2
  92. package/src/node/assertion/contained.js +5 -0
  93. package/src/node/assertion/defined.js +5 -0
  94. package/src/node/assertion/property.js +5 -0
  95. package/src/node/assertion/satisfies.js +5 -0
  96. package/src/node/assertion/subproof.js +5 -0
  97. package/src/node/assertion/type.js +5 -0
  98. package/src/node/axiom.js +5 -0
  99. package/src/node/combinator.js +5 -0
  100. package/src/node/conclusion.js +5 -0
  101. package/src/node/conjecture.js +5 -0
  102. package/src/node/constructor.js +5 -0
  103. package/src/node/declaration/combinator.js +5 -0
  104. package/src/node/declaration/complexType.js +5 -0
  105. package/src/node/declaration/constructor.js +5 -0
  106. package/src/node/declaration/metavariable.js +5 -0
  107. package/src/node/declaration/type.js +5 -0
  108. package/src/node/declaration/variable.js +5 -0
  109. package/src/node/declaration.js +5 -0
  110. package/src/node/deduction.js +5 -0
  111. package/src/node/derivation.js +5 -0
  112. package/src/node/equality.js +5 -0
  113. package/src/node/error.js +5 -0
  114. package/src/node/frame.js +5 -0
  115. package/src/node/judgement.js +5 -0
  116. package/src/node/label.js +5 -0
  117. package/src/node/lemma.js +5 -0
  118. package/src/node/metaLemma.js +5 -0
  119. package/src/node/metaType.js +5 -0
  120. package/src/node/metatheorem.js +5 -0
  121. package/src/node/metavariable.js +5 -0
  122. package/src/node/parameter.js +5 -0
  123. package/src/node/premise.js +5 -0
  124. package/src/node/procedureCall.js +5 -0
  125. package/src/node/proof.js +5 -0
  126. package/src/node/property.js +5 -0
  127. package/src/node/propertyRelation.js +5 -0
  128. package/src/node/reference.js +5 -0
  129. package/src/node/rule.js +5 -0
  130. package/src/node/statement.js +5 -0
  131. package/src/node/step.js +5 -0
  132. package/src/node/subDerivation.js +5 -0
  133. package/src/node/subproof.js +5 -0
  134. package/src/node/supposition.js +5 -0
  135. package/src/node/term.js +5 -0
  136. package/src/node/theorem.js +5 -0
  137. package/src/node/topLevelAssertion.js +5 -0
  138. package/src/node/topLevelMetaAssertion.js +5 -0
  139. package/src/node/type.js +5 -0
  140. package/src/node/variable.js +5 -0
  141. package/src/node.js +5 -0
  142. package/src/nodeMap.js +146 -0
  143. package/src/nominal/lexer.js +11 -0
  144. package/src/nominal/parser.js +37 -0
  145. package/src/ruleNames.js +48 -0
  146. package/src/utilities/parser.js +18 -0
  147. package/src/utilities/type.js +19 -0
@@ -2,9 +2,8 @@
2
2
 
3
3
  import dom from "../../dom";
4
4
 
5
- import { objectType } from "../type";
6
5
  import { domAssigned } from "../../dom";
7
- import { superTypeStringFromSuperType, superTypesStringFromSuperTypes } from "../declaration/type";
6
+ import { superTypesStringFromSuperTypes } from "../../utilities/type";
8
7
 
9
8
  export default domAssigned(class ComplexTypeDeclaration {
10
9
  constructor(fileContext, string, type) {
@@ -74,26 +73,21 @@ export default domAssigned(class ComplexTypeDeclaration {
74
73
  verifyType() {
75
74
  let typeVerified = false;
76
75
 
77
- const typeName = this.type.getName();
76
+ const typeName = this.type.getName(),
77
+ typeString = this.type.getString();
78
78
 
79
- this.fileContext.trace(`Verifying the '${typeName}' type...`);
79
+ this.fileContext.trace(`Verifying the '${typeString}' type...`);
80
80
 
81
81
  const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
82
82
 
83
83
  if (typePresent) {
84
- const typeRefined = this.type.isRefined();
85
-
86
- if (typeRefined) {
87
- typeVerified = true;
88
- } else {
89
- this.fileContext.debug(`The type '${typeName}' is already present.`);
90
- }
84
+ this.fileContext.debug(`The type '${typeString}' is already present.`);
91
85
  } else {
92
86
  typeVerified = true;
93
87
  }
94
88
 
95
89
  if (typeVerified) {
96
- this.fileContext.debug(`...verified the '${typeName}' type.`);
90
+ this.fileContext.debug(`...verified the '${typeString}' type.`);
97
91
  }
98
92
 
99
93
  return typeVerified;
@@ -102,58 +96,57 @@ export default domAssigned(class ComplexTypeDeclaration {
102
96
  verifySuperTypes() {
103
97
  let superTypesVerified;
104
98
 
105
- const typeBasic = this.type.isBasic(),
106
- typeRefined = this.type.isRefined();
99
+ const typeBasic = this.type.isBasic();
107
100
 
108
- if (typeBasic || typeRefined) {
101
+ if (typeBasic) {
109
102
  superTypesVerified = true;
110
103
  } else {
111
- const typeName = this.type.getName(),
104
+ const typeString = this.type.getString(),
112
105
  superTypes = this.type.getSuperTypes(),
113
106
  superTypesString = superTypesStringFromSuperTypes(superTypes);
114
107
 
115
- this.fileContext.trace(`Verifying the '${typeName}' type's ${superTypesString} super-types...`);
108
+ this.fileContext.trace(`Verifying the '${typeString}' type's ${superTypesString} super-types...`);
116
109
 
117
110
  superTypesVerified = superTypes.every((superType) => {
118
- const superTypeVerified = this.verifySuperType(superType);
111
+ const superTypesVerified = this.verifySuperTypes(superType);
119
112
 
120
- if (superTypeVerified) {
113
+ if (superTypesVerified) {
121
114
  return true;
122
115
  }
123
116
  });
124
117
 
125
118
  if (superTypesVerified) {
126
- this.fileContext.debug(`...verified the '${typeName}' type's ${superTypesString} super-types.`);
119
+ this.fileContext.debug(`...verified the '${typeString}' type's ${superTypesString} super-types.`);
127
120
  }
128
121
  }
129
122
 
130
123
  return superTypesVerified;
131
124
  }
132
125
 
133
- verifySuperType(superType) {
134
- let superTypeVerified;
126
+ verifySuperTypes(superType) {
127
+ let superTypesVerified;
135
128
 
136
- const superTypeObjectType = (superType === objectType);
129
+ const typeBasic = this.type.isBasic();
137
130
 
138
- if (superTypeObjectType) {
139
- superTypeVerified = true;
131
+ if (typeBasic) {
132
+ superTypesVerified = true;
140
133
  } else {
141
- const typeName = this.type.getString(),
142
- superTypeString = superTypeStringFromSuperType(superType);
134
+ const typeString = this.type.getString(),
135
+ superTypeString = superType.getString();
143
136
 
144
- this.fileContext.trace(`Verifying the '${typeName}' type's '${superTypeString}' super-type...`);
137
+ this.fileContext.trace(`Verifying the '${typeString}' type's '${superTypeString}' super-type...`);
145
138
 
146
139
  const superTypeName = superType.getName(),
147
140
  superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
148
141
 
149
- superTypeVerified = superTypePresent; ///
142
+ superTypesVerified = superTypePresent; ///
150
143
 
151
- if (superTypeVerified) {
152
- this.fileContext.debug(`...verified the '${typeName}' type's '${superTypeString}' super-type.`);
144
+ if (superTypesVerified) {
145
+ this.fileContext.debug(`...verified the '${typeString}' type's '${superTypeString}' super-type.`);
153
146
  }
154
147
  }
155
148
 
156
- return superTypeVerified;
149
+ return superTypesVerified;
157
150
  }
158
151
 
159
152
  verifyProperty(property, properties, superTypeProperties) {
@@ -243,32 +236,28 @@ export default domAssigned(class ComplexTypeDeclaration {
243
236
  verifyPropertyType(propertyType) {
244
237
  let propertyTypeVerified = false;
245
238
 
246
- if (propertyType === objectType) {
247
- propertyTypeVerified = true;
248
- } else {
249
- const typeName = this.type.getName(),
250
- propertyTypeName = propertyType.getName();
239
+ const typeEqualToPropertyType = this.type.isEqualTo(propertyType);
251
240
 
252
- if (typeName === propertyTypeName) {
253
- propertyTypeVerified = true;
254
- } else {
255
- const propertyTypeString = propertyType.getString(); ///
241
+ if (typeEqualToPropertyType) {
242
+ propertyTypeVerified = true;
243
+ } else {
244
+ const propertyTypeString = propertyType.getString(); ///
256
245
 
257
- this.fileContext.trace(`Verifying the '${propertyTypeString}' property type...`);
246
+ this.fileContext.trace(`Verifying the '${propertyTypeString}' property type...`);
258
247
 
259
- const propertyTypePresent = this.fileContext.isTypePresentByTypeName(propertyTypeName);
248
+ const propertyTypeName = propertyType.getName(),
249
+ propertyTypePresent = this.fileContext.isTypePresentByTypeName(propertyTypeName);
260
250
 
261
- if (!propertyTypePresent) {
262
- const propertyTypeString = propertyType.getString();
251
+ if (!propertyTypePresent) {
252
+ const propertyTypeString = propertyType.getString();
263
253
 
264
- this.fileContext.debug(`The '${propertyTypeString}' property type is not present.`);
265
- } else {
266
- propertyTypeVerified = true;
267
- }
254
+ this.fileContext.debug(`The '${propertyTypeString}' property type is not present.`);
255
+ } else {
256
+ propertyTypeVerified = true;
257
+ }
268
258
 
269
- if (propertyTypeVerified) {
270
- this.fileContext.debug(`...verified the '${propertyTypeString}' property type.`);
271
- }
259
+ if (propertyTypeVerified) {
260
+ this.fileContext.debug(`...verified the '${propertyTypeString}' property type.`);
272
261
  }
273
262
  }
274
263
 
@@ -4,7 +4,6 @@ import dom from "../../dom";
4
4
 
5
5
  import constructorVerifier from "../../verifier/constructor";
6
6
 
7
- import { objectType } from "../type";
8
7
  import { domAssigned } from "../../dom";
9
8
 
10
9
  export default domAssigned(class ConstructorDeclaration {
@@ -83,24 +82,21 @@ export default domAssigned(class ConstructorDeclaration {
83
82
 
84
83
  const type = this.constructor.getType();
85
84
 
86
- if (type === objectType) {
87
- typeVerified = true;
88
- } else {
89
- const typeName = type.getName();
85
+ const typeName = type.getName(),
86
+ typeString = type.getString();
90
87
 
91
- this.fileContext.trace(`Verifying the '${typeName}' type...`);
88
+ this.fileContext.trace(`Verifying the '${typeString}' type...`);
92
89
 
93
- const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
90
+ const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
94
91
 
95
- if (!typePresent) {
96
- this.fileContext.debug(`The '${typeName}' type is not present.`);
97
- } else {
98
- typeVerified = true;
99
- }
92
+ if (!typePresent) {
93
+ this.fileContext.debug(`The '${typeString}' type is not present.`);
94
+ } else {
95
+ typeVerified = true;
96
+ }
100
97
 
101
- if (typeVerified) {
102
- this.fileContext.debug(`...verified the '${typeName}' type.`);
103
- }
98
+ if (typeVerified) {
99
+ this.fileContext.debug(`...verified the '${typeString}' type.`);
104
100
  }
105
101
 
106
102
  return typeVerified;
@@ -2,7 +2,6 @@
2
2
 
3
3
  import dom from "../../dom";
4
4
 
5
- import { objectType } from "../type";
6
5
  import { nodeQuery } from "../../utilities/query";
7
6
  import { domAssigned } from "../../dom";
8
7
 
@@ -56,24 +55,21 @@ export default domAssigned(class MetavariableDeclaration {
56
55
  if (type === null) {
57
56
  typeVerified = true;
58
57
  } else {
59
- if (type === objectType) {
60
- typeVerified = true;
61
- } else {
62
- const typeName = type.getName();
58
+ const typeName = type.getName(),
59
+ typeString = type.getString();
63
60
 
64
- this.fileContext.trace(`Verifying the '${typeName}' type...`);
61
+ this.fileContext.trace(`Verifying the '${typeString}' type...`);
65
62
 
66
- const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
63
+ const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
67
64
 
68
- if (!typePresent) {
69
- this.fileContext.debug(`The '${typeName}' type is not present.`);
70
- } else {
71
- typeVerified = true;
72
- }
65
+ if (!typePresent) {
66
+ this.fileContext.debug(`The '${typeString}' type is not present.`);
67
+ } else {
68
+ typeVerified = true;
69
+ }
73
70
 
74
- if (typeVerified) {
75
- this.fileContext.debug(`...verified the '${typeName}' type.`);
76
- }
71
+ if (typeVerified) {
72
+ this.fileContext.debug(`...verified the '${typeString}' type.`);
77
73
  }
78
74
  }
79
75
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  import dom from "../../dom";
4
4
 
5
- import { objectType } from "../type";
6
5
  import { domAssigned } from "../../dom";
6
+ import { superTypesStringFromSuperTypes } from "../../utilities/type";
7
7
 
8
8
  export default domAssigned(class TypeDeclaration {
9
9
  constructor(fileContext, string, type) {
@@ -67,18 +67,21 @@ export default domAssigned(class TypeDeclaration {
67
67
  verifyType() {
68
68
  let typeVerified = false;
69
69
 
70
- const typeName = this.type.getName();
70
+ const typeName = this.type.getName(),
71
+ typeString = this.type.getString();
71
72
 
72
- this.fileContext.trace(`Verifying the '${typeName}' type...`);
73
+ this.fileContext.trace(`Verifying the '${typeString}' type...`);
73
74
 
74
75
  const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
75
76
 
76
- if (!typePresent) {
77
+ if (typePresent) {
78
+ this.fileContext.debug(`The type '${typeString}' is already present.`);
79
+ } else {
77
80
  typeVerified = true;
78
81
  }
79
82
 
80
83
  if (typeVerified) {
81
- this.fileContext.debug(`...verified the '${typeName}' type.`);
84
+ this.fileContext.debug(`...verified the '${typeString}' type.`);
82
85
  }
83
86
 
84
87
  return typeVerified;
@@ -92,11 +95,11 @@ export default domAssigned(class TypeDeclaration {
92
95
  if (typeBasic) {
93
96
  superTypesVerified = true;
94
97
  } else {
95
- const typeName = this.type.getName(),
98
+ const typeString = this.type.getString(),
96
99
  superTypes = this.type.getSuperTypes(),
97
100
  superTypesString = superTypesStringFromSuperTypes(superTypes);
98
101
 
99
- this.fileContext.trace(`Verifying the '${typeName}' type's ${superTypesString} super-types...`);
102
+ this.fileContext.trace(`Verifying the '${typeString}' type's ${superTypesString} super-types...`);
100
103
 
101
104
  superTypesVerified = superTypes.every((superType) => {
102
105
  const superTypeVerified = this.verifySuperType(superType);
@@ -107,7 +110,7 @@ export default domAssigned(class TypeDeclaration {
107
110
  });
108
111
 
109
112
  if (superTypesVerified) {
110
- this.fileContext.debug(`...verified the '${typeName}' type's ${superTypesString} super-types.`);
113
+ this.fileContext.debug(`...verified the '${typeString}' type's ${superTypesString} super-types.`);
111
114
  }
112
115
  }
113
116
 
@@ -117,24 +120,18 @@ export default domAssigned(class TypeDeclaration {
117
120
  verifySuperType(superType) {
118
121
  let superTypeVerified;
119
122
 
120
- const superTypeObjectType = (superType === objectType);
121
-
122
- if (superTypeObjectType) {
123
- superTypeVerified = true;
124
- } else {
125
- const typeName = this.type.getString(),
126
- superTypeString = superTypeStringFromSuperType(superType);
123
+ const typeString = this.type.getString(),
124
+ superTypeString = superType.getString();
127
125
 
128
- this.fileContext.trace(`Verifying the '${typeName}' type's '${superTypeString}' super-type...`);
126
+ this.fileContext.trace(`Verifying the '${typeString}' type's '${superTypeString}' super-type...`);
129
127
 
130
- const superTypeName = superType.getName(),
131
- superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
128
+ const superTypeName = superType.getName(),
129
+ superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
132
130
 
133
- superTypeVerified = superTypePresent; ///
131
+ superTypeVerified = superTypePresent; ///
134
132
 
135
- if (superTypeVerified) {
136
- this.fileContext.debug(`...verified the '${typeName}' type's '${superTypeString}' super-type.`);
137
- }
133
+ if (superTypeVerified) {
134
+ this.fileContext.debug(`...verified the '${typeString}' type's '${superTypeString}' super-type.`);
138
135
  }
139
136
 
140
137
  return superTypeVerified;
@@ -152,25 +149,3 @@ export default domAssigned(class TypeDeclaration {
152
149
  return typeDeclaration;
153
150
  }
154
151
  });
155
-
156
- export function superTypeStringFromSuperType(superType) {
157
- const superTypeName = superType.getName(),
158
- superTypeString = superTypeName; ///
159
-
160
- return superTypeString;
161
- }
162
-
163
- export function superTypesStringFromSuperTypes(superTypes) {
164
- const superTypesString = superTypes.reduce((superTypesString, superType) => {
165
- const superTypeString = superTypeStringFromSuperType(superType);
166
-
167
- superTypesString = (superTypesString === null) ?
168
- `'${superTypeString}'` :
169
- `${superTypesString}, '${superTypeString}'`;
170
-
171
- return superTypesString;
172
- }, null);
173
-
174
- return superTypesString;
175
- }
176
-
@@ -2,7 +2,6 @@
2
2
 
3
3
  import dom from "../../dom";
4
4
 
5
- import { objectType } from "../type";
6
5
  import { domAssigned } from "../../dom";
7
6
 
8
7
  export default domAssigned(class VariableDeclaration {
@@ -41,13 +40,9 @@ export default domAssigned(class VariableDeclaration {
41
40
 
42
41
  type = this.variable.getType();
43
42
 
44
- const typeObjectType = (type === objectType);
43
+ const typeName = type.getName();
45
44
 
46
- if (!typeObjectType) {
47
- const typeName = type.getName();
48
-
49
- type = this.fileContext.findTypeByTypeName(typeName);
50
- }
45
+ type = this.fileContext.findTypeByTypeName(typeName);
51
46
 
52
47
  const typeProvisional = type.isProvisional(),
53
48
  variableProvisional = this.variable.isProvisional();
@@ -64,8 +59,6 @@ export default domAssigned(class VariableDeclaration {
64
59
  this.fileContext.debug(`The '${typeString}' type is not provisional whilst the '${variableString}' variable's type is.`);
65
60
  }
66
61
  } else {
67
- this.variable.setType(type);
68
-
69
62
  this.fileContext.addVariable(this.variable);
70
63
 
71
64
  verified = true;
@@ -83,26 +76,41 @@ export default domAssigned(class VariableDeclaration {
83
76
  verifyVariableType() {
84
77
  let typeVerified = false;
85
78
 
86
- const type = this.variable.getType();
79
+ let type;
87
80
 
88
- if (type === objectType) {
89
- typeVerified = true;
90
- } else {
91
- const typeName = type.getName();
81
+ type = this.variable.getType();
82
+
83
+ const typeName = type.getName(),
84
+ typeString = type.getString(),
85
+ variableString = this.variable.getString();
86
+
87
+ this.fileContext.trace(`Verifying the '${variableString}' variable's '${typeString}' type...`);
92
88
 
93
- this.fileContext.trace(`Verifying the '${typeName}' type...`);
89
+ const includeSupertypes = false,
90
+ provisional = type.isProvisional(includeSupertypes);
94
91
 
95
- const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
92
+ type = this.fileContext.findTypeByTypeName(typeName);
96
93
 
97
- if (!typePresent) {
98
- this.fileContext.debug(`The '${typeName}' type is not present.`);
94
+ const typePresent = (type !== null)
95
+
96
+ if (!typePresent) {
97
+ this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is not present.`);
98
+ } else {
99
+ const provisionalMatches = type.matchProvisional(provisional);
100
+
101
+ if (!provisionalMatches) {
102
+ provisional ?
103
+ this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is present but it should be provisional.`) :
104
+ this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is present but it should not be provisional.`);
99
105
  } else {
106
+ this.variable.setType(type);
107
+
100
108
  typeVerified = true;
101
109
  }
110
+ }
102
111
 
103
- if (typeVerified) {
104
- this.fileContext.debug(`...verified the '${typeName}' type.`);
105
- }
112
+ if (typeVerified) {
113
+ this.fileContext.debug(`...verified the '${variableString}' variable's '${typeString}' type.`);
106
114
  }
107
115
 
108
116
  return typeVerified;
@@ -117,9 +117,9 @@ function stringFromNamesAndType(names, type) {
117
117
  if (type === objectType) {
118
118
  string = namesString; ///
119
119
  } else {
120
- const typeName = type.getName();
120
+ const typeString = type.getString();
121
121
 
122
- string = `${namesString}:${typeName}`;
122
+ string = `${namesString}:${typeString}`;
123
123
  }
124
124
 
125
125
  return string;
@@ -109,9 +109,9 @@ export default domAssigned(class PropertyRelation {
109
109
 
110
110
  if (variableTypeProperty === null) {
111
111
  const variableString = this.term.getString(),
112
- variableTypeName = variableType.getName();
112
+ variableTypeString = variableType.getString();
113
113
 
114
- context.debug(`The '${propertyNames}' property is not a property of the '${variableString}' variable's '${variableTypeName}' type.`);
114
+ context.debug(`The '${propertyNames}' property is not a property of the '${variableString}' variable's '${variableTypeString}' type.`);
115
115
  } else {
116
116
  const type = variableType;
117
117
 
package/src/dom/term.js CHANGED
@@ -152,10 +152,10 @@ export default domAssigned(class Term {
152
152
  verifyGivenType(type, generalContext, specificContext) {
153
153
  let verifiedGivenType;
154
154
 
155
- const typeName = type.getName(),
155
+ const typeString = type.getString(),
156
156
  termString = this.getString(); ///
157
157
 
158
- specificContext.trace(`Verifying the '${termString}' term given the '${typeName}' type...`);
158
+ specificContext.trace(`Verifying the '${termString}' term given the '${typeString}' type...`);
159
159
 
160
160
  const context = specificContext, ///
161
161
  verified = this.verify(context, () => {
@@ -173,7 +173,7 @@ export default domAssigned(class Term {
173
173
  verifiedGivenType = verified; ///
174
174
 
175
175
  if (verifiedGivenType) {
176
- specificContext.debug(`...verified the '${termString}' term given the '${typeName}' type.`);
176
+ specificContext.debug(`...verified the '${termString}' term given the '${typeString}' type.`);
177
177
  }
178
178
 
179
179
  return verifiedGivenType;