theory Trace_seq
imports Prefix
begin
declare disj_not1 [simp del]
consts
rmTick:: "'a trace => 'a trace"
defs
rmTick_def :
"rmTick s == if noTick s then s else butlastt s"
lemma rmTick_nochange[simp]: "noTick s ==> rmTick s = s"
by (simp add: rmTick_def)
lemma rmTick_nil[simp]: "rmTick <> = <>"
by (simp add: rmTick_def)
lemma rmTick_Tick[simp]: "rmTick <Tick> = <>"
by (simp add: rmTick_def)
lemma noTick_rmTick[simp]: "noTick (rmTick s)"
apply (case_tac "noTick s")
apply (simp_all add: rmTick_def)
apply (simp add: noTick_butlast)
done
lemma noTick_rmTickE: "[| t = rmTick s ; noTick t ==> R |] ==> R"
by (simp)
lemma rmTick_last_Tick[simp]:
"noTick s ==> rmTick (s ^^^ <Tick>) = s"
by (simp add: rmTick_def)
lemma rmTick_butlastt:
"~ noTick s ==> rmTick s = butlastt s"
by (simp add: rmTick_def)
lemma rmTick_appt_dist[simp]:
"noTick s ==> rmTick (s ^^^ t) = s ^^^ (rmTick t)"
apply (insert trace_last_nil_or_unnil)
apply (drule_tac x="t" in spec, simp)
apply (erule disjE, simp)
apply (elim conjE exE, simp)
apply (insert event_Tick_or_Ev)
apply (drule_tac x="a" in spec)
apply (erule disjE)
apply (simp add: appt_assoc_sym)
apply (erule exE)
apply (simp add: appt_assoc_sym)
done
lemma rmTick_prefix_only_if:
"prefix s (rmTick t) ==> (EX u. prefix u t & s = rmTick u)"
apply (insert trace_last_nil_or_unnil)
apply (drule_tac x="t" in spec, simp)
apply (erule disjE, simp)
apply (elim conjE exE, simp)
apply (insert event_Tick_or_Ev)
apply (drule_tac x="a" in spec)
apply (erule disjE)
apply (rule_tac x="s" in exI)
apply (simp add: prefix_noTick)
apply (erule exE)
apply (simp)
apply (erule disjE)
apply (rule_tac x="sa ^^^ <Ev aa>" in exI, simp)
apply (rule_tac x="s" in exI)
apply (simp add: prefix_noTick)
done
lemma rmTick_prefix_if:
"(EX u. prefix u t & s = rmTick u) ==> prefix s (rmTick t)"
apply (elim conjE exE)
apply (simp)
apply (insert trace_last_nil_or_unnil)
apply (drule_tac x="t" in spec, simp)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (simp)
apply (erule disjE, simp)
apply (case_tac "~ noTick u")
apply (simp add: prefix_noTick)
apply (insert event_Tick_or_Ev)
apply (drule_tac x="a" in spec)
apply (erule disjE)
apply (simp)
apply (elim exE)
apply (simp)
done
lemma rmTick_prefix:
"prefix s (rmTick t) = (EX u. prefix u t & s = rmTick u)"
apply (rule iffI)
apply (simp add: rmTick_prefix_only_if)
apply (simp add: rmTick_prefix_if)
done
lemma rmTick_prefix_rev: "prefix s t ==> prefix (rmTick s) t"
apply (simp add: rmTick_def)
apply (intro impI)
apply (simp add: prefix_def)
apply (rule_tac x="<Tick>" in exI)
apply (simp add: noTick_butlast)
apply (simp add: Tick_decompo)
done
lemma rmTick_prefix_rev_simp[simp]: "prefix (rmTick s) s"
by (simp add: rmTick_prefix_rev)
declare disj_not1 [simp]
end