<!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 Epistemic Logic Programs?</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>University of 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 as 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 to Answer Set Programming (ASP), which we then use to solve the problem via epistemic logic programs (ELPs). This work provides a sound and complete system for determining reversibility of PDDL actions (restricted to the STRIPS fragment), while also providing insight into the performance of state-ofthe-art ELP solvers.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Traditionally, the eld of Automated Planning [
        <xref ref-type="bibr" rid="ref14 ref15">14, 15</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="ref10">10</xref>
        ] or by Daum et al. [
        <xref ref-type="bibr" rid="ref7">7</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="ref16">16</xref>
        ]. Reasoning in more complex structures
such as Agent Planning Programs [
        <xref ref-type="bibr" rid="ref8">8</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="ref4">4</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="ref2">2</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="ref6">6</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="ref5">5</xref>
        ].
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] we 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="ref7">7</xref>
        ], or the concept of
\reverse plans" as introduced in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The concept of reversibility in [
        <xref ref-type="bibr" rid="ref17">17</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="ref7">7</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="ref10">10</xref>
        ].
      </p>
      <p>
        The complexity analyses in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] indicate that several of these tasks can be
solved via Epistemic Logic Programs (ELPs). In this paper, we leverage the
translations implemented in plasp [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and produce encodings to e ectively solve
some reversibility tasks on PDDL domains, restricted, for now, to the STRIPS
[
        <xref ref-type="bibr" rid="ref11">11</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="ref17">17</xref>
        ]; in Section 4 we review the plasp
format and present some ELP encodings for reversibility tasks before concluding
in Section 5.
2
      </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="ref1">1</xref>
        ].
      </p>
      <p>
        Epistemic Logic Programs (ELPs) and Answer Set Programming (ASP). We
assume the reader is familiar with ELPs and will only give a very brief overview of
the core language. For more information, we refer to the original paper proposing
ELPs [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] (therein named Epistemic Speci cations ), whose semantics we will use
in the present paper.
      </p>
      <p>Brie y, ELPs consist of sets of rules of the form
