diff options
author | Son Ho | 2022-02-26 19:14:12 +0100 |
---|---|---|
committer | Son Ho | 2022-02-26 19:14:12 +0100 |
commit | 9f8deb8283fc5affdfc36218c22e316f0efb866f (patch) | |
tree | f5d7b8d171214b01c2085669c341fa6a6b4432c7 /tests | |
parent | 7063ad38f9da58f952bf4a47fbfae01163605000 (diff) |
Add the betree_nll.rs test
Diffstat (limited to '')
-rw-r--r-- | tests/misc/BetreeNll.fst | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/misc/BetreeNll.fst b/tests/misc/BetreeNll.fst new file mode 100644 index 00000000..ae35827c --- /dev/null +++ b/tests/misc/BetreeNll.fst @@ -0,0 +1,41 @@ +(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) +(** [betree_nll] *) +module BetreeNll +open Primitives + +#set-options "--z3rlimit 50 --fuel 0 --ifuel 1" + +(** [betree_nll::List] *) +type list_t (t : Type0) = +| ListCons : t -> list_t t -> list_t t +| ListNil : list_t t + +(** [betree_nll::get_list_at_x] *) +let rec get_list_at_x_fwd (ls : list_t u32) (x : u32) : result (list_t u32) = + begin match ls with + | ListCons hd tl -> + if hd = x + then Return (ListCons hd tl) + else + begin match get_list_at_x_fwd tl x with + | Fail -> Fail + | Return l -> Return l + end + | ListNil -> Return ListNil + end + +(** [betree_nll::get_list_at_x] *) +let rec get_list_at_x_back + (ls : list_t u32) (x : u32) (ret : list_t u32) : result (list_t u32) = + begin match ls with + | ListCons hd tl -> + if hd = x + then Return ret + else + begin match get_list_at_x_back tl x ret with + | Fail -> Fail + | Return l -> Return (ListCons hd l) + end + | ListNil -> Return ret + end + |