Transportation delays and a transport robot
Lax434175.Transportation · concepts/Lax434175/Transportation.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
In a shop with transportation delays an instance carries, for every job and every ordered pair of its operations , a delay . Of any two operations of a job, the later one may not start before the completion of the earlier one plus the delay from the earlier to the later.
The shape field restricts the delays:
- none: all delays are ;
- uniform: all delays equal one number ;
- two values: there are two numbers, and the delays of each job all equal one of them;
- job: the delay depends on the job only, ;
- source: the delay depends on the earlier operation only, ;
- job and source: the delay does not depend on the later operation, ;
- pair: the delay depends on the two positions only, , possibly required to be symmetric, ;
- job and pair: arbitrary delays , possibly required to be symmetric, .
A shape is a special case of another if its delays are among the other's.
With a transport robot, in addition every transport of a job from an operation to the next one in its sequence is carried out by a single robot: the transport starts no earlier than the completion of the operation, lasts for the delay, and ends no later than the start of the next operation. The robot may need time to travel empty, as in Brucker and Knust, Complex Scheduling, §4.6: an instance then carries, for every two machines , an empty moving time . Of any two transports, the later one departs no earlier than the arrival of the earlier one plus the time the robot needs to travel empty from the machines where it delivers the earlier one to the machines where it picks up the later one, the largest empty moving time between them. Unless the robot has empty moves, all empty moving times are , and two transports merely do not overlap.
A problem with a robot and one without are incomparable. A robot without empty moves is a special case of one with them.
Theorem. The field of transportation delays is sound.
Concept map
Lean source view on GitHub
| 1 | import Lax434175.Shops |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Transportation delays and a transport robot |
| 6 | type: theorem |
| 7 | --- |
| 8 | In a shop with transportation delays an instance carries, for every job |
| 9 | and every ordered pair of its operations , a delay . Of any |
| 10 | two operations of a job, the later one may not start before the completion |
| 11 | of the earlier one plus the delay from the earlier to the later. |
| 12 | |
| 13 | The shape field restricts the delays: |
| 14 | |
| 15 | - none: all delays are ; |
| 16 | - uniform: all delays equal one number ; |
| 17 | - two values: there are two numbers, and the delays of each job all equal |
| 18 | one of them; |
| 19 | - job: the delay depends on the job only, ; |
| 20 | - source: the delay depends on the earlier operation only, ; |
| 21 | - job and source: the delay does not depend on the later operation, |
| 22 | ; |
| 23 | - pair: the delay depends on the two positions only, , possibly |
| 24 | required to be symmetric, ; |
| 25 | - job and pair: arbitrary delays , possibly required to be |
| 26 | symmetric, . |
| 27 | |
| 28 | A shape is a special case of another if its delays are among the other's. |
| 29 | |
| 30 | With a transport robot, in addition every transport of a job from an |
| 31 | operation to the next one in its sequence is carried out by a single robot: |
| 32 | the transport starts no earlier than the completion of the operation, lasts |
| 33 | for the delay, and ends no later than the start of the next operation. The |
| 34 | robot may need time to travel empty, as in Brucker and Knust, *Complex |
| 35 | Scheduling*, §4.6: an instance then carries, for every two machines , |
| 36 | an empty moving time . Of any two transports, the later one departs |
| 37 | no earlier than the arrival of the earlier one plus the time the robot needs |
| 38 | to travel empty from the machines where it delivers the earlier one to the |
| 39 | machines where it picks up the later one, the largest empty moving time |
| 40 | between them. Unless the robot has empty moves, all empty moving times are |
| 41 | , and two transports merely do not overlap. |
| 42 | |
| 43 | A problem with a robot and one without are incomparable. A robot without |
| 44 | empty moves is a special case of one with them. |
| 45 | |
| 46 | **Theorem.** The field of transportation delays is sound. |
| 47 | -/ |
| 48 | |
| 49 | namespace Lax434175.Transportation |
| 50 | open Lax434175.Kernels Lax434175.Modules Lax434175.Shops |
| 51 | |
| 52 | /-- The delays of an instance. -/ |
| 53 | abbrev Delays (x : Inst) := (j : Fin x.jobs) → Fin (x.ops j) → Fin (x.ops j) → ℕ |
| 54 | |
| 55 | inductive Shape |
| 56 | | none |
| 57 | | uniform |
| 58 | | twoValues |
| 59 | | job |
| 60 | | source |
| 61 | | jobSource |
| 62 | | pairSymmetric |
| 63 | | pair |
| 64 | | jobPairSymmetric |
| 65 | | jobPair |
| 66 | deriving DecidableEq |
| 67 | |
| 68 | /-- The delays of a shape. -/ |
| 69 | def Shape.holds {x : Inst} : Shape → Delays x → Prop |
| 70 | | .none, t => ∀ j k l, t j k l = 0 |
| 71 | | .uniform, t => ∃ T, ∀ j k l, t j k l = T |
| 72 | | .twoValues, t => ∃ T₁ T₂, ∀ j, (∀ k l, t j k l = T₁) ∨ (∀ k l, t j k l = T₂) |
| 73 | | .job, t => ∀ j k l k' l', t j k l = t j k' l' |
| 74 | | .source, t => ∃ g : ℕ → ℕ, ∀ j k l, t j k l = g k.val |
| 75 | | .jobSource, t => ∀ j k l l', t j k l = t j k l' |
| 76 | | .pairSymmetric, t => ∃ g : ℕ → ℕ → ℕ, (∀ a b, g a b = g b a) ∧ ∀ j k l, t j k l = g k.val l.val |
| 77 | | .pair, t => ∃ g : ℕ → ℕ → ℕ, ∀ j k l, t j k l = g k.val l.val |
| 78 | | .jobPairSymmetric, t => ∀ j k l, t j k l = t j l k |
| 79 | | .jobPair, _ => True |
| 80 | |
| 81 | def Shape.le : Shape → Shape → Bool |
| 82 | | _, .jobPair => true |
| 83 | | .none, _ => true |
| 84 | | .uniform, .none => false |
| 85 | | .uniform, _ => true |
| 86 | | .twoValues, .twoValues | .twoValues, .job | .twoValues, .jobSource |
| 87 | | .twoValues, .jobPairSymmetric => true |
| 88 | | .job, .job | .job, .jobSource | .job, .jobPairSymmetric => true |
| 89 | | .source, .source | .source, .jobSource | .source, .pair => true |
| 90 | | .jobSource, .jobSource => true |
| 91 | | .pairSymmetric, .pairSymmetric | .pairSymmetric, .pair |
| 92 | | .pairSymmetric, .jobPairSymmetric => true |
| 93 | | .pair, .pair => true |
| 94 | | .jobPairSymmetric, .jobPairSymmetric => true |
| 95 | | _, _ => false |
| 96 | |
| 97 | /-- Of two operations of a job, the later one waits for the delay. -/ |
| 98 | def Delayed (x : Inst) (t : Delays x) (σ : Sched x) : Prop := |
| 99 | ∀ j (k l : Fin (x.ops j)), k ≠ l → |
| 100 | finish x σ ⟨j, k⟩ + t j k l ≤ σ.start j l ∨ finish x σ ⟨j, l⟩ + t j l k ≤ σ.start j k |
| 101 | |
| 102 | /-- The empty moving times of the robot, from a machine to a machine. -/ |
| 103 | abbrev EmptyMoves (x : Inst) := Fin x.machines → Fin x.machines → ℕ |
| 104 | |
| 105 | /-- The time the robot needs to travel empty from a set of machines to |
| 106 | another: the largest empty moving time from a machine of the first to a |
| 107 | machine of the second. -/ |
| 108 | def emptyTime {m : ℕ} (e : Fin m → Fin m → ℕ) (S S' : Finset (Fin m)) : ℕ := |
| 109 | S.sup fun i => S'.sup (e i) |
| 110 | |
| 111 | /-- A single robot carries every job from each operation to the next, and |
| 112 | between two transports it travels empty from the machines where it delivers |
| 113 | the one to the machines where it picks up the other. -/ |
| 114 | def Carried (x : Inst) (t : Delays x) (e : EmptyMoves x) (σ : Sched x) : Prop := |
| 115 | ∃ depart : (j : Fin x.jobs) → Fin (x.ops j) → ℕ, |
| 116 | (∀ j (k l : Fin (x.ops j)), l.val = k.val + 1 → |
| 117 | finish x σ ⟨j, k⟩ ≤ depart j k ∧ depart j k + t j k l ≤ σ.start j l) ∧ |
| 118 | ∀ j (k l : Fin (x.ops j)) j' (k' l' : Fin (x.ops j')), l.val = k.val + 1 → |
| 119 | l'.val = k'.val + 1 → (⟨j, k⟩ : Op x) ≠ ⟨j', k'⟩ → |
| 120 | depart j k + t j k l + emptyTime e (σ.machines j l) (σ.machines j' k') ≤ depart j' k' ∨ |
| 121 | depart j' k' + t j' k' l' + emptyTime e (σ.machines j' l') (σ.machines j k) ≤ depart j k |
| 122 | |
| 123 | /-- A value of the field: a shape of delays, whether a robot carries the |
| 124 | jobs, and whether the robot needs time to travel empty. -/ |
| 125 | structure Value where |
| 126 | shape : Shape |
| 127 | robot : Bool := false |
| 128 | emptyMoves : Bool := false |
| 129 | |
| 130 | /-- No transportation delays and no robot. -/ |
| 131 | def Value.none : Value := ⟨.none, false, false⟩ |
| 132 | |
| 133 | /-- The data of the field: the delays and the empty moving times. -/ |
| 134 | abbrev Data (x : Inst) := Delays x × EmptyMoves x |
| 135 | |
| 136 | /-- The delays have the shape, and unless the value has a robot with empty |
| 137 | moves, the empty moving times are `0`. -/ |
| 138 | def Value.admits {x : Inst} (v : Value) (d : Data x) : Prop := |
| 139 | v.shape.holds d.1 ∧ ((v.robot && v.emptyMoves) = false → ∀ i i', d.2 i i' = 0) |
| 140 | |
| 141 | /-- The shape is a special case, both values have a robot or neither has, |
| 142 | and empty moves only if the other value has them. -/ |
| 143 | def Value.le (v w : Value) : Bool := |
| 144 | Shape.le v.shape w.shape && decide (v.robot = w.robot) && (!v.emptyMoves || w.emptyMoves) |
| 145 | |
| 146 | /-- The field of transportation delays. -/ |
| 147 | def module : Module kernel where |
| 148 | Value := Value |
| 149 | Data _ x := Data x |
| 150 | admits v _ d := v.admits d |
| 151 | constraint v x d σ := Delayed x d.1 σ ∧ (v.robot = true → Carried x d.1 d.2 σ) |
| 152 | le := Value.le |
| 153 | embed _ _ d := d |
| 154 | |
| 155 | axiom sound : module.Sound |
| 156 | |
| 157 | end Lax434175.Transportation |
| 158 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments