diff -r 9789ccc2a477 -r def97df48390 src/HOL/Data_Structures/RBT_Map.thy --- a/src/HOL/Data_Structures/RBT_Map.thy Thu Jul 07 17:34:39 2016 +0200 +++ b/src/HOL/Data_Structures/RBT_Map.thy Thu Jul 07 18:08:10 2016 +0200 @@ -8,7 +8,7 @@ Lookup2 begin -fun upd :: "'a::cmp \ 'b \ ('a*'b) rbt \ ('a*'b) rbt" where +fun upd :: "'a::linorder \ 'b \ ('a*'b) rbt \ ('a*'b) rbt" where "upd x y Leaf = R Leaf (x,y) Leaf" | "upd x y (B l (a,b) r) = (case cmp x a of LT \ bal (upd x y l) (a,b) r | @@ -19,12 +19,12 @@ GT \ R l (a,b) (upd x y r) | EQ \ R l (x,y) r)" -definition update :: "'a::cmp \ 'b \ ('a*'b) rbt \ ('a*'b) rbt" where +definition update :: "'a::linorder \ 'b \ ('a*'b) rbt \ ('a*'b) rbt" where "update x y t = paint Black (upd x y t)" -fun del :: "'a::cmp \ ('a*'b)rbt \ ('a*'b)rbt" -and delL :: "'a::cmp \ ('a*'b)rbt \ 'a*'b \ ('a*'b)rbt \ ('a*'b)rbt" -and delR :: "'a::cmp \ ('a*'b)rbt \ 'a*'b \ ('a*'b)rbt \ ('a*'b)rbt" +fun del :: "'a::linorder \ ('a*'b)rbt \ ('a*'b)rbt" +and delL :: "'a::linorder \ ('a*'b)rbt \ 'a*'b \ ('a*'b)rbt \ ('a*'b)rbt" +and delR :: "'a::linorder \ ('a*'b)rbt \ 'a*'b \ ('a*'b)rbt \ ('a*'b)rbt" where "del x Leaf = Leaf" | "del x (Node c t1 (a,b) t2) = (case cmp x a of @@ -36,7 +36,7 @@ "delR x t1 a (B t2 b t3) = balR t1 a (del x (B t2 b t3))" | "delR x t1 a t2 = R t1 a (del x t2)" -definition delete :: "'a::cmp \ ('a*'b) rbt \ ('a*'b) rbt" where +definition delete :: "'a::linorder \ ('a*'b) rbt \ ('a*'b) rbt" where "delete x t = paint Black (del x t)"