Advanced Artificial Intelligence, DT4048

Size: px
Start display at page:

Download "Advanced Artificial Intelligence, DT4048"

Transcription

1 Advanced Artificial Intelligence, DT4048 Part 5 Boolean Satisfiability Federico Pecora federico.pecora@oru.se Center for Applied Autonomous Sensor Systems (AASS) Örebro University, Sweden

2 What is Boolean Satisfiability? George Boole ( ) introduces a way to reduce propositional logic to algerbaic manipulation Propositional logic had been studies since Aristotle provides a foundation for formalizing deductive reasoning today, used to automate such reasoning in AI 2015 F. Pecora / Örebro University aass.oru.se 2 / 49

3 What is Boolean Satisfiability? George Boole ( ) introduces a way to reduce propositional logic to algerbaic manipulation Propositional logic had been studies since Aristotle provides a foundation for formalizing deductive reasoning today, used to automate such reasoning in AI Example [T. Walsh lecture slides, 2002]: you are instructed to organizing the embassy ball the ambassador wants to invite Peru, or exclude Qatar the vice-ambassador wants Qatar, Romania, or both recent diplomatic events make it impossible to invite both Romania and Peru Who do you invite? 2015 F. Pecora / Örebro University aass.oru.se 2 / 49

4 What is Boolean Satisfiability? the ambassador wants to invite Peru, or exclude Qatar P Q the vice-ambassador wants Qatar, Romania, or both Q R impossible to invite both Romania and Peru (R P) Variables: meaningful parts of the problem (P, Q, R) Domains: possible values of variables (T, F) Constraints: conditions restricting possible mutual assignments φ = (P Q) (Q R) ( (R P)) = (P Q) (Q R) ( R P) 2015 F. Pecora / Örebro University aass.oru.se 3 / 49

5 What is Boolean Satisfiability? the ambassador wants to invite Peru, or exclude Qatar P Q the vice-ambassador wants Qatar, Romania, or both Q R impossible to invite both Romania and Peru (R P) Variables: meaningful parts of the problem (P, Q, R) Domains: possible values of variables (T, F) Constraints: conditions restricting possible mutual assignments φ = (P Q) (Q R) ( (R P)) = (P Q) (Q R) ( R P) Constraint Satisfaction Problem: find an assignment of values to variables that satisfies all constraints {P = T, Q = T, R = F} 2015 F. Pecora / Örebro University aass.oru.se 3 / 49

6 Boolean Satisfiability (SAT) Instance: a set U of variables and a collection C of clauses over the variables U variables: all boolean, i.e., domains are all {, } clauses: are disjunction or conjunction of literals literals: a variable or its negation conjunctive normal form (CNF): formula is conjunction of clauses, clauses are disjunctions of literals, e.g., (P Q R) (R S) disjunctive normal form (DNF): formula is disjunction of clauses, clauses are conjunction of literals, e.g., (P Q R) (R S) Question: is there a model for C? model: truth assignment to variables that satisfies all clauses (if CNF) or at least one clause (if DNF) 2015 F. Pecora / Örebro University aass.oru.se 4 / 49

7 Boolean Satisfiability (SAT) Recall a few important opertions with booleans (P Q) P Q (De Morgan s law) (P Q) P Q (De Morgan s law) P Q P Q (implication) P Q (P Q) (Q P) (logical equivalence) P Q Q P (commutative law) P Q Q P (commutative law) P (Q R) (P Q) R (associative law) P (Q R) (P Q) R (associative law) P (Q R) (P Q) (P R) (distributive law) P (Q R) (P Q) (P R) (distributive law) P P, P P P (identity law) 2015 F. Pecora / Örebro University aass.oru.se 5 / 49

8 Clausal Normal Form DNF and CNF, as normal forms, are useful for automated problem solving In both CNF and DNF, negation ( ) can only be used as part of a literal (i.e., it can only precede a propositional variable) Every propositional formula can be converted to an equivalent formula in CNF or DNF k-cnf: each clause has k lilterals k-sat: the problem of finding a model for a k-cnf formula 2015 F. Pecora / Örebro University aass.oru.se 6 / 49

9 k-sat and Complexity problem complexity NP-Hard NP-Complete 3-SAT NP? = P 2-SAT 2-SAT P 2-SAT can be solved in polynomial time 3-SAT NP sol(3-sat) can be verified in polynomial time 3-SAT NP-Complete [Cook, 1971, Garey and Johnson, 1979] all problems in NP can be reduced to 3-SAT in polynomial time 2015 F. Pecora / Örebro University aass.oru.se 7 / 49

10 k-sat and Complexity problem complexity NP-Hard NP-Complete 3-SAT NP? = P 2-SAT 2-SAT P 2-SAT can be solved in polynomial time 3-SAT NP sol(3-sat) can be verified in polynomial time 3-SAT NP-Complete [Cook, 1971, Garey and Johnson, 1979] all problems in NP can be reduced to 3-SAT in polynomial time If a polinomial time algorithm for 3-SAT is found, this algorithm will solve all problems in NP (and more... )! 2015 F. Pecora / Örebro University aass.oru.se 7 / 49

11 3-SAT and Complexity of CSP Recall that π NP-Complete iff sol(π) can be verified in polynomial time all problems in NP can be reduced to π Now we know that 3-SAT is NP-Complete what does this say about CSP? 2015 F. Pecora / Örebro University aass.oru.se 8 / 49

12 3-SAT and Complexity of CSP Recall that π NP-Complete iff sol(π) can be verified in polynomial time all problems in NP can be reduced to π Now we know that 3-SAT is NP-Complete what does this say about CSP? all problems in NP can be reduced to 3-SAT 3-SAT can be reduced to CSP (because 3-SAT is a CSP) a solution to a CSP can be verified in polynomial time (just check all constraints) 2015 F. Pecora / Örebro University aass.oru.se 8 / 49

13 3-SAT and Complexity of CSP Recall that π NP-Complete iff sol(π) can be verified in polynomial time all problems in NP can be reduced to π Now we know that 3-SAT is NP-Complete what does this say about CSP? all problems in NP can be reduced to 3-SAT 3-SAT can be reduced to CSP (because 3-SAT is a CSP) a solution to a CSP can be verified in polynomial time (just check all constraints) Hence, the CSP is NP-Complete 2015 F. Pecora / Örebro University aass.oru.se 8 / 49

14 CSP as SAT Every CSP can be translated to a SAT problem instance every CSP variable (domain size d) is represented by d SAT variables (n d variables) each variable requires a small cluster ( of clauses to ensure (d ) ) that it takes exactly one value (n + 1 clauses) every CSP constraint is represented by a series of mutual exclusions between the SAT variables that participate in the constraint (e (d 2) clauses) Can often lead to very large instances despite size, even these are often efficiently solvable by SAT solvers F. Pecora / Örebro University aass.oru.se 9 / 49

15 CSP as SAT: Example A Domains: A, B, C, D {red, green, blue} C D B Constraints: A B, A C, C B, D B, A D 2015 F. Pecora / Örebro University aass.oru.se 10 / 49

16 CSP as SAT: Example C A D B One boolean var. per CSP domain value: x r A, xg A, xb A, xr B, xg B, xb B, xr C, xg C, xb C, xr D, xg D, xb D Domains: A, B, C, D {red, green, blue} Constraints: A B, A C, C B, D B, A D (12 variables) 2015 F. Pecora / Örebro University aass.oru.se 10 / 49

17 CSP as SAT: Example C A D B Domains: A, B, C, D {red, green, blue} Constraints: A B, A C, C B, D B, A D One boolean var. per CSP domain value: xa r, xg A, xb A, xr B, xg B, xb B, xr C, xg C, xb C, xr D, xg D, xb D (12 variables) Single value clauses: (xa r xg A xb A ) ( xr A xg A ) ( xr A xb A ) ( xg A xb A )... ( 4 = 16 clauses) 2015 F. Pecora / Örebro University aass.oru.se 10 / 49

