<!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>A Query Evaluation Method for ASP with Abduction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ken Satoh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>National Institute of Informatics</institution>
          ,
          <addr-line>Tokyo</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present a goal-directed proof procedure for ASP with abduction. Our proposed procedure in this paper is correct for any consistent abductive framework proposed in [Kakas90a]. In other words, if the procedure succeeds, there is a set of hypotheses which satisfies a query, and if the procedure finitely fails, there is no such set. If we do not consider abducibles, this procedure is a goal-directed proof procedure for ASP as well.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Logic Programming</kwd>
        <kwd>Abduction</kwd>
        <kwd>Topdown Proof Procedure</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>() ← (1)
() ← (2)
ℎ(, ) ← (), ∼ ℎ(, ) (3)
ℎ(, ) ← (), _†() (4)
ℎ(, ) ← (), ∼ _†() (5)
Since () is true from (2), ℎ(, ) will be derived by using Kakas
and Mancarella’s proof procedure and assuming ∼ _†() in (5). However,
actually, there is no generalized stable model which satsifies ℎ(, ). We solve
this problem by using the above techniques.</p>
    </sec>
    <sec id="sec-2">
      <title>2. A Semantics of Abductive Framework</title>
      <p>We mainly follow the definition of abductive framework in [ Kakas90a], but we modify it slightly
for notational conveniences. Firstly, we define a rule and an integrity constraint.
Definition 1. Let  be an atom, and 1, ..., ( ≥ 0) be literals each of which is an atom or
a negated atom of the form ∼ . A rule is of the form:
 ←</p>
      <p>1, 2, ..., .</p>
      <p>We call  the head of the rule and 1, ...,  the body of the rule. Let  be a rule. ℎ(),
() and () denote the head of , the set of literals in the body of  and the set of
positive literals in () respectively.</p>
      <p>Definition 2. Let 1, ..., ( ≥ 0) be literals. An integrity constraint is of the form:
⊥ ←</p>
      <p>1, 2, ..., .</p>
      <p>For a given program (with integrity constraints), we define a stable model (in other words,
answer set) as follows.</p>
      <p>Definition 3. Let  be a logic program and Π be a set of ground rules obtained by replacing all
variables in each rule in  by every element of its Herbrand universe. Let  be a set of ground
atoms from Π and Π be the following (possibly infinite) program.</p>
      <p>Π = { ←
1, ..., |  ← 1, ..., , ∼ 1, ..., ∼  ∈ Π</p>
      <p>and  ̸∈  for each  = 1, ..., .}
Let (Π ) be the least model of Π . A stable model for a logic program  is  if  =
(Π ) and ⊥ ̸∈  .</p>
      <p>This definition gives a stable model of  which satisfies all integrity constraints. We say that 
is consistent if there exists a stable model for  .</p>
      <p>Now, we define an abductive framework.</p>
      <p>Definition 4. An abductive framework is a pair ⟨, ⟩ where  is a set of predicate symbols,
called abducible predicates and  is a set of rules each of whose head is not in .
We call a set of all ground atoms for predicates in  abducibles. As pointed out in [Kakas90a], we
can translate a program which includes a definition of abducibles to an equivalent framework
that satisfies the above requirement. Moreover, we impose an abductive framework to be
rangerestricted, that is, any variable in a rule of a program must occur in non-abducible positive
literals of the rule.</p>
      <p>Now, we define a semantics of an abductive framework.</p>
      <p>Definition 5. Let ⟨, ⟩ be an abductive framework and Θ be a set of abducibles. A generalized
stable model  (Θ) is a stable model of  ∪ { ← |  ∈ Θ}.</p>
      <p>We say that ⟨, ⟩ is consistent if there exists a generalized stable model  (Θ) for some Θ.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Query Evaluation for Abduction</title>
      <p>Before showing our query evaluation method, we need the following definitions. Let  be a
literal. Then,  denotes the complement of 3
Definition 6. Let  be a logic program. A set of resolvents w.r.t. a ground literal  and  ,
(,  ) is the following set of rules:
(,  ) =
{(⊥ ← 1, ..., ) |  is negative and</p>
      <p>← 1, ...,  ∈  and  =  by a ground substitution  }∪
{( ← 1, ..., − 1, +1, ..., ) |</p>
      <p>← 1, ...,  ∈  and  =  by a ground substitution  }
The first set of resolvents are for negation as failure and the second set of resolvents corresponds
with “forward” evaluation of the rule introduced in [Sadri88].</p>
      <p>Definition 7. Let  be a logic program. A set of deleted rules w.r.t. a ground literal  and  ,
(,  ), is the following set of rules:
(,  ) = {( ← 1, ..., ) |</p>
      <p>← 1, ...,  ∈  and  =  by a ground substitution  }</p>
      <p>Our query evaluation procedure consists of 4 subprocedures, (, Δ), _(, Δ),
_(, Δ) and _(, Δ) where  is a non-abducible atom and Δ is a set of
ground literals already assumed and  is a ground literal and  is a rule.</p>
      <p>(, Δ) returns a ground substitution for the variables in  and a set of ground literals.
This set of ground literals is a union of Δ and literals newly assumed during execution of the
subprocedure. Other subprocedures return a set of ground literals.</p>
      <p>The subprocedures have a select operation and a fail operation. The select operation
expresses a nondeterministic choice among alternatives. The fail operation expresses immediate
termination of an execution with failure. Therefore, a subprocedure succeeds when its inner
calls of subprocedures do not encounter fail. We say a subprocedure succeeds with ( and) Δ
when the subprocedure successfully returns ( and) Δ.</p>
      <p>The informal specification of the 4 subprocedures is as follows.</p>
      <p>3 =∼  for a positive literal , and ∼  =  for a negative literal ∼ .
1. (, Δ) searches a rule  of  in a program  whose body can be made true with
a ground substitution  under a set of assumptions Δ. To show that every literal in the
body can be made true, we call  for non-abducible positive literals in the body.
Then, we check the consistency of other literals in the body with  and Δ. Note that
because of the range-restrictedness, other literals in  become ground after all the calls
of  for non-abducible positive literals.
2. _(, Δ) checks the consistency of a ground literal  with  and Δ. To show the
consistency for assuming , we add  to Δ; then, we check the consistency of resolvents
and deleted rules w.r.t.  and  .
3. _(, Δ) checks the consistency of a rule  with  and Δ. If  is not ground,
we must check the consistency for ground instances of . But it is suficient to consider
every ground instance  in Ω ∪{}. We can prove the consistency by showing that
either a literal in ( ) can be falsified or ( ) can be made true and ℎ( )
consistent.</p>
      <p>This procedure can also be used to check integrity for rule addition.
4. _(, Δ) checks if a deletion of  does not cause any contradictions with 
and Δ. To show the consistency of the implicit deletion of , it is suficient to prove that
the head of every ground instance  in Ω 4 can be made either true or false.
Thanks to the range-restrictedness, we can compute all ground instances of a rule  (if they
are finite) in Ω (or Ω ∪{}). For this, we compute every SLD derivation of a query which
consists of all non-abducible positive literals in () to the abducible-and-negation-removed
program  − (or ( ∪ {})− ).</p>
      <p>Please see the details of each subprocedure at Figure 1 and Figure 2 in Appendix. In Figure 1,
 denotes empty substitution and    expresses a composition of two substitutions   and  .
Also, we denote a set of non-abducible positive literals, non-abducible negative literals, and
abducibles (either negative or positive) in a rule  as (), () and ().</p>
      <p>If we remove _ and do not consider resolvents obtained with “forward” evaluation
of the rule, then this procedure coincides with that of Kakas and Mancarella [Kakas90a]. That is,
our procedure is obtained by augmenting their procedure with an integrity constraint checking
in a bottom-up manner and with an implicit deletion checking.</p>
      <p>We can show the following theorems for correctness of successful derivation, consistency
check for addition of a rule and finite failure.</p>
      <p>Theorem 1. Let ⟨, ⟩ be a consistent abductive framework. Suppose (, {}) succeeds
with (, Δ). Then, there exists a generalized stable model  (Θ) for  such that Θ includes all
positive abducibles in Δ and  (Θ) |=  .</p>
      <p>This theorem means that if the procedure (, {}) answers “yes” with (, Δ), then there is
a generalized stable model which satisfies  . However, we cannot say in general that we make
 true only with positive abducibles in Δ, because there might be some hypotheses which are
irrelevant to a query but which we must assume to get consistency.</p>
      <p>The following theorem states correctness for consistency for addition of a rule.</p>
      <p>4Note that Ω ∪{} = Ω since  is an instance of a rule in  .</p>
      <p>Theorem 2. Let ⟨, ⟩ be a consistent abductive framework. Suppose _(, {}) succeeds,
then ⟨ ∪ , ⟩ is a consistent abductive framework.</p>
      <p>This means that this procedure can be used to guarantee the existence of a generalized stable
model for a given abductive framework ⟨, ⟩ if iterative calls of _ succeed from ⟨{}, ⟩
by adding each rule in  .</p>
      <p>The following is a theorem related to correctness for finite failure.</p>
      <p>Theorem 3. Let ⟨, ⟩ be an abductive framework. Suppose that every selection of rules
terminates for (, {}) with either success or failure. If there exists a generalized stable model
 (Θ) for ⟨, ⟩ and a ground substitution  such that  (Θ) |=  , then there is a selection of
rules such that (, {}) succeeds with (, Δ) where Θ includes all positive abducibles in Δ.
This theorem means that if we can search exhaustively in selecting the rules and there is a
generalized stable model which satisfies a query, then the procedure always answers “yes”.</p>
      <p>With this theorem, we obtain the following corollary for a finite failure.</p>
      <p>Corollary 1. Let ⟨, ⟩ be an abductive framework. If (, {}) fails, then for every
generalized stable model  (Θ) for ⟨, ⟩ and for every ground substitution  ,  (Θ) ̸|=  .
When the procedure (, {}) answers “no”, there is no generalized stable model which
satisfies the query. Also, this corollary means that we can use a finite failure to check if
the negation of a ground literal is true in all generalized stable models since finite failure of
(, {}) means that every generalized stable model satisfies ∼ .</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>In this paper, we propose a query evaluation method for an abductive framework. Our procedure
can be regarded as an extension of the procedure of Kakas and Mancarella by augmenting
forward evaluation of rules and consistency check for implicit deletion.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This work was supported by JSPS KAKENHI Grant Numbers, JP17H06103 and JP19H05470 and
JST, AIP Trilateral AI Research, Grant Number JPMJCR20G4.</p>
      <p>Appendix: Topdown Proof Procedure
(, Δ) : a non-abducible atom; Δ: a set of literals
begin
if  is ground and  ∈ Δ then return (, Δ)
elseif  is ground and ∼  ∈ Δ then fail
else
begin
select  ∈  s.t. ℎ() and  are unifiable with an mgu 
if such a rule is not found then fail
Δ0 := Δ,  0 :=  , 0 := ( ),  := 0
while  ̸= {} do
begin
take a literal  in 
if (, Δ) succeeds with ( , Δ+1)</p>
      <p>then  +1 :=   , +1 := ( − { }) ,  :=  + 1 and continue
end
 :=  
for every  ∈ ( ) ∪ ( ) do
begin
if _(, Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
end
if _(, Δ) succeeds with Δ′ then return (, Δ′)
end
end ()
_(, Δ) : a ground literal; Δ: a set of literals
begin
if  ∈ Δ then return Δ
elseif  = ⊥ or  ∈ Δ then fail
else
begin
Δ0 := {} ∪ Δ,  := 0
for every  ∈ (,  ) do
if _(, Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
for every  ∈ (,  ) do
if _(, Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
end
return Δ
end (_)
_(, Δ) : a rule; Δ: a set of literals
begin
Δ0 := Δ,  := 0
for every ground rule  ∈ Ω ∪{} do
begin
select (a) or (b)
(a) select  ∈ ( )
if  ∈ ( ) ∪ ( ) and _(, Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
elseif  ∈ ( ) and (, Δ) succeeds with (, Δ+1)</p>
      <p>then  :=  + 1 and continue
(b) Δ0 := Δ,  := 0
for every  ∈ ( ) do
begin
if  ∈ ( )
and (, Δ) succeeds with (, Δ+1)
then  :=  + 1 and continue
elseif  ∈ ( ) ∪ ( )
and _(, Δ) succeeds with Δ</p>
      <p>+1
then  :=  + 1 and continue
end
if _(ℎ( ), Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
end
return Δ
end (_)
_(, Δ) : a rule; Δ: a set of literals
begin
Δ0 := Δ,  := 0
for every ground rule  ∈ Ω do
begin
select (a) or (b)
(a) if (ℎ( ), Δ) succeeds with (, Δ+1)</p>
      <p>then  :=  + 1 and continue
(b) if _(∼ ℎ( ), Δ) succeeds with Δ+1</p>
      <p>then  :=  + 1 and continue
end
return Δ
end (_)
Figure 2: The definition of _ and _</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [Kakas90a]
          <string-name>
            <surname>Kakas</surname>
            ,
            <given-names>A. C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mancarella</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Generalized Stable Models:
          <article-title>A Semantics for Abduction</article-title>
          ,
          <source>Proc. of ECAI'90</source>
          , pp.
          <fpage>385</fpage>
          -
          <lpage>391</lpage>
          (
          <year>1990</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [Kakas90b]
          <string-name>
            <surname>Kakas</surname>
            ,
            <given-names>A. C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mancarella</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <article-title>On the Relation between Truth Maintenance and Abduction</article-title>
          ,
          <source>Proc. of PRICAI'90</source>
          , pp.
          <fpage>438</fpage>
          -
          <lpage>443</lpage>
          (
          <year>1990</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [Sadri88]
          <string-name>
            <surname>Sadri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>A</given-names>
            <surname>Theorem-Proving Approach</surname>
          </string-name>
          to Database Integrity,
          <article-title>Foundations of Deductive Database and Logic Programming, (J</article-title>
          . Minker, Ed.), Morgan Kaufmann Publishers, pp.
          <fpage>313</fpage>
          -
          <lpage>362</lpage>
          (
          <year>1988</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>