summaryrefslogtreecommitdiff
path: root/tests/fstar/array
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fstar/array')
-rw-r--r--tests/fstar/array/Array.Clauses.Template.fst4
-rw-r--r--tests/fstar/array/Array.Funs.fst68
2 files changed, 41 insertions, 31 deletions
diff --git a/tests/fstar/array/Array.Clauses.Template.fst b/tests/fstar/array/Array.Clauses.Template.fst
index 08a2925f..84347ab9 100644
--- a/tests/fstar/array/Array.Clauses.Template.fst
+++ b/tests/fstar/array/Array.Clauses.Template.fst
@@ -7,13 +7,13 @@ open Array.Types
#set-options "--z3rlimit 50 --fuel 1 --ifuel 1"
(** [array::sum]: decreases clause
- Source: 'src/array.rs', lines 228:0-236:1 *)
+ Source: 'src/array.rs', lines 242:0-250:1 *)
unfold
let sum_loop_decreases (s : slice u32) (sum0 : u32) (i : usize) : nat =
admit ()
(** [array::sum2]: decreases clause
- Source: 'src/array.rs', lines 238:0-247:1 *)
+ Source: 'src/array.rs', lines 252:0-261:1 *)
unfold
let sum2_loop_decreases (s : slice u32) (s2 : slice u32) (sum0 : u32)
(i : usize) : nat =
diff --git a/tests/fstar/array/Array.Funs.fst b/tests/fstar/array/Array.Funs.fst
index a8722a4f..935bd9c9 100644
--- a/tests/fstar/array/Array.Funs.fst
+++ b/tests/fstar/array/Array.Funs.fst
@@ -209,8 +209,18 @@ let take_slice (s : slice u32) : result unit =
let take_mut_slice (s : slice u32) : result (slice u32) =
Return s
+(** [array::const_array]: forward function
+ Source: 'src/array.rs', lines 127:0-127:32 *)
+let const_array : result (array u32 2) =
+ Return (mk_array u32 2 [ 0; 0 ])
+
+(** [array::const_slice]: forward function
+ Source: 'src/array.rs', lines 131:0-131:20 *)
+let const_slice : result unit =
+ let* _ = array_to_slice u32 2 (mk_array u32 2 [ 0; 0 ]) in Return ()
+
(** [array::take_all]: forward function
- Source: 'src/array.rs', lines 127:0-127:17 *)
+ Source: 'src/array.rs', lines 141:0-141:17 *)
let take_all : result unit =
let* _ = take_array (mk_array u32 2 [ 0; 0 ]) in
let* _ = take_array_borrow (mk_array u32 2 [ 0; 0 ]) in
@@ -222,32 +232,32 @@ let take_all : result unit =
Return ()
(** [array::index_array]: forward function
- Source: 'src/array.rs', lines 141:0-141:38 *)
+ Source: 'src/array.rs', lines 155:0-155:38 *)
let index_array (x : array u32 2) : result u32 =
array_index_usize u32 2 x 0
(** [array::index_array_borrow]: forward function
- Source: 'src/array.rs', lines 144:0-144:46 *)
+ Source: 'src/array.rs', lines 158:0-158:46 *)
let index_array_borrow (x : array u32 2) : result u32 =
array_index_usize u32 2 x 0
(** [array::index_slice_u32_0]: forward function
- Source: 'src/array.rs', lines 148:0-148:42 *)
+ Source: 'src/array.rs', lines 162:0-162:42 *)
let index_slice_u32_0 (x : slice u32) : result u32 =
slice_index_usize u32 x 0
(** [array::index_mut_slice_u32_0]: forward function
- Source: 'src/array.rs', lines 152:0-152:50 *)
+ Source: 'src/array.rs', lines 166:0-166:50 *)
let index_mut_slice_u32_0 (x : slice u32) : result u32 =
slice_index_usize u32 x 0
(** [array::index_mut_slice_u32_0]: backward function 0
- Source: 'src/array.rs', lines 152:0-152:50 *)
+ Source: 'src/array.rs', lines 166:0-166:50 *)
let index_mut_slice_u32_0_back (x : slice u32) : result (slice u32) =
let* _ = slice_index_usize u32 x 0 in Return x
(** [array::index_all]: forward function
- Source: 'src/array.rs', lines 156:0-156:25 *)
+ Source: 'src/array.rs', lines 170:0-170:25 *)
let index_all : result u32 =
let* i = index_array (mk_array u32 2 [ 0; 0 ]) in
let* i0 = index_array (mk_array u32 2 [ 0; 0 ]) in
@@ -265,24 +275,24 @@ let index_all : result u32 =
Return i7
(** [array::update_array]: forward function
- Source: 'src/array.rs', lines 170:0-170:36 *)
+ Source: 'src/array.rs', lines 184:0-184:36 *)
let update_array (x : array u32 2) : result unit =
let* _ = array_update_usize u32 2 x 0 1 in Return ()
(** [array::update_array_mut_borrow]: merged forward/backward function
(there is a single backward function, and the forward function returns ())
- Source: 'src/array.rs', lines 173:0-173:48 *)
+ Source: 'src/array.rs', lines 187:0-187:48 *)
let update_array_mut_borrow (x : array u32 2) : result (array u32 2) =
array_update_usize u32 2 x 0 1
(** [array::update_mut_slice]: merged forward/backward function
(there is a single backward function, and the forward function returns ())
- Source: 'src/array.rs', lines 176:0-176:38 *)
+ Source: 'src/array.rs', lines 190:0-190:38 *)
let update_mut_slice (x : slice u32) : result (slice u32) =
slice_update_usize u32 x 0 1
(** [array::update_all]: forward function
- Source: 'src/array.rs', lines 180:0-180:19 *)
+ Source: 'src/array.rs', lines 194:0-194:19 *)
let update_all : result unit =
let* _ = update_array (mk_array u32 2 [ 0; 0 ]) in
let* x = update_array_mut_borrow (mk_array u32 2 [ 0; 0 ]) in
@@ -292,7 +302,7 @@ let update_all : result unit =
Return ()
(** [array::range_all]: forward function
- Source: 'src/array.rs', lines 191:0-191:18 *)
+ Source: 'src/array.rs', lines 205:0-205:18 *)
let range_all : result unit =
let* s =
core_array_Array_index_mut u32 (core_ops_range_Range usize) 4
@@ -308,32 +318,32 @@ let range_all : result unit =
Return ()
(** [array::deref_array_borrow]: forward function
- Source: 'src/array.rs', lines 200:0-200:46 *)
+ Source: 'src/array.rs', lines 214:0-214:46 *)
let deref_array_borrow (x : array u32 2) : result u32 =
array_index_usize u32 2 x 0
(** [array::deref_array_mut_borrow]: forward function
- Source: 'src/array.rs', lines 205:0-205:54 *)
+ Source: 'src/array.rs', lines 219:0-219:54 *)
let deref_array_mut_borrow (x : array u32 2) : result u32 =
array_index_usize u32 2 x 0
(** [array::deref_array_mut_borrow]: backward function 0
- Source: 'src/array.rs', lines 205:0-205:54 *)
+ Source: 'src/array.rs', lines 219:0-219:54 *)
let deref_array_mut_borrow_back (x : array u32 2) : result (array u32 2) =
let* _ = array_index_usize u32 2 x 0 in Return x
(** [array::take_array_t]: forward function
- Source: 'src/array.rs', lines 213:0-213:31 *)
+ Source: 'src/array.rs', lines 227:0-227:31 *)
let take_array_t (a : array aB_t 2) : result unit =
Return ()
(** [array::non_copyable_array]: forward function
- Source: 'src/array.rs', lines 215:0-215:27 *)
+ Source: 'src/array.rs', lines 229:0-229:27 *)
let non_copyable_array : result unit =
let* _ = take_array_t (mk_array aB_t 2 [ AB_A; AB_B ]) in Return ()
(** [array::sum]: loop 0: forward function
- Source: 'src/array.rs', lines 228:0-236:1 *)
+ Source: 'src/array.rs', lines 242:0-250:1 *)
let rec sum_loop
(s : slice u32) (sum0 : u32) (i : usize) :
Tot (result u32) (decreases (sum_loop_decreases s sum0 i))
@@ -348,12 +358,12 @@ let rec sum_loop
else Return sum0
(** [array::sum]: forward function
- Source: 'src/array.rs', lines 228:0-228:28 *)
+ Source: 'src/array.rs', lines 242:0-242:28 *)
let sum (s : slice u32) : result u32 =
sum_loop s 0 0
(** [array::sum2]: loop 0: forward function
- Source: 'src/array.rs', lines 238:0-247:1 *)
+ Source: 'src/array.rs', lines 252:0-261:1 *)
let rec sum2_loop
(s : slice u32) (s2 : slice u32) (sum0 : u32) (i : usize) :
Tot (result u32) (decreases (sum2_loop_decreases s s2 sum0 i))
@@ -370,14 +380,14 @@ let rec sum2_loop
else Return sum0
(** [array::sum2]: forward function
- Source: 'src/array.rs', lines 238:0-238:41 *)
+ Source: 'src/array.rs', lines 252:0-252:41 *)
let sum2 (s : slice u32) (s2 : slice u32) : result u32 =
let i = slice_len u32 s in
let i0 = slice_len u32 s2 in
if not (i = i0) then Fail Failure else sum2_loop s s2 0 0
(** [array::f0]: forward function
- Source: 'src/array.rs', lines 249:0-249:11 *)
+ Source: 'src/array.rs', lines 263:0-263:11 *)
let f0 : result unit =
let* s = array_to_slice u32 2 (mk_array u32 2 [ 1; 2 ]) in
let* s0 = slice_update_usize u32 s 0 1 in
@@ -385,17 +395,17 @@ let f0 : result unit =
Return ()
(** [array::f1]: forward function
- Source: 'src/array.rs', lines 254:0-254:11 *)
+ Source: 'src/array.rs', lines 268:0-268:11 *)
let f1 : result unit =
let* _ = array_update_usize u32 2 (mk_array u32 2 [ 1; 2 ]) 0 1 in Return ()
(** [array::f2]: forward function
- Source: 'src/array.rs', lines 259:0-259:17 *)
+ Source: 'src/array.rs', lines 273:0-273:17 *)
let f2 (i : u32) : result unit =
Return ()
(** [array::f4]: forward function
- Source: 'src/array.rs', lines 268:0-268:54 *)
+ Source: 'src/array.rs', lines 282:0-282:54 *)
let f4 (x : array u32 32) (y : usize) (z : usize) : result (slice u32) =
core_array_Array_index u32 (core_ops_range_Range usize) 32
(core_ops_index_IndexSliceTIInst u32 (core_ops_range_Range usize)
@@ -403,7 +413,7 @@ let f4 (x : array u32 32) (y : usize) (z : usize) : result (slice u32) =
{ start = y; end_ = z }
(** [array::f3]: forward function
- Source: 'src/array.rs', lines 261:0-261:18 *)
+ Source: 'src/array.rs', lines 275:0-275:18 *)
let f3 : result u32 =
let* i = array_index_usize u32 2 (mk_array u32 2 [ 1; 2 ]) 0 in
let* _ = f2 i in
@@ -413,17 +423,17 @@ let f3 : result u32 =
sum2 s s0
(** [array::SZ]
- Source: 'src/array.rs', lines 272:0-272:19 *)
+ Source: 'src/array.rs', lines 286:0-286:19 *)
let sz_body : result usize = Return 32
let sz_c : usize = eval_global sz_body
(** [array::f5]: forward function
- Source: 'src/array.rs', lines 275:0-275:31 *)
+ Source: 'src/array.rs', lines 289:0-289:31 *)
let f5 (x : array u32 32) : result u32 =
array_index_usize u32 32 x 0
(** [array::ite]: forward function
- Source: 'src/array.rs', lines 280:0-280:12 *)
+ Source: 'src/array.rs', lines 294:0-294:12 *)
let ite : result unit =
let* s = array_to_slice u32 2 (mk_array u32 2 [ 0; 0 ]) in
let* s0 = array_to_slice u32 2 (mk_array u32 2 [ 0; 0 ]) in