Blockers, probes, and precedence
Lax833301.Schedules · concepts/Lax833301/Schedules.lean · lax-833301
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A template has 7 types of blockers and probes. Each blocker is active between its opening and its closing. A probe succeeds when every blocker of its type is inactive. For discrete time we count a blocker from its opening up to, but excluding, its closing. Orders are strict on arcs. Unrelated events at a common time can be serialized with endpoints before probes, which preserves every probe's test.
Concept map
In the paper
- page 2 of this submission's paper
Lean source view on GitHub
| 1 | import Mathlib.Data.Fintype.BigOperators |
| 2 | import Mathlib.Data.Fintype.Sum |
| 3 | import Mathlib.Data.Finset.Card |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Blockers, probes, and precedence |
| 8 | type: definition |
| 9 | --- |
| 10 | A template has 7 types of blockers and probes. Each blocker is active between |
| 11 | its opening and its closing. A probe succeeds when every blocker of its type |
| 12 | is inactive. For discrete time we count a blocker from its opening up to, |
| 13 | but excluding, its closing. Orders are strict on arcs. Unrelated events at a |
| 14 | common time can be serialized with endpoints before probes, which preserves |
| 15 | every probe's test. |
| 16 | -/ |
| 17 | |
| 18 | namespace Lax833301.Schedules |
| 19 | |
| 20 | abbrev Kind := Fin 7 |
| 21 | |
| 22 | structure Template where |
| 23 | Fixed : Type |
| 24 | Probe : Type |
| 25 | Blocker : Type |
| 26 | [fixedFinite : Fintype Fixed] |
| 27 | [probeFinite : Fintype Probe] |
| 28 | [blockerFinite : Fintype Blocker] |
| 29 | entry : Fixed |
| 30 | exit : Fixed |
| 31 | collector : Fixed |
| 32 | opening : Blocker → Fixed |
| 33 | closing : Blocker → Fixed |
| 34 | color : Blocker → Kind |
| 35 | test : Probe → Kind |
| 36 | arc : Fixed ⊕ Probe → Fixed ⊕ Probe → Prop |
| 37 | |
| 38 | attribute [instance] Template.fixedFinite Template.probeFinite Template.blockerFinite |
| 39 | |
| 40 | abbrev Template.Event (T : Template) := T.Fixed ⊕ T.Probe |
| 41 | |
| 42 | def Template.Respects (T : Template) (time : T.Event → ℕ) : Prop := |
| 43 | ∀ u v, T.arc u v → time u < time v |
| 44 | |
| 45 | def Template.Active (T : Template) (f : T.Fixed → ℕ) (i : T.Blocker) (z : ℕ) : Prop := |
| 46 | f (T.opening i) ≤ z ∧ z < f (T.closing i) |
| 47 | |
| 48 | noncomputable def Template.count (T : Template) (f : T.Fixed → ℕ) (z : ℕ) |
| 49 | (keep : T.Blocker → Prop) : ℕ := by |
| 50 | classical |
| 51 | exact (Finset.univ.filter (fun i => T.Active f i z ∧ keep i)).card |
| 52 | |
| 53 | def Template.Succeeds (T : Template) (time : T.Event → ℕ) : Prop := |
| 54 | ∀ p i, T.color i = T.test p → ¬ T.Active (time ∘ Sum.inl) i (time (.inr p)) |
| 55 | |
| 56 | noncomputable def Template.frontier (T : Template) (time : T.Event → ℕ) (z : ℕ) : ℕ := by |
| 57 | classical |
| 58 | exact (Finset.univ.filter (fun u => time u ≤ z ∧ |
| 59 | ∃ v, z < time v ∧ v ≠ Sum.inl T.collector ∧ T.arc u v)).card |
| 60 | |
| 61 | structure Template.Good (T : Template) (B : ℕ) (time : T.Event → ℕ) : Prop where |
| 62 | respects : T.Respects time |
| 63 | injective : Function.Injective time |
| 64 | spanned : ∀ e, time (.inl T.entry) ≤ time e ∧ time e ≤ time (.inl T.exit) |
| 65 | succeeds : T.Succeeds time |
| 66 | load : ∀ z, T.count (time ∘ Sum.inl) z (fun _ => True) ≤ 11 |
| 67 | boundary : ∀ z, T.frontier time z ≤ B |
| 68 | |
| 69 | end Lax833301.Schedules |
| 70 |
Builds on
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments