CDM Boolean Decision Diagrams

CDM Boolean Decision Diagrams

CDM Boolean Decision Diagrams 1 Boolean Functions Clones and Post Klaus Sutner Carnegie Mellon University Minimal Automata 24-bdd 2017/12/15 23:21 Binary Decision Diagrams Boolean Functions 3 There Are Lots 4 n Obviously there are 22 Boolean functions of arity n. Let us return to the two-element Boolean algebra B = ff, tt . { } To lighten notation we will overload and write 2 = 0, 1 instead. { } Definition n 1 2 3 4 5 6 7 8 A Boolean function of arity n is any function of the form n 22 4 16 256 65536 4.3 109 1.8 1019 3.4 1038 1.2 1077 2n 2 × × × × → 20 Note that we only consider single outputs here, f : 2n 2 rather than 22 = 6.7 10315652 = → f : 2n 2m. × ∞ → Slightly more vexing is the question of whether one should include n = 0. We’ll . , for all practical intents and purposes. Since there are quite so many, it is a fudge things a bit. good idea to think about how to describe and construct these functions. Different Angles 5 The Challenge Problems 6 The propositional logic angle immediately suggests the following computational problems. Combinatorics: 2n 2 → Problem: Tautology Logic: propositional formula Instance: A propositional formula ϕ. Question: Is ϕ a tautology? Circuits: logic gates Datatype: BDDs Problem: Satisfiability Instance: A propositional formula ϕ. Question: Is ϕ a contingency? In a sense, this is all the same–but different perspectives lead to different ideas and very different algorithms. Problem: Equivalence For example, from the logic perspective it is natural to generate tautologies, a Instance: Two propositional formulae ϕ and ψ. boring idea from the viewpoint of circuits. Question: Are ϕ and ψ equivalent? Alas, we know from complexity theory that these are all hard. Connections 7 Boolean Functions These are all closely connected: ϕ is a tautology iff ϕ fails to be satisfiable 2 Clones and Post ¬ ϕ is a tautology iff ϕ is equivalent to > ϕ and ψ are equivalent iff ϕ ψ is a tautology Minimal Automata ⇔ Note, though, that some care is necessary to deal with normal forms (which are often required by specific algorithms). Binary Decision Diagrams Taxonomy: Zero or One Inputs 9 Binary Boolean Functions 10 Case n = 2: This is much more interesting: here all the well-known operations from propositional logic appear. For small arities n we can easily enumerate all Boolean functions. x y Hand(x, y) Hor(x, y) Himp(x, y) Case n = 0: All we get is 2 constant functions 0 and 1. 0 0 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 1 1 Case n = 1: 2 constants, plus x y Hequ(x, y) Hxor(x, y) Hnand(x, y) Hid = x, the identity, and 0 0 1 0 1 Hnot(x) = 1 x, negation. − 0 1 0 1 1 1 0 0 1 1 Incidentally, the latter two are reversible. 1 1 1 0 0 Via composition we can generate all Boolean functions from these. Expressing Boolean Functions 11 Propositional Bases 12 It is well-known that some Boolean functions can be expressed in terms of As it turns out, there are lots of bases. others. For example, one can write “exclusive or” in disjunctive normal form, ⊕ conjunctive normal, or using only nand ¯ or nor ¯ as follows: ∧ ∨ Theorem (Basis Theorem) Any Boolean function f : 2n 2 can be obtained by composition from the → x y = (x y) (x y) basic functions (unary) negation and (binary) disjunction. ⊕ ∧ ∨ ∧ = (x y) (x y) ∨ ∧ ∨ Proof. = ((x ¯ x) ¯(y ¯ y)) ¯(x ¯ y) Consider the truth table for f. ∨ ∨ ∨ ∨ ∨ For every truth assignment α such that f(α) = 1 define a conjunction = (x ¯(x ¯ y)) ¯((x ¯ y) ¯ y) Cα = z1 ... zn by zi = xi whenever α(xi) = 1, zi = xi otherwise. ∧ ∧ ∧ ∧ ∧ ∧ ∧ Then f(x) Cα ... Cα . ≡ 1 ∨ ∨ r Use Morgan’s law to eliminate the conjunctions from this disjunctive normal A set of Boolean functions is a basis or functionally complete if it produces all form. Boolean functions by composition. 2 Other Bases 13 Clones 14 Here are some more bases: Definition (Clones) , , Write for all Boolean functions and for Boolean functions of arity n. {∧ ¬} BF BFn , , n { ⇒ ¬} A family F of Boolean functions is a clone if it contains all projections Pi and , 0 , is closed under composition. { ⇒ } , , 0 {∨ ⇔ } Recall that a projection is a simple map ¯ {∧} n n n ¯ Pi : 2 2 Pi (x1, . , xn) = xi {∨} → On the other hand, , does not work. and closure under composition means that {∨ ⇔ } m f : 2 2 f(x) = h(g1(x), . , gn(x)) One might be tempted to ask when a set of Boolean functions is a basis. → m n is in F, given functions gi : 2 2 for i = 1, . , n , and h : 2 2 , all in F. To tackle this problem we need to be a little more careful about what is meant → → by basis. More succinctly, we can write h (g1, . , gn). ◦ Characterization of Clones 15 One can rephrase the definition of a clone into a longer list of simpler According to rules (2), (3), (4), (5) we can construct h from f via conditions (that may be easier to work with). Let f, g F be an arbitrary ∈ h(x1, . , xn) = f(x , . , x ) functions of suitable arity. π(1) π(m) The following functions h must also be in . for any function π :[m] [n] . F → monadic identity:P 1 1 Together with the last rule this suffices to get arbitrary compositions. cylindrification: h(x1, . , xn) = f(x1, . , xn 1) − diagonalization: h(x1, . , xn) = f(x1, . , xn, xn) rotation: h(x1, . , xn) = f(x2, x3, . , xn, x1) Exercise Show that this characterization of clones is correct. transposition: h(x1, . , xn) = f(x1, . , xn 2, xn, xn 1) − − composition: h(x1, . , xn+m) = f(x1, . , xn, g(xn+1, . , xn+m)) Classifying Clones 17 Self-Dual Functions 18 Wild Question: Is there a way to describe all clones? For any Boolean function f we can define its dual f by f(x) = f(x) This may seem utterly hopeless at first, but at least a few simple clones can be b dealt with easily. For example, = and = . b ∨ ∧ ¬ ¬ It is clear that BF is a clone; we write for this clone. At the other end, the > smallest clone is the set all projections; we write for this clone. b b ⊥ A function is self-dual if The collections of all clones form a lattice under set inclusion. Operation is f(x) = f(x) u just intersection, but requires closure under composition. t Examples of self-dual functions are and projections. b ¬ Dual Clones 19 0/1-Preserving Functions 20 To find more interesting examples of clones, consider the following. For any clone F we can define the dual clone by Definition F = f f F { | ∈ } Let f be a Boolean function. b b f is 0-preserving if f(0) = 0. f is 1-preserving if f(1) = 1. So the claim here is that F is again a clone. f is bi-preserving if f is 0-preserving and 1-preserving. Unfortunately, for our trivialb clones and duality does not buy us anything. > ⊥ But later we will find a nice symmetric structure. For example n-ary disjunction and conjunction are both bi-preserving. Claim Claim The collection D of all self-dual Boolean functions is a clone. The collections P0, P1 and P of all 0-preserving, 1-preserving and bi-preserving Boolean functions are clones. Monotone Functions 21 Dedekind Numbers 22 For Boolean vectors a and b of the same length write a b iff ai bi (the ≤ ≤ product order on 2). Counting the number of n-ary monotone Boolean functions is not easy, the problem was first introduced by R. Dedekind in 1897, see Definition https://oeis.org/A000372. A Boolean function f is monotone if Here are the first few Dedekind numbers Dn, for arities n = 0,..., 8. a b implies f(a) f(b) ≤ ≤ 2, 3, 6, 20, 168, 7581, 7828354, 2414682040998, 56130437228687557907788 For example n-ary disjunction and conjunction are both monotone. One can define a topology on 2n so that these functions are precisely the One can show that Dn is the number of anti-chains in the powerset of [n]. For continuous ones. example, there are 6 anti-chains over [2] Claim , , 1 , 2 , 1, 2 , 1 , 2 ∅ {∅} {{ }} {{ }} {{ }} {{ } { }} The collection M of all monotone Boolean functions is a clone. More Anti-Chains 23 Quasi-Monadic Functions 24 And 20 anti-chains over [3]: These are functions that are essentially unary: they are formally n-ary but depend on only one argument. , , 1 , 2 , 3 , 1, 2 , 1, 3 , 2, 3 , 1, 2, 3 , Definition ∅ {∅} {{ }} {{ }} {{ }} {{ }} {{ }} {{ }} {{ }} 1 , 2 , 1 , 3 , 1 , 2, 3 , 2 , 3 , 2 , 1, 3 , 3 , 1, 2 , A Boolean function f is quasi-monadic if there is some index i such that {{ } { }} {{ } { }} {{ } { }} {{ } { }} {{ } { }} {{ } { }} 1, 2 , 1, 3 , 1, 2 , 2, 3 , 1, 3 , 2, 3 , 1 , 2 , 3 , {{ } { }} {{ } { }} {{ } { }} {{ } { } { }} xi = yi implies f(x) = f(y) 1, 2 , 1, 3 , 2, 3 {{ } { } { }} Claim Make sure you understand how the anti-chains correspond to monotone The collection U of all quasi-monadic Boolean functions is a clone. functions: every set in an anti-chain over [n] defines a clause over n Boolean variables x1, . , xn. Define f to be true on exactly these clauses. Quasi-Monadic Clones 25 Relations Between Quasi-Monadic Functions 26 Quasi-monadic functions are rather simple, so it is not too surprising that we can actually determine all clones containing only quasi-monadic functions: U there are exactly 6 of them.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us