<!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>Encoding Definitional Fragments of Temporal Action Logic into Logic Programming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Marc van Zee</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Patrick Doherty</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>John-Jules Meyer</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer and Information Science</institution>
          ,
          <addr-line>Link o ̈ping University</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Individual and Collective Reasoning, University of Luxembourg</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Information and Computing Science, Utrecht University</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Temporal Action Logics (TAL) is an expressive class of nonmonotonic temporal logics for reasoning about action and change. In previous work, it has been shown that a very general fragment of the logic can be reduced to firstorder logic with equality. Consequently, standard theorem proving techniques can be used to reason in TAL. TAL is intended to be used for robotics. In this case, standard theorem proving techniques are too general and do not provide efficient decision procedures. The goal of this article is to identify a limited subset of TAL that can be directly mapped to a normal logic program. Although quite restrictive, this sets the lower bound on what can be done with direct mappings to logic programs. Discussions concerning extensions to the restricted fragment are also provided.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Temporal Action Logics (TAL) [
        <xref ref-type="bibr" rid="ref2 ref4">2, 4</xref>
        ] is a general class of nonmonotonic temporal
logics for reasoning about action and change that are based on the Features and Fluents
framework of Sandewall [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. TAL is highly expressive and includes the use of
contextdependent durative actions, durational fluents (fluents with default values), ramification
constraints, qualification constraints, concurrent and non-deterministic actions. Like
several other action formalisms, TAL uses circumscription [
        <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
        ] to solve the frame
and the ramification problems, which require nonmonotonicity. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], it was shown
how the 2nd-order circumscription component could be reduced to a logically
equivalent 1st-order component using quantifier elimination. Consequently, standard theorem
proving techniques can be used to reason with TAL. This is problematic from an
efficiency perspective since in the case of many domains such as robotics, one requires an
efficient decision procedure to answer queries. VITAL4 was an early implementation of
a fragment of TAL that uses model generation techniques. This does not scale for large
TAL narratives though.
4 http://www.ida.liu.se/ jonkv/vital
      </p>
      <p>
        The generality of TAL is useful in other domains as a natural semantic
specification language. For instance, it provides a formal specification of TALplanner.
TALplanner5 [
        <xref ref-type="bibr" rid="ref3 ref6">3, 6</xref>
        ] is an award-winning forward-chaining planner based on TAL. Both TAL
planner and an execution monitoring framework based on TAL have been used in
Unmanned Aerial Vehicles [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], developed at Linko¨ping University.6
      </p>
      <p>In this paper, the focus is on isolating a restricted fragment of TAL and showing
that it can be encoded in a sound manner into normal logic programs. Unfortunately,
the fragment for which this works is highly restrictive. The subset of TAL narratives
with deterministic single step actions and complete information about initial state can
be encoded soundly into logic programs. This in fact makes sense, since any
nondeterminism in TAL narratives must be excluded from such a direct mapping. Relaxing
the single step constraint and complete information at initial state both result in
introducing non-determinism and thus multiple minimal models. This, in fact, would apply
to any alternative action formalism.</p>
      <p>
        The systematic use of logic programming as a basis for soundly implementing
fragments of action formalisms was introduced in the case of the Situation Calculus by
Reiter (see [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], Chapter 5). The initial fragment identified by Reiter had similar
restrictions for progression to work. This article applies the techniques introduced by Reiter
to encode a fragment of TAL soundly into logic programs and analyzes the feasibility
of extending the technique to more general fragments of TAL.
      </p>
      <p>An algorithm is developed for the systematic translation of definitional theories of
TAL into logic programs. The definitional fragment of TAL identified is called TALM.
It is then shown that extending this fragment via the use of direct encodings into normal
logic programs is not feasible. Any attempt to generalize the TALM fragment results
in the introduction of non-determinism into the fragment. The main limitation here is
the inability to encode a unique values axiom for features in TAL narratives. This
immediately rules out non-deterministic actions, actions with duration and an incomplete
initial state.</p>
      <p>The rest of this paper is organised as follows: In Section 2 we introduce the basic
concepts of TAL, in Section 3 we develop an algorithm to translate definitional theories
into logic programs, in Section 4 we reformulate a constrained TAL theory, TALM, as a
definitional theory, and finally in Section 5 we discuss the limitations of the translation.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Temporal Action Logics</title>
      <p>
        Due to lack of space, we refer the reader to [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] for details about the full syntax and
