occam-verify-cli 1.0.826 → 1.0.827

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 (47) hide show
  1. package/lib/element/declaration/combinator.js +5 -6
  2. package/lib/element/declaration/complexType.js +23 -24
  3. package/lib/element/declaration/constructor.js +8 -9
  4. package/lib/element/declaration/metavariable.js +8 -9
  5. package/lib/element/declaration/simpleType.js +17 -18
  6. package/lib/element/declaration/typePrefix.js +5 -6
  7. package/lib/element/declaration/variable.js +8 -9
  8. package/lib/element/error.js +3 -3
  9. package/lib/element/proofAssertion/premise.js +5 -5
  10. package/lib/element/proofAssertion/step.js +3 -3
  11. package/lib/element/proofAssertion/supposition.js +5 -5
  12. package/lib/element/rule.js +8 -9
  13. package/lib/element/section.js +3 -3
  14. package/lib/element/topLevelAssertion/axiom.js +3 -4
  15. package/lib/element/topLevelAssertion/conjecture.js +3 -4
  16. package/lib/element/topLevelAssertion/lemma.js +3 -4
  17. package/lib/element/topLevelAssertion/theorem.js +3 -4
  18. package/lib/element/topLevelAssertion.js +3 -3
  19. package/lib/element/topLevelMetaAssertion/metaLemma.js +3 -4
  20. package/lib/element/topLevelMetaAssertion/metatheorem.js +3 -4
  21. package/lib/element/topLevelMetaAssertion.js +6 -6
  22. package/lib/process/verify.js +17 -17
  23. package/lib/utilities/element.js +80 -38
  24. package/package.json +1 -1
  25. package/src/element/declaration/combinator.js +4 -7
  26. package/src/element/declaration/complexType.js +22 -31
  27. package/src/element/declaration/constructor.js +7 -11
  28. package/src/element/declaration/metavariable.js +7 -11
  29. package/src/element/declaration/simpleType.js +17 -24
  30. package/src/element/declaration/typePrefix.js +4 -7
  31. package/src/element/declaration/variable.js +7 -11
  32. package/src/element/error.js +2 -3
  33. package/src/element/proofAssertion/premise.js +4 -4
  34. package/src/element/proofAssertion/step.js +2 -2
  35. package/src/element/proofAssertion/supposition.js +4 -4
  36. package/src/element/rule.js +7 -11
  37. package/src/element/section.js +2 -3
  38. package/src/element/topLevelAssertion/axiom.js +2 -4
  39. package/src/element/topLevelAssertion/conjecture.js +2 -4
  40. package/src/element/topLevelAssertion/lemma.js +2 -4
  41. package/src/element/topLevelAssertion/theorem.js +2 -4
  42. package/src/element/topLevelAssertion.js +2 -3
  43. package/src/element/topLevelMetaAssertion/metaLemma.js +2 -4
  44. package/src/element/topLevelMetaAssertion/metatheorem.js +2 -4
  45. package/src/element/topLevelMetaAssertion.js +5 -7
  46. package/src/process/verify.js +16 -16
  47. package/src/utilities/element.js +133 -70
@@ -79,8 +79,11 @@ export function ruleFromRuleNode(ruleNode, context) {
79
79
  ruleString = rulsStringFromLabelsPremisesAndConclusion(labels, premises, conclusion),
80
80
  node = ruleNode, ///
81
81
  string = ruleString, ///
82
- lineIndex = null,
83
- rule = new Rule(context, string, node, lineIndex, proof, labels, premises, conclusion);
82
+ lineIndex = null;
83
+
84
+ context = null;
85
+
86
+ const rule = new Rule(context, string, node, lineIndex, proof, labels, premises, conclusion);
84
87
 
85
88
  return rule;
86
89
  }
@@ -100,8 +103,11 @@ export function errorFromErrorNode(errorNode, context) {
100
103
  const { Error } = elements,
101
104
  node = errorNode, ///
102
105
  string = context.nodeAsString(node),
103
- lineIndex = null,
104
- error = new Error(context, string, node, lineIndex);
106
+ lineIndex = null;
107
+
108
+ context = null;
109
+
110
+ const error = new Error(context, string, node, lineIndex);
105
111
 
106
112
  return error;
107
113
  }
