import Mt.Thread namespace Mt variable {spec :spec: SpecSpec} localSpec: Type 1instance :instance: {spec : Spec} β IsReservation spec.ReservationIsReservationIsReservation: Type β Typespec.spec: SpecReservation :=Reservation: Spec β Typespec.spec: Specis_reservation /-- Describes a system of zero or more threads running in parallel Systems can be iterated one atomic step at a time by choosing one of its threads. They keep track of the number of threads which panicked during execution -/ structure System (is_reservation: (self : Spec) β IsReservation self.Reservationspec :spec: SpecSpec) where state :Spec: Type 1spec.spec: SpecState threads :State: Spec β TypeList (List: Type ?u.34 β Type ?u.34ThreadThread: Spec β Type 1spec) panics :spec: SpecNat namespace System defNat: TypeThreadIndex (ThreadIndex: System spec β Types :s: System specSystemSystem: Spec β Type 1spec) :spec: SpecType :=Type: Type 1FinFin: Nat β Types.threads.length def done (s: System specs :s: System specSystemSystem: Spec β Type 1spec) :spec: SpecBool :=Bool: Types.threads.length =s: System spec0 def0: ?m.565iterate (iterate: (s : System spec) β ThreadIndex s β System specs :s: System specSystemSystem: Spec β Type 1spec) :spec: Specs.ThreadIndex ->s: System specSystemSystem: Spec β Type 1spec |spec: Specthread_idx => if (thread_idx: ?m.670s.threads.s: System specgetget: {Ξ± : Type ?u.673} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).block_untilthread_idx: ?m.670s.state then match (s: System specs.threads.s: System specgetget: {Ξ± : Type ?u.763} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).thread_idx: ?m.670iterateiterate: {spec : Spec} β Thread spec β spec.State β Thread.IterationResult specs.state with |s: System specThread.IterationResult.DoneThread.IterationResult.Done: {spec : Spec} β spec.State β Thread.IterationResult specstate => {state: spec.Statestate threads :=state: spec.States.threads.eraseIdxs: System specthread_idx.val panics :=thread_idx: ?m.670s.panics } |s: System specThread.IterationResult.PanicThread.IterationResult.Panic: {spec : Spec} β spec.State β Thread.IterationResult specstate => {state: spec.Statestate threads :=state: spec.States.threads.eraseIdxs: System specthread_idx.val panics :=thread_idx: ?m.670s.panics +s: System spec1 } |1: ?m.822Thread.IterationResult.RunningThread.IterationResult.Running: {spec : Spec} β spec.State β Thread spec β Thread.IterationResult specstatestate: spec.Statethread => {thread: Thread specstate threads :=state: spec.States.threads.sets: System specthread_idx.valthread_idx: ?m.670thread panics :=thread: Thread specs.panics } elses: System specs theorems: System speciterate_threads (iterate_threads: β (s : System spec) (thread_idx : ThreadIndex s), Thread.block_until (List.get s.threads thread_idx) s.state = true β (iterate s thread_idx).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threads :s: System specSystemSystem: Spec β Type 1spec) (spec: Specthread_idx :thread_idx: ThreadIndex ss.ThreadIndex) (s: System specblocked_until : (blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = trues.threads.s: System specgetget: {Ξ± : Type ?u.1259} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).block_untilthread_idx: ThreadIndex ss.state) : (s: System specs.s: System speciterateiterate: {spec : Spec} β (s : System spec) β ThreadIndex s β System specthread_idx).threads = match (thread_idx: ThreadIndex ss.threads.s: System specgetget: {Ξ± : Type ?u.1293} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).thread_idx: ThreadIndex siterateiterate: {spec : Spec} β Thread spec β spec.State β Thread.IterationResult specs.state with |s: System specThread.IterationResult.Done .. =>Thread.IterationResult.Done: {spec : Spec} β spec.State β Thread.IterationResult specs.threads.eraseIdxs: System specthread_idx.val |thread_idx: ThreadIndex sThread.IterationResult.Panic .. =>Thread.IterationResult.Panic: {spec : Spec} β spec.State β Thread.IterationResult specs.threads.eraseIdxs: System specthread_idx.val |thread_idx: ThreadIndex sThread.IterationResult.Running _Thread.IterationResult.Running: {spec : Spec} β spec.State β Thread spec β Thread.IterationResult specthread =>thread: Thread specs.threads.sets: System specthread_idx.valthread_idx: ThreadIndex sthread :=thread: Thread specspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(let thread_idx := thread_idx; if Thread.block_until (List.get s.threads thread_idx) s.state = true then match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics } else s).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(let thread_idx := thread_idx; if Thread.block_until (List.get s.threads thread_idx) s.state = true then match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics } else s).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).threads = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Done aβ
Done(match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Panic aβ
Panic(match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβΒΉ: spec.State
aβ: Thread spec
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Running aβΒΉ aβ
Running(match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Done aβ
Done(match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Panic aβ
Panic(match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβΒΉ: spec.State
aβ: Thread spec
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Running aβΒΉ aβ
Running(match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).threads = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Panic a => List.eraseIdx s.threads thread_idx.val | Thread.IterationResult.Running a thread => List.set s.threads thread_idx.val threadtheoremGoals accomplished! πiterate_panics (iterate_panics: β {spec : Spec} (s : System spec) (thread_idx : ThreadIndex s), Thread.block_until (List.get s.threads thread_idx) s.state = true β (iterate s thread_idx).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicss :s: System specSystemSystem: Spec β Type 1spec) (spec: Specthread_idx :thread_idx: ThreadIndex ss.ThreadIndex) (s: System specblocked_until : (blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = trues.threads.s: System specgetget: {Ξ± : Type ?u.2792} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).block_untilthread_idx: ThreadIndex ss.state) : (s: System specs.s: System speciterateiterate: {spec : Spec} β (s : System spec) β ThreadIndex s β System specthread_idx).panics = match (thread_idx: ThreadIndex ss.threads.s: System specgetget: {Ξ± : Type ?u.2826} β (as : List Ξ±) β Fin (List.length as) β Ξ±thread_idx).thread_idx: ThreadIndex siterateiterate: {spec : Spec} β Thread spec β spec.State β Thread.IterationResult specs.state with |s: System specThread.IterationResult.Done .. =>Thread.IterationResult.Done: {spec : Spec} β spec.State β Thread.IterationResult specs.panics |s: System specThread.IterationResult.Panic .. =>Thread.IterationResult.Panic: {spec : Spec} β spec.State β Thread.IterationResult specs.panics +s: System spec1 |1: ?m.2877Thread.IterationResult.Running .. =>Thread.IterationResult.Running: {spec : Spec} β spec.State β Thread spec β Thread.IterationResult specs.panics :=s: System specspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(let thread_idx := thread_idx; if Thread.block_until (List.get s.threads thread_idx) s.state = true then match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics } else s).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(let thread_idx := thread_idx; if Thread.block_until (List.get s.threads thread_idx) s.state = true then match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics } else s).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(iterate s thread_idx).panics = let _discr := Thread.iterate (List.get s.threads thread_idx) s.state; match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Done aβ
Done(match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Panic aβ
Panic(match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβΒΉ: spec.State
aβ: Thread spec
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Running aβΒΉ aβ
Running(match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Done aβ
Done(match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Done aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβ: spec.State
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Panic aβ
Panic(match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Panic aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true
aβΒΉ: spec.State
aβ: Thread spec
h: Thread.iterate (List.get s.threads thread_idx) s.state = Thread.IterationResult.Running aβΒΉ aβ
Running(match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.IterationResult.Running aβΒΉ aβ with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsspec: Spec
s: System spec
thread_idx: ThreadIndex s
blocked_until: Thread.block_until (List.get s.threads thread_idx) s.state = true(match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics } | Thread.IterationResult.Panic state => { state := state, threads := List.eraseIdx s.threads thread_idx.val, panics := s.panics + 1 } | Thread.IterationResult.Running state thread => { state := state, threads := List.set s.threads thread_idx.val thread, panics := s.panics }).panics = match Thread.iterate (List.get s.threads thread_idx) s.state with | Thread.IterationResult.Done a => s.panics | Thread.IterationResult.Panic a => s.panics + 1 | Thread.IterationResult.Running a a_1 => s.panicsinductive reduces_to :Goals accomplished! πSystemSystem: Spec β Type 1spec ->spec: SpecSystemSystem: Spec β Type 1spec ->spec: SpecProp where |Prop: Typesingle {single: β {spec : Spec} {a b : System spec} (idx : ThreadIndex a), iterate a idx = b β reduces_to a baa: ?m.4086b} (b: ?m.4089idx :idx: ?m.4092a.ThreadIndex) (a: ?m.4086iteration :iteration: ?m.4098 = ba.a: ?m.4086iterateiterate: {spec : Spec} β (s : System spec) β ThreadIndex s β System specidx =idx: ?m.4092b) : reduces_tob: ?m.4089aa: ?m.4086b |b: ?m.4089trans {trans: β {spec : Spec} {a b c : System spec}, reduces_to a b β reduces_to b c β reduces_to a caa: ?m.4119bb: ?m.4122c} (c: ?m.4125a_to_b :a_to_b: ?m.4128a.reduces_toa: ?m.4119b) (b: ?m.4122b_to_c :b_to_c: ?m.4131b.reduces_tob: ?m.4122c) : reduces_toc: ?m.4125aa: ?m.4119c def reduces_to_or_eq (c: ?m.4125aa: System specb :b: System specSystemSystem: Spec β Type 1spec) :spec: SpecProp :=Prop: Typea =a: System specb β¨b: System speca.reduces_toa: System specb theoremb: System specreduces_to_or_eq.refl (reduces_to_or_eq.refl: β (a : System spec), reduces_to_or_eq a aa :a: System specSystemSystem: Spec β Type 1spec) :spec: Speca.reduces_to_or_eqa: System speca :=a: System specOr.inlOr.inl: β {a b : Prop}, a β a β¨ brfl theoremrfl: β {Ξ± : Sort ?u.4389} {a : Ξ±}, a = areduces_to_or_eq.trans {reduces_to_or_eq.trans: β {spec : Spec} {a b c : System spec}, reduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a caa: System specbb: System specc :c: System specSystemSystem: Spec β Type 1spec} :spec: Speca.reduces_to_or_eqa: System specb βb: System specb.reduces_to_or_eqb: System specc βc: System speca.reduces_to_or_eqa: System specc :=c: System specreduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a creduces_to_or_eq a creduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a c
inlreduces_to_or_eq a c
inrreduces_to_or_eq a creduces_to_or_eq a c
inlreduces_to_or_eq a c
inrreduces_to_or_eq a creduces_to_or_eq a c
inl.inlreduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inlreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inlreduces_to_or_eq a c
inr.inlreduces_to_or_eq a creduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a c
inl.inlreduces_to_or_eq a c
inl.inlreduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inl.inlreduces_to_or_eq a c
inl.inlreduces_to_or_eq b c
inl.inlreduces_to_or_eq a c
inl.inlreduces_to_or_eq c c
inl.inlreduces_to_or_eq c c
inl.inlreduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inl.inlreduces_to_or_eq c c
inl.inlreduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a cGoals accomplished! πreduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inl.inrreduces_to_or_eq a c
inl.inrreduces_to_or_eq b c
inl.inrreduces_to_or_eq b c
inl.inrreduces_to_or_eq b cGoals accomplished! πreduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inr.inlreduces_to_or_eq a c
inr.inlreduces_to_or_eq a b
inr.inlreduces_to_or_eq a b
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inr.inlreduces_to_or_eq a b
inr.inlreduces_to_or_eq a c
inr.inrreduces_to_or_eq a cGoals accomplished! πreduces_to_or_eq a b β reduces_to_or_eq b c β reduces_to_or_eq a c
inr.inrreduces_to_or_eq a c
inr.inrreduces_to_or_eq a cend System end MtGoals accomplished! π