Reconstructing Positive Boolean Functions with Shadow Clustering Marco Muselli * Alfonso Quarati Abstract — The problem of reconstructing the and- or expression of a positive Boolean function starting from a portion of its truth table is solved by adopting a proper algorithm, called Shadow Clustering (SC). It generates a collection of prime implicants by descending the part of the diagram of the Boolean lattice (associated with the input domain) that lies beneath the available examples. Three different versions of SC are proposed, according to the ap- proaches adopted to perform a single move down- ward. 1 INTRODUCTION The reconstruction of a Boolean function starting from a portion of its truth table is a basic task in the realization of digital circuits. In general, it is required that the complexity of the resulting logi- cal network (tipically, in terms of number of ports and number of connections) is kept as low as possi- ble, which leads to prefer techniques possessing the ability of retrieving functions with minimal or near- minimal expressions, according to some complexity measure. A general result ensures that every Boolean func- tion can be realized by a logical network containing only and, or and not ports. If the use of the com- plement operator not is not allowed, we can only construct some of the possible binary mappings, the positive Boolean functions. These mathemat- ical objects have recently attracted the attention of many researchers, because of their applications in the solution of several practical problems, rang- ing from the implementations of stack filters to the development of machine learning algorithms, from the choice of strategies in game theory to the gen- eration of feasible sets in convex programming. Unfortunately, to our best knowledge a proce- dure for an efficient synthesis of positive Boolean functions is available only in the case of active learning [1, 2], when queries about the value of the output in correspondence of specific points chosen by the user can be performed. On the other hand, * Istituto di Elettronica e di Ingegneria dell’Informazione e delle Telecomunicazioni, Consiglio Nazionale delle Ricerche, Genova, Italy, e-mail: marco.muselli@ieiit.cnr.it, tel.: +39 010 6475213, fax: +39 010 6475200. Istituto di Matematica Applicata e Tecnologie Infor- matiche, Consiglio Nazionale delle Ricerche, Genova, Italy, e-mail: alfonso.quarati@ge.imati.cnr.it, tel.: +39 010 6475673, fax: +39 010 6475660. if only a fixed part of the truth table is known and no other input points can be explored, a proper algorithm for solving practical problems within a reasonable execution time cannot be found in the literature. The present paper deals with this important syn- thesis problem and proposes a general technique for the reconstruction of positive Boolean functions from examples. Following an approach similar to Hamming Clustering [3], the proposed method pro- ceeds by considering at every iteration one of the points contained in the data set at hand and by con- structing one or more implicants to be employed in the generation of a disjunctive normal form for the positive Boolean function to be retrieved. 2 Basic definitions and notations Consider the Boolean lattice {0, 1} n , equipped with the well known binary operations ‘+’ (logical sum or or) and ‘·’(logical product or and). To improve readability, the elements of this Boolean lattice will be denoted henceforth as strings of bits: in this way, (0, 1, 1, 0) ∈{0, 1} 4 will be written as 0110. The usual priority on the execution of the operators + and · will be adopted; furthermore, when there is no possibility of misleading, the symbol · will be omitted, thus writing uv instead of u · v. A standard partial ordering can be defined on {0, 1} n by setting u v if and only if u + v = v; this definition is equivalent to write u v if and only if u i v i for every i =1,...,n. According to this ordering, a Boolean function f : {0, 1} n {0, 1} is called positive if u v implies f (u) f (v). Since the Boolean lattice {0, 1} n does not involve the complement operator not, Boolean ex- pressions developed in this lattice (sometimes called lattice expressions) can only include the logical op- erations and and or. As a consequence, it can be shown that only positive Boolean functions allow to be put in the form of lattice expressions. The following definitions will be used henceforth. Definition 1 An antichain is a subset A ⊂{0, 1} n such that for any x, y A with x = y neither x < y nor y < x holds. The lower shadow of a {0, 1} n is the subset L(a)= {x ∈{0, 1} n : x a}. Likewise, the upper shadow of a ∈{0, 1} n is the subset U (a)= {x ∈{0, 1} n : x a}.