semantics of TAL. In this section, we summarize the main components necessary for
understanding the techniques introduced.
      </p>
      <p>
        In TAL, a scenario (or narrative) can be described in a compact surface language
L(ND), which is a high-level macro expandable language consisting of action type
specifications (acs), dependency constraints (dep), domain constraints (dom),
persistence statements (per), observation statements (obs), and action occurrence statements
5 http://www.ida.liu.se/divisions/aiics/aiicssite/projects/talplanner.en.shtml
6 http://www.ida.liu.se/divisions/aiics/aiicssite/index.en.shtml
(occ). To make sure that fluents will not be persistent when they are changed by an
action, the reassignment macro R can be used. R([t2] ) ensures that will hold at the
time point t2. Consider the following scenario due to Reiter [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] that will be used as a
running example.
      </p>
      <p>Example 1 (Simple robot specification). There is one robot called rob and there are two
objects, namely a ball and a vase. A robot can only pick up an object if he is not holding
anything and if he is next to the object, and he can only drop an object if he is holding
it. When a robot drops an object it will fall on the floor. Initially, rob is next to vase and
not next to ball. Rob is not holding anything. First, rob picks up vase, after which he
walks to ball and drops vase. The narrative specification of this example in the macro
language L(ND) is:
acs1 [t1; t2] pickup(r; o) ;
acs2 [t1; t2] walk(r; o) ;
acs3 [t1; t2] drop(r; o) ;
[t1] 8o1 [:holding(r; o1)] ^ nextto(r; o) !</p>
      <p>R([t2] holding(r; o) ^ :onfloor(o))
R([t2] nextto(r; o)) ^ 8o1 [o 6= o1 ! R([t2] :nextto(r; o1))]
[t1] holding(r; o) ! R([t2] :holding(r; o) ^ onfloor(o))
obs1 [0] nextto(rob; vase) ^ :nextto(rob; ball)
obs2 [0] 8z:holding(rob; z)
obs3 [0] onfloor(vase) ^ onfloor(ball)
occ1 [0; 1] pickup(rob; vase)
occ2 [1; 2] walk(rob; ball)
occ3 [3; 4] drop(rob; vase)</p>
      <p>
        Reasoning about a narrative in L(ND) is done by translating it into the base
language L(FL)), which is an order-sorted classical first-order language using a linear,
discrete time structure. The language uses the ternary predicates H olds and Occurs,
and the binary predicate Occlude. The translation from L(ND) to L(FL) is given by the
function T rans [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. For instance, T rans([t]f =^ !) is defined as H olds(t; f; !).
Similarly, T rans(R((t; t0]f =^ !)) is defined as 8t00(t &lt; t00 &lt; t0 ! Occlude(t00; f )) ^
H olds(t0; f; !). Occlude(t; f ) represents that a persistent or durational fluent f is
exempt from inertia or default value assumption, respectively, at time t. T rans([t; t0] ),
where is an action term, is defined as Occurs(t; t0; ), which represents that action
occurs in the interval [t; t0].
      </p>
      <p>Consider any narrative N and let Nper; Nobs; Nocc; Nacs; Ndomc; and Ndepc denote
the sets of persistence statements, observation statements, action occurrence statements,
action type specifications, domain constraints, and dependency constraints in N
respectively. The TAL domain description (referred to as preferred narrative) N is given by
CIRC[ occ; Occurs] ^ CIRC[ depc ^ acs; Occlude] ^ fnd ^ time ^ per ^ obs ^ domc;
where per; obs; occ; acs; domc; and depc are the formulas in L(FL) (first-order
logic formulas) obtained by applying T rans on N ; Nobs; Nocc; Nacs; Ndomc; and Ndepc
respectively; fnd is the set of foundational axioms in L(FL), containing unique name
axioms, unique value axioms, etc., and time is the axiomatization of the particular
temporal structure used in TAL.</p>
      <p>
        By proposition 18.2 in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], the circumscription of Occurs and Occludes,
respectively CIRC[ occ; Occurs] and CIRC[ depc ^ acs; Occlude], can be transformed
into first-order definitional forms either through quantifier elimination of predicate
completion techniques.
      </p>
      <p>Example 2 (Robot Specification, Ctd.). The following is a representation of acs1 in the
