# HG changeset patch # User nipkow # Date 1449329600 -3600 # Node ID 0494964bb2261104661a7d231f013fdf995cb439 # Parent 9ce1a397410a056099fd7613e8395f909aa65d66 avoid name clashes diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/AVL_Map.thy --- a/src/HOL/Data_Structures/AVL_Map.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/AVL_Map.thy Sat Dec 05 16:33:20 2015 +0100 @@ -42,7 +42,7 @@ proof (standard, goal_cases) case 1 show ?case by simp next - case 2 thus ?case by(simp add: lookup_eq) + case 2 thus ?case by(simp add: lookup_map_of) next case 3 thus ?case by(simp add: inorder_update) next diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/Lookup2.thy --- a/src/HOL/Data_Structures/Lookup2.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/Lookup2.thy Sat Dec 05 16:33:20 2015 +0100 @@ -14,7 +14,8 @@ "lookup (Node _ l (a,b) r) x = (case cmp x a of LT \ lookup l x | GT \ lookup r x | EQ \ Some b)" -lemma lookup_eq: "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" +lemma lookup_map_of: + "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" by(induction t) (auto simp: map_of_simps split: option.split) end \ No newline at end of file diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/RBT_Map.thy --- a/src/HOL/Data_Structures/RBT_Map.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/RBT_Map.thy Sat Dec 05 16:33:20 2015 +0100 @@ -70,7 +70,7 @@ proof (standard, goal_cases) case 1 show ?case by simp next - case 2 thus ?case by(simp add: lookup_eq) + case 2 thus ?case by(simp add: lookup_map_of) next case 3 thus ?case by(simp add: inorder_update) next diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/Tree234_Map.thy --- a/src/HOL/Data_Structures/Tree234_Map.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/Tree234_Map.thy Sat Dec 05 16:33:20 2015 +0100 @@ -113,7 +113,8 @@ subsection "Functional correctness" -lemma lookup: "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" +lemma lookup_map_of: + "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" by (induction t) (auto simp: map_of_simps split: option.split) @@ -163,11 +164,11 @@ subsection \Overall Correctness\ -interpretation T234_Map: Map_by_Ordered +interpretation Map_by_Ordered where empty = Leaf and lookup = lookup and update = update and delete = delete and inorder = inorder and inv = bal proof (standard, goal_cases) - case 2 thus ?case by(simp add: lookup) + case 2 thus ?case by(simp add: lookup_map_of) next case 3 thus ?case by(simp add: inorder_update) next diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/Tree23_Map.thy --- a/src/HOL/Data_Structures/Tree23_Map.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/Tree23_Map.thy Sat Dec 05 16:33:20 2015 +0100 @@ -72,7 +72,8 @@ subsection \Functional Correctness\ -lemma lookup: "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" +lemma lookup_map_of: + "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" by (induction t) (auto simp: map_of_simps split: option.split) @@ -118,11 +119,11 @@ subsection \Overall Correctness\ -interpretation T23_Map: Map_by_Ordered +interpretation Map_by_Ordered where empty = Leaf and lookup = lookup and update = update and delete = delete and inorder = inorder and inv = bal proof (standard, goal_cases) - case 2 thus ?case by(simp add: lookup) + case 2 thus ?case by(simp add: lookup_map_of) next case 3 thus ?case by(simp add: inorder_update) next diff -r 9ce1a397410a -r 0494964bb226 src/HOL/Data_Structures/Tree_Map.thy --- a/src/HOL/Data_Structures/Tree_Map.thy Sat Dec 05 16:13:28 2015 +0100 +++ b/src/HOL/Data_Structures/Tree_Map.thy Sat Dec 05 16:33:20 2015 +0100 @@ -30,7 +30,7 @@ subsection "Functional Correctness Proofs" -lemma lookup_eq: +lemma lookup_map_of: "sorted1(inorder t) \ lookup t x = map_of (inorder t) x" by (induction t) (auto simp: map_of_simps split: option.split) @@ -48,7 +48,7 @@ proof (standard, goal_cases) case 1 show ?case by simp next - case 2 thus ?case by(simp add: lookup_eq) + case 2 thus ?case by(simp add: lookup_map_of) next case 3 thus ?case by(simp add: inorder_update) next