18 CSP as SAT: Example C A D B Domains: A, B, C, D {red, green, blue} Constraints: A B, A C, C B, D B, A D One boolean var. per CSP domain value: xa r, xg A, xb A, xr B, xg B, xb B, xr C, xg C, xb C, xr D, xg D, xb D (12 variables) Single value clauses: (xa r xg A xb A ) ( xr A xg A ) ( xr A xb A ) ( xg A xb A )... ( 4 = 16 clauses) Binary constraint clauses: ( x r A xr B ) ( xg A xg B ) ( xb A xb B )... ( 5 = 15 clauses) 2015 F. Pecora / Örebro University aass.oru.se 10 / 49

19 Why Reduce to SAT? Many interesting problems can be reduced to SAT planning, scheduling, circuit design, model verification,... polinomial-time reductions model leads to solution of original problem Efficient algorithms can often decide large, interesting problems What if specific solving techniques exists for the original problem? 2015 F. Pecora / Örebro University aass.oru.se 11 / 49

20 Why Reduce to SAT? Many interesting problems can be reduced to SAT planning, scheduling, circuit design, model verification,... polinomial-time reductions model leads to solution of original problem Efficient algorithms can often decide large, interesting problems What if specific solving techniques exists for the original problem? SAT is simple 2015 F. Pecora / Örebro University aass.oru.se 11 / 49

21 Why Reduce to SAT? Many interesting problems can be reduced to SAT planning, scheduling, circuit design, model verification,... polinomial-time reductions model leads to solution of original problem Efficient algorithms can often decide large, interesting problems What if specific solving techniques exists for the original problem? SAT is simple SAT solvers employ very sophisticated search techniques 2015 F. Pecora / Örebro University aass.oru.se 11 / 49

22 Why Reduce to SAT? Many interesting problems can be reduced to SAT planning, scheduling, circuit design, model verification,... polinomial-time reductions model leads to solution of original problem Efficient algorithms can often decide large, interesting problems What if specific solving techniques exists for the original problem? SAT is simple SAT solvers employ very sophisticated search techniques SAT solvers are the workhorses of AI 2015 F. Pecora / Örebro University aass.oru.se 11 / 49

23 Reduction ot SAT: Another Example Correspondence between digital logic circuits and propositional logic Digital design circuit logic gate input wire internal wire voltage level Propositional logic formula propositional connective literal sub-expression boolean value 2015 F. Pecora / Örebro University aass.oru.se 12 / 49

24 Reduction ot SAT: Another Example b a c Correspondence between digital logic circuits and propositional logic a b c φ 1 = b a c φ 2 = (a b) (b c) Are the the two circuits equivalent? Is φ = φ 1 φ 2 SAT? 2015 F. Pecora / Örebro University aass.oru.se 12 / 49

25 Transforming to CNF Unfortunately naïvely applying distribution can cause the size of the formula to grow exponentially original formula: (x 1 y 1 ) (x 2 y 2 )... (x n y n ) naïve transformation gives 2 n clauses: (x 1... x n 1 x n ) (x 1... x n 1 y n )... (y 1... y n 1 y n ) However, we are not usually interested in equivalent CNF formulations We only care about satisfiability and possibly a simple way to extract the model of the original formula 2015 F. Pecora / Örebro University aass.oru.se 13 / 49

26 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables 2015 F. Pecora / Örebro University aass.oru.se 14 / 49

27 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: 2015 F. Pecora / Örebro University aass.oru.se 14 / 49

28 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: (p 1 q r) 2015 F. Pecora / Örebro University aass.oru.se 14 / 49

29 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: (p 1 q r) (p 2 p p 1 ) 2015 F. Pecora / Örebro University aass.oru.se 14 / 49

30 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: (p 1 q r) (p 2 p p 1 ) (p 3 p 2 s) 2015 F. Pecora / Örebro University aass.oru.se 14 / 49

31 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: (p 1 q r) (p 2 p p 1 ) (p 3 p 2 s) p F. Pecora / Örebro University aass.oru.se 14 / 49

32 Transforming to CNF SAT-preserving trasformation to CNF: φ φ φ is SAT φ is SAT (equisatisfiable) φ is only linearly bigger than φ transformation introduces linear number of new variables model of φ is projection of model of φ on original variables Example: (p (q r)) s introduce new variables for sub-formulas: (p 1 q r) (p 2 p p 1 ) (p 3 p 2 s) p 3 then transform to CNF: ( p 1 q) ( p 1 r) (p 1 q r) ( p 2 p p 1 ) (p 2 p) (p 2 p 1 ) ( p 3 p 2 ) ( p 3 s) (p 3 p 2 s) p F. Pecora / Örebro University aass.oru.se 14 / 49

33 Davis-Putnam-Logeman-Loveland Procedure Fundamental SAT solving algorithm developed through two seminal papers [Davis and Putnam, 1960], [Davis et al., 1962] latter fixes memory explosion problem in former method known today as DPLL DPLL is essentially a backtracking search algorithm As such, DPLL benefits from propagation propagation in general CSP: enforce some level of consistency while making valid assignments propagation in SAT: transform the set of clauses while preserving satisfiability 2015 F. Pecora / Örebro University aass.oru.se 15 / 49

34 Davis-Putnam-Logeman-Loveland Procedure Propagation in DPLL is based on two transformations on the set of clauses: unit propagation (UP): if a unit clause p appears, remove p from other clauses and remove all clauses including p pure-literal elimination (PLE): if p occurs only negated, or only unnegated, delete all clauses involving p 2015 F. Pecora / Örebro University aass.oru.se 16 / 49

35 Davis-Putnam-Logeman-Loveland Procedure Propagation in DPLL is based on two transformations on the set of clauses: unit propagation (UP): if a unit clause p appears, remove p from other clauses and remove all clauses including p pure-literal elimination (PLE): if p occurs only negated, or only unnegated, delete all clauses involving p UP example: (x 5 ) is a unit clause, i.e., x 5 must be (x 1 x 2 x 3 ) (x 1 x 2 ) ( x 2 x 3 ) (x 1 x 2 x 5 ) ( x 3 x 4 ) (x 4 x 5 ) (x 5 ) 2015 F. Pecora / Örebro University aass.oru.se 16 / 49

36 Davis-Putnam-Logeman-Loveland Procedure Propagation in DPLL is based on two transformations on the set of clauses: unit propagation (UP): if a unit clause p appears, remove p from other clauses and remove all clauses including p pure-literal elimination (PLE): if p occurs only negated, or only unnegated, delete all clauses involving p UP example: (x 5 ) is a unit clause, i.e., x 5 must be (x 1 x 2 x 3 ) (x 1 x 2 ) ( x 2 x 3 ) (x 1 x 2 x 5 ) ( x 3 x 4 ) (x 4 x 5 ) (x 5 ) 2015 F. Pecora / Örebro University aass.oru.se 16 / 49

37 Davis-Putnam-Logeman-Loveland Procedure Propagation in DPLL is based on two transformations on the set of clauses: unit propagation (UP): if a unit clause p appears, remove p from other clauses and remove all clauses including p pure-literal elimination (PLE): if p occurs only negated, or only unnegated, delete all clauses involving p UP example: (x 5 ) is a unit clause, i.e., x 5 must be (x 1 x 2 x 3 ) (x 1 x 2 ) ( x 2 x 3 ) (x 1 x 2 x 5 ) ( x 3 x 4 ) (x 4 x 5 ) (x 5 ) PLE example: x 1 is never negated, i.e., x 1 can be 2015 F. Pecora / Örebro University aass.oru.se 16 / 49

