Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
import Mt.Thread.Basic
import Mt.Utils

namespace Mt.Traced

structure 
TracedThread: SpecType 1
TracedThread
(
spec: Spec
spec
:
Spec: Type 1
Spec
) where
thread: {spec : Spec} → TracedThread specThread spec
thread
:
Thread: SpecType 1
Thread
spec: Spec
spec
reservation: {spec : Spec} → TracedThread specspec.Reservation
reservation
:
spec: Spec
spec
.
Reservation: SpecType
Reservation
variable {
spec: Spec
spec
:
Spec: Type 1
Spec
} local
instance: {spec : Spec} → IsReservation spec.Reservation
instance
:
IsReservation: TypeType
IsReservation
spec: Spec
spec
.
Reservation: SpecType
Reservation
:=
spec: Spec
spec
.
is_reservation: (self : Spec) → IsReservation self.Reservation
is_reservation
namespace TracedThread def
T: TracedThread specType
T
(
t: TracedThread spec
t
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
) :
Type: Type 1
Type
:=
t: TracedThread spec
t
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
T: {spec : Spec} → Thread specType
T
def
block_until: TracedThread specspec.StateBool
block_until
(
t: TracedThread spec
t
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
) :
spec: Spec
spec
.
State: SpecType
State
->
Bool: Type
Bool
:=
t: TracedThread spec
t
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
block_until: {spec : Spec} → Thread specspec.StateBool
block_until
def
task: (t : TracedThread spec) → TaskM spec (T t)
task
(
t: TracedThread spec
t
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
) :
TaskM: SpecTypeType
TaskM
spec: Spec
spec
t: TracedThread spec
t
.
T: {spec : Spec} → TracedThread specType
T
:=
t: TracedThread spec
t
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
task: {spec : Spec} → (self : Thread spec) → TaskM spec self.T
task
def
iterate: TracedThread specspec.StateThread.IterationResult spec
iterate
(
t: TracedThread spec
t
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
) :
spec: Spec
spec
.
State: SpecType
State
->
Thread.IterationResult: SpecType 1
Thread.IterationResult
spec: Spec
spec
:=
t: TracedThread spec
t
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
iterate: {spec : Spec} → Thread specspec.StateThread.IterationResult spec
iterate
def
valid: TracedThread specProp
valid
(
thread: TracedThread spec
thread
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
) :
Prop: Type
Prop
:=
thread: TracedThread spec
thread
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
task: {spec : Spec} → (self : Thread spec) → TaskM spec self.T
task
.
valid: {spec : Spec} → {T : Type} → TaskM spec Tspec.Reservation(spec.StateBool) → (Tspec.ReservationProp) → Prop
valid
thread: TracedThread spec
thread
.
reservation: {spec : Spec} → TracedThread specspec.Reservation
reservation
thread: TracedThread spec
thread
.
thread: {spec : Spec} → TracedThread specThread spec
thread
.
block_until: {spec : Spec} → Thread specspec.StateBool
block_until
_: ?m.573
_
r: ?m.576
r
=>
r: ?m.576
r
=
IsReservation.empty: {T : Type} → [self : IsReservation T] → T
IsReservation.empty
) theorem
valid_elim: ∀ {thread : TracedThread spec}, valid thread∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
valid_elim
{
thread: TracedThread spec
thread
:
TracedThread: SpecType 1
TracedThread
spec: Spec
spec
} (
is_valid: valid thread
is_valid
:
thread: TracedThread spec
thread
.
valid: {spec : Spec} → TracedThread specProp
valid
) : ∀
env_r: ?m.615
env_r
s: ?m.618
s
,
thread: TracedThread spec
thread
.
block_until: {spec : Spec} → TracedThread specspec.StateBool
block_until
s: ?m.618
s
spec: Spec
spec
.
validate: (self : Spec) → self.Reservationself.StateProp
validate
(
env_r: ?m.615
env_r
+
thread: TracedThread spec
thread
.
reservation: {spec : Spec} → TracedThread specspec.Reservation
reservation
)
s: ?m.618
s
→ ∃
r': spec.Reservation
r'
:
spec: Spec
spec
.
Reservation: SpecType
Reservation
, match
thread: TracedThread spec
thread
.
iterate: {spec : Spec} → TracedThread specspec.StateThread.IterationResult spec
iterate
s: ?m.618
s
with |
Thread.IterationResult.Done: {spec : Spec} → spec.StateThread.IterationResult spec
Thread.IterationResult.Done
s': spec.State
s'
=>
spec: Spec
spec
.
validate: (self : Spec) → self.Reservationself.StateProp
validate
(
env_r: ?m.615
env_r
+
r': spec.Reservation
r'
)
s': spec.State
s'
r': spec.Reservation
r'
=
IsReservation.empty: {T : Type} → [self : IsReservation T] → T
IsReservation.empty
|
Thread.IterationResult.Panic: {spec : Spec} → spec.StateThread.IterationResult spec
Thread.IterationResult.Panic
.. =>
False: Prop
False
|
Thread.IterationResult.Running: {spec : Spec} → spec.StateThread specThread.IterationResult spec
Thread.IterationResult.Running
s': spec.State
s'
cont: Thread spec
cont
=> (
spec: Spec
spec
.
validate: (self : Spec) → self.Reservationself.StateProp
validate
(
env_r: ?m.615
env_r
+
r': spec.Reservation
r'
)
s': spec.State
s'
) ∧
TracedThread.valid: {spec : Spec} → TracedThread specProp
TracedThread.valid
cont: Thread spec
cont
,
r': spec.Reservation
r'
⟩ :=
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: TaskM.valid thread.thread.task thread.reservation thread.thread.block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: ∀ (env_r : spec.Reservation) (s : spec.State), Thread.block_until thread.thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: ∀ (env_r : spec.Reservation) (s : spec.State), Thread.block_until thread.thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: ∀ (env_r : spec.Reservation) (s : spec.State), Thread.block_until thread.thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: ∀ (env_r : spec.Reservation) (s : spec.State), Thread.block_until thread.thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

