- thread : Mt.Thread spec
- reservation : spec.Reservation
Instances For
Equations
- Mt.Traced.instIsReservationReservation = spec.is_reservation
Equations
- Mt.Traced.TracedThread.T t = t.thread.T
def
Mt.Traced.TracedThread.block_until
{spec : Mt.Spec}
(t : Mt.Traced.TracedThread spec)
:
spec.State → Bool
Equations
- Mt.Traced.TracedThread.block_until t = t.thread.block_until
def
Mt.Traced.TracedThread.task
{spec : Mt.Spec}
(t : Mt.Traced.TracedThread spec)
:
Mt.TaskM spec (Mt.Traced.TracedThread.T t)
Equations
- Mt.Traced.TracedThread.task t = t.thread.task
def
Mt.Traced.TracedThread.iterate
{spec : Mt.Spec}
(t : Mt.Traced.TracedThread spec)
:
spec.State → Mt.Thread.IterationResult spec
Equations
- Mt.Traced.TracedThread.iterate t = Mt.Thread.iterate t.thread
Equations
- Mt.Traced.TracedThread.valid thread = Mt.TaskM.valid thread.thread.task thread.reservation thread.thread.block_until fun x r => r = Mt.IsReservation.empty
theorem
Mt.Traced.TracedThread.valid_elim
{spec : Mt.Spec}
{thread : Mt.Traced.TracedThread spec}
(is_valid : Mt.Traced.TracedThread.valid thread)
(env_r : spec.Reservation)
(s : spec.State)
:
Mt.Traced.TracedThread.block_until thread s = true →
Mt.Spec.validate spec (env_r + thread.reservation) s →
∃ r',
let _discr := Mt.Traced.TracedThread.iterate thread s;
match Mt.Traced.TracedThread.iterate thread s with
| Mt.Thread.IterationResult.Done s' => Mt.Spec.validate spec (env_r + r') s' ∧ r' = Mt.IsReservation.empty
| Mt.Thread.IterationResult.Panic a => False
| Mt.Thread.IterationResult.Running s' cont =>
Mt.Spec.validate spec (env_r + r') s' ∧ Mt.Traced.TracedThread.valid { thread := cont, reservation := r' }