38 Davis-Putnam-Logeman-Loveland Procedure Propagation in DPLL is based on two transformations on the set of clauses: unit propagation (UP): if a unit clause p appears, remove p from other clauses and remove all clauses including p pure-literal elimination (PLE): if p occurs only negated, or only unnegated, delete all clauses involving p UP example: (x 5 ) is a unit clause, i.e., x 5 must be (x 1 x 2 x 3 ) (x 1 x 2 ) ( x 2 x 3 ) (x 1 x 2 x 5 ) ( x 3 x 4 ) (x 4 x 5 ) (x 5 ) PLE example: x 1 is never negated, i.e., x 1 can be (x 1 x 2 x 3 ) (x 1 x 2 ) ( x 2 x 3 ) (x 1 x 2 x 5 ) ( x 3 x 4 ) (x 4 x 5 ) (x 5 ) 2015 F. Pecora / Örebro University aass.oru.se 16 / 49

39 Davis-Putnam-Logeman-Loveland Procedure Unit propagation and pure-literal elimination is a Boolean Constraint Propagation (BCP) procedure Algorithm 1: BCP(φ) : formula or φ unit-propagate(φ) φ eliminate-pure-lit(φ) if empty clause φ then return return φ 2015 F. Pecora / Örebro University aass.oru.se 17 / 49

40 Davis-Putnam-Logeman-Loveland Procedure DPLL: recursive depth-first enumeration of possible models Algorithm 2: DPLL(φ) : model for φ or UNSAT static assignment (current assignment of variables to {, }) φ BCP(φ) if φ = then return UNSAT assignment state(φ) if assignment is complete then return assignment variable choose-unassigned-variable(φ,assignment) return DPLL(φ variable) DPLL(φ variable) 2015 F. Pecora / Örebro University aass.oru.se 18 / 49

41 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 branch over x 1 =... x F. Pecora / Örebro University aass.oru.se 19 / 49

42 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 2 is a unit clause x 2 = x F. Pecora / Örebro University aass.oru.se 19 / 49

43 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 3 is a unit clause x 3 = x F. Pecora / Örebro University aass.oru.se 19 / 49

44 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 4 is a unit clause x 4 = x F. Pecora / Örebro University aass.oru.se 19 / 49

45 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 7 is a unit clause x 7 = x F. Pecora / Örebro University aass.oru.se 19 / 49

46 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 10 is a unit clause x 10 = x F. Pecora / Örebro University aass.oru.se 19 / 49

47 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 BCP does nothing branch over x 5 =... x F. Pecora / Örebro University aass.oru.se 19 / 49

48 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

49 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 6 is a unit clause x 6 = x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

50 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 8 is a unit clause x 8 = x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

51 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 11 is a unit clause x 11 = x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

52 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 9 is a unit clause x 9 = x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

53 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 12 is a unit clause x 12 = x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

54 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 x 1 x 4 x 1 x 2 x 2 x 5 x 1 x 3 x 3 x 6 x 2 x 3 x 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 x 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 empty clause! backtrack on x 5... x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

55 Davis-Putnam-Logeman-Loveland Procedure: Example x 1 x 2 x 3 1 x 3 x 3 x 6 x 2 x 3 1 x 7 x 4 x 5 x 6 x 2 x 8 x 4 x 5 x 3 x 9 x 4 x 6 1 x 10 x 5 x 6 x 2 x 11 x 7 x 8 x 9 x 3 x 12 x 7 x 8 x 4 x 7 x 7 x 9 x 5 x 8 x 8 x 9 x 6 x 9 x 10 x 11 x 12 x 4 x 10 x 10 x 11 x 5 x 11 x 10 x 12 x 6 x 12 x 11 x 12 x 7 x 10 x 8 x 11 x 9 x 12 x 5 x F. Pecora / Örebro University aass.oru.se 19 / 49

56 Conflict-Driven Backjumping and Clause Learning BCP detects conflicts when a clause becomes empty Chronological backtracking: go back to most recent branching and flip value of variable Notice that we can make a more informed choice on where to backtrack most recent decision is not necessarily what has caused the conflict can deduce the culprit when BCP finds a conflict Clause learning: learn clauses that will avoid repeating mistakes Conflict-driven backjumping: backtrack to the culprit 2015 F. Pecora / Örebro University aass.oru.se 20 / 49

57 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x F. Pecora / Örebro University aass.oru.se 21 / 49

58 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 1 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

59 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 4 = x 1 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

60 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 4 = x 1 = x 3 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

61 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 4 = x 1 = x 3 = x 8 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

62 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 7 x 8 x 10 x 7 x 10 x 12 x 4 = x 1 = x 3 = x 8 = x 12 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

63 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 7 x 8 x 10 x 7 x 10 x 12 x 4 = x 2 x 2 = x 1 = x 3 = x 2 = x 8 = x 12 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

64 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 7 x 8 x 10 x 7 x 10 x 12 x 4 = x 2 x 2 = x 11 = x 1 = x 3 = x 2 = x 11 = x 8 = x 12 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

65 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 4 = x 2 x 2 = x 11 = x 1 = x 2 = x 3 = x 7 = x 7 x 7 = x 11 = x 8 = x 12 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

66 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 4 = x 9 = x 2 x 2 = x 11 = x 1 = x 2 = x 3 = x 7 = x 9 = x 7 x 7 = x 9 =? x 11 = x 8 = x 12 = 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

67 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 2 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 2 = x 11 = x 4 = x 9 = x 1 = x 3 = x 7 = x 7 x 7 = x 9 =? x 2 = x 9 = x 11 = x 12 = x 8 = (x 3 x 7 x 8 ) implies conflict 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

68 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 3 x 7 x 8 x 2 x 2 = x 11 = x 4 = x 9 = x 1 = x 2 = x 3 = x 7 = x 9 = x 7 x 7 = x 9 =? x 11 = x 12 = x 8 = learn clause ( x 3 x 7 x 8 ) 2015 F. Pecora / Örebro University aass.oru.se 21 / 49

69 Conflict-Driven Backjumping and Clause Learning x 1 x 4 x 1 x 3 x 8 x 1 x 8 x 12 x 2 x 11 x 7 x 3 x 9 x 7 x 8 x 9 x 7 x 8 x 10 x 7 x 10 x 12 x 1 x 1 = x 4 = x 3 x 3 = x 8 = x 12 = x 3 x 7 x 8 x 2 x 4 = x 1 = x 3 = x 7 x 12 = x 8 = backjump to x F. Pecora / Örebro University aass.oru.se 21 / 49

70 Conflict-Driven Backjumping and Clause Learning Conflict-driven backjumping can significantly reduce the search space Conflict clauses never cease to be useful Clauses are useful in generating new conflict clauses BCP picks up more conflicts, therefore learns more All modern systematic SAT solvers employ these strategies real-world applications thousands, even millions of variables research direction changes towards more efficient implementations 2015 F. Pecora / Örebro University aass.oru.se 22 / 49

71 Performance in SAT Solvers As all systematic CSP strategies, DPLL alternates branching and propagation So performance depends on propagation and ordering heuristics BCP iteratively analyses all clauses at each clause, either the clause is eliminated (SAT), or a literal is eliminated, or a conflict is identified (UNSAT) BCP may have to cycle over clauses several times In general, all DPLL-based algorithms spend most of their time doing BCP (up to 90%!) Modern SAT solvers implement efficient BCP procedures and sophisticated variable ordering heuristics 2015 F. Pecora / Örebro University aass.oru.se 23 / 49

