summaryrefslogtreecommitdiff
path: root/tests/fstar/misc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fstar/misc')
-rw-r--r--tests/fstar/misc/Constants.fst2
-rw-r--r--tests/fstar/misc/External.Opaque.fsti4
-rw-r--r--tests/fstar/misc/Loops.Funs.fst14
-rw-r--r--tests/fstar/misc/NoNestedBorrows.fst5
-rw-r--r--tests/fstar/misc/Primitives.fst88
5 files changed, 56 insertions, 57 deletions
diff --git a/tests/fstar/misc/Constants.fst b/tests/fstar/misc/Constants.fst
index c21d6a5f..2f2fccdb 100644
--- a/tests/fstar/misc/Constants.fst
+++ b/tests/fstar/misc/Constants.fst
@@ -55,7 +55,7 @@ let p3_c : pair_t u32 u32 = eval_global p3_body
(** [constants::Wrap] *)
type wrap_t (t : Type0) = { value : t; }
-(** [constants::Wrap::{0}::new]: forward function *)
+(** [constants::{constants::Wrap<T>}::new]: forward function *)
let wrap_new (t : Type0) (value : t) : result (wrap_t t) =
Return { value = value }
diff --git a/tests/fstar/misc/External.Opaque.fsti b/tests/fstar/misc/External.Opaque.fsti
index 85cf285c..3914a8eb 100644
--- a/tests/fstar/misc/External.Opaque.fsti
+++ b/tests/fstar/misc/External.Opaque.fsti
@@ -17,11 +17,11 @@ val core_mem_swap_back0
val core_mem_swap_back1
(t : Type0) : t -> t -> state -> state -> result (state & t)
-(** [core::num::nonzero::NonZeroU32::{14}::new]: forward function *)
+(** [core::num::nonzero::{core::num::nonzero::NonZeroU32#14}::new]: forward function *)
val core_num_nonzero_NonZeroU32_new
: u32 -> state -> result (state & (option core_num_nonzero_NonZeroU32_t))
-(** [core::option::Option::{0}::unwrap]: forward function *)
+(** [core::option::{core::option::Option<T>}::unwrap]: forward function *)
val core_option_Option_unwrap
(t : Type0) : option t -> state -> result (state & t)
diff --git a/tests/fstar/misc/Loops.Funs.fst b/tests/fstar/misc/Loops.Funs.fst
index 0f755351..4dd3a5dd 100644
--- a/tests/fstar/misc/Loops.Funs.fst
+++ b/tests/fstar/misc/Loops.Funs.fst
@@ -64,7 +64,7 @@ let rec clear_loop
let* i1 = usize_add i 1 in
let* v0 =
alloc_vec_Vec_index_mut_back u32 usize
- (core_slice_index_usize_coresliceindexSliceIndexInst u32) v i 0 in
+ (core_slice_index_SliceIndexUsizeSliceTInst u32) v i 0 in
clear_loop v0 i1
else Return v
@@ -157,8 +157,7 @@ let get_elem_mut
(slots : alloc_vec_Vec (list_t usize)) (x : usize) : result usize =
let* l =
alloc_vec_Vec_index_mut (list_t usize) usize
- (core_slice_index_usize_coresliceindexSliceIndexInst (list_t usize))
- slots 0 in
+ (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 in
get_elem_mut_loop x l
(** [loops::get_elem_mut]: loop 0: backward function 0 *)
@@ -181,12 +180,10 @@ let get_elem_mut_back
=
let* l =
alloc_vec_Vec_index_mut (list_t usize) usize
- (core_slice_index_usize_coresliceindexSliceIndexInst (list_t usize))
- slots 0 in
+ (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 in
let* l0 = get_elem_mut_loop_back x l ret in
alloc_vec_Vec_index_mut_back (list_t usize) usize
- (core_slice_index_usize_coresliceindexSliceIndexInst (list_t usize)) slots
- 0 l0
+ (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 l0
(** [loops::get_elem_shared]: loop 0: forward function *)
let rec get_elem_shared_loop
@@ -203,8 +200,7 @@ let get_elem_shared
(slots : alloc_vec_Vec (list_t usize)) (x : usize) : result usize =
let* l =
alloc_vec_Vec_index (list_t usize) usize
- (core_slice_index_usize_coresliceindexSliceIndexInst (list_t usize))
- slots 0 in
+ (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 in
get_elem_shared_loop x l
(** [loops::id_mut]: forward function *)
diff --git a/tests/fstar/misc/NoNestedBorrows.fst b/tests/fstar/misc/NoNestedBorrows.fst
index e97927aa..a6269f60 100644
--- a/tests/fstar/misc/NoNestedBorrows.fst
+++ b/tests/fstar/misc/NoNestedBorrows.fst
@@ -129,7 +129,10 @@ let _ = assert_norm (test_list1 = Return ())
(** [no_nested_borrows::test_box1]: forward function *)
let test_box1 : result unit =
- let b = 1 in let x = b in if not (x = 1) then Fail Failure else Return ()
+ let b = 0 in
+ let* b0 = alloc_boxed_Box_deref_mut_back i32 b 1 in
+ let* x = alloc_boxed_Box_deref i32 b0 in
+ if not (x = 1) then Fail Failure else Return ()
(** Unit test for [no_nested_borrows::test_box1] *)
let _ = assert_norm (test_box1 = Return ())
diff --git a/tests/fstar/misc/Primitives.fst b/tests/fstar/misc/Primitives.fst
index 3297803c..94322ead 100644
--- a/tests/fstar/misc/Primitives.fst
+++ b/tests/fstar/misc/Primitives.fst
@@ -351,14 +351,14 @@ let alloc_boxed_Box_deref_mut (t : Type0) (x : t) : result t = Return x
let alloc_boxed_Box_deref_mut_back (t : Type) (_ : t) (x : t) : result t = Return x
// Trait instance
-let alloc_boxed_Box_coreOpsDerefInst (self : Type0) : core_ops_deref_Deref self = {
+let alloc_boxed_Box_coreopsDerefInst (self : Type0) : core_ops_deref_Deref self = {
target = self;
deref = alloc_boxed_Box_deref self;
}
// Trait instance
-let alloc_boxed_Box_coreOpsDerefMutInst (self : Type0) : core_ops_deref_DerefMut self = {
- derefInst = alloc_boxed_Box_coreOpsDerefInst self;
+let alloc_boxed_Box_coreopsDerefMutInst (self : Type0) : core_ops_deref_DerefMut self = {
+ derefInst = alloc_boxed_Box_coreopsDerefInst self;
deref_mut = alloc_boxed_Box_deref_mut self;
deref_mut_back = alloc_boxed_Box_deref_mut_back self;
}
@@ -483,23 +483,23 @@ let core_slice_index_Slice_index
| Some x -> Return x
// [core::slice::index::Range:::get]: forward function
-let core_slice_index_Range_get (t : Type0) (i : core_ops_range_Range usize) (s : slice t) :
+let core_slice_index_RangeUsize_get (t : Type0) (i : core_ops_range_Range usize) (s : slice t) :
result (option (slice t)) =
admit () // TODO
// [core::slice::index::Range::get_mut]: forward function
-let core_slice_index_Range_get_mut
+let core_slice_index_RangeUsize_get_mut
(t : Type0) : core_ops_range_Range usize → slice t → result (option (slice t)) =
admit () // TODO
// [core::slice::index::Range::get_mut]: backward function 0
-let core_slice_index_Range_get_mut_back
+let core_slice_index_RangeUsize_get_mut_back
(t : Type0) :
core_ops_range_Range usize → slice t → option (slice t) → result (slice t) =
admit () // TODO
// [core::slice::index::Range::get_unchecked]: forward function
-let core_slice_index_Range_get_unchecked
+let core_slice_index_RangeUsize_get_unchecked
(t : Type0) :
core_ops_range_Range usize → const_raw_ptr (slice t) → result (const_raw_ptr (slice t)) =
// Don't know what the model should be - for now we always fail to make
@@ -507,7 +507,7 @@ let core_slice_index_Range_get_unchecked
fun _ _ -> Fail Failure
// [core::slice::index::Range::get_unchecked_mut]: forward function
-let core_slice_index_Range_get_unchecked_mut
+let core_slice_index_RangeUsize_get_unchecked_mut
(t : Type0) :
core_ops_range_Range usize → mut_raw_ptr (slice t) → result (mut_raw_ptr (slice t)) =
// Don't know what the model should be - for now we always fail to make
@@ -515,17 +515,17 @@ let core_slice_index_Range_get_unchecked_mut
fun _ _ -> Fail Failure
// [core::slice::index::Range::index]: forward function
-let core_slice_index_Range_index
+let core_slice_index_RangeUsize_index
(t : Type0) : core_ops_range_Range usize → slice t → result (slice t) =
admit () // TODO
// [core::slice::index::Range::index_mut]: forward function
-let core_slice_index_Range_index_mut
+let core_slice_index_RangeUsize_index_mut
(t : Type0) : core_ops_range_Range usize → slice t → result (slice t) =
admit () // TODO
// [core::slice::index::Range::index_mut]: backward function 0
-let core_slice_index_Range_index_mut_back
+let core_slice_index_RangeUsize_index_mut_back
(t : Type0) : core_ops_range_Range usize → slice t → slice t → result (slice t) =
admit () // TODO
@@ -559,44 +559,44 @@ let core_array_Array_index_mut_back
(a : array t n) (i : idx) (x : inst.indexInst.output) : result (array t n) =
admit () // TODO
-// Trait implementation: [core::slice::index::[T]]
-let core_slice_index_Slice_coreopsindexIndexInst (t idx : Type0)
- (inst : core_slice_index_SliceIndex idx (slice t)) :
- core_ops_index_Index (slice t) idx = {
- output = inst.output;
- index = core_slice_index_Slice_index t idx inst;
-}
-
// Trait implementation: [core::slice::index::private_slice_index::Range]
-let core_slice_index_private_slice_index_Range_coresliceindexprivate_slice_indexSealedInst
+let core_slice_index_private_slice_index_SealedRangeUsizeInst
: core_slice_index_private_slice_index_Sealed (core_ops_range_Range usize) = ()
// Trait implementation: [core::slice::index::Range]
-let core_slice_index_Range_coresliceindexSliceIndexInst (t : Type0) :
+let core_slice_index_SliceIndexRangeUsizeSliceTInst (t : Type0) :
core_slice_index_SliceIndex (core_ops_range_Range usize) (slice t) = {
- sealedInst = core_slice_index_private_slice_index_Range_coresliceindexprivate_slice_indexSealedInst;
+ sealedInst = core_slice_index_private_slice_index_SealedRangeUsizeInst;
output = slice t;
- get = core_slice_index_Range_get t;
- get_mut = core_slice_index_Range_get_mut t;
- get_mut_back = core_slice_index_Range_get_mut_back t;
- get_unchecked = core_slice_index_Range_get_unchecked t;
- get_unchecked_mut = core_slice_index_Range_get_unchecked_mut t;
- index = core_slice_index_Range_index t;
- index_mut = core_slice_index_Range_index_mut t;
- index_mut_back = core_slice_index_Range_index_mut_back t;
+ get = core_slice_index_RangeUsize_get t;
+ get_mut = core_slice_index_RangeUsize_get_mut t;
+ get_mut_back = core_slice_index_RangeUsize_get_mut_back t;
+ get_unchecked = core_slice_index_RangeUsize_get_unchecked t;
+ get_unchecked_mut = core_slice_index_RangeUsize_get_unchecked_mut t;
+ index = core_slice_index_RangeUsize_index t;
+ index_mut = core_slice_index_RangeUsize_index_mut t;
+ index_mut_back = core_slice_index_RangeUsize_index_mut_back t;
+}
+
+// Trait implementation: [core::slice::index::[T]]
+let core_ops_index_IndexSliceTIInst (t idx : Type0)
+ (inst : core_slice_index_SliceIndex idx (slice t)) :
+ core_ops_index_Index (slice t) idx = {
+ output = inst.output;
+ index = core_slice_index_Slice_index t idx inst;
}
// Trait implementation: [core::slice::index::[T]]
-let core_slice_index_Slice_coreopsindexIndexMutInst (t idx : Type0)
+let core_ops_index_IndexMutSliceTIInst (t idx : Type0)
(inst : core_slice_index_SliceIndex idx (slice t)) :
core_ops_index_IndexMut (slice t) idx = {
- indexInst = core_slice_index_Slice_coreopsindexIndexInst t idx inst;
+ indexInst = core_ops_index_IndexSliceTIInst t idx inst;
index_mut = core_slice_index_Slice_index_mut t idx inst;
index_mut_back = core_slice_index_Slice_index_mut_back t idx inst;
}
// Trait implementation: [core::array::[T; N]]
-let core_array_Array_coreopsindexIndexInst (t idx : Type0) (n : usize)
+let core_ops_index_IndexArrayInst (t idx : Type0) (n : usize)
(inst : core_ops_index_Index (slice t) idx) :
core_ops_index_Index (array t n) idx = {
output = inst.output;
@@ -604,10 +604,10 @@ let core_array_Array_coreopsindexIndexInst (t idx : Type0) (n : usize)
}
// Trait implementation: [core::array::[T; N]]
-let core_array_Array_coreopsindexIndexMutInst (t idx : Type0) (n : usize)
+let core_ops_index_IndexMutArrayIInst (t idx : Type0) (n : usize)
(inst : core_ops_index_IndexMut (slice t) idx) :
core_ops_index_IndexMut (array t n) idx = {
- indexInst = core_array_Array_coreopsindexIndexInst t idx n inst.indexInst;
+ indexInst = core_ops_index_IndexArrayInst t idx n inst.indexInst;
index_mut = core_array_Array_index_mut t idx n inst;
index_mut_back = core_array_Array_index_mut_back t idx n inst;
}
@@ -651,13 +651,13 @@ let core_slice_index_usize_index_mut_back
admit () // TODO
// Trait implementation: [core::slice::index::private_slice_index::usize]
-let core_slice_index_private_slice_index_usize_coresliceindexprivate_slice_indexSealedInst
+let core_slice_index_private_slice_index_SealedUsizeInst
: core_slice_index_private_slice_index_Sealed usize = ()
// Trait implementation: [core::slice::index::usize]
-let core_slice_index_usize_coresliceindexSliceIndexInst (t : Type0) :
+let core_slice_index_SliceIndexUsizeSliceTInst (t : Type0) :
core_slice_index_SliceIndex usize (slice t) = {
- sealedInst = core_slice_index_private_slice_index_usize_coresliceindexprivate_slice_indexSealedInst;
+ sealedInst = core_slice_index_private_slice_index_SealedUsizeInst;
output = t;
get = core_slice_index_usize_get t;
get_mut = core_slice_index_usize_get_mut t;
@@ -706,24 +706,24 @@ let alloc_vec_Vec_coreopsindexIndexMutInst (t idx : Type0)
let alloc_vec_Vec_index_eq (#a : Type0) (v : alloc_vec_Vec a) (i : usize) :
Lemma (
- alloc_vec_Vec_index a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i ==
+ alloc_vec_Vec_index a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i ==
alloc_vec_Vec_index_usize v i)
- [SMTPat (alloc_vec_Vec_index a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i)]
+ [SMTPat (alloc_vec_Vec_index a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i)]
=
admit()
let alloc_vec_Vec_index_mut_eq (#a : Type0) (v : alloc_vec_Vec a) (i : usize) :
Lemma (
- alloc_vec_Vec_index_mut a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i ==
+ alloc_vec_Vec_index_mut a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i ==
alloc_vec_Vec_index_usize v i)
- [SMTPat (alloc_vec_Vec_index_mut a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i)]
+ [SMTPat (alloc_vec_Vec_index_mut a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i)]
=
admit()
let alloc_vec_Vec_index_mut_back_eq (#a : Type0) (v : alloc_vec_Vec a) (i : usize) (x : a) :
Lemma (
- alloc_vec_Vec_index_mut_back a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i x ==
+ alloc_vec_Vec_index_mut_back a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i x ==
alloc_vec_Vec_update_usize v i x)
- [SMTPat (alloc_vec_Vec_index_mut_back a usize (core_slice_index_usize_coresliceindexSliceIndexInst a) v i x)]
+ [SMTPat (alloc_vec_Vec_index_mut_back a usize (core_slice_index_SliceIndexUsizeSliceTInst a) v i x)]
=
admit()