skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Equations reloaded: high-level dependently-typed functional programming and proving in Coq

Authors Info & Claims
Published:26 July 2019Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

a86-sozeau.webm

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andreas Abel and Brigitte Pientka. 2016. Well-founded recursion with copatterns and sized types. J. Funct. Program. 26 (2016), e2.Google ScholarGoogle ScholarCross RefCross Ref
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thorsten Altenkirch, Conor McBride, and Wouter Swierstra. 2007. Observational Equality, Now!. In PLPV’07. Freiburg, Germany. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. Adam Chlipala. 2011. Certified Programming with Dependent Types. Vol. 20. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jesper Cockx. 2017. Dependent Pattern Matching and Proof-Relevant Unification. Ph.D. Dissertation. Katholieke Universiteit Leuven, Belgium. https://lirias.kuleuven.be/handle/123456789/583556Google ScholarGoogle Scholar
  11. Jesper Cockx and Andreas Abel. 2018. Elaborating dependent (co)pattern matching. PACMPL 2, ICFP (2018), 75:1–75:30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Thierry Coquand. 1992. Pattern Matching with Dependent Types. http://www.cs.chalmers.se/~coquand/pattern.ps Proceedings of the Workshop on Logical Frameworks.Google ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle Scholar
  19. 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 ScholarGoogle Scholar
  20. John Hughes, Lars Pareto, and Amr Sabry. 1996. Proving the correctness of reactive systems using sized types. In POPL, Vol. 96. 410–423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. Peter LeFanu Lumsdaine. 2010. Weak omega-categories from intensional type theory. Logical Methods in Computer Science 6, 3 (2010).Google ScholarGoogle Scholar
  24. Assia Mahboubi, Enrico Tassi, Yves Bertot, and Georges Gonthier. 2018. Mathematical Components.Google ScholarGoogle Scholar
  25. 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 ScholarGoogle ScholarCross RefCross Ref
  26. Per Martin-Löf. 1984. Intuitionistic type theory. Studies in Proof Theory, Vol. 1. Bibliopolis. iv+91 pages.Google ScholarGoogle Scholar
  27. Conor McBride. 1999. Dependently Typed Functional Programs and Their Proofs. Ph.D. Dissertation. University of Edinburgh. http://citeseer.ist.psu.edu/mcbride99dependently.htmlGoogle ScholarGoogle Scholar
  28. Conor McBride, Healfdene Goguen, and James McKinna. 2004. A Few Constructions on Constructors. Types for Proofs and Programs (2004), 186–200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Conor McBride and James McKinna. 2004. The view from the left. J. Funct. Program. 14, 1 (2004), 69–111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Jean-François Monin and Xiaomu Shi. 2013. Handcrafted Inversions Made Operational on Operational Semantics. Springer Berlin Heidelberg, Berlin, Heidelberg, 338–353.Google ScholarGoogle Scholar
  31. 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 ScholarGoogle Scholar
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle Scholar
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle Scholar
  37. Matthieu Sozeau. 2007. Program-ing Finger Trees in Coq. In ICFP’07. ACM Press, Freiburg, Germany, 13–24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Matthieu Sozeau. 2010. Equations: A Dependent Pattern-Matching Compiler. In First International Conference on Interactive Theorem Proving. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Matthieu Sozeau and Cyprien Mangin. 2019a. Equations Reloaded Accompanying Material. Available on the ACM DL.Google ScholarGoogle Scholar
  40. Matthieu Sozeau and Cyprien Mangin. 2019b. Equations v1.2.Google ScholarGoogle Scholar
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. Thomas Streicher. 1993. Semantical Investigations into Intensional Type Theory. Habilitationsschrift. LMU München.Google ScholarGoogle Scholar
  43. The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations for Mathematics. Institute for Advanced Study. http://homotopytypetheory.org/bookGoogle ScholarGoogle Scholar
  44. Benno van den Berg and Richard Garner. 2011. Types are weak ω-groupoids. Proceedings of the London Mathematical Society 102, 2 (2011), 370–394.Google ScholarGoogle ScholarCross RefCross Ref
  45. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  46. 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 ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Equations reloaded: high-level dependently-typed functional programming and proving in Coq

      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

      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!