Generati-on 0o Representative Functions Equivalence … 0 0 f(C2) 4 C2 2 0 1 0 f(CO) 2 C3 o 0 1...

7
IEEE TRANSACTIONS ON COMPUTERS, VOL. c-21, NO. 12, DECEMBER 1972 [7] T. A. Dolotta and E. J. McCluskey, "The coding of internal states of sequential circuits," IEEE Trans. Electron. Comput., vol. EC-13, pp. 549-563, Oct. 1964. [81 P. WTeiner and E. J. Smith, "Optimization of reduced de- pendencies for Eynchronous sequential machines," IEEE Trans. Electron. Comput., vol. EC-16, pp. 835-847, Dec. 1967. [9] H. C. Torng, "An algorithm for finding secondary assignments of synchronous sequential circuits," IEEE Trans. Comput., vol. C-17, pp. 461-469, May 1968. [10] H. A. Curtis, "Systematic procedures for realizing synchronous sequential machines using flip-flop memory: Part I," IEEE Trans. Comput., vol. C-18, pp. 1121-1127, Dec. 1969. [11] --, "Systematic procedures for realizing synchronous se- quential machines using flip-flop memory: Part II," IEEE Trans. Comput., vol. C-19, pp. 66-73, Jan. 1970. [12] T. A. Dolotta, "The coding problem in the design of switching circuiits," Ph.D. dissertation, Princeton Univ., Princeton, N. J., May 1961. [131 H. A. Curtis, "Illustrationi of design methods for power reduc- tion in logical systems," NASA Tech. Note D-3027, 1965. [14] C. Harlow and C. L. Coates, "On the structure of realizations using flip-flop memory elements," Inform. Contr., vol. 10, pp. 159-174, Feb. 1967. [15] La, "On the structure of sequential machine realizations," Lab. Electron. Related Sci. Res., Univ. Texas, Austin, Tech. Rep. 27, July 1967. [16] WV. A. Davis, "An approach to the assignment iinput codes," 1373 IEEE Trans. Electron. Comput., vol. EC-16, pp. 435-442, Aug. 1967. [17] J. R. Story, "State assignment optimization for synchronous sequential machines,'" Ph.D. dissertation, Univ. Alabama, Tuscaloosa, May 1971. [18] H. J. Harrison, "State assignment optimization for synchronous sequential machines with flip-flop memory," Ph.D. disserta- tion, Univ. Alabama, Tuscaloosa, Jan. 1972. [19] E.J. McCluskey, Jr., and S. H. Unger, "A note on the nuimber of internal variable assignments for sequential circuits, " IRE Trans. Electron. Comput., vol. EC-8, pp. 439-440, Dec. 1959. [20] P. Weiner and E. J. Smith, "On the number of distinct assign- ments for synchronous sequential machines, " IEEE Trans. Electron. Comput. (Short Notes), vol. EC-16, pp. 220-221, Apr. 1967. [21] R. E. Miller, Switching Theory Volume I: Combinational Cir- cuits. New York: Wiley, 1965. [22] H. C. Torng, Introduction to the Logical Design of Switching Systems. Reading, Mass.: Addison-Wesley, 1964. [23] F. J. Hill and G. R. Peterson, Introduction to Switching Theory and Logical Design. New York: Wiley, 1968. [24] E. J. McCluskey, Jr.. Introduction to the Theory of Switching Circuits. New York: McGraw-Hill, 1965. [25] M. Phister, Logical Design of Digital Computers. New York: Wiley, 1959, ch. 5. [26] D. L. Dietmeyer, Logical Design of Digital Systems. Boston, Mass.: Allyn and Bacon, 1970. Generati-on 0o Representative Functions of the NPN Equivalence Classes of Unate Boolean Functions CHARLES R. BAUGH Abstract-An algorithm is described which generates the set of representative functions of the negation and/or permutation of vari- ables and negation of the function (NPN) equivalence classes of unate Boolean functions. The algorithm is based upon integer pro- gramming techniques. The set of representative functions for the NPN equivalence classes of unate functions of six or fewer variables was obtained using this algorithm. The set of pseudothreshold func- tions of six or fewer variables was also tabulated by using this algo- rithm as a basis. Index Terms-Boolean functions, integer programming, NPN equivalence classes, pseudothreshold functions, representative func- tions, unate functions. I. INTRODUCTION T HE SET of Boolean functions which are unate form an interesting class of Boolean functions. This class of functions contains: 1) most of the widely used logic gates such as NAND, NOR, AND; 2) all threshold functions; and 3) all pseudothreshold func- tions. (See Slivinski [8] for a very good description of Manuscript received March 11, 1971; revised March 15, 1972. This work was supported in part by NSF Grant GJ-503. The author was with the Department of Computer Science, Uni- versity of Illinois, Urbana, ll. He is now with Bell Telephone Labora- tories, Inc., Holmdel, N. J. 07733. pseudothreshold f.unctions.) Further, it is known that the class of pseudothreshold functions contains the class of threshold functions which in turn contains most of the widely used logic gates. Thus, by examining the class of pseudothreshold functions, the other two classes are also examined. One of the motivations for examining pseudothreshold logic has been the desire to extend the mathematical models used for threshold functions to a larger subset of Boolean functions. In this way, a larger set of Boolean functions can be incorporated into a single unified theory. The class of pseudothreshold functions is much larger than the class of threshold functions. The well-known upper bound on the number of threshold functions is \/2/(rn)(e/n)n2n2 while the lower bound [1 ] on the number of pseudothreshold func- tions is 221'. Clearly, the latter is larger than the former. When studying pseudothreshold functions, it is sohle- times desirable to enumerate properties for all pseudo- threshlold functions of a given number of variables. For pseudothreshold functions it is sufficient to enumerate the properties of a representative of each negation and/or permutation of variables and negation of the function (NPN) equivalence class in order to enumerate the properties of all pseudothreshold functions. Since

