Skip to main content

Congruence Closure in Intensional Type Theory

  • Conference paper
  • First Online:
Automated Reasoning (IJCAR 2016)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 9706))

Included in the following conference series:

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    There are many equivalent ways of defining heq. One popular way is “John Major equality” [15]. Additional formulations and formal proofs of equivalence can be found at http://leanprover.github.io/ijcar16/congr.lean.

  2. 2.

    The formal statements and proofs for small values of n can be found at http://leanprover.github.io/ijcar16/congr.lean, along with formal proofs of all other lemmas described in this paper.

  3. 3.

    To simplify the presentation further, we ignore the possibility that any of these subterms themselves include partial applications of equality.

  4. 4.

    https://github.com/leanprover/lean/blob/master/src/library/blast/congruence_closure.cpp.

References

  1. Private communication with Jeremy Avigad and Floris van Doorn

    Google Scholar 

  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)

    Chapter  Google Scholar 

  3. Bachmair, L., Tiwari, A., Vigneron, L.: Abstract congruence closure. J. Autom. Reason. 31(2), 129–168 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  6. Brady, E.: Idris, a general-purpose dependently typed programming language: design and implementation. J. Funct. Program. 23(05), 552–593 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  7. Castéran, P., Sozeau, M.: A gentle introduction to type classes and relations in Coq. Technical report. Citeseer (2012)

    Google Scholar 

  8. Coq Development Team: The Coq proof assistant reference manual: Version 8.5. INRIA (2015–2016)

    Google Scholar 

  9. Corbineau, P.: Autour de la clôture de congruence avec Coq. Master’s Thesis, Université Paris-Sud (2001)

    Google Scholar 

  10. Detlefs, D., Nelson, G., Saxe, J.B.: Simplify: a theorem prover for program checking. J. ACM 52(3), 365–473 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  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)

    Chapter  Google Scholar 

  12. Hur, C.K.: Heq: a Coq library for heterogeneous equality (2010)

    Google Scholar 

  13. Kapur, D.: Shostak’s congruence closure as completion. In: Comon, H. (ed.) RTA 1997. LNCS, vol. 1232, pp. 23–37. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  14. Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009)

    Article  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  19. de Moura, L., Avigad, J., Kong, S., Roux, C.: Elaboration in dependent type theory. Technical report (2015). http://arXiv.org/abs/1505.04324

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  22. de Moura, L., Rueß, H., Shankar, N.: Justifying equality. Electron. Notes Theoret. Comput. Sci. 125(3), 69–85 (2005)

    Article  MATH  Google Scholar 

  23. Nelson, G., Oppen, D.C.: Fast decision procedures based on congruence closure. J. ACM (JACM) 27(2), 356–364 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  24. Nieuwenhuis, R., Oliveras, A.: Proof-producing congruence closure. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 453–468. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  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. Streicher, T.: Investigations into Intensional Type Theory, Habilitations-schrift, Ludwig-Maximilians-Universität München (1993)

    Google Scholar 

Download references

Acknowledgments

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.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Leonardo de Moura .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Selsam, D., de Moura, L. (2016). Congruence Closure in Intensional Type Theory. In: Olivetti, N., Tiwari, A. (eds) Automated Reasoning. IJCAR 2016. Lecture Notes in Computer Science(), vol 9706. Springer, Cham. https://doi.org/10.1007/978-3-319-40229-1_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-40229-1_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-40228-4

  • Online ISBN: 978-3-319-40229-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics