From d89cbfdc3f972e1ff4c7c9dd723146556d26526d Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 25 Jan 2024 11:54:31 +0100 Subject: Update a decreases clause --- tests/fstar-split/misc/Loops.Clauses.fst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/fstar-split/misc') diff --git a/tests/fstar-split/misc/Loops.Clauses.fst b/tests/fstar-split/misc/Loops.Clauses.fst index 75194437..13f5513d 100644 --- a/tests/fstar-split/misc/Loops.Clauses.fst +++ b/tests/fstar-split/misc/Loops.Clauses.fst @@ -19,6 +19,11 @@ unfold let sum_with_shared_borrows_loop_decreases (max : u32) (i : u32) (s : u32) : nat = if max >= i then max - i else 0 +(** [loops::sum_array]: decreases clause *) +unfold +let sum_array_loop_decreases (n : usize) (_ : array u32 n) (i : usize) (_ : u32) : nat = + if n >= i then n - i else 0 + (** [loops::clear]: decreases clause *) unfold let clear_loop_decreases (v : alloc_vec_Vec u32) (i : usize) : nat = if i <= List.Tot.length v then List.Tot.length v - i else 0 -- cgit v1.2.3