summaryrefslogtreecommitdiff
path: root/tests/fstar/misc/Loops.Clauses.fst
blob: 2087f2e7d3d4bcdecd0aafef2210fc9ec69f778d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(** [loops]: templates for the decreases clauses *)
module Loops.Clauses
open Primitives
open Loops.Types

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

(** [loops::sum]: decreases clause *)
unfold let sum_decreases (max : u32) (i : u32) (s : u32) : nat =
  if i <= max then max - i else 0

(** [loops::list_nth_mut_loop]: decreases clause *)
unfold
let list_nth_mut_loop_decreases (t : Type0) (ls : list_t t) (i : u32) : nat =
  i