@@ -3,39 +3,48 @@ module arrays where
3
3
4
4
import Prelude;
5
5
6
+ letRecM_single :
7
+ (lrt : LetRecType) ->
8
+ (B : sort 0) ->
9
+ (lrtToType lrt -> lrtToType lrt) ->
10
+ (lrtToType lrt -> CompM B) -> CompM B;
11
+ letRecM_single lrt B fn body =
12
+ letRecM
13
+ (LRT_Cons lrt LRT_Nil) B
14
+ (\ (x : lrtToType lrt) -> consTuple (lrtToType lrt) TypeNil (fn x) ())
15
+ (\ (x : lrtToType lrt) -> body x);
16
+
6
17
-- The helper function for noErrorsContains0
7
18
--
8
19
-- noErrorsContains0H len i v =
9
20
-- orM (exists x. returnM x) (noErrorsContains0H len (i+1) v)
10
21
noErrorsContains0H : (len i:Vec 64 Bool) -> BVVec 64 len (Vec 64 Bool) ->
11
- CompM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool);
22
+ CompM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool);
12
23
noErrorsContains0H len_top i_top v_top =
13
- letRecM
14
- (LRT_Cons
15
- (LRT_Fun (Vec 64 Bool) (\ (len:Vec 64 Bool) ->
16
- LRT_Fun (Vec 64 Bool) (\ (_:Vec 64 Bool) ->
17
- LRT_Fun (BVVec 64 len (Vec 64 Bool)) (\ (_:BVVec 64 len (Vec 64 Bool)) ->
18
- LRT_Ret (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)))))
19
- LRT_Nil)
20
- (BVVec 64 len_top (Vec 64 Bool) * Vec 64 Bool)
24
+ letRecM_single
25
+ (LRT_Fun (Vec 64 Bool) (\ (len:Vec 64 Bool) ->
26
+ LRT_Fun (Vec 64 Bool) (\ (_:Vec 64 Bool) ->
27
+ LRT_Fun (BVVec 64 len (Vec 64 Bool)) (\ (_:BVVec 64 len (Vec 64 Bool)) ->
28
+ LRT_Ret #(BVVec 64 len (Vec 64 Bool), Vec 64 Bool)))))
29
+ #(BVVec 64 len_top (Vec 64 Bool), Vec 64 Bool)
21
30
(\ (f : (len i:Vec 64 Bool) -> BVVec 64 len (Vec 64 Bool) ->
22
- CompM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)) ->
23
- (( \ (len:Vec 64 Bool) (i:Vec 64 Bool) (v:BVVec 64 len (Vec 64 Bool)) ->
24
- precondHint
25
- (CompM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool))
26
- (and (bvsle 64 0x0000000000000000 i)
27
- (bvsle 64 i 0x0fffffffffffffff))
28
- (orM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)
29
- (existsM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)
30
- (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)
31
- (returnM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)))
32
- (f len (bvAdd 64 i 0x0000000000000001) v))), ( )))
31
+ CompM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)) ->
32
+ (\ (len:Vec 64 Bool) (i:Vec 64 Bool) (v:BVVec 64 len (Vec 64 Bool)) ->
33
+ precondHint
34
+ (CompM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool))
35
+ (and (bvsle 64 0x0000000000000000 i)
36
+ (bvsle 64 i 0x0fffffffffffffff))
37
+ (orM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)
38
+ (existsM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)
39
+ # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)
40
+ (returnM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)))
41
+ (f len (bvAdd 64 i 0x0000000000000001) v))))
33
42
(\ (f : (len i:Vec 64 Bool) -> BVVec 64 len (Vec 64 Bool) ->
34
- CompM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool)) ->
43
+ CompM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool)) ->
35
44
f len_top i_top v_top);
36
45
37
46
-- The specification that contains0 has no errors
38
47
noErrorsContains0 : (len:Vec 64 Bool) -> BVVec 64 len (Vec 64 Bool) ->
39
- CompM (BVVec 64 len (Vec 64 Bool) * Vec 64 Bool);
48
+ CompM # (BVVec 64 len (Vec 64 Bool), Vec 64 Bool);
40
49
noErrorsContains0 len v =
41
50
noErrorsContains0H len 0x0000000000000000 v;
0 commit comments