State-indexed values #
@[reducible, inline]
A value indexed by a curried tuple of states.
example : SVal [Nat, Bool] String = (Nat → Bool → String) := rfl
Equations
- Std.Do.SVal [] α = α
- Std.Do.SVal (σ :: σs_2) α = (σ → Std.Do.SVal σs_2 α)
Instances For
A tuple capturing the whole state of an SVal
.
Equations
- Std.Do.SVal.StateTuple [] = PUnit
- Std.Do.SVal.StateTuple (σ :: σs_2) = (σ × Std.Do.SVal.StateTuple σs_2)
Instances For
instance
Std.Do.SVal.instInhabitedStateTupleCons
{σ : Type u_1}
{σs : List (Type u_1)}
[Inhabited σ]
[Inhabited (StateTuple σs)]
:
Inhabited (StateTuple (σ :: σs))
Curry a function taking a StateTuple
into an SVal
.
Equations
- Std.Do.SVal.curry f_2 = f_2 PUnit.unit
- Std.Do.SVal.curry f_2 = fun (s : head) => Std.Do.SVal.curry fun (s' : Std.Do.SVal.StateTuple tail) => f_2 (s, s')
Instances For
@[simp]
@[simp]
theorem
Std.Do.SVal.curry_cons
{α σ : Type u}
{σs : List (Type u)}
{f : StateTuple (σ :: σs) → α}
{s : σ}
:
@[simp]
@[simp]
Equations
- Std.Do.SVal.instInhabited = { default := Std.Do.SVal.curry fun (x : Std.Do.SVal.StateTuple σs) => default }
Equations
- Std.Do.SVal.instGetTyCons = { get := fun (s : σ) => Std.Do.SVal.curry fun (x : Std.Do.SVal.StateTuple σs) => s }
instance
Std.Do.SVal.instGetTyCons_1
{σ₁ : Type u_1}
{σs : List (Type u_1)}
{σ₂ : Type u_1}
[GetTy σ₁ σs]
:
Equations
- Std.Do.SVal.instGetTyCons_1 = { get := fun (x : σ₂) => Std.Do.SVal.GetTy.get }
@[simp]