SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.

Slides:



Advertisements
Similar presentations
SAT Solver CS 680 Formal Methods Jeremy Johnson. 2 Disjunctive Normal Form  A Boolean expression is a Boolean function  Any Boolean function can be.
Advertisements

Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
Disjunctive Normal Form CS 680: Formal Methods Jeremy Johnson.
Models and Propositional Logic In propositional logic, a model in general simply fixes the truth value – true or false – for every proposition symbol.
Lecture 21 NP-complete problems
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
1 Discrete Structures CS 280 Example application of probability: MAX 3-SAT.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
Propositional Calculus Math Foundations of Computer Science.
Propositional Calculus Math Foundations of Computer Science.
Propositional Calculus CS 680: Formal Methods in Verification Computer Systems Jeremy Johnson.
Adapted from Discrete Math
Equational Reasoning Math Foundations of Computer Science.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Boolean Satisfiability and SAT Solvers
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Lecture 22 More NPC problems
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
HW #1. Due Mar 22 Midnight Verify the following program using SAT solver 1. Translate the program into a SSA form 2. Create a Boolean formula from.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CS6133 Software Specification and Verification
Disjunctive Normal Form CS 270: Math Foundation of CS Jeremy Johnson.
First-Order Logic and Inductive Logic Programming.
Review of Propositional Logic Syntax
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
Finding Models for Blocked 3-SAT Problems in Linear Time by Systematical Refinement of a Sub- Model Gábor Kusper Eszterházy Károly.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
NPC.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
Boolean Expression Evaluation CS 270: Math Foundations of CS Jeremy Johnson.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Propositional Calculus: Boolean Functions and Expressions
Disjunctive Normal Form
Propositional Calculus: Boolean Functions and Expressions
Intro to Theory of Computation
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
NP-Completeness Proofs
Introduction to the Boolean Satisfiability Problem
Introduction to the Boolean Satisfiability Problem
Disjunctive Normal Form
NP-Complete Problems.
Back to “Serious” Topics…
Presentation transcript:

SAT Solver Math Foundations of Computer Science

2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written as a Boolean expression  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) s x 0 x 1 f

3 Conjunctive Normal Form s x 0 x 1 f

4 Tautology Checker  A program can be written to check to see if a Boolean expression is a tautology.  Simply generate all possible truth assignments for the variables occurring in the expression and evaluate the expression with its variables set to each of these assignments. If the evaluated expressions are always true, then the given Boolean expression is a tautology.  A similar program can be written to check if any two Boolean expressions E1 and E2 are equivalent, i.e. if E1  E2. Such a program has been provided.

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)

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 a tautology  An assignment that evaluates to false provides a counter example to validity

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

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)

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)

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

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

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

Corresponding SAT problem

Constaints in CNF

DIMACS Format

Avionics Example

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

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

Avionics Example Programs]$./MiniSat_v1.14_linux aircraft assignment ==================================[MINISAT]=================================== | Conflicts | ORIGINAL | LEARNT | Progress | | | Clauses Literals | Limit Clauses Literals Lit/Cl | | ============================================================================== | 0 | | 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

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)