language L(FL):
acs1’ Occurs(t1; t2; pickup(r; o)) !</p>
      <sec id="sec-2-1">
        <title>8o1 [:Holds(t1; holding(r; o1); true)] ^ Holds(t1; nextto(r; o); true) !</title>
      </sec>
      <sec id="sec-2-2">
        <title>Occlude(t2; holding(r; o)) ^ Occlude(t2; onfloor(o))^</title>
      </sec>
      <sec id="sec-2-3">
        <title>Holds(t2; holding(r; o); true) ^ :Holds(t2; onfloor(o); true):</title>
        <p>The circumscription of the Occurs predicate in the action occurrences (occ1, occ2,
and occ2) above is equivalent to the following first-order formula:</p>
        <p>Occurs(t1; t2; a) $(t1 = 0 ^ t2 = 1 ^ a = pickup(rob; vase))_
(t1 = 1 ^ t2 = 2 ^ a = walk(rob; ball))_
(t1 = 2 ^ t2 = 3 ^ a = drop(rob; vase))</p>
        <p>The circumscription of the Occlude predicate in the action specifications (acs1,
acs2, and acs3) above is equivalent to the following set of first-order formulas:</p>
      </sec>
      <sec id="sec-2-4">
        <title>Occlude(t; holding(rob; o)) $</title>
        <p>o = vase ^ 8o1 [:Holds(0; holding(r; o1); true)]^</p>
      </sec>
      <sec id="sec-2-5">
        <title>Holds(0; nextto(r; o); true) ^ 1</title>
        <p>t
2
Occlude(t; nextto(rob; o)) $ o = ball ^ t = 2</p>
      </sec>
      <sec id="sec-2-6">
        <title>Occlude(t; onf loor(o)) $</title>
        <p>o = vase ^ (t = 1 ^ 8o1 [:Holds(0; holding(rob; o1); true)]^</p>
        <p>Holds(0; nextto(rob; o); true) _ t = 3 ^ Holds(2; holding(rob; o); true)
3</p>
        <p>def2P Algorithm: From Definitional Theories to Logic Programs
We begin by providing some background definitions and techniques for the sake of
completeness. Although these techniques are well-known by now, we state them here
for completeness and readability of the paper.
3.1</p>
        <sec id="sec-2-6-1">
          <title>Negation As Failure Semantics: Clark’s Completion</title>
          <p>
            The most widely accepted declarative semantics for negation as failure is the
“completed database” introduced by Clark [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ]. This is now usually called the completion or
Clark completion of a program P and denoted by comp(P ). We shall define this only
when P is what Lloyd calls a normal program, i.e. a set of clauses (not containing the
predicate =) of the form
          </p>
          <p>A</p>
          <p>L1; : : : ; Lm
where A is an atom and L1; : : : ; Lm are literals. To avoid tedious repetition we shall
assume that all programs referred to are normal. Similarly goals and queries will be
assumed to be normal, i.e. of the forms L1; : : : ; Lm, and ? L1; : : : ; Lm, respectively.</p>
          <p>
            Norms logic programs generally does not use classical negation, but negation as
failure. This means exactly what it says: if some fact cannot be derived from the theory
(i.e. it fails), then we assume that the negation of this fact can be derived from the
theory (i.e. it succeeds). One of the most widely applicable and often used semantics for
negation as failure was given by Clark [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ]. This is usually called the (Clark) completion,
comp(P ), of the original program P . The idea of this result is that we use the ’implied
iff’: we simply replace all the implications of the normal program clauses with
equivalences. The basic result of Clark is that negation as failure is sound for comp(P ) for
both success and failure. Because of the syntactical form of normal program clauses,
comp(P ) will be a definitional theory.
3.2
          </p>
        </sec>
        <sec id="sec-2-6-2">
          <title>Lloyd-Topor Transformations</title>
          <p>Although Clark’s theorem assumes that a Prolog program P can be obtained from the
theory T by writing the if-halves, it does not give any details on how this is done.
Because Prolog only uses disjunctions and conjunctions as connectives, we will translate
the other connectives (implication, bi-implication and quantifiers) into a form such that
it is amenable for a Prolog interpreter. The same can be said for the query goals.</p>
          <p>
            The Lloyd-Topor transformations [
            <xref ref-type="bibr" rid="ref8 ref9">9, 8</xref>
            ] is a set of derivation rules for systematically
transforming if-halves of definitions of the syntactic form W ! A into a syntactic form
suitable for implementation as Prolog clauses. Here, A must be an atomic formula, but
W may be an arbitrary first-order formula, possibly involving quantifiers, in which case
we require that the quantified variables of W be different from one another, and from
any of the free variables mentioned in W . Originally, the Lloyd-Topor transformations
introduce auxiliary predicates when transforming negated existential quantifiers and
disjunctions, but Reiter [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ] shows that these predicates are only introduced for
exposition of the results of Lloyd-Topor and that they can be omitted using a process called
unfolding. The output of these revised transformations is a single Prolog executable
formula lt(W ) ! A, without introducing new predicates and clauses. Here, lt(W ) is
a formula Reiter defines inductively on the syntactic structure of W . It is defined as
follows:
1. If W is a literal: lt(W ) = W .
2. lt(W1 ^ W2) = lt(W1) ^ lt(W2).
3. lt(W1 _ W2) = lt(W1) _ lt(W2).
4. lt(W1 ! W2) = lt(:W1 _ W2).
5. lt(W1 W2) = lt((W1 !
          </p>
          <p>(W2 ! W1)).
6. lt((8x)W ) = lt(:(9x):W ).
7. lt((9x)W ) = lt(W ).</p>
          <p>W2) ^
8. lt(::W ) = lt(W ).
9. lt(:(W1 ^ W2)) = lt(:W1) ^ lt(:W2).
10. lt(:(W1 _ W2)) = lt(:W1) _ lt(:W2).
11. lt(:(W1 ! W2)) = lt(:(:W1 _ W2)).
12. lt(:(W1 W2)) = lt(:(W1 ! W2) ^</p>
          <p>:(W2 ! W1))).
