Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College.

Slides:



Advertisements
Similar presentations
Course Summary What have we learned and what are we expected to know?
Advertisements

MATH 224 – Discrete Mathematics
Satisfiability Modulo Theories (An introduction)
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Data Structures for SAT Solvers The 2-Literal Representation Gábor Kusper Eszterházy Károly College Eger, Hungary.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Methods of Proof Chapter 7, second half.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Intro to Programming Problem 1: Computers have to be told exactly what do to. Problem 2: Computers only understand “Machine language”. Problem 3: Machine.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY Lecture 12 CS2110 – Fall 2009.
Boolean Satisfiability and SAT Solvers
CMU, Oct 4 DPLL-based Checkers for Satisfiability Modulo Theories Cesare Tinelli Department of Computer Science The University of Iowa Joint work with.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
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.
Logic (continuation) Boolean Logic and Bit Operations.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
HW #2. Due Mar 27 23:59 Do NOT forget to submit both a hardcopy solution to the HW box and a softcopy solution to TA (Youngjoo Kim):
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
A DPLL example C1:(a  b) C2:(  a   b) C3:(a   c) C4:(c  d  e) C5:(d   e) C6:(  d   f) C7:(f  e) C8:(  f   e) false true a a a=false by.
Boolean Satisfiability Present and Future
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
LDK R Logics for Data and Knowledge Representation ClassL (part 2): Reasoning with a TBox 1.
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.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Quantified Formulas Acknowledgement: QBF slides borrowed from S.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Algebra 1 Section 4.2 Graph linear equation using tables The solution to an equation in two variables is a set of ordered pairs that makes it true. Is.
Inference and search for the propositional satisfiability problem
Gábor Kusper University of Linz RISC Austria
Richard Anderson Lecture 26 NP-Completeness
Recovering and Exploiting Structural Knowledge from CNF Formulas
Introduction to Software Verification
Lecture 2 Propositional Logic
Binary Decision Diagrams
Introduction to the Boolean Satisfiability Problem
ECE 667 Synthesis and Verification of Digital Circuits
Introduction to the Boolean Satisfiability Problem
Artificial Intelligence
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Gábor Kusper  Research Institute for Symbolic Computation (RISC-Linz)
Presentation transcript:

Multi-Domain Logic and its Applications to SAT Implementation Issues Tudor Jebelean, Johannes Kepler Unversity Linz Gábor Kusper, Eszterházy Károly College Eger SYNASC 2008

Outline History Implementation issues –Data structure: Spare literal matrix with pointers –Branching: Propagate as much information as possible! Clustering –Test results Deletion of Weaker Assignments –Test results Future work

History Philosophy: Propagate as much information as possible at once! Gábor Kusper: Investigation of Binary Representations of SAT especially 2-Literal Representation. Proceedings of CSCS-2002, Gábor Kusper: Solving the Resolution-Free SAT Problem by Hyper- Unit Propagation in Linear Time. Annals of Mathematics and Artificial Intelligence 43, , Gábor Kusper: Solving and Simplifying the Propositional Satisability Problem by Sub-Model Propagation. PhD thesis. Johannes Kepler University Linz, RISC, Gábor Kusper, Lajos Csőke: Better Test Results for the Graph Coloring and the Pigeonhole Problems using DPLL with k-Literal Representation. Proceedings of ICAI-2007, Volume II , 2007.

Literal in Multi-Domain Logic A literal is the set of the Boolean assignments which make the function true. The representation: {}FALSE {0}  a {1}a{0,1}TRUE { }FALSE{00}  a  b {11}a  b{00,11}a  b {10}a  b {00,10}  b {10,11}a {00,10,11}a  b {01}  a  b {00,01}  a {01,11}b {00,01,11}  a  b {01,10}a  b {00,01,10}  a  b {01,10,11}a  b{00,01,10,11} TRUE a  b

Literal Representation Note that we need 2 k bits. The representation: 00FALSE 10  a 01a11TRUE 0000FALSE1000  a  b 0001a  b1001a  b 0010a  b 1010  b 0011a 1011a  b 0100  a  b 1100  a 0101b 1101  a  b 0110a  b 1110  a  b 0111a  b1111TRUE a  b

Basics of the implementation

Literal Representation A literal is represented as an integer array. This allows us to use bitwise operations: Intersectionbitwise and (&) Unionbitwise or (|) Based on these fast methods we can implement –Unit Propagation –Deletion of Weak Assignments

Unit Propagation on Literal Level Up to 5 prop. variables / multi-variable we can represent a literal by 1 integer (32 bits). In this case we need only 3 elementary operations: –public void unitPropagation(int unit) { bits &= unit; if ( bits == unit ) { subsumed = true; } }

