summaryrefslogtreecommitdiff
path: root/tests/fstar/misc/InfiniteLoop.fst
blob: 4e7c8c0605f1ec86f3063def287d74b52c994c98 (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
(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *)
(** [infinite_loop] *)
module InfiniteLoop
open Primitives

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

(** [infinite_loop::bar]:
    Source: 'tests/src/infinite-loop.rs', lines 4:0-4:8 *)
let bar : result unit =
  Ok ()

(** [infinite_loop::foo]: loop 0:
    Source: 'tests/src/infinite-loop.rs', lines 6:0-10:1 *)
let rec foo_loop (n : nat) : result unit =
  if is_zero n
  then Fail OutOfFuel
  else let n1 = decrease n in let* _ = bar in foo_loop n1

(** [infinite_loop::foo]:
    Source: 'tests/src/infinite-loop.rs', lines 6:0-6:8 *)
let foo (n : nat) : result unit =
  foo_loop n