From 1b940535421adb54c224d6deda58ec0d701e6ad6 Mon Sep 17 00:00:00 2001 From: gebser Date: Wed, 18 Jan 2017 10:12:52 +0100 Subject: [PATCH] revised redundant rules --- encodings/strips/redundancy.lp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/encodings/strips/redundancy.lp b/encodings/strips/redundancy.lp index 7d420ce..d2089bb 100644 --- a/encodings/strips/redundancy.lp +++ b/encodings/strips/redundancy.lp @@ -12,11 +12,11 @@ compatible(A) :- compatible(A,A1). compatible(A) :- active(A), active(A1), A != A1, _parallel = 1, not selfdefeat(A), not diverge(A,A1), not exclude(A,A1), not disjoin(A,A1). -disable(A,A1,A2) :- compatible(A,A1), compatible(A,A2), not disable(A1,A), - disable(A1,A2), not disable(A2,A1). +disable(A,A1,A2) :- compatible(A,A1), compatible(A,A2), compatible(A1,A2), + disable(A1,A2), not disable(A1,A). disabled(A,A2) :- disable(A,A1,A2). -disabled(A,A2) :- disable(A,A2). +disabled(A,A1) :- compatible(A), disable(A,A1). % STEP PROGRAM @@ -33,12 +33,14 @@ proceed(A,X,V,t) :- compatible(A), holds(X,V,t-1), scope(X,V). proceed(A,X,V,t) :- compatible(A,A1), not disable(A1,A), perform(A,A1,t), occurs(A1,t), scope(X,V), postcondition(A1,X,V), not precondition(A1,X,V). -perform(A,A1,t) :- disabled(A,A1), not occurs(A1,t). perform(A,A1,t) :- compatible(A,A1), not disable(A1,A), proceed(A,X,V,t) : precondition(A1,X,V), _parallel = 2; - perform(A,A2,t) : disable(A,A1,A2). + alright(A,A2,t) : disable(A,A1,A2). + +alright(A,A1,t) :- disabled(A,A1), not occurs(A1,t). +alright(A,A1,t) :- perform(A,A1,t). defeated(A,t) :- compatible(A), precondition(A,X,V), not proceed(A,X,V,t), _parallel = 2. -defeated(A,t) :- compatible(A), disable(A,A1), not perform(A,A1,t). +defeated(A,t) :- compatible(A), disable(A,A1), not alright(A,A1,t). :- compatible(A), not occurs(A,t), not defeated(A,t), 0 < _parallel, _parallel < 4.