Coquet: A Coq Library for Verifying Hardware

  • Thomas Braibant
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7086)


We propose a new library to model and verify hardware circuits in the Coq proof assistant. This library allows one to easily build circuits by following the usual pen-and-paper diagrams. We define a deep-embedding: we use a (dependently typed) data-type that models the architecture of circuits, and a meaning function. We propose tactics that ease the reasoning about the behavior of the circuits, and we demonstrate that our approach is practicable by proving the correctness of various circuits: a text-book divide and conquer adder of parametric size, some higher-order combinators of circuits, and some sequential circuits: a buffer, and a register.


Dependent Type Arithmetic Circuit Meaning Relation Sequential Circuit Output Wire 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V., Ullman, J.D.: Foundations of Computer Science. Computer Science Press, W. H. Freeman and Company (1992)Google Scholar
  2. 2.
    Bjesse, P., Claessen, K., Sheeran, M., Singh, S.: Lava: Hardware Design in Haskell. In: Proc. ICFP, pp. 174–184. ACM Press (1998)Google Scholar
  3. 3.
  4. 4.
    Brock, B., Hunt Jr., W.A.: The DUAL-EVAL Hardware Description Language and Its Use in the Formal Specification and Verification of the FM9001 Microprocessor. Formal Methods in System Design 11(1), 71–104 (1997)CrossRefGoogle Scholar
  5. 5.
    Brown, C., Hutton, G.: Categories, allegories and circuit design. In: Proc. LICS, pp. 372–381. IEEE Computer Society (1994)Google Scholar
  6. 6.
    Coupet-Grimal, S., Jakubiec, L.: Certifying circuits in type theory. Formal Asp. Comput. 16(4), 352–373 (2004)CrossRefzbMATHGoogle Scholar
  7. 7.
    Ghica, D.R.: Geometry of synthesis: a structured approach to VLSI design. In: Proc. POPL, pp. 363–375 (2007)Google Scholar
  8. 8.
    Gonthier, G., Mahboubi, A.: An introduction to small scale reflection in Coq. Journal of Formalized Reasoning 3(2), 95–152 (2010)MathSciNetzbMATHGoogle Scholar
  9. 9.
    Gordon, M.: Why Higher-Order Logic is a Good Formalism for Specifying and Verifying Hardware. Technical Report UCAM-CL-TR-77, Cambridge Univ., Computer Lab (1985)Google Scholar
  10. 10.
    Hanna, F.K., Daeche, N., Longley, M.: Veritas + : A Specification Language Based on Type Theory. In: Leeser, M., Brown, G. (eds.) Hardware Specification, Verification and Synthesis: Mathematical Aspects. LNCS, vol. 408, pp. 358–379. Springer, Heidelberg (1990)CrossRefGoogle Scholar
  11. 11.
    Harrison, J.: A HOL Theory of Euclidean Space. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 114–129. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  12. 12.
    Hinze, R.: An Algebra of Scans. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 186–210. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  13. 13.
    Iyoda, J.: Translating HOL functions to hardware. Technical Report UCAM-CL-TR-682, Cambridge Univ., Computer Lab (April 2007)Google Scholar
  14. 14.
    Hunt Jr., W.A., Brock, B.: The Verification of a Bit-slice ALU. In: Leeser, M., Brown, G. (eds.) Hardware Specification, Verification and Synthesis: Mathematical Aspects. LNCS, vol. 408, pp. 282–306. Springer, Heidelberg (1990)CrossRefGoogle Scholar
  15. 15.
    Lafont, Y.: Towards an algebraic theory of boolean circuits. Journal of Pure and Applied Algebra 184, 257–310 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Leroy, X.: A formally verified compiler back-end. Journal of Automated Reasoning 43(4), 363–446 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    Melham, T.: Higher Order Logic and Hardware Verification. Cambridge Tracts in Theoretical Computer Science, vol. 31. Cambridge University Press (1993)Google Scholar
  18. 18.
    Paulin-Mohring, C.: Circuits as Streams in Coq: Verification of a Sequential Multiplier. In: Berardi, S., Coppo, M. (eds.) TYPES 1995. LNCS, vol. 1158, pp. 216–230. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  19. 19.
    Sheeran, M.: μFP, A Language for VLSI Design. In: LISP and Functional Programming, pp. 104–112 (1984)Google Scholar
  20. 20.
    Sheeran, M.: Hardware Design and Functional Programming: a Perfect Match. J. UCS 11(7), 1135–1158 (2005)Google Scholar
  21. 21.
    Slind, K., Owens, S., Iyoda, J., Gordon, M.: Proof producing synthesis of arithmetic and cryptographic hardware. Formal Asp. Comput. 19(3), 343–362 (2007)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Thomas Braibant
    • 1
  1. 1.LIG, UMR 5217INRIAFrance

Personalised recommendations