SAT Solver. CS 680 Formal Methods Jeremy Johnson

Size: px
Start display at page:

Download "SAT Solver. CS 680 Formal Methods Jeremy Johnson"

Transcription

1 SAT Solver CS 680 Formal Methods Jeremy Johnson

2 Disjunctive Normal Form A Boolean expression is a Boolean function Any Boolean function can be written as a Boolean expression s x 0 x 1 f Disjunctive normal form (sums of products) For each row in the truth table where the output is true, write a product such that the corresponding input is the only input combination that is true Not unique E.G. (multiplexor function)

3 Conjunctive Normal Form Conjunctive normal form (products of sums) For each row in the truth table where the output is false, write a sum such that the corresponding input not in that row Alternatively use Demorgan s law for the negation of dnf for f (zero rows) E.G. (multiplexor function) (s + x 0 + x 1 ) (s + x 0 + x 1 ) (s + x 0 + x 1 ) (s + x 0 + x 1 ) s x 0 x 1 f

4 Satisfiability A formula is satisfiable if there is an assignment to the variables that make the formula true A formula is unsatisfiable if all assignments to variables eval to false A formula is falsifiable if there is an assignment to the variables that make the formula false A formula is valid if all assignments to variables eval to true (a valid formula is a theorem or tautology)

5 Satisfiability Checking to see if a formula f is satisfiable can be done by searching a truth table for a true entry Exponential in the number of variables Does not appear to be a polynomial time algorithm (satisfiability is NP-complete) There are efficient satisfiability checkers that work well on many practical problems Checking whether f is satisfiable can be done by checking if f is not valid An assignment that evaluates to false provides a counter example to validity

6 DNF vs CNF It is easy to determine if a boolean expression in DNF is satisfiable but difficult to determine if it is valid It is easy to determine if a boolean expression in CNF is valid but difficult to determine if it is satisfiable It is possible to convert any boolean expression to DNF or CNF; however, there can be exponential blowup

7 Propositional Logic in ACL2 In beginner mode and above ACL2S B!>QUERY (thm (implies (and (booleanp p) (booleanp q)) (iff (implies p q) (or (not p) q)))) << Starting proof tree logging >> Q.E.D. Summary Form: ( THM...) Rules: NIL Time: 0.00 seconds (prove: 0.00, print: 0.00, proof tree: 0.00, other: 0.00) Proof succeeded.

8 Propositional Logic in ACL2 ACL2 >QUERY (thm (implies (and (booleanp p) (booleanp q)) (iff (xor p q) (or p q)))) **Summary of testing** We tested 500 examples across 1 subgoals, of which 1 (1 unique) satisfied the hypotheses, and found 1 counterexamples and 0 witnesses. We falsified the conjecture. Here are counterexamples: [found in : "Goal''"] (IMPLIES (AND (BOOLEANP P) (BOOLEANP Q) P) (NOT Q)) -- (P T) and (Q T)

9 SAT Solvers Input expected in CNF Using DIMACS format One clause per line delimited by 0 Variables encoded by integers, not variable encoded by negating integer We will use MiniSAT (minisat.se)

10 MiniSAT Example (x1 -x5 x4) & (-x1 x5 x3 x4) & (-x3 x4). DIMACS format (c = comment, p cnf = SAT problem in CNF) c SAT problem in CNF with 5 variables and 3 clauses p cnf

11 MiniSAT Example (x1 -x5 x4) & (-x1 x5 x3 x4) & (-x3 x4). This is MiniSat 2.0 beta ============================[ Problem Statistics ]================== Number of variables: 5 Number of clauses: 3 Parsing time: 0.00 s. SATISFIABLE v

12 Avionics Application Aircraft controlled by (real time) software applications (navigation, control, obstacle detection, obstacle avoidance ) Applications run on computers in different cabinets 500 apps 20 cabinets Apps 1, 2 and 3 must run in separate cabinets Problem: Find assignment of apps to cabinets that satisfies constraints

13 Corresponding SAT problem AC is a map from apps to cabinents [indicator variable] AC(app,cab) = t iff AC(app) = cab [Valid Mapping] a c AA a c a A c C AA a c [constaints] c AA 1 c AA 2 c AA 3 c c AA 2 c AA 3 c c C AA 1 c AA 2 c AA 3 c c C AA 2 c AA 3 c