Transcript of Generati-on 0o Representative Functions Equivalence … 0 0 f(C2) 4 C2 2 0 1 0 f(CO) 2 C3 o 0 1...

IEEE TRANSACTIONS ON COMPUTERS, VOL. c-21, NO. 12, DECEMBER 1972

[7] T. A. Dolotta and E. J. McCluskey, "The coding of internalstates of sequential circuits," IEEE Trans. Electron. Comput.,vol. EC-13, pp. 549-563, Oct. 1964.

[81 P. WTeiner and E. J. Smith, "Optimization of reduced de-pendencies for Eynchronous sequential machines," IEEE Trans.Electron. Comput., vol. EC-16, pp. 835-847, Dec. 1967.

[9] H. C. Torng, "An algorithm for finding secondary assignmentsof synchronous sequential circuits," IEEE Trans. Comput.,vol. C-17, pp. 461-469, May 1968.

[10] H. A. Curtis, "Systematic procedures for realizing synchronoussequential machines using flip-flop memory: Part I," IEEETrans. Comput., vol. C-18, pp. 1121-1127, Dec. 1969.

[11] --, "Systematic procedures for realizing synchronous se-quential machines using flip-flop memory: Part II," IEEETrans. Comput., vol. C-19, pp. 66-73, Jan. 1970.

[12] T. A. Dolotta, "The coding problem in the design of switchingcircuiits," Ph.D. dissertation, Princeton Univ., Princeton, N. J.,May 1961.

[131 H. A. Curtis, "Illustrationi of design methods for power reduc-tion in logical systems," NASA Tech. Note D-3027, 1965.

[14] C. Harlow and C. L. Coates, "On the structure of realizationsusing flip-flop memory elements," Inform. Contr., vol. 10, pp.159-174, Feb. 1967.

[15] La, "On the structure of sequential machine realizations,"Lab. Electron. Related Sci. Res., Univ. Texas, Austin, Tech.Rep. 27, July 1967.

[16] WV. A. Davis, "An approach to the assignment iinput codes,"

1373

IEEE Trans. Electron. Comput., vol. EC-16, pp. 435-442,Aug. 1967.

[17] J. R. Story, "State assignment optimization for synchronoussequential machines,'" Ph.D. dissertation, Univ. Alabama,Tuscaloosa, May 1971.

[18] H. J. Harrison, "State assignment optimization for synchronoussequential machines with flip-flop memory," Ph.D. disserta-tion, Univ. Alabama, Tuscaloosa, Jan. 1972.

[19] E.J. McCluskey, Jr., and S. H. Unger, "A note on the nuimber ofinternal variable assignments for sequential circuits, " IRE Trans.Electron. Comput., vol. EC-8, pp. 439-440, Dec. 1959.

[20] P. Weiner and E. J. Smith, "On the number of distinct assign-ments for synchronous sequential machines, " IEEE Trans.Electron. Comput. (Short Notes), vol. EC-16, pp. 220-221, Apr.1967.

[21] R. E. Miller, Switching Theory Volume I: Combinational Cir-cuits. New York: Wiley, 1965.

[22] H. C. Torng, Introduction to the Logical Design of SwitchingSystems. Reading, Mass.: Addison-Wesley, 1964.

[23] F. J. Hill and G. R. Peterson, Introduction to Switching Theoryand Logical Design. New York: Wiley, 1968.

[24] E. J. McCluskey, Jr.. Introduction to the Theory of SwitchingCircuits. New York: McGraw-Hill, 1965.

[25] M. Phister, Logical Design of Digital Computers. New York:Wiley, 1959, ch. 5.

[26] D. L. Dietmeyer, Logical Design of Digital Systems. Boston,Mass.: Allyn and Bacon, 1970.

Generati-on 0o Representative Functions of the NPN

Equivalence Classes of Unate Boolean Functions

CHARLES R. BAUGH

Abstract-An algorithm is described which generates the set ofrepresentative functions of the negation and/or permutation of vari-ables and negation of the function (NPN) equivalence classes ofunate Boolean functions. The algorithm is based upon integer pro-gramming techniques. The set of representative functions for theNPN equivalence classes of unate functions of six or fewer variableswas obtained using this algorithm. The set of pseudothreshold func-tions of six or fewer variables was also tabulated by using this algo-rithm as a basis.

Index Terms-Boolean functions, integer programming, NPNequivalence classes, pseudothreshold functions, representative func-tions, unate functions.

I. INTRODUCTIONT HE SET of Boolean functions which are unate

form an interesting class of Boolean functions.This class of functions contains: 1) most of the

widely used logic gates such as NAND, NOR, AND; 2) allthreshold functions; and 3) all pseudothreshold func-tions. (See Slivinski [8] for a very good description of

Manuscript received March 11, 1971; revised March 15, 1972.This work was supported in part by NSF Grant GJ-503.

The author was with the Department of Computer Science, Uni-versity of Illinois, Urbana, ll. He is now with Bell Telephone Labora-tories, Inc., Holmdel, N. J. 07733.

pseudothreshold f.unctions.) Further, it is known thatthe class of pseudothreshold functions contains the classof threshold functions which in turn contains most ofthe widely used logic gates. Thus, by examining theclass of pseudothreshold functions, the other two classesare also examined. One of the motivations for examiningpseudothreshold logic has been the desire to extend themathematical models used for threshold functions to alarger subset of Boolean functions. In this way, a largerset of Boolean functions can be incorporated into asingle unified theory. The class of pseudothresholdfunctions is much larger than the class of thresholdfunctions. The well-known upper bound on the numberof threshold functions is \/2/(rn)(e/n)n2n2 while thelower bound [1 ] on the number of pseudothreshold func-tions is 221'. Clearly, the latter is larger than the former.When studying pseudothreshold functions, it is sohle-