72 BCP and Variable Ordering in CHAFF CHAFF is an efficient implementation of DPLL developed at Princeton University [Moskewicz et al., 2001] Efficiency gains made from fast UP (watched literals) intelligent backtracking conflict resolution (clause learning) effective branching rule (VSIDS) Key point in CHAFF s BCP: avoid revisiting clauses until they can lead to conflict Key point in CHAFF s branching: branch over variables that have recently lead to conflicts 2015 F. Pecora / Örebro University aass.oru.se 24 / 49

73 BCP in CHAFF: Watched Literals A clause (x 1... x n ) in implied iff n 1 literals are During BCP, we wish to quickly find newly implied clauses We could keep a counter for each clause representing the number of -literals, and visit clauses with counter = n 1 However, there is no need to visit a clause when 1, 2,... n 2 literals are We would like to only visit a clause when its counter goes from n 2 to n 1 CHAFF approximates this with watched literals 2015 F. Pecora / Örebro University aass.oru.se 25 / 49

74 BCP in CHAFF: Watched Literals Every clause watches two literals if neither are, clause cannot be implied if one is, clause may be implied We only visit a clause when one of its two watched literals is assigned to When a watched literal is set to the clause is searched for a new unassigned literal if none exists, the other watched literal is forced to otherwise the new unassigned literal becomes watched 2015 F. Pecora / Örebro University aass.oru.se 26 / 49

75 BCP in CHAFF: Watched Literals Watched literals facilitate finding new implications excludes clauses that couldn t possibly lead to a new implication Watched literals require very little overhead during UP skip clauses where watched literals are untouched do nothing when a watched literal is set to simple update of new watched literals Watched literals require no overhead when backtracking the literals that are watched can stay the same, because they were unassigned anyway un-assignment can be done in constant time 2015 F. Pecora / Örebro University aass.oru.se 27 / 49

76 Variable Ordering in DPLL Which unassigned variable should DPLL branch on? dynamic variable ordering i.e., order of expansion changes during search An effective heuristic is not necessarily the one which leads to fewest branches different assignments yield different # BCP operations shorter sequence of assignments may lead to more BCP operations than a longer one Must somehow minimize consequences for BCP as well as keep a low overhead for bookeeping 2015 F. Pecora / Örebro University aass.oru.se 28 / 49

77 Variable Ordering in DPLL: DLIS A simple and intuitive strategy: DLIS (Dynamic Largest Individual Sum) choose the assignment that satisfies the most unsatisfied clauses However, considerable work is required to maintain the statistics necessary for this heuristic maintain counters for each clause must update rankings when counter(s) transition from 0 to 1 need to reverse process when backtracking Total effort is much more than BCP! 2015 F. Pecora / Örebro University aass.oru.se 29 / 49

78 Variable Ordering in CHAFF: VSIDS 1 Each variable in each polarity has a counter, initialized to 0 2 When a conflict clause is added, counter associated with each literal in the clause is incremented 3 The (unassigned) variable and polarity with the highest counter is chosen for branching ties are broken randomly 4 Periodically, all the counters are divided by a constant 2015 F. Pecora / Örebro University aass.oru.se 30 / 49

79 Variable Ordering in CHAFF: VSIDS VSIDS effectively leads DPLL to attempt to satisfy recent conflict clauses difficult problems generate many conflicts conflict clauses dominate the problem in terms of literal count step 4 (division by constant) favors information from literals that often provoke conflicts direct coupling of combinatorial core to search process VSIDS has very low overhead does not depend on state of variable assignments statistics updated only when new conflict is detected 2015 F. Pecora / Örebro University aass.oru.se 31 / 49

80 DPLL-Based Methods So Far First generation (1960s) DP, DPLL 10s of variables Second generation (1980s/1990s) POSIT, Tableau, [... ] 10s 100s of variables Third generation (mid-1990s) SATO, satz, grasp, [... ] 1k 10k of variables Fourth generation (2000s) Chaff, Berkmin, [... ] 10k 1m of variables 2015 F. Pecora / Örebro University aass.oru.se 32 / 49

81 DPLL-Based Methods So Far Is SAT solver technology keeping up with Moore s law? number of transistors doubles every 18 months number of variables reported in random 3-SAT experiments doubles every 3 or 4 years Getting better performance, but primarily due to computing power Do we need a paradigm shift? 2015 F. Pecora / Örebro University aass.oru.se 33 / 49

82 Local Search for SAT DPLL-based methods are complete Systematic methods are inevitably slower than local search aka repair-based methods However, local search based methods cannot prove unsatisfiability often useful, e.g., in verification, planning, F. Pecora / Örebro University aass.oru.se 34 / 49

83 Local Search for SAT: GSAT GSAT: hill-climbing for SAT Algorithm 3: GSAT(φ) : model for φ or failure for i=1 to maxrestarts do assignment random-assignment(φ) for j=1 to maxclimbs do if evaluate(assignment,φ) then return assignment return fail assignment best-successor(assignment,φ) 2015 F. Pecora / Örebro University aass.oru.se 35 / 49

84 Local Search for SAT: GSAT The best successor is the one that makes the most clauses true Algorithm 4: best-successor(assignment,φ) : an assignment maxsatclauses 0 best successors compute-successors(assignment) forall the successor successors do if (numsat get-sat-clauses(φ,successor)) > maxsatclauses then maxsatclauses numsat best successor return best 2015 F. Pecora / Örebro University aass.oru.se 36 / 49

85 SAT Problem Structure Structure of SAT instance provides complexity classification 2-SAT is polinomial k-sat with k > 2 is NP-Complete 2015 F. Pecora / Örebro University aass.oru.se 37 / 49

86 SAT Problem Structure Structure of SAT instance provides complexity classification 2-SAT is polinomial k-sat with k > 2 is NP-Complete Horn Clauses: a clause with at most one positive literal P Q... T U What does a Horn clause really say? 2015 F. Pecora / Örebro University aass.oru.se 37 / 49

87 SAT Problem Structure Structure of SAT instance provides complexity classification 2-SAT is polinomial k-sat with k > 2 is NP-Complete Horn Clauses: a clause with at most one positive literal P Q... T U What does a Horn clause really say? (P Q... T) U to prove U, prove P and Q and... T 2015 F. Pecora / Örebro University aass.oru.se 37 / 49

88 SAT Problem Structure Structure of SAT instance provides complexity classification 2-SAT is polinomial k-sat with k > 2 is NP-Complete Horn Clauses: a clause with at most one positive literal P Q... T U What does a Horn clause really say? (P Q... T) U to prove U, prove P and Q and... T Theorem: If φ consists only of Horn clauses, then φ can be proved to be SAT or UNSAT through unit propagation only HORNSAT is P-complete (i.e., one of the hardest or most expressive problems which is known to be computable in polynomial time) 2015 F. Pecora / Örebro University aass.oru.se 37 / 49

89 HORNSAT Solvable by Unit Propagation: Proof Assume φ has only Horn clauses, and UP has completed UP has removed all clauses that were satisfied, and removed corresponding UNSAT literals from remaining clauses Only clauses of two types remain (all Horn) P 1 P 2... P n Q P 1 P 2... P n Each remaining clause has at least two variables (otherwise UP would have eliminated it, or found a conflict) We can satisfy all remaining clauses by assigning remaining variables to because each remaining clause has at least one negated variable (QED) 2015 F. Pecora / Örebro University aass.oru.se 38 / 49

90 Horn Theories and P? = NP 3-SAT is NP-complete Can we transform a 3-SAT formula into an equisatisfiable formula containing only Horn clauses? 2015 F. Pecora / Örebro University aass.oru.se 39 / 49

91 Horn Theories and P? = NP 3-SAT is NP-complete Can we transform a 3-SAT formula into an equisatisfiable formula containing only Horn clauses? Yes 2015 F. Pecora / Örebro University aass.oru.se 39 / 49

