src/HOL/Data_Structures/Tree234_Map.thy
changeset 68020 6aade817bee5
parent 67965 aaa31cd0caef
child 68431 b294e095f64c
     1.1 --- a/src/HOL/Data_Structures/Tree234_Map.thy	Fri Apr 20 22:22:46 2018 +0200
     1.2 +++ b/src/HOL/Data_Structures/Tree234_Map.thy	Sat Apr 21 08:41:42 2018 +0200
     1.3 @@ -88,23 +88,23 @@
     1.4  "del x (Node2 l ab1 r) = (case cmp x (fst ab1) of
     1.5    LT \<Rightarrow> node21 (del x l) ab1 r |
     1.6    GT \<Rightarrow> node22 l ab1 (del x r) |
     1.7 -  EQ \<Rightarrow> let (ab1',t) = del_min r in node22 l ab1' t)" |
     1.8 +  EQ \<Rightarrow> let (ab1',t) = split_min r in node22 l ab1' t)" |
     1.9  "del x (Node3 l ab1 m ab2 r) = (case cmp x (fst ab1) of
    1.10    LT \<Rightarrow> node31 (del x l) ab1 m ab2 r |
    1.11 -  EQ \<Rightarrow> let (ab1',m') = del_min m in node32 l ab1' m' ab2 r |
    1.12 +  EQ \<Rightarrow> let (ab1',m') = split_min m in node32 l ab1' m' ab2 r |
    1.13    GT \<Rightarrow> (case cmp x (fst ab2) of
    1.14             LT \<Rightarrow> node32 l ab1 (del x m) ab2 r |
    1.15 -           EQ \<Rightarrow> let (ab2',r') = del_min r in node33 l ab1 m ab2' r' |
    1.16 +           EQ \<Rightarrow> let (ab2',r') = split_min r in node33 l ab1 m ab2' r' |
    1.17             GT \<Rightarrow> node33 l ab1 m ab2 (del x r)))" |
    1.18  "del x (Node4 t1 ab1 t2 ab2 t3 ab3 t4) = (case cmp x (fst ab2) of
    1.19    LT \<Rightarrow> (case cmp x (fst ab1) of
    1.20             LT \<Rightarrow> node41 (del x t1) ab1 t2 ab2 t3 ab3 t4 |
    1.21 -           EQ \<Rightarrow> let (ab',t2') = del_min t2 in node42 t1 ab' t2' ab2 t3 ab3 t4 |
    1.22 +           EQ \<Rightarrow> let (ab',t2') = split_min t2 in node42 t1 ab' t2' ab2 t3 ab3 t4 |
    1.23             GT \<Rightarrow> node42 t1 ab1 (del x t2) ab2 t3 ab3 t4) |
    1.24 -  EQ \<Rightarrow> let (ab',t3') = del_min t3 in node43 t1 ab1 t2 ab' t3' ab3 t4 |
    1.25 +  EQ \<Rightarrow> let (ab',t3') = split_min t3 in node43 t1 ab1 t2 ab' t3' ab3 t4 |
    1.26    GT \<Rightarrow> (case cmp x (fst ab3) of
    1.27            LT \<Rightarrow> node43 t1 ab1 t2 ab2 (del x t3) ab3 t4 |
    1.28 -          EQ \<Rightarrow> let (ab',t4') = del_min t4 in node44 t1 ab1 t2 ab2 t3 ab' t4' |
    1.29 +          EQ \<Rightarrow> let (ab',t4') = split_min t4 in node44 t1 ab1 t2 ab2 t3 ab' t4' |
    1.30            GT \<Rightarrow> node44 t1 ab1 t2 ab2 t3 ab3 (del x t4)))"
    1.31  
    1.32  definition delete :: "'a::linorder \<Rightarrow> ('a*'b) tree234 \<Rightarrow> ('a*'b) tree234" where
    1.33 @@ -130,7 +130,7 @@
    1.34  lemma inorder_del: "\<lbrakk> bal t ; sorted1(inorder t) \<rbrakk> \<Longrightarrow>
    1.35    inorder(tree\<^sub>d (del x t)) = del_list x (inorder t)"
    1.36  by(induction t rule: del.induct)
    1.37 -  (auto simp: del_list_simps inorder_nodes del_minD split!: if_splits prod.splits)
    1.38 +  (auto simp: del_list_simps inorder_nodes split_minD split!: if_splits prod.splits)
    1.39  (* 30 secs (2016) *)
    1.40  
    1.41  lemma inorder_delete: "\<lbrakk> bal t ; sorted1(inorder t) \<rbrakk> \<Longrightarrow>
    1.42 @@ -148,11 +148,11 @@
    1.43  
    1.44  lemma height_del: "bal t \<Longrightarrow> height(del x t) = height t"
    1.45  by(induction x t rule: del.induct)
    1.46 -  (auto simp add: heights height_del_min split!: if_split prod.split)
    1.47 +  (auto simp add: heights height_split_min split!: if_split prod.split)
    1.48  
    1.49  lemma bal_tree\<^sub>d_del: "bal t \<Longrightarrow> bal(tree\<^sub>d(del x t))"
    1.50  by(induction x t rule: del.induct)
    1.51 -  (auto simp: bals bal_del_min height_del height_del_min split!: if_split prod.split)
    1.52 +  (auto simp: bals bal_split_min height_del height_split_min split!: if_split prod.split)
    1.53  
    1.54  corollary bal_delete: "bal t \<Longrightarrow> bal(delete x t)"
    1.55  by(simp add: delete_def bal_tree\<^sub>d_del)