/** * All rights reserved. Use of this software is permitted for non-commercial * research purposes, and it may be copied only for that use. All copies must * include this copyright message. This software is made available AS IS, and * neither the GIPO team nor the University of Huddersfield make any warranty * about the software or its performance. * * Automatically generated OCL Domain from GIPO Version 2.0 * * Author: Doris Liu * Institution: University of Huddersfield * Date created: April 2000 * Date last modified: 2005/07/05 at 03:38:04 PM BST * Description: * This is a version of the flat-tyre world descended from Russell. * Goal to change a flat tyre on truck */ domain_name(tyre). % Sorts sorts(primitive_sorts,[container,nuts,hub,pump,wheel,wrench,jack]). % Objects objects(container,[boot]). objects(nuts,[nuts_1]). objects(hub,[hub0]). objects(pump,[pump0]). objects(wheel,[wheel1,wheel2]). objects(wrench,[wrench0]). objects(jack,[jack0]). % Predicates predicates([ closed(container), open(container), tight(nuts,hub), loose(nuts,hub), have_nuts(nuts), on_ground(hub), fastened(hub), jacked_up(hub,jack), free(hub), unfastened(hub), have_pump(pump), pump_in(pump,container), have_wheel(wheel), wheel_in(wheel,container), wheel_on(wheel,hub), have_wrench(wrench), wrench_in(wrench,container), have_jack(jack), jack_in_use(jack,hub), jack_in(jack,container)]). % Object Class Definitions substate_classes(container,C,[ [closed(C)], [open(C)]]). substate_classes(nuts,N,[ [tight(N,H)], [loose(N,H)], [have_nuts(N)]]). substate_classes(hub,H,[ [on_ground(H),fastened(H)], [jacked_up(H,J),fastened(H)], [free(H),jacked_up(H,J),unfastened(H)], [unfastened(H),jacked_up(H,J)]]). substate_classes(pump,P,[ [have_pump(P)], [pump_in(P,C)]]). substate_classes(wheel,W,[ [have_wheel(W)], [wheel_in(W,C)], [wheel_on(W,H)]]). substate_classes(wrench,W,[ [have_wrench(W)], [wrench_in(W,C)]]). substate_classes(jack,J,[ [have_jack(J)], [jack_in_use(J,H)], [jack_in(J,C)]]). % Atomic Invariants % Implied Invariants % Inconsistent Constraints inconsistent_constraint([have_nuts(X),tight(X,_)]). inconsistent_constraint([have_nuts(X),loose(X,_)]). inconsistent_constraint([loose(_,H),tight(_,H)]). inconsistent_constraint([unfastened(H),tight(_,H)]). inconsistent_constraint([unfastened(H),loose(_,H)]). inconsistent_constraint([wheel_in(W,_),wheel_on(W,_)]). inconsistent_constraint([wheel_in(W,_),have_wheel(W)]). inconsistent_constraint([jack_in(J,_),have_jack(J)]). inconsistent_constraint([pump_in(P,_),have_pump(P)]). inconsistent_constraint([wrench_in(W,_),have_wrench(W)]). inconsistent_constraint([open(C),closed(C)]). inconsistent_constraint([deflated(W),inflated(W)]). inconsistent_constraint([fastened(H),unfastened(H)]). inconsistent_constraint([jacked_up(H,J),on_ground(H)]). inconsistent_constraint([free(H),wheel_on(_,H)]). inconsistent_constraint([free(X),fastened(X)]). inconsistent_constraint([free(X),tight(Nuts,X)]). inconsistent_constraint([free(X),loose(Nuts,X)]). inconsistent_constraint([wheel_on(W1,X),wheel_on(W2,X),ne(W1,W2)]). inconsistent_constraint([wheel_on(W,H1),wheel_on(W,H2),ne(H1,H2)]). inconsistent_constraint([wheel_on(W,H1),have_wheel(W)]). inconsistent_constraint([jacked_up(H,J),jack_in(J,_)]). inconsistent_constraint([jacked_up(H,J),have_jack(J)]). inconsistent_constraint([fastened(H),have_nuts(N)]). inconsistent_constraint([jack_in_use(J,_),jack_in(J,_)]). inconsistent_constraint([jack_in_use(J,_),have_jack(J)]). inconsistent_constraint([jack_in_use(J,H),on_ground(H)]). % Operators operator(open_container(C), % prevail [], % necessary [ sc(container,C,[closed(C)]=>[open(C)])], % conditional []). operator(close_container(C), % prevail [], % necessary [ sc(container,C,[open(C)]=>[closed(C)])], % conditional []). operator(fetch_jack(C,J), % prevail [ se(container,C,[open(C)])], % necessary [ sc(jack,J,[jack_in(J,C)]=>[have_jack(J)])], % conditional []). operator(fetch_wheel(C,W), % prevail [ se(container,C,[open(C)])], % necessary [ sc(wheel,W,[wheel_in(W,C)]=>[have_wheel(W)])], % conditional []). operator(fetch_wrench(C,W), % prevail [ se(container,C,[open(C)])], % necessary [ sc(wrench,W,[wrench_in(W,C)]=>[have_wrench(W)])], % conditional []). operator(fetch_pump(C,P), % prevail [ se(container,C,[open(C)])], % necessary [ sc(pump,P,[pump_in(P,C)]=>[have_pump(P)])], % conditional []). operator(putaway_wheel(C,W), % prevail [ se(container,C,[open(C)])], % necessary [ sc(wheel,W,[have_wheel(W)]=>[wheel_in(W,C)])], % conditional []). operator(putaway_wrench(C,W), % prevail [ se(container,C,[open(C)])], % necessary [ sc(wrench,W,[have_wrench(W)]=>[wrench_in(W,C)])], % conditional []). operator(putaway_jack(C,J), % prevail [ se(container,C,[open(C)])], % necessary [ sc(jack,J,[have_jack(J)]=>[jack_in(J,C)])], % conditional []). operator(putaway_pump(C,P), % prevail [ se(container,C,[open(C)])], % necessary [ sc(pump,P,[have_pump(P)]=>[pump_in(P,C)])], % conditional []). operator(loosen(W,H,N), % prevail [ se(wrench,W,[have_wrench(W)]), se(hub,H,[on_ground(H),fastened(H)])], % necessary [ sc(nuts,N,[tight(N,H)]=>[loose(N,H)])], % conditional []). operator(tighten(W,H,N), % prevail [ se(wrench,W,[have_wrench(W)]), se(hub,H,[on_ground(H),fastened(H)])], % necessary [ sc(nuts,N,[loose(N,H)]=>[tight(N,H)])], % conditional []). operator(jack_up(H,J), % prevail [], % necessary [ sc(hub,H,[on_ground(H),fastened(H)]=>[jacked_up(H,J),fastened(H)]), sc(jack,J,[have_jack(J)]=>[jack_in_use(J,H)])], % conditional []). operator(jack_down(H,J), % prevail [], % necessary [ sc(hub,H,[jacked_up(H,J),fastened(H)]=>[on_ground(H),fastened(H)]), sc(jack,J,[jack_in_use(J,H)]=>[have_jack(J)])], % conditional []). operator(do_up(W,H,J,N), % prevail [ se(wrench,W,[have_wrench(W)])], % necessary [ sc(hub,H,[unfastened(H),jacked_up(H,J)]=>[jacked_up(H,J),fastened(H)]), sc(nuts,N,[have_nuts(N)]=>[loose(N,H)])], % conditional []). operator(remove_wheel(W,H,J), % prevail [], % necessary [ sc(wheel,W,[wheel_on(W,H)]=>[have_wheel(W)]), sc(hub,H,[unfastened(H),jacked_up(H,J)]=>[free(H),jacked_up(H,J),unfastened(H)])], % conditional []). operator(put_on_wheel(W,H,J), % prevail [], % necessary [ sc(wheel,W,[have_wheel(W)]=>[wheel_on(W,H)]), sc(hub,H,[free(H),jacked_up(H,J),unfastened(H)]=>[unfastened(H),jacked_up(H,J)])], % conditional []). operator(undo(W,H,J,N), % prevail [ se(wrench,W,[have_wrench(W)])], % necessary [ sc(hub,H,[jacked_up(H,J),fastened(H)]=>[unfastened(H),jacked_up(H,J)]), sc(nuts,N,[loose(N,H)]=>[have_nuts(N)])], % conditional []). % Methods % Domain Tasks planner_task(1, % Goals [ se(hub,hub0,[fastened(hub0),jacked_up(hub0,jack0)]), se(wheel,wheel2,[wheel_on(wheel2,hub0)])], % INIT States [ ss(wrench,wrench0,[wrench_in(wrench0,boot)]), ss(wheel,wheel1,[wheel_in(wheel1,boot)]), ss(wheel,wheel2,[have_wheel(wheel2)]), ss(pump,pump0,[pump_in(pump0,boot)]), ss(nuts,nuts_1,[tight(nuts_1,hub0)]), ss(jack,jack0,[have_jack(jack0)]), ss(hub,hub0,[on_ground(hub0),fastened(hub0)]), ss(container,boot,[closed(boot)])]). planner_task(2, % Goals [ se(container,boot,[open(boot)]), se(hub,hub0,[jacked_up(hub0,jack0)]), se(nuts,nuts_1,[loose(nuts_1,hub0)]), se(wheel,wheel2,[wheel_in(wheel2,boot)]), se(wheel,wheel1,[wheel_on(wheel1,hub0)]), se(wrench,wrench0,[wrench_in(wrench0,boot)])], % INIT States [ ss(wrench,wrench0,[have_wrench(wrench0)]), ss(wheel,wheel1,[have_wheel(wheel1)]), ss(wheel,wheel2,[wheel_on(wheel2,hub0)]), ss(pump,pump0,[pump_in(pump0,boot)]), ss(nuts,nuts_1,[loose(nuts_1,hub0)]), ss(jack,jack0,[jack_in_use(jack0,hub0)]), ss(hub,hub0,[jacked_up(hub0,jack0),fastened(hub0)]), ss(container,boot,[closed(boot)])]). planner_task(3, % Goals [ se(container,boot,[open(boot)]), se(hub,hub0,[jacked_up(hub0,jack0)]), se(jack,jack0,[jack_in_use(jack0,hub0)]), se(nuts,nuts_1,[have_nuts(nuts_1)]), se(pump,pump0,[have_pump(pump0)]), se(wrench,wrench0,[wrench_in(wrench0,boot)])], % INIT States [ ss(wrench,wrench0,[wrench_in(wrench0,boot)]), ss(wheel,wheel1,[wheel_on(wheel1,hub0)]), ss(wheel,wheel2,[have_wheel(wheel2)]), ss(pump,pump0,[have_pump(pump0)]), ss(nuts,nuts_1,[tight(nuts_1,hub0)]), ss(jack,jack0,[jack_in(jack0,boot)]), ss(hub,hub0,[on_ground(hub0),fastened(hub0)]), ss(container,boot,[open(boot)])]). planner_task(4, % Goals [ se(container,boot,[closed(boot)]), se(wheel,wheel1,[have_wheel(wheel1)])], % INIT States [ ss(wrench,wrench0,[wrench_in(wrench0,boot)]), ss(wheel,wheel1,[wheel_on(wheel1,hub0)]), ss(wheel,wheel2,[have_wheel(wheel2)]), ss(pump,pump0,[pump_in(pump0,boot)]), ss(nuts,nuts_1,[have_nuts(nuts_1)]), ss(jack,jack0,[jack_in_use(jack0,hub0)]), ss(hub,hub0,[unfastened(hub0),jacked_up(hub0,jack0)]), ss(container,boot,[closed(boot)])]).