times desirable to enumerate properties for all pseudo-threshlold functions of a given number of variables. Forpseudothreshold functions it is sufficient to enumeratethe properties of a representative of each negationand/or permutation of variables and negation of thefunction (NPN) equivalence class in order to enumeratethe properties of all pseudothreshold functions. Since

IEEE TRANSACTIONS ON COMPUTERS, DECEMBER 1972

pseudothreshold functions are unate functions, the setof representative functions of the NPN equivalenceclasses of pseudothreshold functions can be defined as asubset of the representative functions of the NPNequivalence classes of unate functions. More precisely,a representativef(X), of an NPN equivalence class ofunate functions can be defined as a representative of anNPN equivalence class of a pseudothreshold functionif f(X) is a pseudothreshold function.However, it is not a simple task to generate a repre-

sentative from each NPN equivalence class of unatefunctions. In this paper an algorithm is described whichgenerates exactly one representative function from eachNPN equivalence class of unate functions, The algo-rithm consists of formulating a set of linear inequalitieswhose complete set of solutions corresponds to a propersubset of the unate functions. This subset of unatefunctions is shown to contain the set of representativefunctions of the NPN equivalence classes of unate func-tions. The solutions of these inequalities are obtainedusing integer programming techniques. The set of repre-sentatives of the NPN equivalence classes of unatefunctions is extracted from the set of solutions of theinequalities by eliminating those functions which areidentical to other functions when the variables of eitherthe function or its dual are permuted.

Before proceeding to the details of the algorithm,necessary terminology is introduced. The n-tuple C= (c1, * , c,) where each ci = 1 or 0 is an assignment tothe n variables x1, , x., of the Boolean functionf(X) =f(x1, ., xv). The Boolean function f(X) ispositive in x, if 1 f(A:xi-*1) >f(A:xj->O) for all assign-ments A on the remaining n -1 variables.The function f(X) is negative in xi if f(A:xil-*)

<f(A:xi-+O) for all assignments A on the remainingn -1 variables. The function f(X) is a positive functionif f(X) is positive in all xi and f(X) is a unate function iff(X) is either positive or negative in each xi.

II. ARRANGEMENT OF THE TRUTH TABLEThe linear inequalities for the Boolean functions are

based upon the particular arrangement of the truthtable given next. Assume the truth table consists of the2n assignments contaihing n components.

1) Arrange the assignments in groups according tothe number of I's in each assignment. Group 1 consistsof the assignment which contains no l's, group 2 con-sists of the assignments which contain one 1, etc. Noticethat there are (n+ 1) groups. Arrange the groups accord-ing to the number of l's in the assignments as shown inExample 1.

2) Consider each assignment C= (ci, *, c) as adecimal integer, i.e., EZ=n 2n-iC. Within each of then+1 groups defined in 1), arrange the assignments in

1 We use f(X: xi-*1) to denote the function obtained from f(X)by substituting 1 for xi.

TABLE IARRANGEMENT OF TRUTH TABLE FOR A BOOLEAN

FUNCTION OF THREE VARIABLES

DecimalGroup Equiva- Assign-Number x1 X2 X3 f(X) lent ment

1 0 0 0 f(C1) 0 C1

1 0 0 f(C2) 4 C22 0 1 0 f(CO) 2 C3

o 0 1 f(C4) 1 C4

1 1 0 f(C5) 6 C53 1 0 1 f(C6) 5 c6

0 1 1 f(C7) 3 C7

4 1 1 1 f(C8) 7 c8

descending order according to the value of the decimalinteger they represent.

Label the assignments as follows: the assignment ofgroup 1 as C1; the first assignment of group 2 as C2;the second assignment of group 2 as C3, * * *; and theassignment of group n+1 as C2n.Example 1: For example, the truth table for a Boolean

function f(X) of three variables is shown in Table I.Throughout this paper a permutation of variables is