13. lt(:(8x)W ) = lt((9x):W ).
14. lt(:(9x)W ) = :lt(W ).</p>
        </sec>
        <sec id="sec-2-6-3">
          <title>Allowed Programs</title>
          <p>
            Clark’s theorem is not applicable to any Prolog interpreter, but only to proper Prolog
interpreters. Such an interpreter is one that evaluates a negative literal not A, using
negation as failure, and moreover, does so only when (at the time of evaluation) the
atom A is ground. When A is not ground, the interpreter may suspend its evaluation,
working on other literals until A does become ground, or it may abort its computation.
Either way, it never tries to fail on non-ground atoms, because this can result in unsound
behaviour [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ]. Due to space limitations, we leave out the details7, but we instead
introduce a well-known class of programs that is known to be complete, meaning that it will
not cause problems with floundering [
            <xref ref-type="bibr" rid="ref14">14</xref>
            ], namely the allowed programs. In Section 4
we show that every TALM theory results in an allowed Prolog program.
          </p>
        </sec>
        <sec id="sec-2-6-4">
          <title>Definition 1 (Allowed Program, Allowed Query). A query is said to be allowed if</title>
          <p>every variable which occurs in it occurs in a positive literal of it; a program clause
A L1; :::; Ln is allowed if every variable which occurs in it occurs in a positive
literal of its body L1; :::; Ln and a program is allowed if all of its clauses are allowed.</p>
        </sec>
        <sec id="sec-2-6-5">
          <title>3.4 the def2P algorithm</title>
          <p>The contents of the previous section can be summarized into a single algorithm that
translates a definitional theory to a Prolog program.</p>
          <p>
            Definition 2 (def2P algorithm). The def2P algorithm takes a definitional theory T as
input and output a Prolog program def2P(T ) by performing the following steps:
1. T is augmented with Clark’s Equality Axioms [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ], obtaining T 0,
2. T 0 is translated into Lloyd-Topor Normal Form, obtaining Tn0orm,
3. The if-halves of the definitions of Tn0orm form the Prolog program P ,
4. If P falls in the class of allowed programs, return P . Else, return false.
          </p>
          <p>The following result follows directly from the previous discussion.</p>
        </sec>
        <sec id="sec-2-6-6">
          <title>Theorem 1 (Completeness of def2P algorithm). The Prolog resolution algorithm for</title>
          <p>def2P(T ) is complete for the theory T .
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>A Definitional Theory for TAL</title>
      <p>
        We constrain TAL to integer and positive time, relational and inertial fluents, complete
