skip to main content
research-article
Open Access

On the semantic expressiveness of recursive types

Published:04 January 2021Publication History
Skip Abstract Section

Abstract

Recursive types extend the simply-typed lambda calculus (STLC) with the additional expressive power to enable diverging computation and to encode recursive data-types (e.g., lists). Two formulations of recursive types exist: iso-recursive and equi-recursive. The relative advantages of iso- and equi-recursion are well- studied when it comes to their impact on type-inference. However, the relative semantic expressiveness of the two formulations remains unclear so far. This paper studies the semantic expressiveness of STLC with iso- and equi-recursive types, proving that these formulations are equally expressive. In fact, we prove that they are both as expressive as STLC with only term-level recursion. We phrase these equi-expressiveness results in terms of full abstraction of three canonical compilers between these three languages (STLC with iso-, with equi-recursive types and with term-level recursion). Our choice of languages allows us to study expressiveness when interacting over both a simply-typed and a recursively-typed interface. The three proofs all rely on a typed version of a proof technique called approximate backtranslation. Together, our results show that there is no difference in semantic expressiveness between STLCs with iso- and equi-recursive types. In this paper, we focus on a simply-typed setting but we believe our results scale to more powerful type systems like System F.

References

  1. Amal Ahmed and Matthias Blume. 2008. Typed Closure Conversion Preserves Observational Equivalence. In International Conference on Functional Programming. ACM, 157-168.Google ScholarGoogle Scholar
  2. Amal Ahmed and Matthias Blume. 2011. An Equivalence-Preserving CPS Translation via Multi-Language Semantics. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming (Tokyo, Japan) ( ICFP '11). ACM, 431-444.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Andrew W. Appel and David McAllester. 2001. An Indexed Model of Recursive Types for Foundational Proof-carrying Code. ACM Trans. Program. Lang. Syst. 23, 5 (Sept. 2001 ), 657-683.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Nick Benton and Chung-Kil Hur. 2009. Biorthogonality, step-indexing and compiler correctness. SIGPLAN Not. 44, 97-108.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. William J. Bowman and Amal Ahmed. 2015. Noninterference for free. In ICFP. ACM.Google ScholarGoogle Scholar
  6. Yufei Cai, Paolo G. Giarrusso, and Klaus Ostermann. 2016. System F-omega with Equirecursive Types for Datatype-generic Programming. SIGPLAN Not. 51, 1 (Jan. 2016 ), 30-43.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dominique Devriese, Marco Patrignani, and Frank Piessens. 2016. Fully-abstract Compilation by Approximate Backtranslation. In Principles of Programming Languages. 164-177.Google ScholarGoogle Scholar
  8. Dominique Devriese, Marco Patrignani, Frank Piessens, and Steven Keuchel. 2017. Modular, Fully-abstract Compilation by Approximate Back-translation. Logical Methods in Computer Science Volume 13, Issue 4 (Oct. 2017 ).Google ScholarGoogle Scholar
  9. Matthias Felleisen. 1991. On the Expressive Power of Programming Languages. In Selected Papers from the Symposium on 3rd European Symposium on Programming (ESOP '90). Elsevier North-Holland, Inc., New York, NY, USA, 35-75.Google ScholarGoogle Scholar
  10. Cedric Fournet, Nikhil Swamy, Juan Chen, Pierre-Evariste Dagand, Pierre-Yves Strub, and Benjamin Livshits. 2013. Fully Abstract Compilation to JavaScript. In Principles of Programming Languages. ACM, 371-384.Google ScholarGoogle Scholar
  11. M. Gordon, R. Milner, and C. P. Wadsworth. 1979. Edinburgh LCF: A Mechanized Logic of Computation. Springer-Verlag, Berlin Heidelberg. https://doi.org/10.1007/3-540-09724-4 Google ScholarGoogle ScholarCross RefCross Ref
  12. Daniele Gorla and Uwe Nestmann. 2016. Full abstraction for expressiveness: history, myths and facts. Mathematical Structures in Computer Science 26, 4 ( 2016 ), 639-654.Google ScholarGoogle Scholar
  13. Robert Harper and John C. Mitchell. 1993. On the Type Structure of Standard ML. ACM Transactions on Programming Languages and Systems 15, 2 (April 1993 ), 211-252. https://doi.org/10.1145/169701.169696 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Chung-Kil Hur and Derek Dreyer. 2011. A Kripke Logical Relation Between ML and Assembly. In Principles of Programming Languages. 133-146.Google ScholarGoogle Scholar
  15. Hyeonseung Im, Keiko Nakata, and Sungwoo Park. 2013. Contractive Signatures with Recursive Types, Type Parameters, and Abstract Types. In Automata, Languages, and Programming, Fedor V. Fomin, Ru¯sin¸š Freivalds, Marta Kwiatkowska, and David Peleg (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 299-311.Google ScholarGoogle Scholar
  16. Andrew Kennedy. 2006. Securing the. NET Programming Model. Theoretical Computer Science 364 ( 2006 ), 311-317.Google ScholarGoogle Scholar
  17. David MacQueen, Gordon Plotkin, and Ravi Sethi. 1984. An Ideal Model for Recursive Polymorphic Types. In Proceedings of the 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (Salt Lake City, Utah, USA) ( POPL '84). Association for Computing Machinery, New York, NY, USA, 165-174. https://doi.org/10.1145/800017.800528 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. David MacQueen, Gordon Plotkin, and Ravi Sethi. 1986. An ideal model for recursive polymorphic types. Information and Control 71, 1 ( 1986 ), 95-130.Google ScholarGoogle Scholar
  19. Robin Milner. 1977. Fully abstract models of typed λ-calculi. Theoretical Computer Science 4, 1 ( 1977 ), 1-22.Google ScholarGoogle Scholar
  20. John C. Mitchell. 1993. On abstraction and the expressive power of programming languages. Science of Computer Programming 21, 2 ( 1993 ), 141-163.Google ScholarGoogle Scholar
  21. James H. Morris. 1968. Lambda-Calculus Models of Programming Languages. Ph.D. Dissertation. Massachusetts Institute of Technology.Google ScholarGoogle Scholar
  22. Max S. New, William J. Bowman, and Amal Ahmed. 2016. Fully Abstract Compilation via Universal Embedding. In International Conference on Functional Programming. ACM, 103-116.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Joachim Parrow. 2008. Expressiveness of Process Algebras. Elec. Not. Theo. Comp. Sci. 209, 0 ( 2008 ), 173-186.Google ScholarGoogle Scholar
  24. Marco Patrignani. 2020. Why Should Anyone use Colours? or, Syntax Highlighting Beyond Code Snippets. CoRR abs/ 2001.11334.Google ScholarGoogle Scholar
  25. Marco Patrignani, Pieter Agten, Raoul Strackx, Bart Jacobs, Dave Clarke, and Frank Piessens. 2015. Secure Compilation to Protected Module Architectures. ACM Trans. Program. Lang. Syst. 37, Article 6 ( April 2015 ), 6 : 1-6 :50 pages.Google ScholarGoogle Scholar
  26. Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019. Formal Approaches to Secure Compilation A Survey of Fully Abstract Compilation and Related Work. ACM Comput. Surv. 51, 6, Article 125 ( Jan. 2019 ), 36 pages.Google ScholarGoogle Scholar
  27. Marco Patrignani, Eric Mark Martin, and Dominique Devriese. 2020. On the Semantic Expressiveness of Recursive Types. arXiv: 2010. 10859 [cs.PL]Google ScholarGoogle Scholar
  28. Benjamin Pierce. 2002. Types and Programming Languages. MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Gordon D. Plotkin. 1977. LCF Considered as a Programming Language. Theoretical Computer Science 5 ( 1977 ), 223-255.Google ScholarGoogle Scholar
  30. Dipanwita Sarkar, Oscar Waddell, and R. Kent Dybvig. 2004. A Nanopass Infrastructure for Compiler Education. ACM SIGPLAN Notices 39, 9 (Sept. 2004 ), 201-212. https://doi.org/10.1145/1016848.1016878 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Manfred Schmidt-Schauß, David Sabel, Joachim Niehren, and Jan Schwinghammer. 2015. Observational program calculi and the correctness of translations. Theoretical Computer Science 577 ( 2015 ), 98-124.Google ScholarGoogle Scholar
  32. Lau Skorstengaard, Dominique Devriese, and Lars Birkedal. 2019. StkTokens: Enforcing Well-Bracketed Control Flow and Stack Encapsulation Using Linear Capabilities. Proc. ACM Program. Lang. 3, POPL (Jan. 2019 ), 19 : 1-19 : 28.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Pawel Urzyczyn. 1995. Positive Recursive Type Assignment. In Proceedings of the 20th International Symposium on Mathematical Foundations of Computer Science (MFCS '95). Springer-Verlag, Berlin, Heidelberg, 382-391.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Thomas Van Strydonck, Frank Piessens, and Dominique Devriese. 2019. Linear Capabilities for Fully Abstract Compilation of Separation-Logic-Verified Code. Proc. ACM Program. Lang. ICFP ( 2019 ).Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On the semantic expressiveness of recursive types

        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!