%%% ACTIONS %%% :- variables A,A1 :: exogenousAction. :- constants move(animal,position), open(human,gate), close(human,gate), mount(human,animal), getOff(human,animal,position), throwOff(animal,human) :: exogenousAction. :- macros % Action #1 is executed by animal #2 doneBy(#1,#2) -> ([\/P | #1==move(#2,P)] ++ [\/G | #1==open(#2,G) ++ #1==close(#2,G)] ++ [\/ANML | #1==mount(#2,ANML)] ++ [\/ANML \/P | #1==getOff(#2,ANML,P)] ++ [\/H | #1==throwOff(#2,H)]). % A failed mount is not subject to the usual, rather strict, % movement restriction on large animals mount(H,ANML) causes ab(H). % If the position a large human is thrown into was previously % occupied by another large animal, the usual movement restric- % tion doesn't apply throwOff(ANML,H) causes ab(H). % Every animal can execute only one action at a time nonexecutable A & A1 if doneBy(A,ANML1) & doneBy(A1,ANML1) where A@> large(ANML). % A human cannot attempt to mount a small animal (lmw) nonexecutable mount(H,ANML) if -large(ANML). % A large human cannot be mounted on a human constraint mounted(H,H1) ->> -large(H). % A large human cannot attempt to mount a human nonexecutable mount(H,H1) if large(H). % An animal can be mounted by at most one human at a time constraint -(mounted(H,ANML) & mounted(H1,ANML)) where H@