Generating Reversible Circuits from Higher-Order Functional Programs

  • Benoît ValironEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9720)


Boolean reversible circuits are boolean circuits made of reversible elementary gates. Despite their constrained form, they can simulate any boolean function. The synthesis and validation of a reversible circuit simulating a given function is a difficult problem. In 1973, Bennett proposed to generate reversible circuits from traces of execution of Turing machines. In this paper, we propose a novel presentation of this approach, adapted to higher-order programs. Starting with a PCF-like language, we use a monadic representation of the trace of execution to turn a regular boolean program into a circuit-generating code. We show that a circuit traced out of a program computes the same boolean function as the original program. This technique has been successfully applied to generate large oracles with the quantum programming language Quipper.


Boolean Function Operational Semantic Quantum Algorithm Functional Program Abstract Machine 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Abramsky, S.: A structural approach to reversible computation. Theor. Comput. Sci. 347(3), 441–464 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Ambainis, A., Childs, A.M., et al.: Any AND-OR formula of size \(n\) can be evaluated in time \(n^{\frac{1}{2}+o(1)}\) on a quantum computer. SIAM J. Comput. 39, 2513–2530 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Bennett, C.H.: Logical reversibility of computation. IBM J. Res. Dev. 17, 525–532 (1973)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Berry, G.: The foundations of esterel. In: Proof, Language, and Interaction, Essays in Honour of Robin Milner. MIT Press, Cambridge (2000)Google Scholar
  5. 5.
    Braibant, T., Chlipala, A.: Formal verification of hardware synthesis. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 213–228. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  6. 6.
    Claessen, K.: Embedded languages for describing and verifying hardware. Ph.D. thesis, Chalmers University of Technology and Göteborg University (2001)Google Scholar
  7. 7.
    Fazel, K., Thornton, M.A., Rice, J.E.: ESOP-based Toffoli gate cascade generation. In: Proceedings of PacRim, pp. 206–209 (2007)Google Scholar
  8. 8.
    Feynman, R.P.: Quantum mechanical computers. Optics News 11, 11–20 (1985)CrossRefGoogle Scholar
  9. 9.
    Ghica, D.R.: Geometry of synthesis. In: Proceedings of POPL, pp. 363–375 (2007)Google Scholar
  10. 10.
    Girard, J.-Y.: Towards a geometry of interaction. Contemp. Math. 92, 69–108 (1989)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Green, A.S., Lumsdaine, P.L., et al.: Quipper: a scalable quantum programming language. In: Proceedings of PLDI, pp. 333–342 (2013)Google Scholar
  12. 12.
    Gupta, P., Agrawal, A., Jha, N.K.: An algorithm for synthesis of reversible logic circuits. IEEE Trans. CAD Int. Circ. Syst. 25(11), 2317–2330 (2006)CrossRefGoogle Scholar
  13. 13.
    Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103(15), 150–502 (2009)MathSciNetCrossRefGoogle Scholar
  14. 14.
    James, R.P., Sabry, A.: Information effects. In: Proceedings of POPL, pp. 73–84 (2012)Google Scholar
  15. 15.
    Kluge, W.: A reversible SE(M)CD machine. IFL’99. LNCS, vol. 1868, pp. 95–113. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  16. 16.
    Laundauer, R.: Irreversibility and heat generation in the computing process. IBM J. Res. Dev. 5, 261–269 (1961)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Magniez, F., Santha, M., Szegedy, M.: Quantum algorithms for the triangle problem. SIAM J. Comput. 37(2), 413–424 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  18. 18.
    Maslov, D., Dueck, G W., Miller, D.M.: Fredkin/Toffoli templates for reversible logic synthesis. In: Proceedings of ICCAD, pp. 256–261 (2003)Google Scholar
  19. 19.
    Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge Univ. Press, Cambridge (2002)zbMATHGoogle Scholar
  20. 20.
    Nikhil, R.S.: Bluespec: a general-purpose approach to high-level synthesis based on parallel atomic transactions. In: Coussy, P., Morawiec, A. (eds.) High-Level Synthesis, pp. 129–146. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  21. 21.
    Parent, A., Roetteler, M., Svore, K.M.: Reversible circuit compilation with space constraints. arXiv:1510.00377 (2015)
  22. 22.
    Park, S., Kim, J., Im, H.: Functional netlists. In: Proceedings of ICFP, pp. 353–366 (2008)Google Scholar
  23. 23.
  24. 24.
    Saeedi, M., Markov, I.L.: Synthesis and optimization of reversible circuits - a survey. ACM Comput. Surv. 45(2), 21:1–21:34 (2013)CrossRefzbMATHGoogle Scholar
  25. 25.
    Sanaee, Y., Saeedi, M., Zamani, M.S.:Shared-PPRM: a memory-efficient representation for boolean reversiblefunctions. In: Proceedings of ISVLSI, pp. 471–474 (2008)Google Scholar
  26. 26.
    Sander, I.: System modeling and design refinement in ForSyDe. Ph.D. thesis, Royal Institute of Technology, Stockholm, Sweden (2003)Google Scholar
  27. 27.
    Scherer, A., Valiron, B., et al.: Resource analysis of the quantum linear system algorithm. arxiv:1505.06552 (2015)
  28. 28.
    Shor, P.: Algorithms for quantum computation: discrete logarithm and factoring. In: Proceedings of FOCS (1994)Google Scholar
  29. 29.
    Soeken, M., Frehse, S., Wille, R., Drechsler, R.: RevKit: an open source toolkit for the design of reversible circuits. In: De Vos, A., Wille, R. (eds.) RC 2011. LNCS, vol. 7165, pp. 64–76. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  30. 30.
    Green, A.S., Lumsdaine, P.L.F., Ross, N.J., Selinger, P., Valiron, B.: White dots do matter: rewriting reversible logic circuits. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 196–208. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  31. 31.
    Swamy, N., Guts, N., et al.: Lightweight monadic programming in ML. In: Proceedings of ICFP, pp. 15–27 (2011)Google Scholar
  32. 32.
    Terui, K.: Proof nets and boolean circuits. In: Proceedings of LICS, pp. 182–191 (2004)Google Scholar
  33. 33.
    Thomsen, M.K.: A functional language for describing reversible logic. In: Proceedings of FDL, pp. 135–142 (2012)Google Scholar
  34. 34.
    Wille, R., Große, D., et al.: RevLib: an online resource for reversible functions and reversible circuits. In: International Symposium on Multi-valued Logic, pp. 220–225 (2008)Google Scholar
  35. 35.
    Wille, R., Le, H.M., Dueck, G.W., Grosse, D.: Quantified synthesis of reversible logic. In: Proceedings of DATE, pp. 1015–1020 (2008)Google Scholar
  36. 36.
    Wille, R., Offermann, S., Drechsler, R.:SyReC: a programming language for synthesis of reversible circuits. In: Forum on Specification Design Languages, pp. 1–6 (2010)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.LRI, CentraleSupélecUniversité Paris SaclayOrsay CedexFrance

Personalised recommendations