Unit Propagation on Literal Level In general a literal is an integer array. Then we need O(3 * 2 k / 32) elementary operations: public void unitPropagation(Literal unit) { intersection(unit); if (equals(unit)) { subsumed = true; } } public void intersection(Literal lit) { int[] input = lit.getBits(); for (int i=0; i<bits.length; i++) { bits[i] &= input[i]; } } public boolean equals(Literal lit) { boolean isEqu = true; int[] input = lit.getBits(); for (int i=0; i<bits.length; i++) { if (bits[i] != input[i]) { isEqu = false; break; } } return isEqu; }

Details of the implementation Data structure: Spare literal matrix with pointers Branching: Propagate as much information as possible!

Data structure Spare literal matrix with pointers Example: ( a  ¬b )  (¬a  c )  (¬a  ¬c ) Multi-var_1 … 2 var. / multi-var: Domains: Clause_1 Clause_2 …

Literal Representation, Once more Note that we need 2 k bits. The representation: 00FALSE 10  a 01a11TRUE 0000FALSE1000  a  b 0001a  b1001a  b 0010a  b 1010  b 0011a 1011a  b 0100  a  b 1100  a 0101b 1101  a  b 0110a  b 1110  a  b 0111a  b1111TRUE a  b

Granularity of Unit Propagation A unit has exactly one literal, which is an integer array (with k = 2^number of prop. var / multi-var bits). With this representation we may propagate: 1, 2, …, k-1 bits at once Most coarse grained UP (lot of information):1 bit … Normal UP (half of the information):k/2 bits … Most fine grained UP (very little information):k-1 bits We may mix kind of UPs when we branch!

Propagate as much as possible Use always the most coarse grained UP for branching, i.e., propagate as much information as you can!

Test results We tested our Java implementation on unsatisfiable SAT problems from the SATLIB page:

What is the value of Multi-Domain Logic? Multi-Domain Logic brings new ideas, which result in new simplification techniques: –Clustering –Deletion of Weak Assignments –Variable merging We implemented DPLL using Multi-Domain Logic to judge these techniques.

Clustering Clustering is a method which shuffles the propositional variables in order to have more multi-variable units at the beginning of the search.

Search Space BRANCHING UNIT PROPAGATION Early UNIT PROPAGATIONS small search space!

Does Multi-Domain Logic allow early units? YES! Do this: –Take the shortest clause. –Merge its variables. –Now it is a unit! BUT! –The number of bits grows exponential by increasing the number of merged Boolean variables! The solution! –Cluster the input clause set before the search starts!

Clustering uuf cnf, rate = 7 Before clustering: %TERNARY %BINARY %TERNARY %TERNARY %TERNARY %BINARY %TERNARY %TERNARY %TERNARY %BINARY … After clustering: %BINARY %BINARY %BINARY %TERNARY %BINARY %BINARY %BINARY %TERNARY %UNIT %BINARY … Borders are at: 1, 8, 15, 22, 29, 36, 43, 50, 57, …

Test Result, Clustering UUF050: Unsatisfiable Uniform Random-3-SAT Problems with 50 propositional variables

The same result in table form Propositional variables / multi-variable: Running time without clustering (ms): Running time with clustering (ms): Clustering gives significant speed-up! Best running time (319 ms) is in case of clustering and 3 prop. var. / multi-var. Note that the longest clause is 3-clause!

Weaker Assignments Let F be a formula, D be a domain and v, w elements of D. Then w is weaker than v iff v occurs in any literal where w occurs. The weaker assignment w can be eliminated from D, because any solution using w can be transformed in a solution using v

Search Space

Search Space after Deleting the Weaker Assignments

Test Results Pigeon Hole Problem with 6 holes and 7 pigeons hole6.cnf: …

The same result in table form Propositional variables / multi-variable: Running time (ms) with no Deletion of Weaker Assignments (DoWA): Running time (ms) with DoWA only once in the preprocessing: Running time (ms) with DoWA also after a new unit is found: Deletion of Weaker Assignments gives significant speed-up! Best running times is in case of 6 prop. var. / multi-var. Note that the longest clause is 6-clause!

The same table for hole7.cnf Propositional variables / multi-variable: Running time (ms) with no Deletion of Weaker Assignments (DoWA): Running time (ms) with DoWA only once in the preprocessing: Running time (ms) with DoWA also after a new unit is found: Deletion of Weaker Assignments gives significant speed-up! Best running times is in case of 7 prop. var. / multi-var. Note that the longest clause is 7-clause!

Future work Now it is implemented in Java. –Migrate it to C / C++. We would like to implement –Variable merging, –Lazy data structure, –Watch literals, –Pure literal elimination.

Thank you for your attention!