discussed. It will be assumed that the truth table result-ing from a permutation of variables is the same as thetruth table before permuting the variables except thatthe functional valuesf(Ci) are appropriately rearranged.In other words, the columns of the truth table cor-responding to the variables being permuted are notinterchanged but rather the change in the functionalvalues f(Ci) reflects the permutation. Therefore, thearrangement of the assignnments in the truth table al-ways remains fixed according to the rules just outlined.

III. INEQUALITIES FOR THE NPNCLASSES OF UNATE FUNCTIONS

In this section the inequalities which preclude thevast majority of the 22 Boolean functions from being amember of the set of representative functions of theNPN equivalence classes of unate Boolean functions arepresented. The variables of the inequalities z1, * * - , z2nwill correspond to the values of the function, i.e., for agiven assignment Ci = (cil, * * ,c?)

f(C) = z.

Therefore, the complete set of solutions of the inequal-ities described in this section is a set of Boolean func-tions. It will be proven that the representative func-tions of the NPN equivalence classes of unate Booleanfunctions are a subset of this set of functions. The func-tions which are solutions to the integer programmingproblem but are not representatives will be detected bypermuting the variables of either the function or itsdual. This procedure is sketched in Section IV.The complete set of inequalities which are developed

are

1374

BAUGH: UNATE BOOLEAN FUNCTIONS

mkE Zki - mkzk > 0i=l

2n

(Ci - Cij+j* >°-i=1

2n 2n22 E (ci- - Cij )z i + E7 2 (2n-i)(C -Cj+1)Z > °

i=l i=1

2nZtzi> 2n-I

i=l

(1)qj(f) = qj+(g)

q3+±(f) = q,(g)for k:j and k j+1I Obviously f(X) and g(X) belong

(2) to the same NPN equivalence class. In order to excludeg(X) from being a candidate for a representative func-tion, the components of the Chow parameters are ar-

(3) ranged in descending order, i.e.,forj= 1,- - , n - 1.

(4)

forj=1, * n-1 and fork=1, * ,2n-1.

A. Positive Boolean Functions-Inequalities (1)Since the NPN equivalence classes of unate Boolean

functions are considered, two Boolean functions areequivalent if one can be obtained from the other bynegation of variables. Therefore, all representative func-tions are required to be positive functions. It is knownthat a Boolean function is positive if and only if for eachCk, f(Ck) .f(Ci) for all Ci such that2 Ck < Ci. Thus foreach assignment Ck for k=1, - - 21'-1 we have

f(Ck) < f(Cki), for i = 1 * , mk

where mk is the number of assignment Cki which satisfies

Ck < CkI, fori 1, Mkm

Next it is shown that inequalities (1) insure thatf(X) is positive. If Zk=1 (i.e., f(Ck) = 1), (1) requiresthat all assignments C > Ck must be true assignments.In other words f(X) is a positive function. Consequentlyany solution to the inequalities (1) corresponds to a

positive function.

B. Ordering the Chow Parameters-Inequalities (2)The Chow parameters [4] q(f)=(qo(f), qi(f), *

q.(f)) of f(X) are defined as

qo(f) = Ef(A)A

qi(f) - aif(A), fori= 1, ... XA

where >A denotes the summation over all assignments.It will be shown that the components of the Chowparameters of representative functions can be arrangedin descending order. Assume f(X) is a Boolean functionof n variables with Chow parameters q(f) such thatqj(f)>qqj+4(f) for some 1<j<n-1. Letg(X) with Chowparameters q(g) be obtained from f(X) by exchangingxj and xj ,. Then from the properties of Chow pa-

rameters

qk) - qk(g)

2 We use Ck< Ci to denote that no component of Ci is smaller thanthe corresponding component of Ck and at least one component of Ciis larger than the corresponding component of Ck.

Next it is shown that inequalities (2) insure that thecomponents of the Chow parameters are in descendingorder. If zi= 1, then f(Ci) = 1. Inequalities (2) requirethat the sunm of the jth components (Z 1 cijzi) of thetrue assignments cannot be smaller than the sum of the(j+1 )th components ( Z=1 c.X+izi) of the true assign-ments. In other words, the jthi component of the Chowparameters is not smaller than the (j+1)th component.

C. Ordering Variables of Equal Chow Parameters-Inequalities (3)

If a Boolean functionf(X) has two components of itsChow parameters equal and iff(X) is not symmetric inthe corresponding two variables, then a different Bool-ean function g(X) can be obtained by interchangingthese two variables. Obviouslyf(X) and g(X) belong tothe same NPN equivalence class. In an attempt to ex-clude one of these two functions from being a candidatefor a representative function, the columns of the truthtable which have equal Chow parameters will be lexi-cographically ordered according to the definition oflexicographic order given in what follows. Unfortunately,if f(X) satisfies the lexicographic ordering, g(X) mayalso satisfy 'the lexicographic ordering. Thus the lexico-graphic ordering is a necessary condition for excludingone of the functions f(X) and g(X), but not a sufficientcondition. Two columns (Clk, C`2,C) and (cil, *C2nj) of the truth table are lexicographically ordered if

Cmk > Cm I

for the smallest m such that f(Cm) 1 and Cmk5£cC.Notice that the lexicographic ordering is only con-

