summaryrefslogtreecommitdiff
path: root/tests/lean/misc-loops/Loops/Clauses
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lean/misc-loops/Loops/Clauses')
-rw-r--r--tests/lean/misc-loops/Loops/Clauses/Clauses.lean42
-rw-r--r--tests/lean/misc-loops/Loops/Clauses/Template.lean45
2 files changed, 39 insertions, 48 deletions
diff --git a/tests/lean/misc-loops/Loops/Clauses/Clauses.lean b/tests/lean/misc-loops/Loops/Clauses/Clauses.lean
index 5ddb65ca..89a7ce34 100644
--- a/tests/lean/misc-loops/Loops/Clauses/Clauses.lean
+++ b/tests/lean/misc-loops/Loops/Clauses/Clauses.lean
@@ -4,7 +4,7 @@ import Loops.Types
/- [loops::sum]: termination measure -/
@[simp]
-def sum_loop_terminates (max : UInt32) (i : UInt32) (s : UInt32) := (max, i, s)
+def sum_loop_terminates (max : U32) (i : U32) (s : U32) := (max, i, s)
syntax "sum_loop_decreases" term+ : tactic
@@ -13,8 +13,7 @@ macro_rules
/- [loops::sum_with_mut_borrows]: termination measure -/
@[simp]
-def sum_with_mut_borrows_loop_terminates (max : UInt32) (mi : UInt32)
- (ms : UInt32) :=
+def sum_with_mut_borrows_loop_terminates (max : U32) (mi : U32) (ms : U32) :=
(max, mi, ms)
syntax "sum_with_mut_borrows_loop_decreases" term+ : tactic
@@ -24,8 +23,7 @@ macro_rules
/- [loops::sum_with_shared_borrows]: termination measure -/
@[simp]
-def sum_with_shared_borrows_loop_terminates (max : UInt32) (i : UInt32)
- (s : UInt32) :=
+def sum_with_shared_borrows_loop_terminates (max : U32) (i : U32) (s : U32) :=
(max, i, s)
syntax "sum_with_shared_borrows_loop_decreases" term+ : tactic
@@ -34,7 +32,7 @@ macro_rules
| `(tactic| sum_with_shared_borrows_loop_decreases $max $i $s) =>`(tactic| sorry)
/- [loops::clear]: termination measure -/
-@[simp] def clear_loop_terminates (v : vec UInt32) (i : USize) := (v, i)
+@[simp] def clear_loop_terminates (v : Vec U32) (i : Usize) := (v, i)
syntax "clear_loop_decreases" term+ : tactic
@@ -43,7 +41,7 @@ macro_rules
/- [loops::list_mem]: termination measure -/
@[simp]
-def list_mem_loop_terminates (x : UInt32) (ls : list_t UInt32) := (x, ls)
+def list_mem_loop_terminates (x : U32) (ls : list_t U32) := (x, ls)
syntax "list_mem_loop_decreases" term+ : tactic
@@ -52,8 +50,7 @@ macro_rules
/- [loops::list_nth_mut_loop]: termination measure -/
@[simp]
-def list_nth_mut_loop_loop_terminates (T : Type) (ls : list_t T) (i : UInt32)
- :=
+def list_nth_mut_loop_loop_terminates (T : Type) (ls : list_t T) (i : U32) :=
(ls, i)
syntax "list_nth_mut_loop_loop_decreases" term+ : tactic
@@ -63,8 +60,7 @@ macro_rules
/- [loops::list_nth_shared_loop]: termination measure -/
@[simp]
-def list_nth_shared_loop_loop_terminates (T : Type) (ls : list_t T)
- (i : UInt32) :=
+def list_nth_shared_loop_loop_terminates (T : Type) (ls : list_t T) (i : U32) :=
(ls, i)
syntax "list_nth_shared_loop_loop_decreases" term+ : tactic
@@ -74,7 +70,7 @@ macro_rules
/- [loops::get_elem_mut]: termination measure -/
@[simp]
-def get_elem_mut_loop_terminates (x : USize) (ls : list_t USize) := (x, ls)
+def get_elem_mut_loop_terminates (x : Usize) (ls : list_t Usize) := (x, ls)
syntax "get_elem_mut_loop_decreases" term+ : tactic
@@ -83,7 +79,7 @@ macro_rules
/- [loops::get_elem_shared]: termination measure -/
@[simp]
-def get_elem_shared_loop_terminates (x : USize) (ls : list_t USize) := (x, ls)
+def get_elem_shared_loop_terminates (x : Usize) (ls : list_t Usize) := (x, ls)
syntax "get_elem_shared_loop_decreases" term+ : tactic
@@ -92,7 +88,7 @@ macro_rules
/- [loops::list_nth_mut_loop_with_id]: termination measure -/
@[simp]
-def list_nth_mut_loop_with_id_loop_terminates (T : Type) (i : UInt32)
+def list_nth_mut_loop_with_id_loop_terminates (T : Type) (i : U32)
(ls : list_t T) :=
(i, ls)
@@ -103,7 +99,7 @@ macro_rules
/- [loops::list_nth_shared_loop_with_id]: termination measure -/
@[simp]
-def list_nth_shared_loop_with_id_loop_terminates (T : Type) (i : UInt32)
+def list_nth_shared_loop_with_id_loop_terminates (T : Type) (i : U32)
(ls : list_t T) :=
(i, ls)
@@ -115,7 +111,7 @@ macro_rules
/- [loops::list_nth_mut_loop_pair]: termination measure -/
@[simp]
def list_nth_mut_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_mut_loop_pair_loop_decreases" term+ : tactic
@@ -126,7 +122,7 @@ macro_rules
/- [loops::list_nth_shared_loop_pair]: termination measure -/
@[simp]
def list_nth_shared_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_shared_loop_pair_loop_decreases" term+ : tactic
@@ -138,7 +134,7 @@ macro_rules
/- [loops::list_nth_mut_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_mut_loop_pair_merge_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_mut_loop_pair_merge_loop_decreases" term+ : tactic
@@ -150,7 +146,7 @@ macro_rules
/- [loops::list_nth_shared_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_shared_loop_pair_merge_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_shared_loop_pair_merge_loop_decreases" term+ : tactic
@@ -162,7 +158,7 @@ macro_rules
/- [loops::list_nth_mut_shared_loop_pair]: termination measure -/
@[simp]
def list_nth_mut_shared_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_mut_shared_loop_pair_loop_decreases" term+ : tactic
@@ -174,7 +170,7 @@ macro_rules
/- [loops::list_nth_mut_shared_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_mut_shared_loop_pair_merge_loop_terminates (T : Type)
- (ls0 : list_t T) (ls1 : list_t T) (i : UInt32) :=
+ (ls0 : list_t T) (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_mut_shared_loop_pair_merge_loop_decreases" term+ : tactic
@@ -186,7 +182,7 @@ macro_rules
/- [loops::list_nth_shared_mut_loop_pair]: termination measure -/
@[simp]
def list_nth_shared_mut_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_shared_mut_loop_pair_loop_decreases" term+ : tactic
@@ -198,7 +194,7 @@ macro_rules
/- [loops::list_nth_shared_mut_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_shared_mut_loop_pair_merge_loop_terminates (T : Type)
- (ls0 : list_t T) (ls1 : list_t T) (i : UInt32) :=
+ (ls0 : list_t T) (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
syntax "list_nth_shared_mut_loop_pair_merge_loop_decreases" term+ : tactic
diff --git a/tests/lean/misc-loops/Loops/Clauses/Template.lean b/tests/lean/misc-loops/Loops/Clauses/Template.lean
index d1e72d65..2e28a6c0 100644
--- a/tests/lean/misc-loops/Loops/Clauses/Template.lean
+++ b/tests/lean/misc-loops/Loops/Clauses/Template.lean
@@ -4,8 +4,7 @@ import Base.Primitives
import Loops.Types
/- [loops::sum]: termination measure -/
-@[simp]
-def sum_loop_terminates (max : UInt32) (i : UInt32) (s : UInt32) := (max, i, s)
+@[simp] def sum_loop_terminates (max : U32) (i : U32) (s : U32) := (max, i, s)
/- [loops::sum]: decreases_by tactic -/
syntax "sum_loop_decreases" term+ : tactic
@@ -14,8 +13,7 @@ macro_rules
/- [loops::sum_with_mut_borrows]: termination measure -/
@[simp]
-def sum_with_mut_borrows_loop_terminates (max : UInt32) (mi : UInt32)
- (ms : UInt32) :=
+def sum_with_mut_borrows_loop_terminates (max : U32) (mi : U32) (ms : U32) :=
(max, mi, ms)
/- [loops::sum_with_mut_borrows]: decreases_by tactic -/
@@ -25,8 +23,7 @@ macro_rules
/- [loops::sum_with_shared_borrows]: termination measure -/
@[simp]
-def sum_with_shared_borrows_loop_terminates (max : UInt32) (i : UInt32)
- (s : UInt32) :=
+def sum_with_shared_borrows_loop_terminates (max : U32) (i : U32) (s : U32) :=
(max, i, s)
/- [loops::sum_with_shared_borrows]: decreases_by tactic -/
@@ -35,7 +32,7 @@ macro_rules
| `(tactic| sum_with_shared_borrows_loop_decreases $max $i $s) =>`(tactic| sorry)
/- [loops::clear]: termination measure -/
-@[simp] def clear_loop_terminates (v : Vec UInt32) (i : USize) := (v, i)
+@[simp] def clear_loop_terminates (v : Vec U32) (i : Usize) := (v, i)
/- [loops::clear]: decreases_by tactic -/
syntax "clear_loop_decreases" term+ : tactic
@@ -43,8 +40,7 @@ macro_rules
| `(tactic| clear_loop_decreases $v $i) =>`(tactic| sorry)
/- [loops::list_mem]: termination measure -/
-@[simp]
-def list_mem_loop_terminates (x : UInt32) (ls : list_t UInt32) := (x, ls)
+@[simp] def list_mem_loop_terminates (x : U32) (ls : list_t U32) := (x, ls)
/- [loops::list_mem]: decreases_by tactic -/
syntax "list_mem_loop_decreases" term+ : tactic
@@ -53,8 +49,7 @@ macro_rules
/- [loops::list_nth_mut_loop]: termination measure -/
@[simp]
-def list_nth_mut_loop_loop_terminates (T : Type) (ls : list_t T) (i : UInt32)
- :=
+def list_nth_mut_loop_loop_terminates (T : Type) (ls : list_t T) (i : U32) :=
(ls, i)
/- [loops::list_nth_mut_loop]: decreases_by tactic -/
@@ -64,8 +59,8 @@ macro_rules
/- [loops::list_nth_shared_loop]: termination measure -/
@[simp]
-def list_nth_shared_loop_loop_terminates (T : Type) (ls : list_t T)
- (i : UInt32) :=
+def list_nth_shared_loop_loop_terminates (T : Type) (ls : list_t T) (i : U32)
+ :=
(ls, i)
/- [loops::list_nth_shared_loop]: decreases_by tactic -/
@@ -75,7 +70,7 @@ macro_rules
/- [loops::get_elem_mut]: termination measure -/
@[simp]
-def get_elem_mut_loop_terminates (x : USize) (ls : list_t USize) := (x, ls)
+def get_elem_mut_loop_terminates (x : Usize) (ls : list_t Usize) := (x, ls)
/- [loops::get_elem_mut]: decreases_by tactic -/
syntax "get_elem_mut_loop_decreases" term+ : tactic
@@ -84,7 +79,7 @@ macro_rules
/- [loops::get_elem_shared]: termination measure -/
@[simp]
-def get_elem_shared_loop_terminates (x : USize) (ls : list_t USize) := (x, ls)
+def get_elem_shared_loop_terminates (x : Usize) (ls : list_t Usize) := (x, ls)
/- [loops::get_elem_shared]: decreases_by tactic -/
syntax "get_elem_shared_loop_decreases" term+ : tactic
@@ -93,7 +88,7 @@ macro_rules
/- [loops::list_nth_mut_loop_with_id]: termination measure -/
@[simp]
-def list_nth_mut_loop_with_id_loop_terminates (T : Type) (i : UInt32)
+def list_nth_mut_loop_with_id_loop_terminates (T : Type) (i : U32)
(ls : list_t T) :=
(i, ls)
@@ -104,7 +99,7 @@ macro_rules
/- [loops::list_nth_shared_loop_with_id]: termination measure -/
@[simp]
-def list_nth_shared_loop_with_id_loop_terminates (T : Type) (i : UInt32)
+def list_nth_shared_loop_with_id_loop_terminates (T : Type) (i : U32)
(ls : list_t T) :=
(i, ls)
@@ -116,7 +111,7 @@ macro_rules
/- [loops::list_nth_mut_loop_pair]: termination measure -/
@[simp]
def list_nth_mut_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_mut_loop_pair]: decreases_by tactic -/
@@ -127,7 +122,7 @@ macro_rules
/- [loops::list_nth_shared_loop_pair]: termination measure -/
@[simp]
def list_nth_shared_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_shared_loop_pair]: decreases_by tactic -/
@@ -139,7 +134,7 @@ macro_rules
/- [loops::list_nth_mut_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_mut_loop_pair_merge_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_mut_loop_pair_merge]: decreases_by tactic -/
@@ -151,7 +146,7 @@ macro_rules
/- [loops::list_nth_shared_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_shared_loop_pair_merge_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_shared_loop_pair_merge]: decreases_by tactic -/
@@ -163,7 +158,7 @@ macro_rules
/- [loops::list_nth_mut_shared_loop_pair]: termination measure -/
@[simp]
def list_nth_mut_shared_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_mut_shared_loop_pair]: decreases_by tactic -/
@@ -175,7 +170,7 @@ macro_rules
/- [loops::list_nth_mut_shared_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_mut_shared_loop_pair_merge_loop_terminates (T : Type)
- (ls0 : list_t T) (ls1 : list_t T) (i : UInt32) :=
+ (ls0 : list_t T) (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_mut_shared_loop_pair_merge]: decreases_by tactic -/
@@ -187,7 +182,7 @@ macro_rules
/- [loops::list_nth_shared_mut_loop_pair]: termination measure -/
@[simp]
def list_nth_shared_mut_loop_pair_loop_terminates (T : Type) (ls0 : list_t T)
- (ls1 : list_t T) (i : UInt32) :=
+ (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_shared_mut_loop_pair]: decreases_by tactic -/
@@ -199,7 +194,7 @@ macro_rules
/- [loops::list_nth_shared_mut_loop_pair_merge]: termination measure -/
@[simp]
def list_nth_shared_mut_loop_pair_merge_loop_terminates (T : Type)
- (ls0 : list_t T) (ls1 : list_t T) (i : UInt32) :=
+ (ls0 : list_t T) (ls1 : list_t T) (i : U32) :=
(ls0, ls1, i)
/- [loops::list_nth_shared_mut_loop_pair_merge]: decreases_by tactic -/