<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Determining Action Reversibility in STRIPS Using Answer Set Programming? ??</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Czech Technical University in Prague</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Czechia</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>chrpaluk</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>fiserdang@fel.cvut.cz</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Alpen-Adria University Klagenfurt</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2077</year>
      </pub-date>
      <abstract>
        <p>In planning and reasoning about action and change, reversibility of actions is the problem of deciding whether the e ects of an action can be reverted by applying other actions in order to return to the original state. While this problem has been studied for some time, recently there has been renewed interest in the context of the language PDDL. After reviewing the concepts, in this paper we propose a solution by leveraging an existing translation from PDDL domains and problems to Answer Set Programming (ASP). This work serves as the basis for the rst sound and complete system for determining reversibility of PDDL actions, for now restricted to the STRIPS fragment.</p>
      </abstract>
      <kwd-group>
        <kwd>Planning Answer Set Programming Reasoning about Action and Change</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Traditionally, the eld of Automated Planning [
        <xref ref-type="bibr" rid="ref17 ref18">17, 18</xref>
        ] deals with the problem of
generating a sequence of actions|a plan|that transforms an initial state of the
environment to some goal state. Actions, in plain words, stand for modi ers of
the environment. One interesting question is whether the e ects of an action are
reversible (by other actions), or in other words, whether the action e ects can
be undone. Notions of reversibility have previously been investigated; cf. e.g.,
works by Eiter et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] or by Daum et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        Studying action reversibility is important for several reasons. Intuitively,
actions whose e ects cannot be reversed might lead to dead-end states from which
the goal state is no longer reachable. Early detection of a dead-end state is
bene cial in a plan generation process [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. Reasoning in more complex structures
such as Agent Planning Programs [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] which represent networks of planning tasks
where a goal state of one task is an initial state of another is even more prone to
dead-ends [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Concerning non-deterministic planning, for instance Fully
Observable Non-Deterministic (FOND) Planning, where actions have non-deterministic
e ects, determining reversibility or irreversibility of each set of e ects of the
action can contribute to early dead-end detection, or to generalizing recovery from
undesirable action e ects which is important for e cient computation of strong
(cyclic) plans [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Concerning online planning, we can observe that applying
reversible actions is safe and hence we might not need to explicitly provide the
information about safe states of the environment [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Another, although not very
obvious, bene t of action reversibility is in plan optimization. If the e ects of an
action are later reversed by a sequence of other actions in a plan, these actions
might be removed from the plan, potentially shortening it signi cantly. It has
been shown that under such circumstances, pairs of inverse actions, which are a
special case of action reversibility, can be removed from plans [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] we have introduced a general framework for action reversibility that
o ers a broad de nition of the term, and generalizes many of the already
proposed notions of reversibility, like \undoability" proposed in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], or the concept
of \reverse plans" as introduced in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. The concept of reversibility in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]
directly incorporates the set of states in which a given action should be reversible.
We call these notions S-reversibility and '-reversibility, where the set S
contains states, and the formula ' describes a set of states in terms of propositional
logic. These notions are then further re ned to universal reversibility (referring
to the set of all states) and to reversibility in some planning task (referring to
the set of all reachable states w.r.t. the initial state speci ed in ). These last
two versions match the ones proposed in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Furthermore, our notions can be
further restricted to require that some action is reversible by a single \reverse
plan" that is not dependent of the state for which the action is reversible. For
single actions, this matches the concept of the same name proposed in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>
        The complexity analyses in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] indicate that several of these tasks can be
solved by means of Answer Set Programming (ASP). In this paper, we
leverage the translations implemented in plasp [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and produce encodings to e
ectively solve some reversibility tasks on PDDL domains, for now restricted to the
STRIPS [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] fragment.
      </p>
      <p>
        Structure. The remainder of the paper is organized as follows. In Section 2,
we introduce basic concepts; Section 3 then reviews de nitions and properties
of di erent versions of reversibility from [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]; in Section 4 we review the plasp
format and present some ASP encodings for reversibility tasks before concluding
in Section 5.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>STRIPS Planning. Let F be a set of facts, that is, atomic statements about the
world. Then, a subset s F is called a state, which intuitively represents a set
of facts considered to be true. An action is a tuple a = hpre(a); add (a); del (a)i,
where pre(a) F is the set of preconditions of a, and add (a) F and del (a) F
are the add and delete e ects of a, respectively. W.l.o.g., we assume actions to
be well-formed, that is, add (a) \ del (a) = ; and pre(a) \ add (a) = ;. An action
a is applicable in a state s i pre(a) s. The result of applying an action a in a
state s, given that a is applicable in s, is the state a[s] = (s n del (a)) [ add (a).
A sequence of actions = ha1; : : : ; ani is applicable in a state s0 i there is
a sequence of states hs1; : : : ; sni such that, for 0 &lt; i n, it holds that ai is
applicable in si 1 and ai[si 1] = si. Applying the action sequence on s0 is
denoted [s0], with [s0] = sn. The length of action sequence is denoted j j.</p>
      <p>A STRIPS planning task = hF ; A; s0; Gi is a tuple consisting of a set of
facts F = ff1; : : : ; fng, a set of (ground) actions A = fa1; : : : ; amg, an initial
state s0 F , and a goal speci cation (or, simply, goal ) G F . A state s F is
a goal state (for ) i G s. An action sequence is called a plan i [s0] G.
We further de ne several relevant notions w.r.t. a planning task . A state s is
reachable from state s0 i there exists an applicable action sequence such that
[s0] = s. A state s 2 2F is simply called reachable i it is reachable from the
initial state s0. The set of all reachable states in is denoted by R . An action
a is reachable i there is some state s 2 R such that a is applicable in s.</p>
      <p>
        Deciding whether a STRIPS planning task has a plan is known to be
PSpacecomplete in general and it is NP-complete if the length of the plan is
polynomially bounded [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Answer Set Programming (ASP). We assume the reader is familiar with ASP and
will only give a very brief overview of the core language. For more information,
we refer to standard literature [
        <xref ref-type="bibr" rid="ref15 ref19 ref2">2, 15, 19</xref>
        ], and, in our case, the ASP-Core-2 input
language format [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Brie y, ASP programs consist of sets of rules of the form
a1 j
j an</p>
      <p>b1; : : : ; b`; :b`+1; : : : ; :bm:
In these rules, all ai and bi are atoms of the form p(t1; : : : ; tn), where p is a
predicate name, and t1; : : : ; tn are terms, that is, either variables or constants. The
domain of constants in an ASP program P is given implicitly by the set of all
constants that appear in it. Generally, before evaluating an ASP program, variables
are removed by a process called grounding, that is, for every rule, each variable is
replaced by all possible combination of constants, and appropriate ground copies
of the rule are added to the resulting program ground (P ). In practice, several
optimizations have been implemented in state-of-the-art grounders that try to
minimize the size of the grounding.</p>
      <p>
        The result of a (ground) ASP program P is calculated as follows [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. An
interpretation I (i.e., a set of ground atoms appearing in P ) is called a model
of P i it satis es all the rules in P in the sense of classical logic. It is further
called an answer set of P i there is no proper subset I0 I that is a model of
the so-called reduct P I of P w.r.t. I. P I is de ned as the set of rules obtained
from P where all negated atoms on the right-hand side of the rules are evaluated
over I and replaced by &gt; or ? accordingly. The main decision problem for ASP
is deciding whether a program has at least one answer set. This has been shown
to be 2P -complete [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Reversibility of Actions</title>
      <p>
        In this section, we describe the notion of reversibility of actions. In particular,
we focus on the notion of uniform reversibility, but note that there are other
notions of reversibility which are lied out and explained in detail by Morak et
al. [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. Intuitively, we call an action reversible if there is a way to undo all the
e ects that this action caused, and we call an action uniformly reversible if its
e ects can be undone by a single sequence of actions irrespective of the state
where the action was applied.
      </p>
      <p>
        While this intuition is fairly straightforward, when formally de ning this
concept, we also need to take several other factors into account|in particular, the
set of possible states where an action is considered plays an important role [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ].
De nition 1. Let F be a set of facts, A be a set of actions, S 2F be a set of
states, and a 2 A be an action. We call a uniformly S-reversible i there exists
a sequence of actions = ha1; : : : ; ani 2 An such that for each s 2 S wherein a
is applicable it holds that is applicable in a[s] and [a[s]] = s.
      </p>
      <p>The notion of uniform reversibility in the most general sense does not depend
on a concrete STRIPS planning task, but only on a set of possible actions and
states w.r.t. a set of facts. Note that the set of states S is an explicit part of the
notion of uniform S-reversibility.</p>
      <p>Based on this general notion, it is then possible to de ne several concrete
sets of states S that are useful to consider when considering whether an action
is reversible. For instance, S could be de ned via a propositional formula over
the facts in F . Or we can consider a set of all possible states (2F ) which gives
us a notion of uniform reversibility that applies to all possible planning tasks
that share the same set of facts and actions (i.e., the tasks that di er only in
the initial state or goals). Or we can move our attention to a speci c STRIPS
instance and ask whether a certain action is uniformly reversible for all states
reachable from the initial state.</p>
      <p>De nition 2. Let F , A, S, and a be as in De nition 1. We call the action a
1. uniformly '-reversible i a is uniformly S-reversible in the set S of models
of the propositional formula ' over F ;
2. uniformly reversible in i a is uniformly R -reversible for some STRIPS
planning task ; and
3. universally uniformly reversible, or, simply, uniformly reversible, i a is
uniformly 2F -reversible.</p>
      <p>Given the above de nitions, we can already observe some interrelationships.
In particular, universal uniform reversibility (that is, uniform reversibility in the
set of all possible states) is obviously the strongest notion, implying all the other,
weaker notions. It may be particularly important when one wants to establish
uniform reversibility irrespective of the concrete STRIPS instance.</p>
      <p>
        The notion of uniform reversibility naturally gives rise to the notion of the
reverse plan. We say that some action a has an (S-)reverse plan i a is
uniformly (S-)reversible using the sequence of actions . It is interesting to note
that this de nition of the reverse plan based on uniform reversibility now
coincides with the same notion as de ned by [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Note, however, that in that paper
the authors use a much more general planning language.
      </p>
      <p>
        Even if the length of the reverse plan is polynomially bounded, the problem
of deciding whether an action is uniformly ('-)reversible is intractable. In
particular, deciding whether an action is universally uniformly reversible (resp.
uniformly '-reversible) by a polynomial length reverse plan is NP-complete (resp.
in 2P ) [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ].
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Methods</title>
      <p>
        After reviewing the relevant features of plasp [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] in Section 4.1, we present our
encodings for determining reversibility in Section 4.2.
4.1
      </p>
      <sec id="sec-4-1">
        <title>The plasp Format</title>
        <p>
          The system plasp [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] transforms PDDL domains and problems into facts.
Together with suitable programs, plans can then be computed using ASP solvers.
Given a STRIPS domain with facts F and actions A, the following relevant facts
and rules will be created by plasp:
{ variable(variable("f")). for all f 2 F
{ action(action("a")). for all a 2 A
{ precondition(action("a"),variable("f"),value(variable("f"),true))
:- action(action("a")).
        </p>
        <p>for each a 2 A and f 2 pre(a)
{ postcondition(action("a"),effect(unconditional),variable("f"),
value(variable("f"),true)) :- action(action("a")).</p>
        <p>for each a 2 A and f 2 add (a)
{ postcondition(action("a"),effect(unconditional),variable("f"),
value(variable("f"),false)) :- action(action("a")).</p>
        <p>for each a 2 A and f 2 del (a)
Example 1. The STRIPS domain with F = ff g and actions del f = hff g; ;; ff gi
and add f = h;; ff g; ;i is written in PDDL as follows:
(define (domain example1 )
(:requirements :strips)
(:predicates (f) )
(:action del-f
:precondition (f)
:effect (not (f)))
(:action add-f
:effect (f)))
plasp translates this domain to the following ASP code (plus a few technical
facts and rules):
variable(variable("f")).
action(action("del-f")).
precondition(action("del-f"), variable("f"),</p>
        <p>value(variable("f"), true))
:- action(action("del-f")).
postcondition(action("del-f"), effect(unconditional),</p>
        <p>variable("f"), value(variable("f"), false))
:- action(action("del-f")).
action(action("add-f")).
postcondition(action("add-f"), effect(unconditional),</p>
        <p>variable("f"), value(variable("f"), true))
:- action(action("add-f")).
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Reversibility Encodings in ASP</title>
        <p>In this section, we present our ASP encoding for checking whether, in a given
domain, there is an action that is uniformly reversible. As we have seen in
Section 4.1, the plasp tool is able to rewrite STRIPS domains into ASP even when
no concrete planning instance for that domain is given. We will present two
encodings, one for (universal) uniform reversibility, and one that can be used for
uniform '-reversibility.</p>
        <p>Note that universal uniform reversibility is computationally easier than
'uniform reversibility (under standard complexity-theoretic assumptions). For a
given action (and polynomial-length reverse plans), the former can be decided in
NP, while the latter is harder [21, Theorem 18 and 20]. We will hence start with
the encoding for the former problem, which follows a standard guess-and-check
pattern.</p>
        <p>
          Universal Uniform Reversibility. As a \database" the encoding takes the output
of plasp's translate action [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. The problem can be solved in NP due to the
following Observation (*): in any (universal) reverse plan for some action a, it
is su cient to consider only the set of facts that appear in the precondition of
a. If any action in a candidate reverse plan for a (resp. a itself) contains any
other fact than those in pre(a), then cannot be a reverse plan for a (resp. a is
not uniformly reversible) [21, Theorem 18]. With this observation in mind, we
can now describe the (core parts of) our encoding3.
        </p>
        <p>The encoding makes use of the following main predicates (in addition to
several auxiliary predicates, as well as those imported from plasp):
{ chosen/1 holds the action to be tested for reversibility.
{ holds/3 encodes that some fact (or variable, as they are called in plasp
parlance) is set to a certain value at a given time step.
{ occurs/2 encodes the candidate reverse plan, saying which action occurs at
which time step.</p>
        <p>With the intuitive meaning of the predicates de ned, rstly, we chose an
action from the available actions and set the initial state as the facts in the
precondition of the chosen action. We also say, in line with the Observation (*)
above, that only those variables in the precondition are relevant to check for a
reverse plan.</p>
        <sec id="sec-4-2-1">
          <title>1 {chosen(A) : action(action(A))} 1.</title>
          <p>holds(V, Val, 0)
:chosen(A),
precondition(action(A), variable(V), value(variable(V), Val)).
relevant(V) :- holds(V, _, 0).</p>
          <p>These rules set the stage for the inherent planning problem to be solved to
nd a reverse plan. In fact, from the initial state de ned above, we need to nd
a plan that starts with action a (the chosen action), such that after executing
we end up in the initial state again. Such a plan is a (universal) reverse plan.
This idea is encoded in the following:
time(0..horizon+1).
occurs(A, 1) :- chosen(A).
1 {occurs(A, T) : action(action(A))} 1 :- time(T), T &gt; 1.
caused(V, Val, T)
:occurs(A, T),
postcondition(action(A), _, variable(V), value(variable(V), Val)),
holds(V2, Val2, T - 1) :
precondition(action(A), variable(V2), value(variable(V2), Val2)).
modified(V, T) :- caused(V, _, T).
holds(V, Val, T) :- caused(V, Val, T).
holds(V, Val, T) :- holds(V, Val, T - 1), not modified(V, T), time(T).</p>
          <p>The above rules guess a potential plan as described above, and then execute
the plan on the initial state (changing facts if this is caused by the application
of a rule, and keeping the same facts if they were not modi ed). The notation
in the rule body for caused is an abbreviation for requiring holds for each
precondition. Finally, we simply need to check that the plan is (a) executable,
3 The full encoding is available here: https://sea le.aau.at/d/e0aedc92b4c546d5bf9a/.
and (b) leads from the initial state back to the initial state. This can be done
with the following constraints:
:- occurs(A, T),
precondition(action(A), variable(V), value(variable(V), Val)),
not holds(V, Val, T - 1).
:- occurs(A, T),
precondition(action(A), variable(V), _),
not relevant(V).
:- occurs(A, T),
postcondition(action(A), _, variable(V), _),
not relevant(V).
:- holds(V, Val, 0), not holds(V, Val, horizon+1).
:- holds(V, Val, horizon+1), not holds(V, Val, 0).</p>
          <p>The rst rule checks that rules in the candidate plan are actually applicable.
The next two check that the rules do not contain any facts other than those that
are relevant (cf. Observation (*) above). Finally, the last two rules make sure that
at the maximum time point (i.e., the one given by the externally de ned constant
\horizon") the initial state and the resulting state of plan are the same. It is
not di cult to verify that any answer set of the above program (combined with
the plasp translation of a STRIPS problem domain) will yield a plan (encoded
by the occurs predicate) that contains the sequence a; a1; : : : ; an of actions,
where a1; : : : ; an is a (universal) reverse plan for the action a. Note that our
encoding yields reverse plans of length exactly as long as set in the \horizon"
constant. This completes our encoding for the problem of deciding universal
uniform reversibility.</p>
          <p>
            Other Forms of Uniform Reversibility. Using a similar guess-and-check idea
as in the previous encoding, we can also check for uniform reversibility for a
speci ed set of states (that is, uniform S-reversibility). Generally, the set S of
relevant states is encoded in some compact form, and our encoding therefore,
intentionally, does not assume anything about this representation, but leaves the
precise checking of the set S open for implementations of a concrete use case.
The predicates used in this more advanced encoding are similar to the ones used
in the previous for the universal case above, and hence we will not list them here
again. However, in order to encode the for-all-states check (i.e., the check that
the candidate reverse plan works in all states inside the set S), we now need an
advanced ASP encoding technique called saturation [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ].
          </p>
          <p>The encoding starts o much like the previous one:</p>
        </sec>
        <sec id="sec-4-2-2">
          <title>1 {chosen(A) : action(action(A))} 1.</title>
          <p>holds(V, Val, 0)
:chosen(A),
precondition(action(A), variable(V), value(variable(V), Val)).
affected(A, V) :- postcondition(action(A), _, variable(V), _).</p>
          <p>Note that we no longer need to keep track of any set of \relevant" facts,
since we now need to consider all the facts that appear inside the actions and
in the set S of states. However, we need to keep track of those facts that are
a ected (i.e., potentially changed) by the application of an action. We assume
that a predicate opposites/2 exists that holds, in both possible orders, the
values \true" and \false". This will later be used to nd the opposite value of
some fact at a particular time step.</p>
          <p>Next, we again guess and execute a plan, keeping track of whether the actions
were able to be applied at each particular time step:</p>
          <p>Again, the rules above choose a candidate reverse plan , starting with the
action-to-be-checked a, as before. Furthermore, we set up the goal conditions:
should be applicable (i.e., at each time step, the relevant action must have been
applied), and furthermore, the state at the beginning must be equal to the state
at the end.
same(V) :- holds(V, Val, 0), holds(V, Val, horizon + 1).
samestate :- same(V) : variable(variable(V)).
planvalid :- applied(horizon + 1).
reversePlan :- samestate, planvalid.</p>
          <p>Finally, we need to specify that for all the states speci ed in the set S the
candidate reverse plan must work. This is done as follows:
holds(V, Val1, 0) | holds(V, Val2, 0)
:variable(variable(V)),
opposites(Val1, Val2), Val1 &lt; Val2.
holds(V, Val, T)
:reversePlan,
contains(variable(V), value(variable(V), Val)),
time(T).
:- not reversePlan.</p>
          <p>
            As stated above, this is done using the technique of saturation [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ]. We
encourage the reader to refer to the relevant publication for more details on the
\inner workings" of this encoding technique. In our case, intuitively, the rules
state the following:
          </p>
          <p>The rst rule above speci es that some initial state should be guessed where
the candidate reverse plan is to be checked. The second and third rule together
say that, for each such possible guess (i.e., for each possible initial state), the
atom reversePlan must be derived for that particular guess. This concludes
the main part of our encoding. In its current form, the encoding given above
produces exactly the same results as the rst encoding given in this section; that
is, it checks for universal uniform reversibility. However, the second encoding can
be easily modi ed in order to check uniform S-reversibility. Simply add a rule
of the following form to it:
reversePlan :- &lt; check guess against set S &gt;</p>
          <p>This rule should derive the atom reversePlan precisely when the current
guess (that is, the currently considered starting state) does not belong to the
set S. This can of course be generalized easily. For example, if set S is given as
a formula ', then the rule should check whether the current guess conforms to
formula ' (i.e., encodes a model of '). Other compact representations of S can
be similarly checked at this point. Hence, we have a exible encoding for uniform
S-reversibility that is easy to extend with various forms of representations of set
S4. This concludes the description of our encodings.
4.3</p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>Experiments</title>
        <p>We have conducted preliminary experiments with arti cially constructed
domains. The domains are as follows:
(define (domain rev-i)
(:requirements :strips)
(:predicates (f0) ... (fi))
(:action del-all
:precondition (and (f0) ... (fi) )
:effect (and (not (f0)) ... (not (fi))))
(:action add-f0</p>
        <p>:effect (f0))
4 The full encoding can be found at https://sea le.aau.at/d/e0aedc92b4c546d5bf9a/.</p>
        <p>The action del-all has a universal uniform reverse plan h add-f0, . . . ,
add-fi i. We have generated instances from i = 10 to i = 500 with step 10. We
have analyzed runtime and memory consumption of two problems: (a) nding
the reverse plan of size i (by setting the constant horizon to i) and proving that
no other reverse plan exists, and (b) showing that no reverse plan of length i-1
exists (by setting the constant horizon to i-1). We compare the two encodings
described in Section 4.2, we refer to the rst one as simple encoding and the
second one as saturation encoding.</p>
        <p>We have used plasp 3.1.1 (https://potassco.org/labs/plasp/) and clingo 5.4.0
(https://potassco.org/clingo/) on a computer with a 3.1 GHz Intel Xeon Gold
6254 CPU with 18 cores and 128 GB RAM running CentOS 7. We have set a
timeout of 10 minutes and a memory limit of 4GB (which was never exceeded).
simple encoding
saturation encoding
simple encoding
saturation encoding
250
200
()s 150
e
m
i
tun 100
R
50
0
40
)
s
(e
m
i
tunR 20
0
0
0
100 200 300 400 500</p>
        <p>Number of facts
100 200 300 400 500</p>
        <p>Number of facts
The results for problem (a) are plotted in Figure 1. The saturation encoding
exceeded the time limit already at the problem with 50 facts, while the simple
encoding could solve all problems in under 20 seconds. The memory consumption
increased with i, but was relatively moderate, also for the saturation encoding.
simple encoding
saturation encoding
simple encoding
saturation encoding
) 1;000
B
M
(
y
r
eom 500
M
0</p>
        <p>0
) 1;000
B
M
(
y
r
eom 500
M
0</p>
        <p>0
100 200 300 400 500</p>
        <p>Number of facts
100 200 300 400 500</p>
        <p>Number of facts</p>
        <p>The results for problem (b) are plotted in Figure 2. While the simple encoding
shows very similar behavior to problem (a), the saturation encoding took longer
and had a time-out already at i = 40.</p>
        <p>In total, the saturation encoding scales worse, as expected, but it can still
solve problems of reasonable size. Another positive observation is that memory
consumption does not appear to be an issue.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>
        In this paper, we have given a review of several notions of action reversibility in
STRIPS planning, as originally presented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. We then proceeded, on the basis
of the PDDL-to-ASP translation tool plasp [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], to present two ASP encodings
to solve the task of universal uniform reversibility of STRIPS actions, given a
corresponding planning domain. When given to an ASP solving system, these
encodings, combined with the ASP translation of STRIPS planning domains
produced by plasp, then yield a set of answer sets, each one representing a
(universal) reverse plan for each action in the domain, for which such a reverse
plan could be found.
      </p>
      <p>
        The two encodings use two di erent approaches. The rst encoding makes
use of a shortcut that allows it to focus only on those facts that appear in the
precondition of the action to check for reversibility [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. The second encoding
makes use of an advanced ASP encoding technique called saturation [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], which
allows for the expression of universal quanti ers. It directly encodes the original
de nition of uniform reversibility: for an action to be uniformly reversible, there
must exists a plan, and this plan must revert that action in all possible starting
states (where it is applicable). This second encoding is more exible insofar as it
also allows for the checking of non-universal uniform reversibility (e.g., to check
for uniform '-reversibility, where the starting states are given via some formula
').
      </p>
      <p>In order to compare the two encodings, we performed some benchmarks on
arti cially generated instances by checking whether there is an action that is
universally uniformly reversible. For the ASP community, it will not come as a
surprise that the saturation-based encoding was performing much more poorly
than the encoding without saturation. However, we found that, for our
benchmark instances, both encodings were able to solve reasonably sized instances.
Therefore, the encodings o er a trade-o : while the rst encoding is clearly more
e cient when checking for universal uniform reversibility, the saturation-based
encoding is more exible in that it can also be used to check more advanced
versions where a given set of starting states needs to be considered.</p>
      <p>
        For future work, we intend to optimize our encodings further, and see how
they perform on real-world benchmark instances. It would also be interesting to
see how they perform when compared to a procedural implementation of the
algorithms proposed for reversibility checking by Morak et al. [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. We would also
like to compare our approach to existing tools RevPlan5 (implementing
tech5 http://www.kr.tuwien.ac.at/research/systems/revplan/index.html
niques of [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]) and undoability (implementing techniques of [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). Furthermore,
we would also like to test other ASP systems such as DLV2 6 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
6 https://www.mat.unical.it/DLV2/
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Alviano</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calimeri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dodaro</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fusca</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ricca</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Veltri</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zangari</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>The ASP system DLV2</article-title>
          . In: Balduccini,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Janhunen</surname>
          </string-name>
          , T. (eds.)
          <source>Logic Programming and Nonmonotonic Reasoning - 14th International Conference, LPNMR 2017, Espoo, Finland, July 3-6</source>
          ,
          <year>2017</year>
          ,
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>10377</volume>
          , pp.
          <volume>215</volume>
          {
          <fpage>221</fpage>
          . Springer (
          <year>2017</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -61660-5 19
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Brewka</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Answer set programming at a glance</article-title>
          .
          <source>Commun. ACM</source>
          <volume>54</volume>
          (
          <issue>12</issue>
          ),
          <volume>92</volume>
          {
          <fpage>103</fpage>
          (
          <year>2011</year>
          ). https://doi.org/10.1145/2043174.2043195
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bylander</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>The computational complexity of propositional STRIPS planning</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>69</volume>
          (
          <issue>1-2</issue>
          ),
          <volume>165</volume>
          {
          <fpage>204</fpage>
          (
          <year>1994</year>
          ). https://doi.org/10.1016/
          <fpage>0004</fpage>
          -
          <lpage>3702</lpage>
          (
          <issue>94</issue>
          )
          <fpage>90081</fpage>
          -
          <lpage>7</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Calimeri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maratea</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ricca</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Asp-core-2 input language format</article-title>
          .
          <source>Theory Pract</source>
          . Log. Program.
          <volume>20</volume>
          (
          <issue>2</issue>
          ),
          <volume>294</volume>
          {
          <fpage>309</fpage>
          (
          <year>2020</year>
          ). https://doi.org/10.1017/S1471068419000450
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Camacho</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Muise</surname>
            ,
            <given-names>C.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McIlraith</surname>
            ,
            <given-names>S.A.</given-names>
          </string-name>
          :
          <article-title>From FOND to robust probabilistic planning: Computing compact policies that bypass avoidable deadends</article-title>
          .
          <source>In: Proc. ICAPS</source>
          . pp.
          <volume>65</volume>
          {
          <issue>69</issue>
          (
          <year>2016</year>
          ), http://www.aaai.org/ocs/index.php/ICAPS/ICAPS16/paper/view/13188
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Chrpa</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lipovetzky</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <article-title>Sardin~a, S.: Handling non-local dead-ends in agent planning programs</article-title>
          .
          <source>In: Proc. IJCAI</source>
          . pp.
          <volume>971</volume>
          {
          <issue>978</issue>
          (
          <year>2017</year>
          ). https://doi.org/10.24963/ijcai.
          <year>2017</year>
          /135
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Chrpa</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McCluskey</surname>
            ,
            <given-names>T.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Osborne</surname>
          </string-name>
          , H.:
          <article-title>Optimizing plans through analysis of action dependencies and independencies</article-title>
          .
          <source>In: Proc. ICAPS</source>
          (
          <year>2012</year>
          ), http://www.aaai.org/ocs/index.php/ICAPS/ICAPS12/paper/view/4712
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Cserna</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Doyle</surname>
            ,
            <given-names>W.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramsdell</surname>
            ,
            <given-names>J.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruml</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Avoiding dead ends in realtime heuristic search</article-title>
          .
          <source>In: Proceedings of the Thirty-Second AAAI Conference on Arti cial Intelligence</source>
          ,
          <source>(AAAI-18)</source>
          . pp.
          <volume>1306</volume>
          {
          <issue>1313</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Daum</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Torralba</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ho</surname>
            <given-names>mann</given-names>
          </string-name>
          , J.,
          <string-name>
            <surname>Haslum</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Practical undoability checking via contingent planning</article-title>
          .
          <source>In: Proc. ICAPS</source>
          . pp.
          <volume>106</volume>
          {
          <issue>114</issue>
          (
          <year>2016</year>
          ), http://www.aaai.org/ocs/index.php/ICAPS/ICAPS16/paper/view/13091
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gerevini</surname>
            ,
            <given-names>A.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patrizi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Saetti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>Sardin~a, S.: Agent planning programs</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>231</volume>
          ,
          <issue>64</issue>
          {
          <fpage>106</fpage>
          (
          <year>2016</year>
          ). https://doi.org/10.1016/j.artint.
          <year>2015</year>
          .
          <volume>10</volume>
          .001
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Dimopoulos</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , Luhne,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Romero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Schaub</surname>
          </string-name>
          , T.:
          <article-title>plasp 3: Towards e ective ASP planning</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>19</volume>
          (
          <issue>3</issue>
          ),
          <volume>477</volume>
          {
          <fpage>504</fpage>
          (
          <year>2019</year>
          ). https://doi.org/10.1017/S1471068418000583
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Erdem</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Undoing the e ects of action sequences</article-title>
          .
          <source>J. Applied Logic</source>
          <volume>6</volume>
          (
          <issue>3</issue>
          ),
          <volume>380</volume>
          {
          <fpage>415</fpage>
          (
          <year>2008</year>
          ). https://doi.org/10.1016/j.jal.
          <year>2007</year>
          .
          <volume>05</volume>
          .002
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
          </string-name>
          , G.:
          <article-title>On the computational cost of disjunctive logic programming: Propositional case</article-title>
          .
          <source>Ann. Math. Artif. Intell</source>
          .
          <volume>15</volume>
          (
          <issue>3-4</issue>
          ),
          <volume>289</volume>
          {
          <fpage>323</fpage>
          (
          <year>1995</year>
          ). https://doi.org/10.1007/BF01536399, https://doi.org/10.1007/BF01536399
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Fikes</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nilsson</surname>
            ,
            <given-names>N.J.:</given-names>
          </string-name>
          <article-title>STRIPS: A new approach to the application of theorem proving to problem solving</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>2</volume>
          (
          <issue>3</issue>
          /4),
          <volume>189</volume>
          {
          <fpage>208</fpage>
          (
          <year>1971</year>
          ). https://doi.org/10.1016/
          <fpage>0004</fpage>
          -
          <lpage>3702</lpage>
          (
          <issue>71</issue>
          )
          <fpage>90010</fpage>
          -
          <lpage>5</lpage>
          , http://dx.doi.org/10.1016/
          <fpage>0004</fpage>
          -
          <lpage>3702</lpage>
          (
          <issue>71</issue>
          )
          <fpage>90010</fpage>
          -
          <lpage>5</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , Kaufmann,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Schaub</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>Answer Set Solving in Practice</article-title>
          .
          <source>Synthesis Lectures on Arti cial Intelligence and Machine Learning</source>
          , Morgan &amp; Claypool Publishers (
          <year>2012</year>
          ). https://doi.org/10.2200/S00457ED1V01Y201211AIM019
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Classical negation in logic programs</article-title>
          and disjunctive databases.
          <source>New Gener. Comput</source>
          .
          <volume>9</volume>
          (
          <issue>3</issue>
          /4),
          <volume>365</volume>
          {
          <fpage>386</fpage>
          (
          <year>1991</year>
          ). https://doi.org/10.1007/BF03037169
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Ghallab</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nau</surname>
            ,
            <given-names>D.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Traverso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <source>Automated planning - theory and practice</source>
          .
          <source>Elsevier</source>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Ghallab</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nau</surname>
            ,
            <given-names>D.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Traverso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <source>Automated Planning and Acting</source>
          . Cambridge University Press (
          <year>2016</year>
          ), http://www.cambridge.org/de/academic/subjects/computer-science/
          <article-title>arti cialintelligence-and-natural-language-processing/automated-planning-andacting?format=HB</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Lifschitz</surname>
          </string-name>
          , V.: Answer Set Programming. Springer (
          <year>2019</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -24658-7, https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -24658-7
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Lipovetzky</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Muise</surname>
            ,
            <given-names>C.J.</given-names>
          </string-name>
          , Ge ner, H.:
          <article-title>Traps, invariants, and dead-ends</article-title>
          .
          <source>In: Proc. ICAPS</source>
          . pp.
          <volume>211</volume>
          {
          <issue>215</issue>
          (
          <year>2016</year>
          ), http://www.aaai.org/ocs/index.php/ICAPS/ICAPS16/paper/view/13190
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Morak</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chrpa</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fiser</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>On the reversibility of actions in planning</article-title>
          .
          <source>In: Proceedings of the 17th International Conference on Principles of Knowledge Representation and Reasoning (KR</source>
          <year>2020</year>
          )
          <article-title>(</article-title>
          <year>2020</year>
          ), to appear.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>