Heuristic NPN Classification for Large Functions Using AIGs and LEXSAT

  • Mathias Soeken
  • Alan Mishchenko
  • Ana Petkovska
  • Baruch Sterin
  • Paolo Ienne
  • Robert K. Brayton
  • Giovanni De Micheli
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9710)


Two Boolean functions are NPN equivalent if one can be obtained from the other by negating inputs, permuting inputs, or negating the output. NPN equivalence is an equivalence relation and the number of equivalence classes is significantly smaller than the number of all Boolean functions. This property has been exploited successfully to increase the efficiency of various logic synthesis algorithms. Since computing the NPN representative of a Boolean function is not scalable, heuristics have been proposed that are not guaranteed to find the representative for all functions. So far, these heuristics have been implemented using the function’s truth table representation, and therefore do not scale for functions exceeding 16 variables.

In this paper, we present a symbolic heuristic NPN classification using And-Inverter Graphs and Boolean satisfiability techniques. This allows us to heuristically compute NPN representatives for functions with much larger number of variables; our experiments contain benchmarks with up to 194 variables. A key technique of the symbolic implementation is SAT-based procedure LEXSAT, which finds the lexicographically smallest satisfiable assignment. To our knowledge, LEXSAT has never been used before in logic synthesis algorithms.



This research was supported by H2020-ERC-2014-ADG 669354 CyberCare, by the German Academic Exchange Service (DAAD) in the PPP 57134066, and partly by the NSF/NSA grant “Enhanced equivalence checking in cryptoanalytic applications” at University of California, Berkeley.


  1. 1.
    Benini, L., Micheli, G.D.: A survey of Boolean matching techniques for library binding. ACM Trans. Design Autom. Electr. Syst. 2(3), 193–226 (1997)CrossRefGoogle Scholar
  2. 2.
    Brand, D.: Verification of large synthesized designs. In: Proceedings of the International Conference on Computer Aided Design, pp. 534–537 (1993)Google Scholar
  3. 3.
    Brayton, R., Mishchenko, A.: ABC: an academic industrial-strength verification tool. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 24–40. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  4. 4.
    Chatterjee, S., Mishchenko, A., Brayton, R.K., Wang, X., Kam, T.: Reducing structural bias in technology mapping. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 25(12), 2894–2903 (2006)CrossRefGoogle Scholar
  5. 5.
    Debnath, D., Sasao, T.: Efficient computation of canonical form for Boolean matching in large libraries. In: Proceedings of the Asia and South Pacific Design Automation Conference, pp. 591–96 (2004)Google Scholar
  6. 6.
    Eén, N., Mishchenko, A., Sörensson, N.: Applying logic synthesis for speeding up SAT. In: Marques-Silva, J., Sakallah, K.A. (eds.) SAT 2007. LNCS, vol. 4501, pp. 272–286. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  7. 7.
    Goto, E., Takahasi, H.: Some theorems useful in threshold logic for enumerating Boolean functions. In: International Federation for Information Processing Congress, pp. 747–52 (1962)Google Scholar
  8. 8.
    Harrison, M.A.: Introduction to Switching and Automata Theory. McGraw-Hill, New York (1965)zbMATHGoogle Scholar
  9. 9.
    Hellerman, L.: A catalog of three-variable Or-inverter and And-inverter logical circuits. IEEE Trans. Electr. Comput. 12, 198–223 (1963)CrossRefGoogle Scholar
  10. 10.
    Huang, Z., Wang, L., Nasikovskiy, Y., Mishchenko, A.: Fast Boolean matching based on NPN classification. In: Proceedings of the 2013 International Conference on Field Programmable Technology, pp. 310–313 (2013)Google Scholar
  11. 11.
    Katebi, H., Markov, I.L.: Large-scale Boolean matching. In: Proceedings of the Design, Automation and Test in Europe Conference and Exhibition, pp. 771–76 (2010)Google Scholar
  12. 12.
    Knuth, D.E.: The Art of Computer Programming, vol. 4A. Addison-Wesley, Reading, Massachusetts (2011)Google Scholar
  13. 13.
    Knuth, D.E.: The Art of Computer Programming, vol. 4, Fascicle 6: Satisfiability. Addison-Wesley, Reading, Massachusetts (2015)Google Scholar
  14. 14.
    Krentel, M.W.: The complexity of optimization problems. J. Comput. Syst. Sci. 36(3), 490–509 (1988)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Kuehlmann, A., Paruthi, V., Krohm, F., Ganai, M.K.: Robust Boolean reasoning for equivalence checking and functional property verification. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 21(12), 1377–1394 (2002)CrossRefGoogle Scholar
  16. 16.
    Mailhot, F., Micheli, G.D.: Algorithms for technology mapping based on binary decision diagrams and on Boolean operations. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 12(5), 599–620 (1993)CrossRefGoogle Scholar
  17. 17.
    Mishchenko, A., Chatterjee, S., Brayton, R.: DAG-aware AIG rewriting: a fresh look at combinational logic synthesis. In: Proceedings of the 43rd Design Automation Conference, pp. 532–536 (2006)Google Scholar
  18. 18.
    Muroga, S.: Logic Design and Switching Theory. Wiley, New York (1979)zbMATHGoogle Scholar
  19. 19.
    Rudell, R.: Dynamic variable ordering for ordered binary decision diagrams. In: Proceedings of the International Conference on Computer Aided Design, pp. 42–47 (1993)Google Scholar
  20. 20.
    Soeken, M., Amarù, L.G., Gaillardon, P., De Micheli, G.: Optimizing majority-inverter graphs with functional hashing. In: Proceedings of the Design, Automation and Test in Europe Conference and Exhibition, pp. 1030–1035 (2016)Google Scholar
  21. 21.
    Tseytin, G.S.: On the complexity of derivation in propositional calculus. In: Slisenko, A.P. (ed.) Studies in Constructive Mathematics and Mathematical Logic, Part II, Seminars in Mathematics, pp. 115–125. Springer, NewYork (1970)Google Scholar
  22. 22.
    Warren, H.S.: Hacker’s Delight, 2nd edn. Addison-Wesley, Reading (2012)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Mathias Soeken
    • 1
  • Alan Mishchenko
    • 2
  • Ana Petkovska
    • 1
  • Baruch Sterin
    • 2
  • Paolo Ienne
    • 1
  • Robert K. Brayton
    • 2
  • Giovanni De Micheli
    • 1
  1. 1.EPFLLausanneSwitzerland
  2. 2.UC BerkeleyBerkeleyUSA

Personalised recommendations