cerned with the true assignments of the truth table. Alsonotice that the lexicographic ordering is transitive andconsequently we need to be concerned with lexico-graphically ordering only adjacent pairs of columns ofthe truth table.The next lemma and theorem prove that it is possible

to order the columns of the truth table lexicographi-cally.Lemma 1: Let f(X) be a Boolean function of n vari-

ables whose truth table is arranged according to therules of Section II. Suppose for some assignment Ci suchthatf(Ci) $ 1 there are k and I whichi satisfy

k < I

Cik > Gil

1375

qj(f) > qj+ 1 (f),

IEEE TRANSACTIONS ON COMPUTERS, DECEMBER 1972

and

C8k = C8I

for all true assignments C8 with s<i. Let CZ, be theassignment obtained from Ci by interchanging Cik andcii. Then if f(Ce,) # 1 for all i, k, and I which satisfy the-above conditions, the columns of the truth table arelexicographically ordered.

Proof: The lemma will be proven by contradiction.Assume columns k and I are not lexicographically or-dered. Consequently, there is an assignment Cj suchthat there are k and I which satisfy

f(C,) = 1

k < I

Cjk < cjI

and

Csk = C8

for all true assignments C8 with s<j. Consider the as-signment CZ, obtained from C3 by exchanging Cjk andcjl. Since Ct, is a permutation of Cj, both assignmentsare in the same group of assignments of the truth table.Since C%jk>Ctj, and since k <1, the decimal number whichCt, represents is larger than that of Cj. Therefore, Ce,appears above Cj in the truth table and as a result ,j <j.

