© 2012 IBM Corporation Perfect Hashing and CNF Encodings of Cardinality Constraints Yael Ben-Haim Alexander Ivrii Oded Margalit Arie Matsliah SAT 2012.

Slides:



Advertisements
Similar presentations
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Advertisements

A New SAT Encoding of the At- Most-One Constraint Jingchao Chen Donghua University, China.
1 Constraint operations: Simplification, Optimization and Implication.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
1 Chapter 2: Simplification, Optimization and Implication Where we learn more fun things we can do with constraints.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Maximum-Likelihood estimation Consider as usual a random sample x = x 1, …, x n from a distribution with p.d.f. f (x;  ) (and c.d.f. F(x;  ) ) The maximum.
1 Discrete Structures CS 280 Example application of probability: MAX 3-SAT.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
1 Joint work with Shmuel Safra. 2 Motivation 3 Motivation.
Cardinality & Sorting Networks. Cardinality constraint Appears in many practical problems: scheduling, timetabling etc’. Also takes place in the Max-Sat.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Incremental formal verification of hardware Hana Chockler Alexander Ivrii Arie Matsliah Shiri Moran Ziv Nevo IBM Research - Haifa.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
On Finding All Minimally Unsatisfiable Subformulas Mark Liffiton and Karem Sakallah University of Michigan {liffiton, June 21, 2005.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Implicit Hitting Set Problems Richard M. Karp Erick Moreno Centeno DIMACS 20 th Anniversary.
Finding Models for Blocked 3-SAT Problems in Linear Time by Systematical Refinement of a Sub- Model Gábor Kusper Eszterházy Károly.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
Non-LP-Based Approximation Algorithms Fabrizio Grandoni IDSIA
Solving Weakened Cryptanalysis Problems for the Bivium Keystream Generator in the Volunteer Computing Project Oleg Zaikin, Alexander Semenov,
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
The simple linear regression model and parameter estimation
Introduction to Algorithms
Probabilistic Inference Modulo Theories
Hybrid BDD and All-SAT Method for Model Checking
Hard Problems Some problems are hard to solve.
Chapter 2: Simplification, Optimization and Implication
Inference and search for the propositional satisfiability problem
Gábor Kusper University of Linz RISC Austria
Recovering and Exploiting Structural Knowledge from CNF Formulas
Introduction to Software Verification
Background: Lattices and the Learning-with-Errors problem
Intro to Theory of Computation
LPSAT: A Unified Approach to RTL Satisfiability
SAT-Based Area Recovery in Technology Mapping
NP-Completeness Proofs
Canonical Computation without Canonical Data Structure
Canonical Computation Without Canonical Data Structure
Interactive Proofs Adapted from Oded Goldreich’s course lecture notes.
Resolution Proofs for Combinational Equivalence
Introduction to Algorithms
Canonical Computation without Canonical Data Structure
NP-Completeness Yin Tat Lee
Interactive Proofs Adapted from Oded Goldreich’s course lecture notes.
Interactive Proofs Adapted from Oded Goldreich’s course lecture notes.
Canonical Computation without Canonical Data Structure
CSE 589 Applied Algorithms Spring 1999
SAT-based Methods: Logic Synthesis and Technology Mapping
Instructor: Aaron Roth
Faster Extraction of High-Level Minimal Unsatisfiable Cores
Verifying Clausal Proofs, DRUPing and Interpolants SAT/SMT Seminar
Interactive Proofs Adapted from Oded Goldreich’s course lecture notes.
Presentation transcript:

© 2012 IBM Corporation Perfect Hashing and CNF Encodings of Cardinality Constraints Yael Ben-Haim Alexander Ivrii Oded Margalit Arie Matsliah SAT 2012 IBM Research - Haifa

© 2007 IBM Corporation 2 © 2012 IBM Corporation 2 Talk outline  Introduction to cardinality constraints and their encodings.  Definition of perfect hash families.  New encodings for the “at most k” constraint based on perfect hash families – An encoding that preserves arc consistency under unit propagation. – A “hybrid” encoding that partially preserves arc consistency under unit propagation.  Encoding the “at least k” constraint.

© 2007 IBM Corporation 3 © 2012 IBM Corporation 3 Cardinality constraints  Let be Boolean variables.  A cardinality constraint is of the form “at most / at least / exactly k out of are TRUE”, i.e., in the at most case:  Cardinality constraints are common in many problems – In constraint programming. – In formal verification. – MAXSAT and other optimization problems.

© 2007 IBM Corporation 4 © 2012 IBM Corporation 4 Cardinality constraints (cont.)  Handling of cardinality constraints – Treat them as linear inequalities or Pseudo-Boolean constraints. – Enhance a SAT solver. – Encode to CNF and run with a regular SAT solver.

© 2007 IBM Corporation 5 © 2012 IBM Corporation 5 Definition of encoding  A CNF encoding of a cardinality constraint is a formula F on the variables and the auxiliary variables such that: – SAT before remains SAT after: Every assignment to with at most k TRUEs, can be extended to an assignment on that satisfies F. – UNSAT before remains UNSAT after: for any assignment to with more than k TRUEs, there is no extension to such that F is satisfied.

© 2007 IBM Corporation 6 © 2012 IBM Corporation 6 Properties of efficient encodings  An efficient encoding encodes problems with cardinality constraints to CNF formulas that can be quickly solved by a SAT solver.  Typically, an efficient encoding has the following properties: – Few clauses. – Few auxiliary variables. – If a partial assignment on assigns TRUE to exactly k variables, then unit propagation assigns FALSE to all other Xs. In this case, we say that the encoding preserves arc consistency under unit propagation.

© 2007 IBM Corporation 7 © 2012 IBM Corporation 7 Example: the naïve encoding  The naïve encoding of the constraint :  Properties: – clauses. – 0 auxiliary variables. – Arc consistency is preserved under unit propagation.

© 2007 IBM Corporation 8 © 2012 IBM Corporation 8 Known and new encodings  An encoding that does not preserve arc consistency under unit propagation – Parallel counter [Sin05]  An encoding that partially preserves arc consistency under unit propagation – Hybrid PHF – new  Encodings that preserve arc consistency under unit propagation – Naïve – Sequential counter [Sin05] – Cardinality networks [ANOR09] – PHF – new

© 2007 IBM Corporation 9 © 2012 IBM Corporation 9 Perfect hashing  Perfect hash families are known and well studied combinatorial structures.  A handful of applications – Database management. – Group testing algorithms. – Cryptography: secret sharing, key distribution patterns.  We will use PHFs as ingredients of our encodings.

© 2007 IBM Corporation 10 © 2012 IBM Corporation 10 An (n,l,r,m) perfect hash family  is a collection of functions Each function maps to such that for every subset S of, of size, there is a function such that

© 2007 IBM Corporation 11 © 2012 IBM Corporation 11 Encodings based on perfect hash families  Task: encode the constraint  Ingredient: an (n,k+1,r,m) perfect hash family  Encoding steps: after the example.

© 2007 IBM Corporation 12 © 2012 IBM Corporation 12

© 2007 IBM Corporation 13 © 2012 IBM Corporation 13 Encodings based on perfect hash families  Assuming that we have an (n,l=k+1,r,m) perfect hash family  Encoding steps: for each – Introduce r auxiliary variables – Add clauses for all – Encode the constraint using the sequential counter encoding.  A reduction – From one cardinality constraint on n variables – To a set of implication clauses and several cardinality constraints on r variables

© 2007 IBM Corporation 14 © 2012 IBM Corporation 14 Encodings based on perfect hash families  It remains to choose the underlying perfect hash family.  A handful of constructions, striving to minimize m (the number of hash functions) – Random and explicit. – For various ranges of the parameters. – Related to error correcting codes, combinatorial designs, Latin squares and orthogonal arrays, and more.  For, random constructions yield perfect hash families with

© 2007 IBM Corporation 15 © 2012 IBM Corporation 15 Known and new encodings  An encoding that does not preserve arc consistency under unit propagation – Parallel counter [Sin05]  An encoding that partially preserves arc consistency under unit propagation – Hybrid PHF – new  Encodings that preserve arc consistency under unit propagation – Naïve – Sequential counter [Sin05] – Cardinality networks [ANOR09] – PHF – new

© 2007 IBM Corporation 16 © 2012 IBM Corporation 16 Hybrid encodings  Ingredient: a collection of m hash functions not necessarily forming a perfect hash family.  Encoding steps – Encode to CNF using some encoding. AND IN ADDITION – Follow the same encoding steps as for perfect hash families: introduce auxiliary variables, add implication clauses, encode m “at most k constraints” on r variables.  For a choice of a nearly perfect hash family, we obtain a nearly perfect consistency preservation: for most of k-triplets of Xs, if a partial assignment sets them to TRUE then unit propagation will assign FALSE to all other Xs.

© 2007 IBM Corporation 17 © 2012 IBM Corporation 17 At least constraints  Our encodings (as well as others) are designed to be efficient when k is small relative to n. – An approach saying that the “at least k constraint” is equivalent to the “at most n-k constraint” will not work for small k.  We designed a sequential counter encoding for the “at least k constraint” with clauses and auxiliary variables.  We designed a PHF encoding for the “at least k constraint” with clauses and auxiliary variables. – Number of clauses is small but their length is not constant.

© 2007 IBM Corporation 18 © 2012 IBM Corporation 18 Summary  Our contribution – A new encoding of cardinality constraints to CNF based on perfect hash families. – A new hybrid encoding. – Similar encodings for the “at least k constraint”. – Empirical results.  Take home message – Use combinatorial structures (e.g. block designs or error- correcting codes) as building blocks in encodings of constraints to CNF.