Satisability of Boolean Formulas

Relaterede dokumenter
Skriftlig Eksamen Kombinatorik, Sandsynlighed og Randomiserede Algoritmer (DM528)

Project Step 7. Behavioral modeling of a dual ported register set. 1/8/ L11 Project Step 5 Copyright Joanne DeGroat, ECE, OSU 1

Basic statistics for experimental medical researchers

Exercise 6.14 Linearly independent vectors are also affinely independent.

Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances.

Besvarelser til Lineær Algebra Reeksamen Februar 2017

Skriftlig Eksamen Beregnelighed (DM517)

Generalized Probit Model in Design of Dose Finding Experiments. Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US

Skriftlig Eksamen Diskret matematik med anvendelser (DM72)

Linear Programming ١ C H A P T E R 2

CS 4390/5387 SOFTWARE V&V LECTURE 5 BLACK-BOX TESTING - 2

Brug sømbrættet til at lave sjove figurer. Lav fx: Få de andre til at gætte, hvad du har lavet. Use the nail board to make funny shapes.

University of Copenhagen Faculty of Science Written Exam - 3. April Algebra 3

Sign variation, the Grassmannian, and total positivity

Vina Nguyen HSSP July 13, 2008

Privat-, statslig- eller regional institution m.v. Andet Added Bekaempelsesudfoerende: string No Label: Bekæmpelsesudførende

The X Factor. Målgruppe. Læringsmål. Introduktion til læreren klasse & ungdomsuddannelser Engelskundervisningen

Engineering of Chemical Register Machines

Appendix 1: Interview guide Maria og Kristian Lundgaard-Karlshøj, Ausumgaard

Skriftlig Eksamen Beregnelighed (DM517)

PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU

Engelsk. Niveau D. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

Aktivering af Survey funktionalitet

On the complexity of drawing trees nicely: corrigendum

Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov.

Portal Registration. Check Junk Mail for activation . 1 Click the hyperlink to take you back to the portal to confirm your registration

Black Jack --- Review. Spring 2012

DK - Quick Text Translation. HEYYER Net Promoter System Magento extension

University of Copenhagen Faculty of Science Written Exam April Algebra 3

Statistik for MPH: oktober Attributable risk, bestemmelse af stikprøvestørrelse (Silva: , )

Vejledning til Sundhedsprocenten og Sundhedstjek

IBM Network Station Manager. esuite 1.5 / NSM Integration. IBM Network Computer Division. tdc - 02/08/99 lotusnsm.prz Page 1

Fejlbeskeder i SMDB. Business Rules Fejlbesked Kommentar. Validate Business Rules. Request- ValidateRequestRegist ration (Rules :1)

Trolling Master Bornholm 2015

Agenda. The need to embrace our complex health care system and learning to do so. Christian von Plessen Contributors to healthcare services in Denmark

Engelsk. Niveau C. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

Skriftlig Eksamen Automatteori og Beregnelighed (DM17)

Det er muligt at chekce følgende opg. i CodeJudge: og

OXFORD. Botley Road. Key Details: Oxford has an extensive primary catchment of 494,000 people

Boligsøgning / Search for accommodation!

CHAPTER 8: USING OBJECTS

Statistik for MPH: 7

Trolling Master Bornholm 2016 Nyhedsbrev nr. 7

E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss

User Manual for LTC IGNOU

Trolling Master Bornholm 2016 Nyhedsbrev nr. 8

Business Rules Fejlbesked Kommentar

Curve Modeling B-Spline Curves. Dr. S.M. Malaek. Assistant: M. Younesi

1 What is the connection between Lee Harvey Oswald and Russia? Write down three facts from his file.

Fejlbeskeder i Stofmisbrugsdatabasen (SMDB)

Aarhus Universitet, Science and Technology, Computer Science. Exam. Wednesday 27 June 2018, 9:00-11:00

Help / Hjælp

X M Y. What is mediation? Mediation analysis an introduction. Definition

