diff options
author | Son Ho | 2024-04-26 10:28:32 +0200 |
---|---|---|
committer | Son Ho | 2024-04-26 10:28:32 +0200 |
commit | dbabb0124814c38f11f839f8a67146011107133d (patch) | |
tree | bd780ce7568b620c0e3ab3783c99c210e3445236 /tests/fstar | |
parent | 036756d6bddbcf9bc936489779ed36c7e4d22d14 (diff) |
Update a decreases clause
Diffstat (limited to '')
-rw-r--r-- | tests/fstar/betree/BetreeMain.Clauses.fst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/fstar/betree/BetreeMain.Clauses.fst b/tests/fstar/betree/BetreeMain.Clauses.fst index b95d4c7e..fcef89ed 100644 --- a/tests/fstar/betree/BetreeMain.Clauses.fst +++ b/tests/fstar/betree/BetreeMain.Clauses.fst @@ -130,12 +130,18 @@ let betree_Node_lookup_first_message_for_key_decreases (key : u64) (msgs : betree_List_t (u64 & betree_Message_t)) : betree_List_t (u64 & betree_Message_t) = msgs + +let rec list_length (#a : Type0) (ls : betree_List_t a) : nat = + match ls with + | Betree_List_Cons _ ls -> 1 + list_length ls + | Betree_List_Nil -> 0 + (** [betree_main::betree::Node::{5}::apply_upserts]: decreases clause *) unfold let betree_Node_apply_upserts_decreases (msgs : betree_List_t (u64 & betree_Message_t)) (prev : option u64) (key : u64) : betree_List_t (u64 & betree_Message_t) = - msgs + list_length msgs (** [betree_main::betree::Internal::{4}::lookup_in_children]: decreases clause *) unfold |