Answer Set Programming vs CSP: Power of Constraint Propagation Compared

About This Presentation
Title:

Answer Set Programming vs CSP: Power of Constraint Propagation Compared

Description:

Graph Coloring in SAT (or ASP) Write clauses (or rules in ASP) that express the constraints: Any region must be colored with exactly one (but any) color. ... –

Number of Views:103
Avg rating:3.0/5.0
Slides: 45
Provided by: guohu1
Category:

less

Transcript and Presenter's Notes

Title: Answer Set Programming vs CSP: Power of Constraint Propagation Compared


1
Answer Set Programming vs CSP Power of
Constraint Propagation Compared
  • Jia-Huai You (???)
  • University of Alberta
  • Canada

2
Constraint Programming
  • Studies computational models for solving problems
    that can be expressed as constraints
  • Applications
  • -NP-hard problems
  • -Optimization
  • -Planning (PSPACE-complete), logistics,
    scheduling
  • -Combinatorial problems

3
Approaches to Constraint Programming
  • Constraint Satisfaction Problem (CSP)
  • (Maybe embedded in a programming language
    such as Constraint Logic Programming)
  • Propositional satisfiability (SAT)
  • Answer set programming (ASP)

4
Blocks World Planning
5
Planning Example Logistics World
  • There are two types of vehicles trucks and
    airplanes. Trucks are used to transport packages
    within a city, and airplanes to transport
    packages between airports.
  • The problem in this domain starts with a
    collection of packages at various locations in
    various cities, and the goal is to redistribute
    these packages to their destinations.

6
Example 8-Queens
Generate-and-test, 88 combinations
7
Example Map Coloring
8
Cryptarithmetic puzzles
  • The problem is to assign distinct (decimal)
    digits to letters so that adding two words yields
    the third. E.g.
  • S E N D M O R E M O N E Y
  • D O N A L D G E R A L D R O B E R T

9
Approaches to Constraint Programming
  • Constraint Satisfaction Problem (CSP)
  • Systems Constraint Logic Programming
  • Propositional Satisfiability (SAT)
  • Systems SAT solvers
  • Answer Set Programming (ASP)
  • Systems Smodels,

10
Graph Coloring in SAT (or ASP)
  • Write clauses (or rules in ASP) that express the
    constraints
  • Any region must be colored with exactly one (but
    any) color.
  • No model (or answer set in case of ASP) may have
    two (distinct) adjacent regions colored with the
    same color.

11
Graph Coloring in ASP
  • coloring(N,C) ? node(N),color(C),
  • not other_color(N,C).
  • other_color(N,C) ? node(N),color(C),
  • color(C), C\C,
    coloring(N,C).
  • hasColor(N) ? coloring(N,C), color(C).
  • ? node(N),node(N),color(C), edge(N,N),
  • coloring(N,C), coloring(N,C).

12
Contents
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in ASP
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

13
Motivation
  • Constraint Satisfaction Problem(CSP)
  • Maintaining local consistency
  • SAT solver or answer set programming
  • Unit propagation, lookahead
  • Pruning power comparison

14
Structure
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in ASP
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

15
Constraint Satisfaction Problem(CSP)
  • CSP
  • Variable set
  • Domain set
  • Constraint set
  • Instantiation

16
A CSP
17
i-consistency
  • A CSP is i-consistent iff given any consistent
    assignment of any i-1 variables, there exists an
    assignment of any ith variable such that the i
    values taken together satisfy all of the
    constraints among the i variables.
  • i2 arc-consistency (AC)
  • i3 path-consistency (PC)

18
Maintaining AC
x
y
\
\
z
19
Structure
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in Smodels
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

20
Lookahead in Smodels
  • Answer set program
  • Stable model (answer set) of

21
Lookahead
conflict
22
Propagation rules
  • 1. Adds the head of a rule to A if the
    body is true in A.
  • 2. If there is no rule with h as the head whose
    body is not false w.r.t A, then add not h to A.

23
Propagation rules
  • 3. If h belongs to A, the only rule with
    h as the head must have its body true.
  • 4. If the head of a rule is false in A, the body
    must be false.

24
Structure
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in Smodels
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

25
Direct Encoding
  • Uniqueness rules
  • Denial rules

26
Lookahead vs AC
  • The solution of a CSP corresponds to the stable
    model of the ASP.
  • Does Lookahead AC?

27
Example
  • Enforcing AC cannot remove any value.
  • How about lookahead?

28
Unique value propagation(UP)
which is
  • Generate an superset of

29
Theorem 1
  • lookaheadACUP.

Propagation Arc-Consistency(PAC)
30
Theorem 2
  • (i-1)-lookahead i-consistency

31
Support Encoding
  • Uniqueness rules
  • The same as direct encoding
  • Support rules

32
Under support encoding
  • Does the pruning power of lookahead equal to that
    of PAC?

33
Singleton arc-consistency(SAC)
34
Theorem 3 and 4
  • LookaheadSAC
  • SAC gt PAC

35
Theorem 5
  • 2-lookahead SRPC
  • Restricted path consistency(RPC)
  • Check the unique support pair
  • Singleton RPC(SRPC)
  • Restrict the domain to be a single value

36
Structure
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in Smodels
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

37
Relationships
  • Niemelas encoding
  • Uniquness rules
  • The same as direct encoding
  • Allowed rules
  • Lookahead has the same pruning power under the
    direct encoding as under Niemelas encoding

38
Relationships
  • Performance of the direct and support encodings.
  • Problem set
  • 10 variables
  • Domain size of 30
  • 20 constraints

39
Experiments
40
Structure
  • Motivation
  • Maintaining local consistencies in CSP
  • Lookahead in Smodels
  • Pruning power comparison
  • Relationships between encodings
  • Conclusions

41
Conclusions
  • When testing single literal, lookahead has the
    same prunning power under the direct encoding as
    well as Niemelas encoding.
  • When Testing (i-1)-tuples, lookahead captures
    i-consistency under direct encoding.

42
Conclusions
  • Under the support encoding, lookahead has the
    same pruning power as SAC.
  • Under support encoding, when testing pair of
    literals, lookahead captures SRPC.

43
Conclusions
  • Lookahead performs more efficiently under the
    support encoding than under the direct encoding.

44
  • Thank You!

Comments and Questions?
Write a Comment
User Comments (0)
About PowerShow.com