-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathpersistent_array.coma
More file actions
6823 lines (4987 loc) · 378 KB
/
persistent_array.coma
File metadata and controls
6823 lines (4987 loc) · 378 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module M_implementation__impl_Clone_for_PersistentArray_T__clone (* <implementation::PersistentArray<T> as std::clone::Clone> *)
type namespace_other
type t_Namespace = Namespace_PARRAY int | Other namespace_other
use seq.Seq
use map.Map
use map.Const
use creusot.prelude.Any
use int.Int
type t_Rc_PermCell_Inner_T_Global
type t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
type t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T = { f0: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T }
type t_Rc_NonAtomicInvariant_PA_T_Global
type t_PersistentArray_T = {
permcell: t_Rc_PermCell_Inner_T_Global;
frag: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T;
inv: t_Rc_NonAtomicInvariant_PA_T_Global }
predicate inv_Rc_PermCell_Inner_T_Global (_1: t_Rc_PermCell_Inner_T_Global)
predicate invariant_ref_Rc_PermCell_Inner_T_Global [@inline:trivial] (self: t_Rc_PermCell_Inner_T_Global) =
inv_Rc_PermCell_Inner_T_Global self
meta "rewrite_def" predicate invariant_ref_Rc_PermCell_Inner_T_Global
predicate inv_ref_Rc_PermCell_Inner_T_Global [@inline:trivial] (_1: t_Rc_PermCell_Inner_T_Global) =
invariant_ref_Rc_PermCell_Inner_T_Global _1
meta "rewrite_def" predicate inv_ref_Rc_PermCell_Inner_T_Global
let rec clone_Rc_PermCell_Inner_T_Global (self_: t_Rc_PermCell_Inner_T_Global)
(return (x: t_Rc_PermCell_Inner_T_Global)) =
{[@stop_split] [@expl:clone 'self_' type invariant] inv_ref_Rc_PermCell_Inner_T_Global self_}
any
[ return (result: t_Rc_PermCell_Inner_T_Global) ->
{[@stop_split] [@expl:clone_Rc_PermCell_Inner_T_Global ensures] ([@stop_split] [@expl:clone result type invariant] inv_Rc_PermCell_Inner_T_Global result)
/\ ([@stop_split] [@expl:clone ensures] result = self_)}
(! return {result}) ]
let rec deref_Ghost_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> {[@stop_split] [@expl:deref ensures] result = self}
(! return {result}) ]
type t_Id
function id_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Id
function id_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Id =
id_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self.f0
type t_FMap_PermCell_Inner_T_Ag_Seq_T
type t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
type t_Option_FMap_PermCell_Inner_T_Ag_Seq_T = None | Some t_FMap_PermCell_Inner_T_Ag_Seq_T
type t_T
type t_Ag_Seq_T = { f0'0: Seq.seq t_T }
type t_Option_Ag_Seq_T = None'0 | Some'0 t_Ag_Seq_T
type t_Option_Option_Ag_Seq_T = None'1 | Some'1 t_Option_Ag_Seq_T
type tup2_Option_Ag_Seq_T_Option_Ag_Seq_T = { f0'1: t_Option_Ag_Seq_T; f1'1: t_Option_Ag_Seq_T }
function map_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (f: Map.map t_Ag_Seq_T t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T
= match self with
| None'0 -> None'1
| Some'0 x -> Some'1 (Map.get f x)
end
function op_Ag_Seq_T (self: t_Ag_Seq_T) (other: t_Ag_Seq_T) : t_Option_Ag_Seq_T = if self.f0'0 = other.f0'0 then
Some'0 self
else
None'0
function commutative_Ag_Seq_T (a: t_Ag_Seq_T) (b: t_Ag_Seq_T) : ()
axiom commutative_Ag_Seq_T_spec: forall a: t_Ag_Seq_T, b: t_Ag_Seq_T. op_Ag_Seq_T a b = op_Ag_Seq_T b a
function op_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T =
match { f0'1 = self; f1'1 = other } with
| {f0'1 = None'0} -> Some'1 other
| {f1'1 = None'0} -> Some'1 self
| {f0'1 = Some'0 x; f1'1 = Some'0 y} -> map_Option_Ag_Seq_T (op_Ag_Seq_T x y) (fun (z: t_Ag_Seq_T) -> Some'0 z)
end
function commutative_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) : ()
axiom commutative_Option_Ag_Seq_T_spec: forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= op_Option_Ag_Seq_T b a
type t_PermCell_Inner_T
function to_mapping_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : Map.map t_PermCell_Inner_T t_Option_Ag_Seq_T
function get_PermCell_Inner_T [@inline:trivial] (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (k: t_PermCell_Inner_T) : t_Option_Ag_Seq_T
= Map.get (to_mapping_PermCell_Inner_T self) k
meta "rewrite_def" function get_PermCell_Inner_T
function total_op_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom total_op_PermCell_Inner_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, other: t_FMap_PermCell_Inner_T_Ag_Seq_T. (forall k: t_PermCell_Inner_T. op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k)
<> None'1)
-> (forall k: t_PermCell_Inner_T. Some'1 (get_PermCell_Inner_T (total_op_PermCell_Inner_T self other) k)
= op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k))
function op_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
= if forall k: t_PermCell_Inner_T. op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k)
<> None'1 then
Some (total_op_PermCell_Inner_T self other)
else
None
function commutative_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom commutative_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= op_FMap_PermCell_Inner_T_Ag_Seq_T b a
function len_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : int
axiom len_PermCell_Inner_T_spec: forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T. len_PermCell_Inner_T self >= 0
constant empty_PermCell_Inner_T : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom empty_PermCell_Inner_T_spec: len_PermCell_Inner_T empty_PermCell_Inner_T = 0
axiom empty_PermCell_Inner_T_spec'0: to_mapping_PermCell_Inner_T empty_PermCell_Inner_T = Const.const (None'0)
constant unit_FMap_PermCell_Inner_T_Ag_Seq_T: t_FMap_PermCell_Inner_T_Ag_Seq_T = empty_PermCell_Inner_T
axiom unit_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall x: t_FMap_PermCell_Inner_T_Ag_Seq_T [op_FMap_PermCell_Inner_T_Ag_Seq_T x unit_FMap_PermCell_Inner_T_Ag_Seq_T]. op_FMap_PermCell_Inner_T_Ag_Seq_T x unit_FMap_PermCell_Inner_T_Ag_Seq_T
= Some x
function factor_Ag_Seq_T (self: t_Ag_Seq_T) (factor: t_Ag_Seq_T) : t_Option_Ag_Seq_T = op_Ag_Seq_T self factor
axiom factor_Ag_Seq_T_spec: forall self: t_Ag_Seq_T, factor: t_Ag_Seq_T. match factor_Ag_Seq_T self factor with
| Some'0 c -> op_Ag_Seq_T factor c = Some'0 self
| None'0 -> forall c: t_Ag_Seq_T. op_Ag_Seq_T factor c <> Some'0 self
end
function factor_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (factor: t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T =
match { f0'1 = self; f1'1 = factor } with
| {f0'1 = x; f1'1 = None'0} -> Some'1 x
| {f0'1 = None'0} -> None'1
| {f0'1 = Some'0 x; f1'1 = Some'0 y} -> match factor_Ag_Seq_T x y with
| Some'0 z -> Some'1 (Some'0 z)
| None'0 -> if x = y then Some'1 (None'0) else None'1
end
end
axiom factor_Option_Ag_Seq_T_spec:
forall self: t_Option_Ag_Seq_T, factor: t_Option_Ag_Seq_T. match factor_Option_Ag_Seq_T self factor with
| Some'1 c -> op_Option_Ag_Seq_T factor c = Some'1 self
| None'1 -> forall c: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T factor c <> Some'1 self
end
predicate incl_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) =
factor_Option_Ag_Seq_T other self <> None'1
function incl_transitive_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) : ()
axiom incl_transitive_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T. incl_Option_Ag_Seq_T a b
-> incl_Option_Ag_Seq_T b c -> incl_Option_Ag_Seq_T a c
function associative_some_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) (ab: t_Option_Ag_Seq_T) (bc: t_Option_Ag_Seq_T) : ()
axiom associative_some_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T, ab: t_Option_Ag_Seq_T, bc: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= Some'1 ab -> op_Option_Ag_Seq_T b c = Some'1 bc -> op_Option_Ag_Seq_T a bc = op_Option_Ag_Seq_T ab c
function associative_none_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) (bc: t_Option_Ag_Seq_T) : ()
axiom associative_none_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T, bc: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= None'1 -> op_Option_Ag_Seq_T b c = Some'1 bc -> op_Option_Ag_Seq_T a bc = None'1
function incl_op_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) (comb: t_Option_Ag_Seq_T) : ()
axiom incl_op_Option_Ag_Seq_T_spec:
forall self: t_Option_Ag_Seq_T, other: t_Option_Ag_Seq_T, comb: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T self other
= Some'1 comb -> incl_Option_Ag_Seq_T self comb
type tup2_PermCell_Inner_T_Ag_Seq_T = { f0'2: t_PermCell_Inner_T; f1'2: t_Ag_Seq_T }
function index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T [@inline:trivial] (self: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T) (a: tup2_PermCell_Inner_T_Ag_Seq_T) : t_Option_Ag_Seq_T
= Map.get self a
meta "rewrite_def" function index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T
function filter_map_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (f: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom filter_map_PermCell_Inner_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, f: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T. forall k: t_PermCell_Inner_T [get_PermCell_Inner_T (filter_map_PermCell_Inner_T self f) k]. get_PermCell_Inner_T (filter_map_PermCell_Inner_T self f) k
= match get_PermCell_Inner_T self k with
| None'0 -> None'0
| Some'0 v -> index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T f { f0'2 = k; f1'2 = v }
end
function factor_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (factor: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
=
if forall k: t_PermCell_Inner_T. incl_Option_Ag_Seq_T (get_PermCell_Inner_T factor k) (get_PermCell_Inner_T self k) then
let res = filter_map_PermCell_Inner_T self (fun (__0: tup2_PermCell_Inner_T_Ag_Seq_T) -> let {f0'2 = k; f1'2 = vo} = __0 in match factor_Option_Ag_Seq_T (Some'0 vo) (get_PermCell_Inner_T factor k) with
| Some'1 r -> r
| None'1 -> None'0
end) in Some res
else
None
axiom factor_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, factor: t_FMap_PermCell_Inner_T_Ag_Seq_T. match factor_FMap_PermCell_Inner_T_Ag_Seq_T self factor with
| Some c -> op_FMap_PermCell_Inner_T_Ag_Seq_T factor c = Some self
| None -> forall c: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T factor c <> Some self
end
predicate incl_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) =
factor_FMap_PermCell_Inner_T_Ag_Seq_T other self <> None
function incl_transitive_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom incl_transitive_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T. incl_FMap_PermCell_Inner_T_Ag_Seq_T a b
-> incl_FMap_PermCell_Inner_T_Ag_Seq_T b c -> incl_FMap_PermCell_Inner_T_Ag_Seq_T a c
function associative_some_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) (ab: t_FMap_PermCell_Inner_T_Ag_Seq_T) (bc: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom associative_some_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T, ab: t_FMap_PermCell_Inner_T_Ag_Seq_T, bc: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= Some ab
-> op_FMap_PermCell_Inner_T_Ag_Seq_T b c = Some bc
-> op_FMap_PermCell_Inner_T_Ag_Seq_T a bc = op_FMap_PermCell_Inner_T_Ag_Seq_T ab c
function associative_none_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) (bc: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom associative_none_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T, bc: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= None -> op_FMap_PermCell_Inner_T_Ag_Seq_T b c = Some bc -> op_FMap_PermCell_Inner_T_Ag_Seq_T a bc = None
function incl_op_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) (comb: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom incl_op_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, other: t_FMap_PermCell_Inner_T_Ag_Seq_T, comb: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T self other
= Some comb -> incl_FMap_PermCell_Inner_T_Ag_Seq_T self comb
predicate rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f: t_FMap_PermCell_Inner_T_Ag_Seq_T) =
match a with
| Some a'0 -> incl_FMap_PermCell_Inner_T_Ag_Seq_T f a'0
| None -> true
end
function rel_unit_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_unit_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a unit_FMap_PermCell_Inner_T_Ag_Seq_T
function rel_none_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_none_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T, f: t_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (None) f
function rel_mono_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f1: t_FMap_PermCell_Inner_T_Ag_Seq_T) (f2: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_mono_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T, f1: t_FMap_PermCell_Inner_T_Ag_Seq_T, f2: t_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a f1
-> incl_FMap_PermCell_Inner_T_Ag_Seq_T f2 f1 -> rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a f2
function auth_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
function frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (auth_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self) (frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self)
function val_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
function view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
= val_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self
meta "rewrite_def" function view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
function view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
=
frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self.f0)
function core_Ag_Seq_T (self: t_Ag_Seq_T) : t_Option_Ag_Seq_T = Some'0 self
function core_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
=
Some (filter_map_PermCell_Inner_T self (fun (__0: tup2_PermCell_Inner_T_Ag_Seq_T) -> let {f1'2 = v} = __0 in core_Ag_Seq_T v))
function core_total_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
=
filter_map_PermCell_Inner_T self (fun (__0: tup2_PermCell_Inner_T_Ag_Seq_T) -> let {f1'2 = v} = __0 in core_Ag_Seq_T v)
axiom core_total_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T. core_FMap_PermCell_Inner_T_Ag_Seq_T self
= Some (core_total_FMap_PermCell_Inner_T_Ag_Seq_T self)
let rec core_FMap_PermCell_Inner_T_Ag_Seq_T'0 (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:core_FMap_PermCell_Inner_T_Ag_Seq_T ensures] ([@stop_split] [@expl:core ensures #0] id_FMap_PermCell_Inner_T_Ag_Seq_T result
= id_FMap_PermCell_Inner_T_Ag_Seq_T self)
/\ ([@stop_split] [@expl:core ensures #1] view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T result
= core_total_FMap_PermCell_Inner_T_Ag_Seq_T (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T self))}
(! return {result}) ]
let rec new_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T (x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x'0: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> {[@stop_split] [@expl:new ensures] result = x}
(! return {result}) ]
predicate inv_Rc_NonAtomicInvariant_PA_T_Global (_1: t_Rc_NonAtomicInvariant_PA_T_Global)
predicate invariant_Ghost_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (self: t_Rc_NonAtomicInvariant_PA_T_Global) =
inv_Rc_NonAtomicInvariant_PA_T_Global self
meta "rewrite_def" predicate invariant_Ghost_Rc_NonAtomicInvariant_PA_T_Global
predicate inv_Ghost_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (_1: t_Rc_NonAtomicInvariant_PA_T_Global) =
invariant_Ghost_Rc_NonAtomicInvariant_PA_T_Global _1
meta "rewrite_def" predicate inv_Ghost_Rc_NonAtomicInvariant_PA_T_Global
predicate invariant_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (self: t_Rc_NonAtomicInvariant_PA_T_Global) =
inv_Ghost_Rc_NonAtomicInvariant_PA_T_Global self
meta "rewrite_def" predicate invariant_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global
predicate inv_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (_1: t_Rc_NonAtomicInvariant_PA_T_Global) =
invariant_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global _1
meta "rewrite_def" predicate inv_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global
predicate invariant_ref_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (self: t_Rc_NonAtomicInvariant_PA_T_Global) =
inv_Rc_NonAtomicInvariant_PA_T_Global self
meta "rewrite_def" predicate invariant_ref_Rc_NonAtomicInvariant_PA_T_Global
predicate inv_ref_Rc_NonAtomicInvariant_PA_T_Global [@inline:trivial] (_1: t_Rc_NonAtomicInvariant_PA_T_Global) =
invariant_ref_Rc_NonAtomicInvariant_PA_T_Global _1
meta "rewrite_def" predicate inv_ref_Rc_NonAtomicInvariant_PA_T_Global
let rec deref_Ghost_Rc_NonAtomicInvariant_PA_T_Global (self: t_Rc_NonAtomicInvariant_PA_T_Global)
(return (x: t_Rc_NonAtomicInvariant_PA_T_Global)) =
{[@stop_split] [@expl:deref 'self' type invariant] inv_ref_Ghost_Rc_NonAtomicInvariant_PA_T_Global self}
any
[ return (result: t_Rc_NonAtomicInvariant_PA_T_Global) ->
{[@stop_split] [@expl:deref_Ghost_Rc_NonAtomicInvariant_PA_T_Global ensures] ([@stop_split] [@expl:deref result type invariant] inv_ref_Rc_NonAtomicInvariant_PA_T_Global result)
/\ ([@stop_split] [@expl:deref ensures] result = self)}
(! return {result}) ]
let rec clone_Rc_NonAtomicInvariant_PA_T_Global (self_: t_Rc_NonAtomicInvariant_PA_T_Global)
(return (x: t_Rc_NonAtomicInvariant_PA_T_Global)) =
{[@stop_split] [@expl:clone 'self_' type invariant] inv_ref_Rc_NonAtomicInvariant_PA_T_Global self_}
any
[ return (result: t_Rc_NonAtomicInvariant_PA_T_Global) ->
{[@stop_split] [@expl:clone_Rc_NonAtomicInvariant_PA_T_Global ensures] ([@stop_split] [@expl:clone result type invariant] inv_Rc_NonAtomicInvariant_PA_T_Global result)
/\ ([@stop_split] [@expl:clone ensures] result = self_)}
(! return {result}) ]
let rec new_Rc_NonAtomicInvariant_PA_T_Global (x: t_Rc_NonAtomicInvariant_PA_T_Global)
(return (x'0: t_Rc_NonAtomicInvariant_PA_T_Global)) =
{[@stop_split] [@expl:new 'x' type invariant] inv_Rc_NonAtomicInvariant_PA_T_Global x}
any
[ return (result: t_Rc_NonAtomicInvariant_PA_T_Global) ->
{[@stop_split] [@expl:new_Rc_NonAtomicInvariant_PA_T_Global ensures] ([@stop_split] [@expl:new result type invariant] inv_Ghost_Rc_NonAtomicInvariant_PA_T_Global result)
/\ ([@stop_split] [@expl:new ensures] result = x)}
(! return {result}) ]
type t_NonAtomicInvariant_PA_T
function public_PA_T (self: t_NonAtomicInvariant_PA_T) : t_Id
function view_Rc_NonAtomicInvariant_PA_T_Global (self: t_Rc_NonAtomicInvariant_PA_T_Global) : t_NonAtomicInvariant_PA_T
function view_Rc_PermCell_Inner_T_Global (self: t_Rc_PermCell_Inner_T_Global) : t_PermCell_Inner_T
function namespace_PA_T (self: t_NonAtomicInvariant_PA_T) : t_Namespace
predicate invariant_PersistentArray_T (self: t_PersistentArray_T) =
id_FMap_PermCell_Inner_T_Ag_Seq_T self.frag = public_PA_T (view_Rc_NonAtomicInvariant_PA_T_Global self.inv)
/\ get_PermCell_Inner_T (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T self.frag) (view_Rc_PermCell_Inner_T_Global self.permcell)
<> None'0
/\ namespace_PA_T (view_Rc_NonAtomicInvariant_PA_T_Global self.inv) = Namespace_PARRAY 0
predicate inv_PersistentArray_T (_1: t_PersistentArray_T)
axiom inv_axiom [@rewrite]: forall x: t_PersistentArray_T [inv_PersistentArray_T x]. inv_PersistentArray_T x
= (invariant_PersistentArray_T x
/\ inv_Rc_PermCell_Inner_T_Global x.permcell /\ inv_Ghost_Rc_NonAtomicInvariant_PA_T_Global x.inv)
predicate invariant_ref_PersistentArray_T [@inline:trivial] (self: t_PersistentArray_T) = inv_PersistentArray_T self
meta "rewrite_def" predicate invariant_ref_PersistentArray_T
predicate inv_ref_PersistentArray_T [@inline:trivial] (_1: t_PersistentArray_T) = invariant_ref_PersistentArray_T _1
meta "rewrite_def" predicate inv_ref_PersistentArray_T
predicate index_Mapping_Ag_Seq_T_bool [@inline:trivial] (self: Map.map t_Ag_Seq_T bool) (a: t_Ag_Seq_T) =
Map.get self a
meta "rewrite_def" predicate index_Mapping_Ag_Seq_T_bool
function such_that_Ag_Seq_T (p: Map.map t_Ag_Seq_T bool) : t_Ag_Seq_T
axiom such_that_Ag_Seq_T_spec:
forall p: Map.map t_Ag_Seq_T bool. (exists x: t_Ag_Seq_T. index_Mapping_Ag_Seq_T_bool p x)
-> index_Mapping_Ag_Seq_T_bool p (such_that_Ag_Seq_T p)
function unwrap_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) : t_Ag_Seq_T = match self with
| Some'0 x -> x
| None'0 -> such_that_Ag_Seq_T (fun (__0: t_Ag_Seq_T) -> true)
end
function view_PersistentArray_T [@inline:trivial] (self: t_PersistentArray_T) : Seq.seq t_T =
(unwrap_Option_Ag_Seq_T (get_PermCell_Inner_T (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T self.frag) (view_Rc_PermCell_Inner_T_Global self.permcell))).f0'0
meta "rewrite_def" function view_PersistentArray_T
meta "compute_max_steps" 1000000
meta "select_lsinst" "all"
let rec clone_PersistentArray_T (self: t_PersistentArray_T) (return (x: t_PersistentArray_T)) =
{[@stop_split] [@expl:clone 'self' type invariant] inv_ref_PersistentArray_T self}
(! bb0
[ bb0 = s0
[ s0 = clone_Rc_PermCell_Inner_T_Global {self.permcell}
(fun (_x: t_Rc_PermCell_Inner_T_Global) -> [ &_4 <- _x ] s1)
| s1 = deref_Ghost_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T {self.frag}
(fun (_x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> [ &_9 <- _x ] s2)
| s2 = core_FMap_PermCell_Inner_T_Ag_Seq_T'0 {_9}
(fun (_x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> [ &_7 <- _x ] s3)
| s3 = new_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T {_7}
(fun (_x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> [ &_6 <- _x ] s4)
| s4 = deref_Ghost_Rc_NonAtomicInvariant_PA_T_Global {self.inv}
(fun (_x: t_Rc_NonAtomicInvariant_PA_T_Global) -> [ &_14 <- _x ] s5)
| s5 = clone_Rc_NonAtomicInvariant_PA_T_Global {_14}
(fun (_x: t_Rc_NonAtomicInvariant_PA_T_Global) -> [ &_12 <- _x ] s6)
| s6 = new_Rc_NonAtomicInvariant_PA_T_Global {_12}
(fun (_x: t_Rc_NonAtomicInvariant_PA_T_Global) -> [ &_11 <- _x ] s7)
| s7 = [ &_ret <- { permcell = _4; frag = _6; inv = _11 } ] s8
| s8 = return {_ret} ] ]
[ & _ret: t_PersistentArray_T = Any.any_l ()
| & self: t_PersistentArray_T = self
| & _4: t_Rc_PermCell_Inner_T_Global = Any.any_l ()
| & _6: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T = Any.any_l ()
| & _7: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T = Any.any_l ()
| & _9: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T = Any.any_l ()
| & _11: t_Rc_NonAtomicInvariant_PA_T_Global = Any.any_l ()
| & _12: t_Rc_NonAtomicInvariant_PA_T_Global = Any.any_l ()
| & _14: t_Rc_NonAtomicInvariant_PA_T_Global = Any.any_l () ])
[ return (result: t_PersistentArray_T) ->
{[@stop_split] [@expl:clone_PersistentArray_T ensures] ([@stop_split] [@expl:clone result type invariant] inv_PersistentArray_T result)
/\ ([@stop_split] [@expl:clone ensures] view_PersistentArray_T result = view_PersistentArray_T self)}
(! return {result}) ]
end
module M_implementation__impl_PersistentArray_T__new (* implementation::PersistentArray<T> *)
type namespace_other
type t_Namespace = Namespace_PARRAY int | Other namespace_other
use seq.Seq
use creusot.int.UInt64
use map.Map
use map.Const
use creusot.prelude.MutBorrow
use creusot.prelude.Any
use int.Int
type t_Vec_T_Global
type t_T
constant const_MAX: UInt64.t = (18446744073709551615: UInt64.t)
function view_Vec_T_Global (self: t_Vec_T_Global) : Seq.seq t_T
axiom view_Vec_T_Global_spec: forall self: t_Vec_T_Global. Seq.length (view_Vec_T_Global self)
<= UInt64.t'int const_MAX
type t_Ag_Seq_T = { f0: Seq.seq t_T }
type t_Rc_PermCell_Inner_T_Global
type t_Inner_T = Direct t_Vec_T_Global | Link UInt64.t t_T t_Rc_PermCell_Inner_T_Global
type t_PermCell_Inner_T
type t_Perm_PermCell_Inner_T
type tup2_PermCell_Inner_T_Ghost_Box_Perm_PermCell_Inner_T_Global = {
f0'0: t_PermCell_Inner_T;
f1'0: t_Perm_PermCell_Inner_T }
predicate inv_T (_1: t_T)
predicate invariant_ref_T [@inline:trivial] (self: t_T) = inv_T self
meta "rewrite_def" predicate invariant_ref_T
predicate inv_ref_T [@inline:trivial] (_1: t_T) = invariant_ref_T _1
meta "rewrite_def" predicate inv_ref_T
predicate invariant_Seq_T [@inline:trivial] (self: Seq.seq t_T) =
forall i: int. 0 <= i /\ i < Seq.length self -> inv_ref_T (Seq.get self i)
meta "rewrite_def" predicate invariant_Seq_T
predicate inv_Seq_T [@inline:trivial] (_1: Seq.seq t_T) = invariant_Seq_T _1
meta "rewrite_def" predicate inv_Seq_T
predicate invariant_Vec_T_Global (self: t_Vec_T_Global) = inv_Seq_T (view_Vec_T_Global self)
predicate inv_Vec_T_Global (_1: t_Vec_T_Global)
axiom inv_axiom: forall x: t_Vec_T_Global [inv_Vec_T_Global x]. inv_Vec_T_Global x -> invariant_Vec_T_Global x
predicate inv_Rc_PermCell_Inner_T_Global (_1: t_Rc_PermCell_Inner_T_Global)
predicate inv_Inner_T (_1: t_Inner_T)
axiom inv_axiom'0 [@rewrite]: forall x: t_Inner_T [inv_Inner_T x]. inv_Inner_T x
= match x with
| Direct f0'1 -> inv_Vec_T_Global f0'1
| Link index value next -> inv_T value /\ inv_Rc_PermCell_Inner_T_Global next
end
function ward_PermCell_Inner_T (self: t_Perm_PermCell_Inner_T) : t_PermCell_Inner_T
function val_PermCell_Inner_T (self: t_Perm_PermCell_Inner_T) : t_Inner_T
function view_Perm_PermCell_Inner_T [@inline:trivial] (self: t_Perm_PermCell_Inner_T) : t_Inner_T =
val_PermCell_Inner_T self
meta "rewrite_def" function view_Perm_PermCell_Inner_T
function view_Box_Perm_PermCell_Inner_T_Global [@inline:trivial] (self: t_Perm_PermCell_Inner_T) : t_Inner_T =
view_Perm_PermCell_Inner_T self
meta "rewrite_def" function view_Box_Perm_PermCell_Inner_T_Global
let rec new_Inner_T (value: t_Inner_T) (return (x: tup2_PermCell_Inner_T_Ghost_Box_Perm_PermCell_Inner_T_Global)) =
{[@stop_split] [@expl:new 'value' type invariant] inv_Inner_T value}
any
[ return (result: tup2_PermCell_Inner_T_Ghost_Box_Perm_PermCell_Inner_T_Global) ->
{[@stop_split] [@expl:new_Inner_T ensures] ([@stop_split] [@expl:new ensures #0] result.f0'0
= ward_PermCell_Inner_T result.f1'0)
/\ ([@stop_split] [@expl:new ensures #1] view_Box_Perm_PermCell_Inner_T_Global result.f1'0 = value)}
(! return {result}) ]
type t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate invariant_Authority_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
predicate inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T (_1: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
axiom inv_axiom'1:
forall x: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T x]. inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T x
-> invariant_Authority_FMap_PermCell_Inner_T_Ag_Seq_T x
predicate invariant_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self
meta "rewrite_def" predicate invariant_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
invariant_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T _1
meta "rewrite_def" predicate inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
type t_FMap_PermCell_Inner_T_Ag_Seq_T
function view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
type t_Option_FMap_PermCell_Inner_T_Ag_Seq_T = None | Some t_FMap_PermCell_Inner_T_Ag_Seq_T
type t_Option_Ag_Seq_T = None'0 | Some'0 t_Ag_Seq_T
type t_Option_Option_Ag_Seq_T = None'1 | Some'1 t_Option_Ag_Seq_T
type tup2_Option_Ag_Seq_T_Option_Ag_Seq_T = { f0'1: t_Option_Ag_Seq_T; f1'1: t_Option_Ag_Seq_T }
function map_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (f: Map.map t_Ag_Seq_T t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T
= match self with
| None'0 -> None'1
| Some'0 x -> Some'1 (Map.get f x)
end
function op_Ag_Seq_T (self: t_Ag_Seq_T) (other: t_Ag_Seq_T) : t_Option_Ag_Seq_T = if self.f0 = other.f0 then
Some'0 self
else
None'0
function commutative_Ag_Seq_T (a: t_Ag_Seq_T) (b: t_Ag_Seq_T) : ()
axiom commutative_Ag_Seq_T_spec: forall a: t_Ag_Seq_T, b: t_Ag_Seq_T. op_Ag_Seq_T a b = op_Ag_Seq_T b a
function op_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T =
match { f0'1 = self; f1'1 = other } with
| {f0'1 = None'0} -> Some'1 other
| {f1'1 = None'0} -> Some'1 self
| {f0'1 = Some'0 x; f1'1 = Some'0 y} -> map_Option_Ag_Seq_T (op_Ag_Seq_T x y) (fun (z: t_Ag_Seq_T) -> Some'0 z)
end
function commutative_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) : ()
axiom commutative_Option_Ag_Seq_T_spec: forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= op_Option_Ag_Seq_T b a
function to_mapping_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : Map.map t_PermCell_Inner_T t_Option_Ag_Seq_T
function get_PermCell_Inner_T [@inline:trivial] (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (k: t_PermCell_Inner_T) : t_Option_Ag_Seq_T
= Map.get (to_mapping_PermCell_Inner_T self) k
meta "rewrite_def" function get_PermCell_Inner_T
function total_op_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom total_op_PermCell_Inner_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, other: t_FMap_PermCell_Inner_T_Ag_Seq_T. (forall k: t_PermCell_Inner_T. op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k)
<> None'1)
-> (forall k: t_PermCell_Inner_T. Some'1 (get_PermCell_Inner_T (total_op_PermCell_Inner_T self other) k)
= op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k))
function op_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
= if forall k: t_PermCell_Inner_T. op_Option_Ag_Seq_T (get_PermCell_Inner_T self k) (get_PermCell_Inner_T other k)
<> None'1 then
Some (total_op_PermCell_Inner_T self other)
else
None
function commutative_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom commutative_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= op_FMap_PermCell_Inner_T_Ag_Seq_T b a
function len_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) : int
axiom len_PermCell_Inner_T_spec: forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T. len_PermCell_Inner_T self >= 0
constant empty_PermCell_Inner_T : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom empty_PermCell_Inner_T_spec: len_PermCell_Inner_T empty_PermCell_Inner_T = 0
axiom empty_PermCell_Inner_T_spec'0: to_mapping_PermCell_Inner_T empty_PermCell_Inner_T = Const.const (None'0)
constant unit_FMap_PermCell_Inner_T_Ag_Seq_T: t_FMap_PermCell_Inner_T_Ag_Seq_T = empty_PermCell_Inner_T
axiom unit_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall x: t_FMap_PermCell_Inner_T_Ag_Seq_T [op_FMap_PermCell_Inner_T_Ag_Seq_T x unit_FMap_PermCell_Inner_T_Ag_Seq_T]. op_FMap_PermCell_Inner_T_Ag_Seq_T x unit_FMap_PermCell_Inner_T_Ag_Seq_T
= Some x
let rec alloc_FMap_PermCell_Inner_T_Ag_Seq_T (return (x: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:alloc_FMap_PermCell_Inner_T_Ag_Seq_T ensures] ([@stop_split] [@expl:alloc result type invariant] inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T result)
/\ ([@stop_split] [@expl:alloc ensures] view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T result
= unit_FMap_PermCell_Inner_T_Ag_Seq_T)}
(! return {result}) ]
predicate invariant_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self
meta "rewrite_def" predicate invariant_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate inv_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
invariant_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T _1
meta "rewrite_def" predicate inv_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate invariant_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self
meta "rewrite_def" predicate invariant_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate inv_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
invariant_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T _1
meta "rewrite_def" predicate inv_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
let rec deref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)) =
{[@stop_split] [@expl:deref 'self' type invariant] inv_ref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self}
any
[ return (result: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:deref_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T ensures] ([@stop_split] [@expl:deref result type invariant] inv_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T result)
/\ ([@stop_split] [@expl:deref ensures] result = self)}
(! return {result}) ]
type t_Id
function id_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Id
let rec id_ghost_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: t_Id)) =
{[@stop_split] [@expl:id_ghost 'self' type invariant] inv_ref_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self}
any
[ return (result: t_Id) -> {[@stop_split] [@expl:id_ghost ensures] result = id_FMap_PermCell_Inner_T_Ag_Seq_T self}
(! return {result}) ]
type t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
type t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T = { f0'2: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T }
type t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
function factor_Ag_Seq_T (self: t_Ag_Seq_T) (factor: t_Ag_Seq_T) : t_Option_Ag_Seq_T = op_Ag_Seq_T self factor
axiom factor_Ag_Seq_T_spec: forall self: t_Ag_Seq_T, factor: t_Ag_Seq_T. match factor_Ag_Seq_T self factor with
| Some'0 c -> op_Ag_Seq_T factor c = Some'0 self
| None'0 -> forall c: t_Ag_Seq_T. op_Ag_Seq_T factor c <> Some'0 self
end
function factor_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (factor: t_Option_Ag_Seq_T) : t_Option_Option_Ag_Seq_T =
match { f0'1 = self; f1'1 = factor } with
| {f0'1 = x; f1'1 = None'0} -> Some'1 x
| {f0'1 = None'0} -> None'1
| {f0'1 = Some'0 x; f1'1 = Some'0 y} -> match factor_Ag_Seq_T x y with
| Some'0 z -> Some'1 (Some'0 z)
| None'0 -> if x = y then Some'1 (None'0) else None'1
end
end
axiom factor_Option_Ag_Seq_T_spec:
forall self: t_Option_Ag_Seq_T, factor: t_Option_Ag_Seq_T. match factor_Option_Ag_Seq_T self factor with
| Some'1 c -> op_Option_Ag_Seq_T factor c = Some'1 self
| None'1 -> forall c: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T factor c <> Some'1 self
end
predicate incl_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) =
factor_Option_Ag_Seq_T other self <> None'1
function incl_transitive_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) : ()
axiom incl_transitive_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T. incl_Option_Ag_Seq_T a b
-> incl_Option_Ag_Seq_T b c -> incl_Option_Ag_Seq_T a c
function associative_some_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) (ab: t_Option_Ag_Seq_T) (bc: t_Option_Ag_Seq_T) : ()
axiom associative_some_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T, ab: t_Option_Ag_Seq_T, bc: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= Some'1 ab -> op_Option_Ag_Seq_T b c = Some'1 bc -> op_Option_Ag_Seq_T a bc = op_Option_Ag_Seq_T ab c
function associative_none_Option_Ag_Seq_T (a: t_Option_Ag_Seq_T) (b: t_Option_Ag_Seq_T) (c: t_Option_Ag_Seq_T) (bc: t_Option_Ag_Seq_T) : ()
axiom associative_none_Option_Ag_Seq_T_spec:
forall a: t_Option_Ag_Seq_T, b: t_Option_Ag_Seq_T, c: t_Option_Ag_Seq_T, bc: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T a b
= None'1 -> op_Option_Ag_Seq_T b c = Some'1 bc -> op_Option_Ag_Seq_T a bc = None'1
function incl_op_Option_Ag_Seq_T (self: t_Option_Ag_Seq_T) (other: t_Option_Ag_Seq_T) (comb: t_Option_Ag_Seq_T) : ()
axiom incl_op_Option_Ag_Seq_T_spec:
forall self: t_Option_Ag_Seq_T, other: t_Option_Ag_Seq_T, comb: t_Option_Ag_Seq_T. op_Option_Ag_Seq_T self other
= Some'1 comb -> incl_Option_Ag_Seq_T self comb
type tup2_PermCell_Inner_T_Ag_Seq_T = { f0'3: t_PermCell_Inner_T; f1'3: t_Ag_Seq_T }
function index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T [@inline:trivial] (self: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T) (a: tup2_PermCell_Inner_T_Ag_Seq_T) : t_Option_Ag_Seq_T
= Map.get self a
meta "rewrite_def" function index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T
function filter_map_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (f: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom filter_map_PermCell_Inner_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, f: Map.map tup2_PermCell_Inner_T_Ag_Seq_T t_Option_Ag_Seq_T. forall k: t_PermCell_Inner_T [get_PermCell_Inner_T (filter_map_PermCell_Inner_T self f) k]. get_PermCell_Inner_T (filter_map_PermCell_Inner_T self f) k
= match get_PermCell_Inner_T self k with
| None'0 -> None'0
| Some'0 v -> index_Mapping_tup2_PermCell_Inner_T_Ag_Seq_T_Option_Ag_Seq_T f { f0'3 = k; f1'3 = v }
end
function factor_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (factor: t_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
=
if forall k: t_PermCell_Inner_T. incl_Option_Ag_Seq_T (get_PermCell_Inner_T factor k) (get_PermCell_Inner_T self k) then
let res = filter_map_PermCell_Inner_T self (fun (__0: tup2_PermCell_Inner_T_Ag_Seq_T) -> let {f0'3 = k; f1'3 = vo} = __0 in match factor_Option_Ag_Seq_T (Some'0 vo) (get_PermCell_Inner_T factor k) with
| Some'1 r -> r
| None'1 -> None'0
end) in Some res
else
None
axiom factor_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, factor: t_FMap_PermCell_Inner_T_Ag_Seq_T. match factor_FMap_PermCell_Inner_T_Ag_Seq_T self factor with
| Some c -> op_FMap_PermCell_Inner_T_Ag_Seq_T factor c = Some self
| None -> forall c: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T factor c <> Some self
end
predicate incl_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) =
factor_FMap_PermCell_Inner_T_Ag_Seq_T other self <> None
function incl_transitive_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom incl_transitive_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T. incl_FMap_PermCell_Inner_T_Ag_Seq_T a b
-> incl_FMap_PermCell_Inner_T_Ag_Seq_T b c -> incl_FMap_PermCell_Inner_T_Ag_Seq_T a c
function associative_some_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) (ab: t_FMap_PermCell_Inner_T_Ag_Seq_T) (bc: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom associative_some_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T, ab: t_FMap_PermCell_Inner_T_Ag_Seq_T, bc: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= Some ab
-> op_FMap_PermCell_Inner_T_Ag_Seq_T b c = Some bc
-> op_FMap_PermCell_Inner_T_Ag_Seq_T a bc = op_FMap_PermCell_Inner_T_Ag_Seq_T ab c
function associative_none_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_FMap_PermCell_Inner_T_Ag_Seq_T) (b: t_FMap_PermCell_Inner_T_Ag_Seq_T) (c: t_FMap_PermCell_Inner_T_Ag_Seq_T) (bc: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom associative_none_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_FMap_PermCell_Inner_T_Ag_Seq_T, b: t_FMap_PermCell_Inner_T_Ag_Seq_T, c: t_FMap_PermCell_Inner_T_Ag_Seq_T, bc: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T a b
= None -> op_FMap_PermCell_Inner_T_Ag_Seq_T b c = Some bc -> op_FMap_PermCell_Inner_T_Ag_Seq_T a bc = None
function incl_op_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (other: t_FMap_PermCell_Inner_T_Ag_Seq_T) (comb: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom incl_op_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, other: t_FMap_PermCell_Inner_T_Ag_Seq_T, comb: t_FMap_PermCell_Inner_T_Ag_Seq_T. op_FMap_PermCell_Inner_T_Ag_Seq_T self other
= Some comb -> incl_FMap_PermCell_Inner_T_Ag_Seq_T self comb
predicate rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f: t_FMap_PermCell_Inner_T_Ag_Seq_T) =
match a with
| Some a'0 -> incl_FMap_PermCell_Inner_T_Ag_Seq_T f a'0
| None -> true
end
function rel_unit_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_unit_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a unit_FMap_PermCell_Inner_T_Ag_Seq_T
function rel_none_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_none_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T, f: t_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (None) f
function rel_mono_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T) (f1: t_FMap_PermCell_Inner_T_Ag_Seq_T) (f2: t_FMap_PermCell_Inner_T_Ag_Seq_T) : ()
axiom rel_mono_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall a: t_Option_FMap_PermCell_Inner_T_Ag_Seq_T, f1: t_FMap_PermCell_Inner_T_Ag_Seq_T, f2: t_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a f1
-> incl_FMap_PermCell_Inner_T_Ag_Seq_T f2 f1 -> rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T a f2
function auth_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Option_FMap_PermCell_Inner_T_Ag_Seq_T
function frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T_spec:
forall self: t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T. rel_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (auth_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self) (frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self)
function val_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
function view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
= val_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self
meta "rewrite_def" function view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T
function view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
=
frag_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (view_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self.f0'2)
function id_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T (self: t_Resource_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Id
function id_FMap_PermCell_Inner_T_Ag_Seq_T'0 (self: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) : t_Id =
id_View_AuthViewRel_FMap_PermCell_Inner_T_Ag_Seq_T self.f0'2
let rec new_unit_FMap_PermCell_Inner_T_Ag_Seq_T (id: t_Id) (return (x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) =
any
[ return (result: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:new_unit ensures] view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T result
= unit_FMap_PermCell_Inner_T_Ag_Seq_T
/\ id_FMap_PermCell_Inner_T_Ag_Seq_T'0 result = id}
(! return {result}) ]
let rec new_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T (x: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x'0: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) -> {[@stop_split] [@expl:new ensures] result = x}
(! return {result}) ]
predicate invariant_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.current
/\ inv_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.final
meta "rewrite_def" predicate invariant_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate inv_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
invariant_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T _1
meta "rewrite_def" predicate inv_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate invariant_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.current /\ inv_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.final
meta "rewrite_def" predicate invariant_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
predicate inv_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =
invariant_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T _1
meta "rewrite_def" predicate inv_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
let rec deref_mut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T
(self: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)) =
{[@stop_split] [@expl:deref_mut 'self' type invariant] inv_refmut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self}
any
[ return (result: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:deref_mut_Ghost_Authority_FMap_PermCell_Inner_T_Ag_Seq_T ensures] ([@stop_split] [@expl:deref_mut result type invariant] inv_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T result)
/\ ([@stop_split] [@expl:deref_mut ensures] result = self)}
(! return {result}) ]
let rec deref_mut_Ghost_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T
(self: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(return (x: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)) = any
[ return (result: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) ->
{[@stop_split] [@expl:deref_mut ensures] result = self}
(! return {result}) ]
type t_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T = { f0'4: t_PermCell_Inner_T; f1'4: t_Ag_Seq_T }
predicate premise_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T) (from_auth: t_FMap_PermCell_Inner_T_Ag_Seq_T) (_3: t_FMap_PermCell_Inner_T_Ag_Seq_T) =
get_PermCell_Inner_T from_auth self.f0'4 = None'0
meta "rewrite_def" predicate premise_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T
type tup2_FMap_PermCell_Inner_T_Ag_Seq_T_FMap_PermCell_Inner_T_Ag_Seq_T = {
f0'5: t_FMap_PermCell_Inner_T_Ag_Seq_T;
f1'5: t_FMap_PermCell_Inner_T_Ag_Seq_T }
predicate contains_PermCell_Inner_T [@inline:trivial] (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (k: t_PermCell_Inner_T) =
get_PermCell_Inner_T self k <> None'0
meta "rewrite_def" predicate contains_PermCell_Inner_T
function insert_PermCell_Inner_T (self: t_FMap_PermCell_Inner_T_Ag_Seq_T) (k: t_PermCell_Inner_T) (v: t_Ag_Seq_T) : t_FMap_PermCell_Inner_T_Ag_Seq_T
axiom insert_PermCell_Inner_T_spec:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, k: t_PermCell_Inner_T, v: t_Ag_Seq_T. to_mapping_PermCell_Inner_T (insert_PermCell_Inner_T self k v)
= Map.set (to_mapping_PermCell_Inner_T self) k (Some'0 v)
axiom insert_PermCell_Inner_T_spec'0:
forall self: t_FMap_PermCell_Inner_T_Ag_Seq_T, k: t_PermCell_Inner_T, v: t_Ag_Seq_T. len_PermCell_Inner_T (insert_PermCell_Inner_T self k v)
= (if contains_PermCell_Inner_T self k then len_PermCell_Inner_T self else len_PermCell_Inner_T self + 1)
function update_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (self: t_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T) (from_auth: t_FMap_PermCell_Inner_T_Ag_Seq_T) (from_frag: t_FMap_PermCell_Inner_T_Ag_Seq_T) : tup2_FMap_PermCell_Inner_T_Ag_Seq_T_FMap_PermCell_Inner_T_Ag_Seq_T
= { f0'5 = insert_PermCell_Inner_T from_auth self.f0'4 self.f1'4;
f1'5 = insert_PermCell_Inner_T from_frag self.f0'4 self.f1'4 }
meta "rewrite_def" function update_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T
let rec update_FMap_PermCell_Inner_T_Ag_Seq_T (self: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T)
(frag: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T)
(upd: t_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T) (return (x: ())) =
{[@stop_split] [@expl:update_FMap_PermCell_Inner_T_Ag_Seq_T requires] ([@stop_split] [@expl:update 'self' type invariant] inv_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self)
/\ ([@stop_split] [@expl:update requires #0] id_FMap_PermCell_Inner_T_Ag_Seq_T self.current
= id_FMap_PermCell_Inner_T_Ag_Seq_T'0 frag.current)
/\ ([@stop_split] [@expl:update requires #1] premise_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T upd (view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.current) (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T frag.current))}
any
[ return (result: ()) ->
{[@stop_split] [@expl:update_FMap_PermCell_Inner_T_Ag_Seq_T ensures] ([@stop_split] [@expl:update ensures #0] id_FMap_PermCell_Inner_T_Ag_Seq_T self.current
= id_FMap_PermCell_Inner_T_Ag_Seq_T self.final)
/\ ([@stop_split] [@expl:update ensures #1] id_FMap_PermCell_Inner_T_Ag_Seq_T'0 frag.current
= id_FMap_PermCell_Inner_T_Ag_Seq_T'0 frag.final)
/\ ([@stop_split] [@expl:update ensures #2] incl_FMap_PermCell_Inner_T_Ag_Seq_T (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T frag.current) (view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.current))
/\ ([@stop_split] [@expl:update ensures #3] { f0'5 = view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.final;
f1'5 = view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T frag.final }
= update_FMapInsertLocalUpdate_PermCell_Inner_T_Ag_Seq_T upd (view_Authority_FMap_PermCell_Inner_T_Ag_Seq_T self.current) (view_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T frag.current))}
(! return {result}) ]
predicate resolve_refmut_Ghost_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) =
_1.final = _1.current
meta "rewrite_def" predicate resolve_refmut_Ghost_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T
predicate resolve_refmut_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: MutBorrow.t t_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T) =
_1.final = _1.current
meta "rewrite_def" predicate resolve_refmut_Fragment_FMap_PermCell_Inner_T_Ag_Seq_T
predicate resolve_refmut_Authority_FMap_PermCell_Inner_T_Ag_Seq_T [@inline:trivial] (_1: MutBorrow.t t_Authority_FMap_PermCell_Inner_T_Ag_Seq_T) =