A New Pairwise NPN Boolean Matching Algorithm Based on Structural Difference Signature

: In this paper, we address an NPN Boolean matching algorithm. The proposed structural difference signature (SDS) of a Boolean function signiﬁcantly reduces the search space in the Boolean matching process. The paper analyses the size of the search space from three perspectives: the total number of possible transformations, the number of candidate transformations and the number of decompositions. We test the search space and run time on a large number of randomly generated circuits and Microelectronics Center of North Carolina (MCNC) benchmark circuits with 7–22 inputs. The experimental results show that the search space of Boolean matching is greatly reduced and the matching speed is obviously accelerated.


Introduction
Boolean equivalence classification and matching constitute a long-standing and open problem. The authors of [1,2] applied a group algebraic approach to NP and NPN Boolean equivalence classification. Reference [2] computed the classification results for 10 inputs. Affine equivalence classification is also an important field of study with applications in logic synthesis and cryptography [3]. All Boolean functions in an equivalence class are equivalent to each other. NPN Boolean matching determines whether two Boolean functions are equivalent under input negation and/or permutation and/or output negation. This paper studies NPN Boolean matching for single-output completely specified Boolean functions.
NPN Boolean matching is an important research topic that can be applied to a number of applications in integrated circuit design, such as technology mapping, cell library binding and logic verification [4]. When a Boolean circuit is functionally NPN-equivalent to another Boolean circuit, one of these circuits can be realized by means of the other. There are n!2 n+1 NPN transformations for a n-variable Boolean function. If Boolean function f is NPN-equivalent to Boolean function g, there must be a NPN transformation that can transform f to g. On the contrary, no NPN transformation can transform f to g. The purpose of our proposed algorithm is to find the NPN transformation that can transform Boolean function f to g as early as possible. Based on the structural signature (SS) vector in our previous study [5], we proposes a new combined signature vector, i.e., SDS vector. In this paper, Boolean difference sigture is introduced into SS vector to form SDS vector. The new signature vector SDS is better able to distinguish variables and reduce the research space for NPN Boolean matching. Experimental results show that the search space is reduced by more than 48% compared with [5] and that the run time of our algorithm is reduced by 42% and 80% compared with [5,6], respectively.
In the following, Section 2 introduces relevant works on NPN-equivalence matching. Section 3 introduces some terminology and notation. Section 4 describes the proposed algorithm in detail. In Section 5, we present experimental results to demonstrate the effectiveness of our algorithm. Section 6 concludes the paper.

