0 Enhancing Efficiency and Expressiveness in Answer Set Programming Systems Wolfgang Faber faber@kr.tuwien.ac.at
Enhancing Efficiency and Expressiveness in ASP Systems 1 Agenda • Answer Set Programming – Syntax and Semantics • Answer Set Computation – Computing Deterministic Consequences – Choice Heuristics • Experiments • Weak Constraints • Front-ends – Inheritance – Diagnosis • Conclusions
Enhancing Efficiency and Expressiveness in ASP Systems 2 Answer Set Programming – Syntax Sets of clauses of the following form: a 1 ∨ · · · ∨ a n : − b 1 , · · · , b k , not b k +1 , · · · , not b m . • a i , b j may contain variables • a i , b j may be of the form ¬ x (true/strong/explicit negation) • Rules, Facts, Integrity Constraints
Enhancing Efficiency and Expressiveness in ASP Systems 3 Answer Set Programming – Semantics • Defi ned on the Ground Program • Answer Sets: Consistent Sets of Ground Generalized Atoms • Satisfy all clauses: Whenever the body is true, the head must be true as well. • Subset Minimality • Stability through Gelfond-Lifschitz-Transformation
Enhancing Efficiency and Expressiveness in ASP Systems 4 Example: Hamiltonian Path Input: vertex(V), arc(V1,V2), start(V) : − start(X). reached(X) : − in ham( ,X). reached(X) in ham(X,Y) ∨ out ham(X,Y) : − reached(X), arc(X,Y). : − in ham(X,Y), in ham(X,Y1), Y != Y1. : − in ham(X,Y), in ham(X1,Y), X != X1. : − vertex(X), not reached(X).
Enhancing Efficiency and Expressiveness in ASP Systems 5 Answer Set Computation – DLV Architecture User Interface Diagnosis Inheritance True Negation Brave/Cautious Planning Further Frontend Frontend Frontend Frontend Frontend Frontends DLV kernel Intelligent Ground File Grounding Program System Oracle Model Model Checker Generator Objectivity Filtering Output
Enhancing Efficiency and Expressiveness in ASP Systems 6 Model Generator • Computes candidate Answer Sets • Alternation: – Computation of Deterministic Extension – Choice • until no choice is left
Enhancing Efficiency and Expressiveness in ASP Systems 7 Model Generator – Architecture inconsistency Backtracking DetCons pop Stack no Model Check empty PTs exist stack Output yes Linear DS Exit Choice push
Enhancing Efficiency and Expressiveness in ASP Systems 8 Supporting Rules A rule r supports an atom a w.r.t. an Answer Set A if 1. the body of r is true in A and 2. a is the only atom in the head of r , which is true in A . Theorem: For any atom a in an answer set A of a program P , there exists at least one rule r ∈ P which supports a .
Enhancing Efficiency and Expressiveness in ASP Systems 9 Four Truthvalues Truth T T true M M must-be-true U undefi ned U F false F Knowledge Non-standard truthvalue must-be-true for atoms which are known to be true in any extending answer set, but which miss a supporting rule.
Enhancing Efficiency and Expressiveness in ASP Systems 10 Deterministic Consequences Make inferences based on • rule satisfaction • supporting rules for a must-be-true atom • number of potentially supporting rules for atoms All these inferences are local with respect to the rules, in which an atom which changed truthvalue occurs, and are effi ciently implemented.
Enhancing Efficiency and Expressiveness in ASP Systems 11 Heuristics Dynamic Heuristics DetCons DetCons DetCons DetCons PT atoms • early detection of inconsistencies • a lot of information for the heuristic function • expensive computation
Enhancing Efficiency and Expressiveness in ASP Systems 12 Heuristics Definitions • h 1 : Minimize “short” unsatisfi ed clauses, balanced by an additive and multiplicative criterion. • h 2 : Minimize undefi ned atoms, balanced by a “min/max” criterion. • h 3 : Minimize must-be-true atoms of increasing level, maximize satisfi ed clauses, no balancing. • h 4 : Balanced version of h 3 , using sum.
Enhancing Efficiency and Expressiveness in ASP Systems 13 Benchmarks • 3SAT: Satisfi ability of propositional formulae • HAMPATH: Existence of a Hamiltonian Path • BLOCKSWORLD: Plan-fi nding in a well-known AI setting • STRATCOMP: Deciding whether some companies are strategic
Enhancing Efficiency and Expressiveness in ASP Systems 14
Enhancing Efficiency and Expressiveness in ASP Systems 15 Optimizations for Computing Heuristics 1. Criterion when the heuristic values of two literals will be equal. 2. First-level heuristics: • A more effi ciently computable heuristics selects a subset of the choice candidates. • On this subset, the more expensive heuristics is evaluated.
Enhancing Efficiency and Expressiveness in ASP Systems 16
Enhancing Efficiency and Expressiveness in ASP Systems 17 Weak Constraints Clauses of the following form: : ∼ L 1 , · · · , L m , not L m +1 , · · · , not L n . [ w : l ] L i : classical literals w ≥ 1 : integer weight l ≥ 1 : integer priority level Informal semantics: violation of a weak constraint causes a cost. Answer sets are those answer sets of the weak-constraint-free program, which minimize the sum of weights of violated weak constraints along the priority levels.
Enhancing Efficiency and Expressiveness in ASP Systems 18 Example: Traveling Salesperson Input: vertex(V), arc cost(V1,V2,C), start(V) Program: Hamiltonian Path plus : − arc cost(X,Y,C). arc(X,Y) : ∼ in ham(X,Y), arc cost(X,Y,C). [C:1]
Enhancing Efficiency and Expressiveness in ASP Systems 19 Inheritance Objects — object identifi er, inheritance relation, rules { auth(bob) : − o1 not auth(ann). (r1) auth(ann) ∨ auth(tom) : − ¬ auth(alice). } (r2) not { ¬ auth(alice). } o2 : o1 (r3) { ¬ auth(bob). } o3 : o1 (r4) Informal semantics: • Overriding of literals and rules . • All rules must be satisfi ed or overridden. • Minimality, stability.
Enhancing Efficiency and Expressiveness in ASP Systems 20 Diagnosis Hypotheses, a theory, observations � H,T,O � Input: Options: Semantics of explanation (Abduction, Consistency) Minimality criterion A (minimal) set of hypotheses ∆ ⊆ H Output: explaining the observations by the theory T O
Enhancing Efficiency and Expressiveness in ASP Systems 21 Further Front-ends • Planning Front-End – New action language K – Optimistic and secure planning • SQL3 • Prioritized logic programs – Preferred Answer Sets – Weakly Preferred Answer Sets • plp by Delgrande/Schaub/Tompits (priorities) • nlp by Pearce/Sarsakov/Schaub/Tompits/Woltran (nested expressions)
Enhancing Efficiency and Expressiveness in ASP Systems 22 Conclusions • Optimization techniques for ASP systems – Truthvalue “M” – Heuristics • Enhancing Expressiveness and Knowledge Modeling Features of ASP systems – Weak Constraints – Inheritance and other front-ends • Implementation and Experimentation
Recommend
More recommend