|
1 | 1 | open Prims |
2 | | -let (zero : unit -> FStar_UInt32.t) = fun uu___ -> Stdint.Uint32.zero |
3 | | -let rec (test_invariants_and_later : unit -> unit) = fun uu___ -> () |
4 | | -let rec (test_read_write : |
5 | | - FStar_UInt32.t Pulse_Lib_HigherReference.ref -> unit -> unit) = |
6 | | - fun x -> |
7 | | - fun _'n -> |
8 | | - let n = Pulse_Lib_HigherReference.read x () () in |
9 | | - Pulse_Lib_HigherReference.write x |
10 | | - (FStar_UInt32.add n Stdint.Uint32.zero) () |
11 | | -let rec (test_write_10 : |
12 | | - FStar_UInt32.t Pulse_Lib_HigherReference.ref -> unit -> unit) = |
13 | | - fun x -> |
14 | | - fun _'n -> |
15 | | - Pulse_Lib_HigherReference.write x (Stdint.Uint32.of_int (2)) (); |
16 | | - test_read_write x (); |
17 | | - Pulse_Lib_HigherReference.write x Stdint.Uint32.zero () |
18 | | -let rec (test_inner_ghost_fun : unit -> unit) = fun uu___ -> () |
19 | | -let rec (write10 : |
20 | | - FStar_UInt32.t Pulse_Lib_HigherReference.ref -> unit -> unit) = |
21 | | - fun x -> |
22 | | - fun _'n -> |
23 | | - let ctr = |
24 | | - Pulse_Lib_HigherReference.alloc () (Stdint.Uint32.of_int (10)) in |
25 | | - Pulse_Lib_Dv.while_ |
26 | | - (fun while_cond -> |
27 | | - let __anf0 = Pulse_Lib_HigherReference.read ctr () () in |
28 | | - FStar_UInt32.gt __anf0 Stdint.Uint32.zero) |
29 | | - (fun while_body -> |
30 | | - test_write_10 x (); |
31 | | - (let __anf0 = Pulse_Lib_HigherReference.read ctr () () in |
32 | | - Pulse_Lib_HigherReference.write ctr |
33 | | - (FStar_UInt32.sub __anf0 Stdint.Uint32.one) ())) |
34 | | -let rec (fill_array : |
35 | | - FStar_UInt32.t Pulse_Lib_HigherArray_Core.array -> |
36 | | - FStar_SizeT.t -> FStar_UInt32.t -> unit -> unit) |
37 | | - = |
38 | | - fun x -> |
39 | | - fun n -> |
40 | | - fun v -> |
41 | | - fun _'s -> |
42 | | - let i = Pulse_Lib_HigherReference.alloc () Stdint.Uint64.zero in |
43 | | - Pulse_Lib_Dv.while_ |
44 | | - (fun while_cond -> |
45 | | - let __anf0 = Pulse_Lib_HigherReference.read i () () in |
46 | | - FStar_SizeT.lt __anf0 n) |
47 | | - (fun while_body -> |
48 | | - let __anf0 = Pulse_Lib_HigherReference.read i () () in |
49 | | - Pulse_Lib_HigherArray_Core.mask_write x __anf0 v () (); |
50 | | - (let __anf01 = Pulse_Lib_HigherReference.read i () () in |
51 | | - Pulse_Lib_HigherReference.write i |
52 | | - (FStar_SizeT.add __anf01 Stdint.Uint64.one) ())) |
53 | | -let rec (sub_array : FStar_UInt32.t Pulse_Lib_HigherArray_Core.array -> unit) |
54 | | - = |
55 | | - fun x -> |
56 | | - let __anf0 = |
57 | | - Pulse_Lib_HigherArray_Core.sub x () () Stdint.Uint64.one () () in |
58 | | - Pulse_Lib_HigherArray_Core.mask_write __anf0 Stdint.Uint64.zero |
59 | | - (Stdint.Uint32.of_int (42)) () () |
60 | | -let (test0 : FStar_SizeT.t -> FStar_SizeT.t -> FStar_SizeT.t) = |
61 | | - fun x -> fun y -> FStar_SizeT.rem x y |
| 2 | +let zero (uu___ : unit) : FStar_UInt32.t= Stdint.Uint32.zero |
| 3 | +let rec test_invariants_and_later (uu___ : unit) : unit= () |
| 4 | +let rec test_read_write (x : FStar_UInt32.t Pulse_Lib_HigherReference.ref) |
| 5 | + (_'n : unit) : unit= |
| 6 | + let n = Pulse_Lib_HigherReference.read x () () in |
| 7 | + Pulse_Lib_HigherReference.write x (FStar_UInt32.add n Stdint.Uint32.zero) |
| 8 | + () |
| 9 | +let rec test_write_10 (x : FStar_UInt32.t Pulse_Lib_HigherReference.ref) |
| 10 | + (_'n : unit) : unit= |
| 11 | + Pulse_Lib_HigherReference.write x (Stdint.Uint32.of_int (2)) (); |
| 12 | + test_read_write x (); |
| 13 | + Pulse_Lib_HigherReference.write x Stdint.Uint32.zero () |
| 14 | +let rec test_inner_ghost_fun (uu___ : unit) : unit= () |
| 15 | +let rec write10 (x : FStar_UInt32.t Pulse_Lib_HigherReference.ref) |
| 16 | + (_'n : unit) : unit= |
| 17 | + let ctr = Pulse_Lib_HigherReference.alloc () (Stdint.Uint32.of_int (10)) in |
| 18 | + Pulse_Lib_Dv.while_ |
| 19 | + (fun while_cond -> |
| 20 | + let __anf0 = Pulse_Lib_HigherReference.read ctr () () in |
| 21 | + FStar_UInt32.gt __anf0 Stdint.Uint32.zero) |
| 22 | + (fun while_body -> |
| 23 | + test_write_10 x (); |
| 24 | + (let __anf0 = Pulse_Lib_HigherReference.read ctr () () in |
| 25 | + Pulse_Lib_HigherReference.write ctr |
| 26 | + (FStar_UInt32.sub __anf0 Stdint.Uint32.one) ())) |
| 27 | +let rec fill_array (x : FStar_UInt32.t Pulse_Lib_HigherArray_Core.array) |
| 28 | + (n : FStar_SizeT.t) (v : FStar_UInt32.t) (_'s : unit) : unit= |
| 29 | + let i = Pulse_Lib_HigherReference.alloc () Stdint.Uint64.zero in |
| 30 | + Pulse_Lib_Dv.while_ |
| 31 | + (fun while_cond -> |
| 32 | + let __anf0 = Pulse_Lib_HigherReference.read i () () in |
| 33 | + FStar_SizeT.lt __anf0 n) |
| 34 | + (fun while_body -> |
| 35 | + let __anf0 = Pulse_Lib_HigherReference.read i () () in |
| 36 | + Pulse_Lib_HigherArray_Core.mask_write x __anf0 v () (); |
| 37 | + (let __anf01 = Pulse_Lib_HigherReference.read i () () in |
| 38 | + Pulse_Lib_HigherReference.write i |
| 39 | + (FStar_SizeT.add __anf01 Stdint.Uint64.one) ())) |
| 40 | +let rec sub_array (x : FStar_UInt32.t Pulse_Lib_HigherArray_Core.array) : |
| 41 | + unit= |
| 42 | + let __anf0 = Pulse_Lib_HigherArray_Core.sub x () () Stdint.Uint64.one () () in |
| 43 | + Pulse_Lib_HigherArray_Core.mask_write __anf0 Stdint.Uint64.zero |
| 44 | + (Stdint.Uint32.of_int (42)) () () |
| 45 | +let test0 (x : FStar_SizeT.t) (y : FStar_SizeT.t) : FStar_SizeT.t= |
| 46 | + FStar_SizeT.rem x y |
62 | 47 | type 'a opt = |
63 | 48 | | None |
64 | 49 | | Some of 'a |
65 | | -let uu___is_None : 'a . 'a opt -> Prims.bool = |
66 | | - fun projectee -> match projectee with | None -> true | uu___ -> false |
67 | | -let uu___is_Some : 'a . 'a opt -> Prims.bool = |
68 | | - fun projectee -> match projectee with | Some v -> true | uu___ -> false |
69 | | -let __proj__Some__item__v : 'a . 'a opt -> 'a = |
70 | | - fun projectee -> match projectee with | Some v -> v |
71 | | -let (my_safe_add : FStar_SizeT.t -> FStar_SizeT.t -> FStar_SizeT.t opt) = |
72 | | - fun x -> |
73 | | - fun y -> |
74 | | - if FStar_SizeT.lte x (Stdint.Uint64.of_string "0xffff") |
75 | | - then |
76 | | - (if |
77 | | - FStar_SizeT.lte y |
78 | | - (FStar_SizeT.sub (Stdint.Uint64.of_string "0xffff") x) |
79 | | - then Some (FStar_SizeT.add x y) |
80 | | - else None) |
81 | | - else None |
82 | | -let rec (testbi : FStar_SizeT.t -> FStar_SizeT.t -> FStar_SizeT.t) = |
83 | | - fun x -> fun y -> FStar_SizeT.rem x y |
84 | | -let rec (testbi2 : FStar_SizeT.t -> FStar_SizeT.t -> FStar_SizeT.t opt) = |
85 | | - fun x -> fun y -> my_safe_add x y |
86 | | -let rec (extract_match : Prims.bool opt -> Prims.bool) = |
87 | | - fun x -> match x with | None -> false | Some b -> Prims.op_Negation b |
88 | | -let rec (fib : Prims.nat -> Prims.nat) = |
89 | | - fun x -> |
90 | | - if x <= Prims.int_one |
91 | | - then Prims.int_one |
92 | | - else |
93 | | - (let x1 = fib (x - Prims.int_one) in |
94 | | - let x2 = fib (x - (Prims.of_int (2))) in x1 + x2) |
95 | | -let rec (fib2 : Prims.nat -> Prims.nat) = |
96 | | - fun x -> let n = fib x in let m = fib (x + Prims.int_one) in m + n |
| 50 | +let uu___is_None (projectee : 'a opt) : Prims.bool= |
| 51 | + match projectee with | None -> true | uu___ -> false |
| 52 | +let uu___is_Some (projectee : 'a opt) : Prims.bool= |
| 53 | + match projectee with | Some v -> true | uu___ -> false |
| 54 | +let __proj__Some__item__v (projectee : 'a opt) : 'a= |
| 55 | + match projectee with | Some v -> v |
| 56 | +let my_safe_add (x : FStar_SizeT.t) (y : FStar_SizeT.t) : FStar_SizeT.t opt= |
| 57 | + if FStar_SizeT.lte x (Stdint.Uint64.of_string "0xffff") |
| 58 | + then |
| 59 | + (if |
| 60 | + FStar_SizeT.lte y |
| 61 | + (FStar_SizeT.sub (Stdint.Uint64.of_string "0xffff") x) |
| 62 | + then Some (FStar_SizeT.add x y) |
| 63 | + else None) |
| 64 | + else None |
| 65 | +let rec testbi (x : FStar_SizeT.t) (y : FStar_SizeT.t) : FStar_SizeT.t= |
| 66 | + FStar_SizeT.rem x y |
| 67 | +let rec testbi2 (x : FStar_SizeT.t) (y : FStar_SizeT.t) : FStar_SizeT.t opt= |
| 68 | + my_safe_add x y |
| 69 | +let rec extract_match (x : Prims.bool opt) : Prims.bool= |
| 70 | + match x with | None -> false | Some b -> Prims.op_Negation b |
| 71 | +let rec fib (x : Prims.nat) : Prims.nat= |
| 72 | + if x <= Prims.int_one |
| 73 | + then Prims.int_one |
| 74 | + else |
| 75 | + (let x1 = fib (x - Prims.int_one) in |
| 76 | + let x2 = fib (x - (Prims.of_int (2))) in x1 + x2) |
| 77 | +let rec fib2 (x : Prims.nat) : Prims.nat= |
| 78 | + let n = fib x in let m = fib (x + Prims.int_one) in m + n |
97 | 79 | type ('a, 'b) data = |
98 | 80 | | One of 'a * 'b |
99 | 81 | | Two of 'a |
100 | 82 | | Three of 'b * 'a |
101 | | -let uu___is_One : 'a 'b . ('a, 'b) data -> Prims.bool = |
102 | | - fun projectee -> |
103 | | - match projectee with | One (_0, _1) -> true | uu___ -> false |
104 | | -let __proj__One__item___0 : 'a 'b . ('a, 'b) data -> 'a = |
105 | | - fun projectee -> match projectee with | One (_0, _1) -> _0 |
106 | | -let __proj__One__item___1 : 'a 'b . ('a, 'b) data -> 'b = |
107 | | - fun projectee -> match projectee with | One (_0, _1) -> _1 |
108 | | -let uu___is_Two : 'a 'b . ('a, 'b) data -> Prims.bool = |
109 | | - fun projectee -> match projectee with | Two _0 -> true | uu___ -> false |
110 | | -let __proj__Two__item___0 : 'a 'b . ('a, 'b) data -> 'a = |
111 | | - fun projectee -> match projectee with | Two _0 -> _0 |
112 | | -let uu___is_Three : 'a 'b . ('a, 'b) data -> Prims.bool = |
113 | | - fun projectee -> |
114 | | - match projectee with | Three (_0, _1) -> true | uu___ -> false |
115 | | -let __proj__Three__item___0 : 'a 'b . ('a, 'b) data -> 'b = |
116 | | - fun projectee -> match projectee with | Three (_0, _1) -> _0 |
117 | | -let __proj__Three__item___1 : 'a 'b . ('a, 'b) data -> 'a = |
118 | | - fun projectee -> match projectee with | Three (_0, _1) -> _1 |
119 | | -let rec (test_that_we_access_the_right_field_in_matches : |
120 | | - (Prims.nat, Prims.bool) data -> Prims.nat) = |
121 | | - fun x -> match x with | One (y, z) -> y | Two y -> y | Three (z, y) -> y |
| 83 | +let uu___is_One (projectee : ('a, 'b) data) : Prims.bool= |
| 84 | + match projectee with | One (_0, _1) -> true | uu___ -> false |
| 85 | +let __proj__One__item___0 (projectee : ('a, 'b) data) : 'a= |
| 86 | + match projectee with | One (_0, _1) -> _0 |
| 87 | +let __proj__One__item___1 (projectee : ('a, 'b) data) : 'b= |
| 88 | + match projectee with | One (_0, _1) -> _1 |
| 89 | +let uu___is_Two (projectee : ('a, 'b) data) : Prims.bool= |
| 90 | + match projectee with | Two _0 -> true | uu___ -> false |
| 91 | +let __proj__Two__item___0 (projectee : ('a, 'b) data) : 'a= |
| 92 | + match projectee with | Two _0 -> _0 |
| 93 | +let uu___is_Three (projectee : ('a, 'b) data) : Prims.bool= |
| 94 | + match projectee with | Three (_0, _1) -> true | uu___ -> false |
| 95 | +let __proj__Three__item___0 (projectee : ('a, 'b) data) : 'b= |
| 96 | + match projectee with | Three (_0, _1) -> _0 |
| 97 | +let __proj__Three__item___1 (projectee : ('a, 'b) data) : 'a= |
| 98 | + match projectee with | Three (_0, _1) -> _1 |
| 99 | +let rec test_that_we_access_the_right_field_in_matches |
| 100 | + (x : (Prims.nat, Prims.bool) data) : Prims.nat= |
| 101 | + match x with | One (y, z) -> y | Two y -> y | Three (z, y) -> y |
0 commit comments