Hostname: page-component-8448b6f56d-c4f8m Total loading time: 0 Render date: 2024-04-16T11:01:13.578Z Has data issue: false hasContentIssue false

A comprehensible guide to a new unifier for CIC including universe polymorphism and overloading*

Published online by Cambridge University Press:  07 February 2017

BETA ZILIANI
Affiliation:
FAMAF, Universidad Nacional de Córdoba, Argentina, and CONICET, Córdoba, Argentina (e-mail: bziliani@famaf.unc.edu.ar)
MATTHIEU SOZEAU
Affiliation:
Inria & PPS, France, and Université Paris Diderot, Paris, France (e-mail: matthieu.sozeau@inria.fr)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Unification is a core component of every proof assistant or programming language featuring dependent types. In many cases, it must deal with higher order problems up to conversion. Since unification in such conditions is undecidable, unification algorithms may include several heuristics to solve common problems. However, when the stack of heuristics grows large, the result and complexity of the algorithm can become unpredictable. Our contributions are twofold: (1) We present a full description of a new unification algorithm for the Calculus of Inductive Constructions (the base logic of COQ), building it up from a basic calculus to the full Calculus of Inductive Constructions as it is implemented in COQ, including universe polymorphism, canonical structures (the overloading mechanism baked into COQ's unification), and a small set of useful heuristics. (2) We implemented our algorithm, and tested it on several libraries, providing evidence that the selected set of heuristics suffices for large developments.

Type
Articles
Copyright
Copyright © Cambridge University Press 2017 

Footnotes

*

This research was partially supported by EU 7FP grant agreement 295261 (MEALS).

References

Abel, A. & Pientka, B. (2011) Higher-order dynamic pattern unification for dependent types and records. In Proceedings of International Conference on Typed Lambda Calculi and Applications (TLCA). Berlin, Heidelberg: Springer, pp. 10–26.Google Scholar
Asperti, A., Coen, C. S., Tassi, E. & Zacchiroli, S. (2006) Crafting a proof assistant. In Berlin, Heidelberg: Springer-Verlag, ed. Altenkirch, Thorsten and McBride, Conor, pp. 18–32.Google Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2009) Hints in unification. In TPHOLs, ed. Berghofer, Stefan, Nipkow, Tobias, Urban, Christian, Wenzel, Makarius, LNCS, vol. 5674. Berlin, Heidelberg: Springer, pp. 84–98.Google Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2012) A bi-directional refinement algorithm for the calculus of (co)inductive constructions. Log. Methods Comput. Sci. (LMCS) 8 (1), 149.Google Scholar
Baader, F. & Nipkow, T. (1998) Term Rewriting and All That. New York, NY, USA: Cambridge University Press.Google Scholar
Baader, F. & Siekmann, J. H. (1994) Handbook of Logic in Artificial Intelligence and Logic Programming. New York, NY, USA: Oxford University Press, Inc.Google Scholar
Bender, M. A., Fineman, J. T., Gilbert, S. & Tarjan, R. E. (2015) A new approach to incremental cycle detection and related problems. ACM Trans. Algorithms 12 (2), 14:114:22.Google Scholar
Brady, E. (2013) Idris, a general-purpose dependently typed programming language: Design and implementation. J. Funct. Program. (JFP) 23, pp. 552593.Google Scholar
Cervesato, I. & Pfenning, F. (2003) A linear spine calculus. J. Log. Comput. 13 (5), 639688.Google Scholar
Chlipala, A. (2011) Certified Programming with Dependent Types. MIT Press. Available at: http://adam.chlipala.net/cpdt/.Google Scholar
de Moura, L., Avigad, J., Kong, S. & Roux, C. (2015) Elaboration in dependent type theory. Arxiv e-prints, May.Google Scholar
Dowek, G., Hardin, T., Kirchner, C. & Pfenning, F. (1996) Unification via explicit substitutions: The case of higher-order patterns. In Proceedings of lics'95. IEEE Computer Society Press, Washington, DC, USA, pp. 36637–4, 366–381.Google Scholar
Dunchev, C., Guidi, F., Sacerdoti Coen, C. & Tassi, E. (2015) Elpi: Fast, embeddable, λprolog interpreter. In Logic for Programming, Artificial Intelligence, and Reasoning, Davis, M., Fehnker, A., McIver, A. & Voronkov, A. (eds), Lecture Notes in Computer Science, vol. 9450. Berlin, Heidelberg: Springer, pp. 460468.Google Scholar
Elliott, C. M. (1989) Higher-order unification with dependent function types. In Proceedings of 3rd International Conference Rewriting Techniques and Applications, LNCS, vol. 355. Berlin, Heidelberg: Springer-Verlag, pp. 121–136.Google Scholar
Garillot, F. (2011 December) Generic Proof Tools and Finite Group Theory. PhD Thesis, Ecole Polytechnique X.Google Scholar
Garillot, F., Gonthier, G., Mahboubi, A. & Rideau, L. (2009) Packaging mathematical structures. In TPHOL. ed. Berghofer, Stefan, Nipkow, Tobias, Urban, Christian, Wenzel, Makarius: Springer, pp. 327–342.Google Scholar
Gonthier, G., Mahboubi, A. & Tassi, E. (2008) A Small Scale Reflection Extension for the Coq System. Technical Report, INRIA.Google Scholar
Gonthier, G., Ziliani, B., Nanevski, A. & Dreyer, D. (2011) How to make ad hoc proof automation less ad hoc. In Proceedings of Inernational Conference of Functional Programming (ICFP). New York, NY, USA: ACM, pp. 163175.Google Scholar
Gonthier, G., Ziliani, B., Nanevski, A. & Dreyer, D. (2013a) How to make ad hoc proof automation less ad hoc. J. Funct. Program. (JFP) 23 (04), 357401.CrossRefGoogle Scholar
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. (2013b) A machine-checked proof of the odd order theorem. In ITP. ed. Blazy, Sandrine, Paulin-Mohring, Christine, Pichardie, David. Springer, pp. 163–179.Google Scholar
Harper, R. & Pollack, R. (1991) Type checking with universes. Theor. Comput. Sci. 89 (1), 107136.Google Scholar
Huet, G. P. (2002) Higher order unification 30 years later. In Proceedings of the 15th International Conference on Theorem Proving in Higher Order Logics. In TPHOLs '02. London, UK: Springer-Verlag, pp. 3–12.Google Scholar
Knight, K. (1989) Unification: A multidisciplinary survey. ACM Comput. Surv. 21 (1), 93124.Google Scholar
Mahboubi, A. & Tassi, E. (2013) Canonical Structures for the working Coq user. In ITP. ed. Blazy, Sandrine, Paulin-Mohring, Christine, Pichardie, David. Springer, pp. 19–34.Google Scholar
Miller, D. (1991) Unification of simply typed lamda-terms as logic programming. In ICLP. ed. Beaumont, Anthony and Gupta, Gopal, MIT Press, pp. 255-269.Google Scholar
Nanevski, A., Pfenning, F. & Pientka, B. (2008) Contextual modal type theory. ACM Trans. Comput. Logic 9 (3), pp. 23:123:49.Google Scholar
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. PhD Thesis, Chalmers University of Technology.Google Scholar
Norell, U. (2009) Dependently typed programming in Agda. In Types in Language Design and Implementation (TLDI). ed. Koopman, Pieter, Plasmeijer, Rinus, and Swierstra, Doaitse, ACM, pp. 230266.Google Scholar
Paulson, L. C. (1985) Verifying the unification algorithm in lcf. Sci. Comput. Program. 5 (2), 143169.Google Scholar
Peyton Jones, S., Vytiniotis, D., Weirich, S. & Washburn, G. (2006) Simple unification-based type inference for GADTs. In Proceedings of Inernational Conference of Functional Programming (ICFP). New York, NY, USA: ACM. pp. 50–61.Google Scholar
Pfenning, F. (1991) Unification and anti-unification in the calculus of constructions. In Proceedings of 6th Annual IEEE Symposium on Logic in Computer Science, Ieee Computer Society, Washington, D.C., United States, pp. 74–85.Google Scholar
Pfenning, F. & Schürmann, C. (1998) Algorithms for equality and unification in the presence of notational definitions. In Types for Proofs and Programs, ed. Altenkirch, Thorsten and Naraschewski, Wolfgang and Reus, Bernhard, LNCS. Springer-Verlag, p. 1657.Google Scholar
Reed, J. (2009) Higher-order constraint simplification in dependent type theory. In Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP). New York, NY, USA: ACM, pp. 4956.Google Scholar
Robinson, J. A. (1965) A machine-oriented logic based on the resolution principle. J. ACM (JACM) 12 (1), 2341.Google Scholar
Sacerdoti Coen, C. (2004) Mathematical Knowledge Management and Interactive Theorem Proving. PhD Thesis, University of Bologna.Google Scholar
Saíbi, A. (1999) Outils Generiques de Modelisation et de Demonstration Pour la Formalisation des Mathematiques en Theorie des Types. Application a la Theorie des Categories. PhD Thesis, University Paris 6.Google Scholar
Sozeau, M. & Tabareau, N. (2014) Universe polymorphism in Coq. In Proceedings of International Conference on Interactive Theorem Proving (ITP). Berlin, Heidelberg, Springer, pp. 499–514.Google Scholar
The Coq Development Team. (2012) The Coq Proof Assistant Reference Manual – Version V8.4. Available at: http://coq.inria.fr/V8.4/CREDITS.Google Scholar
Wadler, P. & Blott, S. (1989) How to make ad-hoc polymorphism less ad hoc. In Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. New York, NY, USA: ACM, pp. 60–76.Google Scholar
Ziliani, B. & Sozeau, M. (2015) A unification algorithm for Coq featuring universe polymorphism and overloading. In Proceedings of the International Conference of Functional Programming (ICFP). New York, NY, USA: ACM, pp. 179–191.Google Scholar
Ziliani, B., Dreyer, D., Krishnaswami, N. R., Nanevski, A. & Vafeiadis, V. (2013) Mtac: A monad for typed tactic programming in Coq. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming (ICFP), New York, NY, USA: ACM, pp. 87100.Google Scholar
Ziliani, B., Dreyer, D., Krishnaswami, N., Nanevski, A. & Vafeiadis, V. (2015) Mtac: A monad for typed tactic programming in Coq. J. Funct. Program. (JFP), Cambridge University Press, 25.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.