Related Works
Many methods can be exploited to solve the problem of NPN Boolean matching. The main results of such research are focused on four methods: (1) algorithms on canonical forms; (2) pairwise matching algorithms using signatures; (3) algorithms based on satisfiability (SAT) and (4) algorithms based on spectral analysis.
Each method has its own advantages. In canonical-form-based matching algorithms, the canonical form of each Boolean circuit of cell library is stored in advance. When cell-library binding is implemented, the canonical form of each Boolean circuit to be matched is computed and compared with the canonical forms of each Boolean circuits in the cell library via a hash table. All Boolean functions in an equivalence class have the same canonical form. The canonical form of each equivalence class has a special value. References [6][7][8][9][10][11][12] studied Boolean matching based on canonical forms and attained significant achievements.
Reference [12] reported P-equivalence matching for 20-input Boolean functions. The canonical forms considered in reference [12] was the binary strings with the maximal scores in lexicographic comparison. Reference [7] devised a procedure to canonicalize a threshold logic function and judged equivalence of two threshold logic functions by their canonicalized linear inequalities. Based on the canonical form of Boolean function, the reference [8] reduced the number of configuration bits in an FPGA architecture. The authors of [10,11] proposed fast Boolean matching based on NPN Boolean classification; their canonical form has the maximal truth table. The authors of [6] proposed new canonical forms based on signatures.
A pairwise matching algorithm searches the NPN transformations between two Boolean functions using signatures, which is a semi-exhaustive search algorithm. The merit of this method is that once it finds a transformation that can prove the equivalence of two Boolean functions, other transformations will not be checked. The authors of [4,5,13,14] proposed Boolean matching algorithms based on pairwise matching and used binary decision diagrams (BDDs) to represent Boolean functions. The authors of [5] proposed a structural signature vector to search the transformations between two Boolean functions and implemented NPN Boolean matching for 22 inputs. In pairwise matching algorithms, signatures are usually used as a necessary condition for judging whether two Boolean functions are equivalent, and variable symmetry is commonly utilized to reduce the search space. Symmetric attributes are used in many fields. Reference [15] studied the symmetries of the unitary Lie group. The variable symmetric attributes of Boolean function are widely used in NPN Boolean equivalence matching. In reference [5], the search space was reduced and the matching speed was improved by means of structural signatures, variable symmetry, phase collision check and variable grouping.
Since a SAT solver can help solve the problem of NPN Boolean matching and because many quick SAT solvers can be utilized, many Boolean matching algorithms based on SAT have emerged in recent years. The authors of [16][17][18][19][20] studied SAT-based Boolean matching. Based on graphs, simulation and SAT, Matsunaga [16] achieved PP-equivalence Boolean matching with larger inputs and outputs. The authors of [17,18] studied Boolean matching for FPGAs utilizing SAT technology.
Cong et al. [19] used the implicant table to derive the SAT formulation and achieved significant improvements. The authors of [20] combined simulation and SAT to perform P-equivalent Boolean matching for large Boolean functions. Compared with studies based on the previous three methods, studies on Boolean matching that use spectral techniques are fewer in number. Moore et al. [21] presented an NPN Boolean matching algorithm using Walsh spectra. The authors of [22] utilized Haar spectra to check the equivalence of two logic circuits.
Regardless of which method is used, the key to Boolean matching is to reduce the search space. It is universally known that the search space for exhaustive NPN Boolean matching is O(n!2 n+1 ). In the methods discussed above, many strategies are used to reduce the search space. The authors of [6] used general signatures and symmetry to reduce the search space.
Based on our previous study [5], we propose a new combined signature, i.e., the structural difference signature. We present a new pairwise algorithm based on the following conditions: (1) two NP-equivalent Boolean functions have the same SDS vectors; (2) two variables of a variable mapping have the same SDS values; and (3) two groups of Boolean functions Shannon decomposed with splitting variables are NP-equivalent.

