# HG changeset patch # User nipkow # Date 1368064708 -7200 # Node ID e398ab28eaa7a004ecba759aa8175e4d869966b9 # Parent 3d772b0af85688edf462e80e9d4d52838e01728a standard ivl notation [l,h] diff -r 3d772b0af856 -r e398ab28eaa7 src/HOL/IMP/Abs_Int2_ivl.thy --- a/src/HOL/IMP/Abs_Int2_ivl.thy Thu May 09 02:42:51 2013 +0200 +++ b/src/HOL/IMP/Abs_Int2_ivl.thy Thu May 09 03:58:28 2013 +0200 @@ -27,13 +27,13 @@ quotient_type ivl = eint2 / eq_ivl by(rule equivpI)(auto simp: reflp_def symp_def transp_def eq_ivl_def) -abbreviation ivl_abbr :: "eint \ eint \ ivl" ("[_\_]") where -"[l\h] == abs_ivl(l,h)" +abbreviation ivl_abbr :: "eint \ eint \ ivl" ("[_, _]") where +"[l,h] == abs_ivl(l,h)" lift_definition \_ivl :: "ivl \ int set" is \_rep by(simp add: eq_ivl_def) -lemma \_ivl_nice: "\_ivl[l\h] = {i. l \ Fin i \ Fin i \ h}" +lemma \_ivl_nice: "\_ivl[l,h] = {i. l \ Fin i \ Fin i \ h}" by transfer (simp add: \_rep_def) lift_definition num_ivl :: "int \ ivl" is "\i. (Fin i, Fin i)" @@ -43,7 +43,7 @@ is "\i (l,h). l \ Fin i \ Fin i \ h" by(auto simp: eq_ivl_def \_rep_def) -lemma in_ivl_nice: "in_ivl i [l\h] = (l \ Fin i \ Fin i \ h)" +lemma in_ivl_nice: "in_ivl i [l,h] = (l \ Fin i \ Fin i \ h)" by transfer simp definition is_empty_rep :: "eint2 \ bool" where @@ -187,20 +187,20 @@ lemma eq_ivl_empty: "eq_ivl p empty_rep = is_empty_rep p" by (metis eq_ivl_iff is_empty_empty_rep) -lemma le_ivl_nice: "[l1\h1] \ [l2\h2] \ - (if [l1\h1] = \ then True else - if [l2\h2] = \ then False else l1 \ l2 & h1 \ h2)" +lemma le_ivl_nice: "[l1,h1] \ [l2,h2] \ + (if [l1,h1] = \ then True else + if [l2,h2] = \ then False else l1 \ l2 & h1 \ h2)" unfolding bot_ivl_def by transfer (simp add: le_rep_def eq_ivl_empty) -lemma sup_ivl_nice: "[l1\h1] \ [l2\h2] = - (if [l1\h1] = \ then [l2\h2] else - if [l2\h2] = \ then [l1\h1] else [min l1 l2\max h1 h2])" +lemma sup_ivl_nice: "[l1,h1] \ [l2,h2] = + (if [l1,h1] = \ then [l2,h2] else + if [l2,h2] = \ then [l1,h1] else [min l1 l2,max h1 h2])" unfolding bot_ivl_def by transfer (simp add: sup_rep_def eq_ivl_empty) -lemma inf_ivl_nice: "[l1\h1] \ [l2\h2] = [max l1 l2\min h1 h2]" +lemma inf_ivl_nice: "[l1,h1] \ [l2,h2] = [max l1 l2,min h1 h2]" by transfer (simp add: inf_rep_def) -lemma top_ivl_nice: "\ = [-\\\]" +lemma top_ivl_nice: "\ = [-\,\]" by (simp add: top_ivl_def) @@ -218,8 +218,8 @@ instance .. end -lemma plus_ivl_nice: "[l1\h1] + [l2\h2] = - (if [l1\h1] = \ \ [l2\h2] = \ then \ else [l1+l2 \ h1+h2])" +lemma plus_ivl_nice: "[l1,h1] + [l2,h2] = + (if [l1,h1] = \ \ [l2,h2] = \ then \ else [l1+l2 , h1+h2])" unfolding bot_ivl_def by transfer (auto simp: plus_rep_def eq_ivl_empty) lemma uminus_eq_Minf[simp]: "-x = Minf \ x = Pinf" @@ -252,7 +252,7 @@ lemma \_uminus: "i : \_ivl iv \ -i \ \_ivl(- iv)" by transfer (rule \_uminus_rep) -lemma uminus_nice: "-[l\h] = [-h\-l]" +lemma uminus_nice: "-[l,h] = [-h,-l]" by transfer (simp add: uminus_rep_def) instantiation ivl :: minus @@ -293,14 +293,14 @@ definition constrain_less_ivl :: "bool \ ivl \ ivl \ ivl * ivl" where "constrain_less_ivl res iv1 iv2 = (if res - then (iv1 \ (below iv2 - [Fin 1\Fin 1]), - iv2 \ (above iv1 + [Fin 1\Fin 1])) + then (iv1 \ (below iv2 - [Fin 1,Fin 1]), + iv2 \ (above iv1 + [Fin 1,Fin 1])) else (iv1 \ above iv2, iv2 \ below iv1))" -lemma above_nice: "above[l\h] = (if [l\h] = \ then \ else [l\\])" +lemma above_nice: "above[l,h] = (if [l,h] = \ then \ else [l,\])" unfolding bot_ivl_def by transfer (simp add: above_rep_def eq_ivl_empty) -lemma below_nice: "below[l\h] = (if [l\h] = \ then \ else [-\\h])" +lemma below_nice: "below[l,h] = (if [l,h] = \ then \ else [-\,h])" unfolding bot_ivl_def by transfer (simp add: below_rep_def eq_ivl_empty) lemma add_mono_le_Fin: diff -r 3d772b0af856 -r e398ab28eaa7 src/HOL/IMP/Abs_Int3.thy --- a/src/HOL/IMP/Abs_Int3.thy Thu May 09 02:42:51 2013 +0200 +++ b/src/HOL/IMP/Abs_Int3.thy Thu May 09 03:58:28 2013 +0200 @@ -523,7 +523,7 @@ lift_definition m_ivl :: "ivl \ nat" is m_rep by(auto simp: m_rep_def eq_ivl_iff) -lemma m_ivl_nice: "m_ivl[l\h] = (if [l\h] = \ then 3 else +lemma m_ivl_nice: "m_ivl[l,h] = (if [l,h] = \ then 3 else (if l = Minf then 0 else 1) + (if h = Pinf then 0 else 1))" unfolding bot_ivl_def by transfer (auto simp: m_rep_def eq_ivl_empty split: extended.split)