From f12ac1c83983b258ced0c758906577d88cf2813b Mon Sep 17 00:00:00 2001 From: mgebser Date: Tue, 15 Nov 2016 18:57:52 +0100 Subject: [PATCH] optional redundant rules to reduce the number of parallel plans --- encodings/strips/redundancy.lp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 encodings/strips/redundancy.lp diff --git a/encodings/strips/redundancy.lp b/encodings/strips/redundancy.lp new file mode 100644 index 0000000..3a9cf91 --- /dev/null +++ b/encodings/strips/redundancy.lp @@ -0,0 +1,24 @@ +% Additional rules for enforcing the inclusion of parallel actions in plans, +% whenever such 'redundant' actions are compatible with states and other actions + +#program step(t). + +defeated(A,t) :- active(A), postcondition(A,X,V), fluent(X), not holds(X,V,t), + _parallel = 1 : _parallel != 2. + +defeated(A,t) :- _parallel = 1, active(A), precondition(A,X,V), not holds(X,V,t-1). +defeated(A,t) :- _parallel = 1, active(A), precondition(A,X,V), not holds(X,V,t). +defeated(A,t) :- _parallel = 1, active(A), postcondition(A,X,V), not precondition(A,X,V), + single(X,t). + +proceed(A,X,V,t) :- active(A), holds(X,V,t-1), scope(X,V). +proceed(A,X,V,t) :- active(A), occurs(A1,t), perform(A,A1,t), A != A1, + postcondition(A1,X,V), scope(X,V), not precondition(A1,X,V). + +perform(A,A1,t) :- active(A), active(A1), A != A1, _parallel = 2, not occurs(A1,t). +perform(A,A1,t) :- active(A), active(A1), _parallel = 2, + proceed(A,X,V,t) : precondition(A1,X,V); perform(A,A2,t) : disable(A1,A2). + +defeated(A,t) :- _parallel = 2, active(A), not perform(A,A,t). + +:- active(A), not occurs(A,t), not defeated(A,t), _parallel = 1 : _parallel != 2.