@@ -89,7 +89,7 @@ object List {
89
89
// @formatter:off
90
90
1 ( l ≡ Cons (a, next) ) by Auto ,
91
91
2 ( next.length >= 0 ) by Premise ,
92
- 3 ( l.length ≡ (1 + next.length) ) by Simpl , // Auto,
92
+ 3 ( l.length ≡ (1 + next.length) ) by Auto ,
93
93
4 ( l.length >= 0 ) by Auto and (2 , 3 )
94
94
// @formatter:on
95
95
)
@@ -99,14 +99,24 @@ object List {
99
99
Deduce (
100
100
// @formatter:off
101
101
1 ( l ≡ Nil [T ]() ) by Auto ,
102
- 2 ( l.length >= 0 ) by Simpl // Auto
102
+ 2 ( l.length >= 0 ) by Auto
103
103
// @formatter:on
104
104
)
105
105
return
106
106
}
107
107
}
108
108
}
109
109
110
+ @ pure def emptyZeroLengthInductExpansionTest [T ](l : List [T ]): Unit = {
111
+ Contract (
112
+ Ensures (l.length >= 0 )
113
+ )
114
+
115
+ l : @ induct // to be expanded
116
+
117
+ halt(" To be filled in" )
118
+ }
119
+
110
120
@ pure def emptyZeroLengthInduct [T ](l : List [T ]): Unit = {
111
121
Contract (
112
122
Ensures (l.length >= 0 )
@@ -356,8 +366,8 @@ object List {
356
366
if (p._1 ≡ key2) {
357
367
Deduce (
358
368
// @formatter:off
359
- 1 ( map ≡ Cons (p, next) ) by Premise , // Auto -generated
360
- 2 ( lookup(update(next, key1, value), key2) ≡ lookup(next, key2) ) by Premise , // Auto -generated
369
+ 1 ( map ≡ Cons (p, next) ) by Premise , // auto -generated
370
+ 2 ( lookup(update(next, key1, value), key2) ≡ lookup(next, key2) ) by Premise , // auto -generated
361
371
3 ( key1 ≢ key2 ) by Premise ,
362
372
4 ( ! (p._1 ≡ key1) ) by Premise ,
363
373
5 ( p._1 ≡ key2 ) by Premise ,
@@ -368,8 +378,8 @@ object List {
368
378
} else {
369
379
Deduce (
370
380
// @formatter:off
371
- 1 ( map ≡ Cons (p, next) ) by Premise , // Auto -generated
372
- 2 ( lookup(update(next, key1, value), key2) ≡ lookup(next, key2) ) by Premise , // Auto -generated
381
+ 1 ( map ≡ Cons (p, next) ) by Premise , // auto -generated
382
+ 2 ( lookup(update(next, key1, value), key2) ≡ lookup(next, key2) ) by Premise , // auto -generated
373
383
3 ( key1 ≢ key2 ) by Premise ,
374
384
4 ( ! (p._1 ≡ key1) ) by Premise ,
375
385
5 ( ! (p._1 ≡ key2) ) by Premise ,
@@ -386,7 +396,7 @@ object List {
386
396
case Nil () => {
387
397
Deduce (
388
398
// @formatter:off
389
- 1 ( map ≡ Nil [(K , V )]() ) by Premise , // Auto -generated
399
+ 1 ( map ≡ Nil [(K , V )]() ) by Premise , // auto -generated
390
400
2 ( key1 ≢ key2 ) by Premise ,
391
401
3 ( update(map, key1, value) ≡ Cons (key1 ~> value, Nil [(K , V )]()) ) by RSimpl (RS (update _)), // Auto,
392
402
4 ( lookup(update(map, key1, value), key2) ≡ lookup(map, key2) ) by RSimpl (RS (lookup _)) // Auto,
@@ -615,7 +625,7 @@ object List {
615
625
if (q.length < q.capacity) {
616
626
Deduce (
617
627
// @formatter:off
618
- 1 ( q.strategy ≡ List .Queue .Strategy .DropEarliest ) by Premise , // Auto -generated
628
+ 1 ( q.strategy ≡ List .Queue .Strategy .DropEarliest ) by Premise , // auto -generated
619
629
2 ( q.length < q.capacity ) by Premise ,
620
630
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
621
631
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -625,7 +635,7 @@ object List {
625
635
} else {
626
636
Deduce (
627
637
// @formatter:off
628
- 1 ( q.strategy ≡ List .Queue .Strategy .DropEarliest ) by Premise , // Auto -generated
638
+ 1 ( q.strategy ≡ List .Queue .Strategy .DropEarliest ) by Premise , // auto -generated
629
639
2 ( ! (q.length < q.capacity) ) by Premise ,
630
640
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
631
641
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -638,7 +648,7 @@ object List {
638
648
if (q.length < q.capacity) {
639
649
Deduce (
640
650
// @formatter:off
641
- 1 ( q.strategy ≡ List .Queue .Strategy .DropLatest ) by Premise , // Auto -generated
651
+ 1 ( q.strategy ≡ List .Queue .Strategy .DropLatest ) by Premise , // auto -generated
642
652
2 ( q.length < q.capacity ) by Premise ,
643
653
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
644
654
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -648,7 +658,7 @@ object List {
648
658
} else {
649
659
Deduce (
650
660
// @formatter:off
651
- 1 ( q.strategy ≡ List .Queue .Strategy .DropLatest ) by Premise , // Auto -generated
661
+ 1 ( q.strategy ≡ List .Queue .Strategy .DropLatest ) by Premise , // auto -generated
652
662
2 ( ! (q.length < q.capacity) ) by Premise ,
653
663
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
654
664
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -661,7 +671,7 @@ object List {
661
671
if (q.length < q.capacity) {
662
672
Deduce (
663
673
// @formatter:off
664
- 1 ( q.strategy ≡ List .Queue .Strategy .Error ) by Premise , // Auto -generated
674
+ 1 ( q.strategy ≡ List .Queue .Strategy .Error ) by Premise , // auto -generated
665
675
2 ( q.length < q.capacity ) by Premise ,
666
676
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
667
677
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -671,7 +681,7 @@ object List {
671
681
} else {
672
682
Deduce (
673
683
// @formatter:off
674
- 1 ( q.strategy ≡ List .Queue .Strategy .Error ) by Premise , // Auto -generated
684
+ 1 ( q.strategy ≡ List .Queue .Strategy .Error ) by Premise , // auto -generated
675
685
2 ( ! (q.length < q.capacity) ) by Premise ,
676
686
3 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
677
687
4 ( q.push(a).strategy ≡ q.strategy ) by Simpl
@@ -683,7 +693,7 @@ object List {
683
693
case Queue .Strategy .Unbounded => {
684
694
Deduce (
685
695
// @formatter:off
686
- 1 ( q.strategy ≡ List .Queue .Strategy .Unbounded ) by Premise , // Auto -generated
696
+ 1 ( q.strategy ≡ List .Queue .Strategy .Unbounded ) by Premise , // auto -generated
687
697
2 ( q.push(a).capacity ≡ q.capacity ) by Simpl ,
688
698
3 ( q.push(a).strategy ≡ q.strategy ) by Simpl
689
699
// @formatter:on
0 commit comments