this: r', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty


r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: ∀ (env_r : spec.Reservation) (s : spec.State), Thread.block_until thread.thread s = trueSpec.validate spec (env_r + thread.reservation) sr', match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

w✝: spec.Reservation


intro
r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

w✝: spec.Reservation


intro
r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

w✝: spec.Reservation


intro
r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty


intro
r', match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty


intro
match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty


intro
match match TaskM.iterate thread.1.task s with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Done a✝¹ a✝


intro.Done
match match TaskM.IterationResult.Done a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: String

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Panic a✝¹ a✝


intro.Panic
match match TaskM.IterationResult.Panic a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝²: spec.State

a✝¹: spec.StateBool

a✝: TaskM spec thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝


intro.Running
match match TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

is_valid: valid thread


∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = trueSpec.validate spec (env_r + thread.reservation) sr', let _discr := iterate thread s; match iterate thread s with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Done a✝¹ a✝


intro.Done
match match TaskM.IterationResult.Done a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: String

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Panic a✝¹ a✝


intro.Panic
match match TaskM.IterationResult.Panic a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝²: spec.State

a✝¹: spec.StateBool

a✝: TaskM spec thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝


intro.Running
match match TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Done a✝¹ a✝


intro.Done
match match TaskM.IterationResult.Done a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝²: spec.State

a✝¹: spec.StateBool

a✝: TaskM spec thread.thread.T

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝


intro.Running
match match TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

a✝¹: spec.State

a✝: String

is_valid: match h : TaskM.IterationResult.Panic a✝¹ a✝ with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Panic a✝¹ a✝


intro.Panic
match match TaskM.IterationResult.Panic a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

a✝²: spec.State

a✝¹: spec.StateBool

a✝: TaskM spec thread.thread.T

is_valid: match h : TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝


intro.Running
match match TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

a✝²: spec.State

a✝¹: spec.StateBool

a✝: TaskM spec thread.thread.T

is_valid: match h : TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝


intro.Running
match match TaskM.IterationResult.Running a✝² a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }
spec: Spec

thread: TracedThread spec

env_r: spec.Reservation

s: spec.State

bu_true: block_until thread s = true

initial_valid: Spec.validate spec (env_r + thread.reservation) s

r': spec.Reservation

is_valid: match h : TaskM.iterate thread.thread.task s with | TaskM.IterationResult.Done s' t => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | TaskM.IterationResult.Panic a a_1 => False | TaskM.IterationResult.Running s' block_until cont => Spec.validate spec (env_r + r') s' TaskM.valid cont r' block_until fun x r => r = IsReservation.empty

a✝¹: spec.State

a✝: String

h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Panic a✝¹ a✝


intro.Panic
match match TaskM.IterationResult.Panic a✝¹ a✝ with | TaskM.IterationResult.Done state' a => Thread.IterationResult.Done state' | TaskM.IterationResult.Panic state' a => Thread.IterationResult.Panic state' | TaskM.IterationResult.Running state' block_until task => Thread.IterationResult.Running state' { T := thread.1.T, block_until := block_until, task := task } with | Thread.IterationResult.Done s' => Spec.validate spec (env_r + r') s' r' = IsReservation.empty | Thread.IterationResult.Panic a => False | Thread.IterationResult.Running s' cont => Spec.validate spec (env_r + r') s' valid { thread := cont, reservation := r' }

Goals accomplished! 🐙

Goals accomplished! 🐙
end TracedThread end Mt.Traced