Terminology and Notation
Let f (x 0 , x 1 , · · · , x n−1 ) and g(x 0 , x 1 , · · · , x n−1 ) be two single-output completely specified Boolean functions. The problem to be solved in this paper is to determine whether f is NPN-equivalent to g. Some related terminology has been introduced in [5,6].
An NP transformation T is composed of input negations and/or permutations. It can also be expressed as a group of variable mappings. In reference [5], the mapping from the variable x i of f to the variable x j of g, ϕ i , can be classified into two cases: (1) x i maps to x j with the same phase, in which case the mapping is x i → x j or x i → x j ; or (2) x i maps to x j with the opposite phase, in which case the mapping is x i → x j or x i → x j . A same-phase relation indicates no input negation, whereas an opposite-phase relation indicates input negation. A same-phase variable mapping between the variables x i and x j is abbreviated as i → j − 0, and an opposite-phase variable mapping between the variables x i and x j is abbreviated as i → j − 1. For two NPN-equivalent Boolean functions f and g, there may be an output negation when | f | = |g|. Definition 1. (NPN equivalence) Two Boolean functions f and g are NPN equivalent, f ∼ = g, if and only if there exists an NP transformation T that satisfies f (TX) = g(X) or f (TX) = g(X).
As a general signature, the cofactor signature is widely applied in NPN Boolean matching. The cofactor signature of f (X) with respect to [5].
Reference [5] proposed SS vector. The SS value of f with respect to is the 1st signature of the variable x i , and C i and |C i | are the symmetry mark, and G i is group mark. According to their symmetry properties, the variables of a Boolean function are classified as either asymmetric and symmetric. An asymmetric variable may have a single-mapping set or a multiple-mapping set. The variable mapping set of the asymmetric variable x i is denoted by χ i . Similarly, a symmetric variable may have a single symmetry-mapping set or a multiple symmetry-mapping set. The symmetry-mapping set of the symmetry class C i is denoted by S i , and the symmetry mapping between C i and C j is denoted by C i → C j . The literal ψ i represents a group of two or more variable mappings generated by C i → C j .
A P transformation does not change the cofactor signature of a variable. However, an N transformation changes the order of the positive and negative cofactor signatures without changing their numerical values. Therefore, we do not consider the order of the positive and negative cofactor signatures when comparing the 1st signature values of two variables. A variable x i may be transformed into an arbitrary variable x j , 0 ≤ j ≤ n − 1; therefore, we also do not consider the order of the variables when we compare two SS vectors.
Given two NP-equivalent Boolean functions f and g with a variable mapping x i → x j between them, we have the following four facts: (1) V f = V g and V i = V j ; (2) The Boolean functions decomposed with x i and x j using the Shannon expansion must be NP equivalent. Specifically, x i f x i is NP equivalent to x j g x j , and x i f x i is NP equivalent to x j g x j ; (3) x i and x j are either both asymmetric variables or both symmetric variables; (4) If there is a variable mapping between x l of f and x h of g, then the SS values of x l must be the same as those of x h no matter how many times the Boolean functions f and g are decomposed [5].
Two Boolean functions f and g may undergo one or more transformations in the process of matching. A transformation consists of n variable mappings. The algorithm of [5] and the algorithm presented in this paper detect all possible transformations between f and g according to their SS and SDS vectors, respectively.

The Proposed Algorithm
The goal of the proposed algorithm is to reduce the size of the search space as much as possible, thereby improving the speed of NPN Boolean matching.

Boolean Difference
For n inputs, there are 2 2 n different Boolean functions. Many Boolean functions have one or more independent variables. Whether a variable x i of f is independent can be determined using cofactors.
The Boolean difference of a Boolean function f with respect to When a variable x i of f is NP transformed into x j (x j ), its Boolean difference signature does not change. Thus, Boolean difference signature, like cofactor signature, can be used to distinguish variables.

Example 1. Consider an 5-input Boolean function f
Let us compute the 1st signature and the Boolean difference signature of each variable.
The 1st signatures of x 0 , x 1 , x 2 , x 3 and x 4 are (9, 7), (8,8), (8,8), (8,8) and (8,8), respectively. The variable x 1 is symmetric to x 4 . The Boolean difference signatures of the variables are 32, 12, 20, 28 and 12, respectively. From the 1st signatures and a symmetry check, we can distinguish variables x 0 , x 1 and x 4 . Variables x 2 and x 3 are both asymmetric variables and have the same 1st signature values. If we only utilize on their 1st signatures, the variables x 2 and x 3 cannot be distinguished. However, these two variables have different Boolean difference signatures. Thus, the variables x 2 and x 3 are actually different and can be distinguished.

