Theory OperationalCorrespondence
theory OperationalCorrespondence
imports SourceTargetRelation
begin
section ‹Operational Correspondence›
text ‹We consider different variants of operational correspondence. This criterion consists of a
completeness and a soundness condition and is often defined with respect to a relation TRel
on target terms. Operational completeness modulo TRel ensures that an encoding preserves
source term behaviour modulo TRel by requiring that each sequence of source term steps can be
mimicked by its translation such that the respective derivatives are related by TRel. The two
labelled variants differ in the requirements on labels. The former does not require any
relation between the label used in the source term steps and the one used in the target term
step, whereas the latter relates these label by the label encoding.›
abbreviation (in encoding) operational_complete :: "('procT × 'procT) set ⇒ bool" where
"operational_complete TRel ≡
∀S S'. S ⟼Source* S' ⟶ (∃T. ⟦S⟧ ⟼Target* T ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS) operational_complete :: "('procT × 'procT) set ⇒ bool" where
"operational_complete TRel ≡
∀S α S'. S ─⁀α→Source* S' ⟶ (∃β T. ⟦S⟧ ─⁀β→Target* T ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS_encL) operational_complete_encL :: "('procT × 'procT) set ⇒ bool"
where
"operational_complete_encL TRel ≡
∀S α S'. S ─⁀α→Source* S' ⟶ (∃β T. ⟦S⟧ ─⁀β→Target* T ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β)"
text ‹We call an encoding strongly operational complete modulo TRel if each source term step has to
be mimicked by single target term step of its translation.›
abbreviation (in encoding) strongly_operational_complete :: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_complete TRel ≡
∀S S'. S ⟼Source S' ⟶ (∃T. ⟦S⟧ ⟼Target T ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS) strongly_operational_complete :: "('procT × 'procT) set ⇒ bool"
where
"strongly_operational_complete TRel ≡
∀S α S'. S ─α→Source S' ⟶ (∃β T. ⟦S⟧ ─β→Target T ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS_encL) strongly_operational_complete_encL
:: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_complete_encL TRel ≡
∀S α S'. S ─α→Source S' ⟶ (∃β T. ⟦S⟧ ─β→Target T ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β)"
text ‹Operational soundness ensures that the encoding does not introduce new behaviour. An encoding
is weakly operational sound modulo TRel if each sequence of target term steps is part of the
translation of a sequence of source term steps such that the derivatives are related by TRel.
It allows for intermediate states on the translation of source term step that are not the
result of translating a source term.›
abbreviation (in encoding) weakly_operational_sound :: "('procT × 'procT) set ⇒ bool" where
"weakly_operational_sound TRel ≡
∀S T. ⟦S⟧ ⟼Target* T ⟶ (∃S' T'. S ⟼Source* S' ∧ T ⟼Target* T' ∧ (⟦S'⟧, T') ∈ TRel)"
abbreviation (in encodingLS) weakly_operational_sound :: "('procT × 'procT) set ⇒ bool" where
"weakly_operational_sound TRel ≡ ∀S β T. ⟦S⟧ ─⁀β→Target* T ⟶
(∃S' α T'. S ─⁀α→Source* S' ∧ T →Target* T' ∧ (⟦S'⟧, T') ∈ TRel)"
abbreviation (in encodingLS_encL) weakly_operational_sound_encL
:: "('procT × 'procT) set ⇒ bool" where
"weakly_operational_sound_encL TRel ≡ ∀S β T. ⟦S⟧ ─⁀β→Target* T ⟶
(∃S' α T'. S ─⁀α→Source* S' ∧ T →Target* T' ∧ (⟦S'⟧, T') ∈ TRel ∧ ⦉α⦊ = β)"
text ‹And encoding is operational sound modulo TRel if each sequence of target term steps is the
translation of a sequence of source term steps such that the derivatives are related by TRel.
This criterion does not allow for intermediate states, i.e., does not allow to reach a target
term from an encoded source term that is not related by TRel to the translation of a source
term.›
abbreviation (in encoding) operational_sound :: "('procT × 'procT) set ⇒ bool" where
"operational_sound TRel ≡ ∀S T. ⟦S⟧ ⟼Target* T ⟶ (∃S'. S ⟼Source* S' ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS) operational_sound :: "('procT × 'procT) set ⇒ bool" where
"operational_sound TRel ≡
∀S β T. ⟦S⟧ ─⁀β→Target* T ⟶ (∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS_encL) operational_sound_encL :: "('procT × 'procT) set ⇒ bool" where
"operational_sound_encL TRel ≡
∀S β T. ⟦S⟧ ─⁀β→Target* T ⟶ (∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β)"
text ‹Strong operational soundness modulo TRel is a stricter variant of operational soundness,
where a single target term step has to be mapped on a single source term step.›
abbreviation (in encoding) strongly_operational_sound :: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_sound TRel ≡
∀S T. ⟦S⟧ ⟼Target T ⟶ (∃S'. S ⟼Source S' ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS) strongly_operational_sound :: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_sound TRel ≡
∀S β T. ⟦S⟧ ─β→Target T ⟶ (∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel)"
abbreviation (in encodingLS_encL) strongly_operational_sound_encL
:: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_sound_encL TRel ≡
∀S β T. ⟦S⟧ ─β→Target T ⟶ (∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β)"
text ‹An encoding is weakly operational corresponding modulo TRel if it is operational complete and
weakly operational sound modulo TRel.›
abbreviation (in encoding) weakly_operational_corresponding :: "('procT × 'procT) set ⇒ bool"
where
"weakly_operational_corresponding TRel ≡
operational_complete TRel ∧ weakly_operational_sound TRel"
abbreviation (in encodingLS) weakly_operational_corresponding :: "('procT × 'procT) set ⇒ bool"
where
"weakly_operational_corresponding TRel ≡
operational_complete TRel ∧ weakly_operational_sound TRel"
abbreviation (in encodingLS_encL) weakly_operational_corresponding_encL
:: "('procT × 'procT) set ⇒ bool" where
"weakly_operational_corresponding_encL TRel ≡
operational_complete_encL TRel ∧ weakly_operational_sound_encL TRel"
text ‹Operational correspondence modulo TRel is the combination of operational completeness and
operational soundness modulo TRel.›
abbreviation (in encoding) operational_corresponding :: "('procT × 'procT) set ⇒ bool" where
"operational_corresponding TRel ≡ operational_complete TRel ∧ operational_sound TRel"
abbreviation (in encodingLS) operational_corresponding :: "('procT × 'procT) set ⇒ bool" where
"operational_corresponding TRel ≡ operational_complete TRel ∧ operational_sound TRel"
abbreviation (in encodingLS_encL) operational_corresponding_encL
:: "('procT × 'procT) set ⇒ bool" where
"operational_corresponding_encL TRel ≡
operational_complete_encL TRel ∧ operational_sound_encL TRel"
text ‹An encoding is strongly operational corresponding modulo TRel if it is strongly operational
complete and strongly operational sound modulo TRel.›
abbreviation (in encoding) strongly_operational_corresponding :: "('procT × 'procT) set ⇒ bool"
where
"strongly_operational_corresponding TRel ≡
strongly_operational_complete TRel ∧ strongly_operational_sound TRel"
abbreviation (in encodingLS) strongly_operational_corresponding :: "('procT × 'procT) set ⇒ bool"
where
"strongly_operational_corresponding TRel ≡
strongly_operational_complete TRel ∧ strongly_operational_sound TRel"
abbreviation (in encodingLS_encL) strongly_operational_corresponding_encL
:: "('procT × 'procT) set ⇒ bool" where
"strongly_operational_corresponding_encL TRel ≡
strongly_operational_complete_encL TRel ∧ strongly_operational_sound_encL TRel"
subsection ‹Trivial Operational Correspondence Results›
text ‹Every encoding is (weakly) operational corresponding modulo the all relation on target
terms, which is a weak reduction bisimulation.›
lemma (in encoding) operational_correspondence_modulo_all_relation:
shows "operational_complete {(T1, T2). True}"
and "weakly_operational_sound {(T1, T2). True}"
and "operational_sound {(T1, T2). True}"
using steps_refl[where Cal="Source"] steps_refl[where Cal="Target"]
by blast+
lemma all_relation_is_weak_reduction_bisimulation:
fixes Cal :: "'a processCalculus"
shows "weak_reduction_bisimulation {(a, b). True} Cal"
using steps_refl[where Cal="Cal"]
by blast
lemma (in encoding) operational_correspondence_modulo_some_target_relation:
shows "∃TRel. weakly_operational_corresponding TRel"
and "∃TRel. operational_corresponding TRel"
and "∃TRel. weakly_operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target"
and "∃TRel. operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target"
using operational_correspondence_modulo_all_relation
all_relation_is_weak_reduction_bisimulation[where Cal="Target"]
by blast+
text ‹Also in the labelled case without the requirement on encoded labels very encoding is (weakly)
operational corresponding modulo the all relation on target terms, but in this case the all
relation is not a bisumulation. For the case with encoded labels the all relation does not
imply operational correspondence.›
lemma (in encodingLS) operational_correspondence_modulo_all_relation:
shows "operational_complete {(T1, T2). True}"
and "weakly_operational_sound {(T1, T2). True}"
and "operational_sound {(T1, T2). True}"
proof auto
fix S α S'
have "⟦S⟧ ─⁀τ-Target→Target* ⟦S⟧"
using WTS_refl[of "⟦S⟧" Target]
unfolding weakLabelledStep_def
by simp
thus "∃β T'. ⟦S⟧ ─⁀β→Target* T'"
by blast
next
fix S β T'
have "S ─⁀τ-Source→Source* S"
using WTS_refl[of S Source]
unfolding weakLabelledStep_def
by simp
thus "∃S' α. S ─⁀α→Source* S'"
by blast
next
fix S β T'
have "T' →Target* T'"
using WTS_refl[of T' Target]
by simp
thus "∃T''. T' →Target* T''"
by blast
next
fix S β T'
have "S ─⁀τ-Source→Source* S"
using WTS_refl[of S Source]
unfolding weakLabelledStep_def
by simp
thus "∃α S'. S ─⁀α→Source* S'"
by blast
qed
lemma (in encodingLS) operational_correspondence_modulo_some_target_relation:
shows "∃TRel. weakly_operational_corresponding TRel"
and "∃TRel. operational_corresponding TRel"
using operational_correspondence_modulo_all_relation
by blast+
text ‹Strong operational correspondence requires that the source can perform a step iff their
translations can perform a step. Again the all relation is used as an example for a target
term relation that allows to obtain this result, i.e., again this results holds modulo a weak
reduction bisimulation.›
lemma (in encoding) strong_operational_correspondence_modulo_some_target_relation:
shows "(∃TRel. strongly_operational_corresponding TRel)
= (∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T))"
and "(∃TRel. strongly_operational_corresponding TRel
∧ weak_reduction_bisimulation TRel Target)
= (∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T))"
proof -
have A1: "∃TRel. strongly_operational_corresponding TRel
⟹ ∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T)"
by blast
moreover have A2: "∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T)
⟹ ∃TRel. strongly_operational_corresponding TRel
∧ weak_reduction_bisimulation TRel Target"
proof -
assume "∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T)"
hence "strongly_operational_corresponding {(T1, T2). True}"
by simp
thus "∃TRel. strongly_operational_corresponding TRel
∧ weak_reduction_bisimulation TRel Target"
using all_relation_is_weak_reduction_bisimulation[where Cal="Target"]
by blast
qed
ultimately show "(∃TRel. strongly_operational_corresponding TRel
∧ weak_reduction_bisimulation TRel Target)
= (∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T))"
by blast
from A1 A2 show "(∃TRel. strongly_operational_corresponding TRel)
= (∀S. (∃S'. S ⟼Source S') ⟷ (∃T. ⟦S⟧ ⟼Target T))"
by blast
qed
text ‹Strong operational correspondence requires that the source can perform a labelled step iff
their translations can perform a labelled step. Note that this results holds only for the
variant without a requirement on the labels. It does not hold for encoded labeles. Moreover,
again the all relation is used in this proof, which is not a bisumulation in the labelled
case.›
lemma (in encodingLS) strong_operational_correspondence_modulo_some_target_relation:
shows "(∃TRel. strongly_operational_corresponding TRel) =
(∀S. (∃α S'. S ─α→Source S') ⟷ (∃β T. ⟦S⟧ ─β→Target T))"
proof -
have "(∃TRel. strongly_operational_corresponding TRel)
⟹ (∀S. (∃α S'. S ─α→Source S') ⟷ (∃β T. ⟦S⟧ ─β→Target T))"
by blast
moreover have "(∀S. (∃α S'. S ─α→Source S') ⟷ (∃β T. ⟦S⟧ ─β→Target T))
⟹ strongly_operational_corresponding {(T1, T2). True}"
by simp
ultimately show "(∃TRel. strongly_operational_corresponding TRel)
= (∀S. (∃α S'. S ─α→Source S') ⟷ (∃β T. ⟦S⟧ ─β→Target T))"
by blast
qed
subsection ‹(Strong) Operational Completeness vs (Strong) Simulation›
text ‹An encoding is operational complete modulo a weak simulation on target terms TRel iff there
is a relation, like indRelRTPO, that relates at least all source terms to their literal
translations, includes TRel, and is a weak simulation. We show that also for the labelled
case without encoded labels we can conclude from the simulation to operational completeness.
Note, however, that such a weak labelled simulation without encoded labels that relates all
source terms with their literal translations usually does not exist. And indeed the if and
if result holds only for the reduction case or the labelled case with encoded labels.›
lemma (in encoding) weak_reduction_simulation_impl_OCom:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A3: "weak_reduction_simulation Rel (STCal Source Target)"
shows "operational_complete (TRel⇧*)"
proof clarify
fix S S'
from A1 have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ⟼Source* S'"
hence "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
ultimately obtain Q' where A5: "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q'"
and A6: "(SourceTerm S', Q') ∈ Rel"
using A3
by blast
from A5 obtain T where A7: "T ∈T Q'" and A8: "⟦S⟧ ⟼Target* T"
by (auto simp add: STCal_steps(2))
from A2 A6 A7 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A8 show "∃T. ⟦S⟧ ⟼Target* T ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS) weak_labelled_simulation_impl_OCom:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes encoding: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and target: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and simulation: "weak_labelled_simulation Rel (STLCal Source Target)"
shows "operational_complete (TRel⇧*)"
proof clarify
fix S β S'
obtain α where A1: "β ∈SL ⟨SourceTerm S, α⟩"
unfolding getSourceLabel_def
by blast
from encoding have A2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "S ─⁀β→Source* S'"
with A1 have "SourceTerm S ─⁀α→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α "SourceTerm S'"]
by blast
with simulation A2 obtain Q' where A3: "TargetTerm (⟦S⟧) ─⁀α→(STLCal Source Target)* Q'"
and A4: "(SourceTerm S', Q') ∈ Rel"
by blast
from A1 A3 obtain β' T where A5: "β' ∈TL ⟨TargetTerm (⟦S⟧), α⟩" and A6: "T ∈T Q'"
and A7: "⟦S⟧ ─⁀β'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" α Q']
by blast
from target A4 A6 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A7 show "∃β' T. ⟦S⟧ ─⁀β'→Target* T ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS_encL) weak_labelled_simulation_encL_impl_OCom:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes encoding: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and target: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and simulation: "weak_labelled_simulation_encL Rel"
shows "operational_complete_encL (TRel⇧*)"
proof clarify
fix S α' S'
obtain α where A1: "α' ∈SL ⟨SourceTerm S, α⟩"
unfolding getSourceLabel_def
by blast
from encoding have A2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "S ─⁀α'→Source* S'"
with A1 have "SourceTerm S ─⁀α→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α "SourceTerm S'"]
by blast
with simulation A2 obtain β Q' where A3: "TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* Q'"
and A4: "(SourceTerm S', Q') ∈ Rel"
and A5: "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
from A3 obtain β' T where A6: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩" and A7: "T ∈T Q'"
and A8: "⟦S⟧ ─⁀β'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β Q']
by blast
from target A4 A7 have A9: "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
from A1 A5 A6 have "⦉α'⦊ = β'"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A8 A9 show "∃β' T. ⟦S⟧ ─⁀β'→Target* T ∧ (⟦S'⟧, T) ∈ TRel⇧* ∧ ⦉α'⦊ = β'"
by blast
qed
lemma (in encoding) OCom_iff_indRelRTPO_is_weak_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_complete (TRel⇧*) ∧ weak_reduction_simulation (TRel⇧+) Target)
= weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume oc: "operational_complete (TRel⇧*)"
and sim: "weak_reduction_simulation (TRel⇧+) Target"
show "weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
proof clarify
fix P Q P'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "P ⟼(STCal Source Target)* P'"
thus "∃Q'. Q ⟼(STCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
proof (induct arbitrary: P')
case (encR S)
assume "SourceTerm S ⟼(STCal Source Target)* P'"
from this obtain S' where A1: "S' ∈S P'" and A2: "S ⟼Source* S'"
by (auto simp add: STCal_steps(1))
from oc A2 obtain T where A3: "⟦S⟧ ⟼Target* T" and A4: "(⟦S'⟧, T) ∈ TRel⇧*"
by blast
from A3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
moreover have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
from A4 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover from A1 have A5: "P' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
hence "⟦S'⟧ = T ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof induct
fix T
assume "(⟦S'⟧, T) ∈ TRel"
thus "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with A5 show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
qed
ultimately show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by blast
qed
ultimately
show "∃Q'. TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (source S)
then obtain S' where B1: "S' ∈S P'"
by (auto simp add: STCal_steps(1))
hence "P' ≲⟦⋅⟧RT<TRel> P'"
by (simp add: indRelRTPO.source)
with source show "∃Q'. SourceTerm S ⟼(STCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ⟼(STCal Source Target)* P'"
from this obtain T1' where C1: "T1' ∈T P'" and C2: "T1 ⟼Target* T1'"
by (auto simp add: STCal_steps(2))
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with C2 sim obtain T2' where C3: "T2 ⟼Target* T2'" and C4: "(T1', T2') ∈ TRel⇧+"
by blast
from C3 have "TargetTerm T2 ⟼(STCal Source Target)* (TargetTerm T2')"
by (simp add: STCal_steps(2))
moreover from C4 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
proof induct
fix T2'
assume "(T1', T2') ∈ TRel"
thus "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with C1 have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by simp
ultimately show "∃Q'. TargetTerm T2 ⟼(STCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (trans P Q R)
assume "P ⟼(STCal Source Target)* P'"
and "⋀P'. P ⟼(STCal Source Target)* P'
⟹ ∃Q'. Q ⟼(STCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
from this obtain Q' where D1: "Q ⟼(STCal Source Target)* Q'" and D2: "P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target)* Q'
⟹ ∃R'. R ⟼(STCal Source Target)* R' ∧ Q' ≲⟦⋅⟧RT<TRel> R'"
with D1 obtain R' where D3: "R ⟼(STCal Source Target)* R'" and D4: "Q' ≲⟦⋅⟧RT<TRel> R'"
by blast
from D2 D4 have "P' ≲⟦⋅⟧RT<TRel> R'"
by (rule indRelRTPO.trans)
with D3 show "∃R'. R ⟼(STCal Source Target)* R' ∧ P' ≲⟦⋅⟧RT<TRel> R'"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
ultimately have "operational_complete (TRel⇧*)"
using weak_reduction_simulation_impl_OCom[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "weak_reduction_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_weak_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "operational_complete (TRel⇧*) ∧ weak_reduction_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingLS_encL) OCom_iff_indRelRTPO_is_weak_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_complete_encL (TRel⇧*) ∧ weak_labelled_simulation (TRel⇧+) Target) =
(weak_labelled_simulation_encL (indRelRTPO TRel))"
proof (rule iffI, erule conjE)
assume oc: "operational_complete_encL (TRel⇧*)" and sim: "weak_labelled_simulation (TRel⇧+) Target"
show "weak_labelled_simulation_encL (indRelRTPO TRel)"
proof auto
fix P Q α P'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "P ─⁀α→(STLCal Source Target)* P'"
thus "∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "SourceTerm S ─⁀α→(STLCal Source Target)* P'"
from this obtain α' S' where A1: "α' ∈SL ⟨SourceTerm S, α⟩" and A2: "S' ∈S P'"
and A3: "S ─⁀α'→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α P']
by blast
from oc A3 obtain β' T where A4: "⟦S⟧ ─⁀β'→Target* T" and A5: "(⟦S'⟧, T) ∈ TRel⇧*"
and A6: "⦉α'⦊ = β'"
by blast
obtain β where A7: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩"
unfolding getTargetLabel_def
by blast
with A4 have A8: "TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β "TargetTerm T"]
by blast
moreover have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
from A5 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover from A2 have B: "P' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
hence "⟦S'⟧ = T ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof induct
fix T
assume "(⟦S'⟧, T) ∈ TRel"
thus "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with B show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
qed
ultimately show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by blast
qed
moreover from A1 A6 A7 have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def encLST_def
by blast
ultimately show "∃β Q'. TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* Q' ∧
P' ≲⟦⋅⟧RT<TRel> Q' ∧ ⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (source S)
assume A1: "SourceTerm S ─⁀α→(STLCal Source Target)* P'"
then obtain S' where "S' ∈S P'"
using STLCal_weakLabelledSteps(1)[of S α P']
by blast
hence A2: "P' ≲⟦⋅⟧RT<TRel> P'"
by (simp add: indRelRTPO.source)
have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, α⟩"
unfolding related_labels_def
by simp
with A1 A2 show "∃β Q'. SourceTerm S ─⁀β→(STLCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ─⁀α→(STLCal Source Target)* P'"
from this obtain α' T1' where C1: "α' ∈TL ⟨TargetTerm T1, α⟩" and C2: "T1' ∈T P'"
and C3: "T1 ─⁀α'→Target* T1'"
using STLCal_weakLabelledSteps(2)[of T1 α P']
by blast
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with C3 sim obtain T2' where C4: "T2 ─⁀α'→Target* T2'" and C5: "(T1', T2') ∈ TRel⇧+"
by blast
from C1 C4 have "TargetTerm T2 ─⁀α→(STLCal Source Target)* (TargetTerm T2')"
using STLCal_weakLabelledSteps(2)[of T2 α "TargetTerm T2'"]
unfolding getTargetLabel_def
by blast
moreover from C5 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
proof induct
fix T2'
assume "(T1', T2') ∈ TRel"
thus "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with C2 have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by simp
moreover have "⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T2 ─⁀β→(STLCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans P Q R)
assume "P ─⁀α→(STLCal Source Target)* P'"
and "⋀α P'. P ─⁀α→(STLCal Source Target)* P' ⟹
∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─⁀β→(STLCal Source Target)* Q'" and A2: "P' ≲⟦⋅⟧RT<TRel> Q'"
and A3: "⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀α Q'. Q ─⁀α→(STLCal Source Target)* Q' ⟹
∃β R'. R ─⁀β→(STLCal Source Target)* R' ∧ Q' ≲⟦⋅⟧RT<TRel> R' ∧ ⟨Q, α⟩ ≡⦇⦈ ⟨R, β⟩"
with A1 obtain γ R' where A4: "R ─⁀γ→(STLCal Source Target)* R'"
and A5: "Q' ≲⟦⋅⟧RT<TRel> R'" and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
from A2 A5 have A7: "P' ≲⟦⋅⟧RT<TRel> R'"
by (rule indRelRTPO.trans)
assume "P ≲⟦⋅⟧RT<TRel> Q" and "Q ≲⟦⋅⟧RT<TRel> R"
with A3 A6 have "⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
using related_labels_trans_no_T_to_S[of P α Q β R γ] indRelRTPO_to_TRel(3)[of P Q TRel]
indRelRTPO_to_TRel(3)[of Q R TRel]
by blast
with A4 A7
show "∃γ R'. R ─⁀γ→(STLCal Source Target)* R' ∧ P' ≲⟦⋅⟧RT<TRel> R' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "weak_labelled_simulation_encL (indRelRTPO TRel)"
ultimately have "operational_complete_encL (TRel⇧*)"
using weak_labelled_simulation_encL_impl_OCom[of "indRelRTPO TRel" "TRel"]
by simp
moreover from sim have "weak_labelled_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_weak_labelled_simulation_encL[of "TRel"]
by simp
ultimately show "operational_complete_encL (TRel⇧*) ∧ weak_labelled_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) OCom_iff_weak_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_complete (TRel⇧*)
∧ weak_reduction_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_complete (TRel⇧*)"
and "weak_reduction_simulation (TRel⇧+) Target"
hence "weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using OCom_iff_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_reduction_simulation Rel (STCal Source Target)"
by blast
from A1 A4 A5 have "operational_complete (TRel⇧*)"
using weak_reduction_simulation_impl_OCom[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_reduction_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_weak_reduction_simulation[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "operational_complete (TRel⇧*)
∧ weak_reduction_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingLS_encL) OCom_iff_weak_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_complete_encL (TRel⇧*) ∧ weak_labelled_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL Rel)"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_complete_encL (TRel⇧*)" and "weak_labelled_simulation (TRel⇧+) Target"
hence "weak_labelled_simulation_encL (indRelRTPO TRel)"
using OCom_iff_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_labelled_simulation_encL Rel"
by blast
from A1 A4 A5 have "operational_complete_encL (TRel⇧*)"
using weak_labelled_simulation_encL_impl_OCom[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_labelled_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_weak_labelled_simulation_encL[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "operational_complete_encL (TRel⇧*) ∧ weak_labelled_simulation (TRel⇧+) Target"
by simp
qed
text ‹An encoding is strongly operational complete modulo a strong simulation on target terms TRel
iff there is a relation, like indRelRTPO, that relates at least all source terms to their
literal translations, includes TRel, and is a strong simulation. As for the weak version
above this holds for the reduction case and the labelled case with encoded labels.›
lemma (in encoding) strong_reduction_simulation_impl_SOCom:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "strong_reduction_simulation Rel (STCal Source Target)"
shows "strongly_operational_complete (TRel⇧*)"
proof clarify
fix S S'
from rel have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ⟼Source S'"
hence "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
ultimately obtain Q' where A1: "TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q'"
and A2: "(SourceTerm S', Q') ∈ Rel"
using sim
by blast
from A1 obtain T where A3: "T ∈T Q'" and A4: "⟦S⟧ ⟼Target T"
by (auto simp add: STCal_step(2))
from trel A2 A3 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A4 show "∃T. ⟦S⟧ ⟼Target T ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS) strong_labelled_simulation_impl_SOCom:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "strong_labelled_simulation Rel (STLCal Source Target)"
shows "strongly_operational_complete (TRel⇧*)"
proof clarify
fix S α S'
obtain α' where A1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
from rel have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ─α→Source S'"
with A1 have "SourceTerm S ─α'→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S α' "SourceTerm S'"]
by blast
ultimately obtain β' Q' where A2: "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) Q'"
and A3: "(SourceTerm S', Q') ∈ Rel"
using sim
by blast
from A2 obtain β T where A4: "T ∈T Q'" and A5: "⟦S⟧ ─β→Target T"
and A6: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
using STLCal_labelledStep(2)[of "⟦S⟧" β' Q']
by blast
from trel A3 A4 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A5 show "∃β T. ⟦S⟧ ─β→Target T ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS_encL) strong_labelled_simulation_impl_SOCom_encL:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "strong_labelled_simulation_encL Rel"
shows "strongly_operational_complete_encL (TRel⇧*)"
proof clarify
fix S α S'
obtain α' where A1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
from rel have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ─α→Source S'"
with A1 have "SourceTerm S ─α'→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S α' "SourceTerm S'"]
by blast
ultimately obtain β' Q' where A2: "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) Q'"
and A3: "(SourceTerm S', Q') ∈ Rel"
and A4: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
using sim
by blast
from A2 obtain β T where A5: "T ∈T Q'" and A6: "⟦S⟧ ─β→Target T"
and A7: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
using STLCal_labelledStep(2)[of "⟦S⟧" β' Q']
by blast
from trel A3 A5 have A8: "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
from A1 A4 A7 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by auto
with A6 A8 show "∃β T. ⟦S⟧ ─β→Target T ∧ (⟦S'⟧, T) ∈ TRel⇧* ∧ ⦉α⦊ = β"
by blast
qed
lemma (in encoding) SOCom_iff_indRelRTPO_is_strong_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target)
= strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume soc: "strongly_operational_complete (TRel⇧*)"
and sim: "strong_reduction_simulation (TRel⇧+) Target"
show "strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
proof clarify
fix P Q P'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "P ⟼(STCal Source Target) P'"
thus "∃Q'. Q ⟼(STCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
proof (induct arbitrary: P')
case (encR S)
assume "SourceTerm S ⟼(STCal Source Target) P'"
from this obtain S' where A1: "S' ∈S P'" and A2: "S ⟼Source S'"
by (auto simp add: STCal_step(1))
from soc A2 obtain T where A3: "⟦S⟧ ⟼Target T" and A4: "(⟦S'⟧, T) ∈ TRel⇧*"
by blast
from A3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
moreover have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
from A4 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover from A1 have A5: "P' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
hence "⟦S'⟧ = T ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof induct
fix TQ
assume "(⟦S'⟧, TQ) ∈ TRel"
thus "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with A5 show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
qed
ultimately show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by blast
qed
ultimately
show "∃Q'. TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (source S)
then obtain S' where B1: "S' ∈S P'"
by (auto simp add: STCal_step(1))
hence "P' ≲⟦⋅⟧RT<TRel> P'"
by (simp add: indRelRTPO.source)
with source show "∃Q'. SourceTerm S ⟼(STCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ⟼(STCal Source Target) P'"
from this obtain T1' where C1: "T1' ∈T P'" and C2: "T1 ⟼Target T1'"
by (auto simp add: STCal_step(2))
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with C2 sim obtain T2' where C3: "T2 ⟼Target T2'" and C4: "(T1', T2') ∈ TRel⇧+"
by blast
from C3 have "TargetTerm T2 ⟼(STCal Source Target) (TargetTerm T2')"
by (simp add: STCal_step(2))
moreover from C4 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
proof induct
fix T2'
assume "(T1', T2') ∈ TRel"
thus "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with C1 have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by simp
ultimately show "∃Q'. TargetTerm T2 ⟼(STCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
next
case (trans P Q R)
assume "P ⟼(STCal Source Target) P'"
and "⋀P'. P ⟼(STCal Source Target) P'
⟹ ∃Q'. Q ⟼(STCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q'"
from this obtain Q' where D1: "Q ⟼(STCal Source Target) Q'"
and D2: "P' ≲⟦⋅⟧RT<TRel> Q'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target) Q'
⟹ ∃R'. R ⟼(STCal Source Target) R' ∧ Q' ≲⟦⋅⟧RT<TRel> R'"
with D1 obtain R' where D3: "R ⟼(STCal Source Target) R'"
and D4: "Q' ≲⟦⋅⟧RT<TRel> R'"
by blast
from D2 D4 have "P' ≲⟦⋅⟧RT<TRel> R'"
by (rule indRelRTPO.trans)
with D3 show "∃R'. R ⟼(STCal Source Target) R' ∧ P' ≲⟦⋅⟧RT<TRel> R'"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
ultimately have "strongly_operational_complete (TRel⇧*)"
using strong_reduction_simulation_impl_SOCom[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "strong_reduction_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_strong_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingLS_encL) SOCom_iff_indRelRTPO_is_strong_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target)
= strong_labelled_simulation_encL (indRelRTPO TRel)"
proof (rule iffI, erule conjE)
assume soc: "strongly_operational_complete_encL (TRel⇧*)"
and sim: "strong_labelled_simulation (TRel⇧+) Target"
show "strong_labelled_simulation_encL (indRelRTPO TRel)"
proof clarify
fix P Q α P'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "P ─α→(STLCal Source Target) P'"
thus "∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "SourceTerm S ─α→(STLCal Source Target) P'"
from this obtain α' S' where A1: "α' ∈SL ⟨SourceTerm S, α⟩" and A2: "S' ∈S P'"
and A3: "S ─α'→Source S'"
using STLCal_labelledStep(1)[of S α P']
by blast
from soc A3 obtain β' T where A4: "⟦S⟧ ─β'→Target T" and A5: "(⟦S'⟧, T) ∈ TRel⇧*"
and A6: "⦉α'⦊ = β'"
by blast
obtain β where A7: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩"
unfolding getTargetLabel_def
by blast
with A4 have "TargetTerm (⟦S⟧) ─β→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β "TargetTerm T"]
by blast
moreover have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
from A5 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover from A2 have B: "P' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
hence "⟦S'⟧ = T ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
proof induct
fix TQ
assume "(⟦S'⟧, TQ) ∈ TRel"
thus "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with B show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
qed
ultimately show "P' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by blast
qed
moreover from A1 A6 A7 have "⦇SourceTerm S, α⦈↦⟨TargetTerm (⟦S⟧), β⟩"
unfolding encLST_def
by blast
hence "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm (⟦S⟧) ─β→(STLCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (source S)
assume A1: "SourceTerm S ─α→(STLCal Source Target) P'"
then obtain S' where "S' ∈S P'"
using STLCal_labelledStep(1)[of S α P']
by blast
hence A2: "P' ≲⟦⋅⟧RT<TRel> P'"
by (simp add: indRelRTPO.source)
have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, α⟩"
unfolding related_labels_def
by simp
with A1 A2 show "∃β Q'. SourceTerm S ─β→(STLCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ─α→(STLCal Source Target) P'"
from this obtain α' T1' where A1: "α' ∈TL ⟨TargetTerm T1, α⟩" and A2: "T1' ∈T P'"
and A3: "T1 ─α'→Target T1'"
using STLCal_labelledStep(2)[of T1 α P']
by blast
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with A3 sim obtain T2' where A4: "T2 ─α'→Target T2'" and A5: "(T1', T2') ∈ TRel⇧+"
by blast
from A1 A4 have "TargetTerm T2 ─α→(STLCal Source Target) (TargetTerm T2')"
using STLCal_labelledStep(2)[of T2 α "TargetTerm T2'"]
unfolding getTargetLabel_def
by blast
moreover from A5 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
proof induct
fix T2'
assume "(T1', T2') ∈ TRel"
thus "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule indRelRTPO.target)
next
case (step TQ TR)
assume "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
moreover assume "(TQ, TR) ∈ TRel"
hence "TargetTerm TQ ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.target)
ultimately show "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm TR"
by (rule indRelRTPO.trans)
qed
with A2 have "P' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by simp
moreover have "⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T2 ─β→(STLCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans P Q R)
assume "P ─α→(STLCal Source Target) P'"
and "⋀α P'. P ─α→(STLCal Source Target) P' ⟹
∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ P' ≲⟦⋅⟧RT<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─β→(STLCal Source Target) Q'" and A2: "P' ≲⟦⋅⟧RT<TRel> Q'"
and A3: "⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀β Q'. Q ─β→(STLCal Source Target) Q' ⟹
∃γ R'. R ─γ→(STLCal Source Target) R' ∧ Q' ≲⟦⋅⟧RT<TRel> R' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
with A1 obtain γ R' where A4: "R ─γ→(STLCal Source Target) R'" and A5: "Q' ≲⟦⋅⟧RT<TRel> R'"
and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
from A2 A5 have A7: "P' ≲⟦⋅⟧RT<TRel> R'"
by (rule indRelRTPO.trans)
assume "P ≲⟦⋅⟧RT<TRel> Q"
hence A8: "¬(P ∈ ProcT ∧ Q ∈ ProcS)"
using indRelRTPO_to_TRel(3)[of P Q TRel]
by blast
assume "Q ≲⟦⋅⟧RT<TRel> R"
hence "¬(Q ∈ ProcT ∧ R ∈ ProcS)"
using indRelRTPO_to_TRel[of Q R TRel]
by blast
with A3 A6 A8 have "⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
using related_labels_trans_no_T_to_S[of P α Q β R γ]
by simp
with A4 A7
show "∃γ R'. R ─γ→(STLCal Source Target) R' ∧ P' ≲⟦⋅⟧RT<TRel> R' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "strong_labelled_simulation_encL (indRelRTPO TRel)"
ultimately have "strongly_operational_complete_encL (TRel⇧*)"
using strong_labelled_simulation_impl_SOCom_encL[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "strong_labelled_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) SOCom_iff_strong_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_complete (TRel⇧*)"
and "strong_reduction_simulation (TRel⇧+) Target"
hence "strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using SOCom_iff_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_reduction_simulation Rel (STCal Source Target)"
by blast
from A1 A4 A5 have "strongly_operational_complete (TRel⇧*)"
using strong_reduction_simulation_impl_SOCom[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "strong_reduction_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_strong_reduction_simulation[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingLS_encL) SOCom_iff_strong_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL Rel)"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_complete_encL (TRel⇧*)"
and "strong_labelled_simulation (TRel⇧+) Target"
hence "strong_labelled_simulation_encL (indRelRTPO TRel)"
using SOCom_iff_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL Rel"
then obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_labelled_simulation_encL Rel"
by blast
from A1 A4 A5 have "strongly_operational_complete_encL (TRel⇧*)"
using strong_labelled_simulation_impl_SOCom_encL[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "strong_labelled_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_strong_labelled_simulation_encL[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingFunction) target_relation_from_source_target_relation:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
assumes stre: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧="
shows "∃TRel. (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)"
proof -
define TRel where "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
from TRel_def have "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
by simp
moreover from TRel_def
have "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
by blast
moreover from stre TRel_def
have "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
by blast
ultimately show ?thesis
by blast
qed
lemma (in encoding) SOCom_modulo_TRel_iff_strong_reduction_simulation:
shows "(∃TRel. strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation Rel (STCal Source Target))"
proof (rule iffI)
assume "∃TRel. strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
from this obtain TRel where "strongly_operational_complete (TRel⇧*)"
and "strong_reduction_simulation (TRel⇧+) Target"
by blast
hence "strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using SOCom_iff_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
moreover have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)"
and A3: "strong_reduction_simulation Rel (STCal Source Target)"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3 have "strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
using SOCom_iff_strong_reduction_simulation[where TRel="TRel"]
by blast
thus "∃TRel. strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
by blast
qed
lemma (in encodingLS_encL) SOCom_modulo_TRel_iff_strong_labelled_simulation_encL:
shows "(∃TRel. strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL Rel)"
proof (rule iffI)
assume "∃TRel. strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
from this obtain TRel where "strongly_operational_complete_encL (TRel⇧*)"
and "strong_labelled_simulation (TRel⇧+) Target"
by blast
hence "strong_labelled_simulation_encL (indRelRTPO TRel)"
using SOCom_iff_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL Rel"
then obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)"
and A3: "strong_labelled_simulation_encL Rel"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3 have "strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
using SOCom_iff_strong_labelled_simulation_encL[where TRel="TRel"]
by blast
thus "∃TRel. strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
by blast
qed
subsection ‹Weak Operational Soundness vs Contrasimulation›
text ‹If the inverse of a relation that includes TRel and relates source terms and their literal
translations is a contrasimulation, then the encoding is weakly operational sound. Note that
this result does not hold in the labelled case without encoded labels, because
contrasimulation will relate a given sequences of steps in the target with a single label on
an arbitrary long sequence in the source. Without the relation on encoded labels, we cannot
conclude that the sequence of steps in the source consists only of a single label.›
lemma (in encoding) weak_reduction_contrasimulation_impl_WOSou:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A3: "weak_reduction_contrasimulation (Rel¯) (STCal Source Target)"
shows "weakly_operational_sound (TRel⇧*)"
proof clarify
fix S T
from A1 have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ⟼Target* T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
ultimately obtain Q' where A5: "SourceTerm S ⟼(STCal Source Target)* Q'"
and A6: "(Q', TargetTerm T) ∈ Rel¯"
using A3
by blast
from A5 obtain S' where A7: "S' ∈S Q'" and A8: "S ⟼Source* S'"
by (auto simp add: STCal_steps(1))
have "Q' ⟼(STCal Source Target)* Q'"
by (simp add: steps_refl)
with A6 A3 obtain P'' where A9: "TargetTerm T ⟼(STCal Source Target)* P''"
and A10: "(P'', Q') ∈ Rel¯"
by blast
from A9 obtain T' where A11: "T' ∈T P''" and A12: "T ⟼Target* T'"
by (auto simp add: STCal_steps(2))
from A10 have "(Q', P'') ∈ Rel"
by induct
with A2 A7 A11 have "(⟦S'⟧, T') ∈ TRel⇧*"
by simp
with A8 A12 show "∃S' T'. S ⟼Source* S' ∧ T ⟼Target* T' ∧ (⟦S'⟧, T') ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS_encL) weak_labelled_contrasimulation_impl_WOSou_encL:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "weak_labelled_contrasimulation_encL (Rel¯)"
shows "weakly_operational_sound_encL (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from rel have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
hence "TargetTerm (⟦S⟧) ─⌢[β']→(STLCal Source Target)* (TargetTerm T)"
using weakLabelledSequence_single[of "TargetTerm (⟦S⟧)" β' "STLCal Source Target"
"TargetTerm T"]
by simp
ultimately obtain v P' where A2: "SourceTerm S ─⌢v→(STLCal Source Target)* P'"
and A3: "(P', TargetTerm T) ∈ Rel¯"
and A4: "⟨TargetTerm (⟦S⟧), [β']⟩ ≡⦇⦈* ⟨SourceTerm S, v⟩"
using sim
by blast
from A4 have A5: "length v = 1"
using related_words_length[of "TargetTerm (⟦S⟧)" "[β']" "SourceTerm S" v]
by simp
from A4 have "⦇SourceTerm S, v⦈↦*⟨TargetTerm (⟦S⟧), [β']⟩"
using kinds_of_encoded_word(1)[of "TargetTerm (⟦S⟧)" "[β']" "SourceTerm S" v]
unfolding related_words_def
by blast
with A5 obtain α' P'' Q'' where A6: "v = [α']" and A7: "⦇P'', α'⦈↦⟨Q'', β'⟩"
using encoded_word_decompose[of "SourceTerm S" v "TargetTerm (⟦S⟧)" "[β']"]
by auto
from A2 A6 obtain α S' where A8: "α ∈SL ⟨SourceTerm S, α'⟩" and A9: "S' ∈S P'"
and A10: "S ─⁀α→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α' P']
weakLabelledSequence_single_rev[of "SourceTerm S" α' "STLCal Source Target" P']
by blast
have "P' ─⌢[]→(STLCal Source Target)* P'"
using WTS_refl[of P' "STLCal Source Target"] WLS_Nil[of P' "STLCal Source Target" P']
by simp
with sim A3 obtain w Q' where A11: "TargetTerm T ─⌢w→(STLCal Source Target)* Q'"
and A12: "(Q', P') ∈ Rel¯"
and A13: "⟨P', []⟩ ≡⦇⦈* ⟨TargetTerm T, w⟩"
by blast
from A13 have "w = []"
using related_words_length[of P' "[]" "TargetTerm T" w]
by simp
with A11 have "TargetTerm T →(STLCal Source Target)* Q'"
using weakLabelledSequence_decompose(1)[of "TargetTerm T" w "STLCal Source Target" Q']
by simp
then obtain T' where A14: "T' ∈T Q'" and A15: "T →Target* T'"
using STLCal_weakTauSteps(2)[of T Q']
by blast
from A12 have "(P', Q') ∈ Rel"
by induct
with trel A9 A14 have A16: "(⟦S'⟧, T') ∈ TRel⇧*"
by simp
from A1 A7 A8 have "⦉α⦊ = β"
unfolding encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A10 A15 A16
show "∃S' α T'. S ─⁀α→Source* S' ∧ T →Target* T' ∧ (⟦S'⟧, T') ∈ TRel⇧* ∧ ⦉α⦊ = β"
by blast
qed
subsection ‹(Strong) Operational Soundness vs (Strong) Simulation›
text ‹An encoding is operational sound modulo a relation TRel whose inverse is a weak reduction
simulation on target terms iff there is a relation, like indRelRTPO, that relates at least
all source terms to their literal translations, includes TRel, and whose inverse is a weak
simulation.›
lemma (in encoding) weak_reduction_simulation_impl_OSou:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A3: "weak_reduction_simulation (Rel¯) (STCal Source Target)"
shows "operational_sound (TRel⇧*)"
proof clarify
fix S T
from A1 have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ⟼Target* T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
ultimately obtain Q' where A5: "SourceTerm S ⟼(STCal Source Target)* Q'"
and A6: "(TargetTerm T, Q') ∈ Rel¯"
using A3
by blast
from A5 obtain S' where A7: "S' ∈S Q'" and A8: "S ⟼Source* S'"
by (auto simp add: STCal_steps(1))
from A6 have "(Q', TargetTerm T) ∈ Rel"
by induct
with A2 A7 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A8 show "∃S'. S ⟼Source* S' ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS) weak_labelled_simulation_impl_OSou:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "weak_labelled_simulation (Rel¯) (STLCal Source Target)"
shows "operational_sound (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from rel have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
ultimately obtain P' where A2: "SourceTerm S ─⁀β'→(STLCal Source Target)* P'"
and A3: "(TargetTerm T, P') ∈ Rel¯"
using sim
by blast
from A2 obtain β'' S' where A4: "β'' ∈SL ⟨SourceTerm S, β'⟩" and A5: "S' ∈S P'"
and A6: "S ─⁀β''→Source* S'"
using STLCal_weakLabelledSteps(1)[of S β' P']
by blast
from A3 have "(P', TargetTerm T) ∈ Rel"
by induct
with trel A5 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A6 show "∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS_encL) weak_labelled_simulation_impl_OSou_encL:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "weak_labelled_simulation_encL (Rel¯)"
shows "operational_sound_encL (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from rel have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
ultimately obtain α' P' where A2: "SourceTerm S ─⁀α'→(STLCal Source Target)* P'"
and A3: "(TargetTerm T, P') ∈ Rel¯"
and A4: "⟨TargetTerm (⟦S⟧), β'⟩ ≡⦇⦈ ⟨SourceTerm S, α'⟩"
using sim
by blast
from A2 obtain α S' where A5: "α ∈SL ⟨SourceTerm S, α'⟩" and A6: "S' ∈S P'"
and A7: "S ─⁀α→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α' P']
by blast
from A3 have "(P', TargetTerm T) ∈ Rel"
by induct
with trel A6 have A8: "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
from A4 have "⦇SourceTerm S, α'⦈↦⟨TargetTerm (⟦S⟧), β'⟩"
using kinds_of_encoded_label(1)[of "TargetTerm (⟦S⟧)" β' "SourceTerm S" α']
unfolding related_labels_def
by blast
with A1 A5 have "⦉α⦊ = β"
unfolding encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A7 A8 show "∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel⇧* ∧ ⦉α⦊ = β"
by blast
qed
lemma (in encoding) OSou_iff_inverse_of_indRelRTPO_is_weak_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_sound (TRel⇧*)
∧ weak_reduction_simulation ((TRel⇧+)¯) Target)
= weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume os: "operational_sound (TRel⇧*)"
and sim: "weak_reduction_simulation ((TRel⇧+)¯) Target"
show "weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
proof clarify
fix P Q P'
assume "Q ≲⟦⋅⟧RT<TRel> P" and "P ⟼(STCal Source Target)* P'"
thus "∃Q'. Q ⟼(STCal Source Target)* Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
proof (induct arbitrary: P')
case (encR S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* P'"
from this obtain T where A1: "T ∈T P'" and A2: "⟦S⟧ ⟼Target* T"
by (auto simp add: STCal_steps(2))
from os A2 obtain S' where A3: "S ⟼Source* S'" and A4: "(⟦S'⟧, T) ∈ TRel⇧*"
by blast
from A3 have "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
from A4 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover have A5: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
with A1 have "⟦S'⟧ = T ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with A5 have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
with A1 show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by blast
qed
hence "(P', SourceTerm S') ∈ (indRelRTPO TRel)¯"
by simp
ultimately
show "∃Q'. SourceTerm S ⟼(STCal Source Target)* Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (source S)
then obtain S' where B1: "S' ∈S P'"
by (auto simp add: STCal_steps(1))
hence "(P', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.source)
with source
show "∃Q'. SourceTerm S ⟼(STCal Source Target)* Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ⟼(STCal Source Target)* P'"
from this obtain T2' where C1: "T2' ∈T P'" and C2: "T2 ⟼Target* T2'"
by (auto simp add: STCal_steps(2))
assume "(T1, T2) ∈ TRel"
hence "(T2, T1) ∈ (TRel⇧+)¯"
by simp
with C2 sim obtain T1' where C3: "T1 ⟼Target* T1'" and C4: "(T2', T1') ∈ (TRel⇧+)¯"
by blast
from C3 have "TargetTerm T1 ⟼(STCal Source Target)* (TargetTerm T1')"
by (simp add: STCal_steps(2))
moreover from C4 have "(T1', T2') ∈ TRel⇧+"
by induct
hence "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with C1 have "(P', TargetTerm T1') ∈ (indRelRTPO TRel)¯"
by simp
ultimately
show "∃Q'. TargetTerm T1 ⟼(STCal Source Target)* Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (trans P Q R R')
assume "R ⟼(STCal Source Target)* R'"
and "⋀R'. R ⟼(STCal Source Target)* R'
⟹ ∃Q'. Q ⟼(STCal Source Target)* Q' ∧ (R', Q') ∈ (indRelRTPO TRel)¯"
from this obtain Q' where D1: "Q ⟼(STCal Source Target)* Q'"
and D2: "(R', Q') ∈ (indRelRTPO TRel)¯"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target)* Q'
⟹ ∃P'. P ⟼(STCal Source Target)* P' ∧ (Q', P') ∈ (indRelRTPO TRel)¯"
with D1 obtain P' where D3: "P ⟼(STCal Source Target)* P'"
and D4: "(Q', P') ∈ (indRelRTPO TRel)¯"
by blast
from D4 D2 have "(R', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.trans[where P="P'" and Q="Q'" and R="R'"])
with D3 show "∃P'. P ⟼(STCal Source Target)* P' ∧ (R', P') ∈ (indRelRTPO TRel)¯"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover
assume sim: "weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
ultimately have "operational_sound (TRel⇧*)"
using weak_reduction_simulation_impl_OSou[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "weak_reduction_simulation ((TRel⇧+)¯) Target"
using indRelRTPO_impl_TRel_is_weak_reduction_simulation_rev[where TRel="TRel"]
by simp
ultimately show "operational_sound (TRel⇧*) ∧ weak_reduction_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encodingLS_encL) OSou_iff_inverse_of_indRelRTPO_is_weak_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_sound_encL (TRel⇧*)
∧ weak_labelled_simulation ((TRel⇧+)¯) Target)
= weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
proof (rule iffI, erule conjE)
assume os: "operational_sound_encL (TRel⇧*)"
and sim: "weak_labelled_simulation ((TRel⇧+)¯) Target"
show "weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
proof clarify
fix P Q α P'
assume "Q ≲⟦⋅⟧RT<TRel> P" and "P ─⁀α→(STLCal Source Target)* P'"
thus "∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯ ∧
⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "TargetTerm (⟦S⟧) ─⁀α→(STLCal Source Target)* P'"
then obtain α' T where A1: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩" and A2: "T ∈T P'"
and A3: "⟦S⟧ ─⁀α'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" α P']
by blast
from os A3 obtain β' S' where A4: "S ─⁀β'→Source* S'" and A5: "(⟦S'⟧, T) ∈ TRel⇧*"
and A6: "⦉β'⦊ = α'"
by blast
obtain β where A7: "β' ∈SL ⟨SourceTerm S, β⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─⁀β→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S β "SourceTerm S'"]
by blast
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
from A5 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover have A5: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
with A2 have "⟦S'⟧ = T ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with A5 have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
with A2 show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by blast
qed
hence "(P', SourceTerm S') ∈ (indRelRTPO TRel)¯"
by simp
moreover from A1 A6 A7 have "⦇SourceTerm S, β⦈↦⟨TargetTerm (⟦S⟧), α⟩"
unfolding encLST_def
by blast
hence "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. SourceTerm S ─⁀β→(STLCal Source Target)* Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (source S)
assume A1: "SourceTerm S ─⁀α→(STLCal Source Target)* P'"
then obtain S' where "S' ∈S P'"
using STLCal_weakLabelledSteps(1)[of S α P']
by blast
hence A2: "(P', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.source)
have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, α⟩"
unfolding related_labels_def
by simp
with A1 A2 show "∃β Q'. SourceTerm S ─⁀β→(STLCal Source Target)* Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ─⁀α→(STLCal Source Target)* P'"
then obtain α' T2' where A1: "α' ∈TL ⟨TargetTerm T2, α⟩" and A2: "T2' ∈T P'"
and A3: "T2 ─⁀α'→Target* T2'"
using STLCal_weakLabelledSteps(2)[of T2 α P']
by blast
assume "(T1, T2) ∈ TRel"
hence "(T2, T1) ∈ (TRel⇧+)¯"
by simp
with sim A3 obtain T1' where A4: "T1 ─⁀α'→Target* T1'" and A5: "(T2', T1') ∈ (TRel⇧+)¯"
by blast
from A1 A4 have "TargetTerm T1 ─⁀α→(STLCal Source Target)* (TargetTerm T1')"
using STLCal_weakLabelledSteps(2)[of T1 α "TargetTerm T1'"]
unfolding getTargetLabel_def
by blast
moreover from A5 have "(T1', T2') ∈ TRel⇧+"
by induct
hence "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with A2 have "(P', TargetTerm T1') ∈ (indRelRTPO TRel)¯"
by simp
moreover have "⟨TargetTerm T2, α⟩ ≡⦇⦈ ⟨TargetTerm T1, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T1 ─⁀β→(STLCal Source Target)* Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨TargetTerm T2, α⟩ ≡⦇⦈ ⟨TargetTerm T1, β⟩"
by blast
next
case (trans P Q R γ R')
assume "R ─⁀γ→(STLCal Source Target)* R'"
and "⋀γ R'. R ─⁀γ→(STLCal Source Target)* R' ⟹
∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ (R', Q') ∈ (indRelRTPO TRel)¯ ∧
⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─⁀β→(STLCal Source Target)* Q'"
and A2: "(R', Q') ∈ (indRelRTPO TRel)¯" and A3: "⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀β Q'. Q ─⁀β→(STLCal Source Target)* Q' ⟹
∃α P'. P ─⁀α→(STLCal Source Target)* P' ∧ (Q', P') ∈ (indRelRTPO TRel)¯ ∧
⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
with A1 obtain α P' where A4: "P ─⁀α→(STLCal Source Target)* P'"
and A5: "(Q', P') ∈ (indRelRTPO TRel)¯" and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
from A2 A5 have A7: "(R', P') ∈ (indRelRTPO TRel)¯"
using indRelRTPO.trans[of P' Q' TRel R']
by simp
assume "P ≲⟦⋅⟧RT<TRel> Q"
hence A8: "¬(P ∈ ProcT ∧ Q ∈ ProcS)"
using indRelRTPO_to_TRel(3)[of P Q TRel]
by blast
assume "Q ≲⟦⋅⟧RT<TRel> R"
hence "¬(Q ∈ ProcT ∧ R ∈ ProcS)"
using indRelRTPO_to_TRel(3)[of Q R TRel]
by blast
with A3 A6 A8 have "⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
using related_labels_trans_no_T_to_S[of P α Q β R γ] related_labels_sym[of Q β P α]
related_labels_sym[of R γ Q β] related_labels_sym[of P α R γ]
by simp
with A4 A7 show "∃α P'. P ─⁀α→(STLCal Source Target)* P' ∧ (R', P') ∈ (indRelRTPO TRel)¯ ∧
⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
ultimately have "operational_sound_encL (TRel⇧*)"
using weak_labelled_simulation_impl_OSou_encL[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "weak_labelled_simulation ((TRel⇧+)¯) Target"
using indRelRTPO_impl_TRel_is_weak_labelled_simulation_encL_rev[where TRel="TRel"]
by simp
ultimately show "operational_sound_encL (TRel⇧*) ∧ weak_labelled_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encoding) OSou_iff_weak_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_sound (TRel⇧*)
∧ weak_reduction_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation (Rel¯) (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_sound (TRel⇧*)"
and "weak_reduction_simulation ((TRel⇧+)¯) Target"
hence "weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using OSou_iff_inverse_of_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_simulation (Rel¯) (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
from A1 A4 A5 have "operational_sound (TRel⇧*)"
using weak_reduction_simulation_impl_OSou[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_reduction_simulation ((TRel⇧+)¯) Target"
using rel_with_target_impl_transC_TRel_is_weak_reduction_simulation_rev[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "operational_sound (TRel⇧*) ∧ weak_reduction_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encodingLS_encL) OSou_iff_weak_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_sound_encL (TRel⇧*)
∧ weak_labelled_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL (Rel¯))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_sound_encL (TRel⇧*)"
and "weak_labelled_simulation ((TRel⇧+)¯) Target"
hence "weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using OSou_iff_inverse_of_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL (Rel¯)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_simulation_encL (Rel¯)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_labelled_simulation_encL (Rel¯)"
by blast
from A1 A4 A5 have "operational_sound_encL (TRel⇧*)"
using weak_labelled_simulation_impl_OSou_encL[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_labelled_simulation ((TRel⇧+)¯) Target"
using rel_with_target_impl_transC_TRel_is_weak_labelled_simulation_encL_rev[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately show "operational_sound_encL (TRel⇧*) ∧ weak_labelled_simulation ((TRel⇧+)¯) Target"
by simp
qed
text ‹An encoding is strongly operational sound modulo a relation TRel whose inverse is a strong
reduction simulation on target terms iff there is a relation, like indRelRTPO, that relates
at least all source terms to their literal translations, includes TRel, and whose inverse is
a strong simulation.›
lemma (in encoding) strong_reduction_simulation_impl_SOSou:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A3: "strong_reduction_simulation (Rel¯) (STCal Source Target)"
shows "strongly_operational_sound (TRel⇧*)"
proof clarify
fix S T
from A1 have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ⟼Target T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
ultimately obtain Q' where A5: "SourceTerm S ⟼(STCal Source Target) Q'"
and A6: "(TargetTerm T, Q') ∈ Rel¯"
using A3
by blast
from A5 obtain S' where A7: "S' ∈S Q'" and A8: "S ⟼Source S'"
by (auto simp add: STCal_step(1))
from A6 have "(Q', TargetTerm T) ∈ Rel"
by induct
with A2 A7 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A8 show "∃S'. S ⟼Source S' ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS) strong_labelled_simulation_impl_SOSou:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "strong_labelled_simulation (Rel¯) (STLCal Source Target)"
shows "strongly_operational_sound (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from rel have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ─β→Target T"
with A1 have "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
ultimately obtain Q' where A2: "SourceTerm S ─β'→(STLCal Source Target) Q'"
and A3: "(TargetTerm T, Q') ∈ Rel¯"
using sim
by blast
from A2 obtain β'' S' where A4: "β'' ∈SL ⟨SourceTerm S, β'⟩" and A5: "S' ∈S Q'"
and A6: "S ─β''→Source S'"
using STLCal_labelledStep(1)[of S β' Q']
by blast
from A3 have "(Q', TargetTerm T) ∈ Rel"
by induct
with trel A5 have "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
with A6 show "∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel⇧*"
by blast
qed
lemma (in encodingLS_encL) strong_labelled_simulation_impl_SOSou_encL:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes rel: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and trel: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and sim: "strong_labelled_simulation_encL (Rel¯)"
shows "strongly_operational_sound_encL (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from rel have "(TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel¯"
by simp
moreover assume "⟦S⟧ ─β→Target T"
with A1 have "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
ultimately obtain α' Q' where A2: "SourceTerm S ─α'→(STLCal Source Target) Q'"
and A3: "(TargetTerm T, Q') ∈ Rel¯"
and A4: "⟨TargetTerm (⟦S⟧), β'⟩ ≡⦇⦈ ⟨SourceTerm S, α'⟩"
using sim
by blast
from A2 obtain α S' where A5: "α ∈SL ⟨SourceTerm S, α'⟩" and A6: "S' ∈S Q'"
and A7: "S ─α→Source S'"
using STLCal_labelledStep(1)[of S α' Q']
by blast
from A3 have "(Q', TargetTerm T) ∈ Rel"
by induct
with trel A6 have A8: "(⟦S'⟧, T) ∈ TRel⇧*"
by simp
from A4 have "⦇SourceTerm S, α'⦈↦⟨TargetTerm (⟦S⟧), β'⟩"
using kinds_of_encoded_label(1)[of "TargetTerm (⟦S⟧)" β' "SourceTerm S" α']
unfolding related_labels_def
by blast
with A1 A5 have "⦉α⦊ = β"
unfolding encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A7 A8 show "∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel⇧* ∧ ⦉α⦊ = β"
by blast
qed
lemma (in encoding) SOSou_iff_inverse_of_indRelRTPO_is_strong_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_sound (TRel⇧*)
∧ strong_reduction_simulation ((TRel⇧+)¯) Target)
= strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume os: "strongly_operational_sound (TRel⇧*)"
and sim: "strong_reduction_simulation ((TRel⇧+)¯) Target"
show "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
proof clarify
fix P Q P'
assume "Q ≲⟦⋅⟧RT<TRel> P"
moreover assume "P ⟼(STCal Source Target) P'"
ultimately show "∃Q'. Q ⟼(STCal Source Target) Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
proof (induct arbitrary: P')
case (encR S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target) P'"
from this obtain T where A1: "T ∈T P'" and A2: "⟦S⟧ ⟼Target T"
by (auto simp add: STCal_step(2))
from os A2 obtain S' where A3: "S ⟼Source S'" and A4: "(⟦S'⟧, T) ∈ TRel⇧*"
by blast
from A3 have "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
from A4 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover have A5: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
with A1 have "⟦S'⟧ = T ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with A5 have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
with A1 show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by blast
qed
hence "(P', SourceTerm S') ∈ (indRelRTPO TRel)¯"
by simp
ultimately
show "∃Q'. SourceTerm S ⟼(STCal Source Target) Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (source S)
then obtain S' where B1: "S' ∈S P'"
by (auto simp add: STCal_step(1))
hence "(P', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.source)
with source
show "∃Q'. SourceTerm S ⟼(STCal Source Target) Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ⟼(STCal Source Target) P'"
from this obtain T2' where C1: "T2' ∈T P'" and C2: "T2 ⟼Target T2'"
by (auto simp add: STCal_step(2))
assume "(T1, T2) ∈ TRel"
hence "(T2, T1) ∈ (TRel⇧+)¯"
by simp
with C2 sim obtain T1' where C3: "T1 ⟼Target T1'" and C4: "(T2', T1') ∈ (TRel⇧+)¯"
by blast
from C3 have "TargetTerm T1 ⟼(STCal Source Target) (TargetTerm T1')"
by (simp add: STCal_step(2))
moreover from C4 have "(T1', T2') ∈ TRel⇧+"
by induct
hence "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with C1 have "(P', TargetTerm T1') ∈ (indRelRTPO TRel)¯"
by simp
ultimately
show "∃Q'. TargetTerm T1 ⟼(STCal Source Target) Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯"
by blast
next
case (trans P Q R R')
assume "R ⟼(STCal Source Target) R'"
and "⋀R'. R ⟼(STCal Source Target) R'
⟹ ∃Q'. Q ⟼(STCal Source Target) Q' ∧ (R', Q') ∈ (indRelRTPO TRel)¯"
from this obtain Q' where D1: "Q ⟼(STCal Source Target) Q'"
and D2: "(R', Q') ∈ (indRelRTPO TRel)¯"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target) Q'
⟹ ∃P'. P ⟼(STCal Source Target) P' ∧ (Q', P') ∈ (indRelRTPO TRel)¯"
with D1 obtain P' where D3: "P ⟼(STCal Source Target) P'"
and D4: "(Q', P') ∈ (indRelRTPO TRel)¯"
by blast
from D4 D2 have "(R', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.trans[where P="P'" and Q="Q'" and R="R'"])
with D3 show "∃P'. P ⟼(STCal Source Target) P' ∧ (R', P') ∈ (indRelRTPO TRel)¯"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover
assume sim: "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
ultimately have "strongly_operational_sound (TRel⇧*)"
using strong_reduction_simulation_impl_SOSou[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "strong_reduction_simulation ((TRel⇧+)¯) Target"
using indRelRTPO_impl_TRel_is_strong_reduction_simulation_rev[where TRel="TRel"]
by simp
ultimately
show "strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encodingLS_encL) SOSou_iff_inverse_of_indRelRTPO_is_strong_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_sound_encL (TRel⇧*)
∧ strong_labelled_simulation ((TRel⇧+)¯) Target)
= strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
proof (rule iffI, erule conjE)
assume os: "strongly_operational_sound_encL (TRel⇧*)"
and sim: "strong_labelled_simulation ((TRel⇧+)¯) Target"
show "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
proof clarify
fix P Q α P'
assume "Q ≲⟦⋅⟧RT<TRel> P"
moreover assume "P ─α→(STLCal Source Target) P'"
ultimately show "∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ (P', Q') ∈ (indRelRTPO TRel)¯ ∧
⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "TargetTerm (⟦S⟧) ─α→(STLCal Source Target) P'"
then obtain α' T where A1: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩" and A2: "T ∈T P'"
and A3: "⟦S⟧ ─α'→Target T"
using STLCal_labelledStep(2)[of "⟦S⟧" α P']
by blast
from os A3 obtain β' S' where A4: "S ─β'→Source S'" and A5: "(⟦S'⟧, T) ∈ TRel⇧*"
and A6: "⦉β'⦊ = α'"
by blast
obtain β where A7: "β' ∈SL ⟨SourceTerm S, β⟩"
unfolding getSourceLabel_def
by blast
from A4 A7 have "SourceTerm S ─β→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S β "SourceTerm S'"]
by blast
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
from A5 have "⟦S'⟧ = T ∨ (⟦S'⟧, T) ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T TRel]
by blast
moreover have B: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelRTPO.encR)
with A2 have "⟦S'⟧ = T ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
moreover have "(⟦S'⟧, T) ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
proof -
assume "(⟦S'⟧, T) ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with B have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T"
by (rule indRelRTPO.trans)
with A2 show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by simp
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> P'"
by blast
qed
hence "(P', SourceTerm S') ∈ (indRelRTPO TRel)¯"
by simp
moreover from A1 A6 A7 have "⦇SourceTerm S, β⦈↦⟨TargetTerm (⟦S⟧), α⟩"
unfolding encLST_def
by blast
hence "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. SourceTerm S ─β→(STLCal Source Target) Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (source S)
assume A1: "SourceTerm S ─α→(STLCal Source Target) P'"
then obtain S' where A2: "S' ∈S P'"
using STLCal_labelledStep(1)[of S α P']
by blast
hence A3: "(P', P') ∈ (indRelRTPO TRel)¯"
by (simp add: indRelRTPO.source)
have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, α⟩"
unfolding related_labels_def
by simp
with A1 A3 show "∃β Q'. SourceTerm S ─β→(STLCal Source Target) Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ─α→(STLCal Source Target) P'"
then obtain α' T2' where A1: "α' ∈TL ⟨TargetTerm T2, α⟩" and A2: "T2' ∈T P'"
and A3: "T2 ─α'→Target T2'"
using STLCal_labelledStep(2)[of T2 α P']
by blast
assume "(T1, T2) ∈ TRel"
hence "(T2, T1) ∈ (TRel⇧+)¯"
by simp
with sim A3 obtain T1' where A4: "T1 ─α'→Target T1'" and A5: "(T2', T1') ∈ (TRel⇧+)¯"
by blast
from A1 A4 have "TargetTerm T1 ─α→(STLCal Source Target) (TargetTerm T1')"
using STLCal_labelledStep(2)[of T1 α "TargetTerm T1'"]
unfolding getTargetLabel_def
by blast
moreover from A5 have "(T1', T2') ∈ TRel⇧+"
by induct
hence "TargetTerm T1' ≲⟦⋅⟧RT<TRel> TargetTerm T2'"
by (rule transitive_closure_of_TRel_to_indRelRTPO)
with A2 have "(P', TargetTerm T1') ∈ (indRelRTPO TRel)¯"
by simp
moreover have "⟨TargetTerm T2, α⟩ ≡⦇⦈ ⟨TargetTerm T1, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T1 ─β→(STLCal Source Target) Q' ∧
(P', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨TargetTerm T2, α⟩ ≡⦇⦈ ⟨TargetTerm T1, β⟩"
by blast
next
case (trans P Q R γ R')
assume "R ─γ→(STLCal Source Target) R'"
and "⋀γ R'. R ─γ→(STLCal Source Target) R' ⟹ ∃β Q'. Q ─β→(STLCal Source Target) Q' ∧
(R', Q') ∈ (indRelRTPO TRel)¯ ∧ ⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─β→(STLCal Source Target) Q'"
and A2: "(R', Q') ∈ (indRelRTPO TRel)¯" and A3: "⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀β Q'. Q ─β→(STLCal Source Target) Q' ⟹ ∃α P'. P ─α→(STLCal Source Target) P' ∧
(Q', P') ∈ (indRelRTPO TRel)¯ ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
with A1 obtain α P' where A4: "P ─α→(STLCal Source Target) P'"
and A5: "(Q', P') ∈ (indRelRTPO TRel)¯" and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
from A2 A5 have A7: "(R', P') ∈ (indRelRTPO TRel)¯"
using indRelRTPO.trans[where P="P'" and Q="Q'" and R="R'"]
by simp
assume "P ≲⟦⋅⟧RT<TRel> Q"
hence A8: "¬(P ∈ ProcT ∧ Q ∈ ProcS)"
using indRelRTPO_to_TRel(3)[of P Q TRel]
by blast
assume "Q ≲⟦⋅⟧RT<TRel> R"
hence "¬(Q ∈ ProcT ∧ R ∈ ProcS)"
using indRelRTPO_to_TRel(3)[of Q R TRel]
by blast
with A3 A6 A8 have "⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
using related_labels_trans_no_T_to_S[of P α Q β R γ] related_labels_sym[of Q β P α]
related_labels_sym[of R γ Q β] related_labels_sym[of P α R γ]
by simp
with A4 A7 show "∃α P'. P ─α→(STLCal Source Target) P' ∧ (R', P') ∈ (indRelRTPO TRel)¯ ∧
⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
qed
qed
next
have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume sim: "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
ultimately have "strongly_operational_sound_encL (TRel⇧*)"
using strong_labelled_simulation_impl_SOSou_encL[where Rel="indRelRTPO TRel" and TRel="TRel"]
by simp
moreover from sim have "strong_labelled_simulation ((TRel⇧+)¯) Target"
using indRelRTPO_impl_TRel_is_strong_labelled_simulation_encL_rev[where TRel="TRel"]
by simp
ultimately
show "strongly_operational_sound_encL (TRel⇧*) ∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encoding) SOSou_iff_strong_reduction_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_sound (TRel⇧*)"
and "strong_reduction_simulation ((TRel⇧+)¯) Target"
hence "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
from A1 A4 A5 have "strongly_operational_sound (TRel⇧*)"
using strong_reduction_simulation_impl_SOSou[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "strong_reduction_simulation ((TRel⇧+)¯) Target"
using rel_with_target_impl_transC_TRel_is_strong_reduction_simulation_rev[where Rel="Rel" and
TRel="TRel"]
by simp
ultimately
show "strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encodingLS_encL) SOSou_iff_strong_labelled_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_sound_encL (TRel⇧*) ∧ strong_labelled_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL (Rel¯))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_sound_encL (TRel⇧*)"
and "strong_labelled_simulation ((TRel⇧+)¯) Target"
hence "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL (Rel¯)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_simulation_encL (Rel¯)"
then obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_labelled_simulation_encL (Rel¯)"
by blast
from A1 A4 A5 have "strongly_operational_sound_encL (TRel⇧*)"
using strong_labelled_simulation_impl_SOSou_encL[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "strong_labelled_simulation ((TRel⇧+)¯) Target"
using rel_with_target_impl_transC_TRel_is_strong_labelled_simulation_encL_rev[where Rel="Rel"
and TRel="TRel"]
by simp
ultimately
show "strongly_operational_sound_encL (TRel⇧*) ∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
by simp
qed
lemma (in encoding) SOSou_modulo_TRel_iff_strong_reduction_simulation:
shows "(∃TRel. strongly_operational_sound (TRel⇧*)
∧ strong_reduction_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target))"
proof (rule iffI)
assume "∃TRel. strongly_operational_sound (TRel⇧*)
∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
from this obtain TRel where "strongly_operational_sound (TRel⇧*)"
and "strong_reduction_simulation ((TRel⇧+)¯) Target"
by blast
hence "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_simulation (Rel¯) (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)"
and A3: "strong_reduction_simulation (Rel¯) (STCal Source Target)"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3
have "strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_strong_reduction_simulation[where TRel="TRel"]
by blast
thus "∃TRel. strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
by blast
qed
lemma (in encodingLS_encL) SOSou_modulo_TRel_iff_strong_labelled_simulation_encL:
shows "(∃TRel. strongly_operational_sound_encL (TRel⇧*)
∧ strong_labelled_simulation ((TRel⇧+)¯) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL (Rel¯))"
proof (rule iffI)
assume "∃TRel. strongly_operational_sound_encL (TRel⇧*)
∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
then obtain TRel where "strongly_operational_sound_encL (TRel⇧*)"
and "strong_labelled_simulation ((TRel⇧+)¯) Target"
by blast
hence "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL (Rel¯)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_simulation_encL (Rel¯)"
then obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)"
and A3: "strong_labelled_simulation_encL (Rel¯)"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3
have "strongly_operational_sound_encL (TRel⇧*) ∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_strong_labelled_simulation_encL[where TRel="TRel"]
by blast
thus "∃TRel. strongly_operational_sound_encL (TRel⇧*) ∧
strong_labelled_simulation ((TRel⇧+)¯) Target"
by blast
qed
subsection ‹Weak Operational Correspondence vs Correspondence Similarity›
text ‹If there exists a relation that relates at least all source terms and their literal
translations, includes TRel, and is a correspondence simulation then the encoding is weakly
operational corresponding w.r.t. TRel.›
lemma (in encoding) weak_reduction_correspondence_simulation_impl_WOC:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes enc: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and tRel: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)"
and cs: "weak_reduction_correspondence_simulation Rel (STCal Source Target)"
shows "weakly_operational_corresponding (TRel⇧*)"
proof
from enc tRel cs show "operational_complete (TRel⇧*)"
using weak_reduction_simulation_impl_OCom[where TRel="TRel"]
by simp
next
show "weakly_operational_sound (TRel⇧*)"
proof clarify
fix S T
from enc have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "⟦S⟧ ⟼Target* T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
ultimately obtain P' Q' where A1: "SourceTerm S ⟼(STCal Source Target)* P'"
and A2: "TargetTerm T ⟼(STCal Source Target)* Q'" and A3: "(P', Q') ∈ Rel"
using cs
by blast
from A1 obtain S' where A4: "S' ∈S P'" and A5: "S ⟼Source* S'"
by (auto simp add: STCal_steps(1))
from A2 obtain T' where A6: "T' ∈T Q'" and A7: "T ⟼Target* T'"
by (auto simp: STCal_steps(2))
from tRel A3 A4 A6 have "(⟦S'⟧, T') ∈ TRel⇧*"
by simp
with A5 A7 show "∃S' T'. S ⟼Source* S' ∧ T ⟼Target* T' ∧ (⟦S'⟧, T') ∈ TRel⇧*"
by blast
qed
qed
lemma (in encodingLS) weak_labelled_correspondence_simulation_impl_WOC:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes enc: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and tRel: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)"
and cs: "weak_labelled_correspondence_simulation Rel (STLCal Source Target)"
shows "weakly_operational_corresponding (TRel⇧*)"
proof
from enc tRel cs show "operational_complete (TRel⇧*)"
using weak_labelled_simulation_impl_OCom[where TRel="TRel"]
by simp
next
show "weakly_operational_sound (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from enc have A2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with cs A2 obtain P' Q' where A3: "SourceTerm S ─⁀β'→(STLCal Source Target)* P'"
and A4: "TargetTerm T →(STLCal Source Target)* Q'" and A5: "(P', Q') ∈ Rel"
by blast
from A1 A3 obtain β'' S' where A6: "β'' ∈SL ⟨SourceTerm S, β'⟩" and A7: "S' ∈S P'"
and A8: "S ─⁀β''→Source* S'"
using STLCal_weakLabelledSteps(1)[of S β' P']
by blast
from A4 obtain T' where A9: "T' ∈T Q'" and A10: "T →Target* T'"
using STLCal_weakTauSteps(2)[of T Q']
by blast
from tRel A5 A7 A9 have "(⟦S'⟧, T') ∈ TRel⇧*"
by simp
with A8 A10 show "∃S' α T'. S ─⁀α→Source* S' ∧ T →Target* T' ∧ (⟦S'⟧, T') ∈ TRel⇧*"
by blast
qed
qed
lemma (in encodingLS_encL) weak_labelled_correspondence_simulation_impl_WOC_encL:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes enc: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and tRel: "(∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)"
and cs: "weak_labelled_correspondence_simulation_encL Rel"
shows "weakly_operational_corresponding_encL (TRel⇧*)"
proof
from enc tRel cs show "operational_complete_encL (TRel⇧*)"
using weak_labelled_simulation_encL_impl_OCom[where TRel="TRel"]
by simp
next
show "weakly_operational_sound_encL (TRel⇧*)"
proof clarify
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from enc have A2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with cs A2 obtain α' P' Q' where A3: "SourceTerm S ─⁀α'→(STLCal Source Target)* P'"
and A4: "TargetTerm T →(STLCal Source Target)* Q'"
and A5: "(P', Q') ∈ Rel"
and A6: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from A1 A3 obtain α S' where A7: "α ∈SL ⟨SourceTerm S, α'⟩" and A8: "S' ∈S P'"
and A9: "S ─⁀α→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α' P']
by blast
from A4 obtain T' where A10: "T' ∈T Q'" and A11: "T →Target* T'"
using STLCal_weakTauSteps(2)[of T Q']
by blast
from tRel A5 A8 A10 have A12: "(⟦S'⟧, T') ∈ TRel⇧*"
by simp
from A6 have "⦇SourceTerm S, α'⦈↦⟨TargetTerm (⟦S⟧), β'⟩"
using kinds_of_encoded_label(1)[of "TargetTerm (⟦S⟧)" β' "SourceTerm S" α']
unfolding related_labels_def
by blast
with A1 A7 have "⦉α⦊ = β"
unfolding encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A9 A11 A12
show "∃S' α T'. S ─⁀α→Source* S' ∧ T →Target* T' ∧ (⟦S'⟧, T') ∈ TRel⇧* ∧ ⦉α⦊ = β"
by blast
qed
qed
text ‹An encoding is weakly operational corresponding w.r.t. a correspondence simulation on
target terms TRel iff there exists a relation, like indRelRTPO, that relates at least all
source terms and their literal translations, includes TRel, and is a correspondence
simulation.›
lemma (in encoding) WOC_iff_indRelRTPO_is_reduction_correspondence_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding (TRel⇧*)
∧ weak_reduction_correspondence_simulation (TRel⇧+) Target)
= weak_reduction_correspondence_simulation (indRelRTPO TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume woc: "weakly_operational_corresponding (TRel⇧*)"
and csi: "weak_reduction_correspondence_simulation (TRel⇧+) Target"
show "weak_reduction_correspondence_simulation (indRelRTPO TRel) (STCal Source Target)"
proof
from woc csi show sim: "weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using OCom_iff_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
show "∀P Q Q'. P ≲⟦⋅⟧RT<TRel> Q ∧ Q ⟼(STCal Source Target)* Q'
⟶ (∃P'' Q''. P ⟼(STCal Source Target)* P'' ∧ Q' ⟼(STCal Source Target)* Q''
∧ P'' ≲⟦⋅⟧RT<TRel> Q'')"
proof clarify
fix P Q Q'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "Q ⟼(STCal Source Target)* Q'"
thus "∃P'' Q''. P ⟼(STCal Source Target)* P'' ∧ Q' ⟼(STCal Source Target)* Q''
∧ P'' ≲⟦⋅⟧RT<TRel> Q''"
proof (induct arbitrary: Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q'"
from this obtain T where A1: "T ∈T Q'" and A2: "⟦S⟧ ⟼Target* T"
by (auto simp add: STCal_steps(2))
from A2 woc obtain S' T' where A3: "S ⟼Source* S'" and A4: "T ⟼Target* T'"
and A5: "(⟦S'⟧, T') ∈ TRel⇧*"
by blast
from A3 have "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
moreover from A4 have "TargetTerm T ⟼(STCal Source Target)* (TargetTerm T')"
by (simp add: STCal_steps(2))
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
proof -
have A6: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelRTPO.encR)
from A5 have "⟦S'⟧ = T' ∨ (⟦S'⟧, T') ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T' TRel]
by blast
moreover from A6 have "⟦S'⟧ = T' ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by simp
moreover have "(⟦S'⟧, T') ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
proof -
assume "(⟦S'⟧, T') ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by (simp add: transitive_closure_of_TRel_to_indRelRTPO[where TRel="TRel"])
with A6 show "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by (rule indRelRTPO.trans)
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by blast
qed
ultimately show "∃P'' Q''. SourceTerm S ⟼(STCal Source Target)* P''
∧ Q' ⟼(STCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q''"
using A1
by blast
next
case (source S)
assume B1: "SourceTerm S ⟼(STCal Source Target)* Q'"
moreover have "Q' ⟼(STCal Source Target)* Q'"
by (rule steps_refl)
moreover from B1 obtain S' where "S' ∈S Q'"
by (auto simp add: STCal_steps(1))
hence "Q' ≲⟦⋅⟧RT<TRel> Q'"
by (simp add: indRelRTPO.source)
ultimately show "∃P'' Q''. SourceTerm S ⟼(STCal Source Target)* P''
∧ Q' ⟼(STCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q''"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ⟼(STCal Source Target)* Q'"
from this obtain T2' where C1: "T2' ∈T Q'" and C2: "T2 ⟼Target* T2'"
by (auto simp add: STCal_steps(2))
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with C2 csi obtain T1' T2'' where C3: "T1 ⟼Target* T1'" and C4: "T2' ⟼Target* T2''"
and C5: "(T1', T2'') ∈ TRel⇧+"
by blast
from C3 have "TargetTerm T1 ⟼(STCal Source Target)* (TargetTerm T1')"
by (simp add: STCal_steps(2))
moreover from C1 C4 have "Q' ⟼(STCal Source Target)* (TargetTerm T2'')"
by (simp add: STCal_steps(2))
moreover from C5 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> (TargetTerm T2'')"
by (simp add: transitive_closure_of_TRel_to_indRelRTPO)
ultimately show "∃P'' Q''. TargetTerm T1 ⟼(STCal Source Target)* P''
∧ Q' ⟼(STCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q''"
by blast
next
case (trans P Q R R')
assume "R ⟼(STCal Source Target)* R'"
and "⋀R'. R ⟼(STCal Source Target)* R' ⟹ ∃Q'' R''. Q ⟼(STCal Source Target)* Q''
∧ R' ⟼(STCal Source Target)* R'' ∧ Q'' ≲⟦⋅⟧RT<TRel> R''"
and "⋀Q'. Q ⟼(STCal Source Target)* Q' ⟹ ∃P'' Q''. P ⟼(STCal Source Target)* P''
∧ Q' ⟼(STCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q''"
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show ?case
using sim reduction_correspondence_simulation_condition_trans[where P="P" and
Rel="indRelRTPO TRel" and Cal="STCal Source Target" and Q="Q" and R="R"]
by blast
qed
qed
qed
next
assume csi: "weak_reduction_correspondence_simulation (indRelRTPO TRel) (STCal Source Target)"
show "weakly_operational_corresponding (TRel⇧*)
∧ weak_reduction_correspondence_simulation (TRel⇧+) Target"
proof
have " ∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
ultimately show "weakly_operational_corresponding (TRel⇧*)"
using weak_reduction_correspondence_simulation_impl_WOC[where Rel="indRelRTPO TRel" and
TRel="TRel"] csi
by simp
next
from csi show "weak_reduction_correspondence_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_weak_reduction_correspondence_simulation[where TRel="TRel"]
by simp
qed
qed
lemma (in encodingLS_encL) indRelRTPO_labelled_correspondence_simulation_encL_trans:
fixes P Q R :: "('procS, 'procT) Proc"
assumes csQP: "∀β Q'. Q ─⁀β→(STLCal Source Target)* Q' ⟶
(∃α P'' Q''. P ─⁀α→(STLCal Source Target)* P'' ∧
Q' →(STLCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q'' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩)"
and csRQ: "∀γ R'. R ─⁀γ→(STLCal Source Target)* R' ⟶
(∃β Q'' R''. Q ─⁀β→(STLCal Source Target)* Q'' ∧
R' →(STLCal Source Target)* R'' ∧ Q'' ≲⟦⋅⟧RT<TRel> R'' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩)"
and relPQ: "P ≲⟦⋅⟧RT<TRel> Q"
and relQR: "Q ≲⟦⋅⟧RT<TRel> R"
and trel: "weak_labelled_correspondence_simulation (TRel⇧+) Target"
shows "∀γ R'. R ─⁀γ→(STLCal Source Target)* R' ⟶
(∃α P'' R''. P ─⁀α→(STLCal Source Target)* P'' ∧
R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩)"
using source_or_target[of P] source_or_target[of Q] source_or_target[of R]
proof auto
fix γ R' SP SQ SR
assume "SP ∈S P" and "SQ ∈S Q" and "SR ∈S R"
with relPQ relQR have A1: "SP = SR"
using indRelRTPO_to_TRel
by simp
assume A2: "SourceTerm SR ─⁀γ→(STLCal Source Target)* R'"
with A1 have "SourceTerm SP ─⁀γ→(STLCal Source Target)* R'"
by simp
moreover have "R' →(STLCal Source Target)* R'"
using WTS_refl[of R' "STLCal Source Target"]
by simp
moreover from A2 obtain SR' where "SR' ∈S R'"
using STLCal_weakLabelledSteps(1)[of SR γ R']
by blast
hence "R' ≲⟦⋅⟧RT<TRel> R'"
using indRelRTPO.source[of SR' TRel]
by simp
moreover have "⟨SourceTerm SP, γ⟩ ≡⦇⦈ ⟨SourceTerm SR, γ⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P''. SourceTerm SP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨SourceTerm SR, γ⟩)"
by blast
next
fix γ R' SP SQ TR
assume "TargetTerm TR ─⁀γ→(STLCal Source Target)* R'" and "TR ∈T R"
with csRQ obtain α P'' R'' where A1: "Q ─⁀α→(STLCal Source Target)* P''"
and A2: "R' →(STLCal Source Target)* R''"
and A3: "P'' ≲⟦⋅⟧RT<TRel> R''" and A4: "⟨Q, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩"
by blast
assume "SP ∈S P" and "SQ ∈S Q"
with relPQ have A5: "Q = SourceTerm SP"
using indRelRTPO_to_TRel(1)[of P Q TRel]
by simp
with A1 have A6: "SourceTerm SP ─⁀α→(STLCal Source Target)* P''"
by simp
from A4 A5 have "⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩"
by simp
with A2 A3 A6 show "∃α P''. SourceTerm SP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩)"
by blast
next
fix γ R' SP TQ SR
assume "TQ ∈T Q" and "SR ∈S R"
with relQR have False
using indRelRTPO_to_TRel(3)[of Q R TRel]
by simp
thus "∃α P''. SourceTerm SP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨SourceTerm SR, γ⟩)"
by simp
next
fix γ R' SP TQ TR
assume A1: "TQ ∈T Q" and "TR ∈T R"
with relQR have A2: "(TQ, TR) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[of Q R TRel]
by simp
assume "TargetTerm TR ─⁀γ→(STLCal Source Target)* R'"
then obtain γ' TR' where A3: "γ' ∈TL ⟨TargetTerm TR, γ⟩" and A4: "TR' ∈T R'"
and A5: "TR ─⁀γ'→Target* TR'"
using STLCal_weakLabelledSteps(2)[of TR γ R']
by blast
from trel A2 A5 obtain TQ'' TR'' where A6: "TQ ─⁀γ'→Target* TQ''" and A7: "TR' →Target* TR''"
and A8: "(TQ'', TR'') ∈ TRel⇧+"
by blast
from A3 A6 have A9: "TargetTerm TQ ─⁀γ→(STLCal Source Target)* TargetTerm TQ''"
using STLCal_weakLabelledSteps(2)[of TQ γ "TargetTerm TQ''"]
unfolding getTargetLabel_def
by blast
assume A10: "SP ∈S P"
with csQP A1 A9 obtain α P''' Q''' where A11: "SourceTerm SP ─⁀α→(STLCal Source Target)* P'''"
and A12: "TargetTerm TQ'' →(STLCal Source Target)* Q'''"
and A13: "P''' ≲⟦⋅⟧RT<TRel> Q'''" and A14: "⟨P, α⟩ ≡⦇⦈ ⟨Q, γ⟩"
by blast
from A12 obtain TQ''' where A15: "TQ''' ∈T Q'''" and A16: "TQ'' →Target* TQ'''"
using STLCal_weakTauSteps(2)[of TQ'' Q''']
by blast
from A16 have "TQ'' ─⁀τ-Target→Target* TQ'''"
unfolding weakLabelledStep_def
by simp
with trel A8 obtain TR''' where A17: "TR'' ─⁀τ-Target→Target* TR'''"
and A18: "(TQ''', TR''') ∈ TRel⇧+"
by blast
from A4 A7 A17 have A19: "R' →(STLCal Source Target)* TargetTerm TR'''"
using weakTauSteps_trans[of TR' Target TR'' TR''']
STLCal_weakTauSteps(2)[of TR' "TargetTerm TR'''"]
unfolding weakLabelledStep_def
by auto
from A18 have "TargetTerm TQ''' ≲⟦⋅⟧RT<TRel> TargetTerm TR'''"
using transitive_closure_of_TRel_to_indRelRTPO[of TQ''' TR''' TRel]
by blast
with A13 A15 have A20: "P''' ≲⟦⋅⟧RT<TRel> TargetTerm TR'''"
using indRelRTPO.trans[of P''' Q''' TRel "TargetTerm TR'''"]
by simp
from A1 A10 A14 have "⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩"
using related_labels_exchange_processes[of P α Q γ "SourceTerm SP" "TargetTerm TR"]
by simp
with A11 A19 A20 show "∃α P''. SourceTerm SP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨SourceTerm SP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩)"
by blast
next
fix γ R' TP SQ SR
assume "TP ∈T P" and "SQ ∈S Q"
with relPQ have False
using indRelRTPO_to_TRel(3)[of P Q]
by simp
thus "∃α P''. TargetTerm TP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨TargetTerm TP, α⟩ ≡⦇⦈ ⟨SourceTerm SR, γ⟩)"
by simp
next
fix γ R' TP SQ TR
assume "TP ∈T P" and "SQ ∈S Q"
with relPQ have False
using indRelRTPO_to_TRel(3)[of P Q]
by simp
thus "∃α P''. TargetTerm TP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨TargetTerm TP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩)"
by simp
next
fix γ R' TP TQ SR
assume "TQ ∈T Q" and "SR ∈S R"
with relQR have False
using indRelRTPO_to_TRel(3)[of Q R]
by simp
thus "∃α P''. TargetTerm TP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨TargetTerm TP, α⟩ ≡⦇⦈ ⟨SourceTerm SR, γ⟩)"
by simp
next
fix γ R' TP TQ TR
assume A1: "TQ ∈T Q" and "TR ∈T R"
with relQR have A2: "(TQ, TR) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[of Q R TRel]
by simp
assume "TargetTerm TR ─⁀γ→(STLCal Source Target)* R'"
then obtain γ' TR' where A3: "γ' ∈TL ⟨TargetTerm TR, γ⟩" and A4: "TR' ∈T R'"
and A5: "TR ─⁀γ'→Target* TR'"
using STLCal_weakLabelledSteps(2)[of TR γ R']
by blast
from trel A2 A5 obtain TQ'' TR'' where A6: "TQ ─⁀γ'→Target* TQ''" and A7: "TR' →Target* TR''"
and A8: "(TQ'', TR'') ∈ TRel⇧+"
by blast
assume "TP ∈T P"
with relPQ A1 have "(TP, TQ) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[of P Q TRel]
by simp
with trel A6 obtain TQ''' TP''' where A9: "TP ─⁀γ'→Target* TP'''"
and A10: "TQ'' →Target* TQ'''"
and A11: "(TP''', TQ''') ∈ TRel⇧+"
by blast
from A3 A9 have A12: "TargetTerm TP ─⁀γ→(STLCal Source Target)* TargetTerm TP'''"
using STLCal_weakLabelledSteps(2)[of TP γ "TargetTerm TP'''"]
unfolding getTargetLabel_def
by blast
from A10 have "TQ'' ─⁀τ-Target→Target* TQ'''"
unfolding weakLabelledStep_def
by simp
with trel A8 obtain TR''' where A13: "TR'' ─⁀τ-Target→Target* TR'''"
and A14: "(TQ''', TR''') ∈ TRel⇧+"
by blast
from A4 A7 A13 have A15: "R' →(STLCal Source Target)* TargetTerm TR'''"
using weakTauSteps_trans[of TR' Target TR'' TR''']
STLCal_weakTauSteps(2)[of TR' "TargetTerm TR'''"]
unfolding weakLabelledStep_def
by simp
from A11 A14 have "(TP''', TR''') ∈ TRel⇧+"
using transD[of "TRel⇧+" TP''' TQ''' TR''']
by simp
hence A16: "TargetTerm TP''' ≲⟦⋅⟧RT<TRel> TargetTerm TR'''"
using transitive_closure_of_TRel_to_indRelRTPO[of TP''' TR''' TRel]
by simp
have "⟨TargetTerm TP, γ⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩"
unfolding related_labels_def
by simp
with A12 A15 A16
show "∃α P''. TargetTerm TP ─⁀α→(STLCal Source Target)* P'' ∧
(∃R''. R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨TargetTerm TP, α⟩ ≡⦇⦈ ⟨TargetTerm TR, γ⟩)"
by blast
qed
lemma (in encodingLS_encL) WOC_iff_indRelRTPO_is_labelled_correspondence_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_correspondence_simulation (TRel⇧+) Target)
= weak_labelled_correspondence_simulation_encL (indRelRTPO TRel)"
proof (rule iffI, erule conjE)
assume woc: "weakly_operational_corresponding_encL (TRel⇧*)"
and csi: "weak_labelled_correspondence_simulation (TRel⇧+) Target"
show "weak_labelled_correspondence_simulation_encL (indRelRTPO TRel)"
proof
from woc csi show sim: "weak_labelled_simulation_encL (indRelRTPO TRel)"
using OCom_iff_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
show "∀P Q β Q'. P ≲⟦⋅⟧RT<TRel> Q ∧ Q ─⁀β→(STLCal Source Target)* Q' ⟶
(∃α P'' Q''. P ─⁀α→(STLCal Source Target)* P'' ∧ Q' →(STLCal Source Target)* Q'' ∧
P'' ≲⟦⋅⟧RT<TRel> Q'' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩)"
proof clarify
fix P Q β Q'
assume "P ≲⟦⋅⟧RT<TRel> Q" and "Q ─⁀β→(STLCal Source Target)* Q'"
thus "∃α P'' Q''. P ─⁀α→(STLCal Source Target)* P'' ∧ Q' →(STLCal Source Target)* Q'' ∧
P'' ≲⟦⋅⟧RT<TRel> Q'' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: β Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* Q'"
then obtain β' T where A1: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩" and A2: "T ∈T Q'"
and A3: "⟦S⟧ ─⁀β'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β Q']
by blast
from woc A3 obtain α' S' T' where A4: "S ─⁀α'→Source* S'" and A5: "T →Target* T'"
and A6: "(⟦S'⟧, T') ∈ TRel⇧*" and A7: "⦉α'⦊ = β'"
by blast
obtain α where A8: "α' ∈SL ⟨SourceTerm S, α⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─⁀α→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α "SourceTerm S'"]
by blast
moreover from A2 A5 have "Q' →(STLCal Source Target)* (TargetTerm T')"
using STLCal_weakTauSteps(2)[of T "TargetTerm T'"]
by blast
moreover have "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
proof -
have B: "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelRTPO.encR)
from A6 have "⟦S'⟧ = T' ∨ (⟦S'⟧, T') ∈ TRel⇧+"
using rtrancl_eq_or_trancl[of "⟦S'⟧" T' TRel]
by blast
moreover from B have "⟦S'⟧ = T' ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by simp
moreover have "(⟦S'⟧, T') ∈ TRel⇧+ ⟹ SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
proof -
assume "(⟦S'⟧, T') ∈ TRel⇧+"
hence "TargetTerm (⟦S'⟧) ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by (simp add: transitive_closure_of_TRel_to_indRelRTPO[where TRel="TRel"])
with B show "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by (rule indRelRTPO.trans)
qed
ultimately show "SourceTerm S' ≲⟦⋅⟧RT<TRel> TargetTerm T'"
by blast
qed
moreover from A1 A7 A8 have "⦇SourceTerm S, α⦈↦⟨TargetTerm (⟦S⟧), β⟩"
unfolding encLST_def
by blast
hence "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'' Q''. SourceTerm S ─⁀α→(STLCal Source Target)* P'' ∧
Q' →(STLCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q'' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (source S)
assume A1: "SourceTerm S ─⁀β→(STLCal Source Target)* Q'"
moreover have "Q' →(STLCal Source Target)* Q'"
using WTS_refl[of Q' "STLCal Source Target"]
by simp
moreover from A1 obtain S' where "S' ∈S Q'"
using STLCal_weakLabelledSteps(1)[of S β Q']
by blast
hence "Q' ≲⟦⋅⟧RT<TRel> Q'"
by (simp add: indRelRTPO.source)
moreover have "⟨SourceTerm S, β⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'' Q''. SourceTerm S ─⁀α→(STLCal Source Target)* P'' ∧
Q' →(STLCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q'' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ─⁀β→(STLCal Source Target)* Q'"
then obtain β' T2' where A1: "β' ∈TL ⟨TargetTerm T2, β⟩" and A2: "T2' ∈T Q'"
and A3: "T2 ─⁀β'→Target* T2'"
using STLCal_weakLabelledSteps(2)[of T2 β Q']
by blast
assume "(T1, T2) ∈ TRel"
hence "(T1, T2) ∈ TRel⇧+"
by simp
with csi A3 obtain T1' T2'' where A4: "T1 ─⁀β'→Target* T1'" and A5: "T2' →Target* T2''"
and A6: "(T1', T2'') ∈ TRel⇧+"
by blast
from A1 A4 have "TargetTerm T1 ─⁀β→(STLCal Source Target)* (TargetTerm T1')"
using STLCal_weakLabelledSteps(2)[of T1 β "TargetTerm T1'"]
unfolding getTargetLabel_def
by blast
moreover from A2 A5 have "Q' →(STLCal Source Target)* (TargetTerm T2'')"
using STLCal_weakTauSteps(2)[of T2' "TargetTerm T2''"]
by blast
moreover from A6 have "TargetTerm T1' ≲⟦⋅⟧RT<TRel> (TargetTerm T2'')"
by (simp add: transitive_closure_of_TRel_to_indRelRTPO)
moreover have "⟨TargetTerm T1, β⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'' Q''. TargetTerm T1 ─⁀α→(STLCal Source Target)* P'' ∧
Q' →(STLCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q'' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans P Q R γ R')
assume "R ─⁀γ→(STLCal Source Target)* R'"
and "⋀γ R'. R ─⁀γ→(STLCal Source Target)* R' ⟹
∃β Q'' R''. Q ─⁀β→(STLCal Source Target)* Q'' ∧
R' →(STLCal Source Target)* R'' ∧ Q'' ≲⟦⋅⟧RT<TRel> R'' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
and "⋀β Q'. Q ─⁀β→(STLCal Source Target)* Q' ⟹
∃α P'' Q''. P ─⁀α→(STLCal Source Target)* P'' ∧
Q' →(STLCal Source Target)* Q'' ∧ P'' ≲⟦⋅⟧RT<TRel> Q'' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
and "P ≲⟦⋅⟧RT<TRel> Q" and "Q ≲⟦⋅⟧RT<TRel> R"
with csi show "∃α P'' R''. P ─⁀α→(STLCal Source Target)* P'' ∧
R' →(STLCal Source Target)* R'' ∧ P'' ≲⟦⋅⟧RT<TRel> R'' ∧
⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
using indRelRTPO_labelled_correspondence_simulation_encL_trans[of Q P TRel R]
by blast
qed
qed
qed
next
assume csi: "weak_labelled_correspondence_simulation_encL (indRelRTPO TRel)"
show "weakly_operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_correspondence_simulation (TRel⇧+) Target"
proof
have " ∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
ultimately show "weakly_operational_corresponding_encL (TRel⇧*)"
using weak_labelled_correspondence_simulation_impl_WOC_encL[where Rel="indRelRTPO TRel" and
TRel="TRel"] csi
by simp
next
from csi show "weak_labelled_correspondence_simulation (TRel⇧+) Target"
using indRelRTPO_impl_TRel_is_weak_labelled_correspondence_simulation_encL[where TRel="TRel"]
by simp
qed
qed
lemma (in encoding) WOC_iff_reduction_correspondence_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding (TRel⇧*)
∧ weak_reduction_correspondence_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "weakly_operational_corresponding (TRel⇧*)"
and "weak_reduction_correspondence_simulation (TRel⇧+) Target"
hence "weak_reduction_correspondence_simulation (indRelRTPO TRel) (STCal Source Target)"
using WOC_iff_indRelRTPO_is_reduction_correspondence_simulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_reduction_correspondence_simulation Rel (STCal Source Target)"
by blast
from A1 A4 A5 have "weakly_operational_corresponding (TRel⇧*)"
using weak_reduction_correspondence_simulation_impl_WOC[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_reduction_correspondence_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_weak_reduction_correspondence_simulation
by simp
ultimately show "weakly_operational_corresponding (TRel⇧*)
∧ weak_reduction_correspondence_simulation (TRel⇧+) Target"
by simp
qed
lemma (in encodingLS_encL) WOC_iff_labelled_correspondence_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_correspondence_simulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_correspondence_simulation_encL Rel)"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "weakly_operational_corresponding_encL (TRel⇧*)"
and "weak_labelled_correspondence_simulation (TRel⇧+) Target"
hence "weak_labelled_correspondence_simulation_encL (indRelRTPO TRel)"
using WOC_iff_indRelRTPO_is_labelled_correspondence_simulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_correspondence_simulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_correspondence_simulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_labelled_correspondence_simulation_encL Rel"
by blast
from A1 A4 A5 have "weakly_operational_corresponding_encL (TRel⇧*)"
using weak_labelled_correspondence_simulation_impl_WOC_encL[where Rel="Rel" and TRel="TRel"]
by simp
moreover from A2 A3 A5 have "weak_labelled_correspondence_simulation (TRel⇧+) Target"
using rel_with_target_impl_transC_TRel_is_weak_labelled_correspondence_simulation_encL
by simp
ultimately show "weakly_operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_correspondence_simulation (TRel⇧+) Target"
by simp
qed
lemma rel_includes_TRel_modulo_preorder:
fixes Rel :: "(('procS, 'procT) Proc × ('procS, 'procT) Proc) set"
and TRel :: "('procT × 'procT) set"
assumes transT: "trans TRel"
shows "((∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+))
= (TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel})"
proof (rule iffI, erule conjE)
assume "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
with transT show "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
using trancl_id[of TRel]
by blast
next
assume A: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
hence "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
by simp
moreover from transT A
have "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
using trancl_id[of TRel]
by blast
ultimately show "(∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)"
by simp
qed
lemma (in encoding) WOC_wrt_preorder_iff_reduction_correspondence_simulation:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding TRel ∧ preorder TRel
∧ weak_reduction_correspondence_simulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "operational_complete TRel" and A2: "weakly_operational_sound TRel"
and A3:"preorder TRel" and A4: "weak_reduction_correspondence_simulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using trancl_id[of TRel] reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by auto
with A1 A2 have "weakly_operational_corresponding (TRel⇧*)"
by simp
moreover from A4 A5 have "weak_reduction_correspondence_simulation (TRel⇧+) Target"
by simp
ultimately
have "weak_reduction_correspondence_simulation (indRelRTPO TRel) (STCal Source Target)"
using WOC_iff_indRelRTPO_is_reduction_correspondence_simulation[where TRel="TRel"]
by blast
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover
have "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ indRelRTPO TRel}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by blast
with A3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
using indRelRTPO_refl[of TRel]
unfolding preorder_on_def
by simp
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target)"
unfolding preorder_on_def
by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_correspondence_simulation Rel (STCal Source Target)"
from this obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "weak_reduction_correspondence_simulation Rel (STCal Source Target)"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
using trancl_id[of TRel]
by simp
with B6 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B1 B3 B5 have "weakly_operational_corresponding TRel"
using weak_reduction_correspondence_simulation_impl_WOC[where Rel="Rel" and TRel="TRel"]
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def by simp
moreover from B2 B5 B7 B8 have "weak_reduction_correspondence_simulation TRel Target"
using rel_includes_TRel_modulo_preorder[where Rel="Rel" and TRel="TRel"]
rel_with_target_impl_transC_TRel_is_weak_reduction_correspondence_simulation[where
Rel="Rel" and TRel="TRel"]
by fast
ultimately show "weakly_operational_corresponding TRel ∧ preorder TRel
∧ weak_reduction_correspondence_simulation TRel Target"
by blast
qed
lemma (in encodingLS_encL) WOC_wrt_preorder_iff_labelled_correspondence_simulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(weakly_operational_corresponding_encL TRel ∧ preorder TRel
∧ weak_labelled_correspondence_simulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_correspondence_simulation_encL Rel)"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "operational_complete_encL TRel" and A2: "weakly_operational_sound_encL TRel"
and A3:"preorder TRel" and A4: "weak_labelled_correspondence_simulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using trancl_id[of TRel] reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by auto
with A1 A2 have "weakly_operational_corresponding_encL (TRel⇧*)"
by simp
moreover from A4 A5 have "weak_labelled_correspondence_simulation (TRel⇧+) Target"
by simp
ultimately have "weak_labelled_correspondence_simulation_encL (indRelRTPO TRel)"
using WOC_iff_indRelRTPO_is_labelled_correspondence_simulation_encL[where TRel="TRel"]
by blast
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover
have "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ indRelRTPO TRel}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by blast
with A3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
using indRelRTPO_refl[of TRel]
unfolding preorder_on_def
by simp
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_correspondence_simulation_encL Rel"
unfolding preorder_on_def
by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_correspondence_simulation_encL Rel"
from this obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "weak_labelled_correspondence_simulation_encL Rel"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
using trancl_id[of TRel]
by simp
with B6 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B1 B3 B5 have "weakly_operational_corresponding_encL TRel"
using weak_labelled_correspondence_simulation_impl_WOC_encL[where Rel="Rel" and TRel="TRel"]
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def by simp
moreover from B2 B5 B7 B8 have "weak_labelled_correspondence_simulation TRel Target"
using rel_includes_TRel_modulo_preorder[where Rel="Rel" and TRel="TRel"]
rel_with_target_impl_transC_TRel_is_weak_labelled_correspondence_simulation_encL[where
Rel="Rel" and TRel="TRel"]
by fast
ultimately show "weakly_operational_corresponding_encL TRel ∧ preorder TRel
∧ weak_labelled_correspondence_simulation TRel Target"
by blast
qed
subsection ‹(Strong) Operational Correspondence vs (Strong) Bisimilarity›
text ‹An encoding is operational corresponding w.r.t a weak bisimulation on target terms TRel iff
there exists a relation, like indRelRTPO, that relates at least all source terms and their
literal translations, includes TRel, and is a weak bisimulation. Thus this variant of
operational correspondence ensures that source terms and their translations are weak
bisimilar.›
lemma (in encoding) OC_iff_indRelRTPO_is_weak_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding (TRel⇧*)
∧ weak_reduction_bisimulation (TRel⇧+) Target)
= weak_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume ocorr: "operational_corresponding (TRel⇧*)"
and bisim: "weak_reduction_bisimulation (TRel⇧+) Target"
hence "weak_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using OCom_iff_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
moreover from bisim have "weak_reduction_simulation ((TRel⇧+)¯) Target"
using weak_reduction_bisimulations_impl_inverse_is_simulation[where Rel="TRel⇧+"]
by simp
with ocorr have "weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using OSou_iff_inverse_of_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "weak_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using weak_reduction_simulations_impl_bisimulation[where Rel="indRelRTPO TRel"]
by simp
next
assume bisim: "weak_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
hence "operational_complete (TRel⇧*) ∧ weak_reduction_simulation (TRel⇧+) Target"
using OCom_iff_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
moreover from bisim
have "weak_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using weak_reduction_bisimulations_impl_inverse_is_simulation[where Rel="indRelRTPO TRel"]
by simp
hence "operational_sound (TRel⇧*) ∧ weak_reduction_simulation ((TRel⇧+)¯) Target"
using OSou_iff_inverse_of_indRelRTPO_is_weak_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "operational_corresponding (TRel⇧*) ∧ weak_reduction_bisimulation (TRel⇧+) Target"
using weak_reduction_simulations_impl_bisimulation[where Rel="TRel⇧+"]
by simp
qed
lemma (in encodingLS_encL) OC_iff_indRelRTPO_is_weak_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_bisimulation (TRel⇧+) Target)
= weak_labelled_bisimulation_encL (indRelRTPO TRel)"
proof (rule iffI, erule conjE)
assume ocorr: "operational_corresponding_encL (TRel⇧*)"
and bisim: "weak_labelled_bisimulation (TRel⇧+) Target"
hence "weak_labelled_simulation_encL (indRelRTPO TRel)"
using OCom_iff_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover from bisim have "weak_labelled_simulation ((TRel⇧+)¯) Target"
using weak_labelled_bisimulations_impl_inverse_is_simulation[where Rel="TRel⇧+"]
by simp
with ocorr have "weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using OSou_iff_inverse_of_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "weak_labelled_bisimulation_encL (indRelRTPO TRel)"
using weak_labelled_simulations_encL_impl_bisimulation[where Rel="indRelRTPO TRel"]
by simp
next
assume bisim: "weak_labelled_bisimulation_encL (indRelRTPO TRel)"
hence "operational_complete_encL (TRel⇧*) ∧ weak_labelled_simulation (TRel⇧+) Target"
using OCom_iff_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover from bisim
have "weak_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using weak_labelled_bisimulations_encL_impl_inverse_is_simulation[where Rel="indRelRTPO TRel"]
by simp
hence "operational_sound_encL (TRel⇧*) ∧ weak_labelled_simulation ((TRel⇧+)¯) Target"
using OSou_iff_inverse_of_indRelRTPO_is_weak_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately
show "operational_corresponding_encL (TRel⇧*) ∧ weak_labelled_bisimulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) OC_iff_weak_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding (TRel⇧*) ∧ weak_reduction_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_corresponding (TRel⇧*)"
and "weak_reduction_bisimulation (TRel⇧+) Target"
hence "weak_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using OC_iff_indRelRTPO_is_weak_reduction_bisimulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_reduction_bisimulation Rel (STCal Source Target)"
by blast
hence "operational_complete (TRel⇧*)
∧ weak_reduction_simulation (TRel⇧+) Target"
using OCom_iff_weak_reduction_simulation[where TRel="TRel"]
by blast
moreover from A5 have "weak_reduction_simulation (Rel¯) (STCal Source Target)"
using weak_reduction_bisimulations_impl_inverse_is_simulation[where Rel="Rel"]
by simp
with A1 A2 A3 A4 have "operational_sound (TRel⇧*)
∧ weak_reduction_simulation ((TRel⇧+)¯) Target"
using OSou_iff_weak_reduction_simulation[where TRel="TRel"]
by blast
ultimately show "operational_corresponding (TRel⇧*)
∧ weak_reduction_bisimulation (TRel⇧+) Target"
using weak_reduction_simulations_impl_bisimulation[where Rel="TRel⇧+"]
by simp
qed
lemma (in encodingLS_encL) OC_iff_weak_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding_encL (TRel⇧*) ∧ weak_labelled_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "operational_corresponding_encL (TRel⇧*)"
and "weak_labelled_bisimulation (TRel⇧+) Target"
hence "weak_labelled_bisimulation_encL (indRelRTPO TRel)"
using OC_iff_indRelRTPO_is_weak_labelled_bisimulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_bisimulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_bisimulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "weak_labelled_bisimulation_encL Rel"
by blast
hence "operational_complete_encL (TRel⇧*)
∧ weak_labelled_simulation (TRel⇧+) Target"
using OCom_iff_weak_labelled_simulation_encL[where TRel="TRel"]
by blast
moreover from A5 have "weak_labelled_simulation_encL (Rel¯)"
using weak_labelled_bisimulations_encL_impl_inverse_is_simulation[where Rel="Rel"]
by simp
with A1 A2 A3 A4 have "operational_sound_encL (TRel⇧*)
∧ weak_labelled_simulation ((TRel⇧+)¯) Target"
using OSou_iff_weak_labelled_simulation_encL[where TRel="TRel"]
by blast
ultimately show "operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_bisimulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) OC_wrt_preorder_iff_weak_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding TRel ∧ preorder TRel
∧ weak_reduction_bisimulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "operational_complete TRel" and A2: "operational_sound TRel"
and A3:"preorder TRel" and A4: "weak_reduction_bisimulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by blast
with A1 A2 have "operational_corresponding (TRel⇧*)"
by simp
moreover from A4 A5 have "weak_reduction_bisimulation (TRel⇧+) Target"
by simp
ultimately
have "weak_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using OC_iff_indRelRTPO_is_weak_reduction_bisimulation[where TRel="TRel"]
by blast
moreover have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover
have "TRel = {(T1, T2). TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by auto
with A3 have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
unfolding preorder_on_def
by (simp add: indRelRTPO_refl)
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
unfolding preorder_on_def by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "weak_reduction_bisimulation Rel (STCal Source Target)"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
using trancl_id[of TRel]
by simp
with B6 have B9: "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
by simp
moreover from B2 B8 have "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
by auto
ultimately have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
using B1 B5
by blast
hence "operational_corresponding (TRel⇧*)
∧ weak_reduction_bisimulation (TRel⇧+) Target"
using OC_iff_weak_reduction_bisimulation[where TRel="TRel"]
by simp
with B8 B9 have "operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target"
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def by simp
ultimately show "operational_corresponding TRel ∧ preorder TRel
∧ weak_reduction_bisimulation TRel Target"
by blast
qed
lemma (in encodingLS_encL) OC_wrt_preorder_iff_weak_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(operational_corresponding_encL TRel ∧ preorder TRel
∧ weak_labelled_bisimulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "operational_complete_encL TRel" and A2: "operational_sound_encL TRel"
and A3:"preorder TRel" and A4: "weak_labelled_bisimulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by blast
with A1 A2 have "operational_corresponding_encL (TRel⇧*)"
by simp
moreover from A4 A5 have "weak_labelled_bisimulation (TRel⇧+) Target"
by simp
ultimately have "weak_labelled_bisimulation_encL (indRelRTPO TRel)"
using OC_iff_indRelRTPO_is_weak_labelled_bisimulation_encL[where TRel="TRel"]
by blast
moreover have "∀S. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm (⟦S⟧)"
by (simp add: indRelRTPO.encR)
moreover have "TRel = {(T1, T2). TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by auto
with A3 have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
unfolding preorder_on_def
by (simp add: indRelRTPO_refl)
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_bisimulation_encL Rel"
unfolding preorder_on_def
by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ weak_labelled_bisimulation_encL Rel"
from this obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "weak_labelled_bisimulation_encL Rel"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
using trancl_id[of TRel]
by simp
with B6 have B9: "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
by simp
moreover from B2 B8 have "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
by auto
ultimately have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ weak_labelled_bisimulation_encL Rel"
using B1 B5
by blast
hence "operational_corresponding_encL (TRel⇧*)
∧ weak_labelled_bisimulation (TRel⇧+) Target"
using OC_iff_weak_labelled_bisimulation_encL[where TRel="TRel"]
by simp
with B8 B9 have "operational_corresponding_encL TRel ∧ weak_labelled_bisimulation TRel Target"
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def
by simp
ultimately show "operational_corresponding_encL TRel ∧ preorder TRel
∧ weak_labelled_bisimulation TRel Target"
by blast
qed
lemma (in encoding) OC_wrt_equivalence_iff_indRelTEQ_weak_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
shows "(operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target) ⟷
weak_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume oc: "operational_corresponding TRel" and bisimT: "weak_reduction_bisimulation TRel Target"
show "weak_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
proof auto
fix P Q P'
assume "P ∼⟦⋅⟧T<TRel> Q" and "P ⟼(STCal Source Target)* P'"
thus "∃Q'. Q ⟼(STCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
proof (induct arbitrary: P')
case (encR S)
assume "SourceTerm S ⟼(STCal Source Target)* P'"
from this obtain S' where A1: "S ⟼Source* S'" and A2: "S' ∈S P'"
by (auto simp add: STCal_steps(1))
from A1 oc obtain T where A3: "⟦S⟧ ⟼Target* T" and A4: "(⟦S'⟧, T) ∈ TRel"
by blast
from A3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
moreover have "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
proof -
from A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.encR)
moreover from A4 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.target)
ultimately show "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.trans)
qed
ultimately show "∃Q'. TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (encL S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* P'"
from this obtain T where B1: "⟦S⟧ ⟼Target* T" and B2: "T ∈T P'"
by (auto simp add: STCal_steps(2))
from B1 oc obtain S' where B3: "S ⟼Source* S'" and B4: "(⟦S'⟧, T) ∈ TRel"
by blast
from B3 have "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
moreover have "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
proof -
from B4 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
with B2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.target)
moreover have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.encL)
ultimately show "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃Q'. SourceTerm S ⟼(STCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ⟼(STCal Source Target)* P'"
from this obtain T1' where C1: "T1 ⟼Target* T1'" and C2: "T1' ∈T P'"
by (auto simp add: STCal_steps(2))
assume "(T1, T2) ∈ TRel"
with C1 bisimT obtain T2' where C3: "T2 ⟼Target* T2'" and C4: "(T1', T2') ∈ TRel"
by blast
from C3 have "TargetTerm T2 ⟼(STCal Source Target)* (TargetTerm T2')"
by (simp add: STCal_steps(2))
moreover from C2 C4 have "P' ∼⟦⋅⟧T<TRel> TargetTerm T2'"
by (simp add: indRelTEQ.target)
ultimately show "∃Q'. TargetTerm T2 ⟼(STCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (trans P Q R)
assume "P ⟼(STCal Source Target)* P'"
and "⋀P'. P ⟼(STCal Source Target)* P'
⟹ ∃Q'. Q ⟼(STCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
from this obtain Q' where D1: "Q ⟼(STCal Source Target)* Q'" and D2: "P' ∼⟦⋅⟧T<TRel> Q'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target)* Q'
⟹ ∃R'. R ⟼(STCal Source Target)* R' ∧ Q' ∼⟦⋅⟧T<TRel> R'"
with D1 obtain R' where D3: "R ⟼(STCal Source Target)* R'" and D4: "Q' ∼⟦⋅⟧T<TRel> R'"
by blast
from D2 D4 have "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
with D3 show "∃R'. R ⟼(STCal Source Target)* R' ∧ P' ∼⟦⋅⟧T<TRel> R'"
by blast
qed
next
fix P Q Q'
assume "P ∼⟦⋅⟧T<TRel> Q" and "Q ⟼(STCal Source Target)* Q'"
thus "∃P'. P ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
proof (induct arbitrary: Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q'"
from this obtain T where E1: "⟦S⟧ ⟼Target* T" and E2: "T ∈T Q'"
by (auto simp add: STCal_steps(2))
from E1 oc obtain S' where E3: "S ⟼Source* S'" and E4: "(⟦S'⟧, T) ∈ TRel"
by blast
from E3 have "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
proof -
have "SourceTerm S' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.encR)
moreover from E2 E4 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
ultimately show "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃P'. SourceTerm S ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (encL S)
assume "SourceTerm S ⟼(STCal Source Target)* Q'"
from this obtain S' where F1: "S ⟼Source* S'" and F2: "S' ∈S Q'"
by (auto simp add: STCal_steps(1))
from F1 oc obtain T where F3: "⟦S⟧ ⟼Target* T" and F4: "(⟦S'⟧, T) ∈ TRel"
by blast
from F3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
moreover have "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
proof -
from F4 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
hence "TargetTerm T ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.target)
moreover from F2 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.encL)
ultimately show "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃P'. TargetTerm (⟦S⟧) ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ⟼(STCal Source Target)* Q'"
from this obtain T2' where G1: "T2 ⟼Target* T2'" and G2: "T2' ∈T Q'"
by (auto simp add: STCal_steps(2))
assume "(T1, T2) ∈ TRel"
with G1 bisimT obtain T1' where G3: "T1 ⟼Target* T1'" and G4: "(T1', T2') ∈ TRel"
by blast
from G3 have "TargetTerm T1 ⟼(STCal Source Target)* (TargetTerm T1')"
by (simp add: STCal_steps(2))
moreover from G2 G4 have "TargetTerm T1' ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
ultimately show "∃P'. TargetTerm T1 ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (trans P Q R R')
assume "R ⟼(STCal Source Target)* R'"
and "⋀R'. R ⟼(STCal Source Target)* R'
⟹ ∃Q'. Q ⟼(STCal Source Target)* Q' ∧ Q' ∼⟦⋅⟧T<TRel> R'"
from this obtain Q' where H1: "Q ⟼(STCal Source Target)* Q'" and H2: "Q' ∼⟦⋅⟧T<TRel> R'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target)* Q'
⟹ ∃P'. P ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
with H1 obtain P' where H3: "P ⟼(STCal Source Target)* P'" and H4: "P' ∼⟦⋅⟧T<TRel> Q'"
by blast
from H4 H2 have "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
with H3 show "∃P'. P ⟼(STCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> R'"
by blast
qed
qed
next
assume bisim: "weak_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
have "operational_corresponding TRel"
proof auto
fix S S'
have "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "S ⟼Source* S'"
hence "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
ultimately obtain Q' where I1: "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q'"
and I2: "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
using bisim
by blast
from I1 obtain T where I3: "⟦S⟧ ⟼Target* T" and I4: "T ∈T Q'"
by (auto simp add: STCal_steps(2))
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with I2 I4 have "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by simp
with I3 show "∃T. ⟦S⟧ ⟼Target* T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S T
have "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "⟦S⟧ ⟼Target* T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
ultimately obtain Q' where J1: "SourceTerm S ⟼(STCal Source Target)* Q'"
and J2: "Q' ∼⟦⋅⟧T<TRel> TargetTerm T"
using bisim
by blast
from J1 obtain S' where J3: "S ⟼Source* S'" and J4: "S' ∈S Q'"
by (auto simp add: STCal_steps(1))
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with J2 J4 have "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by blast
with J3 show "∃S'. S ⟼Source* S' ∧ (⟦S'⟧, T) ∈ TRel"
by blast
qed
moreover have "weak_reduction_bisimulation TRel Target"
proof -
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with bisim show "weak_reduction_bisimulation TRel Target"
using indRelTEQ_impl_TRel_is_weak_reduction_bisimulation[where TRel="TRel"]
by simp
qed
ultimately show "operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target"
by simp
qed
lemma (in encodingLS_encL) OC_wrt_equivalence_iff_indRelTEQ_weak_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
and inj: "inj encL"
shows "(operational_corresponding_encL TRel ∧ weak_labelled_bisimulation TRel Target) ⟷
weak_labelled_bisimulation_encL (indRelTEQ TRel)"
proof (rule iffI, erule conjE)
assume oc: "operational_corresponding_encL TRel"
and bisimT: "weak_labelled_bisimulation TRel Target"
show "weak_labelled_bisimulation_encL (indRelTEQ TRel)"
proof auto
fix P Q α P'
assume "P ∼⟦⋅⟧T<TRel> Q" and "P ─⁀α→(STLCal Source Target)* P'"
thus "∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "SourceTerm S ─⁀α→(STLCal Source Target)* P'"
from this obtain α' S' where A1: "α' ∈SL ⟨SourceTerm S, α⟩" and A2: "S' ∈S P'"
and A3: "S ─⁀α'→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α P']
by blast
from oc A3 obtain β' T where A4: "⟦S⟧ ─⁀β'→Target* T" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉α'⦊ = β'"
by blast
obtain β where A7: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩"
unfolding getTargetLabel_def
by blast
with A4 have A8: "TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β "TargetTerm T"]
by blast
moreover have "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
proof -
from A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.encR)
moreover from A5 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> TargetTerm T"
using indRelTEQ.target[of "⟦S'⟧" T "TRel"]
by simp
ultimately show "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def encLST_def
by blast
ultimately show "∃β Q'. TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* Q' ∧
P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (encL S)
assume "TargetTerm (⟦S⟧) ─⁀α→(STLCal Source Target)* P'"
then obtain α' T where A1: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩" and A2: "T ∈T P'"
and A3: "⟦S⟧ ─⁀α'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" α P']
by blast
from oc A3 obtain β' S' where A4: "S ─⁀β'→Source* S'" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉β'⦊ = α'"
by blast
obtain β where A7: "β' ∈SL ⟨SourceTerm S, β⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─⁀β→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S β "SourceTerm S'"]
by blast
moreover have "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
proof -
from A5 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
with A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.target)
moreover have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.encL)
ultimately show "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⦇SourceTerm S, β⦈↦⟨TargetTerm (⟦S⟧), α⟩"
unfolding encLST_def
by blast
hence "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. SourceTerm S ─⁀β→(STLCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ─⁀α→(STLCal Source Target)* P'"
from this obtain α' T1' where C1: "α' ∈TL ⟨TargetTerm T1, α⟩" and C2: "T1' ∈T P'"
and C3: "T1 ─⁀α'→Target* T1'"
using STLCal_weakLabelledSteps(2)[of T1 α P']
by blast
assume "(T1, T2) ∈ TRel"
with bisimT C3 obtain T2' where C4: "T2 ─⁀α'→Target* T2'" and C5: "(T1', T2') ∈ TRel"
by blast
from C1 C4 have "TargetTerm T2 ─⁀α→(STLCal Source Target)* (TargetTerm T2')"
using STLCal_weakLabelledSteps(2)[of T2 α "TargetTerm T2'"]
unfolding getTargetLabel_def
by blast
moreover from C2 C5 have "P' ∼⟦⋅⟧T<TRel> TargetTerm T2'"
by (simp add: indRelTEQ.target)
moreover have "⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T2 ─⁀β→(STLCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans P Q R)
assume "P ─⁀α→(STLCal Source Target)* P'"
and "⋀α P'. P ─⁀α→(STLCal Source Target)* P' ⟹
∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─⁀β→(STLCal Source Target)* Q'" and A2: "P' ∼⟦⋅⟧T<TRel> Q'"
and A3: "⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀β Q'. Q ─⁀β→(STLCal Source Target)* Q' ⟹
∃γ R'. R ─⁀γ→(STLCal Source Target)* R' ∧ Q' ∼⟦⋅⟧T<TRel> R' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
with A1 obtain γ R' where A4: "R ─⁀γ→(STLCal Source Target)* R'" and A5: "Q' ∼⟦⋅⟧T<TRel> R'"
and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
from A2 A5 have A7: "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
from inj A3 A6 have "⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
using related_labels_trans_inj[of P α Q β R γ]
by simp
with A4 A7
show "∃γ R'. R ─⁀γ→(STLCal Source Target)* R' ∧ P' ∼⟦⋅⟧T<TRel> R' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
qed
next
fix P Q β Q'
assume "P ∼⟦⋅⟧T<TRel> Q" and "Q ─⁀β→(STLCal Source Target)* Q'"
thus "∃α P'. P ─⁀α→(STLCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: β Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ─⁀β→(STLCal Source Target)* Q'"
then obtain β' T where A1: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩" and A2: "T ∈T Q'"
and A3: "⟦S⟧ ─⁀β'→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β Q']
by blast
from oc A3 obtain α' S' where A4: "S ─⁀α'→Source* S'" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉α'⦊ = β'"
by blast
obtain α where A7: "α' ∈SL ⟨SourceTerm S, α⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─⁀α→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α "SourceTerm S'"]
by blast
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
proof -
from A2 A5 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.encR)
ultimately show "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
using indRelTEQ.trans[of "SourceTerm S'" "TargetTerm (⟦S'⟧)" TRel Q']
by simp
qed
moreover from A1 A6 A7 have "⦇SourceTerm S, α⦈↦⟨TargetTerm (⟦S⟧), β⟩"
unfolding encLST_def
by blast
hence "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'. SourceTerm S ─⁀α→(STLCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (encL S)
assume "SourceTerm S ─⁀β→(STLCal Source Target)* Q'"
from this obtain β' S' where A1: "β' ∈SL ⟨SourceTerm S, β⟩" and A2: "S' ∈S Q'"
and A3: "S ─⁀β'→Source* S'"
using STLCal_weakLabelledSteps(1)[of S β Q']
by blast
from oc A3 obtain α' T where A4: "⟦S⟧ ─⁀α'→Target* T" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉β'⦊ = α'"
by blast
obtain α where A7: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩"
unfolding getTargetLabel_def
by blast
with A4 have A8: "TargetTerm (⟦S⟧) ─⁀α→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" α "TargetTerm T"]
by blast
moreover have "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
proof -
from A5 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
hence "TargetTerm T ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
using indRelTEQ.target[of T "⟦S'⟧" "TRel"]
by simp
moreover from A2 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.encL)
ultimately show "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def encLST_def
by blast
ultimately show "∃α P'. TargetTerm (⟦S⟧) ─⁀α→(STLCal Source Target)* P' ∧
P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ─⁀β→(STLCal Source Target)* Q'"
from this obtain β' T2' where C1: "β' ∈TL ⟨TargetTerm T2, β⟩" and C2: "T2' ∈T Q'"
and C3: "T2 ─⁀β'→Target* T2'"
using STLCal_weakLabelledSteps(2)[of T2 β Q']
by blast
assume "(T1, T2) ∈ TRel"
with bisimT C3 obtain T1' where C4: "T1 ─⁀β'→Target* T1'" and C5: "(T1', T2') ∈ TRel"
by blast
from C1 C4 have "TargetTerm T1 ─⁀β→(STLCal Source Target)* (TargetTerm T1')"
using STLCal_weakLabelledSteps(2)[of T1 β "TargetTerm T1'"]
unfolding getTargetLabel_def
by blast
moreover from C2 C5 have "TargetTerm T1' ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
moreover have "⟨TargetTerm T1, β⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'. TargetTerm T1 ─⁀α→(STLCal Source Target)* P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans R Q P α P')
assume "P ─⁀α→(STLCal Source Target)* P'"
and "⋀α P'. P ─⁀α→(STLCal Source Target)* P' ⟹
∃β Q'. Q ─⁀β→(STLCal Source Target)* Q' ∧ Q' ∼⟦⋅⟧T<TRel> P' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
then obtain β Q' where A1: "Q ─⁀β→(STLCal Source Target)* Q'" and A2: "Q' ∼⟦⋅⟧T<TRel> P'"
and A3: "⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
assume "⋀β Q'. Q ─⁀β→(STLCal Source Target)* Q' ⟹
∃γ R'. R ─⁀γ→(STLCal Source Target)* R' ∧ R' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
with A1 obtain γ R' where A4: "R ─⁀γ→(STLCal Source Target)* R'" and A5: "R' ∼⟦⋅⟧T<TRel> Q'"
and A6: "⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
from A2 A5 have A7: "R' ∼⟦⋅⟧T<TRel> P'"
using indRelTEQ.trans[of R' Q' TRel P']
by simp
from inj A3 A6 have "⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
using related_labels_trans_inj[of R γ Q β P α]
by simp
with A4 A7
show "∃γ R'. R ─⁀γ→(STLCal Source Target)* R' ∧ R' ∼⟦⋅⟧T<TRel> P' ∧ ⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
qed
qed
next
assume bisim: "weak_labelled_bisimulation_encL (indRelTEQ TRel)"
have "operational_corresponding_encL TRel"
proof auto
fix S α S'
obtain α' where A1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
have A2: "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "S ─⁀α→Source* S'"
with A1 have "SourceTerm S ─⁀α'→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α' "SourceTerm S'"]
by blast
with bisim A2 obtain β' Q' where A3: "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* Q'"
and A4: "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
and A5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from A3 obtain β T where A6: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩" and A7: "T ∈T Q'"
and A8: "⟦S⟧ ─⁀β→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' Q']
by blast
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with A4 A7 have A9: "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by simp
from A1 A5 A6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A8 A9 show "∃T. ⟦S⟧ ─⁀⦉α⦊→Target* T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
have A2: "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
assume "⟦S⟧ ─⁀β→Target* T"
with A1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with bisim A2 obtain α' Q' where A3: "SourceTerm S ─⁀α'→(STLCal Source Target)* Q'"
and A4: "Q' ∼⟦⋅⟧T<TRel> TargetTerm T"
and A5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from A3 obtain α S' where A6: "α ∈SL ⟨SourceTerm S, α'⟩" and A7: "S' ∈S Q'"
and A8: "S ─⁀α→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α' Q']
by blast
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with A4 A7 have A9: "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by blast
from A1 A5 A6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A8 A9 show "∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β"
by blast
qed
moreover have "weak_labelled_bisimulation TRel Target"
proof -
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with bisim show "weak_labelled_bisimulation TRel Target"
using indRelTEQ_impl_TRel_is_weak_labelled_bisimulation_encL[where TRel="TRel"]
by simp
qed
ultimately show "operational_corresponding_encL TRel ∧ weak_labelled_bisimulation TRel Target"
by simp
qed
lemma (in encoding) OC_wrt_equivalence_iff_weak_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
shows "(operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target) ⟷ (∃Rel.
(∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ trans Rel ∧ weak_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
assume oc: "operational_corresponding TRel" and bisimT: "weak_reduction_bisimulation TRel Target"
from eqT have rt: "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
have "∀S. SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧) ∧ TargetTerm (⟦S⟧) ∼⟦⋅⟧T<TRel> SourceTerm S"
by (simp add: indRelTEQ.encR indRelTEQ.encL)
moreover from rt have "TRel = {(T1, T2). TargetTerm T1 ∼⟦⋅⟧T<TRel> TargetTerm T2}"
using indRelTEQ_to_TRel(4)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by (auto simp add: indRelTEQ.target)
moreover have "trans (indRelTEQ TRel)"
using indRelTEQ.trans[where TRel="TRel"]
unfolding trans_def
by blast
moreover from eqT oc bisimT
have "weak_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
using OC_wrt_equivalence_iff_indRelTEQ_weak_reduction_bisimulation[where TRel="TRel"]
by blast
ultimately
show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ weak_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel"
and A2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}" and A3: "trans Rel"
and A4: "weak_reduction_bisimulation Rel (STCal Source Target)"
by blast
have "operational_corresponding TRel"
proof auto
fix S S'
from A1 have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ⟼Source* S'"
hence "SourceTerm S ⟼(STCal Source Target)* (SourceTerm S')"
by (simp add: STCal_steps(1))
ultimately obtain Q' where B1: "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* Q'"
and B2: "(SourceTerm S', Q') ∈ Rel"
using A4
by blast
from B1 obtain T where B3: "⟦S⟧ ⟼Target* T" and B4: "T ∈T Q'"
by (auto simp add: STCal_steps(2))
from A1 have "(TargetTerm (⟦S'⟧), SourceTerm S') ∈ Rel"
by simp
with B2 A3 have "(TargetTerm (⟦S'⟧), Q') ∈ Rel"
unfolding trans_def
by blast
with B4 A2 have "(⟦S'⟧, T) ∈ TRel"
by simp
with B3 show "∃T. ⟦S⟧ ⟼Target* T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S T
from A1 have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "⟦S⟧ ⟼Target* T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target)* (TargetTerm T)"
by (simp add: STCal_steps(2))
ultimately obtain P' where C1: "SourceTerm S ⟼(STCal Source Target)* P'"
and C2: "(P', TargetTerm T) ∈ Rel"
using A4
by blast
from C1 obtain S' where C3: "S ⟼Source* S'" and C4: "S' ∈S P'"
by (auto simp add: STCal_steps(1))
from A1 C4 have "(TargetTerm (⟦S'⟧), P') ∈ Rel"
by simp
from A3 this C2 have "(TargetTerm (⟦S'⟧), TargetTerm T) ∈ Rel"
unfolding trans_def
by blast
with A2 have "(⟦S'⟧, T) ∈ TRel"
by simp
with C3 show "∃S'. S ⟼Source* S' ∧ (⟦S'⟧, T) ∈ TRel"
by blast
qed
moreover have "weak_reduction_bisimulation TRel Target"
proof auto
fix TP TQ TP'
assume "(TP, TQ) ∈ TRel"
with A2 have "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
moreover assume "TP ⟼Target* TP'"
hence "TargetTerm TP ⟼(STCal Source Target)* (TargetTerm TP')"
by (simp add: STCal_steps(2))
ultimately obtain Q' where D1: "TargetTerm TQ ⟼(STCal Source Target)* Q'"
and D2: "(TargetTerm TP', Q') ∈ Rel"
using A4
by blast
from D1 obtain TQ' where D3: "TQ ⟼Target* TQ'" and D4: "TQ' ∈T Q'"
by (auto simp add: STCal_steps(2))
from A2 D2 D4 have "(TP', TQ') ∈ TRel"
by simp
with D3 show "∃TQ'. TQ ⟼Target* TQ' ∧ (TP', TQ') ∈ TRel"
by blast
next
fix TP TQ TQ'
assume "(TP, TQ) ∈ TRel"
with A2 have "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
moreover assume "TQ ⟼Target* TQ'"
hence "TargetTerm TQ ⟼(STCal Source Target)* (TargetTerm TQ')"
by (simp add: STCal_steps(2))
ultimately obtain P' where E1: "TargetTerm TP ⟼(STCal Source Target)* P'"
and E2: "(P', TargetTerm TQ') ∈ Rel"
using A4
by blast
from E1 obtain TP' where E3: "TP ⟼Target* TP'" and E4: "TP' ∈T P'"
by (auto simp add: STCal_steps(2))
from A2 E2 E4 have "(TP', TQ') ∈ TRel"
by simp
with E3 show "∃TP'. TP ⟼Target* TP' ∧ (TP', TQ') ∈ TRel"
by blast
qed
ultimately show "operational_corresponding TRel ∧ weak_reduction_bisimulation TRel Target"
by simp
qed
lemma (in encodingLS_encL) OC_wrt_equivalence_iff_weak_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
and inj: "inj encL"
shows "(operational_corresponding_encL TRel ∧ weak_labelled_bisimulation TRel Target) ⟷ (∃Rel.
(∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ trans Rel ∧ weak_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE)
assume oc: "operational_corresponding_encL TRel"
and bisimT: "weak_labelled_bisimulation TRel Target"
from eqT have rt: "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
have "∀S. SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧) ∧ TargetTerm (⟦S⟧) ∼⟦⋅⟧T<TRel> SourceTerm S"
by (simp add: indRelTEQ.encR indRelTEQ.encL)
moreover from rt have "TRel = {(T1, T2). TargetTerm T1 ∼⟦⋅⟧T<TRel> TargetTerm T2}"
using indRelTEQ_to_TRel(4)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by (auto simp add: indRelTEQ.target)
moreover have "trans (indRelTEQ TRel)"
using indRelTEQ.trans[where TRel="TRel"]
unfolding trans_def
by blast
moreover from eqT inj oc bisimT
have "weak_labelled_bisimulation_encL (indRelTEQ TRel)"
using OC_wrt_equivalence_iff_indRelTEQ_weak_labelled_bisimulation_encL[where TRel="TRel"]
by blast
ultimately
show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ weak_labelled_bisimulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ weak_labelled_bisimulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel"
and A2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}" and A3: "trans Rel"
and A4: "weak_labelled_bisimulation_encL Rel"
by blast
have "operational_corresponding_encL TRel"
proof auto
fix S α S'
obtain α' where B1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
from A1 have B2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "S ─⁀α→Source* S'"
with B1 have "SourceTerm S ─⁀α'→(STLCal Source Target)* (SourceTerm S')"
using STLCal_weakLabelledSteps(1)[of S α' "SourceTerm S'"]
by blast
with A4 B2 obtain β' Q' where B3: "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* Q'"
and B4: "(SourceTerm S', Q') ∈ Rel"
and B5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from B3 obtain β T where B6: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩" and B7: "T ∈T Q'"
and B8: "⟦S⟧ ─⁀β→Target* T"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' Q']
by blast
from A1 have "(TargetTerm (⟦S'⟧), SourceTerm S') ∈ Rel"
by simp
with A3 B4 have "(TargetTerm (⟦S'⟧), Q') ∈ Rel"
using transD[of Rel "TargetTerm (⟦S'⟧)" "SourceTerm S'" Q']
by simp
with A2 B7 have B9: "(⟦S'⟧, T) ∈ TRel"
by simp
from B1 B5 B6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with B8 B9 show "∃T. ⟦S⟧ ─⁀⦉α⦊→Target* T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S β T
obtain β' where B1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from A1 have B2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "⟦S⟧ ─⁀β→Target* T"
with B1 have "TargetTerm (⟦S⟧) ─⁀β'→(STLCal Source Target)* (TargetTerm T)"
using STLCal_weakLabelledSteps(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with A4 B2 obtain α' P' where B3: "SourceTerm S ─⁀α'→(STLCal Source Target)* P'"
and B4: "(P', TargetTerm T) ∈ Rel"
and B5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from B3 obtain α S' where B6: "α ∈SL ⟨SourceTerm S, α'⟩" and B7: "S' ∈S P'"
and B8: "S ─⁀α→Source* S'"
using STLCal_weakLabelledSteps(1)[of S α' P']
by blast
from A1 B7 have "(TargetTerm (⟦S'⟧), P') ∈ Rel"
by simp
with A3 B4 have "(TargetTerm (⟦S'⟧), TargetTerm T) ∈ Rel"
using transD[of Rel "TargetTerm (⟦S'⟧)" P' "TargetTerm T"]
by simp
with A2 have B9: "(⟦S'⟧, T) ∈ TRel"
by simp
from B1 B5 B6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with B8 B9 show "∃α S'. S ─⁀α→Source* S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β"
by blast
qed
moreover have "weak_labelled_bisimulation TRel Target"
proof auto
fix TP TQ α TP'
obtain α' where B1: "α ∈TL ⟨TargetTerm TP, α'⟩"
unfolding getTargetLabel_def
by blast
assume "(TP, TQ) ∈ TRel"
with A2 have B2: "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
assume "TP ─⁀α→Target* TP'"
with B1 have "TargetTerm TP ─⁀α'→(STLCal Source Target)* (TargetTerm TP')"
using STLCal_weakLabelledSteps(2)[of TP α' "TargetTerm TP'"]
by blast
with A4 B2 obtain β' Q' where B3: "TargetTerm TQ ─⁀β'→(STLCal Source Target)* Q'"
and B4: "(TargetTerm TP', Q') ∈ Rel"
and B5: "⟨TargetTerm TP, α'⟩ ≡⦇⦈ ⟨TargetTerm TQ, β'⟩"
by blast
from B5 have "β' = α'"
using related_labels_equal[of "TargetTerm TP" α' "TargetTerm TQ" β']
by simp
with B1 B3 obtain TQ' where B6: "TQ' ∈T Q'" and B7: "TQ ─⁀α→Target* TQ'"
using STLCal_weakLabelledSteps(2)[of TQ α' Q']
unfolding getTargetLabel_def
by blast
from A2 B4 B6 have "(TP', TQ') ∈ TRel"
by simp
with B7 show "∃TQ'. TQ ─⁀α→Target* TQ' ∧ (TP', TQ') ∈ TRel"
by blast
next
fix TP TQ α TQ'
obtain α' where B1: "α ∈TL ⟨TargetTerm TQ, α'⟩"
unfolding getTargetLabel_def
by blast
assume "(TP, TQ) ∈ TRel"
with A2 have B2: "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
assume "TQ ─⁀α→Target* TQ'"
with B1 have "TargetTerm TQ ─⁀α'→(STLCal Source Target)* (TargetTerm TQ')"
using STLCal_weakLabelledSteps(2)[of TQ α' "TargetTerm TQ'"]
by blast
with A4 B2 obtain β' P' where B3: "TargetTerm TP ─⁀β'→(STLCal Source Target)* P'"
and B4: "(P', TargetTerm TQ') ∈ Rel"
and B5: "⟨TargetTerm TP, β'⟩ ≡⦇⦈ ⟨TargetTerm TQ, α'⟩"
by blast
from B5 have "β' = α'"
using related_labels_equal[of "TargetTerm TP" β' "TargetTerm TQ" α']
by simp
with B1 B3 obtain TP' where B6: "TP' ∈T P'" and B7: "TP ─⁀α→Target* TP'"
using STLCal_weakLabelledSteps(2)[of TP α' P']
unfolding getTargetLabel_def
by blast
from A2 B4 B6 have "(TP', TQ') ∈ TRel"
by simp
with B7 show "∃TP'. TP ─⁀α→Target* TP' ∧ (TP', TQ') ∈ TRel"
by blast
qed
ultimately show "operational_corresponding_encL TRel ∧ weak_labelled_bisimulation TRel Target"
by simp
qed
text ‹An encoding is strong operational corresponding w.r.t a strong bisimulation on target terms
TRel iff there exists a relation, like indRelRTPO, that relates at least all source terms
and their literal translations, includes TRel, and is a strong bisimulation. Thus this
variant of operational correspondence ensures that source terms and their translations are
strongly bisimilar.›
lemma (in encoding) SOC_iff_indRelRTPO_is_strong_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target)
= strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume ocorr: "strongly_operational_corresponding (TRel⇧*)"
and bisim: "strong_reduction_bisimulation (TRel⇧+) Target"
hence "strong_reduction_simulation (indRelRTPO TRel) (STCal Source Target)"
using SOCom_iff_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
moreover from bisim have "strong_reduction_simulation ((TRel⇧+)¯) Target"
using strong_reduction_bisimulations_impl_inverse_is_simulation[where Rel="TRel⇧+"]
by simp
with ocorr
have "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using strong_reduction_simulations_impl_bisimulation[where Rel="indRelRTPO TRel"]
by simp
next
assume bisim: "strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
hence "strongly_operational_complete (TRel⇧*) ∧ strong_reduction_simulation (TRel⇧+) Target"
using SOCom_iff_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
moreover from bisim
have "strong_reduction_simulation ((indRelRTPO TRel)¯) (STCal Source Target)"
using strong_reduction_bisimulations_impl_inverse_is_simulation[where Rel="indRelRTPO TRel"]
by simp
hence "strongly_operational_sound (TRel⇧*) ∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_reduction_simulation[where TRel="TRel"]
by simp
ultimately show "strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target"
using strong_reduction_simulations_impl_bisimulation[where Rel="TRel⇧+"]
by simp
qed
lemma (in encodingLS_encL) SOC_iff_indRelRTPO_is_strong_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target)
= strong_labelled_bisimulation_encL (indRelRTPO TRel)"
proof (rule iffI, erule conjE)
assume ocorr: "strongly_operational_corresponding_encL (TRel⇧*)"
and bisim: "strong_labelled_bisimulation (TRel⇧+) Target"
hence "strong_labelled_simulation_encL (indRelRTPO TRel)"
using SOCom_iff_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover from bisim have "strong_labelled_simulation ((TRel⇧+)¯) Target"
by simp
with ocorr have "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "strong_labelled_bisimulation_encL (indRelRTPO TRel)"
using strong_labelled_simulations_encL_impl_bisimulation[where Rel="indRelRTPO TRel"]
by simp
next
assume bisim: "strong_labelled_bisimulation_encL (indRelRTPO TRel)"
hence "strongly_operational_complete_encL (TRel⇧*) ∧ strong_labelled_simulation (TRel⇧+) Target"
using SOCom_iff_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
moreover from bisim have "strong_labelled_simulation_encL ((indRelRTPO TRel)¯)"
using strong_labelled_bisimulations_encL_impl_inverse_is_simulation[where
Rel="indRelRTPO TRel"]
by simp
hence "strongly_operational_sound_encL (TRel⇧*) ∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_inverse_of_indRelRTPO_is_strong_labelled_simulation_encL[where TRel="TRel"]
by simp
ultimately show "strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) SOC_iff_strong_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_corresponding (TRel⇧*)"
and "strong_reduction_bisimulation (TRel⇧+) Target"
hence "strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using SOC_iff_indRelRTPO_is_strong_reduction_bisimulation[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
hence "strongly_operational_complete (TRel⇧*)
∧ strong_reduction_simulation (TRel⇧+) Target"
using SOCom_iff_strong_reduction_simulation[where TRel="TRel"]
by blast
moreover from A5 have "strong_reduction_simulation (Rel¯) (STCal Source Target)"
using strong_reduction_bisimulations_impl_inverse_is_simulation[where Rel="Rel"]
by simp
with A1 A2 A3 A4 have "strongly_operational_sound (TRel⇧*)
∧ strong_reduction_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_strong_reduction_simulation[where TRel="TRel"]
by blast
ultimately show "strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target"
using strong_reduction_simulations_impl_bisimulation[where Rel="TRel⇧+"]
by simp
qed
lemma (in encodingLS_encL) SOC_iff_strong_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE)
have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀T1 T2. (T1, T2) ∈ TRel ⟶ TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2"
by (simp add: indRelRTPO.target)
moreover have "∀T1 T2. TargetTerm T1 ≲⟦⋅⟧RT<TRel> TargetTerm T2 ⟶ (T1, T2) ∈ TRel⇧+"
using indRelRTPO_to_TRel(4)[where TRel="TRel"]
by simp
moreover have "∀S T. SourceTerm S ≲⟦⋅⟧RT<TRel> TargetTerm T ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] trans_closure_of_TRel_refl_cond
by simp
moreover assume "strongly_operational_corresponding_encL (TRel⇧*)"
and "strong_labelled_bisimulation (TRel⇧+) Target"
hence "strong_labelled_bisimulation_encL (indRelRTPO TRel)"
using SOC_iff_indRelRTPO_is_strong_labelled_bisimulation_encL[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_bisimulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_bisimulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and A3: "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and A4: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
and A5: "strong_labelled_bisimulation_encL Rel"
by blast
hence "strongly_operational_complete_encL (TRel⇧*)
∧ strong_labelled_simulation (TRel⇧+) Target"
using SOCom_iff_strong_labelled_simulation_encL[where TRel="TRel"]
by blast
moreover from A5 have "strong_labelled_simulation_encL (Rel¯)"
using strong_labelled_bisimulations_encL_impl_inverse_is_simulation[where Rel="Rel"]
by simp
with A1 A2 A3 A4 have "strongly_operational_sound_encL (TRel⇧*)
∧ strong_labelled_simulation ((TRel⇧+)¯) Target"
using SOSou_iff_strong_labelled_simulation_encL[where TRel="TRel"]
by blast
ultimately show "strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target"
by simp
qed
lemma (in encoding) SOC_wrt_preorder_iff_strong_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding TRel ∧ preorder TRel
∧ strong_reduction_bisimulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "strongly_operational_complete TRel" and A2: "strongly_operational_sound TRel"
and A3:"preorder TRel" and A4: "strong_reduction_bisimulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by blast
with A1 A2 have "strongly_operational_corresponding (TRel⇧*)"
by simp
moreover from A4 A5 have "strong_reduction_bisimulation (TRel⇧+) Target"
by simp
ultimately
have "strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using SOC_iff_indRelRTPO_is_strong_reduction_bisimulation[where TRel="TRel"]
by blast
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover
have "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ indRelRTPO TRel}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by blast
with A3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
unfolding preorder_on_def
by (simp add: indRelRTPO_refl)
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
unfolding preorder_on_def
by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
by (rule trancl_id)
with B6 have B9: "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
by simp
moreover from B2 B8 have "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
by auto
ultimately have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
using B1 B5
by blast
hence "strongly_operational_corresponding (TRel⇧*) ∧ strong_reduction_bisimulation (TRel⇧+) Target"
using SOC_iff_strong_reduction_bisimulation[where TRel="TRel"]
by simp
with B8 B9
have "strongly_operational_corresponding TRel ∧ strong_reduction_bisimulation TRel Target"
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def by simp
ultimately show "strongly_operational_corresponding TRel ∧ preorder TRel
∧ strong_reduction_bisimulation TRel Target"
by blast
qed
lemma (in encodingLS_encL) SOC_wrt_preorder_iff_strong_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
shows "(strongly_operational_corresponding_encL TRel ∧ preorder TRel
∧ strong_labelled_bisimulation TRel Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE, erule conjE, erule conjE)
assume A1: "strongly_operational_complete_encL TRel"
and A2: "strongly_operational_sound_encL TRel"
and A3: "preorder TRel" and A4: "strong_labelled_bisimulation TRel Target"
from A3 have A5: "TRel⇧+ = TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
with A3 have "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding preorder_on_def refl_on_def
by blast
with A1 A2 have "strongly_operational_corresponding_encL (TRel⇧*)"
by simp
moreover from A4 A5 have "strong_labelled_bisimulation (TRel⇧+) Target"
by simp
ultimately
have "strong_labelled_bisimulation_encL (indRelRTPO TRel)"
using SOC_iff_indRelRTPO_is_strong_labelled_bisimulation_encL[where TRel="TRel"]
by blast
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ indRelRTPO TRel}"
proof auto
fix TP TQ
assume "(TP, TQ) ∈ TRel"
thus "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
by (rule indRelRTPO.target)
next
fix TP TQ
assume "TargetTerm TP ≲⟦⋅⟧RT<TRel> TargetTerm TQ"
with A3 show "(TP, TQ) ∈ TRel"
using indRelRTPO_to_TRel(4)[where TRel="TRel"] trancl_id[of TRel]
unfolding preorder_on_def
by blast
qed
moreover from A3
have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel⇧+"
using indRelRTPO_to_TRel(2)[where TRel="TRel"] reflcl_trancl[of TRel]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
unfolding preorder_on_def refl_on_def
by blast
with A3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ indRelRTPO TRel ⟶ (⟦S⟧, T) ∈ TRel"
using trancl_id[of TRel]
unfolding preorder_on_def
by blast
moreover from A3 have "refl (indRelRTPO TRel)"
unfolding preorder_on_def
by (simp add: indRelRTPO_refl)
moreover have "trans (indRelRTPO TRel)"
using indRelRTPO.trans
unfolding trans_def
by blast
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_labelled_bisimulation_encL Rel"
unfolding preorder_on_def
by auto
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel)
∧ preorder Rel
∧ strong_labelled_bisimulation_encL Rel"
then obtain Rel where B1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and B2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}"
and B3: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel" and B4: "preorder Rel"
and B5: "strong_labelled_bisimulation_encL Rel"
by blast
from B2 B4 have B6: "refl TRel"
unfolding preorder_on_def refl_on_def
by blast
from B2 B4 have B7: "trans TRel"
unfolding trans_def preorder_on_def
by blast
hence B8: "TRel⇧+ = TRel"
by (rule trancl_id)
with B6 have B9: "TRel⇧* = TRel"
using reflcl_trancl[of TRel]
unfolding refl_on_def
by blast
with B3 have "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
by simp
moreover from B2 B8 have "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
by auto
ultimately have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_bisimulation_encL Rel"
using B1 B5
by blast
hence "strongly_operational_corresponding_encL (TRel⇧*) ∧
strong_labelled_bisimulation (TRel⇧+) Target"
using SOC_iff_strong_labelled_bisimulation_encL[where TRel="TRel"]
by simp
with B8 B9 have "strongly_operational_corresponding_encL TRel ∧
strong_labelled_bisimulation TRel Target"
by simp
moreover from B6 B7 have "preorder TRel"
unfolding preorder_on_def by simp
ultimately show "strongly_operational_corresponding_encL TRel ∧ preorder TRel
∧ strong_labelled_bisimulation TRel Target"
by blast
qed
lemma (in encoding) SOC_wrt_TRel_iff_strong_reduction_bisimulation:
shows "(∃TRel. strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI)
assume "∃TRel. strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target"
from this obtain TRel where "strongly_operational_corresponding (TRel⇧*)"
and "strong_reduction_bisimulation (TRel⇧+) Target"
by blast
hence "strong_reduction_bisimulation (indRelRTPO TRel) (STCal Source Target)"
using SOC_iff_indRelRTPO_is_strong_reduction_bisimulation[where TRel="TRel"]
by simp
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. (SourceTerm S, TargetTerm T) ∈ (indRelRTPO TRel)
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧="
and A3: "strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3 have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
hence "strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target"
using SOC_iff_strong_reduction_bisimulation[where TRel="TRel"]
by simp
thus "∃TRel. strongly_operational_corresponding (TRel⇧*)
∧ strong_reduction_bisimulation (TRel⇧+) Target"
by blast
qed
lemma (in encodingLS_encL) SOC_wrt_TRel_iff_strong_labelled_bisimulation_encL:
shows "(∃TRel. strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target)
= (∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_bisimulation_encL Rel)"
proof (rule iffI)
assume "∃TRel. strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target"
from this obtain TRel where "strongly_operational_corresponding_encL (TRel⇧*)"
and "strong_labelled_bisimulation (TRel⇧+) Target"
by blast
hence "strong_labelled_bisimulation_encL (indRelRTPO TRel)"
using SOC_iff_indRelRTPO_is_strong_labelled_bisimulation_encL[where TRel="TRel"]
by simp
moreover have "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ indRelRTPO TRel"
by (simp add: indRelRTPO.encR)
moreover have "∀S T. (SourceTerm S, TargetTerm T) ∈ (indRelRTPO TRel)
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ (indRelRTPO TRel)⇧="
using indRelRTPO_relates_source_target[where TRel="TRel"]
by simp
ultimately show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_bisimulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧=)
∧ strong_labelled_bisimulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
and A2: "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel
⟶ (TargetTerm (⟦S⟧), TargetTerm T) ∈ Rel⇧="
and A3: "strong_labelled_bisimulation_encL Rel"
by blast
from A2 obtain TRel where "∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel"
and "∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+"
and "∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*"
using target_relation_from_source_target_relation[where Rel="Rel"]
by blast
with A1 A3 have "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel)
∧ (∀T1 T2. (T1, T2) ∈ TRel ⟶ (TargetTerm T1, TargetTerm T2) ∈ Rel)
∧ (∀T1 T2. (TargetTerm T1, TargetTerm T2) ∈ Rel ⟶ (T1, T2) ∈ TRel⇧+)
∧ (∀S T. (SourceTerm S, TargetTerm T) ∈ Rel ⟶ (⟦S⟧, T) ∈ TRel⇧*)
∧ strong_labelled_bisimulation_encL Rel"
by blast
hence "strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target"
using SOC_iff_strong_labelled_bisimulation_encL[where TRel="TRel"]
by simp
thus "∃TRel. strongly_operational_corresponding_encL (TRel⇧*)
∧ strong_labelled_bisimulation (TRel⇧+) Target"
by blast
qed
lemma (in encoding) SOC_wrt_equivalence_iff_indRelTEQ_strong_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
shows "(strongly_operational_corresponding TRel ∧ strong_reduction_bisimulation TRel Target)
⟷ strong_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
proof (rule iffI, erule conjE)
assume oc: "strongly_operational_corresponding TRel"
and bisimT: "strong_reduction_bisimulation TRel Target"
show "strong_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
proof auto
fix P Q P'
assume "P ∼⟦⋅⟧T<TRel> Q" and "P ⟼(STCal Source Target) P'"
thus "∃Q'. Q ⟼(STCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
proof (induct arbitrary: P')
case (encR S)
assume "SourceTerm S ⟼(STCal Source Target) P'"
from this obtain S' where A1: "S ⟼Source S'" and A2: "S' ∈S P'"
by (auto simp add: STCal_step(1))
from A1 oc obtain T where A3: "⟦S⟧ ⟼Target T" and A4: "(⟦S'⟧, T) ∈ TRel"
by blast
from A3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
moreover have "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
proof -
from A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.encR)
moreover from A4 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.target)
ultimately show "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.trans)
qed
ultimately show "∃Q'. TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (encL S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target) P'"
from this obtain T where B1: "⟦S⟧ ⟼Target T" and B2: "T ∈T P'"
by (auto simp add: STCal_step(2))
from B1 oc obtain S' where B3: "S ⟼Source S'" and B4: "(⟦S'⟧, T) ∈ TRel"
by blast
from B3 have "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
moreover have "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
proof -
from B4 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
with B2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.target)
moreover have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.encL)
ultimately show "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃Q'. SourceTerm S ⟼(STCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ⟼(STCal Source Target) P'"
from this obtain T1' where C1: "T1 ⟼Target T1'" and C2: "T1' ∈T P'"
by (auto simp add: STCal_step(2))
assume "(T1, T2) ∈ TRel"
with C1 bisimT obtain T2' where C3: "T2 ⟼Target T2'" and C4: "(T1', T2') ∈ TRel"
by blast
from C3 have "TargetTerm T2 ⟼(STCal Source Target) (TargetTerm T2')"
by (simp add: STCal_step(2))
moreover from C2 C4 have "P' ∼⟦⋅⟧T<TRel> TargetTerm T2'"
by (simp add: indRelTEQ.target)
ultimately show "∃Q'. TargetTerm T2 ⟼(STCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (trans P Q R)
assume "P ⟼(STCal Source Target) P'"
and "⋀P'. P ⟼(STCal Source Target) P'
⟹ ∃Q'. Q ⟼(STCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
from this obtain Q' where D1: "Q ⟼(STCal Source Target) Q'" and D2: "P' ∼⟦⋅⟧T<TRel> Q'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target) Q'
⟹ ∃R'. R ⟼(STCal Source Target) R' ∧ Q' ∼⟦⋅⟧T<TRel> R'"
with D1 obtain R' where D3: "R ⟼(STCal Source Target) R'" and D4: "Q' ∼⟦⋅⟧T<TRel> R'"
by blast
from D2 D4 have "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
with D3 show "∃R'. R ⟼(STCal Source Target) R' ∧ P' ∼⟦⋅⟧T<TRel> R'"
by blast
qed
next
fix P Q Q'
assume "P ∼⟦⋅⟧T<TRel> Q" and "Q ⟼(STCal Source Target) Q'"
thus "∃P'. P ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
proof (induct arbitrary: Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q'"
from this obtain T where E1: "⟦S⟧ ⟼Target T" and E2: "T ∈T Q'"
by (auto simp add: STCal_step(2))
from E1 oc obtain S' where E3: "S ⟼Source S'" and E4: "(⟦S'⟧, T) ∈ TRel"
by blast
from E3 have "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
proof -
have "SourceTerm S' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.encR)
moreover from E2 E4 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
ultimately show "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃P'. SourceTerm S ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (encL S)
assume "SourceTerm S ⟼(STCal Source Target) Q'"
from this obtain S' where F1: "S ⟼Source S'" and F2: "S' ∈S Q'"
by (auto simp add: STCal_step(1))
from F1 oc obtain T where F3: "⟦S⟧ ⟼Target T" and F4: "(⟦S'⟧, T) ∈ TRel"
by blast
from F3 have "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
moreover have "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
proof -
from F4 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
hence "TargetTerm T ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.target)
moreover from F2 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.encL)
ultimately show "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
ultimately show "∃P'. TargetTerm (⟦S⟧) ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ⟼(STCal Source Target) Q'"
from this obtain T2' where G1: "T2 ⟼Target T2'" and G2: "T2' ∈T Q'"
by (auto simp add: STCal_step(2))
assume "(T1, T2) ∈ TRel"
with G1 bisimT obtain T1' where G3: "T1 ⟼Target T1'" and G4: "(T1', T2') ∈ TRel"
by blast
from G3 have "TargetTerm T1 ⟼(STCal Source Target) (TargetTerm T1')"
by (simp add: STCal_step(2))
moreover from G2 G4 have "TargetTerm T1' ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
ultimately show "∃P'. TargetTerm T1 ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
by blast
next
case (trans P Q R R')
assume "R ⟼(STCal Source Target) R'"
and "⋀R'. R ⟼(STCal Source Target) R'
⟹ ∃Q'. Q ⟼(STCal Source Target) Q' ∧ Q' ∼⟦⋅⟧T<TRel> R'"
from this obtain Q' where H1: "Q ⟼(STCal Source Target) Q'" and H2: "Q' ∼⟦⋅⟧T<TRel> R'"
by blast
assume "⋀Q'. Q ⟼(STCal Source Target) Q'
⟹ ∃P'. P ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q'"
with H1 obtain P' where H3: "P ⟼(STCal Source Target) P'" and H4: "P' ∼⟦⋅⟧T<TRel> Q'"
by blast
from H4 H2 have "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
with H3 show "∃P'. P ⟼(STCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> R'"
by blast
qed
qed
next
assume bisim: "strong_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
have "strongly_operational_corresponding TRel"
proof auto
fix S S'
have "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "S ⟼Source S'"
hence "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
ultimately obtain Q' where I1: "TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q'"
and I2: "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
using bisim
by blast
from I1 obtain T where I3: "⟦S⟧ ⟼Target T" and I4: "T ∈T Q'"
by (auto simp add: STCal_step(2))
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with I2 I4 have "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by simp
with I3 show "∃T. ⟦S⟧ ⟼Target T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S T
have "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "⟦S⟧ ⟼Target T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
ultimately obtain Q' where J1: "SourceTerm S ⟼(STCal Source Target) Q'"
and J2: "Q' ∼⟦⋅⟧T<TRel> TargetTerm T"
using bisim
by blast
from J1 obtain S' where J3: "S ⟼Source S'" and J4: "S' ∈S Q'"
by (auto simp add: STCal_step(1))
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with J2 J4 have "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by blast
with J3 show "∃S'. S ⟼Source S' ∧ (⟦S'⟧, T) ∈ TRel"
by blast
qed
moreover have "strong_reduction_bisimulation TRel Target"
proof -
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with bisim show "strong_reduction_bisimulation TRel Target"
using indRelTEQ_impl_TRel_is_strong_reduction_bisimulation[where TRel="TRel"]
by simp
qed
ultimately
show "strongly_operational_corresponding TRel ∧ strong_reduction_bisimulation TRel Target"
by simp
qed
lemma (in encodingLS_encL) SOC_wrt_equivalence_iff_indRelTEQ_strong_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
and inj: "inj encL"
shows "(strongly_operational_corresponding_encL TRel ∧ strong_labelled_bisimulation TRel Target)
⟷ strong_labelled_bisimulation_encL (indRelTEQ TRel)"
proof (rule iffI, erule conjE)
assume oc: "strongly_operational_corresponding_encL TRel"
and bisimT: "strong_labelled_bisimulation TRel Target"
show "strong_labelled_bisimulation_encL (indRelTEQ TRel)"
proof auto
fix P Q α P'
assume "P ∼⟦⋅⟧T<TRel> Q" and "P ─α→(STLCal Source Target) P'"
thus "∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: α P')
case (encR S)
assume "SourceTerm S ─α→(STLCal Source Target) P'"
from this obtain α' S' where A1: "α' ∈SL ⟨SourceTerm S, α⟩" and A2: "S' ∈S P'"
and A3: "S ─α'→Source S'"
using STLCal_labelledStep(1)[of S α P']
by blast
from oc A3 obtain β' T where A4: "⟦S⟧ ─β'→Target T" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉α'⦊ = β'"
by blast
obtain β where A7: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩"
unfolding getTargetLabel_def
by blast
with A4 have A8: "TargetTerm (⟦S⟧) ─β→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β "TargetTerm T"]
by blast
moreover have "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
proof -
from A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.encR)
moreover from A5 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> TargetTerm T"
using indRelTEQ.target[of "⟦S'⟧" T "TRel"]
by simp
ultimately show "P' ∼⟦⋅⟧T<TRel> TargetTerm T"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def encLST_def
by blast
ultimately show "∃β Q'. TargetTerm (⟦S⟧) ─β→(STLCal Source Target) Q' ∧
P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (encL S)
assume "TargetTerm (⟦S⟧) ─α→(STLCal Source Target) P'"
then obtain α' T where A1: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩" and A2: "T ∈T P'"
and A3: "⟦S⟧ ─α'→Target T"
using STLCal_labelledStep(2)[of "⟦S⟧" α P']
by blast
from oc A3 obtain β' S' where A4: "S ─β'→Source S'" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉β'⦊ = α'"
by blast
obtain β where A7: "β' ∈SL ⟨SourceTerm S, β⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─β→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S β "SourceTerm S'"]
by blast
moreover have "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
proof -
from A5 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
with A2 have "P' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (simp add: indRelTEQ.target)
moreover have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.encL)
ultimately show "P' ∼⟦⋅⟧T<TRel> SourceTerm S'"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⦇SourceTerm S, β⦈↦⟨TargetTerm (⟦S⟧), α⟩"
unfolding encLST_def
by blast
hence "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. SourceTerm S ─β→(STLCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T1 ─α→(STLCal Source Target) P'"
from this obtain α' T1' where C1: "α' ∈TL ⟨TargetTerm T1, α⟩" and C2: "T1' ∈T P'"
and C3: "T1 ─α'→Target T1'"
using STLCal_labelledStep(2)[of T1 α P']
by blast
assume "(T1, T2) ∈ TRel"
with bisimT C3 obtain T2' where C4: "T2 ─α'→Target T2'" and C5: "(T1', T2') ∈ TRel"
by blast
from C1 C4 have "TargetTerm T2 ─α→(STLCal Source Target) (TargetTerm T2')"
using STLCal_labelledStep(2)[of T2 α "TargetTerm T2'"]
unfolding getTargetLabel_def
by blast
moreover from C2 C5 have "P' ∼⟦⋅⟧T<TRel> TargetTerm T2'"
by (simp add: indRelTEQ.target)
moreover have "⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, α⟩"
unfolding related_labels_def
by simp
ultimately show "∃β Q'. TargetTerm T2 ─β→(STLCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans P Q R)
assume "P ─α→(STLCal Source Target) P'"
and "⋀α P'. P ─α→(STLCal Source Target) P' ⟹
∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
then obtain β Q' where A1: "Q ─β→(STLCal Source Target) Q'" and A2: "P' ∼⟦⋅⟧T<TRel> Q'"
and A3: "⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
assume "⋀β Q'. Q ─β→(STLCal Source Target) Q' ⟹
∃γ R'. R ─γ→(STLCal Source Target) R' ∧ Q' ∼⟦⋅⟧T<TRel> R' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
with A1 obtain γ R' where A4: "R ─γ→(STLCal Source Target) R'" and A5: "Q' ∼⟦⋅⟧T<TRel> R'"
and A6: "⟨Q, β⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
from A2 A5 have A7: "P' ∼⟦⋅⟧T<TRel> R'"
by (rule indRelTEQ.trans)
from inj A3 A6 have "⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
using related_labels_trans_inj[of P α Q β R γ]
by simp
with A4 A7
show "∃γ R'. R ─γ→(STLCal Source Target) R' ∧ P' ∼⟦⋅⟧T<TRel> R' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨R, γ⟩"
by blast
qed
next
fix P Q β Q'
assume "P ∼⟦⋅⟧T<TRel> Q" and "Q ─β→(STLCal Source Target) Q'"
thus "∃α P'. P ─α→(STLCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨P, α⟩ ≡⦇⦈ ⟨Q, β⟩"
proof (induct arbitrary: β Q')
case (encR S)
assume "TargetTerm (⟦S⟧) ─β→(STLCal Source Target) Q'"
then obtain β' T where A1: "β' ∈TL ⟨TargetTerm (⟦S⟧), β⟩" and A2: "T ∈T Q'"
and A3: "⟦S⟧ ─β'→Target T"
using STLCal_labelledStep(2)[of "⟦S⟧" β Q']
by blast
from oc A3 obtain α' S' where A4: "S ─α'→Source S'" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉α'⦊ = β'"
by blast
obtain α where A7: "α' ∈SL ⟨SourceTerm S, α⟩"
unfolding getSourceLabel_def
by blast
with A4 have "SourceTerm S ─α→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S α "SourceTerm S'"]
by blast
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
proof -
from A2 A5 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
moreover have "SourceTerm S' ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
by (rule indRelTEQ.encR)
ultimately show "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
using indRelTEQ.trans[of "SourceTerm S'" "TargetTerm (⟦S'⟧)" TRel Q']
by simp
qed
moreover from A1 A6 A7 have "⦇SourceTerm S, α⦈↦⟨TargetTerm (⟦S⟧), β⟩"
unfolding encLST_def
by blast
hence "⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'. SourceTerm S ─α→(STLCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨SourceTerm S, α⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β⟩"
by blast
next
case (encL S)
assume "SourceTerm S ─β→(STLCal Source Target) Q'"
from this obtain β' S' where A1: "β' ∈SL ⟨SourceTerm S, β⟩" and A2: "S' ∈S Q'"
and A3: "S ─β'→Source S'"
using STLCal_labelledStep(1)[of S β Q']
by blast
from oc A3 obtain α' T where A4: "⟦S⟧ ─α'→Target T" and A5: "(⟦S'⟧, T) ∈ TRel"
and A6: "⦉β'⦊ = α'"
by blast
obtain α where A7: "α' ∈TL ⟨TargetTerm (⟦S⟧), α⟩"
unfolding getTargetLabel_def
by blast
with A4 have A8: "TargetTerm (⟦S⟧) ─α→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" α "TargetTerm T"]
by blast
moreover have "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
proof -
from A5 eqT have "(T, ⟦S'⟧) ∈ TRel"
unfolding equiv_def sym_def
by blast
hence "TargetTerm T ∼⟦⋅⟧T<TRel> TargetTerm (⟦S'⟧)"
using indRelTEQ.target[of T "⟦S'⟧" "TRel"]
by simp
moreover from A2 have "TargetTerm (⟦S'⟧) ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.encL)
ultimately show "TargetTerm T ∼⟦⋅⟧T<TRel> Q'"
by (rule indRelTEQ.trans)
qed
moreover from A1 A6 A7 have "⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
unfolding related_labels_def encLST_def
by blast
ultimately show "∃α P'. TargetTerm (⟦S⟧) ─α→(STLCal Source Target) P' ∧
P' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨TargetTerm (⟦S⟧), α⟩ ≡⦇⦈ ⟨SourceTerm S, β⟩"
by blast
next
case (target T1 T2)
assume "TargetTerm T2 ─β→(STLCal Source Target) Q'"
from this obtain β' T2' where C1: "β' ∈TL ⟨TargetTerm T2, β⟩" and C2: "T2' ∈T Q'"
and C3: "T2 ─β'→Target T2'"
using STLCal_labelledStep(2)[of T2 β Q']
by blast
assume "(T1, T2) ∈ TRel"
with bisimT C3 obtain T1' where C4: "T1 ─β'→Target T1'" and C5: "(T1', T2') ∈ TRel"
by blast
from C1 C4 have "TargetTerm T1 ─β→(STLCal Source Target) (TargetTerm T1')"
using STLCal_labelledStep(2)[of T1 β "TargetTerm T1'"]
unfolding getTargetLabel_def
by blast
moreover from C2 C5 have "TargetTerm T1' ∼⟦⋅⟧T<TRel> Q'"
by (simp add: indRelTEQ.target)
moreover have "⟨TargetTerm T1, β⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
unfolding related_labels_def
by simp
ultimately show "∃α P'. TargetTerm T1 ─α→(STLCal Source Target) P' ∧ P' ∼⟦⋅⟧T<TRel> Q' ∧
⟨TargetTerm T1, α⟩ ≡⦇⦈ ⟨TargetTerm T2, β⟩"
by blast
next
case (trans R Q P α P')
assume "P ─α→(STLCal Source Target) P'"
and "⋀α P'. P ─α→(STLCal Source Target) P' ⟹
∃β Q'. Q ─β→(STLCal Source Target) Q' ∧ Q' ∼⟦⋅⟧T<TRel> P' ∧ ⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
then obtain β Q' where A1: "Q ─β→(STLCal Source Target) Q'" and A2: "Q' ∼⟦⋅⟧T<TRel> P'"
and A3: "⟨Q, β⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
assume "⋀β Q'. Q ─β→(STLCal Source Target) Q' ⟹
∃γ R'. R ─γ→(STLCal Source Target) R' ∧ R' ∼⟦⋅⟧T<TRel> Q' ∧ ⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
with A1 obtain γ R' where A4: "R ─γ→(STLCal Source Target) R'" and A5: "R' ∼⟦⋅⟧T<TRel> Q'"
and A6: "⟨R, γ⟩ ≡⦇⦈ ⟨Q, β⟩"
by blast
from A2 A5 have A7: "R' ∼⟦⋅⟧T<TRel> P'"
using indRelTEQ.trans[of R' Q' TRel P']
by simp
from inj A3 A6 have "⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
using related_labels_trans_inj[of R γ Q β P α]
by simp
with A4 A7
show "∃γ R'. R ─γ→(STLCal Source Target) R' ∧ R' ∼⟦⋅⟧T<TRel> P' ∧ ⟨R, γ⟩ ≡⦇⦈ ⟨P, α⟩"
by blast
qed
qed
next
assume bisim: "strong_labelled_bisimulation_encL (indRelTEQ TRel)"
have "strongly_operational_corresponding_encL TRel"
proof auto
fix S α S'
obtain α' where A1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
have A2: "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
moreover assume "S ─α→Source S'"
with A1 have "SourceTerm S ─α'→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S α' "SourceTerm S'"]
by blast
with bisim A2 obtain β' Q' where A3: "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) Q'"
and A4: "SourceTerm S' ∼⟦⋅⟧T<TRel> Q'"
and A5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from A3 obtain β T where A6: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩" and A7: "T ∈T Q'"
and A8: "⟦S⟧ ─β→Target T"
using STLCal_labelledStep(2)[of "⟦S⟧" β' Q']
by blast
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with A4 A7 have A9: "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by simp
from A1 A5 A6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A8 A9 show "∃T. ⟦S⟧ ─⦉α⦊→Target T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S β T
obtain β' where A1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
have A2: "SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧)"
by (rule indRelTEQ.encR)
assume "⟦S⟧ ─β→Target T"
with A1 have "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with bisim A2 obtain α' Q' where A3: "SourceTerm S ─α'→(STLCal Source Target) Q'"
and A4: "Q' ∼⟦⋅⟧T<TRel> TargetTerm T"
and A5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from A3 obtain α S' where A6: "α ∈SL ⟨SourceTerm S, α'⟩" and A7: "S' ∈S Q'"
and A8: "S ─α→Source S'"
using STLCal_labelledStep(1)[of S α' Q']
by blast
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with A4 A7 have A9: "(⟦S'⟧, T) ∈ TRel"
using indRelTEQ_to_TRel(2)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by blast
from A1 A5 A6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with A8 A9 show "∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β"
by blast
qed
moreover have "strong_labelled_bisimulation TRel Target"
proof -
from eqT have "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
with bisim show "strong_labelled_bisimulation TRel Target"
using indRelTEQ_impl_TRel_is_strong_labelled_bisimulation_encL[where TRel="TRel"]
by simp
qed
ultimately show "strongly_operational_corresponding_encL TRel ∧
strong_labelled_bisimulation TRel Target"
by simp
qed
lemma (in encoding) SOC_wrt_equivalence_iff_strong_reduction_bisimulation:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
shows "(strongly_operational_corresponding TRel ∧ strong_reduction_bisimulation TRel Target)
⟷ (∃Rel.
(∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ trans Rel ∧ strong_reduction_bisimulation Rel (STCal Source Target))"
proof (rule iffI, erule conjE)
assume oc: "strongly_operational_corresponding TRel"
and bisimT: "strong_reduction_bisimulation TRel Target"
from eqT have rt: "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
have "∀S. SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧) ∧ TargetTerm (⟦S⟧) ∼⟦⋅⟧T<TRel> SourceTerm S"
by (simp add: indRelTEQ.encR indRelTEQ.encL)
moreover from rt have "TRel = {(T1, T2). TargetTerm T1 ∼⟦⋅⟧T<TRel> TargetTerm T2}"
using indRelTEQ_to_TRel(4)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by (auto simp add: indRelTEQ.target)
moreover have "trans (indRelTEQ TRel)"
using indRelTEQ.trans[where TRel="TRel"]
unfolding trans_def
by blast
moreover from eqT oc bisimT
have "strong_reduction_bisimulation (indRelTEQ TRel) (STCal Source Target)"
using SOC_wrt_equivalence_iff_indRelTEQ_strong_reduction_bisimulation[where TRel="TRel"]
by blast
ultimately
show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ strong_reduction_bisimulation Rel (STCal Source Target)"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel"
and A2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}" and A3: "trans Rel"
and A4: "strong_reduction_bisimulation Rel (STCal Source Target)"
by blast
have "strongly_operational_corresponding TRel"
proof auto
fix S S'
from A1 have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "S ⟼Source S'"
hence "SourceTerm S ⟼(STCal Source Target) (SourceTerm S')"
by (simp add: STCal_step(1))
ultimately obtain Q' where B1: "TargetTerm (⟦S⟧) ⟼(STCal Source Target) Q'"
and B2: "(SourceTerm S', Q') ∈ Rel"
using A4
by blast
from B1 obtain T where B3: "⟦S⟧ ⟼Target T" and B4: "T ∈T Q'"
by (auto simp add: STCal_step(2))
from A1 have "(TargetTerm (⟦S'⟧), SourceTerm S') ∈ Rel"
by simp
with B2 A3 have "(TargetTerm (⟦S'⟧), Q') ∈ Rel"
unfolding trans_def
by blast
with B4 A2 have "(⟦S'⟧, T) ∈ TRel"
by simp
with B3 show "∃T. ⟦S⟧ ⟼Target T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S T
from A1 have "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
moreover assume "⟦S⟧ ⟼Target T"
hence "TargetTerm (⟦S⟧) ⟼(STCal Source Target) (TargetTerm T)"
by (simp add: STCal_step(2))
ultimately obtain P' where C1: "SourceTerm S ⟼(STCal Source Target) P'"
and C2: "(P', TargetTerm T) ∈ Rel"
using A4
by blast
from C1 obtain S' where C3: "S ⟼Source S'" and C4: "S' ∈S P'"
by (auto simp add: STCal_step(1))
from A1 C4 have "(TargetTerm (⟦S'⟧), P') ∈ Rel"
by simp
from A3 this C2 have "(TargetTerm (⟦S'⟧), TargetTerm T) ∈ Rel"
unfolding trans_def
by blast
with A2 have "(⟦S'⟧, T) ∈ TRel"
by simp
with C3 show "∃S'. S ⟼Source S' ∧ (⟦S'⟧, T) ∈ TRel"
by blast
qed
moreover have "strong_reduction_bisimulation TRel Target"
proof auto
fix TP TQ TP'
assume "(TP, TQ) ∈ TRel"
with A2 have "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
moreover assume "TP ⟼Target TP'"
hence "TargetTerm TP ⟼(STCal Source Target) (TargetTerm TP')"
by (simp add: STCal_step(2))
ultimately obtain Q' where D1: "TargetTerm TQ ⟼(STCal Source Target) Q'"
and D2: "(TargetTerm TP', Q') ∈ Rel"
using A4
by blast
from D1 obtain TQ' where D3: "TQ ⟼Target TQ'" and D4: "TQ' ∈T Q'"
by (auto simp add: STCal_step(2))
from A2 D2 D4 have "(TP', TQ') ∈ TRel"
by simp
with D3 show "∃TQ'. TQ ⟼Target TQ' ∧ (TP', TQ') ∈ TRel"
by blast
next
fix TP TQ TQ'
assume "(TP, TQ) ∈ TRel"
with A2 have "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
moreover assume "TQ ⟼Target TQ'"
hence "TargetTerm TQ ⟼(STCal Source Target) (TargetTerm TQ')"
by (simp add: STCal_step(2))
ultimately obtain P' where E1: "TargetTerm TP ⟼(STCal Source Target) P'"
and E2: "(P', TargetTerm TQ') ∈ Rel"
using A4
by blast
from E1 obtain TP' where E3: "TP ⟼Target TP'" and E4: "TP' ∈T P'"
by (auto simp add: STCal_step(2))
from A2 E2 E4 have "(TP', TQ') ∈ TRel"
by simp
with E3 show "∃TP'. TP ⟼Target TP' ∧ (TP', TQ') ∈ TRel"
by blast
qed
ultimately
show "strongly_operational_corresponding TRel ∧ strong_reduction_bisimulation TRel Target"
by simp
qed
lemma (in encodingLS_encL) SOC_wrt_equivalence_iff_strong_labelled_bisimulation_encL:
fixes TRel :: "('procT × 'procT) set"
assumes eqT: "equivalence TRel"
and inj: "inj encL"
shows "(strongly_operational_corresponding_encL TRel ∧ strong_labelled_bisimulation TRel Target)
⟷ (∃Rel.
(∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}
∧ trans Rel ∧ strong_labelled_bisimulation_encL Rel)"
proof (rule iffI, erule conjE)
assume oc: "strongly_operational_corresponding_encL TRel"
and bisimT: "strong_labelled_bisimulation TRel Target"
from eqT have rt: "TRel⇧* = TRel"
using reflcl_trancl[of TRel] trancl_id[of TRel]
unfolding equiv_def refl_on_def
by auto
have "∀S. SourceTerm S ∼⟦⋅⟧T<TRel> TargetTerm (⟦S⟧) ∧ TargetTerm (⟦S⟧) ∼⟦⋅⟧T<TRel> SourceTerm S"
by (simp add: indRelTEQ.encR indRelTEQ.encL)
moreover from rt have "TRel = {(T1, T2). TargetTerm T1 ∼⟦⋅⟧T<TRel> TargetTerm T2}"
using indRelTEQ_to_TRel(4)[where TRel="TRel"]
trans_closure_of_TRel_refl_cond[where TRel="TRel"]
by (auto simp add: indRelTEQ.target)
moreover have "trans (indRelTEQ TRel)"
using indRelTEQ.trans[where TRel="TRel"]
unfolding trans_def
by blast
moreover from eqT inj oc bisimT
have "strong_labelled_bisimulation_encL (indRelTEQ TRel)"
using SOC_wrt_equivalence_iff_indRelTEQ_strong_labelled_bisimulation_encL[where TRel="TRel"]
by blast
ultimately
show "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel ∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ strong_labelled_bisimulation_encL Rel"
by blast
next
assume "∃Rel. (∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel)
∧ TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel} ∧ trans Rel
∧ strong_labelled_bisimulation_encL Rel"
from this obtain Rel where A1: "∀S. (SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel
∧ (TargetTerm (⟦S⟧), SourceTerm S) ∈ Rel"
and A2: "TRel = {(T1, T2). (TargetTerm T1, TargetTerm T2) ∈ Rel}" and A3: "trans Rel"
and A4: "strong_labelled_bisimulation_encL Rel"
by blast
have "strongly_operational_corresponding_encL TRel"
proof auto
fix S α S'
obtain α' where B1: "α ∈SL ⟨SourceTerm S, α'⟩"
unfolding getSourceLabel_def
by blast
from A1 have B2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "S ─α→Source S'"
with B1 have "SourceTerm S ─α'→(STLCal Source Target) (SourceTerm S')"
using STLCal_labelledStep(1)[of S α' "SourceTerm S'"]
by blast
with A4 B2 obtain β' Q' where B3: "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) Q'"
and B4: "(SourceTerm S', Q') ∈ Rel"
and B5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from B3 obtain β T where B6: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩" and B7: "T ∈T Q'"
and B8: "⟦S⟧ ─β→Target T"
using STLCal_labelledStep(2)[of "⟦S⟧" β' Q']
by blast
from A1 have "(TargetTerm (⟦S'⟧), SourceTerm S') ∈ Rel"
by simp
with A3 B4 have "(TargetTerm (⟦S'⟧), Q') ∈ Rel"
using transD[of Rel "TargetTerm (⟦S'⟧)" "SourceTerm S'" Q']
by simp
with A2 B7 have B9: "(⟦S'⟧, T) ∈ TRel"
by simp
from B1 B5 B6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with B8 B9 show "∃T. ⟦S⟧ ─⦉α⦊→Target T ∧ (⟦S'⟧, T) ∈ TRel"
by blast
next
fix S β T
obtain β' where B1: "β ∈TL ⟨TargetTerm (⟦S⟧), β'⟩"
unfolding getTargetLabel_def
by blast
from A1 have B2: "(SourceTerm S, TargetTerm (⟦S⟧)) ∈ Rel"
by simp
assume "⟦S⟧ ─β→Target T"
with B1 have "TargetTerm (⟦S⟧) ─β'→(STLCal Source Target) (TargetTerm T)"
using STLCal_labelledStep(2)[of "⟦S⟧" β' "TargetTerm T"]
by blast
with A4 B2 obtain α' P' where B3: "SourceTerm S ─α'→(STLCal Source Target) P'"
and B4: "(P', TargetTerm T) ∈ Rel"
and B5: "⟨SourceTerm S, α'⟩ ≡⦇⦈ ⟨TargetTerm (⟦S⟧), β'⟩"
by blast
from B3 obtain α S' where B6: "α ∈SL ⟨SourceTerm S, α'⟩" and B7: "S' ∈S P'"
and B8: "S ─α→Source S'"
using STLCal_labelledStep(1)[of S α' P']
by blast
from A1 B7 have "(TargetTerm (⟦S'⟧), P') ∈ Rel"
by simp
with A3 B4 have "(TargetTerm (⟦S'⟧), TargetTerm T) ∈ Rel"
using transD[of Rel "TargetTerm (⟦S'⟧)" P' "TargetTerm T"]
by simp
with A2 have B9: "(⟦S'⟧, T) ∈ TRel"
by simp
from B1 B5 B6 have "⦉α⦊ = β"
unfolding related_labels_def encLST_def getSourceLabel_def getTargetLabel_def
by blast
with B8 B9 show "∃α S'. S ─α→Source S' ∧ (⟦S'⟧, T) ∈ TRel ∧ ⦉α⦊ = β"
by blast
qed
moreover have "strong_labelled_bisimulation TRel Target"
proof auto
fix TP TQ α TP'
obtain α' where B1: "α ∈TL ⟨TargetTerm TP, α'⟩"
unfolding getTargetLabel_def
by blast
assume "(TP, TQ) ∈ TRel"
with A2 have B2: "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
assume "TP ─α→Target TP'"
with B1 have "TargetTerm TP ─α'→(STLCal Source Target) (TargetTerm TP')"
using STLCal_labelledStep(2)[of TP α' "TargetTerm TP'"]
by blast
with A4 B2 obtain β' Q' where B3: "TargetTerm TQ ─β'→(STLCal Source Target) Q'"
and B4: "(TargetTerm TP', Q') ∈ Rel"
and B5: "⟨TargetTerm TP, α'⟩ ≡⦇⦈ ⟨TargetTerm TQ, β'⟩"
by blast
from B5 have "β' = α'"
using related_labels_equal[of "TargetTerm TP" α' "TargetTerm TQ" β']
by simp
with B1 B3 obtain TQ' where B6: "TQ' ∈T Q'" and B7: "TQ ─α→Target TQ'"
using STLCal_labelledStep(2)[of TQ α' Q']
unfolding getTargetLabel_def
by blast
from A2 B4 B6 have "(TP', TQ') ∈ TRel"
by simp
with B7 show "∃TQ'. TQ ─α→Target TQ' ∧ (TP', TQ') ∈ TRel"
by blast
next
fix TP TQ α TQ'
obtain α' where B1: "α ∈TL ⟨TargetTerm TQ, α'⟩"
unfolding getTargetLabel_def
by blast
assume "(TP, TQ) ∈ TRel"
with A2 have B2: "(TargetTerm TP, TargetTerm TQ) ∈ Rel"
by simp
assume "TQ ─α→Target TQ'"
with B1 have "TargetTerm TQ ─α'→(STLCal Source Target) (TargetTerm TQ')"
using STLCal_labelledStep(2)[of TQ α' "TargetTerm TQ'"]
by blast
with A4 B2 obtain β' P' where B3: "TargetTerm TP ─β'→(STLCal Source Target) P'"
and B4: "(P', TargetTerm TQ') ∈ Rel"
and B5: "⟨TargetTerm TP, β'⟩ ≡⦇⦈ ⟨TargetTerm TQ, α'⟩"
by blast
from B5 have "β' = α'"
using related_labels_equal[of "TargetTerm TP" β' "TargetTerm TQ" α']
by simp
with B1 B3 obtain TP' where B6: "TP' ∈T P'" and B7: "TP ─α→Target TP'"
using STLCal_labelledStep(2)[of TP α' P']
unfolding getTargetLabel_def
by blast
from A2 B4 B6 have "(TP', TQ') ∈ TRel"
by simp
with B7 show "∃TP'. TP ─α→Target TP' ∧ (TP', TQ') ∈ TRel"
by blast
qed
ultimately show "strongly_operational_corresponding_encL TRel ∧
strong_labelled_bisimulation TRel Target"
by simp
qed
end