initial state and deterministic, single-step and non-overlapping actions. Moreover, we
omit symbolic constants, dependency constraints and domain constraints. Finally we
assume a consistent narrative specification. Call this constrained formalism TALM.
7 For a more detailed discussion see [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], Section 3.2.2.
Definition 3 (TALM theory). A TALM theory is a constrained TAL theory
=
occ ^ acs ^ per ^ fnd of the form:
obs Holds(t; f; v)
occ Occurs(t; t + 1; a)
acs Occurs(t; t + 1; a) ! (t; t + 1)
per :Occlude(t + 1; f ) ! Holds(t + 1; f; v)
fnd UNA, CWA, Unique values axioms
for t 2 N, fluent f and value v 2 ftrue; falseg
for t 2 N and action a
We obtain a definitional theory for this restricted narrative by providing a definition for
the three predicates in the base language L(FL): Occurs, Occlude and Holds.
Occurs: By definition, only positive occurrences of Occurs predicates are allowed in
occ. Each such atomic formula can be put in the logically equivalent form 8t1;t2;a(t1 =
ut^t2 = u0t^a0 = a(u)) ! Occurs(t1; t2; a0). Denote such a formula by 8t1;t2;a0 i !
Occurs(t1; t2; a0) where i = (t1 = u ^ t2 = u0t ^ a0 = a(u)). Then the conjunction of
ground atomic formulas can be put in the following form: 8t1;t2;a0 ( 1 _ 2 _:::_ n) !
Occurs(t1; t2; a0). Denote this formula by 8t1;t2;a ! Occurs(t1; t2; a). By
proposition 18.2 in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], in this case circumscription is equivalent to predicate completion, i.e.
CIRC( occ; Occurs) is equivalent to:
      </p>
      <p>
        Occurs(t1; t2; a):
Occlude: Circumscribing Occlude works in a similar way. The predicate Occlude
occurs only in the postcondition of dependency constraints and actions specification
formulas. Each member of acs and dep can be transformed syntactically into the
logically equivalent form 8t;f i(t; f ) ! Occlude(t; f ). Again, by proposition 18.2 in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
CIRC( acs ^ acs; Occlude) is equivalent to:
      </p>
      <p>k
8t;f [ _
i=1
i(t; f )]</p>
      <p>Occludes(t; f )
Holds: We obtain the definition of the Holds predicate using case distinctions. The
following proposition simplifies the TALM narrative.</p>
      <sec id="sec-3-1">
        <title>Proposition 1 (Redundant observations at t &gt; 0). Observations that occur at t &gt; 0</title>
        <p>in TALM can be inferred from actions and can thus be removed from the narrative.
Proof. Let be some narrative specification in TALM. Let 0 be the narrative with all
observations at t &gt; 0 removed. We have to show that and 0 have the same models,
i.e. , 0. The truth value of Occurs and Occlude is equivalent for both narratives,
because these predicates do not occur in the observations. This means that it suffices to
show that j= Holds(t; f; v) , 0 j= Holds(t; f; v) for any time point t, fluent f
and valuation v.</p>
        <p>”)”: Suppose for some time point t, fluent f and valuation v 2 ftrue; falseg we
