Answer Set Programming vs CSP: Power of Constraint Propagation Compared Jia-Huai You ( 犹嘉槐 ) University of Alberta Canada.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
MBD and CSP Meir Kalech Partially based on slides of Jia You and Brian Williams.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
Logic.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
/425 Declarative Methods - J. Eisner1 Constraint Programming.
Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Constraint Satisfaction CSE 473 University of Washington.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
Solving Partial Order Constraints for LPO termination.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction Problems
Constraint Satisfaction
Constraint Satisfaction Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Constraint Satisfaction Problems
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems Slides by Prof WELLING.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Chapter 5 Constraint Satisfaction Problems
Constraint Satisfaction Problems (Chapter 6)
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Grand Challenge:
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
G51IAI Introduction to Artificial Intelligence
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
EXAMPLE: MAP COLORING. Example: Map coloring Variables — WA, NT, Q, NSW, V, SA, T Domains — D i ={red,green,blue} Constraints — adjacent regions must.
Constraint Satisfaction Problems Rich and Knight: 3.5 Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Lecture 5: Constraint Satisfaction Problems
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Constraint Satisfaction Problems
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (Chapter 6)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction
CS B551: Elements of Artificial Intelligence
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems
Artificial Intelligence
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Answer Set Programming vs CSP: Power of Constraint Propagation Compared Jia-Huai You ( 犹嘉槐 ) University of Alberta Canada

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

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)

Blocks World Planning AB C TABLE

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.

Example: 8-Queens Generate-and-test, 8 8 combinations

Example: Map Coloring WA NT SA Q NSW V T WA NT SA Q NSW V T

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

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

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.

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).

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

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

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

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

A CSP x y z support consistent

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. i=2 arc-consistency (AC) i=3 path-consistency (PC)

Maintaining AC x y z \ \ \ \ \ \

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

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

Lookahead Expand ( ) conflict

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.

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.

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

Direct Encoding Uniqueness rules Denial rules

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

Example xy z  Enforcing AC cannot remove any value.  How about lookahead?

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

Theorem 1 lookahead=AC+UP. Propagation Arc- Consistency(PAC)

Theorem 2 (i-1)-lookahead i-consistency

Support Encoding Uniqueness rules The same as direct encoding Support rules

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

Singleton arc-consistency(SAC)

Theorem 3 and 4 Lookahead=SAC SAC > PAC

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

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

Relationships Niemela ’ s encoding Uniquness rules The same as direct encoding Allowed rules Lookahead has the same pruning power under the direct encoding as under Niemela ’ s encoding

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

Experiments

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

When testing single literal, lookahead has the same prunning power under the direct encoding as well as Niemela ’ s encoding. When Testing (i-1)-tuples, lookahead captures i-consistency under direct encoding.

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

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

Comments and Questions?