14 Constaints in CNF c C AA 1 c AA 2 c AA 3 c c C AA 1 c AA 2 c AA 1 c AA 3 c c C AA c c 2 AA 3 c c c C AA 2 AA 3

15 DIMACS Format Var(AA a c ) = 20(a-1)+c c c AA 1 AA 2 = -c (20+c) c c AA 1 AA 3 = -c -(40+c) AA 1 20 a AA a = 20(a-1)+1 20(a-1)

16 Avionics Example 10 apps and 5 cabinets Var(AA c a ) = 5(a-1)+c 50 variables 25 clauses Valid Map a=1 10 AA a 1 AA a 5 Constaints c c c C AA 1 AA 2 c c c C AA 1 AA 3 c c c C AA 2 AA 3

17 Avionics Example p cnf c clauses for valid map forall a exists c AC^c_a

18 Avionics Example c constaints ~AC^c_1 + ~AC^c_2 and ~AC^c_1 + ~AC^c_ c constraint ~AC^c_2 + ~AC^c_

19 Avionics Example Programs]$./MiniSat_v1.14_linux aircraft assignment ==================================[MINISAT]=================================== Conflicts ORIGINAL LEARNT Progress Clauses Literals Limit Clauses Literals Lit/Cl ============================================================================== nan % ============================================================================== restarts : 1 conflicts : 0 (nan /sec) decisions : 39 (inf /sec) propagations : 50 (inf /sec) conflict literals : 0 ( nan % deleted) Memory used : 1.67 MB CPU time : 0 s SATISFIABLE

20 Avionics Assignment SAT True indicator variables: 3 = 5*0 + 3 => AC(1,3) 7 = 5*1 + 2 => AC(2,2) 11 = 5*2 + 1 => AC(3,1) 16 = 5*3+1 => AC(4,1) 21 = 5*4+1 => AC(5,1) 26 = 5*5=1 => AC(6,1) 31 = 5*6+1 => AC(7,1) 36 = 5*7+1 => AC(8,1) 41 = 5*8 + 1 => AC(9,1) 46 = 5*9+1 => AC(10,1)

21 DPLL Algorithm Tries to incrementally build a satisfying assignment A: V {T,F} (partial assignment) for a formula ϕ in CNF A is grown by either Deducing a truth value for a literal Whenever all literals except one are F then the remaining literal must be T (unit propagation) Guessing a truth value Backtrack when guess (leads to inconsistency) is wrong

22 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1

23 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1 1 2, 2 3 4, 1 2, 1 3 4, 1

24 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 2 1 2, 2 3 4, 1 2, 1 3 4, 1

25 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Guess 1, 2, 3 1 2, 2 3 4, 1 2, 1 3 4, 1

26 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Guess 1, 2, 3 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 1, 2, 3, 4 1 2, 2 3 4, 1 2, 1 3 4, 1 Inconsistency

27 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce , 2 3 4, 1 2, 1 3 4, 1 Deduce 2 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Guess 3 1, 2, 3 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 4 1, 2, 3, 4 1 2, 2 3 4, 1 2, 1 3 4, 1 Undo 3 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Backtrack

28 DPLL Example Operation Assign Formula 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce , 2 3 4, 1 2, 1 3 4, 1 Deduce 2 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Guess 3 1, 2, 3 1 2, 2 3 4, 1 2, 1 3 4, 1 Deduce 4 1, 2, 3, 4 1 2, 2 3 4, 1 2, 1 3 4, 1 Undo 3 1, 2 1 2, 2 3 4, 1 2, 1 3 4, 1 Guess 3 1, 2, 3 1 2, 2 3 4, 1 2, 1 3 4, 1 Assignment found

Propositional Calculus. Math Foundations of Computer Science

Propositional Calculus. Math Foundations of Computer Science Propositional Calculus Math Foundations of Computer Science Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they can use it to

More information

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Algebra and Simplification CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Topics Motivation: Simplifying Conditional Expressions

More information

PROPOSITIONAL LOGIC (2)