IPTV Box (MAG250/254) Bruger Manual

Remember the Ship, Additional Work

Danish Language Course for International University Students Copenhagen, 12 July 1 August Application form

Trolling Master Bornholm 2016 Nyhedsbrev nr. 3

Titel: Hungry - Fedtbjerget

LESSON NOTES Extensive Reading in Danish for Intermediate Learners #8 How to Interview

How Long Is an Hour? Family Note HOME LINK 8 2

Trolling Master Bornholm 2013

Trolling Master Bornholm 2012

Trolling Master Bornholm 2016 Nyhedsbrev nr. 5

Trolling Master Bornholm 2014

Nyhedsmail, december 2013 (scroll down for English version)

Strings and Sets: set complement, union, intersection, etc. set concatenation AB, power of set A n, A, A +

I. Active-set descent algorithm

Status på det trådløse netværk

what is this all about? Introduction three-phase diode bridge rectifier input voltages input voltages, waveforms normalization of voltages voltages?

Dean's Challenge 16.november 2016

Bilag. Resume. Side 1 af 12

ECE 551: Digital System * Design & Synthesis Lecture Set 5

Trolling Master Bornholm 2014?

Richter 2013 Presentation Mentor: Professor Evans Philosophy Department Taylor Henderson May 31, 2013

Trolling Master Bornholm 2013

Timetable will be aviable after sep. 5. when the sing up ends. Provicius timetable on the next sites.

Danish Language Course for Foreign University Students Copenhagen, 13 July 2 August 2016 Advanced, medium and beginner s level.

Trolling Master Bornholm 2014

Modtageklasser i Tønder Kommune

Kalkulation: Hvordan fungerer tal? Jan Mouritsen, professor Institut for Produktion og Erhvervsøkonomi

VEDLIGEHOLDELSE AF SENGE

South Baileygate Retail Park Pontefract

Nyhedsmail, november 2013 (scroll down for English version)

Listen Mr Oxford Don, Additional Work

Measuring Evolution of Populations

BILAG 8.1.B TIL VEDTÆGTER FOR EXHIBIT 8.1.B TO THE ARTICLES OF ASSOCIATION FOR

Titel: Barry s Bespoke Bakery

Userguide. NN Markedsdata. for. Microsoft Dynamics CRM v. 1.0

Trolling Master Bornholm 2013

Breaking Industrial Ciphers at a Whim MATE SOOS PRESENTATION AT HES 11

Trolling Master Bornholm 2015

DET KONGELIGE BIBLIOTEK NATIONALBIBLIOTEK OG KØBENHAVNS UNIVERSITETS- BIBLIOTEK. Index

DM559/DM545 Linear and integer programming

University of Copenhagen Faculty of Science Written Exam - 8. April Algebra 3

Web-seminar. 30 March Noter

Kurver og flader Aktivitet 15 Geodætiske kurver, Isometri, Mainardi-Codazzi, Teorema Egregium

November hilsner fra NORDJYSKE Medier, Distributionen

Name: Week of April 1 MathWorksheets.com

TM4 Central Station. User Manual / brugervejledning K2070-EU. Tel Fax

how to save excel as pdf

Transkript:

SAT exercises 1 March, 2016 slide 1 Satisability of Boolean Formulas Combinatorics and Algorithms Prof. Emo Welzl Assistant: (CAB G36.1, cannamalai@inf.ethz.ch) URL: http://www.ti.inf.ethz.ch/ew/courses/sat16/

SAT exercises 1 March, 2016 slide 2 Today's exercises 1.3: Associativity of boolean operators 1.12: Four Clauses Suce 1.15: Disjunctive Normal Form 1.18: Counting Formulas 1.25: Number of Vertex Covers 1.28: Horn Formulas Addendum to exercise 1.25: Improved ( 2)-CNF counting

