occam-verify-cli 1.0.230 → 1.0.234

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 (121) hide show
  1. package/lib/assignment/variable.js +4 -2
  2. package/lib/context/file.js +5 -5
  3. package/lib/context/local.js +19 -14
  4. package/lib/dom/axiom.js +36 -27
  5. package/lib/dom/combinator.js +5 -5
  6. package/lib/dom/conclusion.js +5 -5
  7. package/lib/dom/conjecture.js +9 -9
  8. package/lib/dom/constructor.js +5 -5
  9. package/lib/dom/declaration/combinator.js +14 -14
  10. package/lib/dom/declaration/complexType.js +35 -35
  11. package/lib/dom/declaration/constructor.js +19 -19
  12. package/lib/dom/declaration/metavariable.js +22 -22
  13. package/lib/dom/declaration/simpleType.js +23 -23
  14. package/lib/dom/declaration/variable.js +20 -20
  15. package/lib/dom/declaration.js +4 -2
  16. package/lib/dom/deduction.js +5 -5
  17. package/lib/dom/derivation.js +5 -5
  18. package/lib/dom/error.js +9 -9
  19. package/lib/dom/hypothesis.js +184 -0
  20. package/lib/dom/label.js +18 -24
  21. package/lib/dom/lemma.js +7 -7
  22. package/lib/dom/metaLemma.js +9 -9
  23. package/lib/dom/metaType.js +4 -10
  24. package/lib/dom/metatheorem.js +9 -9
  25. package/lib/dom/metavariable.js +7 -8
  26. package/lib/dom/parameter.js +2 -2
  27. package/lib/dom/premise.js +5 -5
  28. package/lib/dom/procedureCall.js +3 -3
  29. package/lib/dom/proof.js +3 -3
  30. package/lib/dom/property.js +9 -9
  31. package/lib/dom/reference.js +23 -22
  32. package/lib/dom/rule.js +24 -24
  33. package/lib/dom/section.js +248 -0
  34. package/lib/dom/signature.js +5 -5
  35. package/lib/dom/statement.js +25 -20
  36. package/lib/dom/step.js +3 -3
  37. package/lib/dom/subDerivation.js +5 -5
  38. package/lib/dom/subproof.js +7 -7
  39. package/lib/dom/substitution/statement.js +3 -3
  40. package/lib/dom/supposition.js +5 -5
  41. package/lib/dom/term.js +5 -6
  42. package/lib/dom/theorem.js +9 -9
  43. package/lib/dom/topLevelAssertion.js +123 -31
  44. package/lib/dom/topLevelMetaAssertion.js +13 -13
  45. package/lib/dom/type.js +21 -21
  46. package/lib/dom/variable.js +9 -15
  47. package/lib/index.js +3 -1
  48. package/lib/mixins/step/unify.js +11 -11
  49. package/lib/mixins/term/verify.js +6 -6
  50. package/lib/node/hypothesis.js +123 -0
  51. package/lib/node/section.js +144 -0
  52. package/lib/nonTerminalNodeMap.js +5 -3
  53. package/lib/ruleNames.js +9 -1
  54. package/lib/utilities/context.js +1 -1
  55. package/lib/utilities/json.js +82 -59
  56. package/lib/utilities/releaseContext.js +3 -3
  57. package/lib/utilities/subproof.js +10 -10
  58. package/lib/verifier/combinator.js +9 -10
  59. package/lib/verifier/constructor.js +10 -11
  60. package/lib/verifier/topLevel.js +38 -31
  61. package/package.json +2 -2
  62. package/src/assignment/variable.js +6 -4
  63. package/src/context/file.js +3 -3
  64. package/src/context/local.js +6 -14
  65. package/src/dom/axiom.js +47 -42
  66. package/src/dom/combinator.js +4 -4
  67. package/src/dom/conclusion.js +5 -5
  68. package/src/dom/conjecture.js +8 -8
  69. package/src/dom/constructor.js +4 -4
  70. package/src/dom/declaration/combinator.js +14 -14
  71. package/src/dom/declaration/complexType.js +35 -35
  72. package/src/dom/declaration/constructor.js +20 -20
  73. package/src/dom/declaration/metavariable.js +22 -22
  74. package/src/dom/declaration/simpleType.js +22 -22
  75. package/src/dom/declaration/variable.js +21 -21
  76. package/src/dom/declaration.js +5 -3
  77. package/src/dom/deduction.js +5 -5
  78. package/src/dom/derivation.js +5 -5
  79. package/src/dom/error.js +8 -8
  80. package/src/dom/hypothesis.js +119 -0
  81. package/src/dom/label.js +17 -19
  82. package/src/dom/lemma.js +8 -8
  83. package/src/dom/metaLemma.js +8 -8
  84. package/src/dom/metaType.js +2 -6
  85. package/src/dom/metatheorem.js +8 -8
  86. package/src/dom/metavariable.js +9 -12
  87. package/src/dom/parameter.js +1 -1
  88. package/src/dom/premise.js +8 -8
  89. package/src/dom/procedureCall.js +3 -3
  90. package/src/dom/proof.js +2 -2
  91. package/src/dom/property.js +8 -8
  92. package/src/dom/reference.js +23 -27
  93. package/src/dom/rule.js +29 -29
  94. package/src/dom/section.js +197 -0
  95. package/src/dom/signature.js +4 -5
  96. package/src/dom/statement.js +24 -32
  97. package/src/dom/step.js +4 -4
  98. package/src/dom/subDerivation.js +5 -5
  99. package/src/dom/subproof.js +8 -8
  100. package/src/dom/substitution/statement.js +5 -5
  101. package/src/dom/supposition.js +7 -7
  102. package/src/dom/term.js +3 -8
  103. package/src/dom/theorem.js +7 -7
  104. package/src/dom/topLevelAssertion.js +113 -40
  105. package/src/dom/topLevelMetaAssertion.js +19 -19
  106. package/src/dom/type.js +22 -22
  107. package/src/dom/variable.js +8 -11
  108. package/src/index.js +2 -0
  109. package/src/mixins/step/unify.js +10 -10
  110. package/src/mixins/term/verify.js +4 -5
  111. package/src/node/hypothesis.js +23 -0
  112. package/src/node/section.js +44 -0
  113. package/src/nonTerminalNodeMap.js +7 -1
  114. package/src/ruleNames.js +2 -0
  115. package/src/utilities/context.js +2 -2
  116. package/src/utilities/json.js +86 -58
  117. package/src/utilities/releaseContext.js +2 -2
  118. package/src/utilities/subproof.js +10 -10
  119. package/src/verifier/combinator.js +6 -11
  120. package/src/verifier/constructor.js +9 -12
  121. package/src/verifier/topLevel.js +42 -30
