This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/encodings/outdated/pddl-sequential-incremental-boolean.lp
Patrick Lühne 8ff87985f5
Moved outdated encodings to separate directory.
These encodings need to be updated to match the new output format. Until
this is done, hide these files in a separate directory in order not to
confuse users.
2017-11-17 15:38:59 +01:00

31 lines
1.1 KiB
Plaintext

#include <incmode>.
#program base.
precondition(Action,variable(Fluent),Value) :- precondition(Action, variable(Fluent),value(Fluent,Value)).
postcondition(Action,variable(Fluent),Value) :- postcondition(Action,effect(unconditional),variable(Fluent),value(Fluent,Value)).
holds(variable(Fluent),0) :- initialState(variable(Fluent),value(Fluent,true)).
#program step(t).
{ occurs(Action,t) : action(Action) } = 1.
:- occurs(Action,t), precondition(Action,Fluent,true), not holds(Fluent,t-1).
:- occurs(Action,t), precondition(Action,Fluent,false), holds(Fluent,t-1).
caused(Fluent,t) :- occurs(Action,t), postcondition(Action,Fluent,true).
holds(Fluent,t) :- caused(Fluent,t).
holds(Fluent,t) :- holds(Fluent,t-1), not occurs(Action,t) : postcondition(Action,Fluent,false).
#program check(t).
goalAt(t) :- holds(variable(Variable),t) : goal(variable(Variable), value(Variable,true));
not holds(variable(Variable),t) : goal(variable(Variable), value(Variable,false)).
:- not goalAt(t), query(t).
#show occurs/2.
% #show holds/2.