% Modeling trip's participants: %%%%% Input Variables %%%%% #domain person(P;P1;P2;P3). object(P). %%%%%%% Domain Signature %%%%%%% action(embark(P,J)). atomic(embark(P,J)). actor(embark(P,J),P). action(disembark(P,J)). atomic(disembark(P,J)). actor(disembark(P,J),P). %action(go_on(P,J)). % < embark(P,J), go(J), disembark(P,J) > %actor(go_on(P,J),P). fluent(participant(P,J)). fluent(at(P,Pos)). %%%%%%%%%% Direct effects % P joins the trip J: h(participant(P,J),S+1) :- o(embark(P,J),S). % P ends the trip J: -h(participant(P,J),S+1) :- o(disembark(P,J),S). %%%%%%%%%% Triggers % go_on is a sequence of three events: % 1. P embarks on the trip: o(embark(P,J),S) :- o(go_on(P,J),S). % 2. The trip starts: starts(go(J),S+1) :- o(go_on(P,J),S). %3. P disembark at arrival: o(disembark(P,J),S) :- h(participant(P,J),S), ends(go(J),S). %%%%%%%%%% State Constraints % Participants share the current location of their trip h(at(P,Pos),S) :- h(participant(P,J),S), h(at(J,Pos),S). %%%%%%%%% Executability Conditions % Can't embark (disembark) if have already done so: -o(embark(P,J),S) :- h(participant(P,J),S). -o(disembark(P,J),S) :- -h(participant(P,J),S). %Need to be at the right place: -o(embark(P,J),S) :- h(at(P,L),S), -h(at(J,L),S). -o(embark(P,J),S) :- h(at(J,en_route),S). -o(disembark(P,J),S) :- h(at(J,en_route),S).