1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)

Slides:



Advertisements
Similar presentations
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Advertisements

UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Effective Propositional Reasoning CSE 473 – Autumn 2003.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Generating Hard Satisfiability Problems1 Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Methods for SAT- a Survey Robert Glaubius CSCE 976 May 6, 2002.
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
Methods of Proof Chapter 7, second half.
AAAI00 Austin, Texas Generating Satisfiable Problem Instances Dimitris Achlioptas Microsoft Carla P. Gomes Cornell University Henry Kautz University of.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Instance Hardness and Phase Transitions.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Knowledge Representation II (Inference in Propositional Logic) CSE 473.
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Logical Agents. Knowledge bases Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): 
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Quasigroups Defaults Foundations of AI. Given an N X N matrix, and given N colors, color the matrix in such a way that: -all cells are colored; - each.
Boolean Satisfiability and SAT Solvers
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
1 Problems in AI Problem Formulation Uninformed Search Heuristic Search Adversarial Search (Multi-agents) Knowledge RepresentationKnowledge Representation.
Propositional Logic: Methods of Proof (Part II) This lecture topic: Propositional Logic (two lectures) Chapter (previous lecture, Part I) Chapter.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
First-Order Logic and Inductive Logic Programming.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Review of Propositional Logic Syntax
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
CS666 AI P. T. Chung Logic Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS 4700: Foundations of Artificial Intelligence
Inference in Propositional Logic (and Intro to SAT)
Inference and search for the propositional satisfiability problem
CS 4700: Foundations of Artificial Intelligence
EA C461 – Artificial Intelligence Logical Agent
Intro to Computational Complexity
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21
Logical Agents Reading: Russell’s Chapter 7
CS 416 Artificial Intelligence
Artificial Intelligence: Agents and Propositional Logic.
Methods of Proof Chapter 7, second half.
Propositional Logic: Methods of Proof (Part II)
Presentation transcript:

1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)

2 Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof = a sequence of inference rule applications Can use inference rules as operators in a standard search algorithm Different types of proofs –Model checking truth table enumeration (always exponential in n) improved backtracking, e.g., Davis--Putnam-Logemann-Loveland (DPLL) (including some inference rules) heuristic search in model space (sound but incomplete) e.g., min-conflicts-like hill-climbing algorithms Intro to logic Current module Previous module

3 Satisfiability

Propositional Satisfiability problem Satifiability (SAT): Given a formula in propositional calculus, is there a model (i.e., a satisfying interpretation, an assignment to its variables) making it true? We consider clausal form, e.g.: ( a   b   c ) AND ( b   c) AND ( a  c) possible assignments SAT: prototypical hard combinatorial search and reasoning problem. Problem is NP-Complete. (Cook 1971) Surprising “power” of SAT for encoding computational problems.

5 Satisfiability as an Encoding Language

Encoding Latin Square Problems in Propositional Logic Variables: Each variables represents a color assigned to a cell. Clauses: Some color must be assigned to each cell No color is repeated in the same row No color is repeated in the same column (example Row i Color k) (example Colum j Color k) (clause of length n); n 2 (sets of negative binary clauses); n(n-1)/2 n n (sets of negative binary clauses); n(n-1)/2 n n

3D Encoding or Full Encoding This encoding is based on the cubic representation of the quasigroup: each line of the cube contains exactly one true variable; Variables: Same as 2D encoding. Clauses: Same as the 2 D encoding plus: –Each color must appear at least once in each row; –Each color must appear at least once in each column; –No two colors are assigned to the same cell;

8 Dimacs format At the top of the file is a simple header. p cnf Each variable should be assigned an integer index. Start at 1, as 0 is used to indicate the end of a clause. The positive integer a positive literal, whereas a negative interger represents a negative literal. Example  (  x1  x7)

9 Extended Latin Square 2x2 p cnf order /2 3/4 5/6 7/8 A cell gets at most a colorNo repetition of color in a column No repetition of color in a rowA cell gets a color A given color goes in each column A given color goes in each row 1 – cell 11 is red 2 – cell 11 is green 3 – cell 12 is red 4 – cell 12 is green 5 – cell 21 is red 6 – cell 21 is green 7 – cell 22 is red 8 – cell 22 is green

