Abstract
Equations is a plugin for the Coq proof assistant which provides a notation for defining programs by dependent pattern-matching and structural or well-founded recursion. It additionally derives useful high-level proof principles for demonstrating properties about them, abstracting away from the implementation details of the function and its compiled form. We present a general design and implementation that provides a robust and expressive function definition package as a definitional extension to the Coq kernel. At the core of the system is a new simplifier for dependent equalities based on an original handling of the no-confusion property of constructors.
Supplemental Material
- Andreas Abel. 2006. Semi-continuous Sized Types and Termination. In Computer Science Logic, 20th International Workshop, CSL 2006, 15th Annual Conference of the EACSL, Szeged, Hungary, September 25-29, 2006, Proceedings (Lecture Notes in Computer Science), Zoltán Ésik (Ed.), Vol. 4207. Springer, 72–88. Google Scholar
Digital Library
- Andreas Abel and Brigitte Pientka. 2016. Well-founded recursion with copatterns and sized types. J. Funct. Program. 26 (2016), e2.Google Scholar
Cross Ref
- Andreas Abel, Andrea Vezzosi, and Théo Winterhalter. 2017. Normalization by evaluation for sized dependent types. PACMPL 1, ICFP (2017), 33:1–33:30. Google Scholar
Digital Library
- Thorsten Altenkirch, Conor McBride, and Wouter Swierstra. 2007. Observational Equality, Now!. In PLPV’07. Freiburg, Germany. Google Scholar
Digital Library
- Abhishek Anand, Andrew Appel, Greg Morrisett, Zoe Paraskevopoulou, Randy Pollack, Olivier Savary Belanger, Matthieu Sozeau, and Matthew Weaver. 2017. CertiCoq: A verified compiler for Coq. In CoqPL. Paris, France. http://conf.researchr. org/event/CoqPL-2017/main-certicoq-a-verified-compiler-for-coqGoogle Scholar
- Jeremy Avigad, Gabriel Ebner, and Sebastian Ullrich. 2017. The Lean Reference Manual, release 3.3.0. Available at https://leanprover.github.io/reference/lean_reference.pdf .Google Scholar
- Gilles Barthe, Julien Forest, David Pichardie, and Vlad Rusu. 2006. Defining and Reasoning About Recursive Functions: A Practical Tool for the Coq Proof Assistant. Functional and Logic Programming (2006), 114–129. Google Scholar
Digital Library
- Edwin Brady, Conor McBride, and James McKinna. 2003. Inductive Families Need Not Store Their Indices.. In TYPES (Lecture Notes in Computer Science), Stefano Berardi, Mario Coppo, and Ferruccio Damiani (Eds.), Vol. 3085. Springer, 115–129.Google Scholar
- Adam Chlipala. 2011. Certified Programming with Dependent Types. Vol. 20. MIT Press. Google Scholar
Digital Library
- Jesper Cockx. 2017. Dependent Pattern Matching and Proof-Relevant Unification. Ph.D. Dissertation. Katholieke Universiteit Leuven, Belgium. https://lirias.kuleuven.be/handle/123456789/583556Google Scholar
- Jesper Cockx and Andreas Abel. 2018. Elaborating dependent (co)pattern matching. PACMPL 2, ICFP (2018), 75:1–75:30. Google Scholar
Digital Library
- Jesper Cockx and Dominique Devriese. 2017. Lifting proof-relevant unification to higher dimensions. In Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017, Paris, France, January 16-17, 2017, Yves Bertot and Viktor Vafeiadis (Eds.). ACM, 173–181. Google Scholar
Digital Library
- Jesper Cockx and Dominique Devriese. 2018. Proof-relevant unification: Dependent pattern matching with only the axioms of your type theory. J. Funct. Program. 28 (2018), e12.Google Scholar
Cross Ref
- Jesper Cockx, Dominique Devriese, and Frank Piessens. 2014. Pattern matching without K. In Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, Johan Jeuring and Manuel M. T. Chakravarty (Eds.). ACM, 257–268. Google Scholar
Digital Library
- Thierry Coquand. 1992. Pattern Matching with Dependent Types. http://www.cs.chalmers.se/~coquand/pattern.ps Proceedings of the Workshop on Logical Frameworks.Google Scholar
- Gaëtan Gilbert, Jesper Cockx, Matthieu Sozeau, and Nicolas Tabareau. 2019. Definitional Proof-Irrelevance without K. Proceedings of the ACM on Programming Languages (Jan. 2019), 1–28. Google Scholar
Digital Library
- Healfdene Goguen, Conor McBride, and James McKinna. 2006. Eliminating Dependent Pattern Matching. In Essays Dedicated to Joseph A. Goguen (Lecture Notes in Computer Science), Kokichi Futatsugi, Jean-Pierre Jouannaud, and José Meseguer (Eds.), Vol. 4060. Springer, 521–540. http://www.cs.st-andrews.ac.uk/~james/RESEARCH/pattern-elimination-final.pdfGoogle Scholar
- Peter Hancock. 2000. Ordinals and Interactive Programs. Ph.D. Dissertation. LFCS. http://www.lfcs.inf.ed.ac.uk/reports/00/ ECS-LFCS-00-421/index.htmlGoogle Scholar
- Martin Hofmann and Thomas Streicher. 1994. A Groupoid Model Refutes Uniqueness of Identity Proofs. In LICS. IEEE Computer Society, 208–212. http://www.tcs.informatik.uni-muenchen.de/~mhofmann/SH.dvi.gzGoogle Scholar
- John Hughes, Lars Pareto, and Amr Sabry. 1996. Proving the correctness of reactive systems using sized types. In POPL, Vol. 96. 410–423. Google Scholar
Digital Library
- Nicolai Kraus, Martín Escardó, Thierry Coquand, and Thorsten Altenkirch. 2013. Generalizations of Hedberg’s Theorem. In Typed Lambda Calculi and Applications, Masahito Hasegawa (Ed.). Lecture Notes in Computer Science, Vol. 7941. Springer Berlin Heidelberg, 173–188.Google Scholar
- Alexander Krauss. 2006. Partial Recursive Functions in Higher-Order Logic. In Automated Reasoning, Third International Joint Conference, IJCAR 2006, Seattle, WA, USA, August 17-20, 2006, Proceedings (Lecture Notes in Computer Science), Ulrich Furbach and Natarajan Shankar (Eds.), Vol. 4130. Springer, 589–603. Google Scholar
Digital Library
- Peter LeFanu Lumsdaine. 2010. Weak omega-categories from intensional type theory. Logical Methods in Computer Science 6, 3 (2010).Google Scholar
- Assia Mahboubi, Enrico Tassi, Yves Bertot, and Georges Gonthier. 2018. Mathematical Components.Google Scholar
- Cyprien Mangin and Matthieu Sozeau. 2015. Equations for Hereditary Substitution in Leivant’s Predicative System F: A Case Study. In Proceedings Tenth International Workshop on Logical Frameworks and Meta Languages: Theory and Practice (EPTCS), Vol. 185.Google Scholar
Cross Ref
- Per Martin-Löf. 1984. Intuitionistic type theory. Studies in Proof Theory, Vol. 1. Bibliopolis. iv+91 pages.Google Scholar
- Conor McBride. 1999. Dependently Typed Functional Programs and Their Proofs. Ph.D. Dissertation. University of Edinburgh. http://citeseer.ist.psu.edu/mcbride99dependently.htmlGoogle Scholar
- Conor McBride, Healfdene Goguen, and James McKinna. 2004. A Few Constructions on Constructors. Types for Proofs and Programs (2004), 186–200. Google Scholar
Digital Library
- Conor McBride and James McKinna. 2004. The view from the left. J. Funct. Program. 14, 1 (2004), 69–111. Google Scholar
Digital Library
- Jean-François Monin and Xiaomu Shi. 2013. Handcrafted Inversions Made Operational on Operational Semantics. Springer Berlin Heidelberg, Berlin, Heidelberg, 338–353.Google Scholar
- Ulf Norell. 2007. Towards a practical programming language based on dependent type theory. Ph.D. Dissertation. Department of Computer Science and Engineering, Chalmers University of Technology, SE-412 96 Göteborg, Sweden. http://www.cs. chalmers.se/~ulfn/papers/thesis.htmlGoogle Scholar
- Christine Paulin-Mohring. 1996. Définitions Inductives en Théorie des Types d’Ordre Supérieur. Habilitation à diriger les recherches. Université Claude Bernard Lyon I. http://www.lri.fr/~paulin/PUBLIS/habilitation.ps.gzGoogle Scholar
- Lawrence C Paulson. 1986. Constructing Recursion operators in Intuitionistic Type Theory. Journal of Symbolic Computation 2, 4 (1986), 325–355. https://www.sciencedirect.com/science/article/pii/S0747717186800025/pdf?md5= 4df038c66455b64726734b09ad0ea894&isDTMRedir=Y&pid=1-s2.0-S0747717186800025-main.pdf&_valck=1 Google Scholar
Digital Library
- Pierre-Marie Pédrot and Nicolas Tabareau. 2018. Failure is Not an Option An Exceptional Type Theory. In ESOP 2018 - 27th European Symposium on Programming (LNCS), Vol. 10801. Springer, Thessaloniki, Greece, 245–271.Google Scholar
- Casper Bach Poulsen, Arjen Rouvoet, Andrew Tolmach, Robbert Krebbers, and Eelco Visser. 2018. Intrinsically-typed definitional interpreters for imperative languages. PACMPL 2, POPL (2018), 16:1–16:34. Google Scholar
Digital Library
- Daniel Schepler. 2013. Bijective function implies equal types is provably inconsistent with functional extensionality in Coq. Post on coq-club. https://sympa.inria.fr/sympa/arc/coq-club/2013-12/msg00114.htmlGoogle Scholar
- Matthieu Sozeau. 2007. Program-ing Finger Trees in Coq. In ICFP’07. ACM Press, Freiburg, Germany, 13–24. Google Scholar
Digital Library
- Matthieu Sozeau. 2010. Equations: A Dependent Pattern-Matching Compiler. In First International Conference on Interactive Theorem Proving. Springer. Google Scholar
Digital Library
- Matthieu Sozeau and Cyprien Mangin. 2019a. Equations Reloaded Accompanying Material. Available on the ACM DL.Google Scholar
- Matthieu Sozeau and Cyprien Mangin. 2019b. Equations v1.2.Google Scholar
- Antal Spector-Zabusky, Joachim Breitner, Christine Rizkallah, and Stephanie Weirich. 2018. Total Haskell is reasonable Coq. In Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2018, Los Angeles, CA, USA, January 8-9, 2018, June Andronick and Amy P. Felty (Eds.). ACM, 14–27. Google Scholar
Digital Library
- Thomas Streicher. 1993. Semantical Investigations into Intensional Type Theory. Habilitationsschrift. LMU München.Google Scholar
- The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations for Mathematics. Institute for Advanced Study. http://homotopytypetheory.org/bookGoogle Scholar
- Benno van den Berg and Richard Garner. 2011. Types are weak ω-groupoids. Proceedings of the London Mathematical Society 102, 2 (2011), 370–394.Google Scholar
Cross Ref
- Niki Vazou, Leonidas Lampropoulos, and Jeff Polakow. 2017. A tale of two provers: verifying monoidal string matching in liquid Haskell and Coq. In Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell, Oxford, United Kingdom, September 7-8, 2017, Iavor S. Diatchki (Ed.). ACM, 63–74. Google Scholar
Digital Library
- Dimitrios Vytiniotis, Thierry Coquand, and David Wahlstedt. 2012. Stop When You Are Almost-Full - Adventures in Constructive Termination. In Interactive Theorem Proving - Third International Conference, ITP 2012, Princeton, NJ, USA, August 13-15, 2012. Proceedings (Lecture Notes in Computer Science), Lennart Beringer and Amy P. Felty (Eds.), Vol. 7406. Springer, 250–265.Google Scholar
Cross Ref
Index Terms
Equations reloaded: high-level dependently-typed functional programming and proving in Coq
Recommendations
Coq Coq correct! verification of type checking and erasure for Coq, in Coq
Coq is built around a well-delimited kernel that perfoms typechecking for definitions in a variant of the Calculus of Inductive Constructions (CIC). Although the metatheory of CIC is very stable and reliable, the correctness of its implementation in Coq ...
POPLMark reloaded: mechanizing logical relations proofs (invited talk)
CPP 2018: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and ProofsMechanizing formal systems, given via axioms and inference rules, together with proofs about them plays an important role in establishing trust in formal developments. Over the past decade, the POPLMark challenge popularized the use of proof assistants ...
A meta-programming approach to realizing dependently typed logic programming
PPDP '10: Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programmingDependently typed λ-calculi such as the Logical Framework (LF) can encode relationships between terms in types and can naturally capture correspondences between formulas and their proofs. Such calculi can also be given a logic programming interpretation:...






Comments