92 Horn Theories and P? = NP 3-SAT is NP-complete Can we transform a 3-SAT formula into an equisatisfiable formula containing only Horn clauses? Yes Does this mean that P = NP? 2015 F. Pecora / Örebro University aass.oru.se 39 / 49

93 Horn Theories and P? = NP 3-SAT is NP-complete Can we transform a 3-SAT formula into an equisatisfiable formula containing only Horn clauses? Yes Does this mean that P = NP? No! Why? 2015 F. Pecora / Örebro University aass.oru.se 39 / 49

94 Horn Theories and P? = NP 3-SAT is NP-complete Can we transform a 3-SAT formula into an equisatisfiable formula containing only Horn clauses? Yes Does this mean that P = NP? No! Why? Transformation to HORNSAT takes exponential time Resulting formula is exponentially longer that the original 2015 F. Pecora / Örebro University aass.oru.se 39 / 49

95 (TANSTAAFL) There Ain t No Such Thing As A Free Lunch 2015 F. Pecora / Örebro University aass.oru.se 40 / 49

96 SAT Problem Structure Structure of SAT instance provides complexity classification 2-SAT is polinomial k-sat with k > 2 is NP-Complete HORNSAT is P-Complete More subtle structural charateristics also predict cost of search Random k-sat instances uniformly sampled from space of all possible k-clauses n variables, l clauses meaningful parameter: ratio l/n of clauses to variables This is true also for general CSPs 2015 F. Pecora / Örebro University aass.oru.se 41 / 49

97 SAT Problem Structure: Phase Transition computational cost SAT UNSAT Hard instances are around l/n = 4.3 Complexity peak occurs around solubility transition l/n < 4.3: problems underconstrained and SAT l/n > 4.3: problems overconstrained and UNSAT l/n 4.3: difficult to prove SAT or UNSAT ratio of clauses to variables l/n 2015 F. Pecora / Örebro University aass.oru.se 42 / 49

98 SAT Problem Structure: Phase Transition median computational cost ratio of clauses to variables l/n Inrease problem size by increasing n Complexity peak invariant of problem size Complexity peak invariant of solving procedure systematic procedures (e.g., DPLL) local search procedures (e.g., GSAT) 2015 F. Pecora / Örebro University aass.oru.se 43 / 49

99 SAT Problem Structure: Phase Transition Why is the phase transition interesting? tells us that all algorithms have similar performance on random instances l/n predicts difficult random problems (and SAT/UNSAT) Phase transition behavior dissapears when problems are more structured e.g., in real-world problems, l/n doesn t tell us anything! The easiest type of test for your new algorithm is a random benchmark however, it is important to test your algorithm on real instances 2015 F. Pecora / Örebro University aass.oru.se 44 / 49

100 Random vs. Real-World Problems The real world is not random Real world problems have other structural features (in addition to random components) real graphs tend to be sparse (random graphs could be both) real graphs tend to have short path lengths (like random graphs) real graphs tend to be clustered (unlike sparse random graphs) Small world graphs: typical of social networks sparse, clustered, short path lengths six degrees of separation (shown to apply to actors DB, neural net of a worm,... ) 2015 F. Pecora / Örebro University aass.oru.se 45 / 49

101 Random vs. Real-World Problems Real-world problems have strong differences with random problems A compelling example [T. Walsh, 2000]: 1994 exam timetable at Edinburgh University 59 nodes, 594 edges (relatively sparse) but contains 10-clique! clique totally dominates search cost Less than chance of a 10-clique in a random graph with same size and density 2015 F. Pecora / Örebro University aass.oru.se 46 / 49

102 Summary Boolean Satisfiability (SAT) is a particular case of constraint reasoning As such, techniques seen for CSPs apply backtracking search, propagation, variable/value ordering SAT is convenient due to its simple formulation SAT solvers have become the workhorses of AI Today, complete algorithms in SAT are as performant as local search algorithms (millions of variables) are we approaching the limit of what we can do? Phase transition behavior for random k-sat predicts difficulty and solubility behavior dissapears in real world problems 2015 F. Pecora / Örebro University aass.oru.se 47 / 49

103 Part 5 Boolean Satisfiability Thank you! 2015 F. Pecora / Örebro University aass.oru.se 48 / 49