PROPOSITIONAL LOGIC (2) PROPOSITIONAL LOGIC (2) based on Huth & Ruan Logic in Computer Science: Modelling and Reasoning about Systems Cambridge University Press, 2004 Russell & Norvig Artificial Intelligence: A Modern Approach

More information

8 NP-complete problem Hard problems: demo

8 NP-complete problem Hard problems: demo Ch8 NPC Millennium Prize Problems http://en.wikipedia.org/wiki/millennium_prize_problems 8 NP-complete problem Hard problems: demo NP-hard (Non-deterministic Polynomial-time hard), in computational complexity

More information

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Finite Model Generation for Isabelle/HOL Using a SAT Solver Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly

More information

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Functions and Expressions CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and

More information

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus

More information

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman. Decision Procedures An Algorithmic Point of View Decision Procedures for Propositional Logic D. Kroening O. Strichman ETH/Technion Version 1.0, 2007 Part I Decision Procedures for Propositional Logic Outline

More information

Deductive Methods, Bounded Model Checking

Deductive Methods, Bounded Model Checking Deductive Methods, Bounded Model Checking http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Deductive methods Pavel Parízek Deductive Methods, Bounded

More information

Propositional Calculus. Math Foundations of Computer Science

Propositional Calculus. Math Foundations of Computer Science Propositional Calculus Math Foundations of Computer Science Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they can use it to

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Other NP-Complete Problems Haniel Barbosa Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Sections 7.4 and 7.5. The 3SAT

More information

NP-Completeness. Algorithms

NP-Completeness. Algorithms NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

Seminar decision procedures: Certification of SAT and unsat proofs

Seminar decision procedures: Certification of SAT and unsat proofs Seminar decision procedures: Certification of SAT and unsat proofs Wolfgang Nicka Technische Universität München June 14, 2016 Boolean satisfiability problem Term The boolean satisfiability problem (SAT)

More information

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses 1.4 Normal Forms We define conjunctions of formulas as follows: 0 i=1 F i =. 1 i=1 F i = F 1. n+1 i=1 F i = n i=1 F i F n+1. and analogously disjunctions: 0 i=1 F i =. 1 i=1 F i = F 1. n+1 i=1 F i = n

More information

Mixed Integer Linear Programming

Mixed Integer Linear Programming Mixed Integer Linear Programming Part I Prof. Davide M. Raimondo A linear program.. A linear program.. A linear program.. Does not take into account possible fixed costs related to the acquisition of new

More information

Symbolic Methods. The finite-state case. Martin Fränzle. Carl von Ossietzky Universität FK II, Dpt. Informatik Abt.

Symbolic Methods. The finite-state case. Martin Fränzle. Carl von Ossietzky Universität FK II, Dpt. Informatik Abt. Symbolic Methods The finite-state case Part I Martin Fränzle Carl von Ossietzky Universität FK II, Dpt. Informatik Abt. Hybride Systeme 02917: Symbolic Methods p.1/34 What you ll learn How to use and manipulate

More information

Implementation of a Sudoku Solver Using Reduction to SAT

Implementation of a Sudoku Solver Using Reduction to SAT Implementation of a Sudoku Solver Using Reduction to SAT For this project you will develop a Sudoku solver that receives an input puzzle and computes a solution, if one exists. Your solver will: read an

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding

More information

EECS 219C: Formal Methods Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Formal Methods Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Formal Methods Boolean Satisfiability Solving Sanjit A. Seshia EECS, UC Berkeley The Boolean Satisfiability Problem (SAT) Given: A Boolean formula F(x 1, x 2, x 3,, x n ) Can F evaluate to 1

More information

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT 3SAT The 3SAT problem is the following. INSTANCE : Given a boolean expression E in conjunctive normal form (CNF) that is the conjunction of clauses, each

More information

NP and computational intractability. Kleinberg and Tardos, chapter 8

NP and computational intractability. Kleinberg and Tardos, chapter 8 NP and computational intractability Kleinberg and Tardos, chapter 8 1 Major Transition So far we have studied certain algorithmic patterns Greedy, Divide and conquer, Dynamic programming to develop efficient

More information

Boolean Functions (Formulas) and Propositional Logic

