Congruence Closure in Intensional Type Theory

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9706)


Congruence closure procedures are used extensively in automated reasoning and are a core component of most satisfiability modulo theories solvers. However, no known congruence closure algorithms can support any of the expressive logics based on intensional type theory (ITT), which form the basis of many interactive theorem provers. The main source of expressiveness in these logics is dependent types, and yet existing congruence closure procedures found in interactive theorem provers based on ITT do not handle dependent types at all and only work on the simply-typed subsets of the logics. Here we present an efficient and proof-producing congruence closure procedure that applies to every function in ITT no matter how many dependencies exist among its arguments, and that only relies on the commonly assumed uniqueness of identity proofs axiom. We demonstrate its usefulness by solving interesting verification problems involving functions with dependent types.



We would like to thank David Dill, Jeremy Avigad, Robert Lewis, Nikhil Swany, Floris van Doorn and Georges Gonthier for providing valuable feedback on early drafts.


  1. 1.
    Private communication with Jeremy Avigad and Floris van DoornGoogle Scholar
  2. 2.
    Asperti, A., Ricciotti, W., Sacerdoti Coen, C., Tassi, E.: The Matita interactive theorem prover. In: Bjørner, N., Sofronie-Stokkermans, V. (eds.) CADE 2011. LNCS, vol. 6803, pp. 64–69. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  3. 3.
    Bachmair, L., Tiwari, A., Vigneron, L.: Abstract congruence closure. J. Autom. Reason. 31(2), 129–168 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 171–177. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  5. 5.
    Bove, A., Dybjer, P., Norell, U.: A brief overview of Agda – a functional language with dependent types. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 73–78. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Brady, E.: Idris, a general-purpose dependently typed programming language: design and implementation. J. Funct. Program. 23(05), 552–593 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Castéran, P., Sozeau, M.: A gentle introduction to type classes and relations in Coq. Technical report. Citeseer (2012)Google Scholar
  8. 8.
    Coq Development Team: The Coq proof assistant reference manual: Version 8.5. INRIA (2015–2016)Google Scholar
  9. 9.
    Corbineau, P.: Autour de la clôture de congruence avec Coq. Master’s Thesis, Université Paris-Sud (2001)Google Scholar
  10. 10.
    Detlefs, D., Nelson, G., Saxe, J.B.: Simplify: a theorem prover for program checking. J. ACM 52(3), 365–473 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Gonthier, G., Asperti, A., Avigad, J., Bertot, Y., Cohen, C., Garillot, F., Le Roux, S., Mahboubi, A., O’Connor, R., Ould Biha, S., Pasca, I., Rideau, L., Solovyev, A., Tassi, E., Théry, L.: A machine-checked proof of the odd order theorem. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 163–179. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  12. 12.
    Hur, C.K.: Heq: a Coq library for heterogeneous equality (2010)Google Scholar
  13. 13.
    Kapur, D.: Shostak’s congruence closure as completion. In: Comon, H. (ed.) RTA 1997. LNCS, vol. 1232, pp. 23–37. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  14. 14.
    Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009)CrossRefGoogle Scholar
  15. 15.
    McBride, C.: Elimination with a motive. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 197–216. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  16. 16.
    McBride, C.: Epigram: practical programming with dependent types. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 130–170. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  17. 17.
    McBride, C., Goguen, H.H., McKinna, J.: A few constructions on constructors. In: Filliâtre, J.-C., Paulin-Mohring, C., Werner, B. (eds.) TYPES 2004. LNCS, vol. 3839, pp. 186–200. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  18. 18.
    Miquel, A., Werner, B.: The not so simple proof-irrelevant model of CC. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 240–258. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  19. 19.
    de Moura, L., Avigad, J., Kong, S., Roux, C.: Elaboration in dependent type theory. Technical report (2015).
  20. 20.
    de Moura, L., Bjørner, N.S.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  21. 21.
    de Moura, L., Kong, S., Avigad, J., Van Doorn, F., von Raumer, J.: The Lean theorem prover (system description). In: Felty, A.P., Middeldorp, A. (eds.) CADE-25. LNAI, vol. 9195, pp. 378–388. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  22. 22.
    de Moura, L., Rueß, H., Shankar, N.: Justifying equality. Electron. Notes Theoret. Comput. Sci. 125(3), 69–85 (2005)CrossRefzbMATHGoogle Scholar
  23. 23.
    Nelson, G., Oppen, D.C.: Fast decision procedures based on congruence closure. J. ACM (JACM) 27(2), 356–364 (1980)MathSciNetCrossRefzbMATHGoogle Scholar
  24. 24.
    Nieuwenhuis, R., Oliveras, A.: Proof-producing congruence closure. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 453–468. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  25. 25.
    Sjöberg, V., Weirich, S.: Programming up to congruence. In: POPL 2015, NY, USA, pp. 369–382. ACM, New York (2015)Google Scholar
  26. 26.
    Streicher, T.: Investigations into Intensional Type Theory, Habilitations-schrift, Ludwig-Maximilians-Universität München (1993)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.Stanford UniversityStanfordUSA
  2. 2.Microsoft ResearchRedmondUSA

Personalised recommendations