104 References Cook, S. A. (1971). The complexity of theorem-proving procedures. In Proceedings of the Third Annual ACM Symposium on Theory of Computing, STOC 71, pages , New York, NY, USA. ACM. Davis, M., Logemann, G., and Loveland, D. (1962). A machine program for theorem-proving. Commun. ACM, 5(7): Davis, M. and Putnam, H. (1960). A computing procedure for quantification theory. J. ACM, 7(3): Garey, M. R. and Johnson, D. S. (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., New York, NY, USA. Moskewicz, M., Madigan, C., Zhao, Y., Zhang, L., and Malik, S. (2001). Chaff: Engineering an Efficient SAT Solver. In Proceedings of the 38th Design Automation Conference (DAC 01) F. Pecora / Örebro University aass.oru.se 49 / 49

105 Acknowledgements Portions of this course are inspired, compiled or taken from scientific presentations and teaching material by the following authors: Fahiem Bacchus, Amedeo Cesta, Gary Cottrell, Rina Dechter, Simone Fratini, Hector Geffner, Geoff Gordon, Russell Greiner, John Harrison, Joachim Hertzberg, David Kriegman, Sharad Malik, Dana Nau, Peter Norvig, Madhusudan Parthasarathy, Rhys Price Jones, Stuart Russel, Tuomas Sandholm, Stephen F. Smith, Padhraic Smyth, Paolo Traverso, Toby Walsh F. Pecora / Örebro University aass.oru.se 49 / 49

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson SAT Solving 1 / 36 Review: Propositional

More information

Formal Verification Methods 1: Propositional Logic

Formal Verification Methods 1: Propositional Logic Formal Verification Methods 1: Propositional Logic John Harrison Intel Corporation Course overview Propositional logic A resurgence of interest Logic and circuits Normal forms The Davis-Putnam procedure

More information

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber 15-414 Aug 31, 2011 Why study SAT solvers? Many problems reduce to SAT. Formal verification CAD, VLSI Optimization AI, planning, automated

More information

From SAT To SMT: Part 1. Vijay Ganesh MIT

From SAT To SMT: Part 1. Vijay Ganesh MIT From SAT To SMT: Part 1 Vijay Ganesh MIT Software Engineering & SMT Solvers An Indispensable Tactic for Any Strategy Formal Methods Program Analysis SE Goal: Reliable/Secure Software Automatic Testing

More information

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning COMP219: Artificial Intelligence Lecture 20: Propositional Reasoning 1 Overview Last time Logic for KR in general; Propositional Logic; Natural Deduction Today Entailment, satisfiability and validity Normal

More information

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask Set 6: Knowledge Representation: The Propositional Calculus Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask Outline Representing knowledge using logic Agent that reason logically A knowledge based agent Representing

More information

VLSI CAD: Lecture 4.1. Logic to Layout. Computational Boolean Algebra Representations: Satisfiability (SAT), Part 1

VLSI CAD: Lecture 4.1. Logic to Layout. Computational Boolean Algebra Representations: Satisfiability (SAT), Part 1 VLSI CAD: Logic to Layout Rob A. Rutenbar University of Illinois Lecture 4.1 Computational Boolean Algebra Representations: Satisfiability (SAT), Part 1 Some Terminology Satisfiability (called SAT for

More information

Lecture 9: Search 8. Victor R. Lesser. CMPSCI 683 Fall 2010

Lecture 9: Search 8. Victor R. Lesser. CMPSCI 683 Fall 2010 Lecture 9: Search 8 Victor R. Lesser CMPSCI 683 Fall 2010 ANNOUNCEMENTS REMEMBER LECTURE ON TUESDAY! EXAM ON OCTOBER 18 OPEN BOOK ALL MATERIAL COVERED IN LECTURES REQUIRED READINGS WILL MOST PROBABLY NOT

More information

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz )

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz ) Logic in AI Chapter 7 Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz ) Knowledge Representation represent knowledge in a manner that facilitates inferencing (i.e. drawing

More information

Heuristics for Efficient SAT Solving. As implemented in GRASP, Chaff and GSAT.

Heuristics for Efficient SAT Solving. As implemented in GRASP, Chaff and GSAT. Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT. Formulation of famous problems as SAT: k-coloring (1/2) The K-Coloring problem: Given an undirected graph G(V,E) and a natural

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 31. Propositional Logic: DPLL Algorithm Malte Helmert and Gabriele Röger University of Basel April 24, 2017 Propositional Logic: Overview Chapter overview: propositional

More information

Tutorial 1: Modern SMT Solvers and Verification

Tutorial 1: Modern SMT Solvers and Verification University of Illinois at Urbana-Champaign Tutorial 1: Modern SMT Solvers and Verification Sayan Mitra Electrical & Computer Engineering Coordinated Science Laboratory University of Illinois at Urbana

More information

An instance of SAT is defined as (X, S)

An instance of SAT is defined as (X, S) SAT: Propositional Satisfiability 22c:45 Artificial Intelligence Russell & Norvig, Ch. 7.6 Validity vs. Satisfiability Validity: A sentence is valid if it is true in every interpretation (every interpretation

More information

SAT Solvers: Theory and Practice

SAT Solvers: Theory and Practice Summer School on Verification Technology, Systems & Applications, September 17, 2008 p. 1/98 SAT Solvers: Theory and Practice Clark Barrett barrett@cs.nyu.edu New York University Summer School on Verification

More information

Lecture 2 Propositional Logic & SAT

Lecture 2 Propositional Logic & SAT CS 5110/6110 Rigorous System Design Spring 2017 Jan-17 Lecture 2 Propositional Logic & SAT Zvonimir Rakamarić University of Utah Announcements Homework 1 will be posted soon Propositional logic: Chapter

More information

Lecture Notes on SAT Solvers & DPLL

Lecture Notes on SAT Solvers & DPLL 15-414: Bug Catching: Automated Program Verification Lecture Notes on SAT Solvers & DPLL Matt Fredrikson André Platzer Carnegie Mellon University Lecture 10 1 Introduction In this lecture we will switch

More information

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit: Three days of interesting talks & workshops from industry experts across Australia Explore new computing topics Network with students & employers in Brisbane Price: $25 (incl. T-Shirt, morning tea and

More information

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel Propositional Logic Methods & Tools for Software Engineering (MTSE) Fall 2017 Prof. Arie Gurfinkel References Chpater 1 of Logic for Computer Scientists http://www.springerlink.com/content/978-0-8176-4762-9/

More information

An Introduction to SAT Solving

An Introduction to SAT Solving An Introduction to SAT Solving Applied Logic for Computer Science UWO December 3, 2017 Applied Logic for Computer Science An Introduction to SAT Solving UWO December 3, 2017 1 / 46 Plan 1 The Boolean satisfiability

More information

Chapter 7 Propositional Satisfiability Techniques

Chapter 7 Propositional Satisfiability Techniques Lecture slides for Automated Planning: Theory and Practice Chapter 7 Propositional Satisfiability Techniques Dana S. Nau University of Maryland 12:58 PM February 15, 2012 1 Motivation Propositional satisfiability:

More information

Planning as Satisfiability

Planning as Satisfiability Planning as Satisfiability Alan Fern * Review of propositional logic (see chapter 7) Planning as propositional satisfiability Satisfiability techniques (see chapter 7) Combining satisfiability techniques

More information

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz ) Logic in AI Chapter 7 Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz ) 2 Knowledge Representation represent knowledge about the world in a manner that

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 8. Satisfiability and Model Construction Davis-Putnam-Logemann-Loveland Procedure, Phase Transitions, GSAT Joschka Boedecker and Wolfram Burgard and Bernhard Nebel

More information

Classical Propositional Logic

Classical Propositional Logic Classical Propositional Logic Peter Baumgartner http://users.cecs.anu.edu.au/~baumgart/ Ph: 02 6218 3717 Data61/CSIRO and ANU July 2017 1 / 71 Classical Logic and Reasoning Problems A 1 : Socrates is a

More information

Chapter 7 Propositional Satisfiability Techniques

Chapter 7 Propositional Satisfiability Techniques Lecture slides for Automated Planning: Theory and Practice Chapter 7 Propositional Satisfiability Techniques Dana S. Nau CMSC 722, AI Planning University of Maryland, Spring 2008 1 Motivation Propositional

More information

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30) Computational Logic Davide Martinenghi Free University of Bozen-Bolzano Spring 2010 Computational Logic Davide Martinenghi (1/30) Propositional Logic - sequent calculus To overcome the problems of natural

More information

Satisifiability and Probabilistic Satisifiability

Satisifiability and Probabilistic Satisifiability Satisifiability and Probabilistic Satisifiability Department of Computer Science Instituto de Matemática e Estatística Universidade de São Paulo 2010 Topics Next Issue The SAT Problem The Centrality of

More information

Intelligent Agents. Pınar Yolum Utrecht University