@@ -118,8 +124,11 @@ export function lemmaFromLemmaNode(lemmaNode, context) {
118
124
  topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
119
125
  node = lemmaNode, ///
120
126
  string = topLevelAsssertionString, ///
121
- lineIndex = null,
122
- lemma = new Lemma(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
127
+ lineIndex = null;
128
+
129
+ context = null;
130
+
131
+ const lemma = new Lemma(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
123
132
 
124
133
  return lemma;
125
134
  }
@@ -130,8 +139,11 @@ export function frameFromFrameNode(frameNode, context) {
130
139
  string = context.nodeAsString(node),
131
140
  lineIndex = null,
132
141
  assumptions = assumptionsFromFrameNode(frameNode, context),
133
- metavariable = metavariableFromFrameNode(frameNode, context),
134
- frame = new Frame(context, string, node, lineIndex, assumptions, metavariable);
142
+ metavariable = metavariableFromFrameNode(frameNode, context);
143
+
144
+ context = null;
145
+
146
+ const frame = new Frame(context, string, node, lineIndex, assumptions, metavariable);
135
147
 
136
148
  return frame;
137
149
  }
@@ -141,8 +153,11 @@ export function proofFromProofNode(proofNode, context) {
141
153
  node = proofNode, ///
142
154
  string = null,
143
155
  lineIndex = null,
144
- derivation = derivationFromProofNode(proofNode, context),
145
- proof = new Proof(context, string, node, lineIndex, derivation);
156
+ derivation = derivationFromProofNode(proofNode, context);
157
+
158
+ context = null;
159
+
160
+ const proof = new Proof(context, string, node, lineIndex, derivation);
146
161
 
147
162
  return proof;
148
163
  }
@@ -175,8 +190,11 @@ export function sectionFromSectionNode(sectionNode, context) {
175
190
  sectionString = sectionStringFromHypothesesTopLevelAssertion(hypotheses, axiom, lemma, theorem, conjecture),
176
191
  node = sectionNode, ///
177
192
  string = sectionString, ///
178
- lineIndex = null,
179
- section = new Section(context, string, node, lineIndex, hypotheses, axiom, lemma, theorem, conjecture);
193
+ lineIndex = null;
194
+
195
+ context = null;
196
+
197
+ const section = new Section(context, string, node, lineIndex, hypotheses, axiom, lemma, theorem, conjecture);
180
198
 
181
199
  return section;
182
200
  }
@@ -205,8 +223,11 @@ export function theoremFromTheoremNode(theoremNode, context) {
205
223
  topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
206
224
  node = theoremNode, ///
207
225
  string = topLevelAsssertionString, ///
208
- lineIndex = null,
209
- theorem = new Theorem(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
226
+ lineIndex = null;
227
+
228
+ context = null;
229
+
230
+ const theorem = new Theorem(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
210
231
 
211
232
  return theorem;
212
233
  }
@@ -218,8 +239,11 @@ export function propertyFromPropertyNode(propertyNode, context) {
218
239
  lineIndex = null,
219
240
  propertyName = propertyNode.getPropertyName(),
220
241
  nominalTypeName = null,
221
- name = propertyName, ///
222
- property = new Property(context, string, node, lineIndex, name, nominalTypeName);
242
+ name = propertyName; ///
243
+
244
+ context = null;
245
+
246
+ const property = new Property(context, string, node, lineIndex, name, nominalTypeName);
223
247
 
224
248
  return property;
225
249
  }
@@ -231,8 +255,11 @@ export function variableFromVariableNode(variableNode, context) {
231
255
  lineIndex = null,
232
256
  type = null,
233
257
  identifier = identifierFromVarialbeNode(variableNode, context),
234
- propertyRelations = [],
235
- variable = new Variable(context, string, node, lineIndex, type, identifier, propertyRelations);
258
+ propertyRelations = [];
259
+
260
+ context = null;
261
+
262
+ const variable = new Variable(context, string, node, lineIndex, type, identifier, propertyRelations);
236
263
 
237
264
  return variable;
238
265
  }
@@ -244,8 +271,11 @@ export function subproofFromSubproofNode(subproofNode, context) {
244
271
  subDerivation = subDerivationFromSubproofNode(subproofNode, context),
245
272
  subproofString = subproofStringFromSuppositionsAndSubDerivation(suppositions, subDerivation, context),
246
273
  string = subproofString, ///
247
- lineIndex = null,
248
- subproof = new Subproof(context, string, node, lineIndex, suppositions, subDerivation);
274
+ lineIndex = null;
275
+
276
+ context = null;
277
+
278
+ const subproof = new Subproof(context, string, node, lineIndex, suppositions, subDerivation);
249
279
 
250
280
  return subproof;
251
281
  }
@@ -256,8 +286,11 @@ export function equalityFromEqualityNode(equalityNode, context) {
256
286
  string = context.nodeAsString(node),
257
287
  lineIndex = null,
258
288
  leftTerm = leftTermFromEqualityNode(equalityNode, context),
259
- rightTerm = rightTermFromEqualityNode(equalityNode, context),
260
- equality = new Equality(context, string, node, lineIndex, leftTerm, rightTerm);
289
+ rightTerm = rightTermFromEqualityNode(equalityNode, context);
290
+
291
+ context = null;
292
+
293
+ const equality = new Equality(context, string, node, lineIndex, leftTerm, rightTerm);
261
294
 
262
295
  return equality;
263
296
  }
@@ -277,8 +310,11 @@ export function statementFromStatementNode(statementNode, context) {
277
310
  const { Statement } = elements,
278
311
  node = statementNode, ///
279
312
  string = context.nodeAsString(node),
280
- lineIndex = null,
281
- statement = new Statement(context, string, node, lineIndex);
313
+ lineIndex = null;
314
+
315
+ context = null;
316
+
317
+ const statement = new Statement(context, string, node, lineIndex);
282
318
 
283
319
  return statement;
284
320
  }
@@ -288,8 +324,11 @@ export function signatureFromSignatureNode(signatureNode, context) {
288
324
  node = signatureNode, ///
289
325
  string = context.nodeAsString(node),
290
326
  lineIndex = null,
291
- terms = termsFromSignatureNode(signatureNode, context),
292
- signature = new Signature(context, string, node, lineIndex, terms);
327
+ terms = termsFromSignatureNode(signatureNode, context);
328
+
329
+ context = null;
330
+
331
+ const signature = new Signature(context, string, node, lineIndex, terms);
293
332
 
294
333
  return signature;
295
334
  }
@@ -312,8 +351,11 @@ export function judgementFromJudgementNode(judgementNode, context) {
312
351
  string = context.nodeAsString(node),
313
352
  lineIndex = null,
314
353
  frame = frameFromJudgementNode(judgementNode, context),
315
- assumption = assumptionFromJudgementNode(judgementNode, context),
316
- judgement = new Judgement(context, string, node, lineIndex, frame, assumption);
354
+ assumption = assumptionFromJudgementNode(judgementNode, context);
355
+
356
+ context = null;
357
+
358
+ const judgement = new Judgement(context, string, node, lineIndex, frame, assumption);
317
359
 
318
360
  return judgement;
319
361
  }
@@ -329,8 +371,11 @@ export function metaLemmaFromMetaLemmaNode(metaLemmaNode, context) {
329
371
  topLevelMetaAssertionString = topLevelMetaAssertionStringFromLabelSuppositionsDeductionAndMetaLevelAssumptions(label, suppositions, deduction, metaLevelAssumptions),
330
372
  node = metaLemmaMetathoremNode, ///
331
373
  string = topLevelMetaAssertionString, ///
332
- lineIndex = null,
333
- metaLemma = new MetaLemma(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
374
+ lineIndex = null;
375
+
376
+ context = null;
377
+
378
+ const metaLemma = new MetaLemma(context, string, node, lineIndex, label, suppositions, deduction, proof, metaLevelAssumptions);
334
379
 
335
380
  return metaLemma;
336
381
  }
@@ -341,8 +386,11 @@ export function parameterFromParameterNode(parameterNode, context) {
341
386
  string = context.nodeAsString(node),
342
387
  lineIndex = null,
343
388
  name = parameterNode.getName(),
344
- identifier = parameterNode.getIdentifier(),
345
- parameter = new Parameter(context, string, node, lineIndex, name, identifier);
389
+ identifier = parameterNode.getIdentifier();
390
+
391
+ context = null;
392
+
393
+ const parameter = new Parameter(context, string, node, lineIndex, name, identifier);
346
394
 
347
395
  return parameter;
348
396
  }
@@ -352,8 +400,11 @@ export function signatureFromJSignatureNode(signatureNode, context) {
352
400
  node = signatureNode,
353
401
  string = context.nodeAsString(node),
354
402
  lineIndex = null,
355
- terms = termsFromSignatureNode(signatureNode, context),
356
- signature = new Signature(context, string, node, lineIndex, terms);
403
+ terms = termsFromSignatureNode(signatureNode, context);
404
+
405
+ context = null;
406
+
407
+ const signature = new Signature(context, string, node, lineIndex, terms);
357
408
 
358
409
  return signature;
359
410
  }
@@ -363,8 +414,11 @@ export function hypothesisFromHypothesisNode(hypotheseNode, context) {
363
414
  node = hypotheseNode, ///
364
415
  string = context.nodeAsString(node),
365
416
  lineIndex = null,
366
- statement = statementFromHypothesisNode(hypotheseNode, context),
367
- hypohtesis = new Hypothsis(context, string, node, lineIndex, statement);
417
+ statement = statementFromHypothesisNode(hypotheseNode, context);
418
+
419
+ context = null;
420
+
421
+ const hypohtesis = new Hypothsis(context, string, node, lineIndex, statement);
368
422
 
369
423
  return hypohtesis;
370
424
  }
@@ -381,8 +435,11 @@ export function conjectureFromConjectureNode(conjectureNode, context) {
381
435
  topLevelAsssertionString = topLevelAssertionStringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
382
436
  node = conjectureNode, ///
383
437
  string = topLevelAsssertionString, ///
384
- lineIndex = null,
385
- conjecture = new Conjecture(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
438
+ lineIndex = null;
439
+
440
+ context = null;
441
+
442
+ const conjecture = new Conjecture(context, string, node, lineIndex, labels, suppositions, deduction, proof, signature, hypotheses);
386
443
 
387
444
  return conjecture;
388
445
  }
@@ -392,8 +449,11 @@ export function combinatorFromCombinatorNode(combinatorNode, context) {
392
449
  node = combinatorNode, ///
393
450
  string = context.nodeAsString(node),
394
451
  lineIndex = null,
395
- statement = statementFromCombinatorNode(combinatorNode, context),
396
- combinator = new Combinator(context, string, node, lineIndex, statement);
452
+ statement = statementFromCombinatorNode(combinatorNode, context);
453
+
454
+ context = null;
455
+
456
+ const combinator = new Combinator(context, string, node, lineIndex, statement);
397
457
 
398
458
  return combinator;
399
459
  }
@@ -414,8 +474,11 @@ export function derivationFromDerivationNode(derivationNode, context) {
414
474
  node = derivationNode, ///
415
475
  string = null,
416
476
  lineIndex = null,
417
- stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context),
418
- derivation = new Derivation(context, string, node, lineIndex, stepsOrSubproofs);
477
+ stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context);
478
+
479
+ context = null;
480
+
481
+ const derivation = new Derivation(context, string, node, lineIndex, stepsOrSubproofs);
419
482
 
420
483
  return derivation;
421
484
  }
@@ -426,8 +489,11 @@ export function typePrefixFromTypePrefixNode(typePrefixNode, context) {
426
489
  string = context.nodeAsString(node),
427
490
  lineIndex = null,
428
491
  term = termFromTypePrefixNode(typePrefixNode, context),
429
- type = typeFromTypePrefixNode(typePrefixNode, context),
430
- typePrefix = new TypePrefix(context, string, node, lineIndex, term, type);
492
+ type = typeFromTypePrefixNode(typePrefixNode, context);
493
+
494
+ context = null;
495
+
496
+ const typePrefix = new TypePrefix(context, string, node, lineIndex, term, type);
431
497
 
432
498
  return typePrefix;
433
499
  }
@@ -438,8 +504,11 @@ export function assumptionFromAssumptionNode(assumptionNode, context) {
438
504
  string = context.nodeAsString(node),
439
505
  lineIndex = null,
440
506
  reference = referenceFromAssumptionNode(assumptionNode, context),
441
- statement = statementFromAssumptionNode(assumptionNode, context),
442
- assumption = new Assumption(context, string, node, lineIndex, reference, statement);
507
+ statement = statementFromAssumptionNode(assumptionNode, context);
508
+
509
+ context = null;
510
+
511
+ const assumption = new Assumption(context, string, node, lineIndex, reference, statement);
443
512
 
444
513
  return assumption;
445
514
  }
@@ -450,8 +519,11 @@ export function constructorFromConstructorNode(constructorNode, context) {
450
519
  string = context.nodeAsString(node),
451
520
  lineIndex = null,
452
521
  term = termFromConstructorNode(constructorNode, context),
453
- type = typeFromConstructorNode(constructorNode, context),
454
- constructor = new Constructor(context, string, node, lineIndex, term, type);
522
+ type = typeFromConstructorNode(constructorNode, context);
523
+
524
+ context = null;
525
+
526
+ const constructor = new Constructor(context, string, node, lineIndex, term, type);
455
527
 
456
528
  return constructor;
457
529
  }
@@ -475,8 +547,11 @@ export function equivalenceFromEquivalenceNode(equivalenceNode, context) {
475
547
  type = typeFromEquivalenceNode(equivalenceNode, context),
476
548
  terms = termsFromEquivalenceNode(equivalenceNode, context),
477
549
  equivalenceString = equivalenceStringFromTerms(terms),
478
- string = equivalenceString, ///
479
- equivalence = new Equivalence(context, string, node, lineIndex, type, terms);
550
+ string = equivalenceString; ///
551
+
552
+ context = null;
553
+
554
+ const equivalence = new Equivalence(context, string, node, lineIndex, type, terms);
480
555
 
481
556
  return equivalence;
482
557
  }
@@ -609,11 +684,8 @@ export function termSubstitutionFromTermSubstitutionNode(termSubstitutionNode, c
609
684
  lineIndex = null,
610
685
  generalContext = generalContextFromTermSubstitutionNode(termSubstitutionNode, context),
611
686
  targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
612
- replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context);
613
-
614
- context = null;
615
-
616
- const termSubstitution = new TermSubstitution(context, string, node, lineIndex, generalContext, targetTerm, replacementTerm);
687
+ replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context),
688
+ termSubstitution = new TermSubstitution(context, string, node, lineIndex, generalContext, targetTerm, replacementTerm);
617
689
 
618
690
  return termSubstitution;
619
691
  }
@@ -625,11 +697,8 @@ export function frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode
625
697
  lineIndex = null,
626
698
  generalContext = generalContextFromFrameSubstitutionNode(frameSubstitutionNode, context),
627
699
  targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
628
- replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context);
629
-
630
- context = null;
631
-
632
- const frameSubstitution = new FrameSubstitution(context, string, node, lineIndex, generalContext, targetFrame, replacementFrame);
700
+ replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
701
+ frameSubstitution = new FrameSubstitution(context, string, node, lineIndex, generalContext, targetFrame, replacementFrame);
633
702
 
634
703
  return frameSubstitution;
635
704
  }
