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/sequential-incremental.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

41 lines
1.1 KiB
Plaintext

#include <incmode>.
% Check feature requirements
:- requires(feature(actionCosts)).
:- requires(feature(axiomRules)).
:- requires(feature(conditionalEffects)).
#program base.
% Establish initial state
holds(Variable, Value, 0) :- initialState(Variable, Value).
#program step(t).
% Perform actions
1 {occurs(Action, t) : action(Action)} 1.
% Check preconditions
:- occurs(Action, t), precondition(Action, Variable, Value), not holds(Variable, Value, t - 1).
% Apply effects
caused(Variable, Value, t) :- occurs(Action, t), postcondition(Action, _, Variable, Value).
modified(Variable, t) :- caused(Variable, Value, t).
holds(Variable, Value, t) :- caused(Variable, Value, t).
holds(Variable, Value, t) :- holds(Variable, Value, t - 1), not modified(Variable, t).
% Check that variables have unique values
:- variable(Variable), not 1 {holds(Variable, Value, t) : contains(Variable, Value)} 1.
% Check mutexes
:- mutexGroup(MutexGroup), not {holds(Variable, Value, t) : contains(MutexGroup, Variable, Value)} 1.
#program check(t).
% Verify that goal is met
:- query(t), goal(Variable, Value), not holds(Variable, Value, t).
#show query/1.
#show occurs/2.