Boolean Functions (Formulas) and Propositional Logic EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving Part I: Basics Sanjit A. Seshia EECS, UC Berkeley Boolean Functions (Formulas) and Propositional Logic Variables: x 1, x 2, x 3,, x

More information

Where Can We Draw The Line?

Where Can We Draw The Line? Where Can We Draw The Line? On the Hardness of Satisfiability Problems Complexity 1 Introduction Objectives: To show variants of SAT and check if they are NP-hard Overview: Known results 2SAT Max2SAT Complexity

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions 8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.

More information

Integrating a SAT Solver with Isabelle/HOL

Integrating a SAT Solver with Isabelle/HOL Integrating a SAT Solver with / Tjark Weber (joint work with Alwen Tiu et al.) webertj@in.tum.de First Munich-Nancy Workshop on Decision Procedures for Theorem Provers March 6th & 7th, 2006 Integrating

More information

SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013

SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013 SAT Solvers Ranjit Jhala, UC San Diego April 9, 2013 Decision Procedures We will look very closely at the following 1. Propositional Logic 2. Theory of Equality 3. Theory of Uninterpreted Functions 4.

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning

More information

Normal Forms for Boolean Expressions

Normal Forms for Boolean Expressions Normal Forms for Boolean Expressions A NORMAL FORM defines a class expressions s.t. a. Satisfy certain structural properties b. Are usually universal: able to express every boolean function 1. Disjunctive

More information

Computer-Aided Program Design

Computer-Aided Program Design Computer-Aided Program Design Spring 2015, Rice University Unit 1 Swarat Chaudhuri January 22, 2015 Reasoning about programs A program is a mathematical object with rigorous meaning. It should be possible

More information

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

Massively Parallel Seesaw Search for MAX-SAT

Massively Parallel Seesaw Search for MAX-SAT Massively Parallel Seesaw Search for MAX-SAT Harshad Paradkar Rochester Institute of Technology hp7212@rit.edu Prof. Alan Kaminsky (Advisor) Rochester Institute of Technology ark@cs.rit.edu Abstract The

More information

DM841 DISCRETE OPTIMIZATION. Part 2 Heuristics. Satisfiability. Marco Chiarandini

DM841 DISCRETE OPTIMIZATION. Part 2 Heuristics. Satisfiability. Marco Chiarandini DM841 DISCRETE OPTIMIZATION Part 2 Heuristics Satisfiability Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline 1. Mathematical Programming Constraint

More information

SAT and Termination. Nao Hirokawa. Japan Advanced Institute of Science and Technology. SAT and Termination 1/41

SAT and Termination. Nao Hirokawa. Japan Advanced Institute of Science and Technology. SAT and Termination 1/41 SAT and Termination Nao Hirokawa Japan Advanced Institute of Science and Technology SAT and Termination 1/41 given 9 9-grid like Sudoku Puzzle 1 8 7 3 2 7 7 1 6 4 3 4 5 3 2 8 6 fill out numbers from 1

More information

CSP- and SAT-based Inference Techniques Applied to Gnomine

CSP- and SAT-based Inference Techniques Applied to Gnomine CSP- and SAT-based Inference Techniques Applied to Gnomine Bachelor Thesis Faculty of Science, University of Basel Department of Computer Science Artificial Intelligence ai.cs.unibas.ch Examiner: Prof.

More information

Boolean Representations and Combinatorial Equivalence

Boolean Representations and Combinatorial Equivalence Chapter 2 Boolean Representations and Combinatorial Equivalence This chapter introduces different representations of Boolean functions. It then discusses the applications of these representations for proving

More information

Reductions and Satisfiability

Reductions and Satisfiability Reductions and Satisfiability 1 Polynomial-Time Reductions reformulating problems reformulating a problem in polynomial time independent set and vertex cover reducing vertex cover to set cover 2 The Satisfiability

More information

Formally Certified Satisfiability Solving

Formally Certified Satisfiability Solving SAT/SMT Proof Checking Verifying SAT Solver Code Future Work Computer Science, The University of Iowa, USA April 23, 2012 Seoul National University SAT/SMT Proof Checking Verifying SAT Solver Code Future

More information

