1 % -------------------- Sample of a planning domain
--------------------
4 % the following line specifies which predicates
or fluents are
defined
5 % across two
or more files
. These predicates appear here
, and in the
6 % initial
state and goal definitions
, in sample
-blocks
.pl
8 :- multifile on
/3, clear/2. % <name
>/<number of parameters
>
13 % -- Primitive control actions
: this section defines the name
and
14 % the number of parameters of the actions available to the planner
16 primitive_action
( move
(_
,_
) ). % underscore means
`anything'
21 % -- Preconditions for primitive actions: describe when an action
22 % can be carried out, in a generic situation S
24 poss( move(What, Where), S ) :- % implication poss() <= precond
27 not(heavy(What)), % can't move the table (or other heavy obj)
28 not(What = Where), % can't move a block on top of itself
29 not(on(What, Where, S)). % can't move around the same support
30 % (applies for the table)
34 % -- Successor State Axioms for primitive fluents: describe the value
35 % of fluent based on the previous situation and the action chosen for
38 % The general form of a successor state axiom is:
40 % a fluent is true in the situation resulting from applying action A
42 % - action A makes the fluent true; OR
43 % - the fluent was already true in the previous situation S,
44 % AND action A will not change this fact, by making it false.
47 on(Block, Support, result(A, S)) :-
48 A = move(Block, Support);
49 on(Block, Support, S), not(A = move(Block, _)).
52 clear(table, _). % special case, the table is clear any situation
53 % (i.e. there is always space on the table)
55 clear(Block, result(A, S)) :-
56 A = move(Something, _), on(Something, Block, S);
57 not(A = move(_, Block)), clear(Block, S).
60 % ---------------------------------------------------------------------
61 % ---------------------------------------------------------------------