• No results found

Precedence Constraint Propagation

4.2 Constraint Propagation

4.2.6 Precedence Constraint Propagation

Ifachieve(T,T0)=1orfollow(T,T0) = 1orsupport(T,T0)> 0, then it means that both T and T0 are included in the plan and there is a precedence constraint T → T0. On each state variable and resource, for each transition pair< T,T0 >, a precedence relationT → T0 represents that ifTandT0 are included in the plan, thenT0starts afterTfinishes its execution. This precedence relation between a pair of transitions is conditionallytransitive. This means that ifT →T0holds, andT0 →T00holds, thenT→T00holds, if and only ifT0 is included in the plan. Note that ifT→T0holds, then it means thatTmust finish its execution beforeT0 if and only ifTandT0are included in the plan.

For each state variable and resource, for each pair of transitions < T,T0 >, we define another relationanti-precedenceT9 T0, that represents that ifTandT0are included in the

plan, thenTcan not finish beforeT0starts.

Note that each precedence relation betweenTandT0, implies an anti-precedence relation betweenT0andT. It means, ifTmust finish beforeT0, thenT0can’t finish beforeTstarts.

T→T0 ⇒T0 9T

In general, T0 9 T doesn’t imply that T must finish before T0 starts. Note that the anti-

precedence relation is nottransitive. Consider three transitionsT,T0 andT00, such that all are included in the plan, and the following constraints holds:

T9T0 andT0 9T00

From these relations we can’t conclude thatT 9 T00, because it might be the case thatT →

Each precedence constraint implies a temporal constraint (Constraint18). Since effect of precedence relations is conditioned on the inclusion of the transitions in the plan, if transitions are not yet decided to be included in the plan, then precedence relations have no temporal effects. Anti-precedence relations do not have any temporal effects on transitions’ start or end times. We use anti-precedence constraints for pruning domains ofsupport,achieveand

followvariables.

Propagation Rule 15. On each state variable and resource, for each pair of transitions<

T,T0 >such thatT → T0holds, ifTis included in the plan, then we update the start time of

T0 ifT0 is not excluded from the plan. Similarly, ifT0 is included in the plan, then we update the end time ofT ifTis not excluded from the plan. This means that∀T,T0s.t.TandT0 are not excluded, we apply the following rules

inplan(T)∧T →T0 ⇒ post : start(T0)≥lb(end(T)) (4.23)

inplan(T0)∧T →T0 ⇒ post : end(T)≤ ub(start(T0)) (4.24)

Each precedence constraint between a pair of transitions implies an anti-precedence rela- tion between the transitions.

Propagation Rule 16. For each pair of transitions< T,T0 > such that neither of them is excluded from the plan, a precedence relationT→T0implies an anti-precedence relation.

T →T0 ⇒ post : T0 9T (4.25)

Note thatT9T0 meansTcan’t finish its execution beforeT0 starts its execution.

On each state variable sv, ifTsv 9 Tsv0 holds andTsv is an EFFECT transition, thenTsv

can’t achieve the pre-condition ofTsv0 .

Propagation Rule 17. On each state variable sv, for each pair of achieve-relevant pair<

Tsv,Tsv0 >∈ AC(sv), ifTsv9Tsv0 holds thenTsvcan’t achieve the pre-condition ofTsv0 .

Tsv 9Tsv0 ⇒ set : achieve(Tsv,Tsv0 ) =0 (4.26)

On each state variable, ifTP

svis a PREVAIL transition, andTsvE is an EFFECT transitions,

andTsvP 9TsvE holds, thenTsvE can’t followTsvP, if<TsvP,TsvE >is a can-follow pair.

Propagation Rule 18. On each state variablesv, for each can-follow pair < TsvP,TsvE >∈

FL(sv), ifTsvP 9TsvE holds, thenTsvE can’t followTsvP.

§4.2 Constraint Propagation 81

Similarly, for each pair of resource transitions on a resource,Tcan’t supportT0ifT9T0

holds.

Propagation Rule 19. On each resourcer, for each pair of support-relevant pair< Tr,Tr0 >∈ SUP(r), ifTr9Tr0holds thenTrcan’t provide support toTr0.

Tr9Tr0 ⇒ set : support(Tr,Tr0) =0 (4.28)

On each domain object to maintain theprecedenceandanti-precedencerelation, for each transition on the domain object we maintain the following sets during the search:

• before(T): For each transitionT0 in this set, ifTandT0 are included in the plan, then T0 mustfinish beforeTstarts.

• not-before(T): For each transition T0 in this set, ifT andT0 are included in the plan, thenT0 mustfinish afterTstarts.

• after(T): For each transitionT0in this set, ifTandT0are included in the plan, thenT0 muststart afterTfinishes.

• not-after(T): For each transition T0 in this set, if T and T0 are included in the plan, thenT0 muststart beforeTfinishes.

When propagating, we post precedence and anti-precedence constraints between transitions. When we postT →T0, then we addT0inafter(T)and addTinbefore(T0). Similarly, when we post T 9 T0, then we add T0 innot-after(T)and add Tinnot-before(T0). When we

say theT → T0 holds, we mean that T ∈ before(T0), andT0 ∈ after(T). Similarly, when we sayT9T0 holds, we mean thatT ∈not-before(T0)andT0 ∈not-after(T).