skip to main content
research-article

A unification algorithm for Coq featuring universe polymorphism and overloading

Published: 29 August 2015 Publication History

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.
[2]
A. Asperti, C. S. Coen, E. Tassi, and S. Zacchiroli. Crafting a proof assistant. In TYPES. Springer-Verlag, 2006.
[3]
A. Asperti, W. Ricciotti, C. S. Coen, and E. Tassi. Hints in unification. In TPHOLs, volume 5674 of LNCS. Springer, 2009.
[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.
[5]
E. Brady. Idris, a general-purpose dependently typed programming language: Design and implementation. JFP, 23, 2013.
[6]
I. Cervesato and F. Pfenning. A linear spine calculus. Journal of Logic and Computation, 13(5):639–688, 2003.
[7]
A. Chlipala. Certified Programming with Dependent Types. MIT Press, 2011. http://adam.chlipala.net/cpdt/.
[8]
F. Garillot. Generic Proof Tools and Finite Group Theory. PhD thesis, Ecole Polytechnique X, Dec. 2011.
[9]
F. Garillot, G. Gonthier, A. Mahboubi, and L. Rideau. Packaging Mathematical Structures. In TPHOL. Springer, 2009.
[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.
[11]
G. Gonthier, A. Mahboubi, and E. Tassi. A small scale reflection extension for the Coq system. Technical report, INRIA, 2008.
[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.
[13]
A. Mahboubi and E. Tassi. Canonical Structures for the working Coq user. In ITP. Springer, 2013.
[14]
D. Miller. Unification of simply typed lamda-terms as logic programming. In ICLP. MIT Press, 1991.
[15]
A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Trans. Comput. Logic, 9(3), June 2008.
[16]
U. Norell. Dependently Typed Programming in Agda. In TLDI. ACM, 2009.
[17]
S. Peyton Jones, D. Vytiniotis, S. Weirich, and G. Washburn. Simple unification-based type inference for gadts. In ICFP. ACM, 2006.
[18]
J. Reed. Higher-order constraint simplification in dependent type theory. In LFMTP, 2009.
[19]
C. Sacerdoti Coen. Mathematical Knowledge Management and Interactive Theorem Proving. PhD thesis, University of Bologna, 2004.
[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.
[21]
M. Sozeau and N. Tabareau. Universe Polymorphism in Coq. In ITP. Springer, 2014.
[22]
The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.4, 2012.
[23]
P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In POPL, pages 60–76, 1989.
[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.
[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.

Cited By

View all
  • (2021)Functions-as-constructors higher-order unification: extended pattern unificationAnnals of Mathematics and Artificial Intelligence10.1007/s10472-021-09774-y90:5(455-479)Online publication date: 30-Sep-2021
  • (2019)Kind inference for datatypesProceedings of the ACM on Programming Languages10.1145/33711214:POPL(1-28)Online publication date: 20-Dec-2019
  • (2018)Proof-relevant unification: Dependent pattern matching with only the axioms of your type theoryJournal of Functional Programming10.1017/S095679681800014X28Online publication date: 10-May-2018

Recommendations

Comments

Information & Contributors

Information

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
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 August 2015
Published in SIGPLAN Volume 50, Issue 9

Check for updates

Author Tags

  1. Coq
  2. Interactive theorem proving
  3. overloading
  4. unification
  5. universe polymorphism

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2021)Functions-as-constructors higher-order unification: extended pattern unificationAnnals of Mathematics and Artificial Intelligence10.1007/s10472-021-09774-y90:5(455-479)Online publication date: 30-Sep-2021
  • (2019)Kind inference for datatypesProceedings of the ACM on Programming Languages10.1145/33711214:POPL(1-28)Online publication date: 20-Dec-2019
  • (2018)Proof-relevant unification: Dependent pattern matching with only the axioms of your type theoryJournal of Functional Programming10.1017/S095679681800014X28Online publication date: 10-May-2018

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media