Documentation

HeyVL.Semantics

@[simp]
@[simp]
theorem HeyLo.ofNat_sem {σ : pGCL.State Ty.Γ} (n : ) :
@[simp]
@[simp]
@[simp]
theorem HeyLo.sem_var {a : String} {t : Ty} {σ : pGCL.State Ty.Γ} :
@(Var a t)⟧' σ = σ { name := a, type := t }
@[simp]
theorem HeyLo.sem_binop {α : Ty} {A B : HeyLo α} {a✝ : Ty} {op : BinOp α a✝} :
@[simp]
theorem HeyLo.sem_unop {α : Ty} {A : HeyLo α} {a✝ : Ty} {op : UnOp α a✝} :
@[simp]
theorem HeyLo.sem_eq {α : Ty} {A B : HeyLo α} :
(@A = @B⟧') = fun (σ : pGCL.State Ty.Γ) => @A⟧' σ = @B⟧' σ
@[simp]
@[simp]
@[simp]
theorem HeyLo.sem_lit_apply {a✝ : Ty} {l : Literal a✝} :
@[simp]
theorem HeyLo.sem_subst_apply' {A : HeyLo Ty.ENNReal} {xs : List ((v : Ident) × HeyLo v.type)} :
@(A[..xs])⟧' = @A⟧'[..List.map (fun (x : (v : Ident) × HeyLo v.type) => x.fst, @x.snd⟧') xs]
@[simp]
theorem HeyLo.sem_subst_apply {x : Ident} {P : HeyLo Ty.Bool} {X : HeyLo x.type} {σ : pGCL.State Ty.Γ} :
@(P[x X])⟧' σ = @P⟧' (σ[x @X⟧' σ])
@[simp]
theorem HeyLo.substs_inf {xs : List ((a : Ident) × (pGCL.State Ty.ΓTy.Γ a))} {A B : HeyLo Ty.ENNReal} :
@[simp]
theorem Distribution.map_toExpr_apply {σ : pGCL.State HeyLo.Ty.Γ} (x : HeyLo.Ident) (μ : HeyLo.Distribution x.type) (f : HeyLo x.typeHeyLo HeyLo.Ty.ENNReal) :
@(μ.map f).toExpr⟧' σ = (Array.map (fun (x_1 : HeyLo HeyLo.Ty.ENNReal × HeyLo x.type) => match x_1 with | (a, b) => @a⟧' σ * @(f b)⟧' σ) μ.values).sum
@[simp]
theorem HeyLo.Var_sem_subst {n : String} {t : Ty} {x : Ident} {v : pGCL.State Ty.ΓTy.Γ x} :
@(Var n t)⟧'[x v] = if h : x = { name := n, type := t } then cast v else fun (x : pGCL.State Ty.Γ) => x { name := n, type := t }
def Substitution.applied (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) (xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))) :
Equations
Instances For
    theorem BExpr.subst_applied {b : pGCL.BExpr fun (x : HeyLo.Ident) => x.type.lit} {xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))} :
    b[..xs] = fun (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) => b (Substitution.applied σ xs)
    theorem BExpr.subst_apply {σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit} {b : pGCL.BExpr fun (x : HeyLo.Ident) => x.type.lit} {xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))} :
    (b[..xs]) σ = b (Substitution.applied σ xs)
    theorem Exp.subst_applied {α : Type u_1} {b : pGCL.State HeyLo.Ty.Γα} {xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))} :
    b[..xs] = fun (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) => b (Substitution.applied σ xs)
    theorem Exp.subst_apply {α : Type u_1} {σ : pGCL.State HeyLo.Ty.Γ} {b : pGCL.State HeyLo.Ty.Γα} {xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))} :
    (b[..xs]) σ = b (Substitution.applied σ xs)
    structure HeyVL.Subs (Vars : List HeyLo.Ident) (hn : Vars.Nodup) :
    Instances For
      @[implicit_reducible]
      instance instInhabitedSubs {xs : List HeyLo.Ident} {hn : xs.Nodup} :
      Equations
      @[simp]
      theorem HeyVL.Subs.values_nil {hn : [].Nodup} (S : Subs [] hn) :
      def HeyVL.Subs.cons {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) (x : HeyLo.Ident) (v : x.type.lit) (hv : xxs) :
      Subs (x :: xs)
      Equations
      Instances For
        def HeyVL.Subs.tail {x : HeyLo.Ident} {xs : List HeyLo.Ident} {hn : (x :: xs).Nodup} (S : Subs (x :: xs) hn) :
        x.type.lit × Subs xs
        Equations
        Instances For
          @[simp]
          theorem HeyVL.Subs.values_length {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) :
          def HeyVL.Subs.help {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) :
          Equations
          Instances For
            def HeyVL.Subs.help' {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) :
            List ((v : HeyLo.Ident) × v.type.lit)
            Equations
            Instances For
              @[simp]
              theorem HeyVL.Subs.help_length {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) :
              @[simp]
              theorem HeyVL.Subs.help_cons {x : HeyLo.Ident} {xs : List HeyLo.Ident} {hn : (x :: xs).Nodup} (S : Subs (x :: xs) hn) :
              S.help = x, fun (x_1 : pGCL.State HeyLo.Ty.Γ) => S.tail.1 :: S.tail.2.help
              @[simp]
              theorem HeyVL.Subs.help'_cons {x : HeyLo.Ident} {xs : List HeyLo.Ident} {hn : (x :: xs).Nodup} (S : Subs (x :: xs) hn) :
              S.help' = x, S.tail.1 :: S.tail.2.help'
              def HeyVL.Subs.get {xs : List HeyLo.Ident} {hn : xs.Nodup} (S : Subs xs hn) (x : HeyLo.Ident) (hx : x xs) :
              Equations
              Instances For
                @[simp]
                theorem HeyVL.Subs.tail_get {x : HeyLo.Ident} {xs : List HeyLo.Ident} {hn : (x :: xs).Nodup} (S : Subs (x :: xs) hn) (y : HeyLo.Ident) (hy : y xs) :
                S.tail.2.get y hy = S.get y
                theorem HeyVL.Subs.tail_1_eq_get {x : HeyLo.Ident} {xs : List HeyLo.Ident} {hn : (x :: xs).Nodup} (S : Subs (x :: xs) hn) :
                S.tail.1 = S.get x
                @[simp]
                theorem HeyVL.Subs.subst_help'_apply {xs : List HeyLo.Ident} {hn : xs.Nodup} {y : HeyLo.Ident} (S : Subs xs hn) (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) :
                (σ[..S.help']) y = if h : y xs then S.get y h else σ y
                @[simp]
                theorem Exp.substs_help_apply {α : Type u_1} {xs : List HeyLo.Ident} {hxs : xs.Nodup} {σ : pGCL.State HeyLo.Ty.Γ} (m : pGCL.State HeyLo.Ty.Γα) (Ξ : HeyVL.Subs xs hxs) :
                (m[..Ξ.help]) σ = m (σ[..Ξ.help'])
                @[simp]
                theorem BExpr.substs_help_apply {xs : List HeyLo.Ident} {hxs : xs.Nodup} {σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit} (m : pGCL.BExpr fun (x : HeyLo.Ident) => x.type.lit) (Ξ : HeyVL.Subs xs hxs) :
                (m[..Ξ.help]) σ = m (σ[..Ξ.help'])
                theorem HeyLo.sem_substs_apply {α : Ty} {xs : List ((a : Ident) × (pGCL.State Ty.ΓTy.Γ a))} {σ : pGCL.State Ty.Γ} (m : HeyLo α) :
                theorem HeyLo.sem_substs_apply' {α : Ty} {xs : List Ident} {hxs : xs.Nodup} {σ : pGCL.State Ty.Γ} (m : HeyLo α) (Ξ : HeyVL.Subs xs hxs) :
                theorem Substitution.applied_subst {x : HeyLo.Ident} (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) (xs : List ((v : HeyLo.Ident) × (pGCL.State HeyLo.Ty.Γv.type.lit))) (v : pGCL.State HeyLo.Ty.Γx.type.lit) :
                (applied σ xs)[x v (applied σ xs)] = applied σ (xs ++ [x, v])
                def HeyVL.Subs.of (xs : List HeyLo.Ident) (hn : xs.Nodup) (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) :
                Subs xs hn
                Equations
                Instances For
                  @[simp]
                  theorem HeyVL.Subs.of_get (xs : List HeyLo.Ident) (hn : xs.Nodup) (σ : pGCL.State fun (x : HeyLo.Ident) => x.type.lit) {y : HeyLo.Ident} {hy : y xs} :
                  (of xs hn σ).get y hy = σ y
                  @[simp]
                  theorem HeyLo.sem_indep {α : Ty} {φ : HeyLo α} {x : Ident} (h : xφ.fv) :
                  @[simp]
                  theorem HeyVL.vp_havocs {xs : List HeyLo.Ident} {φ : HeyLo HeyLo.Ty.ENNReal} {hn : xs.Nodup} (h : xs.Nodup) :
                  @(vp⟦@(Havocs xs) φ)⟧' = ⨅ (vs : Subs xs hn), @φ⟧'[..vs.help]
                  @[simp]
                  theorem HeyVL.vp_cohavocs {xs : List HeyLo.Ident} {φ : HeyLo HeyLo.Ty.ENNReal} {hn : xs.Nodup} (h : xs.Nodup) :
                  @(vp⟦@(Cohavocs xs) φ)⟧' = ⨆ (vs : Subs xs hn), @φ⟧'[..vs.help]
                  @[simp]
                  theorem spGCL.pGCL_mods (C : spGCL) :
                  C.pGCL.mods = C.mods