diff -r 9789ccc2a477 -r def97df48390 src/HOL/Data_Structures/Tree23_Map.thy --- a/src/HOL/Data_Structures/Tree23_Map.thy Thu Jul 07 17:34:39 2016 +0200 +++ b/src/HOL/Data_Structures/Tree23_Map.thy Thu Jul 07 18:08:10 2016 +0200 @@ -8,7 +8,7 @@ Map_by_Ordered begin -fun lookup :: "('a::cmp * 'b) tree23 \ 'a \ 'b option" where +fun lookup :: "('a::linorder * 'b) tree23 \ 'a \ 'b option" where "lookup Leaf x = None" | "lookup (Node2 l (a,b) r) x = (case cmp x a of LT \ lookup l x | @@ -22,7 +22,7 @@ EQ \ Some b2 | GT \ lookup r x))" -fun upd :: "'a::cmp \ 'b \ ('a*'b) tree23 \ ('a*'b) up\<^sub>i" where +fun upd :: "'a::linorder \ 'b \ ('a*'b) tree23 \ ('a*'b) up\<^sub>i" where "upd x y Leaf = Up\<^sub>i Leaf (x,y) Leaf" | "upd x y (Node2 l ab r) = (case cmp x (fst ab) of LT \ (case upd x y l of @@ -46,10 +46,10 @@ T\<^sub>i r' => T\<^sub>i (Node3 l ab1 m ab2 r') | Up\<^sub>i r1 ab' r2 => Up\<^sub>i (Node2 l ab1 m) ab2 (Node2 r1 ab' r2))))" -definition update :: "'a::cmp \ 'b \ ('a*'b) tree23 \ ('a*'b) tree23" where +definition update :: "'a::linorder \ 'b \ ('a*'b) tree23 \ ('a*'b) tree23" where "update a b t = tree\<^sub>i(upd a b t)" -fun del :: "'a::cmp \ ('a*'b) tree23 \ ('a*'b) up\<^sub>d" where +fun del :: "'a::linorder \ ('a*'b) tree23 \ ('a*'b) up\<^sub>d" where "del x Leaf = T\<^sub>d Leaf" | "del x (Node2 Leaf ab1 Leaf) = (if x=fst ab1 then Up\<^sub>d Leaf else T\<^sub>d(Node2 Leaf ab1 Leaf))" | "del x (Node3 Leaf ab1 Leaf ab2 Leaf) = T\<^sub>d(if x=fst ab1 then Node2 Leaf ab2 Leaf @@ -66,7 +66,7 @@ EQ \ let (ab2',r') = del_min r in node33 l ab1 m ab2' r' | GT \ node33 l ab1 m ab2 (del x r)))" -definition delete :: "'a::cmp \ ('a*'b) tree23 \ ('a*'b) tree23" where +definition delete :: "'a::linorder \ ('a*'b) tree23 \ ('a*'b) tree23" where "delete x t = tree\<^sub>d(del x t)"