# Encoding disjunctive-scheduling_domain.gringo

Name disjunctive-scheduling_domain.gringo [Root]    Miscellaneous (45) Martin Gebser Martin Gebser and Roland Kaminski This logic program encodes the computation of sufficient intervals for tasks' starting times. That is, if there is a solution for an instance, there is at least one solution such that all tasks' starting times lie in-between X and Y as given by mintime(X) and maxtime(Y) in an answer set. This functionality can be used to figure out values to insert into statement "\$domain(X..Y)" used by clingcon (cf. disjunctive-scheduling_decision.clingcon). 2009-05-07 16:30 2009-05-07 16:37 Disjunctive Scheduling est/2let/2task/2 maxtime/1mintime/1 No ttask(I,D) :- task(I,D), D > 0. noest(I) :- ttask(I,D), not est(I,T) : est(I,T). nolet(I) :- ttask(I,D), not let(I,T) : let(I,T). tsk :- ttask(I,D). est :- ttask(I,D), est(I,T). let :- ttask(I,D), let(I,T). minest(M) :- est, M = min [ est(I,T) : est(I,T) : ttask(I,D) = T ]. maxest(M) :- est, M = max [ est(I,T) : est(I,T) : ttask(I,D) = T ]. minlet(M) :- let, M = min [ let(I,T) : let(I,T) : ttask(I,D) = T ]. maxlet(M) :- let, M = max [ let(I,T) : let(I,T) : ttask(I,D) = T ]. mindur(M) :- tsk, M = min [ ttask(I,D) : ttask(I,D) = D ]. sumnoest(S) :- S = [ ttask(I,D) : ttask(I,D) : noest(I) = D ]. sumnolet(S) :- S = [ ttask(I,D) : ttask(I,D) : nolet(I) = D ]. sumall(S) :- S = [ ttask(I,D) : ttask(I,D) = D ]. lowest(M-S) :- est, minest(M), sumnoest(S). lowlet(M-S) :- let, minlet(M), sumall(S). higest((M+S)-D) :- est, maxest(M), sumall(S), mindur(D). higlet((M+S)-D) :- let, maxlet(M), sumnolet(S), mindur(D). maxtime(0) :- not tsk. mintime(0) :- not est, not let. maxtime(S-D) :- not est, not let, sumall(S), mindur(D), tsk. mintime(M) :- est, not let, maxest(M). maxtime(M) :- est, not let, higest(M). mintime(M) :- not est, let, lowlet(M). maxtime(M-D) :- not est, let, minlet(M), mindur(D). mintime(M) :- est, let, M = max [ lowest(I) : lowest(I) = I, lowlet(J) : lowlet(J) = J ]. maxtime(M) :- est, let, M = min [ higest(I) : higest(I) = I, higlet(J) : higlet(J) = J ]. #hide. #show mintime/1. #show maxtime/1.