Assunme f(Ct,) = 1. The fact that (j <j contradicts theassumption that

C8k = C8G

for all true assignments C8 with s <j. Therefore, f(C13)$ 1. The fact that Cb, satisfies

f(Ct,) # 1

k < I

and

CQjk > Ct 1

results inf(Cj) $ 1 by the conditions in Lemma 1; (noticethat Cj and Ct, are reversed here). This contradicts theoriginal assumption thatf(Cj) = 1. Therefore, columns kand I must be lexicographically ordered. Q.E.D.

Theorem 1: Letf(X) be a positive Boolean function ofn variables. Then there exists some function g(X) ob-tained from f(X) by successive permutations of vari-ables such that all columns of the truth table (arrangedaccording to the rules of Section II) are lexicographicallyordered.

Proof: Assume f(X) satisfies the conditions ofLemma 1. Then the columns of the truth table forf(X)are lexicographically ordered and the theorem is true.Assumef(X) does not satisfy the conditions of Lemma

1. In this case a sequence of functionsfi(X), f2(X), *fm(X) (starting with fi(X) =f(X)) will be formed suchthat fm(X) satisfies the conditions of Lemma 1 and suchthat each fj+1(X) (j = 1, * *, mr-1) is obtained fromfj(X) by interchanging a pair of variables Xk and xl.

Therefore, fm(X) =f(X(X)) for some permutation ofvariables X(X). Next define g(X) =f(X(X)) and byLemma 1, the columns of the truth table of g(X) arelexicographically ordered. The notation Cti is used todenote the assignment obtained from Ci by exchangingCik and cil for a given k and 1.

First define f2(X) from f(X). Let J2 be the smallestinteger r such that there are k and I which satisfy

k < I

Crk > Cr I

f(Cr) 5 1 and f(Cer) = 1

and

CB k C8 I

for all true assignments C8 with s <r. Clearly, such j2,k and I exist sincef(X) does not satisfy the conditions ofLemma 1. Sincej2 is minimum, f(X) satisfies the condi-tions of Lemma 1 for all i <j2. It will be shown thatf2(X) obtained from f(X) by exchanging Xk and xi satis-fies the conditions of Lemma 1 for all i<j2. (Notice thatequality is included for f2(X) but not for f(X).) If

f2(Cp) = f(C), forp = 1, * j2-1

then f2(X) satisfies the conditions of Lemma 1 for alli <j2. It will be proven thatf2(Cp) =f(Cp) for p = 1, *J2-1. Since f2(X) is obtained from f(X) by exchangingXk and xi, f2(Cp) =f(CtP) for p= 1, * , 2 .

Case 1: Consider the assignment Ca of f(X) such thatCak = cal. In this case C, = C: and thus f(Ca) =f(CZ,)Therefore, f2(C,) =f(Ct,) =f(C,).

Case 2: Consider the assignment C, of f(X) such thatCok$ C0j and J<j. Since it was assumed that columns kand 1 satisfy C8k = C81 for all true assignments C, withS <j2, f(Ca) #1. Next it is shown that f(CtC)$# 1. SinceC, is a permutation of C<, they both are in the samegroup of assignments of the truth table.Assume Cak > CCL. Since cCk > CCI and since k < 1, CC ap-

pears above Ct7 in the truth table. Since f(X) satisfiesthe conditions of Lemma 1 for all i <j2 and since o- <j2,f(CZ,)#P1 by Lemma 1.

Next assume CCk<CC, In this case C, appears below*Ct in the truth table and therefore, (,a<a<j2. Iff(Ct,) = 1, there would be a contradiction of the as-sumption that columns k and I satisfy

C8k = C I

for all true assignments C8 with s <j2. Therefore,f(C ¢) i- 1. Thus, f(CC,) =f(Cta) and f2(Ca) =f(Ct,)f(Ca) .Since all assignments C8 with s <j2 are examined in

either Case 1 or Case 2,

f2(Cp) = f(Cp)ITherefore, f2(X) satisfies the conditions of Lemma 1 forall i <j2. Since f(Ctj2) =1 and since f2(Cj2)=f(Ctj2),

1376

for p = 1, - - -

, j2 1-

BAUGH: UNATE BOOLEAN FUNCTIONS

f2(C2) = 1. Therefore, it has been shown that f2(X)satisfies the conditions of Lemma 1 for all i<j2.Next consider the functionf2(X). If f2(X) satisfies the

conditions of Lemma 1, the columns of the truth tablefor f2(X) are lexicographically ordered. In this case de-fine g(X) =f2(X) and the theorem is true. If f2(X) doesnot satisfy the conditions of Lemma 1, f3(X) is formedfrom f2(X) as follows. Let j3 be the smallest integer rsuch that there are k' and 1' which satisfy

k' < 1'

Crk' > Cr1'

f2(C,) 1 and f2(C0r) = 1

and

Csk' = Csl1

for all true assignments C, with s<r. Sincef2(X) satis-fies the conditions of Lemma 1 for all i<j2, we knowj3>j2. The same proof that was used for f2(X) is used toshow thatf3(X) satisfies the conditions of Lemma 1 forall .<j3 wheref3(X) is obtained fromf2(X) by exchang-ing Xk, and xj'.By repeating this process, a series of functions

f2(X), s ¢ sfm(X) and a series of corresponding j's,j2 <j3 < ... <jm-l are obtained such thatfm(X) satisfiesthe conditions of Lemma 1. Since

iP <jKJ+i, for p = 2, *,m-2,

the sequence of functions f1(X), *- , fm(X) is finite.Define g(X) =fm(X). Sincefm(X) satisfies the conditionsof Lemma 1, the columns of the truth table for g(X) arelexicographically ordered. Q.E.D.Next it is shown that the solutions of inequalities (3)

correspond to Boolean functions which have the col-umns of their truth tables lexicographically ordered.By Theorem 1, the columns of the truth table for g(X)can be lexicographically ordered. In order to insure thateach pair of columns are lexicographically ordered, oneinequality for each pair of columns is needed. Since thelexicographic order of columns is transitive, only adja-cent pairs of columns need to be ordered to insure allcolumns are ordered. As a result only n -1 inequalities(one for each adjacent pair of columns) are needed. Inthe beginning of this section it was noted that onlythose columns whose components of the Chow parame-ters are equal need to be order lexicographically. There-fore, the inequalities which insure that the columns arelexicographically ordered must take into account thevalues of the components of the Chow parameters.

Notice that from inequalities (2)

2

22n (cij - cij+1)zi . 0i=l

and consequently the first term in inequality (3) takesthe value 0 when the jth and (j+ 1)th components ofthe Chow parameters are equal. The left-hand side

takes the value greater than or equal to 221 if the jthand (j+1)th components of the Chow parameters arenot equal. Also notice that the second term in (3) isbounded by

2

E 2(2fj)(cij- Cij+l)Zj < 22.i=l

Thus the second term is restricted only if the first termis zero. Therefore, inequalities (3) become

2n2"

E 2(2 i)(ci - cij+l)zi > 0i=l

(5)

only if the first term of (3) is zero, i.e., only if the jthand (j+1)th components of the Chow parameters areequal. Next it will be proven that inequality (5) re-quires columns j and j+1 to be lexicographically or-dered. Let m be-the smallest integer such that CmjC1mjc+landf(Cm) =Zm= 1. If Cmj<Cmj+±, the preceding inequalityis infeasible since

(cij - cij+l)zi = 0, for all i < m

(Cm1 - Cinj+l)Zm = -

and

2n 2

2 (2"-m) > E 2(2n-_) > 2(2 -i) (Cij -Cij+J)Zii=m+ 1 i=m+ 1

Therefore, cm3j> cmj±1. Since columns j and j+ 1 arelexicographically ordered if c;> c,j+l for the smallest psuclh thatf(C,) 1 and c, --cpj+, the preceding inequal-ity restricts columns j and j+1 to be lexicographicallyordered. Therefore, inequalities (3) require that thosecolumns of the truth table whose components of theChow parameters are equal are lexicographically or-dered.

D. Dual of the Fudction-Inequality (4)Since the set of representative functions of the NPN

equivalence classes of unate Boolean functions are beinggenerated, only one of the pair of functions f(X) andfd(X) where fd(X) =7(X) is the dual of f(X) need begenerated. Let q(f) and q(fd) be the Chow parametersof f(X) and f(X), respectively. It is known that thenumber of true assignments qo(f) of f(X) and qo(fd) offd(X) are related by qo(f) = 2n-qo(fd). Since it is imma-terial which of f(X) and fd(X) is generated, restrictqo(f) >qo(f). From the above relationship betweenqo(f) and qo(fd), qo(f) >qo(fd) if and only if qo(f) > 2n-1.Thus inequality (4) restricts qo(f) > 2"-'. If qo(f) =qO(fd),both f(X) and fd(X) satisfy (4). Thus restricting qo(f)> 2n-I is a necessary but not sufficient condition for pre-cluding one of the two functions f(X) and fd(X).

E. Formulation of the Integer Programming ProblemNow that the set of inequalities (1)-(4) is derived, it

will be shown that the set of all solutions to these in-

1377

IEEE TRANSACTIONS ON COMPUTERS, DECEMBER 1972

equalities contains the set of representative functions ofthe NPN equivalence classes of unate Boolean func-tions. Assume thatf(X) is a unate Boolean function of nvariables. It will be shown that there is a function ob-tained from f(X) by NPN operations which satisfiesinequalities (1)-(4). Since f(X) is unate, the positivefunction f1(X) is formed by appropriate negations ofvariables off(X). Since fi(X) is positive, it satisfies (1).If fi(X) does not satisfy (4), it was shown above thatfl3(X) does satisfy (4). Hence, f2(X) is defined as eitherfi(X) orfid(X) such thatf2(X) satisfies (4). Sincefi(X)is positive, f1d(X) is positive. Therefore, f2(X) is positiveand satisfies (1). As was shown, f3(X) can be obtainedfrom f2(X) by a permutation of variables such thatf3(X) satisfies (2). Next f3(X) is shown to satisfy both(1) and (4). Since any function obtained from a positivefunction by permutation of variable is positive, f3(X)satisfies (1). Sincef3(X) and f2(X) have the same num-ber of true assignments, f3(X) satisfies (4). As wasshown, there is a function f4(X) obtained from f3(X)by a permutation of variables which satisfies (3). It wasshown that f4(X) also satisfied (2). By using the samearguments onf4(X) that were used onf3(X) it is proventhat f4(X) also satisfies (1) and (4). Therefore, f4(X)satisfies the constraints (1)-(4). Since f4(X) is obtainedfrom f(X) by a series of NPN operations,f(X) and f4(X)are in the same NPN equivalence class. Thus, there isat least one representative function of each NPNequivalence class which is a solution to (1)-(4).

Since the unknowns zi in inequalities (1)-(4) are re-stricted to be 1 or 0, the techniques developed to solvezero-one integer programming problems can be used todetermine the solutions to inequalities (1)-(4). It willbe seen that the set of all optimum solutions to the zero-one integer programming problems:

2

min E 0 zii=l

subject to (l)-(4) is equivalent to the set of all solutionsto (1)-(4). Obviously, all optimum solutions to theinteger programming problem are solutions to (1)-(4).Since all coefficients of the objective function are 0, allfeasible solutions to the integer programming problemhave an objective function value of 0 and consequentlyall feasible solutions are optimum solutions. Therefore,all solutions to (1)-(4) are optimum solutions to theinteger programming problem. Since the set of all opti-mum solutions of the integer programming problem isalso the set of all solutions to (1)-(4), all optimum solu-tions to the integer programming problem will be enu-merated. By a slight modification of the implicit enu-meration code' ILLIP [5 ] which is designed to determinea single optimum solution of a zero-one integer pro-

3 This implicit enumeration code has been used for the synthesisof optimum logic networks. For details of the formulation and com-putational results see [31, [6], [7].

gramming problem, all optimum solutions are obtained.Using this modified program, all solutions to (1)-(4) areenumerated. The results are given in Section V.

IV. SELECTING REPRESENTATIVES OF THE NPNCLASSES FROM THE INTEGER PROGRAMMING

SOLUTIONSThe scheme for selecting one function from the set of

integer programming solutions for each NPN equiva-lence class is relatively simple. It will be stated withoutproof. The details and proofs are available in [2 ].As was shown in Section III, inequalities (3) and (4)

are necessary but not sufficient conditions for precludingtwo functions from the same NPN equivalence class ofunate functions from being solutions to inequalities(1)-(4).Let f(X) be a solution to (1)-(4). It must be deter-

mined if f(X) is a representative. In order to satisfy (1)and (2), only those variables whose Chow parametersare equal can be permuted.

Thus, only those functions which can be obtainedfrom f(X) by permutation of those variables which haveequal Chow parameters need to be examined. In gen-eral, there will be much fewer of these permutationsthan there will be of all possible permutations of n vari-ables. If any of the permuted images of f(X) are a solu-tion to (1)-(4), they are also candidates for the repre-sentative -of that NPN class.

If f(X) has exactly 2n-1 true assignments, f(X) orfd(X) with its variables permuted may be a solution to(1)-(4). There are two important properties of the dualof f(X) which are needed.

Property 1: f(X) is a positive function if and only iffd(X) is positive function.

Property 2: The Chow parameters of two variables off(X) are equal if and only if the Chow parameters ofthose same two variables of fd(X) are equal.From these two properties, the only permutations of

f(X) which can be solutions to (1)-(4) are those samepermutations which were applied to f(X).

Let G be the set of functions consisting of fd(X), thepermuted images of fd(X) defined above, and the per-muted images of f(X) defined above. By appropriatelydefining a representative function, f(X) is comparedagainst all those functions which are both in G and alsosolutions to (1)-(4) to determine iff(X) is a representa-tive function. Note that the functions in G are easilygenerated from f(X). The ability to define a representa-tive in this way is important because it allows f(X) tobe compared with those functions in G rather than becompared with a list of all functions enumerated by thealgorithm prior to the enumeration of f(X). Computa-tionally the former is much preferred over the latter.Thus as each solution to (I)-(4) is calculated by the

algorithm it is examined to see if it is a representative.If it is, it is added to the list of representatives. If it isnot, it is dropped and the next function is generated.

1378

BAUGH: UNATE BOOLEAN FUNCTIONS

TABLE JIGENERATION OF REPRESENTATIVE FUNCTIONS OF THE NPN

EQUIVALENCE CLASSES OF UNATE FUNCTIONS

Number ofNumber of Number of Equivalence ComputationBoolean Solutions to Classes of Time on

Functions of Inequalities Unate 360/751n n Variables (1)-(4) Functions (s)

3 256 6 6 0.104 65 536 17 17 0.285 cv4.3X 109 133 112 4.766 l.8X10I9 21 720 8282 1425.18

V. COMPUTATIONAL RESULTS

The algorithm described in Sections III and IV wasimplemented in Fortran for the 1131\I 360/751. Thecomputational results are presented in Table II. Thenumber of Boolean functions is shown along with thenumber of functions which are solutions to inequalities(1)-(4). The number of representative functions is alsoshown. The algorithm of Section IV was used to extractthe representative functions from the set of functionswhich are solutions to (1)-(4). Note that the number ofsolutions to (1)-(4) is much smaller than the total num-ber of Boolean functions and also that the number ofsolutions to (1)-(4) is a reasonable approximation to thenumber of representative functions of the NPN equiva-lence classes of unate functions.Table II includes statistics for Boolean functions of

six or fewer variables. It is estimated that there are20 000 000 NPN equivalence classes of unate functionsof seven variables. Because of this large number ofclasses, it appears unlikely that it is computationallypractical to enumerate those properties which can onlybe determined by examining a representative functionfrom each equivalence class. Thus there appears to belittle need to generate a representative function for eachof the NPN equivalence classes of unate functions ofseven variables.Each one of the representatives of the NPN equiva-

lence classes of unate functions was tested by solvingone linear programming problem for each representativeto determine if it is a pseudothreshold function. Theseresults are shown in Table III. A list of the representa-tive functions of the NPN equivalence classes of pseudo-threshold functions and the details of the test for check-ing whether a Boolean function is a pseudothresholdfunction are available in [2].

VI. CONCLUSION

An algorithm for generating the set, of representativefunctions of the NPN equivalence classes of unateBoolean functions has been described. This algorithm isbased upon integer programming techniques and thus anew application on the use of integer programmingtechniques in switching theory is shown. The algorithm

TABLE IIINPN EQUIVALENCE CLASSES OF PSEUDOTHRRSHOLD FUNCT1ONS

Number of Number ofNPN L-quivalent

Number of Equivalenit Classes of ComputationBoolean Classes of Pseudo- Time on

Functions of Uniate threshold 360/75In n Variables Functions Functions (s)

3 256 6 6 0.084 65 536 17 17 1.175 --4.3X101 112 106 9.486 -1.8X10'9 8282 4098 479.63

is shown to be computationally feasible. Furthermore,the algorithm was used as a basis for tabulating pseudo-threshold functions of six variables or less.

ACKNOWLEDGMENT

The author wislhes to thank Prof. S. 1\Iuroga of theDepartment of Computer Science, University of Illinois,Urbana, for his guidance, suggestions, and commentswhich were valuable in the research described in thispaper and for his excellent advice throughout theauthor's graduate sttudy.

REFERENCES[1] C. R. Baugh, "Bounds on the number of pseudothreshold func-

tions," IEEE Trans. Comprtt. (Short Notes), vol. C-20, pp. 1602-1603, Dec. 1971.

[2] , "Pseudothreshold logic: A generalization of threshold logic,'Ph.D. dissertation, Dep. Comput. Sci., Univ. Illinois, Urbana,Rep. 389, Mar. 1970, also available from University Microfilms orthe author.

[3] C. R. Baugh, C. S. Chandersekaran, R. S. Swee, and S. Muroga,"Optimal networks of NOR-OR gates for functions of three vari-ables," IEEE Trans. Comput., vol. C-21, pp. 153-160, Feb. 1972.

[41 C. K. Chow, "On the characterization of threshold functions," inIEEE Symp. Switching Circuit Theory and Logical Design, Sept.1961, pp. 34-38.

[53 T. K. Liui, "A code for 0-1 integer linear programming by implicitenumeration," M.S. thesis, Dep. Comput. Sci., Univ. Illinois,UJrbana, Rep. 302, Dec. 1968.

[6] S. Muroga and T. Ibaraki, "Design of optimal switching networksby integer programming," IEEE Trans. Comput., vol. C-21, pp.573-582, June 1972.

[7] S. Muroga, "Logical design of optimal digital networks by integerprogramming," in Advances In Information Systems Science, J. T.Tou, Ed. New York: Plenum, 1970.

[8] T. A. Slivinski, "An extension of threshold logic," IEEE Trans.Comput., vol. C-19, pp. 319-341, Apr. 1970.

[9] R. 0. Winder, "Enumeration of seven-arguiment threshold func-tions," IEEE Trans. Electron. Comput., vol. EC-14, pp. 315-325,June 1965.

1379