Intelligent Agents. Pınar Yolum Utrecht University Intelligent Agents Pınar Yolum p.yolum@uu.nl Utrecht University Logical Agents (Based mostly on the course slides from http://aima.cs.berkeley.edu/) Outline Knowledge-based agents Wumpus world Logic in

More information

Logical Agents. Chapter 7

Logical Agents. Chapter 7 Logical Agents Chapter 7 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem

More information

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 10, 5/9/2005 University of Washington, Department of Electrical Engineering Spring 2005 Instructor: Professor Jeff A. Bilmes Logical Agents Chapter 7

More information

A brief introduction to Logic. (slides from

A brief introduction to Logic. (slides from A brief introduction to Logic (slides from http://www.decision-procedures.org/) 1 A Brief Introduction to Logic - Outline Propositional Logic :Syntax Propositional Logic :Semantics Satisfiability and validity

More information

CS:4420 Artificial Intelligence

CS:4420 Artificial Intelligence CS:4420 Artificial Intelligence Spring 2018 Propositional Logic Cesare Tinelli The University of Iowa Copyright 2004 18, Cesare Tinelli and Stuart Russell a a These notes were originally developed by Stuart

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) You will be expected to know Basic definitions Inference, derive, sound, complete Conjunctive Normal Form (CNF) Convert a Boolean formula to CNF Do a short

More information

Introduction to Arti Intelligence

Introduction to Arti Intelligence Introduction to Arti Intelligence cial Lecture 4: Constraint satisfaction problems 1 / 48 Constraint satisfaction problems: Today Exploiting the representation of a state to accelerate search. Backtracking.

More information

Kecerdasan Buatan M. Ali Fauzi

Kecerdasan Buatan M. Ali Fauzi Kecerdasan Buatan M. Ali Fauzi Artificial Intelligence M. Ali Fauzi Logical Agents M. Ali Fauzi In which we design agents that can form representations of the would, use a process of inference to derive

More information

CS 188: Artificial Intelligence Spring 2007

CS 188: Artificial Intelligence Spring 2007 CS 188: Artificial Intelligence Spring 2007 Lecture 8: Logical Agents - I 2/8/2007 Srini Narayanan ICSI and UC Berkeley Many slides over the course adapted from Dan Klein, Stuart Russell or Andrew Moore

More information

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harry Lewis November 19, 2013 Reading: Sipser 7.4, 7.5. For culture : Computers and Intractability: A Guide to the Theory

More information

Pythagorean Triples and SAT Solving

Pythagorean Triples and SAT Solving Pythagorean Triples and SAT Solving Moti Ben-Ari Department of Science Teaching Weizmann Institute of Science http://www.weizmann.ac.il/sci-tea/benari/ c 2017-18 by Moti Ben-Ari. This work is licensed

More information

Topics in Model-Based Reasoning

Topics in Model-Based Reasoning Towards Integration of Proving and Solving Dipartimento di Informatica Università degli Studi di Verona Verona, Italy March, 2014 Automated reasoning Artificial Intelligence Automated Reasoning Computational

More information

Artificial Intelligence

Artificial Intelligence Torralba and Wahlster Artificial Intelligence Chapter 11: Propositional Reasoning, Part II 1/69 Artificial Intelligence 11. Propositional Reasoning, Part II: SAT Solvers How to Efficiently Think About

More information

SAT-Solving: From Davis- Putnam to Zchaff and Beyond Day 3: Recent Developments. Lintao Zhang

SAT-Solving: From Davis- Putnam to Zchaff and Beyond Day 3: Recent Developments. Lintao Zhang SAT-Solving: From Davis- Putnam to Zchaff and Beyond Day 3: Recent Developments Requirements for SAT solvers in the Real World Fast & Robust Given a problem instance, we want to solve it quickly Reliable

More information

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170 UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, 2003 Notes 22 for CS 170 1 NP-completeness of Circuit-SAT We will prove that the circuit satisfiability

More information

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World Agenda Artificial Intelligence 10. Propositional Reasoning, Part I: Principles How to Think About What is True or False 1 Introduction Álvaro Torralba Wolfgang Wahlster 2 Propositional Logic 3 Resolution

More information

Introduction to Artificial Intelligence. Logical Agents

Introduction to Artificial Intelligence. Logical Agents Introduction to Artificial Intelligence Logical Agents (Logic, Deduction, Knowledge Representation) Bernhard Beckert UNIVERSITÄT KOBLENZ-LANDAU Winter Term 2004/2005 B. Beckert: KI für IM p.1 Outline Knowledge-based

More information

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT The Wumpus Game Stench Stench Gold Stench Start 1 The Wumpus Game Stench in the square containing the wumpus and in the directly adjacent squares in the squares directly adjacent to a pit Glitter in the

More information

Satisfiability Modulo Theories

Satisfiability Modulo Theories Satisfiability Modulo Theories Summer School on Formal Methods Menlo College, 2011 Bruno Dutertre and Leonardo de Moura bruno@csl.sri.com, leonardo@microsoft.com SRI International, Microsoft Research SAT/SMT

More information

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna The Calculus of Computation: Decision Procedures with Applications to Verification Part I: FOUNDATIONS by Aaron Bradley Zohar Manna 1. Propositional Logic(PL) Springer 2007 1-1 1-2 Propositional Logic(PL)

More information

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010 Introduction to Artificial Intelligence Propositional Logic & SAT Solving UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010 Today Representation in Propositional Logic Semantics & Deduction

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Propositional Logic Marc Toussaint University of Stuttgart Winter 2016/17 (slides based on Stuart Russell s AI course) Motivation: Most students will have learnt about propositional

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems

More information

Part 1: Propositional Logic

Part 1: Propositional Logic Part 1: Propositional Logic Literature (also for first-order logic) Schöning: Logik für Informatiker, Spektrum Fitting: First-Order Logic and Automated Theorem Proving, Springer 1 Last time 1.1 Syntax

More information

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

CS156: The Calculus of Computation

CS156: The Calculus of Computation CS156: The Calculus of Computation Zohar Manna Winter 2010 It is reasonable to hope that the relationship between computation and mathematical logic will be as fruitful in the next century as that between

More information

Logical Agents. Outline

Logical Agents. Outline Logical Agents *(Chapter 7 (Russel & Norvig, 2004)) Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability

More information

Lecture 9: The Splitting Method for SAT

Lecture 9: The Splitting Method for SAT Lecture 9: The Splitting Method for SAT 1 Importance of SAT Cook-Levin Theorem: SAT is NP-complete. The reason why SAT is an important problem can be summarized as below: 1. A natural NP-Complete problem.

More information

SAT-based Combinational Equivalence Checking

SAT-based Combinational Equivalence Checking SAT-based Combinational Equivalence Checking Zhuo Huang zhuang@cise.ufl.edu Prabhat Mishra prabhat@cise.ufl.edu CISE Technical Report #05-007 Department of Computer and Information Science and Engineering,

More information

Logic and Inferences

Logic and Inferences Artificial Intelligence Logic and Inferences Readings: Chapter 7 of Russell & Norvig. Artificial Intelligence p.1/34 Components of Propositional Logic Logic constants: True (1), and False (0) Propositional

More information

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World School of Informatics, University of Edinburgh 26/01/18 Slide Credits: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann Outline Knowledge-based

More information

Proof Methods for Propositional Logic

Proof Methods for Propositional Logic Proof Methods for Propositional Logic Logical equivalence Two sentences are logically equivalent iff they are true in the same models: α ß iff α β and β α Russell and Norvig Chapter 7 CS440 Fall 2015 1

More information

Non-Deterministic Time

Non-Deterministic Time Non-Deterministic Time Master Informatique 2016 1 Non-Deterministic Time Complexity Classes Reminder on DTM vs NDTM [Turing 1936] (q 0, x 0 ) (q 1, x 1 ) Deterministic (q n, x n ) Non-Deterministic (q

More information

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning COMP9414, Monday 26 March, 2012 Propositional Logic 2 COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning Overview Proof systems (including soundness and completeness) Normal Forms

More information

Principles of AI Planning

Principles of AI Planning Principles of 5. Planning as search: progression and regression Malte Helmert and Bernhard Nebel Albert-Ludwigs-Universität Freiburg May 4th, 2010 Planning as (classical) search Introduction Classification

More information

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem. 1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search

More information

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas Journal of Artificial Intelligence Research 1 (1993) 1-15 Submitted 6/91; published 9/91 Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas Enrico Giunchiglia Massimo

More information

Propositional Calculus

Propositional Calculus Propositional Calculus Dr. Neil T. Dantam CSCI-498/598 RPM, Colorado School of Mines Spring 2018 Dantam (Mines CSCI, RPM) Propositional Calculus Spring 2018 1 / 64 Calculus? Definition: Calculus A well

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) This lecture topic: Propositional Logic (two lectures) Chapter 7.1-7.4 (previous lecture, Part I) Chapter 7.5 (this lecture, Part II) (optional: 7.6-7.8)

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Constraint Satisfaction Vibhav Gogate The University of Texas at Dallas Some material courtesy of Rina Dechter, Alex Ihler and Stuart Russell Constraint Satisfaction Problems The

More information

6. Logical Inference

6. Logical Inference Artificial Intelligence 6. Logical Inference Prof. Bojana Dalbelo Bašić Assoc. Prof. Jan Šnajder University of Zagreb Faculty of Electrical Engineering and Computing Academic Year 2016/2017 Creative Commons

More information

Solving SAT Modulo Theories

Solving SAT Modulo Theories Solving SAT Modulo Theories R. Nieuwenhuis, A. Oliveras, and C.Tinelli. Solving SAT and SAT Modulo Theories: from an Abstract Davis-Putnam-Logemann-Loveland Procedure to DPLL(T) Mooly Sagiv Motivation

More information

Propositional and First Order Reasoning

Propositional and First Order Reasoning Propositional and First Order Reasoning Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p p Clause: disjunction of literals q \/ p \/ r given by

More information

Principles of AI Planning

Principles of AI Planning Principles of AI Planning 5. Planning as search: progression and regression Albert-Ludwigs-Universität Freiburg Bernhard Nebel and Robert Mattmüller October 30th, 2013 Introduction Classification Planning

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) You will be expected to know Basic definitions Inference, derive, sound, complete Conjunctive Normal Form (CNF) Convert a Boolean formula to CNF Do a short

More information

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5) B.Y. Choueiry 1 Instructor s notes #12 Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5) Introduction to Artificial Intelligence CSCE 476-876, Fall 2018 URL: www.cse.unl.edu/ choueiry/f18-476-876

More information

Logical agents. Chapter 7. Chapter 7 1

Logical agents. Chapter 7. Chapter 7 1 Logical agents Chapter 7 Chapter 7 Outline Knowledge-based agents Wumpus world Logic in general models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules

More information

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/ Computer-Aided Reasoning for Software CSE507 courses.cs.washington.edu/courses/cse507/17wi/ Introduction Emina Torlak emina@cs.washington.edu Today What is this course about? Course logistics Review of

More information

Logical agents. Chapter 7. Chapter 7 1

Logical agents. Chapter 7. Chapter 7 1 Logical agents Chapter 7 Chapter 7 1 Outline Knowledge-based agents Logic in general models and entailment Propositional (oolean) logic Equivalence, validity, satisfiability Inference rules and theorem

More information

LOGIC PROPOSITIONAL REASONING

LOGIC PROPOSITIONAL REASONING LOGIC PROPOSITIONAL REASONING WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität Linz Version 2018.1

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Propositional Logic Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Outline Knowledge-based agents Wumpus world Logic in general

More information

Propositional Logic: Evaluating the Formulas

Propositional Logic: Evaluating the Formulas Institute for Formal Models and Verification Johannes Kepler University Linz VL Logik (LVA-Nr. 342208) Winter Semester 2015/2016 Propositional Logic: Evaluating the Formulas Version 2015.2 Armin Biere

More information

TDT4136 Logic and Reasoning Systems

TDT4136 Logic and Reasoning Systems TDT436 Logic and Reasoning Systems Chapter 7 - Logic gents Lester Solbakken solbakke@idi.ntnu.no Norwegian University of Science and Technology 06.09.0 Lester Solbakken TDT436 Logic and Reasoning Systems

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard, Maren Bennewitz, and Marco Ragni Albert-Ludwigs-Universität Freiburg Contents 1 Agents

More information

Machine Learning and Logic: Fast and Slow Thinking

Machine Learning and Logic: Fast and Slow Thinking Machine Learning and Logic: Fast and Slow Thinking Moshe Y. Vardi Rice University Is Computer Science Fundamentally Changing? Formal Science vs Data Science We are at peak hype about machine learning and

More information

Introduction to SAT (constraint) solving. Justyna Petke

Introduction to SAT (constraint) solving. Justyna Petke Introduction to SAT (constraint) solving Justyna Petke SAT, SMT and CSP solvers are used for solving problems involving constraints. The term constraint solver, however, usually refers to a CSP solver.

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Joschka Boedecker and Wolfram Burgard and Bernhard Nebel Albert-Ludwigs-Universität Freiburg May 17, 2016

More information

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic Matt Fredrikson mfredrik@cs.cmu.edu October 17, 2016 Matt Fredrikson Propositional Logic 1 / 33 Propositional

More information

Warm-Up Problem. Is the following true or false? 1/35

Warm-Up Problem. Is the following true or false? 1/35 Warm-Up Problem Is the following true or false? 1/35 Propositional Logic: Resolution Carmen Bruni Lecture 6 Based on work by J Buss, A Gao, L Kari, A Lubiw, B Bonakdarpour, D Maftuleac, C Roberts, R Trefler,

More information

Mathematical Logic Part Three

Mathematical Logic Part Three Mathematical Logic Part hree riday our Square! oday at 4:15PM, Outside Gates Announcements Problem Set 3 due right now. Problem Set 4 goes out today. Checkpoint due Monday, October 22. Remainder due riday,

More information

CS156: The Calculus of Computation Zohar Manna Autumn 2008

CS156: The Calculus of Computation Zohar Manna Autumn 2008 Page 3 of 52 Page 4 of 52 CS156: The Calculus of Computation Zohar Manna Autumn 2008 Lecturer: Zohar Manna (manna@cs.stanford.edu) Office Hours: MW 12:30-1:00 at Gates 481 TAs: Boyu Wang (wangboyu@stanford.edu)

More information

Satisfiability Checking of Non-clausal Formulas using General Matings

Satisfiability Checking of Non-clausal Formulas using General Matings Satisfiability Checking of Non-clausal Formulas using General Matings Himanshu Jain, Constantinos Bartzis, and Edmund Clarke School of Computer Science, Carnegie Mellon University, Pittsburgh, PA Abstract.

More information

SAT, CSP, and proofs. Ofer Strichman Technion, Haifa. Tutorial HVC 13

SAT, CSP, and proofs. Ofer Strichman Technion, Haifa. Tutorial HVC 13 SAT, CSP, and proofs Ofer Strichman Technion, Haifa Tutorial HVC 13 1 The grand plan for today Intro: the role of SAT, CSP and proofs in verification SAT how it works, and how it produces proofs CSP -

More information

Propositional Logic: Methods of Proof. Chapter 7, Part II

Propositional Logic: Methods of Proof. Chapter 7, Part II Propositional Logic: Methods of Proof Chapter 7, Part II Inference in Formal Symbol Systems: Ontology, Representation, ti Inference Formal Symbol Systems Symbols correspond to things/ideas in the world

More information

Artificial Intelligence Chapter 7: Logical Agents

Artificial Intelligence Chapter 7: Logical Agents Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent State University February 20, 2006 AI: Chapter 7: Logical Agents 1 Contents Knowledge Based Agents

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Compiling Knowledge into Decomposable Negation Normal Form

Compiling Knowledge into Decomposable Negation Normal Form Compiling Knowledge into Decomposable Negation Normal Form Adnan Darwiche Cognitive Systems Laboratory Department of Computer Science University of California Los Angeles, CA 90024 darwiche@cs. ucla. edu

More information

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel Foundations of AI 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard and Bernhard Nebel Contents Agents that think rationally The wumpus world Propositional logic: syntax and semantics

More information

Tecniche di Verifica. Introduction to Propositional Logic

Tecniche di Verifica. Introduction to Propositional Logic Tecniche di Verifica Introduction to Propositional Logic 1 Logic A formal logic is defined by its syntax and semantics. Syntax An alphabet is a set of symbols. A finite sequence of these symbols is called

More information

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning  Hanna Kurniawati COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati" Last week" Main components of PRM" Collision check for a configuration"

More information

Sums of Products. Pasi Rastas November 15, 2005

Sums of Products. Pasi Rastas November 15, 2005 Sums of Products Pasi Rastas November 15, 2005 1 Introduction This presentation is mainly based on 1. Bacchus, Dalmao and Pitassi : Algorithms and Complexity results for #SAT and Bayesian inference 2.

More information

Algorithms and Complexity of Constraint Satisfaction Problems (course number 3)

Algorithms and Complexity of Constraint Satisfaction Problems (course number 3) Algorithms and Complexity of Constraint Satisfaction Problems (course number 3) Nicolas (Miki) Hermann LIX, École Polytechnique hermann@lix.polytechnique.fr Miki Hermann Algorithms and Complexity of csp

More information

Introduction. Pvs.NPExample

Introduction. Pvs.NPExample Introduction Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 09 NP-Completeness (Chapter 34) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu I

More information