The Univer-sity of Warwick THEORY OF COMPUTATION No 64 REPORT Some Resulrs 0{ RepLqc$.1EMt- Ruus rr,t lhlororc Boor-enr'r NerwoRr<s Paul E Dunne University of Warwick artmeDt of Conputer Science Coveniry CV4 7AI Dep England January 1984 Some Results On Replacement Rules In ltronotone Boolean Networks Panl, E. Dutt'n'e Department Of Computer Science University Of Warwick Coventry CV4'lAL Great Britain 1. Introduction ReplaceraenL n:les were introcluced by Paterson [4] and Mehlhorn [3] and used to prove Light Iower bound.s on the monotone network complefty of boolean matrix multiplieation. Th.e results applied prove that in networks com- puting boolean matrix product, gates computing certain functions may be replaced by the eonstants 0 or 1 or by an input of the network. Applications of replacement rules to otber functions have been made by TTeiss 16] for boolean convolution anil Dunne [2] for threshold functions. In this paper we investigate the f ollowing problem: (P1) Glven a pair of boolean functions/:[0,1J"->[0,1J, ir:[0,11D->[0,1l what are the monotone boolean functions h such that for any monotone network S compuLi::g /, computes We containing a gate u which computes the function 9 , 5lPrs(-t);=b t11 /? prove the folloning results: R1) For any function / we derive closed form exPressions for the maximal (F replaceable and rninimal 1-replaceable functions with respect tot. -2RZ) For any pair of funclioBs t, g we determ-ine closed lorm expressions for: (i) min s such tbat g is replaceable by s in a network comFuting .f (ii) max s sucb that g is replaceable by s in a network compuling / R3) For any pair of functions t,g we determine closed form expressions for: (i) min s such tbat s is replaceable by g in a Detwork computir:g / (ii) max s sucb that s is replaceable by g in a network computing / Using (RZ) we obtain a complete solution for (P1). The remainder of this paper is organised as follows. Below we give basic definitions and the notation used. In SecUon(Z) we derive (R1), (RZ) and (R3) above. ln Section(S) we extend our results to multiple-output functions and illus- trate some applications. ln Section(4) we prove the existence of "pseuclo- complemenLs" for aII single-valued monotone boolean functions and characteri-se lhese. Definition 1 A rrLottotone netunrk S is a directed acyclic graph with 2 distinguished sets ol nodes: X(the inpr.its of S) is the set of norles with in-degree 0. These nodes are labelled ruith members of the set [t1,...,r,, J. G is the remsinihg set of nodes, wbich have in-degree 2 (the gdtes of S). Gates are labeUed by n or w (Boolean conjunction and disjunction). tl -oDetrnition ? If S is a monotone network and u is a node of S ,?.AS(u) is the boolean func- Uon recursively defineil by: q u is input u; of S Rf,s(u) = | .Rrs(uJ iJ uis Br ^.RES(uz) I r?n',S(u) v-RE,S(ue) if u is an iJ where ur and u9 are the inputs of uiJ uis a gate. ^v gare gate tl Definition 3 ,f(! < g(x) <=> v a € [0,11"t(d)= 1 =1 9 (a)=1 cl I)efiniUon 4 A monom m is a function of the f orm: IIr = zl r^ltte/\.../\,,ri{ A monom tij €X m,is an *npl:i,cotzt of the monotoDe boolean function./' if and only if m<t. m is a prime intgtti,cutt 1) m is aa implic ant 2) w T'l n of Lt: t such that m' < m', B is not an inplicant of / -4Ilefnition 5 A clouse c is a function of the f orm; C =:rit w A clause .f . tiz w... v q{ cis an zi1 €X itr:.pliog;nd, of tl1e honotone boolean function c. c is aprime clanlsa X: 1) c is an implicand of / 2) w c- such that e < c, s is not an i-rrplieanct of /, cl Notation = [m I mis a prime implicant of I PC(Jf) = {c lcisaprimeclauseolJ } PI(Jf) J / if and only if -52. Results Def.uition 6 Let/:[0,1]L>[0,11. g :[0,1JD->[0,1J and h:[0,1JL>{o,1J be any monotone boolean functions. g Ls h+efl.o.ceahle ui.threryect to 7 k \ n) n: Sliss{ ):=h still computes for any monotone network S computing / / which contains a node u with nf,s(u)=s tr The following result is the replacement rule due to Mehlhorn [3]. Icmma 1 s { oiff: v m€PI(g) -3 d suchthat wh g^h<l => h<l -6L.J 'We sball now cbaracterise the largest O-replaceable and smallest 1- replaceable functions vith respect to any functiont. Although the results are implieil by Theorem(3) below, we shall present these cases separately as the analysis is clearer, The characterisations use tJre representation of / is a con- junctioD of prime clauses (Coqjunctive Normal Form) or as a ilisjuDction of prime implicants (Disjunctive Normal Form). DefihitioD 7 LetJ be a monotone boolean function over Irr,...,rDl. Tlne dtnl of / f) is the monotone function: 7 where " -" = -(j ( -"r,...,-r")) deDotes negatioD.. r't Ilefinition I Let m be a monom, c be a clause and lben: 1) X(m) = v [: In$zl 2) ocLt) = -.t4ax(-) 3) p(c) = n[c lz$cf t be a monotone boolean function. -?- 4) ICU|) = .€Xo,')rr(c) tr lbeorem 1( O,l-replacements ) (A) OC(t) is the unique largest Dreplaceable function with respect to /. i.e OCA) < S => g is not O-replaceable (B) IC(J) ICV) w.r.t/. is the unique smallest 1-replaceable function'with respect > g => g is not 1-replaceable w.r.t tojl'. i.e. t. .koof Let: f Dross lYe shall show (/) = wls 19101 that: oc(J) = -Doss(/) (D ol(f) <Dross(/) Suppose m, such that m /. < OC(J), but that m $ Dross (/). Then n E- € PI(t) and so mis tlere is some monom m' a sbottening of some prime implieant But: m< By monot onicity OCU|) = n.ftU,,,X{f) => m<x(r) r of -8But m $ y(r) if m is a shortening of r. CoDtraaliction. (n) Dross (1) - oc(J) Let m € PI ( Dross m. n rn e PI(/). (/) ), by Lern'na(1) there does not exist d such that Thus: v r€ PI(/) m<X(r) -=n.t{,Dx(n) < ocv) Thus; OCA) and (A) follows as Dross (/) = Dross(/) is by defnition the largest Freplaceable function witb respect to l. (B) It is easy to see tbat: IC(J) = oc6 Thus, by duality, JC(t) ts tJre unique inihirnal l-replaceable fi:ncUon with respect to .f , I] 'YIe - shall nor consider non-eonstant replacements of the form.f :=s. and <Ietermine tninimurn anil lndaimum sotu[oos for these, -9Definition I l,et I[=[6r,...,rnrl be a set ol monoms, and let/ be a monotone boolean function- TJ:e Prim.e- Irnpl:inwt Eztensinz of I[ with respect to / (mr(U)) is . deffneil to be: my(II) = [pePI("f) l=m,e llwithp< Th.e to/ q Pritne-d.anse Extensi.on ol a set of clauses C = [ cr,...,cl i with respect (c&(c)) is eiven by: cE;(c) = [p€Pc(/) A(J'g) = BU ,s) = l=qe cwitbq< pl -.nyo{ot)". q,f;"q";;" tr lbeorem 2 Let J /, gr be monotone booleau functions. Then: t) l|,il 2) .B(/,9) is the maximal s such tJmt 9 is the minimal function s such that { 9{ s s Note: Conventionally the empty monom ( clause ) is r ( o ), - IU. koof 1) Certainly g is ,4 (f ,9 )-replaceable when computing l, as by deffnition IFy( pt(C) ) is tJre set of all prime implicants of / towhichg could be extended. So suppose some turction s. exists, also satisf5ring these require- ments and that,4(/,9) $ s There must be some prime implicant of l(f ,g), p say, which is not an implicant of s . Now: p€ PI(t) atr.l ! So; PI(g ^ p) n But; PI(s n m € PI(g) such that p< m PI(f) = ps) n lpJ ntf) = $ as p{ s CoatradicUon, as g is not replaceable by s wheD computilg Thus sB A(/,g) is a minimal function. /, lf e now establisb uniqueDess. Suppose sr, are ilistinct i.e incomparable minirnal funetions. 'Ihen: Pl(gnh)nPl(/) c c PI(s ns1 n h) n PI(/) PI(g n st n sz n h) n PI(/) asg n sr Thus s1 Z) ^h <, n ss (< s1,s2) is also a suitable, but smaller funetion. Contrad.iction Duality - Codfary 2.1) C !nr"ndonlyif: l'1 D,efinition 1O PI-*(J,c) = PI(.f)-IE;( PI(g) ) Pc".-f ,c) = Pc(/)-trr'( Pc(s) ) E(f ,g) = _.4ro/(d DV,s) = *rq:rr,!r(.) tr r_t - '12I 1) EA'c) I c By Cor(z.1) we need only show: eA,eA,cD<s <EAg) (i) s < E(J,c) l,etp<g.Thenby dennition -3n ot PI,.-(f ,g such tbat p ): n rL € PI--(.f ,S ) Ttrus: wme Pl--(/,g ) p< X(-) By the definition of -O(/,9) this implies the result. (n) AU,EU:,s))-s let: pePI(,a(J,rf ,s)) ). Now: rer(n@VgD ) n Iry( pl-"-(.f,s) ) = {l Ttru6 either p e PI(/), in which case p is a lengthening of some m of g or p=0, In both cases p< g. e) .6'(/,9 ) is maximal Suppose u* f E(.f ,c) anttu! g.'Iben 3 p e PI(u) sucb thus: E(f ,9) < X(P) ".ct therefore, = r e PI,'-(/,g ) such that X (r)<X (p) So r< p. Tllrs: that p$ .8(f ,g) pribe tmplicant -13- It'\r = r € PI(t) gr\t*r(Asr€IL-(f,g)) . Ilrus uis not g-replaceable rrith respect tof; Contratliction- El Corotlary A1) nI s ilaad only if: o{nr,lo(c) = n = -o4;o,o,*{-) tr Beynoa [1] has considerecl a concept of "computational equivaleDce" within a difierent framework. g is said to be equivaleDt to h when computinC l. CH h) if and only Ilg yield; lheorem 4 c Hhtfr ,. lh anat t ( t. h =l g. In this context Cor(z.f) and Cor(3.1) koof Obvious t3 -153. Ilultiple Ou[rut F]rnctirrn* Let F = lfr,...l- J be any set of m monotone boolean functions over X . theoren S oc(F) =,4 oc(/t rc(n = J, t"tfrl l(F,e) = wrrr (rrk)) B(F,g) = ncr* (Pc(g)) E(F,s) = L eA',s) D(F,s) = P, a(J',s) where; As an illustration we reprove the replacement Boolean Matrix Multiplic ation. Let: rule due to Paterson [4] for - ro - 81P Io,1lhE->[o,1j"? where each output ct' is defined by: ' cv = ,-Y=, (z* ^Uri ) l<a I.ernrna g (Paterson [+]) Let BMP = I crr,.,,,cr- l, where cV is as defined above. Let 1< andl<j,j<D(j#il. BP 3.1) cp w zr1 = | 3.2) yX w yo' = | t BAP BITP 3.3) 1 zn w yr{ = | r koof .IC(cir) = OC("ir-) = OC( ,4* (a1 w ya) ) Thus: IC( BMP ) = ( n z*y," cr, ) ,;" l<'i! i,i< n (i * i) -11 - It is easy to see that for each of the function s in (3.1)-(3.3): IC(BMP) vs = s => IC(BMP) < s TI A k-slice function of / is a function of the form: . t t\TPvTP.r The following is due to ltegener[5]. Lemma4 If g is a k-slice firnction then: vrr€X I, &t - | z5 n Tf($ hoof Easily deriveil from Theorem(Z) above, tr Gorollary If g is a k-slice function then: z1 E. 2l ziw Tf.r(! -18- koof Duality. tr - 4, Replacement Rules Defnition rv- lc Pseuilo.f.omplements 11 Let;f be a monotone boolean firnction over X a /, L pseudo-com4tlernzr* for zlis monotone boolean tunction hi, such that in any (,^,v, -,)-network T computing in which negation is applied only to the iDputs, any instance of -zi, can be replaced by hi and the resulting network will still compuLe /. tr) theorem.6 w monotone jf , th is a pseudo" complement for zi if anil only if: .fl"r'=e = h, < fl"t=' Proof Let/s denote the function computed by T after is replacect by/le'o. si-il*ly some instance, z say, of let;f1 denote the function computed by T after tlris instaoce, z, is replaced by tla=t. No.o "io" e f o < f t it is sufficient to prove that: fr<I<Io " .: In terms of the irxtance z of -zi, T compules: 9om V :-i9 rO v -ti -,Bt9Oro V Z$ggy V 'ErW Orr w uizgtot -20where the functions gopT are such that: 1) vm€PI( gdF?): ("t )" is a moDom computeil at 2) n ( -"i )P (z)7 nm T. , -rl- or z. does not depend onzi wbere: I t uo=o (')o = I Iz CIe if 6=r arly: .f = gooo v 5i9 roo w -zr ( goro v 9or v gorr ) Now let z := t la=o so that t '= J6. lYe must prove / ..f0. IYe need only show: -trtgoor \/ -zigorr 1 Jo -.....--_---... However;;la=o I ^goor goor and -"r.f Now consider the replaceEent la=o gorr = -tr gorl thus / ,,= flt'=',lYe must show tJmt l,arly we need. only prove: tlq=tgoo, v -rrtln=lgo' v titlq=lg lor < .r But: tfr=t r.,g.r = -zr g oot < nJll=t n gorr € | gorr <.f < /s. /1 < t Simi- -ztz1 nTlt=t Thus .f r ^gm < f < J, anil the theorem follows, tr) Corollary 6.1) tet F = Lfr,...,.f-J be a set of m monotone boolean functions. Then h; is a pseuilo-complement for .zi if antl only if: ,Y/,'**<tli<*th=r L' 'We note tlat for sets of monotone boolean functions, in general the interval of Corollary(6.1) is not well-defined. However for special cases, such as slice functions, pseuilo-complements exist. For slice fu-nctions Theorem(6) and Corollary(6. t) combined yield the results of Berkoitritz (citeil in [5]) for transforning combinational networks to monotone networks efiiciently, -225. Relerences [1] Beynon, M Replaceability anil computational equivalence in ffnite distributive lattices: Iheory [2] Of Computation Report No.61, Univ. Of lYarwick, Mareh 1984. Durne, P.E. A 2.5n tower Bounil OnThe Monotone Network Complexity Of T$, Theory Ot Computation Report No.62, Univ Of Warwick, March 1984 [3] Mehlhorn, K. & Galit, Z. Monotone Switching Networks and Boolean Matrix Product, CompuUng (f6), 99-111, 19?6 [4] Paterson" M.S. Complexity Of Monotone Networks r.or Boolean Matrix Product, Theoretical Computer Science (1), 13-20, 19?5 [5] 1{egener, I On The Complexity Of Slice-Functioos, Internal Report, Univ. Of Frankfurt, Jtrly 1983 [6] Yieiss. J A nve lower Bor:ncl On Ttre Boolean Convolution, Univ. Germany, November 1982 Of Bielefeltl, West