4.1 Review - the DPLL procedure

4.1 Review - the DPLL procedure Applied Logic Lecture 4: Efficient SAT solving CS 4860 Spring 2009 Thursday, January 29, 2009 The main purpose of these notes is to help me organize the material that I used to teach today s lecture. They

More information

CS February 17

CS February 17 Discrete Mathematics CS 26 February 7 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x n,..x n ) B, F (x,..x n ) = G (x,..x n ) Example: F(x,y,z) = x(y+z), G(x,y,z)

More information

Satisfiability (SAT) Applications. Extensions/Related Problems. An Aside: Example Proof by Machine. Annual Competitions 12/3/2008

Satisfiability (SAT) Applications. Extensions/Related Problems. An Aside: Example Proof by Machine. Annual Competitions 12/3/2008 15 53:Algorithms in the Real World Satisfiability Solvers (Lectures 1 & 2) 1 Satisfiability (SAT) The original NP Complete Problem. Input: Variables V = {x 1, x 2,, x n }, Boolean Formula Φ (typically

More information

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT 1 Satisfiability (SAT) Problem 2 Boolean Expressions Boolean,

More information

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving Sanjit A. Seshia EECS, UC Berkeley Project Proposals Due Friday, February 13 on bcourses Will discuss project topics on Monday Instructions

More information

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

SAT-CNF Is N P-complete

SAT-CNF Is N P-complete SAT-CNF Is N P-complete Rod Howell Kansas State University November 9, 2000 The purpose of this paper is to give a detailed presentation of an N P- completeness proof using the definition of N P given

More information

2SAT Andreas Klappenecker

2SAT Andreas Klappenecker 2SAT Andreas Klappenecker The Problem Can we make the following boolean formula true? ( x y) ( y z) (z y)! Terminology A boolean variable is a variable that can be assigned the values true (T) or false

More information

Dipartimento di Elettronica Informazione e Bioingegneria. Cognitive Robotics. SATplan. Act1. Pre1. Fact. G. Gini Act2

Dipartimento di Elettronica Informazione e Bioingegneria. Cognitive Robotics. SATplan. Act1. Pre1. Fact. G. Gini Act2 Dipartimento di Elettronica Informazione e Bioingegneria Cognitive Robotics SATplan Pre1 Pre2 @ 2015 Act1 Act2 Fact why SAT (satisfability)? 2 Classical planning has been observed as a form of logical

More information

What's the difference between the entailment symbol with the equals vs the entailment symbol with one line? Single turnstile meaning

What's the difference between the entailment symbol with the equals vs the entailment symbol with one line? Single turnstile meaning Propositional connectives, satisfying values, Get expression from venn diagram Definitions (tautology, satisfiability, etc) and basic entailment and arrow rule 3-sat to 2-sat, turning a cnf into arrow

More information

Chapter 2 PRELIMINARIES

Chapter 2 PRELIMINARIES 8 Chapter 2 PRELIMINARIES Throughout this thesis, we work with propositional or Boolean variables, that is, variables that take value in the set {true, false}. A propositional formula F representing a

More information

BITCOIN MINING IN A SAT FRAMEWORK

BITCOIN MINING IN A SAT FRAMEWORK BITCOIN MINING IN A SAT FRAMEWORK Jonathan Heusser @jonathanheusser DISCLAIMER JUST TO BE CLEAR.. This is research! Not saying ASICs suck I am not a cryptographer, nor SAT solver guy WTF REALISED PHD RESEARCH

More information

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion Using a Lazy CNF Conversion Stéphane Lescuyer Sylvain Conchon Université Paris-Sud / CNRS / INRIA Saclay Île-de-France FroCoS 09 Trento 18/09/2009 Outline 1 Motivation and background Verifying an SMT solver

More information

Learning a SAT Solver from Single-

Learning a SAT Solver from Single- Learning a SAT Solver from Single- Bit Supervision Daniel Selsman, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo de Moura and David L. Dill Presented By Aditya Sanghi Overview NeuroSAT Background:

More information

EXTENDING SAT SOLVER WITH PARITY CONSTRAINTS

EXTENDING SAT SOLVER WITH PARITY CONSTRAINTS TKK Reports in Information and Computer Science Espoo 2010 TKK-ICS-R32 EXTENDING SAT SOLVER WITH PARITY CONSTRAINTS Tero Laitinen TKK Reports in Information and Computer Science Espoo 2010 TKK-ICS-R32

More information

SAT Solver Heuristics

SAT Solver Heuristics SAT Solver Heuristics SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) Able to solve 10-15 variable problems Satz (Chu Min Li, 1995) Able to solve some 1000 variable problems