@@ -2,7 +2,7 @@
2
2
 
3
3
  import dom from "../dom";
4
4
 
5
- export function termFromJSON(json, fileContext) {
5
+ export function termFromJSON(json, context) {
6
6
  let { term } = json;
7
7
 
8
8
  const termJSON = term; ///
@@ -11,38 +11,38 @@ export function termFromJSON(json, fileContext) {
11
11
 
12
12
  const { Term } = dom;
13
13
 
14
- term = Term.fromJSON(json, fileContext);
14
+ term = Term.fromJSON(json, context);
15
15
 
16
16
  return term;
17
17
  }
18
18
 
19
- export function typeFromJSON(json, fileContext) {
19
+ export function typeFromJSON(json, context) {
20
20
  let { type } = json;
21
21
 
22
22
  if (type !== null) {
23
23
  const { name } = type,
24
24
  typeName = name; ///
25
25
 
26
- type = fileContext.findTypeByTypeName(typeName);
26
+ type = context.findTypeByTypeName(typeName);
27
27
  }
28
28
 
29
29
  return type;
30
30
  }
31
31
 
32
- export function metaTypeFromJSON(json, fileContext) {
32
+ export function metaTypeFromJSON(json, context) {
33
33
  let { metaType } = json;
34
34
 
35
35
  if (metaType !== null) {
36
36
  const { name } = metaType,
37
37
  metaTypeName = name; ///
38
38
 
39
- metaType = fileContext.findMetaTypeByMetaTypeName(metaTypeName);
39
+ metaType = context.findMetaTypeByMetaTypeName(metaTypeName);
40
40
  }
41
41
 
42
42
  return metaType;
43
43
  }
44
44
 
45
- export function statementFromJSON(json, fileContext) {
45
+ export function statementFromJSON(json, context) {
46
46
  let { statement = null } = json;
47
47
 
48
48
  if (statement !== null) {
@@ -51,13 +51,13 @@ export function statementFromJSON(json, fileContext) {
51
51
 
52
52
  json = statementJSON; ///
53
53
 
54
- statement = Statement.fromJSON(json, fileContext);
54
+ statement = Statement.fromJSON(json, context);
55
55
  }
56
56
 
57
57
  return statement;
58
58
  }
59
59
 
60
- export function referenceFromJSON(json, fileContext) {
60
+ export function referenceFromJSON(json, context) {
61
61
  let { reference } = json;
62
62
 
63
63
  const { Reference } = dom,
@@ -65,12 +65,12 @@ export function referenceFromJSON(json, fileContext) {
65
65
 
66
66
  json = referenceJSON; ///
67
67
 
68
- reference = Reference.fromJSON(json, fileContext);
68
+ reference = Reference.fromJSON(json, context);
69
69
 
70
70
  return reference;
71
71
  }
72
72
 
73
- export function deductionFromJSON(json, fileContext) {
73
+ export function deductionFromJSON(json, context) {
74
74
  let { deduction } = json;
75
75
 
76
76
  const { Deduction } = dom,
@@ -78,12 +78,12 @@ export function deductionFromJSON(json, fileContext) {
78
78
 
79
79
  json = deductionJSON; ///
80
80
 
81
- deduction = Deduction.fromJSON(json, fileContext);
81
+ deduction = Deduction.fromJSON(json, context);
82
82
 
83
83
  return deduction;
84
84
  }
85
85
 
86
- export function signatureFromJSON(json, fileContext) {
86
+ export function signatureFromJSON(json, context) {
87
87
  let { signature = null } = json;
88
88
 
89
89
  if (signature !== null) {
@@ -92,13 +92,13 @@ export function signatureFromJSON(json, fileContext) {
92
92
 
93
93
  json = signatureJSON; ///
94
94
 
95
- signature = Signature.fromJSON(json, fileContext);
95
+ signature = Signature.fromJSON(json, context);
96
96
  }
97
97
 
98
98
  return signature;
99
99
  }
100
100
 
101
- export function conclusionFromJSON(json, fileContext) {
101
+ export function conclusionFromJSON(json, context) {
102
102
  let { conclusion } = json;
103
103
 
104
104
  const { Conclusion } = dom,
@@ -106,12 +106,12 @@ export function conclusionFromJSON(json, fileContext) {
106
106
 
107
107
  json = conclusionJSON; ///
108
108
 
109
- conclusion = Conclusion.fromJSON(json, fileContext);
109
+ conclusion = Conclusion.fromJSON(json, context);
110
110
 
111
111
  return conclusion;
112
112
  }
113
113
 
114
- export function metavariableFromJSON(json, fileContext) {
114
+ export function metavariableFromJSON(json, context) {
115
115
  let { metavariable } = json;
116
116
 
117
117
  const { Metavariable } = dom,
@@ -119,12 +119,12 @@ export function metavariableFromJSON(json, fileContext) {
119
119
 
120
120
  json = metavariableJSON; ///
121
121
 
122
- metavariable = Metavariable.fromJSON(json, fileContext);
122
+ metavariable = Metavariable.fromJSON(json, context);
123
123
 
124
124
  return metavariable;
125
125
  }
126
126
 
127
- export function procedureCallFromJSON(json, fileContext) {
127
+ export function procedureCallFromJSON(json, context) {
128
128
  let { procedureCall = null } = json;
129
129
 
130
130
  if (procedureCall !== null) {
@@ -133,26 +133,26 @@ export function procedureCallFromJSON(json, fileContext) {
133
133
 
134
134
  json = procedureCallJSON; ///
135
135
 
136
- procedureCall = ProcedureCall.fromJSON(json, fileContext);
136
+ procedureCall = ProcedureCall.fromJSON(json, context);
137
137
  }
138
138
 
139
139
  return procedureCall;
140
140
  }
141
141
 
142
- export function typesFromJSON(json, types, fileContext) {
142
+ export function typesFromJSON(json, types, context) {
143
143
  const { types: typesJSON } = json;
144
144
 
145
145
  const { Type } = dom;
146
146
 
147
147
  typesJSON.forEach((typeJSON) => {
148
148
  const json = typeJSON, ///
149
- type = Type.fromJSON(json, fileContext);
149
+ type = Type.fromJSON(json, context);
150
150
 
151
151
  types.push(type);
152
152
  });
153
153
  }
154
154
 
155
- export function termsFromJSON(json, fileContext) {
155
+ export function termsFromJSON(json, context) {
156
156
  let { terms } = json;
157
157
 
158
158
  const { Term } = dom,
@@ -160,7 +160,7 @@ export function termsFromJSON(json, fileContext) {
160
160
 
161
161
  terms = termsJSON.map((termJSON) => {
162
162
  const json = termJSON, ///
163
- term = Term.fromJSON(json, fileContext);
163
+ term = Term.fromJSON(json, context);
164
164
 
165
165
  return term;
166
166
  });
@@ -168,7 +168,7 @@ export function termsFromJSON(json, fileContext) {
168
168
  return terms;
169
169
  }
170
170
 
171
- export function rulesFromJSON(json, fileContext) {
171
+ export function rulesFromJSON(json, context) {
172
172
  let { rules } = json;
173
173
 
174
174
  const { Rule } = dom,
@@ -176,7 +176,7 @@ export function rulesFromJSON(json, fileContext) {
176
176
 
177
177
  rules = rulesJSON.map((ruleJSON) => {
178
178
  const json = ruleJSON, ///
179
- rule = Rule.fromJSON(json, fileContext);
179
+ rule = Rule.fromJSON(json, context);
180
180
 
181
181
  return rule;
182
182
  });
@@ -184,7 +184,7 @@ export function rulesFromJSON(json, fileContext) {
184
184
  return rules;
185
185
  }
186
186
 
187
- export function labelFromJSON(json, fileContext) {
187
+ export function labelFromJSON(json, context) {
188
188
  let { label } = json;
189
189
 
190
190
  const { Label } = dom,
@@ -192,12 +192,12 @@ export function labelFromJSON(json, fileContext) {
192
192
 
193
193
  json = labelJSON; ///
194
194
 
195
- label = Label.fromJSON(json, fileContext);
195
+ label = Label.fromJSON(json, context);
196
196
 
197
197
  return label;
198
198
  }
199
199
 
200
- export function labelsFromJSON(json, fileContext) {
200
+ export function labelsFromJSON(json, context) {
201
201
  let { labels } = json;
202
202
 
203
203
  const { Label } = dom,
@@ -205,7 +205,7 @@ export function labelsFromJSON(json, fileContext) {
205
205
 
206
206
  labels = labelsJSON.map((labelJSON) => {
207
207
  const json = labelJSON, ///
208
- label = Label.fromJSON(json, fileContext);
208
+ label = Label.fromJSON(json, context);
209
209
 
210
210
  return label;
211
211
  });
@@ -213,7 +213,7 @@ export function labelsFromJSON(json, fileContext) {
213
213
  return labels;
214
214
  }
215
215
 
216
- export function axiomsFromJSON(json, fileContext) {
216
+ export function axiomsFromJSON(json, context) {
217
217
  let { axioms } = json;
218
218
 
219
219
  const { Axiom } = dom,
@@ -221,7 +221,7 @@ export function axiomsFromJSON(json, fileContext) {
221
221
 
222
222
  axioms = axiomsJSON.map((axiomJSON) => {
223
223
  const json = axiomJSON, ///
224
- axiom = Axiom.fromJSON(json, fileContext);
224
+ axiom = Axiom.fromJSON(json, context);
225
225
 
226
226
  return axiom;
227
227
  });
@@ -229,7 +229,7 @@ export function axiomsFromJSON(json, fileContext) {
229
229
  return axioms;
230
230
  }
231
231
 
232
- export function premisesFromJSON(json, fileContext) {
232
+ export function premisesFromJSON(json, context) {
233
233
  let { premises } = json;
234
234
 
235
235
  const { Premise } = dom,
@@ -237,7 +237,7 @@ export function premisesFromJSON(json, fileContext) {
237
237
 
238
238
  premises = premisesJSON.map((premiseJSON) => {
239
239
  const json = premiseJSON, ///
240
- premise = Premise.fromJSON(json, fileContext);
240
+ premise = Premise.fromJSON(json, context);
241
241
 
242
242
  return premise;
243
243
  });
@@ -245,7 +245,7 @@ export function premisesFromJSON(json, fileContext) {
245
245
  return premises;
246
246
  }
247
247
 
248
- export function theoremsFromJSON(json, fileContext) {
248
+ export function theoremsFromJSON(json, context) {
249
249
  let { theorems } = json;
250
250
 
251
251
  const { Theorem } = dom,
@@ -253,7 +253,7 @@ export function theoremsFromJSON(json, fileContext) {
253
253
 
254
254
  theorems = theoremsJSON.map((theoremJSON) => {
255
255
  const json = theoremJSON, ///
256
- theorem = Theorem.fromJSON(json, fileContext);
256
+ theorem = Theorem.fromJSON(json, context);
257
257
 
258
258
  return theorem;
259
259
  });
@@ -261,7 +261,7 @@ export function theoremsFromJSON(json, fileContext) {
261
261
  return theorems;
262
262
  }
263
263
 
264
- export function variablesFromJSON(json, fileContext) {
264
+ export function variablesFromJSON(json, context) {
265
265
  let { variables } = json;
266
266
 
267
267
  const { Variable } = dom,
@@ -269,7 +269,7 @@ export function variablesFromJSON(json, fileContext) {
269
269
 
270
270
  variables = variablesJSON.map((variableJSON) => {
271
271
  const json = variableJSON, ///
272
- variable = Variable.fromJSON(json, fileContext);
272
+ variable = Variable.fromJSON(json, context);
273
273
 
274
274
  return variable;
275
275
  });
@@ -277,7 +277,7 @@ export function variablesFromJSON(json, fileContext) {
277
277
  return variables;
278
278
  }
279
279
 
280
- export function propertiesFromJSON(json, fileContext) {
280
+ export function propertiesFromJSON(json, context) {
281
281
  let { properties } = json;
282
282
 
283
283
  const { Property } = dom,
@@ -285,7 +285,7 @@ export function propertiesFromJSON(json, fileContext) {
285
285
 
286
286
  properties = propertiesJSON.map((propertyJSON) => {
287
287
  const json = propertyJSON, ///
288
- property = Property.fromJSON(json, fileContext);
288
+ property = Property.fromJSON(json, context);
289
289
 
290
290
  return property;
291
291
  });
@@ -293,14 +293,14 @@ export function propertiesFromJSON(json, fileContext) {
293
293
  return properties;
294
294
  }
295
295
 
296
- export function superTypesFromJSON(json, fileContext) {
296
+ export function superTypesFromJSON(json, context) {
297
297
  const { superTypes: superTypesJSON } = json;
298
298
 
299
299
  const superTypes = superTypesJSON.map((superTypeJSON) => {
300
300
  const json = superTypeJSON, ///
301
301
  { name } = json,
302
302
  superTypeName = name, ///
303
- superType = fileContext.findTypeByTypeName(superTypeName);
303
+ superType = context.findTypeByTypeName(superTypeName);
304
304
 
305
305
  return superType;
306
306
  });
@@ -308,7 +308,23 @@ export function superTypesFromJSON(json, fileContext) {
308
308
  return superTypes;
309
309
  }
310
310
 
311
- export function parametersFromJSON(json, fileContext) {
311
+ export function hypothesesFromJSON(json, context) {
312
+ let { hypotheses } = json;
313
+
314
+ const { Hypothesis } = dom,
315
+ hypothesesJSON = hypotheses; ///
316
+
317
+ hypotheses = hypothesesJSON.map((hypothesisJSON) => {
318
+ const json = hypothesisJSON, ///
319
+ hypothesis = Hypothesis.fromJSON(json, context);
320
+
321
+ return hypothesis;
322
+ });
323
+
324
+ return hypotheses;
325
+ }
326
+
327
+ export function parametersFromJSON(json, context) {
312
328
  let { parameters } = json;
313
329
 
314
330
  const { Parameter } = dom,
@@ -316,7 +332,7 @@ export function parametersFromJSON(json, fileContext) {
316
332
 
317
333
  parameters = parametersJSON.map((parameterJSON) => {
318
334
  const json = parameterJSON, ///
319
- parameter = Parameter.fromJSON(json, fileContext);
335
+ parameter = Parameter.fromJSON(json, context);
320
336
 
321
337
  return parameter;
322
338
  });
@@ -324,7 +340,7 @@ export function parametersFromJSON(json, fileContext) {
324
340
  return parameters;
325
341
  }
326
342
 
327
- export function conjecturesFromJSON(json, fileContext) {
343
+ export function conjecturesFromJSON(json, context) {
328
344
  let { conjectures } = json;
329
345
 
330
346
  const { Conjecture } = dom,
@@ -332,7 +348,7 @@ export function conjecturesFromJSON(json, fileContext) {
332
348
 
333
349
  conjectures = conjecturesJSON.map((conjectureJSON) => {
334
350
  const json = conjectureJSON, ///
335
- conjecture = Conjecture.fromJSON(json, fileContext);
351
+ conjecture = Conjecture.fromJSON(json, context);
336
352
 
337
353
  return conjecture;
338
354
  });
@@ -340,7 +356,7 @@ export function conjecturesFromJSON(json, fileContext) {
340
356
  return conjectures;
341
357
  }
342
358
 
343
- export function combinatorsFromJSON(json, fileContext) {
359
+ export function combinatorsFromJSON(json, context) {
344
360
  let { combinators } = json;
345
361
 
346
362
  const { Combinator } = dom,
@@ -348,7 +364,7 @@ export function combinatorsFromJSON(json, fileContext) {
348
364
 
349
365
  combinators = combinatorsJSON.map((combinatorJSON) => {
350
366
  const json = combinatorJSON, ///
351
- combinator = Combinator.fromJSON(json, fileContext);
367
+ combinator = Combinator.fromJSON(json, context);
352
368
 
353
369
  return combinator;
354
370
  });
@@ -356,7 +372,7 @@ export function combinatorsFromJSON(json, fileContext) {
356
372
  return combinators;
357
373
  }
358
374
 
359
- export function constructorsFromJSON(json, fileContext) {
375
+ export function constructorsFromJSON(json, context) {
360
376
  let { constructors } = json;
361
377
 
362
378
  const { Constructor } = dom,
@@ -364,7 +380,7 @@ export function constructorsFromJSON(json, fileContext) {
364
380
 
365
381
  constructors = constructorsJSON.map((constructorJSON) => {
366
382
  const json = constructorJSON, ///
367
- constructor = Constructor.fromJSON(json, fileContext);
383
+ constructor = Constructor.fromJSON(json, context);
368
384
 
369
385
  return constructor;
370
386
  });
@@ -372,7 +388,7 @@ export function constructorsFromJSON(json, fileContext) {
372
388
  return constructors;
373
389
  }
374
390
 
375
- export function metatheoremsFromJSON(json, fileContext) {
391
+ export function metatheoremsFromJSON(json, context) {
376
392
  let { metatheorems } = json;
377
393
 
378
394
  const { Metatheorem } = dom,
@@ -380,7 +396,7 @@ export function metatheoremsFromJSON(json, fileContext) {
380
396
 
381
397
  metatheorems = metatheoremsJSON.map((metatheoremJSON) => {
382
398
  const json = metatheoremJSON, ///
383
- metatheorem = Metatheorem.fromJSON(json, fileContext);
399
+ metatheorem = Metatheorem.fromJSON(json, context);
384
400
 
385
401
  return metatheorem;
386
402
  });
@@ -388,7 +404,7 @@ export function metatheoremsFromJSON(json, fileContext) {
388
404
  return metatheorems;
389
405
  }
390
406
 
391
- export function suppositionsFromJSON(json, fileContext) {
407
+ export function suppositionsFromJSON(json, context) {
392
408
  let { suppositions } = json;
393
409
 
394
410
  const { Supposition } = dom,
@@ -396,7 +412,7 @@ export function suppositionsFromJSON(json, fileContext) {
396
412
 
397
413
  suppositions = suppositionsJSON.map((suppositionJSON) => {
398
414
  const json = suppositionJSON, ///
399
- supposition = Supposition.fromJSON(json, fileContext);
415
+ supposition = Supposition.fromJSON(json, context);
400
416
 
401
417
  return supposition;
402
418
  });
@@ -404,7 +420,7 @@ export function suppositionsFromJSON(json, fileContext) {
404
420
  return suppositions;
405
421
  }
406
422
 
407
- export function substitutionsFromJSON(json, fileContext) {
423
+ export function substitutionsFromJSON(json, context) {
408
424
  let { substitutions = [] } = json; ///
409
425
 
410
426
  const { StatementSubstitution } = dom,
@@ -413,7 +429,7 @@ export function substitutionsFromJSON(json, fileContext) {
413
429
 
414
430
  substitutions = substitutionsJSON.map((substitutionJSON) => {
415
431
  const json = substitutionJSON, ///
416
- substitution = Substitution.fromJSON(json, fileContext);
432
+ substitution = Substitution.fromJSON(json, context);
417
433
 
418
434
  return substitution;
419
435
  });
@@ -421,7 +437,7 @@ export function substitutionsFromJSON(json, fileContext) {
421
437
  return substitutions;
422
438
  }
423
439
 
424
- export function metavariablesFromJSON(json, fileContext) {
440
+ export function metavariablesFromJSON(json, context) {
425
441
  let { metavariables } = json;
426
442
 
427
443
  const { Metavariable } = dom,
@@ -429,7 +445,7 @@ export function metavariablesFromJSON(json, fileContext) {
429
445
 
430
446
  metavariables = metavariablesJSON.map((metavariableJSON) => {
431
447
  const json = metavariableJSON, ///
432
- metavariable = Metavariable.fromJSON(json, fileContext);
448
+ metavariable = Metavariable.fromJSON(json, context);
433
449
 
434
450
  return metavariable;
435
451
  });
@@ -616,6 +632,18 @@ export function variablesToVariablesJSON(variables) {
616
632
  return variablesJSON;
617
633
  }
618
634
 
635
+ export function hypothesesToHypothesesJSON(hypotheses) {
636
+ const hypothesesJSON = hypotheses.map((hypothesis) => {
637
+ const hypothesisJSON = hypothesis.toJSON();
638
+
639
+ hypothesis = hypothesisJSON; ///
640
+
641
+ return hypothesis;
642
+ });
643
+
644
+ return hypothesesJSON;
645
+ }
646
+
619
647
  export function superTypesToSuperTypesJSON(superTypes) {
620
648
  const superTypesJSON = superTypes.map((superType) => {
621
649
  const superTypeJSON = superType.toJSON();
@@ -193,7 +193,7 @@ function checkCyclicDependencyExists(dependency, dependentNames, context) {
193
193
  ],
194
194
  dependencyNamesString = dependencyNames.join(`' -> '`);
195
195
 
196
- log.warning(`There is a cyclic dependency: '${dependencyNamesString}'.`);
196
+ log.warning(`There is a cyclic dependency, '${dependencyNamesString}'.`);
197
197
  }
198
198
 
199
199
  return cyclicDependencyExists;
@@ -216,7 +216,7 @@ function checkReleaseMatchesDependency(releaseContext, dependency, dependentName
216
216
  versionString = version.toString(),
217
217
  dependencyString = dependency.asString();
218
218
 
219
- log.warning(`Version mismatch: The '${dependentName}' dependent requires the '${dependencyString}' dependency but a context with version '${versionString}' was provided.`);
219
+ log.warning(`The '${dependentName}' dependent requires the '${dependencyString}' dependency but a context with version '${versionString}' was provided.`);
220
220
 
221
221
  releaseMatchesDependency = false;
222
222
  }
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
 
3
- export function subproofStringFromSubproofNode(subproofNode, fileContext) {
4
- const suppositionStatementsOrNonsenseString = suppositionStatementOrNonsenseStringFromSubproofNode(subproofNode, fileContext),
5
- lastStatementOrNonsenseString = lastStatementOrNonsenseStringFromSubproofNode(subproofNode, fileContext),
3
+ export function subproofStringFromSubproofNode(subproofNode, context) {
4
+ const suppositionStatementsOrNonsenseString = suppositionStatementOrNonsenseStringFromSubproofNode(subproofNode, context),
5
+ lastStatementOrNonsenseString = lastStatementOrNonsenseStringFromSubproofNode(subproofNode, context),
6
6
  subproofString = `[${suppositionStatementsOrNonsenseString}] ... ${lastStatementOrNonsenseString}`;
7
7
 
8
8
  return subproofString;
9
9
  }
10
10
 
11
- function suppositionStatementOrNonsenseStringFromSubproofNode(subproofNode, fileContext) {
11
+ function suppositionStatementOrNonsenseStringFromSubproofNode(subproofNode, context) {
12
12
  const suppositionNodes = subproofNode.getSuppositionNodes(),
13
13
  suppositionStatementsOrNonsenseString = suppositionNodes.reduce((suppositionStatementsOrNonsenseString, suppositionNode) => {
14
14
  const suppositionOrStepNode = suppositionNode, ///
15
- statementOrNonsenseString = statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, fileContext),
15
+ statementOrNonsenseString = statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, context),
16
16
  suppositionStatementOrNonsenseString = statementOrNonsenseString; ///
17
17
 
18
18
  suppositionStatementsOrNonsenseString = (suppositionStatementsOrNonsenseString !== null) ?
@@ -25,16 +25,16 @@ function suppositionStatementOrNonsenseStringFromSubproofNode(subproofNode, file
25
25
  return suppositionStatementsOrNonsenseString;
26
26
  }
27
27
 
28
- function lastStatementOrNonsenseStringFromSubproofNode(subproofNode, fileContext) {
28
+ function lastStatementOrNonsenseStringFromSubproofNode(subproofNode, context) {
29
29
  const lastStepNode = subproofNode.getLastStepNode(),
30
30
  suppositionOrStepNode = lastStepNode, ///
31
- statementOrNonsenseString = statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, fileContext),
31
+ statementOrNonsenseString = statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, context),
32
32
  lastStatementOrNonsenseString = statementOrNonsenseString; ///
33
33
 
34
34
  return lastStatementOrNonsenseString;
35
35
  }
36
36
 
37
- function statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, fileContext) {
37
+ function statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNode, context) {
38
38
  let statementOrNonsenseString;
39
39
 
40
40
  const nonsenseNode = suppositionOrStepNode.getNonsenseNode(),
@@ -43,11 +43,11 @@ function statementOrNonsenseStringFromSuppositionOrStepNode(suppositionOrStepNod
43
43
  if (false) {
44
44
  ///
45
45
  } else if (nonsenseNode !== null) {
46
- const nonsenseString = fileContext.nodeAsString(nonsenseNode);
46
+ const nonsenseString = context.nodeAsString(nonsenseNode);
47
47
 
48
48
  statementOrNonsenseString = nonsenseString; ///
49
49
  } else if (statementNode !== null) {
50
- const statementString = fileContext.nodeAsString(statementNode);
50
+ const statementString = context.nodeAsString(statementNode);
51
51
 
52
52
  statementOrNonsenseString = statementString; ///
53
53
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  import dom from "../dom";
4
4
  import Verifier from "../verifier";
5
- import LocalContext from "../context/local";
6
5
 
7
6
  import { nodeQuery } from "../utilities/query";
8
7
 
@@ -11,12 +10,12 @@ const termNodeQuery = nodeQuery("/term"),
11
10
  statementNodeQuery = nodeQuery("/statement");
12
11
 
13
12
  class CombinatorVerifier extends Verifier {
14
- verifyStatement(statementNode, fileContext) {
13
+ verifyStatement(statementNode, context) {
15
14
  let statementVerifiesAsCombinator;
16
15
 
17
16
  const nonTerminalNode = statementNode, ///
18
17
  childNodes = nonTerminalNode.getChildNodes(),
19
- childNodesVerify = this.verifyChildNodes(childNodes, fileContext);
18
+ childNodesVerify = this.verifyChildNodes(childNodes, context);
20
19
 
21
20
  statementVerifiesAsCombinator = childNodesVerify; ///
22
21
 
@@ -26,10 +25,8 @@ class CombinatorVerifier extends Verifier {
26
25
  static maps = [
27
26
  {
28
27
  nodeQuery: statementNodeQuery,
29
- verify: (statementNode, fileContext) => {
28
+ verify: (statementNode, context) => {
30
29
  const { Statement } = dom,
31
- localContext = LocalContext.fromFileContext(fileContext),
32
- context = localContext, ///
33
30
  statement = Statement.fromStatementNode(statementNode, context),
34
31
  assignments = null,
35
32
  stated = false,
@@ -40,10 +37,8 @@ class CombinatorVerifier extends Verifier {
40
37
  },
41
38
  {
42
39
  nodeQuery: termNodeQuery,
43
- verify: (termNode, fileContext) => {
40
+ verify: (termNode, context) => {
44
41
  const { Term } = dom,
45
- localContext = LocalContext.fromFileContext(fileContext),
46
- context = localContext, ///
47
42
  term = Term.fromTermNode(termNode, context),
48
43
  termVerifies = term.verify(context, () => {
49
44
  const verifiesAhead = true;
@@ -56,11 +51,11 @@ class CombinatorVerifier extends Verifier {
56
51
  },
57
52
  {
58
53
  nodeQuery: typeNodeQuery,
59
- verify: (typeNode, fileContext) => {
54
+ verify: (typeNode, context) => {
60
55
  let typeVerifies = false;
61
56
 
62
57
  const typeName = typeNode.getTypeName(),
63
- typePresent = fileContext.isTypePresentByTypeName(typeName);
58
+ typePresent = context.isTypePresentByTypeName(typeName);
64
59
 
65
60
  if (typePresent) {
66
61
  typeVerifies = true;