import Mt.Thread.Basic import Mt.Utils namespace Mt.Traced structureTracedThread (TracedThread: Spec → Type 1spec :spec: SpecSpec) whereSpec: Type 1thread :thread: {spec : Spec} → TracedThread spec → Thread specThreadThread: Spec → Type 1specspec: Specreservation :reservation: {spec : Spec} → TracedThread spec → spec.Reservationspec.spec: SpecReservation variable {Reservation: Spec → Typespec :spec: SpecSpec} localSpec: Type 1instance :instance: {spec : Spec} → IsReservation spec.ReservationIsReservationIsReservation: Type → Typespec.spec: SpecReservation :=Reservation: Spec → Typespec.spec: Specis_reservation namespace TracedThread defis_reservation: (self : Spec) → IsReservation self.ReservationT (T: TracedThread spec → Typet :t: TracedThread specTracedThreadTracedThread: Spec → Type 1spec) :spec: SpecType :=Type: Type 1t.t: TracedThread specthread.T defthread: {spec : Spec} → TracedThread spec → Thread specblock_until (block_until: TracedThread spec → spec.State → Boolt :t: TracedThread specTracedThreadTracedThread: Spec → Type 1spec) :spec: Specspec.spec: SpecState ->State: Spec → TypeBool :=Bool: Typet.t: TracedThread specthread.block_until defthread: {spec : Spec} → TracedThread spec → Thread spectask (task: (t : TracedThread spec) → TaskM spec (T t)t :t: TracedThread specTracedThreadTracedThread: Spec → Type 1spec) :spec: SpecTaskMTaskM: Spec → Type → Typespecspec: Spect.t: TracedThread specT :=T: {spec : Spec} → TracedThread spec → Typet.t: TracedThread specthread.task defthread: {spec : Spec} → TracedThread spec → Thread speciterate (iterate: TracedThread spec → spec.State → Thread.IterationResult spect :t: TracedThread specTracedThreadTracedThread: Spec → Type 1spec) :spec: Specspec.spec: SpecState ->State: Spec → TypeThread.IterationResultThread.IterationResult: Spec → Type 1spec :=spec: Spect.t: TracedThread specthread.thread: {spec : Spec} → TracedThread spec → Thread speciterate defiterate: {spec : Spec} → Thread spec → spec.State → Thread.IterationResult specvalid (valid: TracedThread spec → Propthread :thread: TracedThread specTracedThreadTracedThread: Spec → Type 1spec) :spec: SpecProp :=Prop: Typethread.thread: TracedThread specthread.task.validthread: {spec : Spec} → TracedThread spec → Thread specthread.thread: TracedThread specreservationreservation: {spec : Spec} → TracedThread spec → spec.Reservationthread.thread: TracedThread specthread.block_until (λthread: {spec : Spec} → TracedThread spec → Thread spec__: ?m.573r =>r: ?m.576r =r: ?m.576IsReservation.empty) theoremIsReservation.empty: {T : Type} → [self : IsReservation T] → Tvalid_elim {valid_elim: ∀ {thread : TracedThread spec}, valid thread → ∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }thread :thread: TracedThread specTracedThreadTracedThread: Spec → Type 1spec} (spec: Specis_valid :is_valid: valid threadthread.thread: TracedThread specvalid) : ∀valid: {spec : Spec} → TracedThread spec → Propenv_renv_r: ?m.615s,s: ?m.618thread.thread: TracedThread specblock_untilblock_until: {spec : Spec} → TracedThread spec → spec.State → Bools →s: ?m.618spec.spec: Specvalidate (validate: (self : Spec) → self.Reservation → self.State → Propenv_r +env_r: ?m.615thread.thread: TracedThread specreservation)reservation: {spec : Spec} → TracedThread spec → spec.Reservations → ∃s: ?m.618r' :r': spec.Reservationspec.spec: SpecReservation, matchReservation: Spec → Typethread.thread: TracedThread speciterateiterate: {spec : Spec} → TracedThread spec → spec.State → Thread.IterationResult specs with |s: ?m.618Thread.IterationResult.DoneThread.IterationResult.Done: {spec : Spec} → spec.State → Thread.IterationResult specs' =>s': spec.Statespec.spec: Specvalidate (validate: (self : Spec) → self.Reservation → self.State → Propenv_r +env_r: ?m.615r')r': spec.Reservations' ∧s': spec.Stater' =r': spec.ReservationIsReservation.empty |IsReservation.empty: {T : Type} → [self : IsReservation T] → TThread.IterationResult.Panic .. =>Thread.IterationResult.Panic: {spec : Spec} → spec.State → Thread.IterationResult specFalse |False: PropThread.IterationResult.RunningThread.IterationResult.Running: {spec : Spec} → spec.State → Thread spec → Thread.IterationResult specs's': spec.Statecont => (cont: Thread specspec.spec: Specvalidate (validate: (self : Spec) → self.Reservation → self.State → Propenv_r +env_r: ?m.615r')r': spec.Reservations') ∧s': spec.StateTracedThread.valid ⟨TracedThread.valid: {spec : Spec} → TracedThread spec → Propcont,cont: Thread specr'⟩ :=r': spec.Reservation∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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 = true → Spec.validate spec (env_r + thread.reservation) s → ∃ 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
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 = true → Spec.validate spec (env_r + thread.reservation) s → ∃ 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
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 = true → Spec.validate spec (env_r + thread.reservation) s → ∃ 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
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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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 = true → Spec.validate spec (env_r + thread.reservation) s → ∃ 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
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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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 = true → Spec.validate spec (env_r + thread.reservation) s → ∃ 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
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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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
intromatch 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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
intromatch 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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.Donematch 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.Panicmatch 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.State → Bool
a✝: TaskM spec thread.thread.T
h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝
intro.Runningmatch 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' }∀ (env_r : spec.Reservation) (s : spec.State), block_until thread s = true → Spec.validate spec (env_r + thread.reservation) s → ∃ r', 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.Donematch 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.Panicmatch 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.State → Bool
a✝: TaskM spec thread.thread.T
h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝
intro.Runningmatch 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.Donematch 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.State → Bool
a✝: TaskM spec thread.thread.T
h: TaskM.iterate thread.thread.task s = TaskM.IterationResult.Running a✝² a✝¹ a✝
intro.Runningmatch 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.Panicmatch 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.State → Bool
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.Runningmatch 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.State → Bool
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.Runningmatch 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.Panicmatch 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! 🐙end TracedThread end Mt.TracedGoals accomplished! 🐙