M. Balduccini, C. Baral, Y. Lierler 801
-o(disembark(P,J),T) :- -h(participant(P,J),T).
-o(disembark(P,J),T) :- h(at(J,en_route),T).
11. Rules about the action go_on: The action go_on is viewed as a composite
action consisting of first embarking and then departing. This is expressed by the first
two rules below. The third rule states that a plane trip takes at most a day.
o(embark(P,J),T) :- o(go_on(P,J),T).
o(depart(J),T+1) :- o(go_on(P,J),T).
time(T2,day,D) | time(T2,day,D + 1) :- o(go_on(P,J),T1),
o(disembark(P,J),T2),
time(T1,day,D),
h(trip_by(J,plane),T1).
12. Effect of the action get: The first rule below states that if one gets something
then he has it. The second rule states that getting a passport could take at least three
days. Rules that compute the duration of an action are discussed later in item 16.
h(has_with_him(P,PP),T+1) :- o(get(P,PP),T).
:- duration(get(P,passport(P)),Day), Day < 3.
13. Effect axioms and executability conditions of the actions pack and unpack:
The first two rules below state the effect of packing and unpacking a possession
inside a container. The third and fourth rule state when one can pack a possession and
the fifth and sixth rules state when one can unpack a possession.
h(inside(PP,Container),T+1) :- o(pack(P,PP,Container),T).
-h(inside(PP,Container),T+1) :- o(unpack(P,PP,Container),T).
-o(pack(P,PP,Container),T) :- -h(has_with_him(P,PP),T).
-o(pack(P,PP,Container),T) :- -h(has_with_him(P,Container),T).
-o(unpack(P,PP,Container),T) :- -h(has_with_him(P,Container),T).
-o(unpack(P,PP,Container),T) :- -h(inside(P,Container),T).
14. Direct and Indirect effects (including triggers) of the actions depart and stop:
The first two rules below express the impact of departing and stopping. The third
rule says that a stop at the destination of a journey is followed by disembarking of
the participants of that journey. The fourth rule says that a stop in a non-destination is
normally followed by a depart action. The fifth and sixth rules give conditions when
departing and stopping is not possible. The seventh rule says that normally a trip goes
to its destination. The eighth rule says that after departing one stops at the next stop.
The last rule states that one can stop at only one place at a time.
h(at(J,en_route),T+1) :- o(depart(J),T).
h(at(J,C),T+1) :- o(stop(J,C),T).
o(disembark(P,J),T+1) :- h(participant(P,J),T),
o(stop(J,D),T), dest(J,D).