SAT exercises 1 March, 2016 slide 3 1.3. Associativity of boolean operators Denition. An operator is associative if for all operands a, b, c we have (a (b c)) = ((a b) c). If an operator is associative, then we can write expressions without parentheses because of the lack of ambiguity. We saw a short proof of this in the exercise session. In particular, only the order of the operands matter (and not the order of evaluation). We can then interpret an expression involving n operands, x 1... x n as an n-variate function. Check which of {,,,, } are associative and characterize the n-variate functions they induce.

SAT exercises 1 March, 2016 slide 4 1.3. Associativity of boolean operators (2) By straightforward checking: Associative:,,, Not associative:. is not associative because when (x 0, y 1, z 0). x (y z) (x y) z

SAT exercises 1 March, 2016 slide 5 1.3. Associativity of boolean operators (3) Characterization: n i=1 is true i all operands are true. n i=1 is true i at least one operand is true. n i=1 is true i an odd number of operands is true (this is called the parity function). n i=1 : When n is even, it is true i an even number of operands are true, and when n is odd, it is true i an odd number of operands are true. Note that this is the same as saying that the expression is true i an even number of operands is false. The proofs of the characterizations follow by induction on n.

SAT exercises 1 March, 2016 slide 6 1.12. Four Clauses Suce As in Section 1.2, we can represent every boolean function as a CNF formula. Over three variables, this automatically becomes a 3-CNF formula, say F. F could potentially contain 8 possible clauses. Let us enumerate them from C 1 through C 8 in order and pair consecutive clauses: {C 1, C 2 },..., {C 7, C 8 }. If F contains both clauses from some pair thenresolve the two clauses using the last variable (since we are guaranteed that this variable appears positively once and negatively once in each of the clauses in

SAT exercises 1 March, 2016 slide 7 the pair, by our enumeration) to obtain an equivalent clause with only two literals. Therefore, for each pair we retain at most one clause with either 2 or 3 literals, giving us a ( 3)-CNF formula with at most 4 clauses.

SAT exercises 1 March, 2016 slide 8 1.15. Disjunctive Normal Form (1) Let φ(x 1,..., x n ) be the given boolean formula on n variables. Imagine the truth table of φ. We show one row of the truth table here and the corresponding DNF clause. x 1 x 2... x n φ(x 1,..., x n ). 0 1... 0 1 = ( x 1 x 2 x n ).

SAT exercises 1 March, 2016 slide 9 (2) For each assignment α := (x 1 t 1,..., x n t n ) that results in φ(α) evaluating to 1 we make one DNF-clause x i x i : α(x i )=1 x i, x i : α(x i )=0 which has the property that it evaluates to 1 exactly when x i = t i for all i {1,..., n}. (3) Taking the OR of all such clauses we obtain a boolean formula equivalent to φ in disjunctive normal form: x i α {0,1} n : φ(α)=1 x i : α(x i )=1 x i. x i : α(x i )=0

SAT exercises 1 March, 2016 slide 10 1.18. Counting Formulas (1) The function can be represented by its truth table associating a value from {0, 1} to each tuple in {0, 1} n. This yields 2 2n possibilities. (2) To build a k-clause we rst need to choose the k variables which appear in the clause, and for each chosen variable we need to decide if it will be negated or not. Therefore there are ( ) n k 2 k many distinct k-clauses. To build a k-cnf formula, we have to select a subset of them. We hence have 2 (n k ) 2k possibilities. (3) Since there are 2 210 = 2 1024 such functions and only 2 (10 3 ) 23 = 2 960 formulas, there are many boolean functions over 10 variables that cannot be represented as 3-CNF formulae.

SAT exercises 1 March, 2016 slide 11 Question: Can you explain why a 3-CNF cannot express everything? Does this contradict what we did on the rst day (everything can be represented as a 3-CNF)?

SAT exercises 1 March, 2016 slide 12 1.25. Number of Vertex Covers Goal: Design and analyze and algorithm for counting the number of vertex covers. Trivial algorithm: O(2 n poly(n)); test for each of the 2 n subsets of V if it is a vertex cover. Idea: Encode subsets N of V as assignments, and the condition that N is a vertex cover as a 2-CNF formula.