have that j= Holds(t; f; v). We have to show that 0 j= Holds(t; f; v). Suppose that
Holds(t; f; v) is not an observation, it follows now directly that 0 j= Holds(t; f; v),
obs ^
(1)
(2)
because the only difference between and 0 are observations. Suppose to the contrary
that Holds(t; f; v) is an observation. Now, if there is no action specification that implies
Holds(t; f; v), then this observation follows from the persistence statement as well,
otherwise it will be contradicting with it and the narrative is inconsistent. Therefore, the
observation is redundant. On the other hand, if there is an action specification formula
that implies Holds(t; f; v), then since the action specification formulas are unchanged
in 0, it follows that 0 j= Holds(t; f; v).</p>
        <p>”(”: Follows directly from the fact that 0 is a subset of , meaning that everything
that is valid in 0 will be valid in .</p>
        <p>Now, to obtain a definition for the Holds predicate, suppose some time point t, fluent
f and value v.</p>
        <p>– Suppose t = 0. The only formulas that can assign a value to the Holds predicate at
t = 0 are observations, because at time point 0 no actions can occur since an action
has a minimal duration of 1 and a minimal starting time of 0. Moreover, all fluents
are assigned a value through the observations because TALM has a complete initial
state. So, given that t = 0,
– Suppose t &gt; 0. We introduce a second case distinction on Occlude:
Suppose :Occlude(t; f ). Using the persistence statement (see Definition (3))
we obtain 8vHolds(t; f; v) Holds(t 1; f; v). So, given that t &gt; 0 and
:Occlude(t; f ),</p>
        <p>Holds(t
1; f; v)
Suppose Occlude(t; f ). By Eq. (2) we obtain i(t; f ). Because actions are
deterministic and non-overlapping, and because there will be no observations
(Proposition 1) there will be a unique action specification formula that is now
true and implies a single Holds statement for the fluent f . Using this we obtain
Holds(t; f; v). This means that, given that t &gt; 0 and Occlude(t; f ),
( i(t; f ) ^ v = vi)
Theorem 2 (Completion of Holds). Formulas (3), (4) and (5) provide necessary and
sufficient conditions for the predicate Holds:</p>
        <p>" k #
t = 0 ^ _ f = Pj (ui) ^ v = vi _</p>
        <p>i=1
t &gt; 0 ^ (:Occlude(t; f ) ^ Holds(t 1; f; v)_</p>
        <p>Occlude(t; f ) ^ i(t; f ) ^ v = vi)</p>
        <p>Holds(t; f; v)
Proof. Formulas (3), (4) and (5) are the only formulas that make the Holds predicate
true in a TALM narrative. We obtain the definition directly by putting these formulas in
a disjunction and adding the conditions for each case.</p>
        <p>Fortunately, it turns out that every definitional theory of a TALM narrative fall into the
class of allowed programs of Definition 1. We show this in the following theorem.
Theorem 3 (Allowed program). Suppose is a TALM narrative , which is translated
into a definitional theory by using the equivalences above. Let P be the program that is
obtained from this theory by applying Clark’s Theorem. P falls into the class of allowed
programs. That is, every variable that occurs in a rule in P occurs in a positive literal
of the body of the rule.</p>
        <p>
          Proof. We have to show that each program clause in P is an allowed program clause.
Each clause corresponds to a predicate of the theory, which means that we will have
to consider Occurs, Occlude, and Holds. By definition, all literals occurring in the
definition of Occurs are positive [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. This is the same for the definition of Occlude
predicate, because the only literals that occur in this definition are Holds literals, and
each negated Holds predicate can be translated into an equivalent positive one,
using the equivalence Holds(t; f; true) :Holds(t; f; false). Finally, there occurs one
negation in the definition of the Holds predicate, which is in the scope of the Occlude
predicate (see Theorem 2):
: : : t &gt; 0 ^ (:Occlude(t; f ) ^ Holds(t
1; f; v) _ : : :)
        </p>
        <p>The variables occurring in the negative literal are t and f , which both occur
positively in the Holds predicate that directly follows it. Therefore, Holds is an allowed
clause too, because all variables occurring in a negative literal occur in a positive literal
in the body.</p>
        <p>We will now demonstrate the translation of our running example. We invite the reader
to download the application that was developed along with this paper called
TALTranslator. This application can perform the transformation automatically and comes with a
user-friendly GUI and several examples8.</p>
        <p>Example 3 (Robot specification, continued). The definition of the Holds predicate for
the fluent onfloor is (slightly simplified for readability):</p>
        <sec id="sec-3-1-1">
          <title>Holds(t; onf loor(o); v) $</title>
          <p>t = 0 ^ v = true_
t &gt; 0^
(o = vase ^ (t = 1 ^ 8o1 [Holds(0; holding(rob; o1); f alse)]^
Holds(0; nextto(rob; o); true) ^ v = false_
t = 3 ^ Holds(2; holding(rob; o); true) ^ v = true)_
:Occlude(t; onfloor(o)) ^ Holds(t
1; onfloor(o); v))
8 Download from http://icr.uni.lu/marc/TALTranslator.rar
Next, we input this definitional theory into the def2P algorithm (Def. 2). Since Prolog
provides the equality axioms (step 1), we can directly apply the Lloyd-Topor
transformations. What follows is the Prolog code for the fluent onfloor(o) (note that Prolog uses
”;” for disjunction):
In the previous sections we have introduced a restricted fragment of TAL, which we
referred to as TALM. We then showed how it can be translated into a logic program
sound for the narrative in question.</p>
          <p>In this section we will consider if, and to what extent the constraints on TALM
can be relaxed while still being able to use direct mappings of TAL narratives into
logic programs. We discuss non-deterministic actions, concurrent actions, actions with
duration and an incomplete initial state. Almost all the restrictions that we will discuss
(except for concurrent actions) have one property in common: relaxing each of them
will result in a non-deterministic narrative. This means essentially that a narrative can
have multiple interpretations.</p>
          <p>The unique values axioms associated with the foundational axioms in TAL for any
narrative are crucial when discussing non-deterministic narratives, because it rules out
narratives in which a fluent has two values at the same time point. This implies that
rather than modelling several alternative values for a fluent in one mode, several
minimal models are required instead. The unique values axioms follow:
8t;f 9vHolds(t; f; v)
8t;f;v1;v2 [v1 6= v2
:(Holds(t; f; v1) ^ Holds(t; f; v2))]
(7)
(8)
In the previous section we did not explicitly encode these axioms into the definitional
theory, because each narrative in TALM is fully deterministic: it will have a unique
model in which each fluent has exactly one value. Satisfaction of the axioms is implicit
in the encoding of TALM narratives into a logic program.</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>Theorem 4 (Unique Model). Each TALM narrative</title>
        <p>each fluent has exactly one value per time point.
has a unique model m in which
Proof. We show that for each narrative in TALM, the interpretations of the predicates
Holds, Occlude and Occurs are unique. Because these are the only predicates
occurring in the narrative, it follows directly that the narrative has a unique model. Suppose
some narrative ,
– For Occurs: The interpretation of Occurs is determined only by the action
occurrences. This interpretation is unique because the assignments of the action
occurrences are non-deterministic and non-overlapping.
– For Occlude: Similar to Occurs.
– For Holds: This follows directly from the case distinction used when constructing
the definition of the Holds predicate (see Section 2).
5.1</p>
      </sec>
      <sec id="sec-3-3">
        <title>Extending TALM with Non-determinism</title>
        <p>Any relaxation of the restrictions on TAL narratives associated with TALM introduce
one form or another of non-deterministic choices of fluent values at time points. This
implies that in the general case, Theorem 4 no longer holds. For any relaxation of TALM
to be sound relative to encoding into a logic program, the unique values axioms would
have to become an explicit part of the the definitional theory. Unfortunately, this is not
possible.</p>
        <p>Observe that Equation 8 is equivalent to,</p>
        <p>v1 6= v2 ! :Holds(t; f; v1) _ :Holds(t; f; v2);
It is in general not possible to bring such a formula into a definitional form. To obtain a
definition of a predicate P , we require a set of formulas of the form,</p>
        <p>( 1 ! P ) ^ ::: ^ ( i ! P );
which can then be combined to ( 1 _ ::: _ i) ! P .</p>
        <p>Unfortunately the unique values axiom does not provide us with such a
construction, and we can also not transform it in a direct manner into one. This means that
we cannot hope to express the unique values axiom and at the same time maintain
a transformation to an equivalent definitional theory. Therefore, we generally cannot
allow non-deterministic actions in TALM, because it will possibly lead to an
inconsistent model in which a fluent has two values at one time point. This immediately rules
out the possibility to extend TALM with any form of non-determinism, including
nondeterministic actions, multi-step actions, and an incomplete initial state, because each
of these extensions introduce a form of non-determinism into the theory. This is not
surprising as it applies to most any approach to modelling action and change.
5.2</p>
      </sec>
      <sec id="sec-3-4">
        <title>Concurrent actions</title>
        <p>Much work in reasoning about action and change has been done under the assumption
that there is a single agent performing sequences of non-overlapping actions. The use
of explicit time points in TAL enables the direct specification of narratives where action
execution intervals are partly or completely overlapping, whether those actions are
performed by a single agent or by multiple agents. No special concurrency operators are
required to do this.</p>
        <p>Independent Concurrent Actions: Extending TALM with independent concurrent
actions involving disjoint sets of features is unproblematic. Since the effects of the actions
do not interfere with each other (i.e. two actions change the same fluent at the same
time), the expected effects will take place. Such concurrent actions will not introduce
multiple models. We omit the proof of this proposition because it is trivial. The
consequence of this is that the unique value axioms can be omitted, which means that it is
possible to extend TALM with independent concurrent actions.</p>
        <p>Dependent Concurrent Actions: In the case where actions affecting the same fluents
occur concurrently, concurrent actions that affect the value of the same fluent can never
assign different values to this fluent, because this would lead to an inconsistent narrative.
Otherwise, both actions assign the same value to the fluent. In either case, it is not
necessary to add the unique values axioms to the theory because there are no multiple
models introduced. Again, the proof of this is trivial and is omitted. Thus, concurrent
actions are allowed as long they do not assign different values to the same fluent at the
same time. Or in other words: concurrent actions that assign different values to the same
fluent are not allowed.
6</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>
        The aim of this paper was to isolate a definitional fragment of the highly expressive
TAL formalism and show how it can be soundly encoded into a normal logic program.
This was done by defining the fragment TALM and providing an algorithm, def2P, that
encodes TAL narratives in this fragment into logic programs that can be shown to be
sound and complete relative to this particular fragment. One would of course like to
find more general reasoning techniques that relax some of the restrictions associated
with TALM narratives. At the very least, one would require a mapping to disjunctive
logic programs such as Answer Set Programs. Lee and Palla [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] have recently
demonstrated that it is possible to reformulate more general fragments of TAL into an answer
set program. Consequently the SAT-based implementation techniques used there can be
applied to TAL. One of the authors is currently looking into the translation of TAL
theories to Satisfiability Module Theory (SMT) programs. Another appropriate extension
would include the use of constraints to more efficiently model the temporal constraints
associated with more general TAL narratives.
7
      </p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>Marc van Zee is funded by the National Research Fund, Luxembourg.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Clark</surname>
            ,
            <given-names>K.L.</given-names>
          </string-name>
          :
          <article-title>Negation as failure</article-title>
          .
          <source>In: Logic and Databases</source>
          . pp.
          <fpage>293</fpage>
          -
          <lpage>322</lpage>
          (
          <year>1977</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Doherty</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Reasoning about action and change using occlusion</article-title>
          .
          <source>In: 11th European Conference on Artificial Intelligence</source>
          ,
          <year>1994</year>
          . John Wiley and Sons (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Doherty</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Kvarnstro¨m, J.:
          <article-title>Talplanner : A temporal logic based forward chaining planner</article-title>
          .
          <source>Annals of Mathematics and Artificial Intelligence</source>
          <volume>30</volume>
          (
          <issue>1-4</issue>
          ),
          <fpage>119</fpage>
          -
          <lpage>169</lpage>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Doherty</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Kvarnstro¨m, J.:
          <article-title>Temporal action logics</article-title>
          .
          <source>In: Handbook of Knowledge Representation</source>
          , pp.
          <fpage>709</fpage>
          -
          <lpage>757</lpage>
          . No. 3
          <source>in Foundations of Artificial Intelligence</source>
          ,
          <source>Elsevier</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Doherty</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Kvarnstr o¨m, J.,
          <string-name>
            <surname>Heintz</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>A temporal logic-based planning and execution monitoring framework for unmanned aircraft systems</article-title>
          .
          <source>Autonomous Agents and Multi-Agent Systems 19(3)</source>
          ,
          <fpage>332</fpage>
          -
          <lpage>377</lpage>
          (
          <year>Dec 2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Kvarnstr o¨m, J.:
          <article-title>TALplanner and other extensions to Temporal Action Logic</article-title>
          .
          <source>Ph.D. thesis</source>
          , Linkping UniversityLinkping University, Department of Computer and Information Science, The Institute of Technology (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Palla</surname>
          </string-name>
          , R.:
          <article-title>Reformulating temporal action logics in answer set programming</article-title>
          .
          <source>In: AAAI</source>
          <year>2012</year>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.</given-names>
          </string-name>
          :
          <article-title>Foundations of logic programming</article-title>
          . Springer-Verlag New York, Inc. (
          <year>1987</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Topor</surname>
          </string-name>
          , R.:
          <article-title>Making prolog more expressive</article-title>
          .
          <source>Journal of Logic Programming</source>
          <volume>1</volume>
          ,
          <fpage>225</fpage>
          -
          <lpage>240</lpage>
          (
          <year>1984</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Mccarthy</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Circumscription-a form of non-monotonic reasoning</article-title>
          .
          <source>Readings in nonmonotonic reasoning</source>
          pp.
          <fpage>145</fpage>
          -
          <lpage>152</lpage>
          (
          <year>1987</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>McCarthy</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Applications of circumscription to formalizing common sense knowledge</article-title>
          .
          <source>Artificial Intelligence</source>
          <volume>59</volume>
          ,
          <fpage>23</fpage>
          -
          <lpage>26</lpage>
          (
          <year>1986</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Reiter</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Knowledge in action: logical foundations for specifying and implementing dynamical systems</article-title>
          . MIT Press, Cambridge, Mass. (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Sandewall</surname>
          </string-name>
          , E.:
          <article-title>Features and fluents (vol. 1): The representation of knowledge about dynamical systems</article-title>
          . Oxford University Press, Inc., New York, NY, USA (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Shepherdson</surname>
          </string-name>
          , J.:
          <article-title>Negation as failure, completion and stratification</article-title>
          .
          <source>In: in Handbook of Logic in Artificial Intelligence and Logic Programming</source>
          . Volume
          <volume>5</volume>
          . Oxford Science Publications (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. van Zee,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Implementing Temporal Action Logics</article-title>
          .
          <source>Master's thesis</source>
          , Utrecht University (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>