skip to main content
research-article

A unification algorithm for Coq featuring universe polymorphism and overloading

Published:29 August 2015Publication History
Skip Abstract Section

Abstract

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), 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.

References

  1. A. Abel and B. Pientka. Higher-order dynamic pattern unification for dependent types and records. In TLCA. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Asperti, C. S. Coen, E. Tassi, and S. Zacchiroli. Crafting a proof assistant. In TYPES. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Asperti, W. Ricciotti, C. S. Coen, and E. Tassi. Hints in unification. In TPHOLs, volume 5674 of LNCS. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Asperti, W. Ricciotti, C. S. Coen, and E. Tassi. A Bi-Directional Refinement Algorithm for the Calculus of (Co)Inductive Constructions. LMCS, 8(1), 2012.Google ScholarGoogle Scholar
  5. E. Brady. Idris, a general-purpose dependently typed programming language: Design and implementation. JFP, 23, 2013.Google ScholarGoogle Scholar
  6. I. Cervesato and F. Pfenning. A linear spine calculus. Journal of Logic and Computation, 13(5):639–688, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  7. A. Chlipala. Certified Programming with Dependent Types. MIT Press, 2011. http://adam.chlipala.net/cpdt/.Google ScholarGoogle Scholar
  8. F. Garillot. Generic Proof Tools and Finite Group Theory. PhD thesis, Ecole Polytechnique X, Dec. 2011.Google ScholarGoogle Scholar
  9. F. Garillot, G. Gonthier, A. Mahboubi, and L. Rideau. Packaging Mathematical Structures. In TPHOL. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Gonthier, A. Asperti, J. Avigad, Y. Bertot, C. Cohen, F. Garillot, S. Le Roux, A. Mahboubi, R. O’Connor, S. Ould Biha, I. Pasca, L. Rideau, A. Solovyev, E. Tassi, and L. Théry. A machine-checked proof of the odd order theorem. In ITP. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. G. Gonthier, A. Mahboubi, and E. Tassi. A small scale reflection extension for the Coq system. Technical report, INRIA, 2008.Google ScholarGoogle Scholar
  12. G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer. How to make ad hoc proof automation less ad hoc. JFP, 23(04):357–401, 2013.Google ScholarGoogle Scholar
  13. A. Mahboubi and E. Tassi. Canonical Structures for the working Coq user. In ITP. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Miller. Unification of simply typed lamda-terms as logic programming. In ICLP. MIT Press, 1991.Google ScholarGoogle Scholar
  15. A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Trans. Comput. Logic, 9(3), June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. U. Norell. Dependently Typed Programming in Agda. In TLDI. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Peyton Jones, D. Vytiniotis, S. Weirich, and G. Washburn. Simple unification-based type inference for gadts. In ICFP. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Reed. Higher-order constraint simplification in dependent type theory. In LFMTP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Sacerdoti Coen. Mathematical Knowledge Management and Interactive Theorem Proving. PhD thesis, University of Bologna, 2004.Google ScholarGoogle Scholar
  20. A. Saïbi. 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, 1999.Google ScholarGoogle Scholar
  21. M. Sozeau and N. Tabareau. Universe Polymorphism in Coq. In ITP. Springer, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  22. The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.4, 2012.Google ScholarGoogle Scholar
  23. P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In POPL, pages 60–76, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. B. Ziliani, D. Dreyer, N. Krishnaswami, A. Nanevski, and V. Vafeiadis. Mtac: A monad for typed tactic programming in coq. To appear in JFP, ??(?):??–??, 2015.Google ScholarGoogle Scholar
  25. B. Ziliani, D. Dreyer, N. R. Krishnaswami, A. Nanevski, and V. Vafeiadis. Mtac: A monad for typed tactic programming in Coq. In ICFP, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A unification algorithm for Coq featuring universe polymorphism and overloading

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 50, Issue 9
          ICFP '15
          September 2015
          436 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2858949
          • Editor:
          • Andy Gill
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
            August 2015
            436 pages
            ISBN:9781450336697
            DOI:10.1145/2784731

          Copyright © 2015 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 August 2015

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!