SAT exercises 1 March, 2016 slide 13 The encoding is straight-forward: Each vertex v becomes a variable. The corresponding assignment α N is dened as α N (v) := 0, v N 1, v N. For each edge e = {v 1, v 2 }, we want that at least one vertex is present. This is encoded by the clause {v 1, v 2 }. Therefore F := E and a subset N is a vertex cover if and only if the corresponding assignment α N satises F. An assignment on V encodes exactly one subset N of V ; therefore the number of satisfying assignments is the number of vertex covers.

SAT exercises 1 March, 2016 slide 14 1.28. Horn formulas Correctness. Trivial. We are using only more restrictive rules. Completeness. Let F be Horn and let F be the extension of F by all possible (unit res.-)resolvents, s.t. no pair C, D F can yield a (unit res.-)resolvent not yet contained in F. Note that F is Horn because two clauses with at most one positive literal each contain again at most one positive literal.

SAT exercises 1 March, 2016 slide 15 1.28. Horn formulas (2) Hence if F, then a satisfying assignment α is given by satisfying all 1-clauses and setting the remaining variables to 0. A contradictory pair {u} and {ū} cannot exist since this would have allowed to derive. Suppose α does not satisfy F, then we will show this leads to a contradiction. Let C be a unsatised clause of F with fewest literals. C contains at least 2 literals (as we satised all 1-clauses), and so one literal must be negative x. This literal is satised unless {x} F. However if {x} F we can do unit resolution with C and {x} to obtain a smaller unsatised clause, a contradiction.

SAT exercises 1 March, 2016 slide 16 Addendum to exercise 1.25: Improved counting ( 2)-CNF The best known ( 2)-CNF counting algorithm is by Wahlström and runs in time O(1.2377 n ) using a very rened analysis. Remember our algorithm fib c2s(f,v ): If F is a ( 1)-CNF, the problem is easy. Otherwise let {u, v} be some 2-clause. Return fib c2s(f [u 1] )+fib c2s(f [u 0,v 1] ). How to improve this?

SAT exercises 1 March, 2016 slide 17 Improved ( 2)-CNF counting (2) We introduce an additional case distinction to better exploit the structure. We rst address trivial cases: If F contains the 0-clause, then sat V (F ) = 0. If F = {}, then sat V (F ) = 2 V. If F contains a 1-clause {u}, then sat V (F ) = sat V \vbl{u} (F [u 1] ). Hence we can assume that F is a non-empty 2-CNF formula.

SAT exercises 1 March, 2016 slide 18 Improved ( 2)-CNF counting (3) Let C = {u, v} be some 2-clause. If the variables of u and v do not occur anywhere else in the formula, then sat V (F ) = 3 sat V \vbl{u,v} (F \ {{u, v}}). Otherwise there is D F with vbl(c) vbl(d). There are the following cases: 1. vbl(c) = vbl(d) (the clauses share both variables) 2. C D = 1 (the clauses have complementary literals) 3. C D = 1 (the clauses share a literal)

SAT exercises 1 March, 2016 slide 19 Improved ( 2)-CNF counting (4) 1. vbl(c) = vbl(d): We need to consider 2 out of 4 possibilities of formulas with 2 fewer variables. 2. C D = 1 (the clauses have complementary literals). C = {u, v}, D = {ū, w}. Either set u to 1 and w to 1, or set u to 0 and v to 1. 3. C D = 1 (the clauses share a literal). C = {u, v}, C = {u, w}. Either set u to 1 or set u to 0 and v, w to 1. The rst two cases give running time O( 2 n poly(n)) O(1.415 n ). The last case is the worst case and gives running time O(1.466 n ), a large improvement over O(1.619 n ). (see Appendix A.2 for methods to solve recurrences, also look at Special Assignment 1, Exercise 1 of SAT12)