Small step operational semantics for pGCL #
Main definitions #
pGCL.SmallStep: The inductive definition of the probabilistic small step semantics ofpGCL.
Probabilistic small step operational semantics for pGCL
- skip {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {σ : State Γ} : (pgcl {skip}, σ) ⤳[Act.N,1] (Sum.inr Termination.term, σ)
- assign {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {x : 𝒱} {e : State Γ → Γ x} {σ : State Γ} : (pgcl {@x := @e}, σ) ⤳[Act.N,1] (Sum.inr Termination.term, σ[x ↦ e σ])
- prob {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C : pGCL Γ} {p : ProbExp Γ} {σ : State Γ} : (pgcl {{ @C } [@p] { @C }}, σ) ⤳[Act.N,1] (Sum.inl C, σ)
- prob_L {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ C₂ : pGCL Γ} {p : ProbExp Γ} {σ : State Γ} (h : ¬C₁ = C₂) (h' : 0 < p σ) : (pgcl {{ @C₁ } [@p] { @C₂ }}, σ) ⤳[Act.N,p σ] (Sum.inl C₁, σ)
- prob_R {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ C₂ : pGCL Γ} {p : ProbExp Γ} {σ : State Γ} (h : ¬C₁ = C₂) (h' : p σ < 1) : (pgcl {{ @C₁ } [@p] { @C₂ }}, σ) ⤳[Act.N,1 - p σ] (Sum.inl C₂, σ)
- nonDet_L {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ C₂ : pGCL Γ} {σ : State Γ} : (pgcl {{ @C₁ } [] { @C₂ }}, σ) ⤳[Act.L,1] (Sum.inl C₁, σ)
- nonDet_R {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ C₂ : pGCL Γ} {σ : State Γ} : (pgcl {{ @C₁ } [] { @C₂ }}, σ) ⤳[Act.R,1] (Sum.inl C₂, σ)
- tick {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {r : State Γ → ENNReal} {σ : State Γ} : (pgcl {tick(@r)}, σ) ⤳[Act.N,1] (Sum.inr Termination.term, σ)
- observe₁ {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {b : State Γ → Prop} {σ : State Γ} : b σ → (pgcl {observe(@b)}, σ) ⤳[Act.N,1] (Sum.inr Termination.term, σ)
- observe₂ {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {b : State Γ → Prop} {σ : State Γ} : ¬b σ → (pgcl {observe(@b)}, σ) ⤳[Act.N,1] (Sum.inr Termination.fault, σ)
- seq_L {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ : pGCL Γ} {σ : State Γ} {α : Act} {p : ENNReal} {τ : State Γ} {C₂ : pGCL Γ} : ((C₁, σ) ⤳[α,p] (Sum.inr Termination.term, τ)) → (pgcl {@C₁ ; @C₂}, σ) ⤳[α,p] (Sum.inl C₂, τ)
- seq_R {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ : pGCL Γ} {σ : State Γ} {α : Act} {p : ENNReal} {C₁' : pGCL Γ} {τ : State Γ} {C₂ : pGCL Γ} : ((C₁, σ) ⤳[α,p] (Sum.inl C₁', τ)) → (pgcl {@C₁ ; @C₂}, σ) ⤳[α,p] (Sum.inl (pgcl {@C₁' ; @C₂}), τ)
- seq_F {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {C₁ : pGCL Γ} {σ : State Γ} {C₂ : pGCL Γ} : ((C₁, σ) ⤳[Act.N,1] (Sum.inr Termination.fault, σ)) → (pgcl {@C₁ ; @C₂}, σ) ⤳[Act.N,1] (Sum.inr Termination.fault, σ)
- loop {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {b : State Γ → Prop} {C : pGCL Γ} {σ : State Γ} : ¬b σ → (pgcl {while @b { @C }}, σ) ⤳[Act.N,1] (Sum.inr Termination.term, σ)
- loop' {𝒱 : Type u_1} {Γ : 𝒱 → Type u_2} [DecidableEq 𝒱] {b : State Γ → Prop} {C : pGCL Γ} {σ : State Γ} : b σ → (pgcl {while @b { @C }}, σ) ⤳[Act.N,1] (Sum.inl (pgcl {@C ; while @b { @C }}), σ)
Instances For
Probabilistic small step operational semantics for pGCL
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
pGCL.SmallStep.to_fault
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
{σ : State Γ}
{α : Act}
{p : ENNReal}
:
@[simp]
theorem
pGCL.SmallStep.observe_iff
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c' : Conf₁ Γ}
{σ : State Γ}
{b : State Γ → Prop}
{α : Act}
{p : ENNReal}
:
@[simp]
theorem
pGCL.SmallStep.seq_iff
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c' : Conf₁ Γ}
{σ : State Γ}
{α : Act}
{p : ENNReal}
{C₁ C₂ : pGCL Γ}
:
((pgcl {@C₁ ; @C₂}, σ) ⤳[α,p] c') ↔ (∃ (C' : pGCL Γ) (σ' : State Γ), ((C₁, σ) ⤳[α,p] (Sum.inl C', σ')) ∧ c' = (Sum.inl (pgcl {@C' ; @C₂}), σ')) ∨ (∃ (σ' : State Γ), ((C₁, σ) ⤳[α,p] (Sum.inr Termination.term, σ')) ∧ c' = (Sum.inl C₂, σ')) ∨ ((C₁, σ) ⤳[α,p] (Sum.inr Termination.fault, σ)) ∧ c' = (Sum.inr Termination.fault, σ) ∧ α = Act.N ∧ p = 1
Instances For
@[implicit_reducible]
noncomputable instance
pGCL.SmallStep.instDecidableMemActSetAct
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
{α : Act}
:
instance
pGCL.SmallStep.instFiniteElemActAct
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
:
@[implicit_reducible]
noncomputable instance
pGCL.SmallStep.instFintypeElemActAct
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
:
instance
pGCL.SmallStep.act_nonempty
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
(s : Conf₀ Γ)
:
@[simp]
theorem
pGCL.SmallStep.iInf_act_const
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{C : Conf₀ Γ}
{x : ENNReal}
:
@[implicit_reducible]
noncomputable instance
pGCL.SmallStep.instDecidable
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
{c' : Conf₁ Γ}
{α : Act}
{p : ENNReal}
:
Equations
@[implicit_reducible]
noncomputable instance
pGCL.SmallStep.instDecidableExistsActENNReal
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
{c : Conf₀ Γ}
{c' : Conf₁ Γ}
:
Equations
- pGCL.SmallStep.instDecidableExistsActENNReal = Classical.propDecidable (∃ (α : pGCL.Act) (p : ENNReal), c ⤳[α,p] c')
def
pGCL.SmallStep.succs
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
(c : Conf₀ Γ)
(α : Act)
:
Instances For
@[irreducible]
noncomputable def
pGCL.SmallStep.succs_fin
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
(c : Conf₀ Γ)
(α : Act)
:
Equations
- pGCL.SmallStep.succs_fin (pgcl {skip}, σ) pGCL.Act.N = {(Sum.inr pGCL.Termination.term, σ)}
- pGCL.SmallStep.succs_fin (pgcl {tick(@a)}, σ) pGCL.Act.N = {(Sum.inl (pgcl {skip}), σ)}
- pGCL.SmallStep.succs_fin (pgcl {observe(@b)}, σ) pGCL.Act.N = if b σ then {(Sum.inl (pgcl {skip}), σ)} else {(Sum.inr pGCL.Termination.fault, σ)}
- pGCL.SmallStep.succs_fin (pgcl {@x := @E}, σ) pGCL.Act.N = {(Sum.inl (pgcl {skip}), σ[x ↦ E σ])}
- pGCL.SmallStep.succs_fin (pgcl {{ @C₁ } [@p] { @C₂ }}, σ) pGCL.Act.N = if p σ = 0 then {(Sum.inl C₂, σ)} else if p σ = 1 then {(Sum.inl C₁, σ)} else {(Sum.inl C₁, σ), (Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_fin (pgcl {{ @C₁ } [] { @a }}, σ) pGCL.Act.L = {(Sum.inl C₁, σ)}
- pGCL.SmallStep.succs_fin (pgcl {{ @a } [] { @C₂ }}, σ) pGCL.Act.R = {(Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_fin (pgcl {while @b { @C }}, σ) pGCL.Act.N = if b σ then {(Sum.inl (pgcl {@C ; while @b { @C }}), σ)} else {(Sum.inl (pgcl {skip}), σ)}
- pGCL.SmallStep.succs_fin (pgcl {skip ; @C₂}, σ) pGCL.Act.N = {(Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_fin (pgcl {@C₁ ; @C₂}, σ) α = Finset.map { toFun := C₂.after, inj' := ⋯ } (pGCL.SmallStep.succs_fin (C₁, σ) α)
- pGCL.SmallStep.succs_fin c α = ∅
Instances For
@[irreducible]
noncomputable def
pGCL.SmallStep.succs_univ_fin
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
(c : Conf₀ Γ)
:
Equations
- One or more equations did not get rendered due to their size.
- pGCL.SmallStep.succs_univ_fin (pgcl {skip}, σ) = {(pGCL.Act.N, Sum.inr pGCL.Termination.term, σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {tick(@a)}, σ) = {(pGCL.Act.N, Sum.inl (pgcl {skip}), σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {observe(@b)}, σ) = if b σ then {(pGCL.Act.N, Sum.inl (pgcl {skip}), σ)} else {(pGCL.Act.N, Sum.inr pGCL.Termination.fault, σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {@x := @E}, σ) = {(pGCL.Act.N, Sum.inl (pgcl {skip}), σ[x ↦ E σ])}
- pGCL.SmallStep.succs_univ_fin (pgcl {{ @C₁ } [] { @C₂ }}, σ) = {(pGCL.Act.L, Sum.inl C₁, σ), (pGCL.Act.R, Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {while @b { @C }}, σ) = if b σ then {(pGCL.Act.N, Sum.inl (pgcl {@C ; while @b { @C }}), σ)} else {(pGCL.Act.N, Sum.inl (pgcl {skip}), σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {skip ; @C₂}, σ) = {(pGCL.Act.N, Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_univ_fin (pgcl {@C₁ ; @C₂}, σ) = Finset.map { toFun := Prod.map id C₂.after, inj' := ⋯ } (pGCL.SmallStep.succs_univ_fin (C₁, σ))
Instances For
@[irreducible]
noncomputable def
pGCL.SmallStep.succs_univ_fin'
{𝒱 : Type u_1}
{Γ : 𝒱 → Type u_2}
[DecidableEq 𝒱]
(c : Conf₀ Γ)
:
Equations
- One or more equations did not get rendered due to their size.
- pGCL.SmallStep.succs_univ_fin' (pgcl {skip}, σ) = {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.term, σ)}
- pGCL.SmallStep.succs_univ_fin' (pgcl {tick(@a)}, σ) = {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.term, σ)}
- pGCL.SmallStep.succs_univ_fin' (pgcl {observe(@b)}, σ) = if b σ then {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.term, σ)} else {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.fault, σ)}
- pGCL.SmallStep.succs_univ_fin' (pgcl {@x := @E}, σ) = {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.term, σ[x ↦ E σ])}
- pGCL.SmallStep.succs_univ_fin' (pgcl {{ @C₁ } [] { @C₂ }}, σ) = {(pGCL.Act.L, 1, Sum.inl C₁, σ), (pGCL.Act.R, 1, Sum.inl C₂, σ)}
- pGCL.SmallStep.succs_univ_fin' (pgcl {while @b { @C }}, σ) = if b σ then {(pGCL.Act.N, 1, Sum.inl (pgcl {@C ; while @b { @C }}), σ)} else {(pGCL.Act.N, 1, Sum.inr pGCL.Termination.term, σ)}
- pGCL.SmallStep.succs_univ_fin' (pgcl {@C₁ ; @C₂}, σ) = Finset.map { toFun := Prod.map id (Prod.map id C₂.after), inj' := ⋯ } (pGCL.SmallStep.succs_univ_fin' (C₁, σ))