a1 _ : : : _ an
`1; : : : ; `m:
In these rules, all ai 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. Each ` is
either an objective or subjective literal, where objective literals are of the form a
or :a (for a an atom), and subjective literals are of the form K l or :K l, where
l is an objective literal. Note that often the operator M is also used, which we
will simply treat as a shorthand for :K :.</p>
      <p>The domain of constants in an ELP P is given implicitly by the set of all
constants that appear in it. Generally, before evaluating an ELP 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 systems that
try to minimize the size of the grounding.</p>
      <p>
        The result of a (ground) ELP program P is calculated as follows [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. An
interpretation I is a set of ground atoms appearing in P . A set of interpretations
I satis es a subjective literal K l (denoted I K l) i the objective literal l is
satis ed in all interpretations in I. The epistemic reduct P I of P w.r.t. I is
obtained from P by replacing all subjective literals ` with either &gt; in case where
I `, or with ? otherwise. P I , therefore, is an ASP program, that is, a program
without subjective literals. The solutions to an ELP P are called world views.
A set of interpretations I is a world view of P i I = AS (P I ) [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], where
AS (P I ) denotes the set of stable models (or answer sets) of the logic program
P I according to the semantics of answer set programming [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. Checking whether
a world view exists for an ELP is known to be 3P -complete in general [
        <xref ref-type="bibr" rid="ref18">18</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="ref17">17</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="ref17">17</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="ref10">10</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="ref17">17</xref>
        ].
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Methods</title>
      <p>
        After reviewing the relevant features of plasp [
        <xref ref-type="bibr" rid="ref9">9</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="ref9">9</xref>
          ] transforms PDDL domains and problems into facts.
Together with suitable programs, plans can then be computed by ASP solvers|and
hence also by ELP solvers, since ELPs are a superset of ASP programs. 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 set of rules (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 using ELPs</title>
        <p>In this section, we present our ELP encodings 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 rules 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 [17, 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="ref9">9</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) [17, Theorem 18]. With this observation in mind, we
can now describe the (core parts of) our encoding1.
        </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 a single
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.
chosen(A) :- action(action(A)), not &amp;k{-chosen(A)}.
-chosen(A) :- action(action(A)), not &amp;k{ chosen(A)}.
:- chosen(A), chosen(B), A!=B.
onechosen :- chosen(A).
:- not onechosen.
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).
occurs(A, T) :- action(action(A)),time(T), T &gt; 1, not &amp;k{-occurs(A, T)}.
-occurs(A, T) :- action(action(A)),time(T), T &gt; 1, not &amp;k{occurs(A, T)}.
:- occurs(A,T), occurs(B,T), A!=B.
oneoccurs(T) :- occurs(A,T), time(T), T &gt; 0.
:- time(T), T&gt;0, not oneoccurs(T).
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)).
1 The full encoding is available here: https://sea le.aau.at/d/373cd25718dc4377afec/.
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,
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).
noreversal :- holds(V, Val, 0), not holds(V, Val, H+1), horizon(H).
noreversal :- holds(V, Val, H+1), not holds(V, Val, 0), horizon(H).
:- not &amp;k{ ~ noreversal}.</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 three 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 world view of the above ELP (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 (each world
view consists of precisely one answer set). 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.
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 our
world views to contain multiple answer sets: one for each state in S.</p>
        <p>The encoding starts o much like the previous one:
chosen(A) :- action(action(A)), not &amp;k{-chosen(A)}.
-chosen(A) :- action(action(A)), not &amp;k{ chosen(A)}.
:- chosen(A), chosen(B), A!=B.
onechosen :- chosen(A).
:- not onechosen.
holds(V, Val, 0)
:chosen(A),
precondition(action(A), variable(V), value(variable(V), Val)).</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 open up several answer sets, one for each
state. This is done by guessing a truth value for each fact at time step 0.
holds(V,Val,0) | -holds(V,Val,0)
:</p>
        <p>variable(variable(V)), contains(variable(V),value(variable(V),Val)).
oneholds(V,0) :- holds(V,Val,0).
:- variable(variable(V)), not oneholds(V,0).
:- holds(V,Val,0), holds(V,Val1,0), Val != Val1.</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:
ccurs(A, 1) :- chosen(A).
occurs(A, T) :- action(action(A)),time(T), T &gt; 1, not &amp;k{-occurs(A, T)}.
-occurs(A, T) :- action(action(A)),time(T), T &gt; 1, not &amp;k{occurs(A, T)}.
:- occurs(A,T), occurs(B,T), A!=B.
oneoccurs(T) :- occurs(A,T), time(T), T &gt; 0.
:- time(T), T&gt;0, not oneoccurs(T).
inapplicable
:occurs(A, T),
precondition(action(A), variable(V), value(variable(V), Val)),
not holds(V, Val, T - 1).
:- not &amp;k{ ~ inapplicable}.
caused(V, Val, T)
:occurs(A, T),
postcondition(action(A), E, variable(V), value(variable(V), Val)).
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>Again, the rules above chose a candidate reverse plan , starting with the
action-to-be-checked a, as before. Furthermore, we check applicability: should
be applicable (i.e. at each time step, the relevant action must have been applied,
encoded by the third block of rules above), and furthermore, only modi ed facts
(i.e. those a ected by an action) can change their truth values from time step
to time step. Finally, we again need to make sure that the guessed plan actually
returns us to the original state at time step 0.
noreversal :- holds(V, Val, 0), not holds(V, Val, H+1), horizon(H).
noreversal :- holds(V, Val, H+1), not holds(V, Val, 0), horizon(H).
:- not &amp;k{ ~ noreversal}.</p>
        <p>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:
:- &lt; check guessed state against set S &gt;</p>
        <p>This rule should re 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 S2. This concludes
the description of our encodings.
4.3</p>
      </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
2 The full encoding can be found at https://sea le.aau.at/d/373cd25718dc4377afec/.</p>
        <p>The action del-all has a universal uniform reverse plan h add-f0, . . . ,
add-fi i. We have generated instances from i = 1 to i = 6 and from i = 10
to i = 200 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 general encoding.</p>
        <p>We have used plasp 3.1.1 (https://potassco.org/labs/plasp/) and eclingo
0.2.0 (https://github.com/potassco/eclingo) [?] on a computer with a 2.3 GHz
AMD EPYC 7601 CPU with 32 cores and 500 GB RAM running CentOS 8. We
have set a timeout of 10 minutes and a memory limit of 16GB (which was never
exceeded).</p>
        <p>600
The results for problem (a) are plotted in Figure 1. The general encoding
exceeded the time limit already at the problem with six facts, while the simple
encoding could solve all problems with up to 120 facts within the time limit.
The memory consumption increased with i for both encodings, proportional to
the computation time.</p>
        <p>The results for problem (b) are plotted in Figure 2. Interestingly, compared to
(a), both the general and the simple encoding performed noticably faster. While
the general encoding still hit the time limit for six facts, the simple encoding
was able to solve all the instances up to our maximum of i = 200, but at the
expense of increasing memory usage.</p>
        <p>
          In total, the general encoding scales worse, as expected, since the ELP solver
needs to evaluate all answer sets inside each possible world view. However, for
the simple encoding, especially the task of testing for non-reversibility performed
surprisingly well. From all of our results, however, we can see that ELP solving
still severly trails, in terms of performance, encodings for plain ASP [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
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="ref17">17</xref>
        ]. We then proceeded, on the basis
of the PDDL-to-ASP translation tool plasp [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], to present two ELP encodings
to solve the task of universal uniform reversibility of STRIPS actions, given a
corresponding planning domain. When given to an ELP solving system, these
encodings, combined with the ASP translation of STRIPS planning domains
produced by plasp, then yield a set of world views, 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="ref17">17</xref>
        ]. The second encoding
makes use of the power of world views containing multiple answer sets, which
allows for the expression of universal quanti ers via the K operator. 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 ELP community, it will not come as
a surprise that the general encoding was performing much more poorly than
the simple encoding, since it needs to deal with a large set of answer sets in
each world view. For such encodings to become practical, ELP solvers need to
be further optimized. However, the simple encoding showed some promise, but
needed an increasing amount of memory with increasing problem sizes, compared
to a plain ASP encoding [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        For future work, we intend to optimize our encodings further, and test them
with other established ELP solvers. 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="ref17">17</xref>
        ]. We would also like to
compare our approach to existing tools RevPlan3 (implementing techniques of
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]) and undoability (implementing techniques of [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]).
3 http://www.kr.tuwien.ac.at/research/systems/revplan/index.html
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <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="ref2">
        <mixed-citation>
          2.
          <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="ref3">
        <mixed-citation>
          3.
          <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>
          ,
          <string-name>
            <surname>Morak</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>Determining action reversibility in strips using answer set programming</article-title>
          .
          <source>In: Proc. ASPOCP</source>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <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="ref5">
        <mixed-citation>
          5.
          <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="ref6">
        <mixed-citation>
          6.
          <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="ref7">
        <mixed-citation>
          7.
          <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="ref8">
        <mixed-citation>
          8. De Giacomo,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Gerevini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.E.</given-names>
            ,
            <surname>Patrizi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Saetti</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </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="ref9">
        <mixed-citation>
          9.
          <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="ref10">
        <mixed-citation>
          10.
          <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="ref11">
        <mixed-citation>
          11.
          <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="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Strong introspection</article-title>
          . In: Dean,
          <string-name>
            <given-names>T.L.</given-names>
            ,
            <surname>McKeown</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.</surname>
          </string-name>
          R. (eds.)
          <source>Proc. AAAI</source>
          . pp.
          <volume>386</volume>
          {
          <fpage>391</fpage>
          . AAAI Press / The MIT Press (
          <year>1991</year>
          ), http://www.aaai.org/Library/AAAI/
          <year>1991</year>
          /aaai91-
          <fpage>060</fpage>
          .php
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <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="ref14">
        <mixed-citation>
          14.
          <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="ref15">
        <mixed-citation>
          15.
          <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="ref16">
        <mixed-citation>
          16.
          <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="ref17">
        <mixed-citation>
          17.
          <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 id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Revisiting epistemic speci cations</article-title>
          . In: Balduccini,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Son</surname>
          </string-name>
          , T.C. (eds.)
          <article-title>Logic Programming</article-title>
          ,
          <source>Knowledge Representation, and Nonmonotonic Reasoning - Essays Dedicated to Michael Gelfond on the Occasion of His 65th Birthday. Lecture Notes in Computer Science</source>
          , vol.
          <volume>6565</volume>
          , pp.
          <volume>315</volume>
          {
          <fpage>333</fpage>
          . Springer (
          <year>2011</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -20832-4 20
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>