summaryrefslogtreecommitdiff
path: root/tests/fstar-split/array/Array.Clauses.fst
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fstar-split/array/Array.Clauses.fst')
-rw-r--r--tests/fstar-split/array/Array.Clauses.fst19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/fstar-split/array/Array.Clauses.fst b/tests/fstar-split/array/Array.Clauses.fst
new file mode 100644
index 00000000..68cbf216
--- /dev/null
+++ b/tests/fstar-split/array/Array.Clauses.fst
@@ -0,0 +1,19 @@
+(** [array]: decreases clauses *)
+module Array.Clauses
+open Primitives
+open Array.Types
+open FStar.List.Tot
+
+#set-options "--z3rlimit 50 --fuel 1 --ifuel 1"
+
+(** [array::sum]: decreases clause *)
+unfold
+let sum_loop_decreases (s : slice u32) (sum : u32) (i : usize) : nat =
+ if i < length s then length s - i else 0
+
+(** [array::sum2]: decreases clause *)
+unfold
+let sum2_loop_decreases (s : slice u32) (s2 : slice u32) (sum : u32)
+ (i : usize) : nat =
+ if i < length s then length s - i else 0
+