summaryrefslogtreecommitdiff
path: root/tests/fstar-split/misc/PoloniusList.fst
blob: 8a8b7ae3732b8b81d511db0d64b85fa0e0233e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *)
(** [polonius_list] *)
module PoloniusList
open Primitives

#set-options "--z3rlimit 50 --fuel 1 --ifuel 1"

(** [polonius_list::List]
    Source: 'src/polonius_list.rs', lines 3:0-3:16 *)
type list_t (t : Type0) =
| List_Cons : t -> list_t t -> list_t t
| List_Nil : list_t t

(** [polonius_list::get_list_at_x]: forward function
    Source: 'src/polonius_list.rs', lines 13:0-13:76 *)
let rec get_list_at_x (ls : list_t u32) (x : u32) : result (list_t u32) =
  begin match ls with
  | List_Cons hd tl ->
    if hd = x then Return (List_Cons hd tl) else get_list_at_x tl x
  | List_Nil -> Return List_Nil
  end

(** [polonius_list::get_list_at_x]: backward function 0
    Source: 'src/polonius_list.rs', lines 13:0-13:76 *)
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
  | List_Cons hd tl ->
    if hd = x
    then Return ret
    else let* tl1 = get_list_at_x_back tl x ret in Return (List_Cons hd tl1)
  | List_Nil -> Return ret
  end