10 Significant progress in Satisfiability Methods Software and hardware verification – complete methods are critical - e.g. for verifying the correctness of chip design, using SAT encodings Current methods can verify automatically the correctness of > 1/7 of a Pentium IV. Going from 50 variable, 200 constraints to 1,000,000 variables and 5,000,000 constraints in the last 10 years Applications: Hardware and Software Verification Planning, Protocol Design, etc.

11 Model Checking

Turing Award Source: Slashdot

13 A “real world” example

i.e. ((not x 1 ) or x 7 ) and ((not x 1 ) or x 6 ) and … etc. Bounded Model Checking instance:

(x 177 or x 169 or x 161 or x 153 … or x 17 or x 9 or x 1 or (not x 185 )) clauses / constraints are getting more interesting… 10 pages later: …

pages later: … !!! a 59-cnf clause…

Finally, 15,000 pages later: MiniSAT solver solves this instance in less than one minute. Note that:… !!!

18 Effective propositional inference

19 Effective propositional inference Two families of algorithms for propositional inference (checking satisfiability) based on model checking (which are quite effective in practice): Complete backtracking search algorithms DPLL algorithm (Davis, Putnam, Logemann, Loveland) Incomplete local search algorithms –WalkSAT algorithm

20 The DPLL algorithm Determine if an input propositional logic sentence (in CNF) is satisfiable. Improvements over truth table enumeration: 1.Early termination A clause is true if any of its literals is true. A sentence is false if any clause is false. 2.Pure symbol heuristic Pure symbol: always appears with the same "sign" in all clauses. e.g., In the three clauses (A   B), (  B   C), (C  A), A and B are pure, C is impure. Make a pure symbol literal true. 3.Unit clause heuristic Unit clause: only one literal in the clause The only literal in a unit clause must be true.

The DPLL algorithm Early terminationPure SymbolUnit Propagation Branch, recursive call

22 DPLL Basic algorithm for state-of-the-art SAT solvers;; Several enhancements: - data structures; - clause learning; - randomization and restarts; Check:

23 Learning in Sat

24 The WalkSAT algorithm Incomplete, local search algorithm Evaluation function: The min-conflict heuristic of minimizing the number of unsatisfied clauses Balance between greediness and randomness

25 The WalkSAT algorithm

26 Lots of solvers and information about SAT, theory and practice:

27 Computational Complexity of SAT How does an algorithm scale? Standard Algorithmic Approach: Too Pessimistic. Ideal Approach, but… What distribution? Analyzable Realistic Spectrum of hardness

28 SAT Complexity NP-Complete - worst-case complexity –(2 n possible assignments) “Average” Case Complexity (I) –Constant Probability Model – Goldberg 79; Goldberg et al 82 N variables; L clauses p - fixed probability of a variable in a clause (literals: 0.5 +/-) (i.e., average clause length is pN) Eliminate empty and unit clauses Empirically, on average, SAT can be easily solved - O(n 2 ) Key problem: easy distribution; random guesses find a solution in a constant number of tries Franco 86; Franco and Ho 88

29 Hard satisfiability problems Consider random 3-CNF sentences. e.g., (  D   B  C)  (B   A   C)  (  C   B  E)  (E   D  B)  (B  E   C) m = number of clauses n = number of symbols

30 SAT Complexity “Average” Case Complexity (II) –Fixed-clause Length Model – Random K-SAT Franco 86; –N variables; L clauses; K number of literals per clause Randomly choose a set of K variables per clause (literals: 0.5 +/-) –Expected time – O(2 n ) Can we provide a finer characterization beyond worst-case results? Typical Case Analysis

31 Typical-Case Complexity Typical-case complexity: a more detailed picture –Characterization of the spectrum of hardness of instances as we vary certain interesting instance parameters e.g. for SAT: clause-to-variable ratio. –Are some regimes easier than others? –What about a majority of the instances?

Selman et al. 92,96 Typical Case Analysis: 3 SAT All clauses have 3 literals Median Runtime

Hard problems seem to cluster near m/n = 4.3 (critical point) Median

Intuition At low ratios: –few clauses (constraints) –many assignments –easily found At high ratios: –many clauses –inconsistencies easily detected