More information

An Introduction to SAT Solvers

An Introduction to SAT Solvers An Introduction to SAT Solvers Knowles Atchison, Jr. Fall 2012 Johns Hopkins University Computational Complexity Research Paper December 11, 2012 Abstract As the first known example of an NP Complete problem,

More information

CS 267: Automated Verification. Lecture 13: Bounded Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 13: Bounded Model Checking. Instructor: Tevfik Bultan CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan Remember Symbolic Model Checking Represent sets of states and the transition relation as Boolean logic formulas

More information

Study of efficient techniques for implementing a Pseudo-Boolean solver based on cutting planes

Study of efficient techniques for implementing a Pseudo-Boolean solver based on cutting planes DEGREE PROJECT IN COMPUTER ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM, SWEDEN 2017 Study of efficient techniques for implementing a Pseudo-Boolean solver based on cutting planes ALEIX SACREST GASCON

More information

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT 20170926 CNF-SAT: CNF-SAT is a problem in NP, defined as follows: Let E be a Boolean expression with m clauses and n literals (literals = variables, possibly negated), in which - each clause contains only

More information

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.

More information

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements. Desiderata Reductions Desiderata. Classify problems according to their computational requirements. Frustrating news. Huge number of fundamental problems have defied classification for decades. Desiderata'.

More information

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY Satisfiability Michail G. Lagoudakis Department of Computer Science Duke University Durham, NC 27708 COMPSCI 271 - Spring 2001 DUKE UNIVERSITY Page 1 Why SAT? Historical Reasons The first NP-COMPLETE problem

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

(p 300) Theorem 7.27 SAT is in P iff P=NP

(p 300) Theorem 7.27 SAT is in P iff P=NP pp. 292-311. The Class NP-Complete (Sec. 7.4) P = {L L decidable in poly time} NP = {L L verifiable in poly time} Certainly all P is in NP Unknown if NP is bigger than P (p. 299) NP-Complete = subset of

More information

SAT Solver and its Application to Combinatorial Problems

SAT Solver and its Application to Combinatorial Problems SAT Solver and its Application to Combinatorial Problems Naoyuki Tamura Kobe University 2014 December 14th, 2014 1 / 46 Contents 1 SAT Problems and SAT Solvers SAT Problems SAT Solvers Don Knuth s TAOCP

More information

versat: A Verified Modern SAT Solver

versat: A Verified Modern SAT Solver Computer Science, The University of Iowa, USA Satisfiability Problem (SAT) Is there a model for the given propositional formula? Model: assignments to the variables that makes the formula true. SAT if

More information

Some Hardness Proofs

Some Hardness Proofs Some Hardness Proofs Magnus Lie Hetland January 2011 This is a very brief overview of some well-known hard (NP Hard and NP complete) problems, and the main ideas behind their hardness proofs. The document

More information

Combining forces to solve Combinatorial Problems, a preliminary approach

Combining forces to solve Combinatorial Problems, a preliminary approach Combining forces to solve Combinatorial Problems, a preliminary approach Mohamed Siala, Emmanuel Hebrard, and Christian Artigues Tarbes, France Mohamed SIALA April 2013 EDSYS Congress 1 / 19 Outline Context

More information

Planning as Search. Progression. Partial-Order causal link: UCPOP. Node. World State. Partial Plans World States. Regress Action.

Planning as Search. Progression. Partial-Order causal link: UCPOP. Node. World State. Partial Plans World States. Regress Action. Planning as Search State Space Plan Space Algorihtm Progression Regression Partial-Order causal link: UCPOP Node World State Set of Partial Plans World States Edge Apply Action If prec satisfied, Add adds,

More information

SAT-based Model Checking for C programs

