theory Trace_par
imports Prefix
begin
declare disj_not1 [simp del]
inductive_set
parx :: "'a set => ('a trace * 'a trace * 'a trace) set"
for X :: "'a set"
where
parx_nil_nil:
"(<>, <>, <>) : parx X" |
parx_Tick_Tick:
"(<Tick>, <Tick>, <Tick>) : parx X" |
parx_Ev_nil:
"[| (u, s, <>) : parx X ; a ~: X |]
==> (<Ev a> ^^^ u, <Ev a> ^^^ s, <>) : parx X" |
parx_nil_Ev:
"[| (u, <>, t) : parx X ; a ~: X |]
==> (<Ev a> ^^^ u, <>, <Ev a> ^^^ t) : parx X" |
parx_Ev_sync:
"[| (u, s, t) : parx X ; a : X |]
==> (<Ev a> ^^^ u, <Ev a> ^^^ s, <Ev a> ^^^ t) : parx X" |
parx_Ev_left:
"[| (u, s, t) : parx X ; a ~: X |]
==> (<Ev a> ^^^ u, <Ev a> ^^^ s, t) : parx X" |
parx_Ev_right:
"[| (u, s, t) : parx X ; a ~: X |]
==> (<Ev a> ^^^ u, s, <Ev a> ^^^ t) : parx X"
consts
par_tr :: "'a trace => 'a set => 'a trace => 'a trace set"
("(_ |[_]|tr _)" [76,0,77] 76)
defs
par_tr_def : "s |[X]|tr t == {u. (u, s, t) : parx X}"
lemma par_tr_defE: "[| u : s |[X]|tr t ; (u, s, t) : parx X ==> R |] ==> R"
by (simp add: par_tr_def)
lemma par_tr_nil_nil:
"<> : <> |[X]|tr <>"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_Tick_Tick:
"<Tick> : <Tick> |[X]|tr <Tick>"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_Ev_nil:
"[| u : s |[X]|tr <> ; a ~: X |]
==> <Ev a> ^^^ u : (<Ev a> ^^^ s) |[X]|tr <>"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_nil_Ev:
"[| u : <> |[X]|tr t ; a ~: X |]
==> <Ev a> ^^^ u : <> |[X]|tr (<Ev a> ^^^ t)"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_Ev_sync:
"[| u : s |[X]|tr t ; a : X |]
==> <Ev a> ^^^ u : (<Ev a> ^^^ s) |[X]|tr (<Ev a> ^^^ t)"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_Ev_left:
"[| u : s |[X]|tr t ; a ~: X |]
==> <Ev a> ^^^ u : (<Ev a> ^^^ s) |[X]|tr t"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemma par_tr_Ev_right:
"[| u : s |[X]|tr t ; a ~: X |]
==> <Ev a> ^^^ u : s |[X]|tr (<Ev a> ^^^ t)"
apply (simp add: par_tr_def)
by (simp add: parx.intros)
lemmas par_tr_intros =
par_tr_nil_nil
par_tr_Tick_Tick
par_tr_Ev_nil
par_tr_nil_Ev
par_tr_Ev_sync
par_tr_Ev_left
par_tr_Ev_right
lemma par_tr_elims_lm:
"[| u : s |[X]|tr t ;
(u = <> & s = <> & t = <>) --> P ;
(u = <Tick> & s = <Tick> & t = <Tick>) --> P ;
ALL a s' u'.
(u = <Ev a> ^^^ u' & s = <Ev a> ^^^ s' & t = <> &
u' : s' |[X]|tr <> & a ~: X)
--> P;
ALL a t' u'.
(u = <Ev a> ^^^ u' & s = <> & t = <Ev a> ^^^ t' &
u' : <> |[X]|tr t' & a ~: X)
--> P;
ALL a s' t' u'.
(u = <Ev a> ^^^ u' & s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t' &
u' : s' |[X]|tr t' & a : X)
--> P;
ALL a s' u'.
(u = <Ev a> ^^^ u' & s = <Ev a> ^^^ s' &
u' : s' |[X]|tr t & a ~: X)
--> P;
ALL a t' u'.
(u = <Ev a> ^^^ u' & t = <Ev a> ^^^ t' &
u' : s |[X]|tr t' & a ~: X)
--> P |]
==> P"
apply (simp add: par_tr_def)
apply (erule parx.cases)
apply (simp_all)
done
lemma par_tr_elims:
"[| u : s |[X]|tr t ;
[| u = <>; s = <>; t = <> |] ==> P ;
[| u = <Tick>; s = <Tick>; t = <Tick> |] ==> P ;
!!a s' u'.
[| u = <Ev a> ^^^ u'; s = <Ev a> ^^^ s'; t = <> ;
u' : s' |[X]|tr <>; a ~: X |]
==> P;
!!a t' u'.
[| u = <Ev a> ^^^ u' ; s = <> ; t = <Ev a> ^^^ t' ;
u' : <> |[X]|tr t'; a ~: X |]
==> P;
!!a s' t' u'.
[| u = <Ev a> ^^^ u' ; s = <Ev a> ^^^ s' ; t = <Ev a> ^^^ t' ;
u' : s' |[X]|tr t'; a : X |]
==> P;
!!a s' u'.
[| u = <Ev a> ^^^ u' ; s = <Ev a> ^^^ s' ;
u' : s' |[X]|tr t; a ~: X |]
==> P;
!!a t' u'.
[| u = <Ev a> ^^^ u' ; t = <Ev a> ^^^ t' ;
u' : s |[X]|tr t'; a ~: X |]
==> P |]
==> P"
apply (rule par_tr_elims_lm[of u s X t])
apply (simp_all)
apply (fast)
apply (fast)
apply (fast)
apply (fast)
apply (fast)
done
lemma par_tr_nil_only_if:
"<> : s |[X]|tr t ==> s = <> & t = <>"
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_nil1[simp]:
"(<> : s |[X]|tr t) = (s = <> & t = <>)"
apply (rule iffI)
apply (simp add: par_tr_nil_only_if)
by (simp add: par_tr_intros)
lemma par_tr_nil2[simp]:
"(u : <> |[X]|tr <>) = (u = <>)"
apply (rule iffI)
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_Tick_only_if:
"<Tick> : s |[X]|tr t ==> s = <Tick> & t = <Tick>"
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_Tick1[simp]:
"<Tick> : s |[X]|tr t = (s = <Tick> & t = <Tick>)"
apply (rule iffI)
apply (simp add: par_tr_Tick_only_if)
by (simp add: par_tr_intros)
lemma par_tr_Tick2[simp]:
"(u : <Tick> |[X]|tr <Tick>) = (u = <Tick>)"
apply (rule iffI)
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_Ev_only_if:
"<Ev a> : s |[X]|tr t
==> ((a : X & s = <Ev a> & t = <Ev a>) |
(a ~: X & s = <Ev a> & t = <>) |
(a ~: X & s = <> & t = <Ev a> ))"
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_Ev_if:
"((a : X & s = <Ev a> & t = <Ev a>) |
(a ~: X & s = <Ev a> & t = <>) |
(a ~: X & s = <> & t = <Ev a> ))
==> <Ev a> : s |[X]|tr t"
apply (erule disjE)
apply (insert par_tr_Ev_sync[of "<>" "<>" X "<>" a], simp)
apply (erule disjE)
apply (insert par_tr_Ev_left[of "<>" "<>" X "<>" a], simp)
apply (insert par_tr_Ev_right[of "<>" "<>" X "<>" a], simp)
done
lemma par_tr_Ev:
"<Ev a> : s |[X]|tr t
= ((a : X & s = <Ev a> & t = <Ev a>) |
(a ~: X & s = <Ev a> & t = <>) |
(a ~: X & s = <> & t = <Ev a> ))"
apply (rule iffI)
apply (simp add: par_tr_Ev_only_if)
apply (simp add: par_tr_Ev_if)
done
lemma par_tr_one:
"<e> : s |[X]|tr t
= ((e = Tick & s = <Tick> & t = <Tick>) |
(EX a. e = Ev a &
((a : X & s = <Ev a> & t = <Ev a>) |
(a ~: X & s = <Ev a> & t = <>) |
(a ~: X & s = <> & t = <Ev a> ))))"
apply (insert event_Tick_or_Ev)
apply (drule_tac x="e" in spec)
apply (erule disjE)
apply (simp)
apply (erule exE)
apply (simp add: par_tr_Ev)
done
lemma par_tr_head_only_if:
"<Ev a> ^^^ u : s |[X]|tr t
==> (a : X & (EX s' t'. u : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. u : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. u : s |[X]|tr t' & t = <Ev a> ^^^ t'))"
apply (erule par_tr_elims)
by (simp_all)
lemma par_tr_head_if:
"(a : X & (EX s' t'. u : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. u : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. u : s |[X]|tr t' & t = <Ev a> ^^^ t'))
==> <Ev a> ^^^ u : s |[X]|tr t"
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: par_tr_intros)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: par_tr_intros)
apply (elim conjE exE)
apply (simp add: par_tr_intros)
done
lemma par_tr_head:
"<Ev a> ^^^ u : s |[X]|tr t
= ((a : X & (EX s' t'. u : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. u : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. u : s |[X]|tr t' & t = <Ev a> ^^^ t')))"
apply (rule iffI)
apply (simp add: par_tr_head_only_if)
apply (simp add: par_tr_head_if)
done
lemma par_tr_head_ifE:
"[| <Ev a> ^^^ u : s |[X]|tr t ;
[| (a : X & (EX s' t'. u : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. u : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. u : s |[X]|tr t' & t = <Ev a> ^^^ t')) |] ==> R
|] ==> R"
by (simp add: par_tr_head)
lemma par_tr_head_Ev_Ev:
"(u : (<Ev a> ^^^ s) |[X]|tr (<Ev b> ^^^ t))
= (EX c v. u = <Ev c> ^^^ v &
(c : X & v : s |[X]|tr t & a = c & b = c |
c ~: X & v : s |[X]|tr (<Ev b> ^^^ t) & a = c |
c ~: X & v : (<Ev a> ^^^ s) |[X]|tr t & b = c))"
apply (rule iffI)
apply (insert trace_nil_or_Tick_or_Ev)
apply (drule_tac x="u" in spec)
apply (elim disjE conjE exE)
apply (simp_all)
apply (simp add: par_tr_head)
apply (elim conjE exE)
apply (simp add: par_tr_head)
done
lemma par_tr_step:
"(u : s |[X]|tr t)
= ((u = <> & s = <> & t = <>) |
(u = <Tick> & s = <Tick> & t = <Tick>) |
(EX a v. u = <Ev a> ^^^ v &
((a : X & (EX s' t'. v : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. v : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. v : s |[X]|tr t' & t = <Ev a> ^^^ t')))))"
apply (insert trace_nil_or_Tick_or_Ev)
apply (drule_tac x="u" in spec)
apply (elim disjE)
apply (simp_all)
apply (elim exE)
apply (simp add: par_tr_head)
done
lemma par_tr_stepI:
"((u = <> & s = <> & t = <>) |
(u = <Tick> & s = <Tick> & t = <Tick>) |
(EX a v. u = <Ev a> ^^^ v &
((a : X & (EX s' t'. v : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. v : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. v : s |[X]|tr t' & t = <Ev a> ^^^ t')))))
==> (u : s |[X]|tr t)"
by (simp add: par_tr_step[THEN sym])
lemma par_tr_stepE:
"[| u : s |[X]|tr t ;
((u = <> & s = <> & t = <>) |
(u = <Tick> & s = <Tick> & t = <Tick>) |
(EX a v. u = <Ev a> ^^^ v &
((a : X & (EX s' t'. v : s' |[X]|tr t'
& s = <Ev a> ^^^ s' & t = <Ev a> ^^^ t')) |
(a ~: X & (EX s'. v : s' |[X]|tr t & s = <Ev a> ^^^ s')) |
(a ~: X & (EX t'. v : s |[X]|tr t' & t = <Ev a> ^^^ t')))))
==> R |] ==> R"
by (simp add: par_tr_step[THEN sym])
lemma par_tr_last_only_if_lm:
"ALL X u s t e.
(u ^^^ <e> : s |[X]|tr t & noTick u)
--> (((e : Ev ` X | e = Tick) &
(EX s' t'. u : s' |[X]|tr t' & s = s' ^^^ <e> & t = t' ^^^ <e>
& noTick s' & noTick t')) |
(e ~: Ev ` X & e ~= Tick &
(EX s'. u : s' |[X]|tr t & s = s' ^^^ <e> & noTick s' & noTick t)) |
(e ~: Ev ` X & e ~= Tick &
(EX t'. u : s |[X]|tr t' & t = t' ^^^ <e> & noTick s & noTick t')))"
apply (rule allI)
apply (rule allI)
apply (induct_tac u rule: induct_trace)
apply (intro allI impI)
apply (simp add: par_tr_one)
apply (erule disjE, simp)
apply (erule exE, force)
apply (simp)
apply (intro allI impI)
apply (elim conjE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (elim disjE conjE exE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="<Ev a> ^^^ s'a" in exI)
apply (rule_tac x="<Ev a> ^^^ t'a" in exI)
apply (simp add: appt_assoc)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="<Ev a> ^^^ s'a" in exI, simp)
apply (simp add: appt_assoc)
apply (simp)
apply (elim conjE exE)
apply (rule disjI2)
apply (rule_tac x="<Ev a> ^^^ t'a" in exI, simp)
apply (simp add: appt_assoc)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="<Ev a> ^^^ s'a" in exI)
apply (rule_tac x="t'" in exI)
apply (simp add: appt_assoc)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="<Ev a> ^^^ s'a" in exI, simp)
apply (simp add: appt_assoc)
apply (simp)
apply (elim conjE exE)
apply (rule disjI2)
apply (rule_tac x="t'" in exI, simp)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="s'" in exI)
apply (rule_tac x="<Ev a> ^^^ t'a" in exI)
apply (simp add: appt_assoc)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule disjI1)
apply (rule_tac x="s'" in exI, simp)
apply (simp)
apply (elim conjE exE)
apply (rule disjI2)
apply (rule_tac x="<Ev a> ^^^ t'a" in exI)
apply (simp add: appt_assoc)
done
lemma par_tr_last_only_if:
"[| u ^^^ <e> : s |[X]|tr t ; noTick u |]
==> (((e : Ev ` X | e = Tick) &
(EX s' t'. u : s' |[X]|tr t' & s = s' ^^^ <e> & t = t' ^^^ <e>
& noTick s' & noTick t')) |
(e ~: Ev ` X & e ~= Tick &
(EX s'. u : s' |[X]|tr t & s = s' ^^^ <e> & noTick s' & noTick t)) |
(e ~: Ev ` X & e ~= Tick &
(EX t'. u : s |[X]|tr t' & t = t' ^^^ <e> & noTick s & noTick t')))"
by (simp add: par_tr_last_only_if_lm)
lemma par_tr_last_if_lm:
"ALL X u s t e. (noTick u &
(((e : Ev ` X | e = Tick) &
(EX s' t'. u : s' |[X]|tr t' & s = s' ^^^ <e> & t = t' ^^^ <e>
& noTick s' & noTick t')) |
(e ~: Ev ` X & e ~= Tick &
(EX s'. u : s' |[X]|tr t & s = s' ^^^ <e> & noTick s' & noTick t)) |
(e ~: Ev ` X & e ~= Tick &
(EX t'. u : s |[X]|tr t' & t = t' ^^^ <e> & noTick s & noTick t'))))
--> u ^^^ <e> : s |[X]|tr t"
apply (rule allI)
apply (rule allI)
apply (induct_tac u rule: induct_trace)
apply (intro allI impI)
apply (simp add: par_tr_one)
apply (elim conjE disjE)
apply (force)
apply (simp)
apply (simp add: not_Tick_to_Ev, fast)
apply (simp add: not_Tick_to_Ev, fast)
apply (simp)
apply (intro allI impI)
apply (simp add: par_tr_head)
apply (simp add: appt_assoc)
apply (elim conjE)
apply (elim disjE)
apply (elim conjE exE)
apply (rotate_tac 3)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'a ^^^ <e>" in spec)
apply (drule_tac x="t'a ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (rotate_tac -1)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'a ^^^ <e>" in spec)
apply (drule_tac x="t' ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s' ^^^ <e>" in spec)
apply (drule_tac x="t'a ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (elim conjE exE)
apply (rotate_tac 4)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'a ^^^ <e>" in spec)
apply (drule_tac x="t'" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (rotate_tac -1)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'a ^^^ <e>" in spec)
apply (drule_tac x="t" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s' ^^^ <e>" in spec)
apply (drule_tac x="t'" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (elim conjE exE)
apply (rotate_tac 4)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'a ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (rotate_tac -1)
apply (erule disjE)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t' ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
apply (elim conjE exE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'a ^^^ <e>" in spec)
apply (drule_tac x="e" in spec)
apply (simp)
apply (fast)
done
lemma par_tr_last_if:
"[| noTick u;
((e : Ev ` X | e = Tick) &
(EX s' t'. u : s' |[X]|tr t' & s = s' ^^^ <e> & t = t' ^^^ <e>
& noTick s' & noTick t')) |
(e ~: Ev ` X & e ~= Tick &
(EX s'. u : s' |[X]|tr t & s = s' ^^^ <e> & noTick s' & noTick t)) |
(e ~: Ev ` X & e ~= Tick &
(EX t'. u : s |[X]|tr t' & t = t' ^^^ <e> & noTick s & noTick t')) |]
==> u ^^^ <e> : s |[X]|tr t"
apply (insert par_tr_last_if_lm)
apply (drule_tac x="X" in spec)
apply (drule_tac x="u" in spec)
apply (drule_tac x="s" in spec)
apply (drule_tac x="t" in spec)
apply (drule_tac x="e" in spec)
by (simp)
lemma par_tr_last:
"noTick u ==>
u ^^^ <e> : s |[X]|tr t
= (((e : Ev ` X | e = Tick) &
(EX s' t'. u : s' |[X]|tr t' & s = s' ^^^ <e> & t = t' ^^^ <e>
& noTick s' & noTick t')) |
(e ~: Ev ` X & e ~= Tick &
(EX s'. u : s' |[X]|tr t & s = s' ^^^ <e> & noTick s' & noTick t)) |
(e ~: Ev ` X & e ~= Tick &
(EX t'. u : s |[X]|tr t' & t = t' ^^^ <e> & noTick s & noTick t')))"
apply (rule iffI)
apply (simp add: par_tr_last_only_if)
apply (simp add: par_tr_last_if)
done
lemma par_tr_sym_only_if_lm:
"ALL u s t. u : (s |[X]|tr t) --> u : (t |[X]|tr s)"
apply (rule allI)
apply (induct_tac u rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (erule par_tr_elims)
apply (simp)
apply (simp)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="<>" in spec)
apply (simp add: par_tr_intros)
apply (drule_tac x="<>" in spec)
apply (drule_tac x="t'" in spec)
apply (simp add: par_tr_intros)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (simp add: par_tr_intros)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (simp add: par_tr_intros)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (simp add: par_tr_intros)
done
lemma par_tr_sym_only_if:
"u : (s |[X]|tr t) ==> u : (t |[X]|tr s)"
apply (insert par_tr_sym_only_if_lm[of X])
apply (drule_tac x="u" in spec)
apply (drule_tac x="s" in spec)
apply (drule_tac x="t" in spec)
apply (simp)
done
lemma par_tr_sym: "s |[X]|tr t = t |[X]|tr s"
apply (auto)
apply (rule par_tr_sym_only_if, simp_all)
apply (rule par_tr_sym_only_if, simp_all)
done
lemma par_tr_prefix_lm:
"ALL X v u s t. prefix v u & u : s |[X]|tr t
--> (EX s' t'. v : s' |[X]|tr t' &
prefix s' s & prefix t' t)"
apply (rule allI)
apply (rule allI)
apply (induct_tac v rule: induct_trace)
apply (simp_all add: disj_not1)
apply (simp add: prefix_Tick)
apply (intro allI impI)
apply (elim conjE exE)
apply (simp add: par_tr_head)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="u'" in spec)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (force)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="u'" in spec)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (force)
apply (elim conjE exE)
apply (drule_tac x="u'" in spec)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (force)
done
lemma par_tr_prefix:
"[| prefix v u ; u : s |[X]|tr t |]
==> (EX s' t'. v : s' |[X]|tr t' & prefix s' s & prefix t' t)"
apply (insert par_tr_prefix_lm)
apply (drule_tac x="X" in spec)
apply (drule_tac x="v" in spec)
apply (drule_tac x="u" in spec)
apply (drule_tac x="s" in spec)
apply (drule_tac x="t" in spec)
by (simp)
lemma par_tr_prefixE:
"[| prefix v u ; u : s |[X]|tr t ;
!! s' t'. [| v : s' |[X]|tr t' ; prefix s' s ; prefix t' t |] ==> R
|] ==> R"
apply (insert par_tr_prefix[of v u s X t])
by (auto)
lemma par_tr_lengtht_lm:
"ALL X u s t. u : s |[X]|tr t
--> lengtht s <= lengtht u & lengtht t <= lengtht u"
apply (rule allI)
apply (rule allI)
apply (induct_tac u rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (simp add: par_tr_head)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (simp)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (force)
apply (elim conjE exE)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (force)
done
lemma par_tr_lengtht:
"u : s |[X]|tr t ==> lengtht s <= lengtht u & lengtht t <= lengtht u"
by (simp add: par_tr_lengtht_lm)
lemma par_tr_lengthtE:
"[| u : s |[X]|tr t ;
[| lengtht s <= lengtht u ; lengtht t <= lengtht u|] ==> R |] ==> R"
by (simp add: par_tr_lengtht)
lemma par_tr_nil_Ev_rev:
"u : <> |[X]|tr (<Ev a> ^^^ t)
==> a ~: X & (EX v. u = <Ev a> ^^^ v & v : <> |[X]|tr t)"
apply (erule par_tr_elims)
by (simp_all add: par_tr_intros)
lemma par_tr_Tick_Ev_rev:
"u : <Tick> |[X]|tr (<Ev a> ^^^ t)
==> a ~: X & (EX v. u = <Ev a> ^^^ v & v : <Tick> |[X]|tr t)"
apply (erule par_tr_elims)
by (simp_all add: par_tr_intros)
lemma par_tr_noTick_only_if_lm:
"ALL s t. ( u : s |[X]|tr t & noTick s & noTick t ) --> noTick u"
apply (induct_tac u rule: induct_trace)
apply (simp)
apply (intro allI)
apply (case_tac "s ~= <Tick>", simp)
apply (case_tac "t ~= <Tick>", simp)
apply (simp)
apply (intro allI impI)
apply (elim conjE)
apply (simp add: par_tr_head)
apply (elim disjE conjE exE)
apply (auto)
done
lemma par_tr_noTick_only_if:
"[| u : s |[X]|tr t ; noTick s ; noTick t |] ==> noTick u"
apply (insert par_tr_noTick_only_if_lm[of u X])
apply (drule_tac x="s" in spec)
apply (drule_tac x="t" in spec)
by (simp)
lemma par_tr_noTick_if_lm:
"ALL s t. ( u : s |[X]|tr t & noTick u ) --> ( noTick s & noTick t )"
apply (induct_tac u rule: induct_trace)
apply (simp)
apply (simp)
apply (intro allI impI)
apply (elim conjE)
apply (erule par_tr_head_ifE)
apply (elim conjE exE disjE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (simp)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (simp)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (simp)
done
lemma par_tr_noTick_if:
"[| u : s |[X]|tr t ; noTick u |] ==> ( noTick s & noTick t )"
apply (insert par_tr_noTick_if_lm[of u X])
apply (drule_tac x="s" in spec)
apply (drule_tac x="t" in spec)
by (simp)
lemma par_tr_noTick:
"u : s |[X]|tr t ==> (noTick s & noTick t) = noTick u"
apply (rule iffI)
apply (simp add: par_tr_noTick_only_if)
apply (simp add: par_tr_noTick_if)
done
lemmas par_tr_noTick_compo = par_tr_noTick_only_if
lemmas par_tr_noTick_decompo = par_tr_noTick_if
lemma par_tr_nil_Tick[simp]:
"(u : <> |[X]|tr <Tick>) = False"
apply (induct_tac u rule: induct_trace)
by (simp_all add: par_tr_head)
lemma par_tr_Tick_nil[simp]:
"(u : <Tick> |[X]|tr <>) = False"
apply (induct_tac u rule: induct_trace)
by (simp_all add: par_tr_head)
lemma par_tr_nil_Ev_iff:
"u : <> |[X]|tr (<Ev a> ^^^ t)
= (a ~: X & (EX v. u = <Ev a> ^^^ v & v : <> |[X]|tr t))"
apply (rule iffI)
apply (rule par_tr_nil_Ev_rev)
apply (simp)
apply (elim conjE exE, simp)
apply (simp add: par_tr_nil_Ev)
done
lemma par_tr_Tick_Ev_iff:
"u : <Tick> |[X]|tr (<Ev a> ^^^ t)
= (a ~: X & (EX v. u = <Ev a> ^^^ v & v : <Tick> |[X]|tr t))"
apply (rule iffI)
apply (rule par_tr_Tick_Ev_rev)
apply (simp)
apply (elim conjE exE, simp)
apply (simp add: par_tr_Ev_right)
done
lemma par_tr_nil_left_only_if_imp:
"ALL u. (u : <> |[X]|tr s)
--> (u = s & Tick ~: sett u & sett u Int Ev ` X = {})"
apply (induct_tac s rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (simp add: par_tr_nil_Ev_iff)
apply (elim conjE exE)
apply (drule_tac x="v" in spec)
apply (auto)
done
lemma par_tr_nil_left_only_if:
"(u : <> |[X]|tr s)
==> u = s & Tick ~: sett u & sett u Int Ev ` X = {}"
apply (insert par_tr_nil_left_only_if_imp[of X s])
apply (drule_tac x="u" in spec)
apply (auto)
done
lemma par_tr_nil_left_if_imp:
"(Tick ~: sett u & sett u Int Ev ` X = {})
--> (u : <> |[X]|tr u)"
apply (induct_tac u rule: induct_trace)
by (auto simp add: par_tr_head)
lemma par_tr_nil_left_if:
"[| Tick ~: sett u ; sett u Int Ev ` X = {} |]
==> (u : <> |[X]|tr u)"
by (simp add: par_tr_nil_left_if_imp)
lemma par_tr_nil_left:
"(u : <> |[X]|tr s) = (u = s & Tick ~: sett u & sett u Int Ev ` X = {})"
apply (rule iffI)
apply (simp add: par_tr_nil_left_only_if)
apply (auto simp add: par_tr_nil_left_if)
done
lemma par_tr_nil_right:
"(u : s |[X]|tr <>) = (u = s & Tick ~: sett u & sett u Int Ev ` X = {})"
apply (simp add: par_tr_sym)
apply (simp add: par_tr_nil_left)
done
lemmas par_tr_nil = par_tr_nil_left par_tr_nil_right
lemma par_tr_Tick_left_only_if_imp:
"ALL u. u : <Tick> |[X]|tr s
--> (u = s & Tick : sett u & sett u Int Ev ` X = {})"
apply (induct_tac s rule: induct_trace)
apply (simp_all)
apply (simp add: image_def)
apply (intro allI impI)
apply (simp add: par_tr_Tick_Ev_iff)
apply (elim conjE exE)
apply (drule_tac x="v" in spec)
apply (auto)
done
lemma par_tr_Tick_left_only_if:
"(u : <Tick> |[X]|tr s)
==> u = s & Tick : sett u & sett u Int Ev ` X = {}"
apply (insert par_tr_Tick_left_only_if_imp[of X s])
apply (drule_tac x="u" in spec)
apply (auto)
done
lemma par_tr_Tick_left_if_imp:
"(Tick : sett u & sett u Int Ev ` X = {})
--> (u : <Tick> |[X]|tr u)"
apply (induct_tac u rule: induct_trace)
by (auto simp add: par_tr_head)
lemma par_tr_Tick_left_if:
"[| Tick : sett u ; sett u Int Ev ` X = {} |]
==> (u : <Tick> |[X]|tr u)"
by (simp add: par_tr_Tick_left_if_imp)
lemma par_tr_Tick_left:
"(u : <Tick> |[X]|tr s)
= (u = s & Tick : sett u & sett u Int Ev ` X = {})"
apply (rule iffI)
apply (simp add: par_tr_Tick_left_only_if)
apply (auto simp add: par_tr_Tick_left_if)
done
lemma par_tr_Tick_right:
"(u : s |[X]|tr <Tick>)
= (u = s & Tick : sett u & sett u Int Ev ` X = {})"
apply (simp add: par_tr_sym[of _ _ "<Tick>"])
apply (simp add: par_tr_Tick_left)
done
lemmas par_tr_Tick = par_tr_Tick_left par_tr_Tick_right
lemma par_tr_sett: "ALL s t. u : s |[X]|tr t --> sett u <= sett s Un sett t"
apply (induct_tac u rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (simp add: par_tr_head)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t'" in spec)
apply (force)
apply (erule disjE)
apply (elim conjE exE)
apply (drule_tac x="s'" in spec)
apply (drule_tac x="t" in spec)
apply (force)
apply (elim conjE exE)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t'" in spec)
apply (force)
done
lemma interleave_appt_left_lm:
"ALL u s t.
(u : s |[{}]|tr t & (noTick v))
--> v ^^^ u : (v ^^^ s) |[{}]|tr t"
apply (induct_tac v rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (simp)
apply (drule_tac x="u" in spec)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t" in spec)
apply (erule conjE)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
done
lemma interleave_appt_left_step:
"[| u : s |[{}]|tr t ; noTick v |] ==> v ^^^ u : (v ^^^ s) |[{}]|tr t"
by (simp add: interleave_appt_left_lm)
lemma interleave_appt_right_step:
"[| u : t |[{}]|tr s ; noTick v |] ==> v ^^^ u : t |[{}]|tr (v ^^^ s)"
apply (simp add: par_tr_sym)
apply (insert interleave_appt_left_step[of u s t v])
apply (simp add: par_tr_sym)
done
lemma interleave_appt_left_nil:
"[| u : <> |[{}]|tr t ; noTick v |] ==> v ^^^ u : v |[{}]|tr t"
apply (insert interleave_appt_left_step[of u <> t v])
by (simp)
lemma interleave_appt_right_nil:
"[| u : t |[{}]|tr <> ; noTick v |] ==> v ^^^ u : t |[{}]|tr v"
apply (insert interleave_appt_right_step[of u t <> v])
by (simp)
lemma interleave_appt_left_nil_nil:
"noTick t ==> t : t |[{}]|tr <>"
apply (insert interleave_appt_left_step[of <> <> <> t])
by (simp)
lemma interleave_appt_right_nil_nil:
"noTick t ==> t : <> |[{}]|tr t"
apply (insert interleave_appt_right_step[of <> <> <> t])
by (simp)
lemmas interleave_appt_left =
interleave_appt_left_step
interleave_appt_left_nil
interleave_appt_left_nil_nil
lemmas interleave_appt_right =
interleave_appt_right_step
interleave_appt_right_nil
interleave_appt_right_nil_nil
lemma par_tr_app_right[rule_format]:
"ALL u v s t.
(noTick u & sett u Int (Ev ` X) = {} & v : (s |[X]|tr t))
--> u ^^^ v : (s |[X]|tr (u ^^^ t))"
apply (rule)
apply (induct_tac u rule: induct_trace)
apply (simp_all)
apply (intro allI impI)
apply (elim exE conjE)
apply (drule_tac x="v" in spec)
apply (drule_tac x="sa" in spec)
apply (drule_tac x="t" in spec)
apply (simp)
apply (simp add: appt_assoc)
apply (simp add: par_tr_head)
apply (auto)
done
declare disj_not1 [simp]
end