Precedence constraints and time lags
Lax434175.Precedence · concepts/Lax434175/Precedence.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
With precedence constraints an instance carries a relation on the jobs, given by its arcs, and a time lag for every pair of jobs. Whenever precedes , job may not start before the completion of job plus the lag: . A lag may be negative.
A value of the field consists of a class of relations and a kind of lags.
The classes are, with the transitive closure of the arcs:
- none: no relation, read as the empty relation;
- chains: every job has at most one successor and at most one predecessor;
- intree: every job has at most one successor;
- outtree: every job has at most one predecessor;
- tree: the relation is an intree or an outtree;
- opposing forest: the jobs split into two parts without arcs between them, one an intree and the other an outtree;
- series-parallel: contains no four jobs whose only relations are , , ;
- divide-and-conquer graph: a single job is one; and for two further jobs and and at least one divide-and-conquer graph on disjoint sets of jobs, so is their union with , and all arcs from to the jobs of the graphs and from these to ;
- interval order: and imply or ;
- over-interval order: no five different jobs are related exactly by , , , and none exactly by the reverse relations , , (the structures of type I and II of Chardon and Moukrim, 2005);
- quasi-interval order: an over-interval order in which, moreover, no five different jobs are related exactly by , , and hence (Moukrim 1999, Definition 2: the structures of type I, in either orientation, and of type II);
- -order, for the number of machines of the instance: for any two sets and of at most pairwise unrelated jobs, at most jobs of have a predecessor in , and at most have a successor in (the property of Moukrim and Quilliot, 1997);
- level order: every job of level precedes every job of level , where the level of a job is the length of the longest path of arcs starting from it;
- bounded height: an arbitrary relation; the value records that the length of its longest path is regarded as a constant;
- dimension two: the jobs can be placed in the plane such that, for different jobs, exactly if both coordinates of are at most those of ;
- bounded dimension: the same in a space of some dimension;
- prec: an arbitrary relation.
The class none is a special case of every class except divide-and-conquer graphs, which have a single first and a single last job; interval orders of quasi-interval orders, of over-interval orders and of -orders; quasi-interval orders of over-interval orders; chains of intree and outtree; these of tree; tree of opposing forest; dimension two of bounded dimension; chains, the trees and opposing forests of series-parallel orders, since every job of an intree has its successors on a chain and every job of an outtree its predecessors; series-parallel orders of dimension two and of bounded dimension, by the classical theorem that an order without such four jobs has dimension at most two; and every class of prec.
The kinds of lags are: zero; unit, ; constant, , also restricted to or to ; and arbitrary, also restricted to or to . A kind is a special case of another if its lags are among the other's.
On a single machine, as in batching, every order is an -order, so the value says nothing there. The field of one machine leaves it out: the value admits no instance and is a special case of no other value.
Theorem. Over every kernel, the field of precedence constraints with time lags is sound, and so is the field of one machine.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Mathlib.Logic.Relation |
| 2 | import Mathlib.Data.Finset.Lattice.Basic |
| 3 | import Mathlib.Data.Fintype.Basic |
| 4 | import Mathlib.Data.Finset.Card |
| 5 | import Mathlib.Algebra.Order.Field.Rat |
| 6 | import Mathlib.Data.NNRat.Defs |
| 7 | import Lax434175.Modules |
| 8 | |
| 9 | /-! |
| 10 | --- |
| 11 | title: Precedence constraints and time lags |
| 12 | type: theorem |
| 13 | --- |
| 14 | With precedence constraints an instance carries a relation on the jobs, |
| 15 | given by its arcs, and a time lag for every pair of jobs. Whenever |
| 16 | precedes , job may not start before the completion of job |
| 17 | plus the lag: . A lag may be negative. |
| 18 | |
| 19 | A value of the field consists of a class of relations and a kind of lags. |
| 20 | |
| 21 | The classes are, with the transitive closure of the arcs: |
| 22 | |
| 23 | - none: no relation, read as the empty relation; |
| 24 | - chains: every job has at most one successor and at most one predecessor; |
| 25 | - intree: every job has at most one successor; |
| 26 | - outtree: every job has at most one predecessor; |
| 27 | - tree: the relation is an intree or an outtree; |
| 28 | - opposing forest: the jobs split into two parts without arcs between them, |
| 29 | one an intree and the other an outtree; |
| 30 | - series-parallel: contains no four jobs whose only |
| 31 | relations are , , ; |
| 32 | - divide-and-conquer graph: a single job is one; and for two further jobs |
| 33 | and and at least one divide-and-conquer graph on disjoint sets of |
| 34 | jobs, so is their union with , and all arcs from to the jobs of |
| 35 | the graphs and from these to ; |
| 36 | - interval order: and imply or |
| 37 | ; |
| 38 | - over-interval order: no five different jobs are related |
| 39 | exactly by , , , and none exactly by the |
| 40 | reverse relations , , (the structures of type |
| 41 | I and II of Chardon and Moukrim, 2005); |
| 42 | - quasi-interval order: an over-interval order in which, moreover, no five |
| 43 | different jobs are related exactly by , , |
| 44 | and hence (Moukrim 1999, Definition 2: the |
| 45 | structures of type I, in either orientation, and of type II); |
| 46 | - -order, for the number of machines of the instance: for any two |
| 47 | sets and of at most pairwise unrelated jobs, at most jobs |
| 48 | of have a predecessor in , and at most have a |
| 49 | successor in (the property of Moukrim and Quilliot, 1997); |
| 50 | - level order: every job of level precedes every job of level , |
| 51 | where the level of a job is the length of the longest path of arcs |
| 52 | starting from it; |
| 53 | - bounded height: an arbitrary relation; the value records that the length |
| 54 | of its longest path is regarded as a constant; |
| 55 | - dimension two: the jobs can be placed in the plane such that, for |
| 56 | different jobs, exactly if both coordinates of are at most |
| 57 | those of ; |
| 58 | - bounded dimension: the same in a space of some dimension; |
| 59 | - prec: an arbitrary relation. |
| 60 | |
| 61 | The class none is a special case of every class except |
| 62 | divide-and-conquer graphs, which have a single first and a single last job; interval orders of quasi-interval orders, |
| 63 | of over-interval orders and of -orders; quasi-interval orders of over-interval orders; chains of intree |
| 64 | and outtree; these of tree; tree of opposing forest; dimension two of |
| 65 | bounded dimension; chains, the trees and opposing forests of series-parallel |
| 66 | orders, since every job of an intree has its successors on a chain and every job |
| 67 | of an outtree its predecessors; series-parallel orders of dimension two and of bounded |
| 68 | dimension, by the classical theorem that an order without such four jobs has |
| 69 | dimension at most two; and every class of prec. |
| 70 | |
| 71 | The kinds of lags are: zero; unit, ; constant, , also |
| 72 | restricted to or to ; and arbitrary, also restricted to |
| 73 | or to . A kind is a special case of another if |
| 74 | its lags are among the other's. |
| 75 | |
| 76 | On a single machine, as in batching, every order is an -order, so the |
| 77 | value says nothing there. The field of one machine leaves it out: the value |
| 78 | admits no instance and is a special case of no other value. |
| 79 | |
| 80 | **Theorem.** Over every kernel, the field of precedence constraints with |
| 81 | time lags is sound, and so is the field of one machine. |
| 82 | -/ |
| 83 | |
| 84 | namespace Lax434175.Precedence |
| 85 | open Lax434175.Kernels Lax434175.Modules |
| 86 | |
| 87 | inductive Order |
| 88 | | none |
| 89 | | chains |
| 90 | | intree |
| 91 | | outtree |
| 92 | | tree |
| 93 | | opposingForest |
| 94 | | seriesParallel |
| 95 | | divideAndConquer |
| 96 | | intervalOrder |
| 97 | | quasiInterval |
| 98 | | overInterval |
| 99 | | aOrder |
| 100 | | levelOrder |
| 101 | | boundedHeight |
| 102 | | dimensionTwo |
| 103 | | boundedDimension |
| 104 | | prec |
| 105 | deriving DecidableEq |
| 106 | |
| 107 | /-- No data without precedence constraints; a relation on the jobs with them. -/ |
| 108 | def Order.Data (n : ℕ) : Order → Type |
| 109 | | .none => Unit |
| 110 | | _ => Fin n → Fin n → Prop |
| 111 | |
| 112 | /-- The precedence relation; empty when the class is none. -/ |
| 113 | def Order.view {n : ℕ} : (v : Order) → v.Data n → Fin n → Fin n → Prop |
| 114 | | .none, _ => fun _ _ => False |
| 115 | | .chains, r | .intree, r | .outtree, r | .tree, r | .opposingForest, r |
| 116 | | .seriesParallel, r | .divideAndConquer, r | .intervalOrder, r | .levelOrder, r | .boundedHeight, r |
| 117 | | .quasiInterval, r | .overInterval, r | .aOrder, r |
| 118 | | .dimensionTwo, r |
| 119 | | .boundedDimension, r | .prec, r => r |
| 120 | |
| 121 | /-- Every job has at most one successor. -/ |
| 122 | def AtMostOneSuccessor {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 123 | ∀ i j k, r i j → r i k → j = k |
| 124 | |
| 125 | /-- Every job has at most one predecessor. -/ |
| 126 | def AtMostOnePredecessor {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 127 | ∀ i j k, r j i → r k i → j = k |
| 128 | |
| 129 | /-- The jobs split into an intree part and an outtree part without arcs |
| 130 | between them. -/ |
| 131 | def OpposingForest {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 132 | ∃ inPart : Fin n → Prop, (∀ i j, r i j → (inPart i ↔ inPart j)) ∧ |
| 133 | (∀ i j k, inPart i → r i j → r i k → j = k) ∧ |
| 134 | (∀ i j k, ¬ inPart i → r j i → r k i → j = k) |
| 135 | |
| 136 | /-- No four jobs are related exactly by `a ≺ c`, `b ≺ c`, `b ≺ d`. -/ |
| 137 | def SeriesParallel {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 138 | ∀ a b c d, Relation.TransGen r a c → Relation.TransGen r b c → Relation.TransGen r b d → |
| 139 | Relation.TransGen r a d ∨ Relation.TransGen r a b ∨ Relation.TransGen r b a ∨ |
| 140 | Relation.TransGen r c d ∨ Relation.TransGen r d c |
| 141 | |
| 142 | /-- The arcs among a set of jobs form a divide-and-conquer graph. -/ |
| 143 | inductive DivideAndConquer {n : ℕ} (r : Fin n → Fin n → Prop) : Finset (Fin n) → Prop |
| 144 | | single (v : Fin n) : ¬ r v v → DivideAndConquer r {v} |
| 145 | | compose (s t : Fin n) (parts : List (Finset (Fin n))) : |
| 146 | s ≠ t → parts ≠ [] → (∀ P ∈ parts, s ∉ P ∧ t ∉ P) → parts.Pairwise Disjoint → |
| 147 | (∀ P ∈ parts, DivideAndConquer r P) → |
| 148 | (∀ a b, (a = s ∨ a = t ∨ ∃ P ∈ parts, a ∈ P) → (b = s ∨ b = t ∨ ∃ P ∈ parts, b ∈ P) → |
| 149 | (r a b ↔ (∃ P ∈ parts, a ∈ P ∧ b ∈ P ∧ r a b) ∨ (a = s ∧ ∃ P ∈ parts, b ∈ P) ∨ |
| 150 | (b = t ∧ ∃ P ∈ parts, a ∈ P))) → |
| 151 | DivideAndConquer r (parts.foldr (· ∪ ·) {s, t}) |
| 152 | |
| 153 | /-- `a ≺ b` and `c ≺ d` imply `a ≺ d` or `c ≺ b`. -/ |
| 154 | def IntervalOrder {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 155 | ∀ a b c d, Relation.TransGen r a b → Relation.TransGen r c d → |
| 156 | Relation.TransGen r a d ∨ Relation.TransGen r c b |
| 157 | |
| 158 | /-- Five different jobs are related exactly by the pairs of a pattern. -/ |
| 159 | def Contains {n : ℕ} (r : Fin n → Fin n → Prop) (pattern : List (Fin 5 × Fin 5)) : Prop := |
| 160 | ∃ f : Fin 5 → Fin n, Function.Injective f ∧ |
| 161 | ∀ a b, Relation.TransGen r (f a) (f b) ↔ (a, b) ∈ pattern |
| 162 | /-- Two unrelated pairs, the first job of one having a further successor. -/ |
| 163 | def patternOut : List (Fin 5 × Fin 5) := [(0, 1), (2, 3), (2, 4)] |
| 164 | /-- The reverse of `patternOut`. -/ |
| 165 | def patternIn : List (Fin 5 × Fin 5) := [(1, 0), (3, 2), (4, 2)] |
| 166 | /-- The third pattern forbidden in a quasi-interval order. -/ |
| 167 | def patternThird : List (Fin 5 × Fin 5) := [(0, 1), (0, 3), (2, 3), (2, 4), (4, 3)] |
| 168 | /-- Neither `patternOut` nor its reverse occurs. -/ |
| 169 | def OverInterval {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 170 | ¬ Contains r patternOut ∧ ¬ Contains r patternIn |
| 171 | /-- An over-interval order in which `patternThird` does not occur. -/ |
| 172 | def QuasiInterval {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 173 | OverInterval r ∧ ¬ Contains r patternThird |
| 174 | /-- Moukrim and Quilliot's property `Q_m`: for two sets of at most `m` pairwise |
| 175 | unrelated jobs, at most `m` jobs of their union have a predecessor in the union, |
| 176 | and at most `m` have a successor in the union. -/ |
| 177 | def AOrder {n : ℕ} (m : ℕ) (r : Fin n → Fin n → Prop) : Prop := |
| 178 | ∀ A B : Finset (Fin n), (∀ x ∈ A, ∀ y ∈ A, ¬ Relation.TransGen r x y) → |
| 179 | (∀ x ∈ B, ∀ y ∈ B, ¬ Relation.TransGen r x y) → A.card ≤ m → B.card ≤ m → |
| 180 | ∀ U ⊆ A ∪ B, |
| 181 | ((∀ x ∈ U, ∃ y ∈ A ∪ B, Relation.TransGen r y x) → U.card ≤ m) ∧ |
| 182 | ((∀ x ∈ U, ∃ y ∈ A ∪ B, Relation.TransGen r x y) → U.card ≤ m) |
| 183 | /-- A path of `l` arcs starts from the job. -/ |
| 184 | def HasPath {n : ℕ} (r : Fin n → Fin n → Prop) : ℕ → Fin n → Prop |
| 185 | | 0, _ => True |
| 186 | | l + 1, v => ∃ w, r v w ∧ HasPath r l w |
| 187 | |
| 188 | /-- The longest path of arcs starting from the job has `l` arcs. -/ |
| 189 | def HasLevel {n : ℕ} (r : Fin n → Fin n → Prop) (v : Fin n) (l : ℕ) : Prop := |
| 190 | HasPath r l v ∧ ¬ HasPath r (l + 1) v |
| 191 | |
| 192 | /-- Every job of level `l + 1` precedes every job of level `l`. -/ |
| 193 | def LevelOrder {n : ℕ} (r : Fin n → Fin n → Prop) : Prop := |
| 194 | ∀ u v l, HasLevel r u (l + 1) → HasLevel r v l → Relation.TransGen r u v |
| 195 | |
| 196 | /-- The jobs can be placed in `k`-dimensional space such that, for different |
| 197 | jobs, `i ≺ j` exactly if every coordinate of `i` is at most that of `j`. -/ |
| 198 | def HasDimension {n : ℕ} (k : ℕ) (r : Fin n → Fin n → Prop) : Prop := |
| 199 | ∃ f : Fin n → Fin k → ℚ, ∀ i j, i ≠ j → (Relation.TransGen r i j ↔ ∀ c, f i c ≤ f j c) |
| 200 | |
| 201 | /-- The relations of a class, for a number `m` of machines. -/ |
| 202 | def Order.InClass {n : ℕ} (m : ℕ) : Order → (Fin n → Fin n → Prop) → Prop |
| 203 | | .none, r => ∀ i j, ¬ r i j |
| 204 | | .chains, r => AtMostOneSuccessor r ∧ AtMostOnePredecessor r |
| 205 | | .intree, r => AtMostOneSuccessor r |
| 206 | | .outtree, r => AtMostOnePredecessor r |
| 207 | | .tree, r => AtMostOneSuccessor r ∨ AtMostOnePredecessor r |
| 208 | | .opposingForest, r => OpposingForest r |
| 209 | | .seriesParallel, r => SeriesParallel r |
| 210 | | .divideAndConquer, r => DivideAndConquer r Finset.univ |
| 211 | | .intervalOrder, r => IntervalOrder r |
| 212 | | .quasiInterval, r => QuasiInterval r |
| 213 | | .overInterval, r => OverInterval r |
| 214 | | .aOrder, r => AOrder m r |
| 215 | | .levelOrder, r => LevelOrder r |
| 216 | | .boundedHeight, _ => True |
| 217 | | .dimensionTwo, r => HasDimension 2 r |
| 218 | | .boundedDimension, r => ∃ k, HasDimension k r |
| 219 | | .prec, _ => True |
| 220 | |
| 221 | def Order.le : Order → Order → Bool |
| 222 | | _, .prec => true |
| 223 | | .none, .divideAndConquer => false |
| 224 | | .none, _ => true |
| 225 | | .chains, .chains | .chains, .intree | .chains, .outtree | .chains, .tree |
| 226 | | .chains, .opposingForest => true |
| 227 | | .intree, .intree | .intree, .tree | .intree, .opposingForest => true |
| 228 | | .outtree, .outtree | .outtree, .tree | .outtree, .opposingForest => true |
| 229 | | .tree, .tree | .tree, .opposingForest => true |
| 230 | | .chains, .seriesParallel | .intree, .seriesParallel | .outtree, .seriesParallel |
| 231 | | .tree, .seriesParallel | .opposingForest, .seriesParallel => true |
| 232 | | .chains, .dimensionTwo | .intree, .dimensionTwo | .outtree, .dimensionTwo |
| 233 | | .tree, .dimensionTwo | .opposingForest, .dimensionTwo => true |
| 234 | | .chains, .boundedDimension | .intree, .boundedDimension | .outtree, .boundedDimension |
| 235 | | .tree, .boundedDimension | .opposingForest, .boundedDimension => true |
| 236 | | .dimensionTwo, .boundedDimension => true |
| 237 | | .intervalOrder, .quasiInterval | .intervalOrder, .overInterval | .intervalOrder, .aOrder |
| 238 | | .quasiInterval, .overInterval => true |
| 239 | | .seriesParallel, .dimensionTwo | .seriesParallel, .boundedDimension => true |
| 240 | | v, w => decide (v = w) |
| 241 | |
| 242 | def Order.embed {n : ℕ} : {v w : Order} → Order.le v w = true → v.Data n → w.Data n |
| 243 | | _, .none, _, _ => () |
| 244 | | v, .chains, _, d | v, .intree, _, d | v, .outtree, _, d | v, .tree, _, d |
| 245 | | v, .opposingForest, _, d | v, .seriesParallel, _, d | v, .divideAndConquer, _, d |
| 246 | | v, .intervalOrder, _, d | v, .quasiInterval, _, d | v, .overInterval, _, d | v, .aOrder, _, d |
| 247 | | v, .levelOrder, _, d |
| 248 | | v, .boundedHeight, _, d | v, .dimensionTwo, _, d | v, .boundedDimension, _, d |
| 249 | | v, .prec, _, d => v.view d |
| 250 | |
| 251 | inductive Lags |
| 252 | | zero |
| 253 | | unit |
| 254 | | constant |
| 255 | | constantNonpositive |
| 256 | | constantPositive |
| 257 | | arbitrary |
| 258 | | arbitraryNonpositive |
| 259 | | arbitraryPositive |
| 260 | deriving DecidableEq |
| 261 | |
| 262 | /-- The data of a kind of lags. -/ |
| 263 | def Lags.Data (n : ℕ) : Lags → Type |
| 264 | | .zero | .unit => Unit |
| 265 | | .constant | .constantNonpositive | .constantPositive => ℤ |
| 266 | | .arbitrary | .arbitraryNonpositive | .arbitraryPositive => Fin n → Fin n → ℤ |
| 267 | |
| 268 | /-- The lag between two jobs. -/ |
| 269 | def Lags.view {n : ℕ} : (v : Lags) → v.Data n → Fin n → Fin n → ℤ |
| 270 | | .zero, _ => fun _ _ => 0 |
| 271 | | .unit, _ => fun _ _ => 1 |
| 272 | | .constant, l | .constantNonpositive, l | .constantPositive, l => fun _ _ => l |
| 273 | | .arbitrary, l | .arbitraryNonpositive, l | .arbitraryPositive, l => l |
| 274 | |
| 275 | /-- The sign condition of a kind of lags. -/ |
| 276 | def Lags.Admits {n : ℕ} : Lags → (Fin n → Fin n → ℤ) → Prop |
| 277 | | .constantNonpositive, l | .arbitraryNonpositive, l => ∀ i j, l i j ≤ 0 |
| 278 | | .constantPositive, l | .arbitraryPositive, l => ∀ i j, 0 < l i j |
| 279 | | _, _ => True |
| 280 | |
| 281 | def Lags.le : Lags → Lags → Bool |
| 282 | | .zero, .zero | .zero, .constant | .zero, .constantNonpositive | .zero, .arbitrary |
| 283 | | .zero, .arbitraryNonpositive => true |
| 284 | | .unit, .unit | .unit, .constant | .unit, .constantPositive | .unit, .arbitrary |
| 285 | | .unit, .arbitraryPositive => true |
| 286 | | .constant, .constant | .constant, .arbitrary => true |
| 287 | | .constantNonpositive, .constantNonpositive | .constantNonpositive, .constant |
| 288 | | .constantNonpositive, .arbitraryNonpositive | .constantNonpositive, .arbitrary => true |
| 289 | | .constantPositive, .constantPositive | .constantPositive, .constant |
| 290 | | .constantPositive, .arbitraryPositive | .constantPositive, .arbitrary => true |
| 291 | | .arbitrary, .arbitrary => true |
| 292 | | .arbitraryNonpositive, .arbitraryNonpositive | .arbitraryNonpositive, .arbitrary => true |
| 293 | | .arbitraryPositive, .arbitraryPositive | .arbitraryPositive, .arbitrary => true |
| 294 | | _, _ => false |
| 295 | |
| 296 | def Lags.embed {n : ℕ} : {v w : Lags} → Lags.le v w = true → v.Data n → w.Data n |
| 297 | | _, .zero, _, _ | _, .unit, _, _ => () |
| 298 | | .constant, .constant, _, l | .constantNonpositive, .constant, _, l |
| 299 | | .constantPositive, .constant, _, l |
| 300 | | .constantNonpositive, .constantNonpositive, _, l |
| 301 | | .constantPositive, .constantPositive, _, l => l |
| 302 | | .zero, .constant, _, _ | .zero, .constantNonpositive, _, _ => (0 : ℤ) |
| 303 | | .unit, .constant, _, _ | .unit, .constantPositive, _, _ => (1 : ℤ) |
| 304 | | v, .arbitrary, _, d | v, .arbitraryNonpositive, _, d | v, .arbitraryPositive, _, d => |
| 305 | v.view d |
| 306 | | .zero, .constantPositive, h, _ | .unit, .constantNonpositive, h, _ |
| 307 | | .constant, .constantNonpositive, h, _ | .constant, .constantPositive, h, _ |
| 308 | | .constantNonpositive, .constantPositive, h, _ |
| 309 | | .constantPositive, .constantNonpositive, h, _ |
| 310 | | .arbitrary, .constant, h, _ | .arbitrary, .constantNonpositive, h, _ |
| 311 | | .arbitrary, .constantPositive, h, _ | .arbitraryNonpositive, .constant, h, _ |
| 312 | | .arbitraryNonpositive, .constantNonpositive, h, _ |
| 313 | | .arbitraryNonpositive, .constantPositive, h, _ | .arbitraryPositive, .constant, h, _ |
| 314 | | .arbitraryPositive, .constantNonpositive, h, _ |
| 315 | | .arbitraryPositive, .constantPositive, h, _ => absurd h Bool.false_ne_true |
| 316 | |
| 317 | /-- A value of the field: a class of relations and a kind of lags. -/ |
| 318 | structure Value where |
| 319 | order : Order |
| 320 | lags : Lags := .zero |
| 321 | |
| 322 | /-- No precedence constraints. -/ |
| 323 | def Value.none : Value := ⟨.none, .zero⟩ |
| 324 | |
| 325 | /-- The field of precedence constraints with time lags over a kernel with a |
| 326 | number of machines. -/ |
| 327 | def module (K : Kernel) (machines : K.Inst → ℕ) : Module K where |
| 328 | Value := Value |
| 329 | Data v x := v.order.Data (K.jobs x) × v.lags.Data (K.jobs x) |
| 330 | admits v x d := v.order.InClass (machines x) (v.order.view d.1) ∧ v.lags.Admits (v.lags.view d.2) |
| 331 | constraint v x d σ := ∀ i j, v.order.view d.1 i j → |
| 332 | (K.completion x σ i : ℚ) + (v.lags.view d.2 i j : ℚ) ≤ (K.start x σ j : ℚ) |
| 333 | le v w := Order.le v.order w.order && Lags.le v.lags w.lags |
| 334 | embed {v w} h _ d := |
| 335 | (Order.embed (v := v.order) (w := w.order) (Bool.and_eq_true_iff.mp h).1 d.1, |
| 336 | Lags.embed (v := v.lags) (w := w.lags) (Bool.and_eq_true_iff.mp h).2 d.2) |
| 337 | |
| 338 | axiom sound (K : Kernel) (machines : K.Inst → ℕ) : (module K machines).Sound |
| 339 | |
| 340 | /-- The field of precedence constraints on one machine, without `A_m`-orders: |
| 341 | the value `A_m` admits no instance and lies below no other value. -/ |
| 342 | def oneMachine (K : Kernel) : Module K where |
| 343 | Value := Value |
| 344 | Data := (module K fun _ => 1).Data |
| 345 | admits v x d := v.order ≠ .aOrder ∧ (module K fun _ => 1).admits v x d |
| 346 | constraint := (module K fun _ => 1).constraint |
| 347 | le v w := (module K fun _ => 1).le v w && (w.order != .aOrder || v.order == .aOrder) |
| 348 | embed {v w} h x d := (module K fun _ => 1).embed (v := v) (w := w) |
| 349 | (Bool.and_eq_true_iff.mp h).1 x d |
| 350 | |
| 351 | axiom oneMachine_sound (K : Kernel) : (oneMachine K).Sound |
| 352 | |
| 353 | end Lax434175.Precedence |
| 354 |
Builds on
Used by
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments