Eliminating Disjunctions in Answer Set Programming by Restricted

Eliminating Disjunctions in Answer Set Programming by Restricted

Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16) Eliminating Disjunctions in Answer Set Programming by Restricted Unfolding 1 2 3 3 2 2 Jianmin Ji , Hai Wan ⇤, Kewen Wang , Zhe Wang , Chuhan Zhang , and Jiangtao Xu 1School of Computer Science and Technology, University of Science and Technology of China, Hefei, China [email protected] 2School of Data and Computer Science, Sun Yat-sen University, Guangzhou, China [email protected] 3School of Information and Communication Technology, Griffith University, Griffith, Australia k.wang,zhe.wang @griffith.edu.au { } Abstract such a disjunctive program can be efficiently rewritten to an equivalent normal program under the answer set semantics. A disjunctive logic program under the answer set Ben-Eliyahu and Dechter [1994] identified a class of dis- semantics can be equivalently translated to a nor- junctive programs, called “Head-Cycle-Free” (HCF), and mal logic program by the shifting transformation, showed that each HCF program can be converted into an if the program is head-cycle-free. In this paper, equivalent normal program in polynomial time by shifting we provide an answer-set-preserving rewriting of head atoms into the body. The class of HCF programs is fur- a general disjunctive program to a normal program ther generalised to that of Head-Elementary-loop-Free (HEF) by first applying the unfolding transformation on programs [Gebser et al., 2011], which can be transformed atoms that prevent the program from being head- into normal programs in polynomial time by shifting too. One cycle-free, then shifting the resulting program. Dif- could identify another proper super class of HEF programs ferent from other transformations that eliminate that are polynomial time convertible to normal programs but disjunctions in answer set programming, the new it would be getting harder to check if a given disjunctive pro- rewriting is efficient for “almost” head-cycle-free gram is in such a class [Ji et al., 2015]. programs, i.e., programs that have only a few atoms On the other hand, it is well known that a disjunctive pro- that prevent them to be head-cycle-free. Based on gram can be equivalently transformed into a negative dis- the new rewriting, we provide an anytime algo- junctive program by a set of program transformations in- rithm to compute answer sets of a disjunctive pro- cluding the unfolding transformation [Brass and Dix, 1997; gram by calling solvers for normal logic programs. Eiter and Wang, 2008]. Since shifting preserves the answer The experiment shows that the algorithm is efficient set semantics for negative disjunctive programs, each disjunc- for some disjunctive programs. We also extend the tive program can be equivalently transformed into a normal rewriting to non-ground answer set programs on fi- program [Zhou, 2014]. Given that the unfolding transforma- nite structures. tion is exponential in the worst case, an exponential blow- up may occur in the unfolding-based rewriting. One source for this blow-up is from that unfolding can be applied on 1 Introduction all atoms in the given disjunctive program. However, it has Disjunctive logic programs extend normal logic programs by not been explored how the efficiency of unfolding can be im- permitting disjunctions to appear in rule heads, which in- proved in the context of disjunctive answer set programming. creases the expressive power of logic programs under the an- Especially, it is unclear if the unfolding transformation can be swer set semantics [Baral, 2003] and brings computational applied on only some atoms that are necessary. penalty as well. In particular, deciding whether a disjunctive A natural idea is to apply unfolding on atoms of the pro- P program has an answer set is ⌃2 -complete [Eiter and Got- gram one by one until the resulting program is HCF. However, tlob, 1995] while deciding whether a normal program has unfolding may introduce new head-cycles and increase the an answer set is NP-complete. In practice, significant per- set of atoms to be unfolded. Hence, generally speaking, one formance difference can be observed after adding disjunctive may need to unfold at all the atoms to achieve an HCF pro- rules into normal programs, even if only a very small number gram, which indeed results in a negative program as in [Zhou, of disjunctive rules are involved. Meanwhile, it is arguable 2014]. In this paper, we show that we can restrict unfolding that many real-life problems can be characterized by pro- to “culprit” atoms, i.e., atoms that prevent the initial program grams consisting of a large number of normal rules and a few to be HCF, and ignore new atoms that prevent the resulting disjunctive rules. Hence, an interesting question is whether program to be HCF. We prove that the result of our restricted unfolding, although not necessarily HCF, can be equivalently ⇤Corresponding author transformed to a normal program via shifting. 1130 This result is of both theoretical and practical interests—it A set S of atoms satisfies a rule r if S p p/S = not only shows that the complexity penalty is closely tied to tr(r) in the sense of propositional logic.[S{¬satisfies| 2 a}| pro- these “culprit” atoms, but also suggests the practicality of our gram ⇧ if S satisfies every rule in ⇧. rewriting approach on disjunctive programs that are “almost” The answer sets of a DLP are defined in [Gelfond and HCF, i.e., with only a small number of “culprit” atoms. We Lifschitz, 1991]. Given a DLP ⇧ and a set S of atoms, the make the following contributions: Gelfond-Lifschitz reduct of ⇧ on S, written ⇧S, is obtained We provide an answer-set-preserving rewriting from a from ⇧ by deleting: • disjunctive program to a normal program by only un- 1. each rule that has a formula not p in its body with p S, 2 folding at “culprit” atoms and shifting the resulting pro- 2. all formulas of the form not p in the bodies of the re- gram, which is efficient for “almost” HCF programs. maining rules. If ⇧0 is a normal program rewritten from a disjunctive • A set S of atoms is an answer set of ⇧ if S is a minimal set program ⇧ by restricted unfolding and shifting, we show satisfying ⇧S. We use AS (⇧) to denote the set of answer sets that the computation of answer sets for ⇧0 can be im- of ⇧. proved. In particular, although the rewriting may intro- duce new loops to ⇧0, we only need to consider loops 2.2 Loops and Loop Formulas constructed from loops of ⇧ for computing answer sets Lee and Lifschitz [2003] extended the notions of loops and of ⇧0. This result suggests that although our rewriting loop formulas [Lin and Zhao, 2004] to DLPs. For a DLP ⇧, to a normal logic program may lead to an exponential the positive dependency graph of ⇧, written G⇧, is the di- blow-up, there is not necessarily a blow-up in loop for- rected graph whose vertices are atoms in ⇧, and there is an mulas. arc from p to q if there is a rule r ⇧ such that p head(r) As another application of the rewriting, we present an and q body+(r). A set L of atoms2 is a loop of2 ⇧ if the • 2 anytime algorithm to compute answer sets of a disjunc- L-induced subgraph of G⇧ is strongly connected. Note that, tive program ⇧ by calling solvers for normal logic pro- every singleton whose atom occurs in ⇧ is also a loop of ⇧. grams. In each iteration, the algorithm outputs the an- We use Loop(⇧) to denote the set of loops of ⇧. swer sets of the shifted program ⇧0 obtained from ⇧ by Given a DLP ⇧ and a loop L of ⇧, a rule r ⇧ is an unfolding at a set A of atoms. The algorithm will output external support of L under ⇧ if head(r) L 2= and + \ 6 ; more answer sets of ⇧ when a larger A is applied. L body (r)= . Let R−(L, ⇧) be the set of external sup- \ L ; ⇧ (conjunctive) loop formula L At last, we extend the rewriting to non-ground answer port rules of under . The of ⇧ LF (L, ⇧) • set programs on finite structures. As a result, we are able under , written , is the following implication: to compute answer sets of some first-order disjunctive logic programs by a solver for first-order normal pro- p body(r) q . grams such as [Asuncion et al., 2012]. ⊃ 0 ^ ¬ 1 p L r R (L,⇧) q head(r) L ^2 2 _− 2 ^ \ @ A 2 Preliminaries Theorem 1 (Theorem 1 in [Lee and Lifschitz, 2003]) For a DLP ⇧ and a set S of atoms, S is an an- 2.1 Disjunctive Logic Programs swer set of ⇧ iff S p p/S is a model of [{¬ | 2 } We consider fully finite logic programs based on a proposi- tr(⇧) L Loop(⇧) LF (L, ⇧). tional language until Section 7. A (disjunctive) logic pro- ^ 2 gram (DLP) is aL finite set of (disjunctive) rules of the form 2.3 UnfoldingV and Shifting We first review the unfolding transformation [Gergatsoulis, a1 ak ak+1,...,am, not am+1,...,not an. (1) _···_ 1997; Brass and Dix, 1997]. where n m k 1 and a1,...,an are atoms. If k =1, it ≥ ≥ ≥ Definition 1 (Elementary unfolding) Let r1, r2 be two is a normal rule; if k = m, it is a negative rule; if m = n, it is + rules and there is an atom a head(r1) body (r2). a positive rule.Anormal logic program (NLP) is a finite set 2 \ The rule obtained by elementary unfolding r2 using r1 at of normal rules and a negative logic program (resp.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us