Documentation

Samples.sample_mutex

structure SampleMutex.Data :
Type
Instances For
    Equations
    structure SampleMutex.State :
    Type
    Instances For
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Equations
        • One or more equations did not get rendered due to their size.
        theorem SampleMutex.validate.elim_locked {env_r : SampleMutex.Reservation} {d : SampleMutex.Data} {s' : SampleMutex.State} :
        SampleMutex.validate (env_r + Mt.Lock.Locked d) s'env_r = Mt.Lock.Unlocked d = s'.data s'.locked = true
        theorem SampleMutex.valid_bind_mutex_lock {T : Type} {cont : Mt.TaskM SampleMutex.spec T} {assuming : SampleMutex.spec.StateBool} {motive : TSampleMutex.spec.ReservationProp} (cont_valid : ∀ (x : Nat), Mt.TaskM.valid cont (Mt.Lock.Locked { x := x, y := x }) (fun x => true) motive) :
        Mt.TaskM.valid (do Mt.TaskM.atomic_blocking_rmr (fun x => match x with | { data := data, locked := locked } => decide (locked = false)) fun s => (PUnit.unit, { data := s.data, locked := true }) cont) Mt.Lock.Unlocked assuming motive
        theorem SampleMutex.valid_mutex_release {assuming : SampleMutex.spec.StateBool} {data : SampleMutex.Data} (data_valid : SampleMutex.Data.valid data) :
        Mt.TaskM.valid (Mt.TaskM.atomic_read_modify fun s => { data := s.data, locked := false }) (Mt.Lock.Locked data) assuming fun x r => r = Mt.Lock.Unlocked