SAT and CP - Parallelisation and Applications
Total Page:16
File Type:pdf, Size:1020Kb
SAT and CP - Parallelisation and Applications Thorsten Ehlers Dissertation zur Erlangung des akademischen Grades Doktor der Ingenieurwissenschaften (Dr.-Ing.) der Technischen Fakultät der Christian-Albrechts-Universität zu Kiel eingereicht im Jahr 2017 Kiel Computer Science Series (KCSS) 2017/3 dated 2017-05-30 URN:NBN urn:nbn:de:gbv:8:1-zs-00000333-a0 ISSN 2193-6781 (print version) ISSN 2194-6639 (electronic version) Electronic version, updates, errata available via https://www.informatik.uni-kiel.de/kcss The author can be contacted via [email protected] Published by the Department of Computer Science, Kiel University Dependable Systems Group Please cite as: Ź Thorsten Ehlers. SAT and CP - Parallelisation and Applications Number 2017/3 in Kiel Com- puter Science Series. Department of Computer Science, 2017. Dissertation, Faculty of Engi- neering, Kiel University. @book{DissThorstenEhlers2017, author = {Thorsten Ehlers}, title = {SAT and CP - Parallelisation and Applications}, publisher = {Department of Computer Science, CAU Kiel}, year = {2017}, number = {2017/3}, series = {Kiel Computer Science Series}, note = {Dissertation, Faculty of Engineering, Kiel University.} } © 2017 by Thorsten Ehlers ii About this Series The Kiel Computer Science Series (KCSS) covers dissertations, habilitation theses, lecture notes, textbooks, surveys, collections, handbooks, etc. written at the Department of Computer Science at Kiel University. It was initiated in 2011 to support authors in the dissemination of their work in electronic and printed form, without restricting their rights to their work. The series provides a unified appearance and aims at high-quality typography. The KCSS is an open access series; all series titles are electronically available free of charge at the department’s website. In addition, authors are encouraged to make printed copies available at a reasonable price, typically with a print-on-demand service. Please visit http://www.informatik.uni-kiel.de/kcss for more information, for instructions how to publish in the KCSS, and for access to all existing publica- tions. iii 1. Gutachter: Prof. Dr. Dirk Nowotka Christian-Albrechts-Universität Kiel 2. Gutachter: Prof. Dr. Mike Codish Ben Gurion University of the Negev Datum der mündlichen Prüfung: 22.05.2017 iv Acknowledgements I’m rolling thunder pouring rain I’m coming on like a hurricane My lightning’s flashing across the sky AC/DC This work would not have been possible without the help, encouragement, support and advise of many people whom I would like to thank at this place. First of all I would like to thank my family, especially my parents Manfred and Susanne, for growing me, making me the person I am now, and supporting me through all decisions, especially the hard ones. Next, I thank my supervisor, Dirk Nowotka, for his guidance, patience, and support, and for providing me the freedom and funding to do research in different directions. Thanks to my current and former colleagues from the Dependable Systems Group in Kiel, who supported, questioned me. Namely, this is Gesa Walsdorf, Philipp Sieweck, Tim Grebien, Mike Müller, Florin Manea, Robert Merca¸s, Maike Bradler, Kamellia Reshadi, Mitja Kulczynski, Danny Poulsen, Joel Day, Pamela Fleischmann, Max Friese, Yvonne Küstermann, Anneke Twardzik and Karoliina Lehtinen. Furthermore, I would like the members of my examining committee, Mike Codish, Steffen Börm and Manfred Schimmler for their efforts. I had a great time in Melbourne, Australia, when spending six month at the Melbourne University in 2015. Here, I owe thanks especially to Peter Stuckey for hosting me, the many fruitful discussions we had, and the advise he gave me. This stay surely changed my understanding of constraint programming and SAT solving. A big thanks also to my colleagues there, Graeme Gange, Diego de Uña, Ignasi Abio, Valentin Mayer-Eichberger and Geoffrey Chu. Furthermore, I would like to thank Mark, Sigrid, Oliver, Kylie, Linda, all the guys from the Graduate House and my football gang for the pleasant time. Science is collaboration; I would like to thank my co-authors that were not mentioned so far, Peter Schneider-Kamp, Luís Cruz-Filipe, Miro Spönemann, Reinhard von Hanxleden, Ulf Rüegg and Johannes Traub. v I also had some fun debugging the software I worked on with Max Bannach and Sebastian Berndt in the field of tree decompositions, hopefully we will manage to publish some results shortly! I would also like to thank my friends and flatmates, for their support and patience, for example when I was writing a paper while we were renovating the flat. Last but not least I want to thank Maria for her patience and advice when I felt overstrained by this work, and for just having a good time with me. vi Zusammenfassung Diese Dissertation befasst sich mit der Parallelisierung von Programmen welche eine beliebige, oder eine optimale Lösung zu Problemen suchen, die auf be- stimmte, formale Arten spezifiziert werden. Wir beschreiben Parallelisierungs- ansätze für zwei verschiedene Arten von Lösern, sowie einen Anwendungsfall. In dem ersten Kapitel beschäftigen wir uns mit SAT, dem Erfüllbarkeitsproblem der Aussagenlogik, und Algorithmen, welche die Erfüllbarkeit oder Unerfüll- barkeit aussagenlogischer Formeln entscheiden. Wir beginnen mit einer kur- zen Einführung in Grundlagen der Beweistheorie, welche dann in Bezug zu der Stärke verschiedener algorithmischer Ansätze gesetzt wird. Desweiteren diskutieren wir Implementierungsdetails aktueller SAT Löser, und zeigen Ver- besserungen. Zuletzt wird eine Parallelisierung dieser Löser diskutiert, wobei ein Schwerpunkt auf der Kommunikation von Zwischenergebnissen innerhalb eines parallelen Lösers, dem Austausch gelernter Klauseln, liegt. In dem zweiten Kapitel betrachten wir Constraint Programing (CP) mit Lern- mechanismen. Im Gegensatz zu klassische Techniken werden hier Lernme- chanismen, wie sie bei SAT Lösern zum Einsatz kommen, übernommen. Wir präsentieren Ergebnisse einer Parallelisierung von CHUFFED, einem lernenden CP Löser. Da dieser sowohl Charakteristiken eines klassischen CP-Lösers als auch eines SAT-Lösers aufweist, ist es nicht klar, welche Parallelisierungsansätze hier am besten funktionieren. Im letzten Kapitel diskutieren wir Sortiernetzwerke, Sortieralgorithmen deren Vergleichsoperationen a priori, also unabhängig von der Eingabe, festgelegt wer- den. Aufgrund dieser Datenunabhängigkeit können Sortiernetzwerke effizient parallel implementiert werden. Wir betrachten die Frage nach der minimalen Anzahl von parallelen Sortierschritten, welche für die Sortierung von bestimm- ten Eingabegrößen benötigt werden, und zeigen untere und obere Schranken für mehrere Fälle. vii Abstract This thesis is considered with the parallelisation of solvers which search for either an arbitrary, or an optimum, solution to a problem stated in some formal way. We discuss the parallelisation of two solvers, and their application in three chapters. In the first chapter, we consider SAT, the decision problem of propositional logic, and algorithms for showing the satisfiability or unsatisfiability of proposi- tional formulas. We sketch some proof-theoretic foundations which are related to the strength of different algorithmic approaches. Furthermore, we discuss details of the implementations of SAT solvers, and show how to improve upon existing sequential solvers. Lastly, we discuss the parallelisation of these solvers with a focus on clause exchange, the communication of intermediate results within a parallel solver. The second chapter is concerned with Contraint Programing (CP) with learning. Contrary to classical Constraint Programming techniques, this incorporates learning mechanisms as they are used in the field of SAT solving. We present results from parallelising CHUFFED, a learning CP solver. As this is both a kind of CP and SAT solver, it is not clear which parallelisation approaches work best here. In the final chapter, we will discuss Sorting networks, which are data oblivi- ous sorting algorithms, i. e., the comparisons they perform do not depend on the input data. Their independence of the input data lends them to parallel implementation. We consider the question how many parallel sorting steps are needed to sort some inputs, and present both lower and upper bounds for several cases. ix Contents 1 Introduction1 2 SAT3 2.1 Preliminaries...............................5 2.1.1 Propositional Formulas.....................5 2.1.2 Satisfiability of Propositional Formulas............7 2.1.3 Conjunctive Normal Form...................8 2.2 Proofs and Complexity.......................... 10 2.2.1 Resolution............................. 11 2.2.2 The DP Algorithm........................ 12 2.2.3 The DPLL Algorithm....................... 13 2.2.4 CDCL................................ 15 2.2.5 Underlying Proof Systems.................... 20 2.3 Techniques & Implementations.................... 26 2.3.1 Preprocessing via Bounded Variable Elimination...... 26 2.3.2 Watched Literal Scheme..................... 27 2.3.3 Branching............................. 30 2.3.4 Conflict Driven Clause Learning................ 31 2.3.5 Restarts............................... 34 2.4 SAT Competition 2016.......................... 36 2.4.1 Refining the Restart Strategy.................. 36 2.4.2 Re-considering LBD....................... 38 2.5 Parallel SAT................................ 42 2.5.1 Portfolio-based Parallel SAT Solving.............. 44 2.5.2 Subsequent Implementations................. 65 2.6 Conclusion and Open Questions...................