explicitly state equivalence relation for sim; tweak syntax of sem_equiv
authorkleing
Thu May 16 13:49:18 2013 +1000 (2013-05-16)
changeset 5202159963cda805a
parent 52020 db08e493cf44
child 52022 e0a83bd90bb1
child 52023 b477be38a7bb
explicitly state equivalence relation for sim; tweak syntax of sem_equiv
src/HOL/IMP/Big_Step.thy
src/HOL/IMP/Sem_Equiv.thy
     1.1 --- a/src/HOL/IMP/Big_Step.thy	Thu May 16 02:13:42 2013 +0200
     1.2 +++ b/src/HOL/IMP/Big_Step.thy	Thu May 16 13:49:18 2013 +1000
     1.3 @@ -226,6 +226,13 @@
     1.4  lemma sim_while_cong: "c \<sim> c' \<Longrightarrow> WHILE b DO c \<sim> WHILE b DO c'"
     1.5  by (metis sim_while_cong_aux)
     1.6  
     1.7 +text {* Command equivalence is an equivalence relation, i.e.\ it is
     1.8 +reflexive, symmetric, and transitive. Because we used an abbreviation
     1.9 +above, Isabelle derives this automatically. *}
    1.10 +
    1.11 +lemma sim_refl:  "c \<sim> c" by simp
    1.12 +lemma sim_sym:   "(c \<sim> c') = (c' \<sim> c)" by auto
    1.13 +lemma sim_trans: "c \<sim> c' \<Longrightarrow> c' \<sim> c'' \<Longrightarrow> c \<sim> c''" by auto
    1.14  
    1.15  subsection "Execution is deterministic"
    1.16  
     2.1 --- a/src/HOL/IMP/Sem_Equiv.thy	Thu May 16 02:13:42 2013 +0200
     2.2 +++ b/src/HOL/IMP/Sem_Equiv.thy	Thu May 16 13:49:18 2013 +1000
     2.3 @@ -7,12 +7,12 @@
     2.4  type_synonym assn = "state \<Rightarrow> bool"
     2.5  
     2.6  definition
     2.7 -  equiv_up_to :: "assn \<Rightarrow> com \<Rightarrow> com \<Rightarrow> bool" ("_ \<Turnstile> _ \<sim> _" [60,0,10] 60)
     2.8 +  equiv_up_to :: "assn \<Rightarrow> com \<Rightarrow> com \<Rightarrow> bool" ("_ \<Turnstile> _ \<sim> _" [50,0,10] 50)
     2.9  where
    2.10    "P \<Turnstile> c \<sim> c' \<equiv> \<forall>s s'. P s \<longrightarrow> (c,s) \<Rightarrow> s' \<longleftrightarrow> (c',s) \<Rightarrow> s'"
    2.11  
    2.12  definition
    2.13 -  bequiv_up_to :: "assn \<Rightarrow> bexp \<Rightarrow> bexp \<Rightarrow> bool" ("_ \<Turnstile> _ <\<sim>> _" [60,0,10] 60)
    2.14 +  bequiv_up_to :: "assn \<Rightarrow> bexp \<Rightarrow> bexp \<Rightarrow> bool" ("_ \<Turnstile> _ <\<sim>> _" [50,0,10] 50)
    2.15  where
    2.16    "P \<Turnstile> b <\<sim>> b' \<equiv> \<forall>s. P s \<longrightarrow> bval b s = bval b' s"
    2.17