skip to main content
research-article

Wellfounded recursion with copatterns: a unified approach to termination and productivity

Published:25 September 2013Publication History
Skip Abstract Section

Abstract

In this paper, we study strong normalization of a core language based on System F-omega which supports programming with finite and infinite structures. Building on our prior work, finite data such as finite lists and trees are defined via constructors and manipulated via pattern matching, while infinite data such as streams and infinite trees is defined by observations and synthesized via copattern matching. In this work, we take a type-based approach to strong normalization by tracking size information about finite and infinite data in the type. This guarantees compositionality. More importantly, the duality of pattern and copatterns provide a unifying semantic concept which allows us for the first time to elegantly and uniformly support both well-founded induction and coinduction by mere rewriting. The strong normalization proof is structured around Girard's reducibility candidates. As such our system allows for non-determinism and does not rely on coverage. Since System F-omega is general enough that it can be the target of compilation for the Calculus of Constructions, this work is a significant step towards representing observation-centric infinite data in proof assistants such as Coq and Agda.

References

  1. A. Abel. Polarized subtyping for sized types. Math. Struct. in Comput. Sci., 18: 797--822, 2008. Special issue on subtyping, edited by Healfdene Goguen and Adriana Compagnoni.Google ScholarGoogle ScholarCross RefCross Ref
  2. A. Abel. Semi-continuous sized types and termination. Logical Meth. in Comput. Sci., 4 (2:3): 1--33, 2008. CSL'06 special issue. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Abel. Type-based termination, inflationary fixed-points, and mixed inductive-coinductive types. Electr. Proc. in Theor. Comp. Sci., 77: 1--11, 2012. Proceedings of FICS 2012.Google ScholarGoogle ScholarCross RefCross Ref
  4. A. Abel and B. Pientka. Wellfounded recursion with copatterns: A unified approach to termination and productivity. URL http://www.tcs.ifi.lmu.de/ abel/icfp13-long.pdf. Extended version, 2013.Google ScholarGoogle Scholar
  5. A. Abel, B. Pientka, D. Thibodeau, and A. Setzer. Copatterns: Programming infinite structures by observations. In Proc. of the 40th ACM Symp. on Principles of Programming Languages, POPL 2013, pages 27--38. ACM Press, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. Altenkirch and N. A. Danielsson. Termination checking in the presence of nested inductive and coinductive types. Short note supporting a talk given at PAR 2010, Workshop on Partiality and Recursion in Interactive Theorem Provers, FLoC 2010, 2010. URL http://www.cse.chalmers.se/ nad/publications/altenkirch-danielsson-par2%010.pdf.Google ScholarGoogle Scholar
  7. R. M. Amadio and S. Coupet-Grimal. Analysis of a guard condition in type theory (extended abstract). In Proc. of the 1st Int. Conf. on Foundations of Software Science and Computation Structure, FoSSaCS'98, volume 1378 of Lect. Notes in Comput. Sci., pages 48--62. Springer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Barthe, M. J. Frade, E. Giménez, L. Pinto, and T. Uustalu. Type-based termination of recursive definitions. Math. Struct. in Comput. Sci., 14 (1): 97--141, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Barthe, B. Grégoire, and C. Riba. Type-based termination with sized products. In Computer Science Logic, 22nd Int. Wksh., CSL 2008, 17th Annual Conf. of the EACSL, volume 5213 of Lect. Notes in Comput. Sci., pages 493--507. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. F. Blanqui. A type-based termination criterion for dependently-typed higher-order rewrite systems. In Rewriting Techniques and Applications (RTA 2004), Aachen, Germany, volume 3091 of Lect. Notes in Comput. Sci., pages 24--39. Springer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  11. F. Blanqui and C. Riba. Combining typing and size constraints for checking the termination of higher-order conditional rewrite systems. In Proc. of the 13th Int. Conf. on Logic for Programming, Artificial Intelligence, and Reasoning, LPAR 2006, volume 4246 of Lect. Notes in Comput. Sci., pages 105--119. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Ghani, P. Hancock, and D. Pattinson. Representations of stream processors using nested fixed points. Logical Meth. in Comput. Sci., 5 (3), 2009.Google ScholarGoogle Scholar
  13. E. Giménez. Un Calcul de Constructions Infinies et son application a la vérification de systèmes communicants. PhD thesis, Ecole Normale Supérieure de Lyon, 1996. Thèse d'université.Google ScholarGoogle Scholar
  14. J.-Y. Girard, Y. Lafont, and P. Taylor. Proofs and Types, volume 7 of Cambridge Tracts in Theoret. Comput. Sci. Cambridge University Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Hughes, L. Pareto, and A. Sabry. Proving the correctness of reactive systems using sized types. In Proc. of the 23rd ACM Symp. on Principles of Programming Languages, POPL'96, pages 410--423, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. INRIA. The Coq Proof Assistant Reference Manual. INRIA, version 8.4 edition, 2012. URL http://coq.inria.fr/.Google ScholarGoogle Scholar
  17. U. Norell. Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Dept of Comput. Sci. and Engrg., Chalmers, Göteborg, Sweden, 2007.Google ScholarGoogle Scholar
  18. J. L. Sacchini. Type-based productivity of stream definitions in the calculus of constructions. In Logics in Computer Science (LICS 2013), June 25--28, 2013, New Orleans, 2013.Google ScholarGoogle Scholar
  19. B. A. Sijtsma. On the productivity of recursive list definitions. ACM Trans. Prog. Lang. Syst., 11 (4): 633--649, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Sprenger and M. Dam. On the structure of inductive reasoning: Circular and tree-shaped proofs in the μ-calculus. In Proc. of the 6th Int. Conf. on Foundations of Software Science and Computational Structures, FoSSaCS 2003, volume 2620 of Lect. Notes in Comput. Sci., pages 425--440. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Steffen. Polarized Higher-Order Subtyping. PhD thesis, Technische Fakultat, Universit\"at Erlangen, 1998.Google ScholarGoogle Scholar
  22. P. Taylor. Intuitionistic sets and ordinals. J. Symb. Logic, 61 (3): 705--744, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  23. J. Vouillon and P.-A. Melliès. Semantic types: A fresh look at the ideal model for types. In Proc. of the 31st ACM Symp. on Principles of Programming Languages, POPL 2004, pages 52--63. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Xi. Dependent types for program termination verification. J. Higher-Order and Symb. Comput., 15 (1): 91--131, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Wellfounded recursion with copatterns: a unified approach to termination and productivity

              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!