PIPDefs.thy
changeset 138 20c1d3a14143
parent 136 fb3f52fe99d1
child 144 e4d151d761c4
equal deleted inserted replaced
137:785c0f6b8184 138:20c1d3a14143
   123   assumed more urgent to finish. *}
   123   assumed more urgent to finish. *}
   124 
   124 
   125 definition preced :: "thread \<Rightarrow> state \<Rightarrow> precedence"
   125 definition preced :: "thread \<Rightarrow> state \<Rightarrow> precedence"
   126   where "preced th s \<equiv> Prc (priority th s) (last_set th s)"
   126   where "preced th s \<equiv> Prc (priority th s) (last_set th s)"
   127 
   127 
   128 definition preceds :: "thread set \<Rightarrow> state \<Rightarrow> precedence set"
   128 abbreviation preceds :: "thread set \<Rightarrow> state \<Rightarrow> precedence set"
   129   where "preceds ths s \<equiv> {preced th s | th. th \<in> ths}"
   129   where "preceds ths s \<equiv> {preced th s | th. th \<in> ths}"
   130 
   130 
   131 text {*
   131 text {*
   132 
   132 
   133   \noindent A number of important notions in PIP are represented as the
   133   \noindent A number of important notions in PIP are represented as the
   225   is whrere the word "Inheritance" in Priority Inheritance Protocol comes
   225   is whrere the word "Inheritance" in Priority Inheritance Protocol comes
   226   from. *}
   226   from. *}
   227 
   227 
   228 lemma cpreced_def2:
   228 lemma cpreced_def2:
   229   "cpreced wq s th \<equiv> Max ((\<lambda>th'. preced th' s) ` ({th} \<union> dependants_raw wq th))"
   229   "cpreced wq s th \<equiv> Max ((\<lambda>th'. preced th' s) ` ({th} \<union> dependants_raw wq th))"
   230   unfolding cpreced_def image_def preceds_def
   230   unfolding cpreced_def image_def
   231   apply(rule eq_reflection)
   231   apply(rule eq_reflection)
   232   apply(rule_tac f="Max" in arg_cong)
   232   apply(rule_tac f="Max" in arg_cong)
   233   by (auto)
   233   by (auto)
   234 
   234 
   235 definition 
   235 definition 
   377 lemma cpreced_initial: 
   377 lemma cpreced_initial: 
   378   "cpreced (\<lambda> cs. []) [] = (\<lambda>_. (Prc 0 0))"
   378   "cpreced (\<lambda> cs. []) [] = (\<lambda>_. (Prc 0 0))"
   379 apply(rule ext)
   379 apply(rule ext)
   380 apply(simp add: cpreced_def)
   380 apply(simp add: cpreced_def)
   381 apply(simp add: dependants_raw_def RAG_raw_def waiting_raw_def holding_raw_def)
   381 apply(simp add: dependants_raw_def RAG_raw_def waiting_raw_def holding_raw_def)
   382 apply(simp add: preced_def preceds_def)
   382 apply(simp add: preced_def)
   383 done
   383 done
   384 
   384 
   385 text {* 
   385 text {* 
   386 
   386 
   387   \noindent The following @{text "wq"} is a shorthand for @{text "wq_fun"}.
   387   \noindent The following @{text "wq"} is a shorthand for @{text "wq_fun"}.