Enhancing Efficiency and Expressiveness in Answer Set Programming - - PowerPoint PPT Presentation
Enhancing Efficiency and Expressiveness in Answer Set Programming - - PowerPoint PPT Presentation
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
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:
a1 ∨ · · · ∨ an :− b1, · · · , bk, not bk+1, · · · , not bm.
- ai, bj may contain variables
- ai, bj 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)
reached(X) :− start(X). reached(X) :− in ham( ,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
Diagnosis Frontend Inheritance Frontend Brave/Cautious Frontend User Interface Frontend True Negation Filtering Output Further Frontends
Objectivity
Oracle File System Grounding Intelligent Model Generator Model Checker Frontend Planning Program Ground DLV kernel
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
DetCons Choice
empty stack
PTs exist yes no Exit Model Check
inconsistency
Backtracking Output DS Linear Stack
pop 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
T true M must-be-true U undefi ned F false M T U F Knowledge Truth 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 PT atoms DetCons DetCons DetCons
- early detection of inconsistencies
- a lot of information for the heuristic function
- expensive computation
Enhancing Efficiency and Expressiveness in ASP Systems 12
Heuristics Definitions
- h1: Minimize “short” unsatisfi ed clauses, balanced by an additive and
multiplicative criterion.
- h2: Minimize undefi ned atoms, balanced by a “min/max” criterion.
- h3: Minimize must-be-true atoms of increasing level, maximize satisfi ed
clauses, no balancing.
- h4: Balanced version of h3, 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:
:∼ L1, · · · , Lm, not Lm+1, · · · , not Ln. [w : l] Li :
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(X,Y) :− arc cost(X,Y,C). :∼ 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
- 1
{ auth(bob) :− not auth(ann). (r1) auth(ann) ∨ auth(tom) :− not ¬auth(alice). } (r2)
- 2 : o1
{ ¬auth(alice). } (r3)
- 3 : o1
{ ¬auth(bob). } (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
Input: Hypotheses, a theory, observations H,T,O Options: Semantics of explanation (Abduction, Consistency) Minimality criterion Output: A (minimal) set of hypotheses ∆ ⊆ H 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
- f ASP systems
– Weak Constraints – Inheritance and other front-ends
- Implementation and Experimentation