Definition 3. (Independent variable) A variable x i of a Boolean function f is an independent variable
NP transformations do not change the independence of a variable. Thus, an independent variable is still an independent variable after NP transformation. Proof. If the Boolean function f is NPN-equivalent to g, then f and g are in the same NPN equivalence class. There must exist an NP transformation T that can transform f into g or g. After NP transformation, an independent variable is still an independent variable. Therefore, it can be deduced that f and g have the same number of independent variables. Property 1. The cofactor signature of a Boolean function f with respect to its variable Because the positive cofactor signature is the same as the negative cofactor signature for an independent variable, the phases of independent variables cannot determined by using the phase assignment method presented in [5,6]. However, independent variables have no influence on a Boolean function. Thus, the proposed algorithm assigns a positive phase to all independent variables.
Let us compute the SS vectors, Boolean difference signatures and independent-variable sets.
The SS vectors of f and g are as follows: Consider two NP-equivalent Boolean functions f and g with independent-variable sets of D f = {x i 1 , x i 2 , · · · x i k } and D g = {x j 1 , x j 2 , · · · x j k }, respectively. If we do not consider the symmetry and independence of variables, then there are 2 k k! groups of different variable mappings between D f and D g according to their 1st signatures. However, according to the properties of independent variables, we need to consider only the positive phase and create one independent-mapping set Therefore, the search space is reduced significantly if there are independent variables in the Boolean functions.
In Example 2, the Boolean function f has the three symmetry classes x 5 }, and the Boolean function g has the three symmetry classes The symmetry class C 0 of f can be mapped to the symmetry classes C 1 and C 2 of g using the method of reference [5]. In other words, the symmetry classes C 0 and C 4 of Boolean function f cannot be distinguished. However, the variables in C 0 and C 4 of Boolean function f have different Boolean difference signatures. Thus, if we consider the Boolean difference signatures when searching the variable mappings, the symmetry class C 0 of f can be mapped only to the symmetry class C 1 of g, and the symmetry class C 4 of f can be mapped only to the symmetry class C 2 of g. There exists an independent-mapping set The algorithm presented in [5] groups variables by their 1st signature values. The algorithm proposed in this paper groups variables by their 1st signature values and Boolean difference signatures. We define the '<' relation between x i and x j as follows.
The variables x i and x j have the relation x i < x j if one of the following two cases is satisfied: The group numbers of the variables are generated with the above '<' relation. The SDS vectors of f and g in example 2 are as follows: V f = {(12, 12, 2, 0, 1, 48), (12, 12, 2,

SDS-Based Boolean Matching Algorithm
NPN Boolean matching is defined as follows: Given two Boolean functions f and g, if there exists an NP transformation T that satisfies f (TX) = g(X) or f (TX) = g(X), then f is NPN-equivalent to g.
Before searching the variable mappings, the proposed algorithm first determines whether there is an output negation for Boolean function f . If there is, then our algorithm will match f and g. The method of identifying the presence of an output negation is the same as that in reference [5].
Our algorithm handles first the condition without output negation and then the condition with output negation if f is not NP equivalent to g.
The algorithm will terminate when it finds a transformation T that satisfies f (TX) = g(X) (g(X)) or when all candidate transformations have been checked and found not to satisfy f (TX) = g(X) (g(X)). The algorithm will attempt all possible variable mappings, and thus, it will certainly find an NP transformation T between two NP-equivalent Boolean functions f and g (g).
The pseudo-code for NPN Boolean matching is given in Procedure 1.
In Procedure 1, trans_list is a tree that stores the NP transformations generated in the process of transformation detection. A candidate transformation is an unabridged branch in trans_list. sp_ f and sp_g are the decomposition expressions for f and g, respectively. After the existence of an output negation has been determined, Procedure 1 calls Handle_SDS() to detect the NP transformations between f and g (g) and judge the NP equivalence of f and g (g).
Any one NP transformation between the Boolean functions f and g (g) is composed of n variable mappings. Thus, the proposed algorithm searches variable mappings and generates NP transformations. In this paper, the necessary condition for two Boolean functions to be judged NP equivalent is that they must have the same SDS vector. For a variable mapping to be established between x i and x j , these two variables must satisfy the following conditions: (1) x i and x j have the same 1st signature values, i.e., ( (2) x i and x j have the same Boolean difference signature, i.e., | f x i | = | f x j |.
(3) x i and x j have the same symmetry class cardinality, i.e., |C i | = |C j |. (4) x i and x j have the same group number, i.e., G i = G j .

Procedure 1 NPN Boolean Matching.
Input: f and g Output: 0 or 1 function MATCHING( f , g) Create BDD of f and g sp_ f = bddtrue, sp_g = bddtrue, trans_list = NULL Return 0 end if end if end function In the process of the variable mapping search, Handle_SDS() searches the variable mappings for each variable that has not been identified. A variable is identified when its phase and variable mappings are determined in a transformation. After searching all variable mapping sets, Handle_SDS() selects the minimal variable mapping set to handle. The minimal variable mapping set is the one with the lowest cardinality. There are eight possible cases for the variable mapping set of the variable x i of f , as follows.
(1) The variable x i is an asymmetric variable. The phase of x i is determined, and there is only one variable x j of g that has the same SDS values as those of x i . The variable mapping set of x i is a single-mapping set. χ i = {i → j − k}, k ∈ {0, 1}, and |χ i | = 1.
(2) The variable x i is an asymmetric variable. There exist multiple variables x j 1 , x j 2 , · · · , x j m of g, where m ≥ 2, that have the same SDS values as those of x i , and their phases are determined. The variable mapping set of x i is a multiple-mapping set.
(3) The variable x i is an asymmetric variable. There exist one or more variables x j 1 , x j 2 , · · · , x j m of g, where m ≥ 1, that have the same SDS values as those of x i , and their phases are not determined. The variable mapping set of x i is a multiple-mapping set.
The variable x i is a symmetric variable, and its symmetry class is C i = {x i , x i 1 , x i 2 , · · · , x i m−1 }. There exists only one symmetry class C j = {x j , x j 1 , x j 2 , · · · , x j m−1 } of g whose variables have the same SDS values as those of the variables in C i , where |C i | = |C j |, and the phase of x i is determined. The variable mapping set of x i , S i , is a single symmetry-mapping set, i.e., |S i | = 1. There exists one group of variable mappings {i → j − k, The variable x i is a symmetric variable, and its symmetry class is C i = {x i , x i 1 , x i 2 , · · · , x i m−1 }. There is only one symmetry class C j = {x j , x j 1 , x j 2 , · · · , x j m−1 } of g whose variables have the same SDS values as those of the variables in C i , where |C i | = |C j |, and the phase of x i is not determined. The variable mapping set of x i , S i , is a multiple symmetry-mapping set: |S i | = 2. There are two groups of variable mappings, {i → j − 0, When the variable symmetry is checked, the phase relation between two symmetric variables is known. The variable mapping relations between C i and C j can be generated in the following way.
We first consider the case in which x i and x j have the same phase, i.e., there exists a variable mapping i → j − 0. A variable mapping i 1 → j 1 − 0 exists in two cases: (1) x i is symmetric to x i 1 and x j is symmetric to x j 1 or (2) x i is symmetric to x i 1 and x j is symmetric to x j 1 . A variable mapping i 1 → j 1 − 1 exists in two cases: (1) x i is symmetric to x i 1 and x j is symmetric to x j 1 or (2) x i is symmetric to x i 1 and x j is symmetric to x j 1 . Then, we consider the case in which x i and x j have the opposite phase, i.e., there exists a variable mapping i → j − 1. A variable mapping i 1 → j 1 − 1 exists in two cases: (1) x i is symmetric to x i 1 and x j is symmetric to x j 1 or (2) x i is symmetric to x i 1 and x j is symmetric to x j 1 . A variable mapping exists i 1 → j 1 − 0 in two cases: (1) x i is symmetric to x i 1 and x j is symmetric to x j 1 or (2) x i is symmetric to x i 1 and x j is symmetric to x j 1 . Thus, two groups of variable mappings between C i and C j will be generated via this method. (6) The variable x i is a symmetric variable, and its symmetry class is C i . There exist multiple symmetry classes C j 1 , C j 2 , · · · , C j m , where 2 ≤ m ≤ n 2 , whose variables have the same SDS values as the variables in C i , where |C i | = |C j 1 | = |C j 2 | = · · · = |C j m |, and the phase of x i is determined. The variable mapping set of x i , S i , is a multiple symmetry-mapping set: |S i | = m. There exists one group of variable mappings between C i and each C j p , where p ∈ {1, 2, · · · , m}.
The variable x i is a symmetric variable, and its symmetry class is C i . There exist one or more symmetry classes C j 1 , C j 2 , · · · , C j m , where 1 ≤ m ≤ n 2 , whose variables have the same SDS values as those of the variables of C i , where |C i | = |C j 1 | = |C j 2 | = · · · = |C j k |, and the phase of x i is not determined. The variable mapping set of x i , S i , is a multiple symmetry-mapping set: |S i | = 2m. There exist two groups of variable mappings between C i and each C j p , where p ∈ {1, 2, · · · , m}.
(8) The variable x i is an independent variable. The variable mapping set of x i is an independent mapping set.
All possible variable mapping sets are listed above. To generate an NP transformation, n variable mappings are needed for x 1 , x 2 , · · · , x n . Each node in the NP transformation tree, trans_list, represents a variable mapping, and all nodes in a given layer belong to the same variable mapping set. The methods for handling the variable mapping sets are as follows.
(1) If it is the first computation of SDS vectors, a check for independent variables is performed. If there are one or more independent variables, an independent-mapping set is created and added to trans_list, and the minimal variable mapping set is then sought among the remaining variables. If there are no independent variables, Handle_SDS() searches the variable mapping sets for all variables.
(2) If the current variable mapping set of x i is a single-mapping set, our algorithm adds the variable mapping in χ i to trans_list. The variable x i is identified.
(3) If the current variable mapping set of x i is a single symmetry-mapping set and x i belongs to C i , where |C i | = m, then the group ψ i of variable mappings of S i is added to trans_list. To the NP transformation tree, m layers are added, where each layer contains a variable mapping node. The variables in the symmetry class C i are all identified.
(4) If the current variable mapping set of x i is a multiple-mapping set or a multiple symmetry-mapping set, then the cardinalities of the variable mapping sets are computed, and the minimal variable mapping set is recorded.
After searching all variable mapping sets, as in reference [5], our algorithm updates the two decomposition expressions sp_ f and sp_g in the case of a single-mapping set or a single symmetry-mapping set. Otherwise, our algorithm handles the minimal variable mapping set. If the cardinality m of the minimal variable mapping set satisfies m ≥ 2, then m branches will be generated in trans_list. Each branch is handled in order.
The purpose of Procedure 2 is to search the variable mappings for all possible NP transformations. In the process of recursive_search, Procedure 2 uses the same methods applied in [5] to find and prune error NP transformation branches. That is, the current branch will be pruned if the two SDS vectors are not the same or if the current variable mapping has a phase collision.
The pseudo-code for Procedure 2 is as follows.

Procedure 2 recursive_search.
Input: f , g, sp_ f , sp_g, and trans_list Output: 0 or 1 The meanings of conditions D 1 , D 2 , D 3 , D 4 , D 5 and D 6 and the operations that need to be performed when these conditions are satisfied are defined as follows: D 1 : When D 1 is true, a candidate transformation is generated. Procedure 2 checks whether the current NP transformation T can transform f into g (g). D 2 : When D 2 is true, the transformation tree is NULL, and this is the first time that the SDS vectors have been computed. Procedure 2 checks and handles the independent-mapping set between f and g (g). D 3 : When D 3 is true, the current variable x i has already been identified, and Procedure 2 fetches the next x i to handle. D 4 : When D 4 is true, the variable-mapping set of x i is a single-mapping set or a single symmetry-mapping set.
D 5 : When D 5 is true, there is a phase collision. D 6 : When D 6 is true, the cardinality of the minimal variable mapping set is 1.
In the process of transformation detection, Procedure 2 attempts each variable mapping in each multiple-mapping set or each group of variable mappings in each multiple symmetry-mapping set. For two NP-equivalent Boolean functions f and g (g), Procedure 2 must find a candidate transformation that satisfies f (TX) = g(X) (g(X)). The purpose of VERIFY() is to check whether f (TX) = g(X) (g(X)).
UPDATE() serves the following functions: (1) Updates the SDS vector V f of f and the SDS vector V g of g by means of Shannon decomposition and the decomposition expressions sp_ f and sp_g.
(2) Updates the phases of the variables in f and g.
. Procedure 2 handles the single symmetry-mapping set S 2 , and the variable mappings x 2 → x 0 and x 3 → x 4 are added to trans_list. sp_ f and sp_g are updated to x 2 and x 0 . After the SS vectors are updated, the 1st signatures of the remaining variables of f and g are all (8,8). Therefore, the remaining four variables still cannot be distinguished, and there are two multiple symmetry-mapping sets, S 0 and S 4 . The first symmetry-mapping set S 0 is selected to be handled. The transformation tree for Example 2 using SS vectors is shown in Figure 1. If we use the SDS values to search the variable mappings, then there are one independent-mapping set, one single symmetry-mapping set and one multiple symmetry-mapping set according to the first computed SDS vectors. Procedure 2 first adds the variable mappings x 4 → x 2 and x 5 → x 5 to the transformation tree. Then, the two variable mappings x 2 → x 0 and x 3 → x 4 of the symmetry mapping C 2 → C 0 are added to the transformation tree. The catch is that the independent variable is not a splitting variable because the decomposition results obtained via Shannon expansion with the independent variable are unchanged. Thus, the decomposition expressions sp_ f and sp_g are updated to x 2 and x 0 . UPDATE() is called to compute new SDS vectors, and the SDS vectors are updated in accordance with sp_ f and sp_g.
In this way, Procedure 2 determines 4 variable mappings, namely, x 4 → x 2 , x 5 → x 5 , x 2 → x 0 and x 3 → x 4 , after the first variable mapping search for example 2. In the next variable mapping search, there is one multiple symmetry-mapping set, The transformation tree for Example 2 using SDS vectors is shown in Figure 2. From Example 2, we can see that the number of candidate transformations decreases from 8 to 2. The use of Boolean difference signatures helps to distinguish symmetry classes C 1 and C 5 , and we need to consider only the positive phase for independent variables. Thus, Boolean difference signatures are very beneficial for distinguishing variables.
In cell library binding, a benchmark Boolean circuit is found to realize another NPN equivalent Boolean function. Example 3 demonstrates the process of NPN equivalent matching by SS and SDS vectors respectively, and illustrates the validity of the SDS vectors proposed in this paper. Example 3. Consider two 6-input Boolean functions f (X) and g(X): The transformation detection process using SS vectors is as follows: (1) Compute the SS vectors of f and g. The results are: The results show the following: (1) the two new SS vectors are the same; (2) the phases of all variables are determined; and (3) the next variable-mapping set to be handled is In the subsequent variable mapping search, the x 0 → x 1 branch is pruned by a phase collision. The x 0 → x 2 , x 0 → x 3 and x 0 → x 4 branches are pruned by having different SS vectors.
(3) Then, Procedure 2 handles the variable mapping x 0 → x 5 and detects a candidate After verification, this transformation is found to satisfy f (TX) = g(X). Therefore, f is NPN-equivalent to g.
The transformation tree for Example 3 using SS vectors is shown in Figure 3. Figure 3. The transformation search tree for example 3 using SS vectorss. Figure 3 shows that this transformation tree for Example 3 has 6 branches and that the two Boolean functions are decomposed 4 times. Let us examine the detection process using SDS vectors.
(1) The SDS vectors of f and g are as follows: From these results, we can draw the following conclusions: (1) these two SDS vectors are the same; (2) the phases of the variable x 1 of f and the variable x 0 of g are determined,; and (3) there is one single-mapping set {x 1 → x 0 } to be used in the search. In Procedure 2, the splitting variables x 1 and x 0 are used to decompose f and g, respectively.
(2) The new SDS vectors are as follows: From these two new SDS vectors, the following can be seen: (1) the phases of all variables are determined; and (2) all unidentified variables can be identified from their Boolean differences.
and this T is verified to be correct.
When SDS vectors are used to perform Boolean matching, the transformation tree for Example 3 contains only one candidate transformation. In the transformation detection process, the search space comprises all branches of the transformation tree, including unabridged and abridged branches. The unabridged branches are the candidate transformations, and the abridged branches are the pruned transformations. When the transformation tree possesses fewer branches, the algorithm considers a smaller search space. The purpose of decomposing the Boolean functions is to update the SDS vectors to search the new variable mappings. When the algorithm requires fewer decompositions, more variables are identified in each iteration. These three indicators can be used to measure how much of the search space our algorithm searches.
In the best case, the variable mapping set of every variable is a single-mapping set, and there is only one candidate transformation. In this case, the spatial complexity is O(1), and the time complexity is O(n 2 ). In the worst case, there are no symmetric variables, every variable has the same SDS value, and the phases of all variables cannot be determined in each SDS update. There are 2 n+1 n! candidate transformations that need to be verified. The spatial complexity is O(2 n n!), and the time complexity is O(n 3 ).

Experimental Results
To demonstrate the effectiveness of the proposed method, we re-implemented the algorithm of [6] and tested the algorithm presented in this paper, the algorithm of [5] and the algorithm of [6] on both a randomly generated circuit set and an MCNC benchmark circuit set. In the random circuit set, there were 1200 circuits in each input circuit set. Every circuit in the random circuit set contained at least two candidate transformations. In the test, we recorded the three indicators concerning the search space and the run time. The proposed algorithm was implemented in C with buddy package. The following experimental results were obtained in a hardware environment with a 3.3-GHz Intel Xeon processor and 4 GB of memory.
In the following tables, the first column shows the number of input variables (#I), and the following four columns show the experimental results for our algorithm. The next four columns show the corresponding experimental results of [5], and the last column shows the average run time of the algorithm of [6]. Tables 1 and 2   From Table 1, we can see that the run time of our algorithm is improved by 54% relative to that of [5] and by 84% relative to that of [6]. From the comparison of the three indicators for the search space, we can see that the number of branches in the transformation tree is reduced by 70%, the number of candidate transformations is reduced by 65%, and the number of decompositions is reduced by 27%. Because the Boolean difference facilitates the identification of the variables, the proposed algorithm reduces the search space and speeds up the matching process. Figure 4 presents the diagram of the search space comparison results for our algorithm and that of reference [5] tested on the random circuit set.    Figure 5 presents the diagram of the speed comparison results for our algorithm, that of reference [6] and that of reference [5] tested on the random circuit set. Table 2 shows the experimental results obtained during testing on the MCNC benchmark circuit set. Table 2 shows that with the proposed algorithm, the values of the three indicators for the search space are decreased, and the run time is also slightly reduced. When there are 22 inputs, however, the average run time of our algorithm is higher than that of [5]. This is because the variables of this group circuit are easy to identify and because the search space of our algorithm is almost the same as that of [5]. In this case, our algorithm spends additional time in computing the Boolean differences compared with the algorithm of [5].
From Tables 1 and 2, we can see that the matching speed on the MCNC benchmark circuits is slower than that on random circuits, although the search space for the MCNC benchmark circuits is less than that for the random circuits. In this paper, we use BDDs to represent Boolean functions. The BDD structure of a Boolean function is closely related to the speed of operations on the BDD. Because the BDD operation speed on the MCNC benchmark circuits is slower than that on the random circuits, the matching speed on the MCNC benchmark circuits is also slower than that on the random circuits . Average Matching Time (s) Our Algorithm reference [5] reference [6] Figure 5. The matching speed comparison results for testing on random circuits.

Conclusions
The major contribution of this paper is the raise of SDS vector. The paper demonstrates how SDS vectors can be used to effectively search variable mappings and reduce the search space. The algorithm of this paper take advantage of cofactor, symmetry and Boolean different when search the variable mappings between two Boolean functions. Therefore, the search space and match speed of ours algorithm is better than the competitors. Compared with the algorithm of [5], the search space is cut in 48%, and the run time is reduced by 42% and 80% compared with [5,6], respectively. The experimental results prove that the algorithm proposed in this paper is more effective than competing algorithms on general circuits. In future work, we will extend our algorithm to multiple-output Boolean matching and Boolean matching with don't care sets.