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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 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.
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.
To simplify the presentation further, we ignore the possibility that any of these subterms themselves include partial applications of equality.
- 4.
References
Private communication with Jeremy Avigad and Floris van Doorn
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)
Bachmair, L., Tiwari, A., Vigneron, L.: Abstract congruence closure. J. Autom. Reason. 31(2), 129–168 (2003)
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)
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)
Brady, E.: Idris, a general-purpose dependently typed programming language: design and implementation. J. Funct. Program. 23(05), 552–593 (2013)
Castéran, P., Sozeau, M.: A gentle introduction to type classes and relations in Coq. Technical report. Citeseer (2012)
Coq Development Team: The Coq proof assistant reference manual: Version 8.5. INRIA (2015–2016)
Corbineau, P.: Autour de la clôture de congruence avec Coq. Master’s Thesis, Université Paris-Sud (2001)
Detlefs, D., Nelson, G., Saxe, J.B.: Simplify: a theorem prover for program checking. J. ACM 52(3), 365–473 (2005)
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)
Hur, C.K.: Heq: a Coq library for heterogeneous equality (2010)
Kapur, D.: Shostak’s congruence closure as completion. In: Comon, H. (ed.) RTA 1997. LNCS, vol. 1232, pp. 23–37. Springer, Heidelberg (1997)
Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009)
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)
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)
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)
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)
de Moura, L., Avigad, J., Kong, S., Roux, C.: Elaboration in dependent type theory. Technical report (2015). http://arXiv.org/abs/1505.04324
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)
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)
de Moura, L., Rueß, H., Shankar, N.: Justifying equality. Electron. Notes Theoret. Comput. Sci. 125(3), 69–85 (2005)
Nelson, G., Oppen, D.C.: Fast decision procedures based on congruence closure. J. ACM (JACM) 27(2), 356–364 (1980)
Nieuwenhuis, R., Oliveras, A.: Proof-producing congruence closure. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 453–468. Springer, Heidelberg (2005)
Sjöberg, V., Weirich, S.: Programming up to congruence. In: POPL 2015, NY, USA, pp. 369–382. ACM, New York (2015)
Streicher, T.: Investigations into Intensional Type Theory, Habilitations-schrift, Ludwig-Maximilians-Universität München (1993)
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
Corresponding author
Editor information
Editors and Affiliations
Rights 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)