Crossing


actions:
crossTogether(X,Y) requires person(X), person(Y), X < Y

costs Smax where speed(X,SX), speed(Y,SY),

max(SX,SY,Smax).
cross(X) requires person(X) costs SX where speed(X,SX).

giveLampTo(X) requires person(X).

fluents:
across(X) requires person(X).

hasLamp(X) requires person(X).

differentSides(X,Y) requires person(X), person(Y).
initially:

-across(X).

hasLamp(a).
always:
executable crossTogether(X,Y) if hasLamp(X).

executable crossTogether(X,Y) if hasLamp(Y).

nonexecutable crossTogether(X,Y) if differentSides(X,Y).

executable cross(X) if hasLamp(X).

executable giveLampTo(X).

nonexecutable giveLampTo(X) if hasLamp(Y), differentSides(X,Y).

caused across(X) after crossTogether(X,Y), -across(X).

caused across(Y) after crossTogether(X,Y), -across(Y).

caused -across(X) after crossTogether(X,Y), across(X).

caused -across(Y) after crossTogether(X,Y), across(Y).

caused across(X) after cross(X), -across(X).

caused -across(X) after cross(X), across(X).

caused hasLamp(X) after giveLampTo(X).

caused -hasLamp(X) after giveLampTo(Y), X !=Y, hasLamp(X).

caused differentSides(X,Y) if across(X), -across(Y).

caused differentSides(X,Y) if -across(X), across(Y).

inertial across(X).

inertial -across(X).

inertial hasLamp(X).

noConcurrency.

goal: across(a), across(b), across(c), across(d)?