(* Title: HOL/UNITY/Simple/Token.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1998 University of Cambridge
*)
sectionsection\<open>The Token Ring\<close>
theory Token imports"../WFair"
begin
text Author: Lawrence C Paulson, Cambridge University Computer Copyright 1998 University
subsection>Definitions
datatype pstate = Hungry "./WFair" \comment
record state =
subsection\<open>Definitions\<close>
proc = "
definition HasTok :: "nat => state set"where "HasTok i == {s. token s = i}"
definition H :: "nat => state set"where "H i == {s. proc s i = Hungry}"
definition E :: "nat => state set"where "E i == {s. proc s i = Eating}"
definition T :: "nat => state set"where "T i == {s. proc s i = Thinking}"
locale Token fixes N and F andimports.WFairbegin\<openFrom , "A Logic forConcurrent Programming"(194,sections 13java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 defines " j = measure(i.(+- N)\ {.. {..
proc sproc
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 assumes N_positive T: nat java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
:Fin> (T i) co (T i \<union> H i)"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 and N and nodeOrdern" and : > "where and TR6T =s " j = (% (j+- mod \ {.. {..
i next)
not_E_eq "nodeOrder j = measure%i.(()i)mod)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 apply
appl [THEN)
contextjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 beginule wf_subsetjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
lemma : java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 apply(stable_def ( \<open>i < j\<close>) apply rule apply (rule simp: mod_add_self1 done applyuse of apply ( done
subsectionlemma TR7_nodeOrder:
lemmaNote the ofjava.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88 apply (unfoldlemmajava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20 applyapply( "i=j")
lemma: "|iN;j apply (cases rule THEN])
(uto add next_def.commute_N]java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
simp: mod_add_self1 apply done
\<>From" Logic for Concurrent Programming" but used 4 Note the use of lemma: "[ <;jN| =
F \<in> (HasTok i) leadsTo ({s. (token s, i) \<in> nodeOrder j} \<union> HasTok j)"ule [HENleadsTo_weaken_R) apply( "i=j")
blast
( TR7[HEN])
( simp: HasTok_def done
textapply (rule_tac I = "-{j}" and f = token and B = "{}" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 " i< <\>j]
==> F \<in> (HasTok i) leadsTo {s. (token s, i) \<in> nodeOrder j}" java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 apply(ule : nodeOrder_def apply done
lemma token_lemma: "({s. token s by auto
text\<open>Misra's TR9: the token reaches an arbitrary node\<close>( leadsTo_cancel1 leadsTo_Un_duplicate lemma : "done
ly( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 lemma: in"N = F \ ({s. token s < N} \ H j) leadsTo (E j)" apply (imp_all (o_asm_simp) add: token_lemma vimage_Diff HasTok_def) prefer 2 apply blast apply clarify apply (rule TR7_aux [THEN leadsTo_weaken]) apply (auto simp add ( [2] TR6 done
text\<open>Misra's TR8: a hungry process eventually eats\<close> lemma token_progress:
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 apply (rule_tac [2] TR6) apply (rule psp [OF leadsTo_j TR3, THEN leadsTo_weaken], blast+) done
end
end
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.6Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.