SAT-based Model Checking for C programs SAT-based Model Checking for C programs Moonzoo Kim Provable Software Lab. CS Division of EE 1 Formal Methods Definition in Wikepedia Formal methods are mathematically-based techniques for the specification,

More information

Randomness and Computation March 25, Lecture 5

Randomness and Computation March 25, Lecture 5 0368.463 Randomness and Computation March 25, 2009 Lecturer: Ronitt Rubinfeld Lecture 5 Scribe: Inbal Marhaim, Naama Ben-Aroya Today Uniform generation of DNF satisfying assignments Uniform generation

More information

Induction Schemes. Math Foundations of Computer Science

Induction Schemes. Math Foundations of Computer Science Induction Schemes Math Foundations of Computer Science Topics Induction Example Induction scheme over the naturals Termination Reduction to equational reasoning ACL2 proof General Induction Schemes Induction

More information

Answer Key #1 Phil 414 JL Shaheen Fall 2010

Answer Key #1 Phil 414 JL Shaheen Fall 2010 Answer Key #1 Phil 414 JL Shaheen Fall 2010 1. 1.42(a) B is equivalent to B, and so also to C, where C is a DNF formula equivalent to B. (By Prop 1.5, there is such a C.) Negated DNF meets de Morgan s

More information

SAT/SMT Solvers and Applications

SAT/SMT Solvers and Applications SAT/SMT Solvers and Applications University of Waterloo Winter 2013 Today s Lecture Lessons learnt so far Implementation-related attacks (control-hazard, malware,...) Program analysis techniques can detect

More information

Lecture 14: Lower Bounds for Tree Resolution

Lecture 14: Lower Bounds for Tree Resolution IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 14: Lower Bounds for Tree Resolution David Mix Barrington and Alexis Maciel August

More information

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns Chapter 8 NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic

More information

New Encodings of Pseudo-Boolean Constraints into CNF

New Encodings of Pseudo-Boolean Constraints into CNF New Encodings of Pseudo-Boolean Constraints into CNF Olivier Bailleux, Yacine Boufkhad, Olivier Roussel olivier.bailleux@u-bourgogne.fr boufkhad@liafa.jussieu.fr roussel@cril.univ-artois.fr New Encodings

More information

QuteSat. A Robust Circuit-Based SAT Solver for Complex Circuit Structure. Chung-Yang (Ric) Huang National Taiwan University

QuteSat. A Robust Circuit-Based SAT Solver for Complex Circuit Structure. Chung-Yang (Ric) Huang National Taiwan University QuteSat A Robust Circuit-Based SAT Solver for Complex Circuit Structure Chung-Yang (Ric) Huang National Taiwan University To appear: DATE 27 2/1/27 Fact Sheet (Background) Boolean Satisfiability (SAT)

More information

Lecture 2: Symbolic Model Checking With SAT

