My Slides for a Course on Satisfiability
Total Page:16
File Type:pdf, Size:1020Kb
Satisfiability Victor W. Marek Computer Science University of Kentucky Spring Semester 2005 Satisfiability – p.1/97 Satisfiability story ie× Á Satisfiability - invented in the ¾¼ of XX century by philosophers and mathematicians (Wittgenstein, Tarski) ie× Á Shannon (late ¾¼ ) applications to what was then known as electrical engineering ie× ie× Á Fundamental developments: ¼ and ¼ – both mathematics of it, and fundamental algorithms ie× Á ¼ - progress in computing speed and solving moderately large problems Á Emergence of “killer applications” in Computer Engineering, Bounded Model Checking Satisfiability – p.2/97 Current situation Á SAT solvers as a class of software Á Solving large cases generated by industrial applications Á Vibrant area of research both in Computer Science and in Computer Engineering ¯ Various CS meetings (SAT, AAAI, CP) ¯ Various CE meetings (CAV, FMCAD, DATE) ¯ CE meetings Stressing applications Satisfiability – p.3/97 This Course Á Providing mathematical and computer science foundations of SAT ¯ General mathematical foundations ¯ Two- and Three- valued logics ¯ Complete sets of functors ¯ Normal forms (including ite) ¯ Compactness of propositional logic ¯ Resolution rule, completeness of resolution, semantical resolution ¯ Fundamental algorithms for SAT ¯ Craig Lemma Satisfiability – p.4/97 And if there is enough of time and will... Á Easy cases of SAT ¯ Horn ¯ 2SAT ¯ Linear formulas Á And if there is time (but notes will be provided anyway) ¯ Expressing runs of polynomial-time NDTM as SAT, NP completeness ¯ “Mix and match” ¯ Learning in SAT, partial closure under resolution ¯ Bounded Model Checking Satisfiability – p.5/97 Various remarks Á Expected involvement of Dr. Truszczynski Á An extensive set of notes (> 200 pages), covering most of topics will be provided f.o.c. to registered students (in installments) Á No claim to absolute correctness made Á Syllabus: http://www.cs.uky.edu/ marek/htmldid.dir/686.html Á Homeworks every other week Á Midterm Á Individually-negotiated project a ¯ Write your own SAT solver ¯ Modify Chaff ¯ Use SAT solver for some reasonable task Á Questions? aHic Rhodes, Hic Salta Satisfiability – p.6/97 Basic concepts Á Sets and operations on sets Á Relations Á Partial orderings (posets) Á Elements’ classification Á Lattices Á Boolean Algebras Á Chains in posets, Zorn Lemma Á Well-orderings, ordinals, induction Á Inductive proofs Á Inductive definability Satisfiability – p.7/97 Fixpoint theorem Á Complete Lattices Á Monotone operators (functions) in lattices Á (Knaster-Tarski Fixpoint Theorem) If Ä is a complete lattice and Ä ! Ä is monotone operator in Ä then possesses a fixpoint. In fact fixpoints of form a complete lattice under the ordering of Ä, and thus there is a least and largest fixpoint of Á Continuous monotone functions Á The least fixpoint (but not the largest fixpoint) of a continuous operator reached in or less steps Á Generalizations of fixpoint theorem Satisfiability – p.8/97 Syntax of propositional logic Á Variables of some (problem-dependent) set Var Á For each set Var a separate propositional logic Á ÓÖÑ Inductive definition of the set of formulas ÎaÖ Á Thinking about formulas as binary trees, the rank of formula Satisfiability – p.9/97 Semantics Á Valuations of variables Á Partial valuations of variables Á Two-valued logic and valuations Á Type Bool Á Tables for operations in Bool Á Valuations acting on formulas Á Valuations uniquely extend from variables to formulas Á Characterizing valuations as complete sets of literals Á Characterizing valuations as sets of variables Á Ú Two-valued truth function ¾ Á Satisfaction relation j Á Consistent theories Satisfiability – p.10/97 Localization and joint-consistency Á Interactions between sets of variables Á Restrictions of valuations Á ÎÖ ÎÖ ³ ¾ Ä Ú ÎÖ Localization theorem: If ½ ¾ and ÎaÖ , is a valuation of ¾ , ½ ¼ ¼ Ú Ú ÎÖ j ³ Ú j ³ Ú j ³ is the restriction of to ½ then if and only if Á Complete sets of formulas Á Lemma: Complete sets of formulas determine valuations and conversely, valuations determine completes sets of formulas Á Ì Ì ÎÖ ÎÖ (Robinson joint-consistency) Let ½ , ¾ are two sets of formulas in ½ , ¾ ÎÖ ÎÖ \ ÎÖ Ì Ì resp. Let us assume that ½ ¾ and that both ½ , ¾ are complete ÎÖ Ì [ Ì for and coincide. Then ½ ¾ is consistent Satisfiability – p.11/97 Partial valuations, 3-valued logic Á Need for partial valuations? Á Partial valuation as complete valuations but in f¼ ½ Ùg Á Post ordering and Kleene ordering in the set f¼ ½ Ùg Á Product ordering Á f¼ ½ Ùg Post ordering and Kleene ordering in the multiple-copies product of , Ô and Á Getting Kleene and Post orderings of partial valuations Á Valuations as maximal partial valuations Satisfiability – p.12/97 Tables for Kleene 3-valued logic Á Ú Three-valued truth function ¿ Á Ú Ú Ú ¾ and ¿ coincide if is a (two-valued) valuation Á Ú Û ³ Ú ´³µ Û ´³µ If then for every formula , ¿ ¿ Á Autarkies Á Fundamental effect of this result in SAT Á Restriction result for 3-valued valuations Satisfiability – p.13/97 Tautologies and Satisfiability Á A tautology - formula true under all valuation of its variables Á Satisfiable formulas Á A formula ³ is satisfiable if and only if :³ is not a tautology Á Consequences of this fact: satisfiability checkers as tautology checkers Á Common tautologies Á How many are there tautologies? Satisfiability – p.14/97 Substitutions to formulas Á Substitution ! Ô Ô ½ Ò ½ Ò Á Valuations acting on substitutions Á Substitution Lemma ³ ¾ ÓÖÑ : Let fÔ Ô g be a formula in propositional ½ Ñ Ô Ô h i variables ½ Ñ and let ½ Ñ be a sequence of propositional Ú formulas. Let be a valuation of all variables occurring in ½ Ñ . Finally, ¼ ¼ Ú Ô Ô Ú ´Ô µ Ú ´ µ let be a valuation of variables ½ Ñ defined by , ½ Ñ. Then !! Ô Ô ½ Ò ¼ Ú ´³µ Ú ³ ½ Ò Satisfiability – p.15/97 Substitutions to formulas, cont’d Á ³ ³ Ô Ô Let be a tautology, with variables of among ½ Ò . Then for every ! Ô Ô ½ Ò h i ³ choice of formulas ½ Ò , the formula is a tautology. ½ Ò Á There are infinitely many tautologies Satisfiability – p.16/97 Lindenbaum Algebra Á Relation : ³ if for all valuations Ú (of all variables occurring in ³, ) Ú ´³µ Ú ´ µ Á is an equivalence relation Á ³ iff the formula ³ is a tautology Á We can form the cosets ÓÖÑ Á Operations in ÓÖÑ Á Independence from the choice of representatives Á Lindenbaum Algebra Á Lindenbaum Algebra is a Boolean Algebra Satisfiability – p.17/97 Permutations of atoms and literals Á Permutations of atoms Á Permutations of literals, consistent permutations of literals Á Shifts Á Consistent permutations form a group Á Decomposing consistent permutations of literals into shifts and permutation of variables Ò Á There is ¾ ¡ Ò of consistent permutations of literals over a set ÎÖ of size Ò Á Consistent permutations of literals (and thus permutations of variables) preserve completeness of sets of literals Á Every consistent and complete set of literals can be mapped onto any other consistent and complete set of literals by a suitably chosen consistent permutation of literals Satisfiability – p.18/97 Permutations and formulas Á Permutations act on formulas Á (Permutation Theorem) If ³ is a formula, Ú is a valuation and a consistent permutation of literals then Ú j ³ if and only if ´Ú µ j ´³µ Á Set-representation of valuations and permutation Satisfiability – p.19/97 Semantical consequence Á Operation Cn, entailment of the (sets of) formulas Ò ´ µ f³ 8 ´Ú j µ Ú j ³µg Ú Á Ò is an operator in the complete Boolean algebra of sets of formulas Á For all sets , Ò ´ µ Á Ò is monotone and idempotent Á Ò is continuous (but we have no means to prove it, yet) Á Ò ´;µ consists of tautologies and nothing else Satisfiability – p.20/97 Deduction Theorem Á Implication functor and consequence operation Á The following are equivalent ¯ ³ µ ¾ Ò ´ µ ¯ ¾ Ò ´ [ f³gµ Satisfiability – p.21/97 Operations Mod and Th Á From sets of formulas to valuations: ÅÓ ´ µ fÚ Ú j g Á From sets of valuations to formulas Ì ´Î µ f³ for all Ú ¾ Î , Ú j ³g Á Connection: Let Ú be a valuation and Î a set of valuations. Then Ú ¾ ÅÓ ´Ì ´Î µµ if and only if for every finite set of variables there is a Û ¾ Î Ú j Û j valuation such that . Á Let be a finite set of propositional variables. Let Î be a collections of valuations of set and Ú be a valuation of . Then Ú j ÅÓ ´Ì ´Î µµ if and only if Ú ¾ Î . Á ÅÓ ´Ì ´ÅÓ ´ µµµ ÅÓ ´Ò ´ µµ ÅÓ ´ µ Á Ì ´ÅÓ ´Ì ´Î µµµ Ì ´Î µ Satisfiability – p.22/97 Functors and formulas Á An Ò-ary functor is a Ò-ary function in ÓÓÐ Ò ¾ Á There are ¾ n-ary functors Á Table - Boolean function of finite number of variables Á Altogether there is infinitely many tables C Á Given a set C of names for functors we can form ÓÖÑ - the set of formulas based on C (obvious syntactic restrictions) Satisfiability – p.23/97 Completeness of sets of functors Á Valuations as before, functions on ÎÖ into Bool Á Assigning tables to well-formed formulas (i.e. trees, but no longer binary trees) Á Ì ³ ³ table associated with C Á C Ì Ì ³ ¾ ÓÖÑ is complete if every table is equal to ³ for some Satisfiability – p.24/97 Completeness of sets of functors, cont’d Á C C C C C C If ½ are two sets of functors, is complete and ½ then ½ is also complete. Á The set f: ^ _g is a complete set of functors. Á Thus f: ^ _ µ g is a complete set of functors.