Grasp: a Graph Based ASP-Solver and Justification System

Grasp: a Graph Based ASP-Solver and Justification System

grASP: A Graph Based ASP-Solver and Justification System Fang Li1∗ , Huaduo Wang1 , Gopal Gupta1 1University of Texas at Dallas ffang.li, huaduo.wang, [email protected] Abstract of goals is explicitly represented as a node which allows arbi- trary answer set programs to be uniformly represented. Our Answer set programming (ASP) is a popular representation preserves causal relationships allowing for jus- nonmonotonic-logic based paradigm for knowl- tification for each literal in the answer set to be elegantly edge representation and solving combinatorial found. Performance results from an implementation are also problems. Computing the answer set of an ASP reported. Our work paves the way for computing answer sets program is NP-hard in general, and researchers without grounding a program. have been investing significant effort to speed it up. Compared to SAT solver based implementations, graph- The majority of current ASP solvers employ SAT based implementations of ASP have not been well studied. solver-like technology to find these answer sets. As Very few researchers have investigated graph-based tech- a result, justification for why a literal is in the an- niques. NoMoRe system [Anger et al., 2001] represents ASP swer set is hard to produce. There are dependency programs with a block graph (a labeled graph) with meta- graph based approaches to find answer sets, but due information, then computes the A-coloring (non-standard to the representational limitations of dependency graph coloring with two colors) of that graph to obtain an- graphs, such approaches are limited. We propose swer sets. Another approach [Konczak et al., 2005] uses rule a novel dependency graph-based approach for find- dependency graph (nodes for rules, edges for rule dependen- ing answer sets in which conjunction of goals is cies) to represent ASP programs, then performs graph color- explicitly represented as a node which allows ar- ing algorithm to determine which rule should be chosen to bitrary answer set programs to be uniformly rep- generate answer sets. Another group [Linke and Sarsakov, resented. Our representation preserves causal re- 2005] proposed an hybrid approach which combines different lationships allowing for justification for each lit- kinds of graph representations that are suitable for ASP. The eral in the answer set to be elegantly found. Per- hybrid graph uses both rules and literals as nodes, while edges formance results from an implementation are also represent dependencies. It also uses the A-coloring technique reported. Our work paves the way for computing to find answer sets. answer sets without grounding a program. All of the above approaches were well designed, but their graph representations are complex as they all rely on extra information to map the ASP elements to nodes and edges 1 Introduction of a graph. In contrast, our approach uses a much simpler Answer set programming (ASP) [Gelfond and Lifschitz, graph representation, where nodes represent literals and an 1988; Marek and Truszczynski,´ 1999; Eiter et al., 2000; edge represent the relationship between the nodes it connects. arXiv:2104.01190v1 [cs.AI] 2 Apr 2021 Simons et al., 2002] is a popular nonmonotonic-logic based Since this representation faithfully reflects the casual relation- paradigm for knowledge representation and solving combi- ships, it is capable of producing causal justification for goals natorial problems. Computing the answer set of an ASP pro- entailed by the program. gram is NP-hard in general, and researchers have been in- vesting significant effort to speed it up. Most ASP solvers 2 Background employ SAT solver-like technology to find these answer sets. 2.1 Answer Set Programming As a result, justification for why a literal is in the answer set is hard to produce. There are dependency graph (DG) based ap- Answer Set Programming (ASP) is a declarative paradigm proaches to find answer sets, but due to the representational that extends logic programming with negation-as-failure. limitations of dependency graphs, such approaches are lim- ASP is a highly expressive paradigm that can elegantly ex- ited. In this paper we propose a novel dependency graph- press complex reasoning methods, including those used by based approach for finding answer sets in which conjunctions humans, such as default reasoning, deductive and abduc- tive reasoning, counterfactual reasoning, constraint satisfac- ∗Contact Author tion [Baral, 2003; Gelfond and Kahl, 2014]. Figure 1: Dependency Graph for Programs 1 & 2 (a) CNR for Program 1 (b) CNR for Program 2 Figure 2: CNRs for program 1 & 2 ASP supports better semantics for negation (negation as failure) than does standard logic programming and Prolog. An ASP program consists of rules that look like Prolog rules. The semantics of an ASP program Π is given in terms of the answer sets of the program ground(Π), where ground(Π) is the program obtained from the substitu- tion of elements of the Herbrand universe for variables in Π [Baral, 2003]. Rules in an ASP program are of the form: p :- q1, ..., qm, not r1, ..., not rn. (1) Figure 3: CNR-DG Transformation where m ≥ 0 and n ≥ 0. Each of p and qi (8i ≤ m) is a literal, and each not r (8j ≤ n) is a naf-literal (not is a j To make conjunctive relationships representable by de- logical connective called negation-as-failure or default nega- pendency graphs, we first transform it slightly to come up tion). The literal not r is true if proof of r fails. Negation j j with a novel representation method. This new representation as failure allows us to take actions that are predicated on fail- method, called conjunction node representation (CNR) graph, ure of a proof. Thus, the rule r :- not s. states that uses an artificial node to represent conjunction of sub-goals in r can be inferred if we fail to prove s. Note that in Rule the body of a rule. This conjunctive node has a directed edge 1, p is optional. Such a headless rule is called a constraint, that points to the rule head (Figure 2). which states that conjunction of qi’s and not rj’s should yield false. Thus, the constraint :- u, v. states that u The conjunction node, which is colored black, refers to the and v cannot be both true simultaneously in any model of the conjunctive relation between the in-coming edges from nodes program (called an answer set). representing subogals in the body of a rule. Note that a CNR The declarative semantics of an Answer Set Program P graph is not a conventional dependency graph. [ is given via the Gelfond-Lifschitz transform Baral, 2003; Converting CNR Graph to Dependency Graph Gelfond and Kahl, 2014] in terms of the answer sets of the program ground(Π). More details on ASP can be found Since CNR graph does not follow the dependency graph con- elsewhere [Baral, 2003; Gelfond and Kahl, 2014]. vention, we need to convert it to a proper dependency graph in order to perform dependency graph-based reasoning. We 2.2 Dependency Graph use a simple technique to convert a CNR graph to an equiva- lent conventional dependency graph. We negate all in-edges A dependency graph [Linke and Sarsakov, 2005] uses nodes and out-edges of the conjunction node. This process essen- and directed edges to represent dependency relationships of tially converts a conjunction into a disjunction. Once we do an ASP rule. that we can treat the conjunction node as a normal node in a Definition 1. The dependency graph of a program is defined dependency graph. As an example, Figure 3 shows the CNR on its literals s.t. there is a positive (resp. negative) edge from graph to dependency graph transformation for Program 3: p to q if p appears positively (resp. negatively) in the body of a rule with head q. %% program 3 p : − q , not r . Conventional dependency graphs are not able to represent ASP programs uniquely. This is due to the inability of depen- This transformation is a simple application of De Morgan’s dency graphs to distinguish between non-determinism (mul- law. The rule in program 3 represents: tiple rules defining a proposition) and conjunctions (multiple conjunctive sub-goals in the body of a rule) in logic programs. p : − C . C : − q , not r . For example, the following two programs have identical de- pendency graphs (Figure 1). The transformation produces the equivalent rules: %% program 1 p : − not C . C : − not q . C : − r . p : − q , not r , not p . %% program 2 Since conjunction nodes are just helper nodes which allow p : − q , not p . p : − not r . us to perform dependency graph reasoning, we don’t report them in the final answer set. p : − not q . q : − not p . then breaking this negative even cycle will produce two an- swer sets: fpg and fqg: one in which node p is assigned true and q false, and the other the opposite. Theorem 3. If C is a negative odd cycle, then the program π is satisfiable iff there is at least one node assigned true in C. (a) Program 4 (b) Program 5 If we have the graph corresponding to: Figure 4: Constraint DG p : − not q . q : − not r . r : − not p . then there will be no models unless one or more of p, q, or r Constraint Representation are true through other rules and are assigned the value True. ASP also allows for special types of rules called constraints. There are two ways to encode constraints: (i) headed con- 3 A Graph Algorithm for Answer Sets straint where negated head is called directly or indirectly in We have developed the grASP graph-based algorithm for the body (e.g., Program 4), and (ii) headless constraints (e.g., finding answer sets.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 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