Lecture 2: Symbolic Model Checking With SAT Lecture 2: Symbolic Model Checking With SAT Edmund M. Clarke, Jr. School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 (Joint work over several years with: A. Biere, A. Cimatti, Y.

More information

Example: Map coloring

Example: Map coloring Today s s lecture Local Search Lecture 7: Search - 6 Heuristic Repair CSP and 3-SAT Solving CSPs using Systematic Search. Victor Lesser CMPSCI 683 Fall 2004 The relationship between problem structure and

More information

Binary Decision Diagrams

Binary Decision Diagrams Logic and roof Hilary 2016 James Worrell Binary Decision Diagrams A propositional formula is determined up to logical equivalence by its truth table. If the formula has n variables then its truth table

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Practical SAT Solving

Practical SAT Solving Practical SAT Solving Lecture 5 Carsten Sinz, Tomáš Balyo May 23, 2016 INSTITUTE FOR THEORETICAL COMPUTER SCIENCE KIT University of the State of Baden-Wuerttemberg and National Laboratory of the Helmholtz

More information

CS-E3220 Declarative Programming

CS-E3220 Declarative Programming CS-E3220 Declarative Programming Lecture 5: Premises for Modern SAT Solving Aalto University School of Science Department of Computer Science Spring 2018 Motivation The Davis-Putnam-Logemann-Loveland (DPLL)

More information

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W. : Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity

More information

A Satisfiability Procedure for Quantified Boolean Formulae

A Satisfiability Procedure for Quantified Boolean Formulae A Satisfiability Procedure for Quantified Boolean Formulae David A. Plaisted Computer Science Department, University of North Carolina Chapel Hill, NC 27599-3175, USA Armin Biere ETH Zürich, Computer Systems

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

Solving Constraint Satisfaction Problems by a SAT Solver

Solving Constraint Satisfaction Problems by a SAT Solver SAT Encodings Sugar Examples Demo Summary Solving Constraint Satisfaction Problems by a SAT Solver Kobe University, JAPAN CICLOPS-WLPE-2010 SAT Encodings Sugar Examples Demo Summary Contents 3 A SAT-based

More information

1 Introduction. 1. Prove the problem lies in the class NP. 2. Find an NP-complete problem that reduces to it.

1 Introduction. 1. Prove the problem lies in the class NP. 2. Find an NP-complete problem that reduces to it. 1 Introduction There are hundreds of NP-complete problems. For a recent selection see http://www. csc.liv.ac.uk/ ped/teachadmin/comp202/annotated_np.html Also, see the book M. R. Garey and D. S. Johnson.

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 11/23/99 NP-completeness of 3SAT, Minimum Vertex Cover, Maximum Independent Set, Boolean Formulae A Boolean formula is an expression that we can build starting from Boolean

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions. CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT

More information

A First Step Towards a Unified Proof Checker for QBF

A First Step Towards a Unified Proof Checker for QBF A First Step Towards a Unified Proof Checker for QBF Toni Jussila 1, Armin Biere 1, Carsten Sinz 2, Daniel Kröning 3, and Christoph M. Wintersteiger 3 1 Formal Models and Verification, Johannes Kepler

More information

Decision Procedures for Equality Logic. Daniel Kroening and Ofer Strichman 1

Decision Procedures for Equality Logic. Daniel Kroening and Ofer Strichman 1 in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1 Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions

More information

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns 8. NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic programming.

More information

Solving 3-SAT. Radboud University Nijmegen. Bachelor Thesis. Supervisors: Henk Barendregt Alexandra Silva. Author: Peter Maandag s

Solving 3-SAT. Radboud University Nijmegen. Bachelor Thesis. Supervisors: Henk Barendregt Alexandra Silva. Author: Peter Maandag s Solving 3-SAT Radboud University Nijmegen Bachelor Thesis Author: Peter Maandag s3047121 Supervisors: Henk Barendregt Alexandra Silva July 2, 2012 Contents 1 Introduction 2 1.1 Problem context............................

More information

Decision Procedures in First Order Logic

Decision Procedures in First Order Logic in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1 Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions

More information

Better test results for the graph coloring and the Pigeonhole Problems using DPLL with k-literal representation

Better test results for the graph coloring and the Pigeonhole Problems using DPLL with k-literal representation Proceedings of the 7 th International Conference on Applied Informatics Eger, Hungary, January 28 31, 2007. Vol. 2. pp. 127 135. Better test results for the graph coloring and the Pigeonhole Problems using

More information

Constraint Reasoning Part 2: SAT, PB, WCSP

Constraint Reasoning Part 2: SAT, PB, WCSP Constraint Reasoning Part 2: SAT, PB, WCSP Olivier ROUSSEL roussel@cril.univ-artois.fr CRIL-CNRS UMR 8188 Université d Artois Lens, France Tutorial ECAI 2012 Montpellier August, 22 2012 Constraint Reasoning

More information

Markov Logic: Representation

Markov Logic: Representation Markov Logic: Representation Overview Statistical relational learning Markov logic Basic inference Basic learning Statistical Relational Learning Goals: Combine (subsets of) logic and probability into

More information

Multi Domain Logic and its Applications to SAT

Multi Domain Logic and its Applications to SAT Multi Domain Logic and its Applications to SAT Tudor Jebelean RISC Linz, Austria Tudor.Jebelean@risc.uni-linz.ac.at Gábor Kusper Eszterházy Károly College gkusper@aries.ektf.hu Abstract We describe a new

More information