_(_|_) is now override_on
authornipkow
Sun Apr 10 17:19:03 2005 +0200 (2005-04-10)
changeset 15691900cf45ff0a6
parent 15690 1da2cfd1ca45
child 15692 666ea7e62384
_(_|_) is now override_on
src/HOL/Fun.thy
src/HOL/Map.thy
src/HOL/document/root.tex
     1.1 --- a/src/HOL/Fun.thy	Sun Apr 10 11:42:07 2005 +0200
     1.2 +++ b/src/HOL/Fun.thy	Sun Apr 10 17:19:03 2005 +0200
     1.3 @@ -39,9 +39,8 @@
     1.4  *)
     1.5  
     1.6  constdefs
     1.7 - overwrite :: "('a => 'b) => ('a => 'b) => 'a set => ('a => 'b)"
     1.8 -              ("_/'(_|/_')"  [900,0,0]900)
     1.9 -"f(g|A) == %a. if a : A then g a else f a"
    1.10 + override_on :: "('a => 'b) => ('a => 'b) => 'a set => ('a => 'b)"
    1.11 +"override_on f g A == %a. if a : A then g a else f a"
    1.12  
    1.13   id :: "'a => 'a"
    1.14  "id == %x. x"
    1.15 @@ -392,16 +391,16 @@
    1.16       "f(x:=y) ` A = (if x \<in> A then insert y (f ` (A-{x})) else f ` A)"
    1.17  by auto
    1.18  
    1.19 -subsection{* overwrite *}
    1.20 +subsection{* @{text override_on} *}
    1.21  
    1.22 -lemma overwrite_emptyset[simp]: "f(g|{}) = f"
    1.23 -by(simp add:overwrite_def)
    1.24 +lemma override_on_emptyset[simp]: "override_on f g {} = f"
    1.25 +by(simp add:override_on_def)
    1.26  
    1.27 -lemma overwrite_apply_notin[simp]: "a ~: A ==> (f(g|A)) a = f a"
    1.28 -by(simp add:overwrite_def)
    1.29 +lemma override_on_apply_notin[simp]: "a ~: A ==> (override_on f g A) a = f a"
    1.30 +by(simp add:override_on_def)
    1.31  
    1.32 -lemma overwrite_apply_in[simp]: "a : A ==> (f(g|A)) a = g a"
    1.33 -by(simp add:overwrite_def)
    1.34 +lemma override_on_apply_in[simp]: "a : A ==> (override_on f g A) a = g a"
    1.35 +by(simp add:override_on_def)
    1.36  
    1.37  subsection{* swap *}
    1.38  
    1.39 @@ -410,7 +409,7 @@
    1.40     "swap a b f == f(a := f b, b:= f a)"
    1.41  
    1.42  lemma swap_self: "swap a a f = f"
    1.43 -by (simp add: swap_def) 
    1.44 +by (simp add: swap_def)
    1.45  
    1.46  lemma swap_commute: "swap a b f = swap b a f"
    1.47  by (rule ext, simp add: fun_upd_def swap_def)
     2.1 --- a/src/HOL/Map.thy	Sun Apr 10 11:42:07 2005 +0200
     2.2 +++ b/src/HOL/Map.thy	Sun Apr 10 17:19:03 2005 +0200
     2.3 @@ -18,7 +18,7 @@
     2.4  consts
     2.5  chg_map	:: "('b => 'b) => 'a => ('a ~=> 'b) => ('a ~=> 'b)"
     2.6  map_add :: "('a ~=> 'b) => ('a ~=> 'b) => ('a ~=> 'b)" (infixl "++" 100)
     2.7 -restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" ("_|'__" [90, 91] 90)
     2.8 +restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" (infixl "|^"  110)
     2.9  dom	:: "('a ~=> 'b) => 'a set"
    2.10  ran	:: "('a ~=> 'b) => 'b set"
    2.11  map_of	:: "('a * 'b)list => 'a ~=> 'b"
    2.12 @@ -55,7 +55,7 @@
    2.13    "_maplet"  :: "['a, 'a] => maplet"             ("_ /\<mapsto>/ _")
    2.14    "_maplets" :: "['a, 'a] => maplet"             ("_ /[\<mapsto>]/ _")
    2.15  
    2.16 -  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" ("_\<lfloor>_" [90, 91] 90)
    2.17 +  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" (infixl "\<upharpoonright>" 110) --"requires amssymb!"
    2.18    map_upd_s  :: "('a ~=> 'b) => 'a set => 'b => ('a ~=> 'b)"
    2.19  				    		 ("_/'(_/{\<mapsto>}/_')" [900,0,0]900)
    2.20    map_subst :: "('a ~=> 'b) => 'b => 'b => 
    2.21 @@ -80,7 +80,7 @@
    2.22  chg_map_def:  "chg_map f a m == case m a of None => m | Some b => m(a|->f b)"
    2.23  
    2.24  map_add_def:   "m1++m2 == %x. case m2 x of None => m1 x | Some y => Some y"
    2.25 -restrict_map_def: "m|_A == %x. if x : A then m x else None"
    2.26 +restrict_map_def: "m|^A == %x. if x : A then m x else None"
    2.27  
    2.28  map_upds_def: "m(xs [|->] ys) == m ++ map_of (rev(zip xs ys))"
    2.29  map_upd_s_def: "m(as{|->}b) == %x. if x : as then Some b else m x"
    2.30 @@ -324,44 +324,44 @@
    2.31  
    2.32  subsection {* @{term restrict_map} *}
    2.33  
    2.34 -lemma restrict_map_to_empty[simp]: "m\<lfloor>{} = empty"
    2.35 +lemma restrict_map_to_empty[simp]: "m|^{} = empty"
    2.36  by(simp add: restrict_map_def)
    2.37  
    2.38 -lemma restrict_map_empty[simp]: "empty\<lfloor>D = empty"
    2.39 +lemma restrict_map_empty[simp]: "empty|^D = empty"
    2.40  by(simp add: restrict_map_def)
    2.41  
    2.42 -lemma restrict_in [simp]: "x \<in> A \<Longrightarrow> (m\<lfloor>A) x = m x"
    2.43 +lemma restrict_in [simp]: "x \<in> A \<Longrightarrow> (m|^A) x = m x"
    2.44  by (auto simp: restrict_map_def)
    2.45  
    2.46 -lemma restrict_out [simp]: "x \<notin> A \<Longrightarrow> (m\<lfloor>A) x = None"
    2.47 +lemma restrict_out [simp]: "x \<notin> A \<Longrightarrow> (m|^A) x = None"
    2.48  by (auto simp: restrict_map_def)
    2.49  
    2.50 -lemma ran_restrictD: "y \<in> ran (m\<lfloor>A) \<Longrightarrow> \<exists>x\<in>A. m x = Some y"
    2.51 +lemma ran_restrictD: "y \<in> ran (m|^A) \<Longrightarrow> \<exists>x\<in>A. m x = Some y"
    2.52  by (auto simp: restrict_map_def ran_def split: split_if_asm)
    2.53  
    2.54 -lemma dom_restrict [simp]: "dom (m\<lfloor>A) = dom m \<inter> A"
    2.55 +lemma dom_restrict [simp]: "dom (m|^A) = dom m \<inter> A"
    2.56  by (auto simp: restrict_map_def dom_def split: split_if_asm)
    2.57  
    2.58 -lemma restrict_upd_same [simp]: "m(x\<mapsto>y)\<lfloor>(-{x}) = m\<lfloor>(-{x})"
    2.59 +lemma restrict_upd_same [simp]: "m(x\<mapsto>y)|^(-{x}) = m|^(-{x})"
    2.60  by (rule ext, auto simp: restrict_map_def)
    2.61  
    2.62 -lemma restrict_restrict [simp]: "m\<lfloor>A\<lfloor>B = m\<lfloor>(A\<inter>B)"
    2.63 +lemma restrict_restrict [simp]: "m|^A|^B = m|^(A\<inter>B)"
    2.64  by (rule ext, auto simp: restrict_map_def)
    2.65  
    2.66  lemma restrict_fun_upd[simp]:
    2.67 - "m(x := y)\<lfloor>D = (if x \<in> D then (m\<lfloor>(D-{x}))(x := y) else m\<lfloor>D)"
    2.68 + "m(x := y)|^D = (if x \<in> D then (m|^(D-{x}))(x := y) else m|^D)"
    2.69  by(simp add: restrict_map_def expand_fun_eq)
    2.70  
    2.71  lemma fun_upd_None_restrict[simp]:
    2.72 -  "(m\<lfloor>D)(x := None) = (if x:D then m\<lfloor>(D - {x}) else m\<lfloor>D)"
    2.73 +  "(m|^D)(x := None) = (if x:D then m|^(D - {x}) else m|^D)"
    2.74  by(simp add: restrict_map_def expand_fun_eq)
    2.75  
    2.76  lemma fun_upd_restrict:
    2.77 - "(m\<lfloor>D)(x := y) = (m\<lfloor>(D-{x}))(x := y)"
    2.78 + "(m|^D)(x := y) = (m|^(D-{x}))(x := y)"
    2.79  by(simp add: restrict_map_def expand_fun_eq)
    2.80  
    2.81  lemma fun_upd_restrict_conv[simp]:
    2.82 - "x \<in> D \<Longrightarrow> (m\<lfloor>D)(x := y) = (m\<lfloor>(D-{x}))(x := y)"
    2.83 + "x \<in> D \<Longrightarrow> (m|^D)(x := y) = (m|^(D-{x}))(x := y)"
    2.84  by(simp add: restrict_map_def expand_fun_eq)
    2.85  
    2.86  
    2.87 @@ -432,7 +432,7 @@
    2.88  
    2.89  lemma restrict_map_upds[simp]: "!!m ys.
    2.90   \<lbrakk> length xs = length ys; set xs \<subseteq> D \<rbrakk>
    2.91 - \<Longrightarrow> m(xs [\<mapsto>] ys)\<lfloor>D = (m\<lfloor>(D - set xs))(xs [\<mapsto>] ys)"
    2.92 + \<Longrightarrow> m(xs [\<mapsto>] ys)|^D = (m|^(D - set xs))(xs [\<mapsto>] ys)"
    2.93  apply (induct xs, simp)
    2.94  apply (case_tac ys, simp)
    2.95  apply(simp add:Diff_insert[symmetric] insert_absorb)
    2.96 @@ -500,9 +500,10 @@
    2.97  lemma dom_map_add[simp]: "dom(m++n) = dom n Un dom m"
    2.98  by (unfold dom_def, auto)
    2.99  
   2.100 -lemma dom_overwrite[simp]:
   2.101 - "dom(f(g|A)) = (dom f  - {a. a : A - dom g}) Un {a. a : A Int dom g}"
   2.102 -by(auto simp add: dom_def overwrite_def)
   2.103 +lemma dom_override_on[simp]:
   2.104 + "dom(override_on f g A) =
   2.105 + (dom f  - {a. a : A - dom g}) Un {a. a : A Int dom g}"
   2.106 +by(auto simp add: dom_def override_on_def)
   2.107  
   2.108  lemma map_add_comm: "dom m1 \<inter> dom m2 = {} \<Longrightarrow> m1++m2 = m2++m1"
   2.109  apply(rule ext)
     3.1 --- a/src/HOL/document/root.tex	Sun Apr 10 11:42:07 2005 +0200
     3.2 +++ b/src/HOL/document/root.tex	Sun Apr 10 17:19:03 2005 +0200
     3.3 @@ -3,6 +3,7 @@
     3.4  
     3.5  \documentclass[11pt,a4paper]{article}
     3.6  \usepackage{graphicx,isabelle,isabellesym,latexsym}
     3.7 +\usepackage{amssymb}
     3.8  \usepackage[only,bigsqcap]{stmaryrd}
     3.9  \usepackage[latin1]{inputenc}
    3.10  \usepackage{pdfsetup}