@@ -793,11 +862,8 @@ export function referenceSubstitutionFromReferenceSubstitutionNode(referenceSubs
793
862
  lineIndex = null,
794
863
  generalContext = generalContextFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
795
864
  targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
796
- replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context);
797
-
798
- context = null;
799
-
800
- const referenceSubstitution = new ReferenceSubstitution(context, string, node, lineIndex, generalContext, targetReference, replacementReference);
865
+ replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
866
+ referenceSubstitution = new ReferenceSubstitution(context, string, node, lineIndex, generalContext, targetReference, replacementReference);
801
867
 
802
868
  return referenceSubstitution;
803
869
  }
@@ -812,11 +878,8 @@ export function statementSubstitutionFromStatementSubstitutionNode(statementSubs
812
878
  resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, context),
813
879
  substitution = substitutionFromStatementSubstitutionNode(statementSubstitutionNode, context),
814
880
  targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
815
- replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context);
816
-
817
- context = null;
818
-
819
- const statementSubstitution = new StatementSubstitution(context, string, node, lineIndex, generalContext, resolved, substitution, targetStatement, replacementStatement);
881
+ replacementStatement = replacementStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
882
+ statementSubstitution = new StatementSubstitution(context, string, node, lineIndex, generalContext, resolved, substitution, targetStatement, replacementStatement);
820
883
 
821
884
  return statementSubstitution;
822
885
  }