1 (* Title: HOL/Hoare/HeapSyntax.thy
6 theory HeapSyntax imports Hoare_Logic Heap begin
8 subsection "Field access and update"
11 "_refupdate" :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a ref \<Rightarrow> 'b \<Rightarrow> ('a \<Rightarrow> 'b)"
12 ("_/'((_ \<rightarrow> _)')" [1000,0] 900)
13 "_fassign" :: "'a ref => id => 'v => 's com"
14 ("(2_^._ :=/ _)" [70,1000,65] 61)
15 "_faccess" :: "'a ref => ('a ref \<Rightarrow> 'v) => 'v"
18 "f(r \<rightarrow> v)" == "f(CONST addr r := v)"
19 "p^.f := e" => "f := f(p \<rightarrow> e)"
20 "p^.f" => "f(CONST addr p)"
23 declare fun_upd_apply[simp del] fun_upd_same[simp] fun_upd_other[simp]
26 text "An example due to Suzuki:"
29 {w = Ref w0 & x = Ref x0 & y = Ref y0 & z = Ref z0 &
30 distinct[w0,x0,y0,z0]}
31 w^.v := (1::int); w^.n := x;