Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Fully abstract from static to gradual

Published: 04 January 2021 Publication History
  • Get Citation Alerts
  • Abstract

    What is a good gradual language? Siek et al. have previously proposed the refined criteria, a set of formal ideas that characterize a range of guarantees typically expected from a gradual language. While these go a long way, they are mostly focused on syntactic and type safety properties and fail to characterize how richer semantic properties and reasoning principles that hold in the static language, like non-interference or parametricity for instance, should be upheld in the gradualization.
    In this paper, we investigate and argue for a new criterion previously hinted at by Devriese et al.: the embedding from the static to the gradual language should be fully abstract. Rather than preserving an arbitrarily chosen interpretation of source language types, this criterion requires that all source language equivalences are preserved. We demonstrate that the criterion weeds out erroneous gradualizations that nevertheless satisfy the refined criteria. At the same time, we demonstrate that the criterion is realistic by reporting on a mechanized proof that the property holds for a standard example: GTLCµ, the natural gradualization of STLCµ, the simply typed lambda-calculus with equirecursive types. We argue thus that the criterion is useful for understanding, evaluating, and guiding the design of gradual languages, particularly those which are intended to preserve source language guarantees in a rich way.

    References

    [1]
    Martín Abadi. 1998. Protection in Programming-Language Translations: Mobile Object Systems. In European Conference on Object-Oriented Programming (Lecture Notes in Computer Science). Springer Berlin Heidelberg, 291-291. https: //doi.org/10.1007/3-540-49255-0_70
    [2]
    Martín Abadi. 1999. Protection in Programming-Language Translations. In Secure Internet Programming. Springer-Verlag. https://doi.org/10.1007/BFb0055109
    [3]
    Carmine Abate, Roberto Blanco, Deepak Garg, Catalin Hritcu, Marco Patrignani, and Jérémy Thibault. 2019. Journey Beyond Full Abstraction: Exploring Robust Property Preservation for Secure Compilation. In Computer Security Foundations Symposium. https://doi.org/10.1109/CSF. 2019.00025
    [4]
    Amal Ahmed, Robert Bruce Findler, Jeremy G. Siek, and Philip Wadler. 2011a. Blame for All. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Austin, Texas, USA) ( POPL '11). Association for Computing Machinery, New York, NY, USA, 201-214. https://doi.org/10.1145/1926385.1926409
    [5]
    Amal Ahmed, Dustin Jamner, Jeremy G. Siek, and Philip Wadler. 2017. Theorems for Free for Free: Parametricity, with and without Types. Proceedings of the ACM on Programming Languages 1, ICFP (Aug. 2017 ), 39 : 1-39 : 28. https: //doi.org/10.1145/3110283
    [6]
    Amal Ahmed, Lindsey Kuper, and Jacob Matthews. 2011b. Parametric polymorphism through run-time sealing, or, Theorems for low, low prices ! http://www.ccs.neu.edu/home/amal/papers/paramseal-tr.pdf
    [7]
    Andrew W Appel and David McAllester. 2001. An indexed model of recursive types for foundational proof-carrying code. ACM Transactions on Programming Languages and Systems (TOPLAS) 23, 5 ( 2001 ), 657-683. https://doi.org/10.1007/978-3-642-00590-9_1
    [8]
    Felipe Bañados Schwerter, Ronald Garcia, and Éric Tanter. 2014. A Theory of Gradual Efect Systems. In Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming (ICFP '14). Association for Computing Machinery, 283-295. https://doi.org/10.1145/2628136.2628149
    [9]
    Dominique Devriese, Marco Patrignani, and Frank Piessens. 2016. Fully-abstract compilation by approximate back-translation. In ACM SIGPLAN Notices, Vol. 51. ACM, 164-177. https://doi.org/10.1145/2837614.2837618
    [10]
    Dominique Devriese, Marco Patrignani, and Frank Piessens. 2017a. Parametricity versus the universal type. Proceedings of the ACM on Programming Languages 2, POPL ( 2017 ), 38. https://doi.org/10.1145/3158126
    [11]
    Dominique Devriese, Marco Patrignani, and Frank Piessens. 2020. Two Parametricities versus Three Universal Types. ( 2020 ). http://soft.vub.ac.be/~dodevrie/poly-seal-no-j-201910.pdf Submitted to the Journal of the ACM.
    [12]
    Dominique Devriese, Marco Patrignani, Frank Piessens, and Steven Keuchel. 2017b. Modular, Fully-Abstract Compilation by Approximate Back-Translation. Logical Methods in Computer Science 13, 4 lmcs:4011 (Oct. 2017 ). https://doi.org/10. 23638/LMCS-13 ( 4 :2) 2017 arXiv: 1703.09988 [cs.PL]
    [13]
    D. Dreyer, A. Ahmed, and L. Birkedal. 2009. Logical Step-Indexed Logical Relations. In 2009 24th Annual IEEE Symposium on Logic In Computer Science. 71-80. https://doi.org/10.1109/LICS. 2009.34
    [14]
    Dan Frumin, Robbert Krebbers, and Lars Birkedal. 2018. ReLoC: A mechanised relational logic for fine-grained concurrency. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science. 442-451. https://doi.org/10.1145/ 3209108.3209174
    [15]
    Ronald Garcia, Alison M Clark, and Éric Tanter. 2016. Abstracting gradual typing. In ACM SIGPLAN Notices, Vol. 51. ACM, 429-442. https://doi.org/10.1145/2914770.2837670
    [16]
    Ronald Garcia and Éric Tanter. 2015. Deriving a Simple Gradual Security Language. arXiv preprint arXiv:1511.01399 ( 2015 ).
    [17]
    Ronald Garcia and Éric Tanter. 2020. Gradual Typing as if Types Mattered. ( 2020 ). Workshop on Gradual Typing.
    [18]
    Michael Greenberg. 2019. The Dynamic Practice and Static Theory of Gradual Typing. In Summit on Advances in Programming Languages (SNAPL) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 136 ), Benjamin S. Lerner, Rastislav Bodík, and Shriram Krishnamurthi (Eds.). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 6 : 1-6 : 20. https://doi.org/10.4230/LIPIcs.SNAPL. 2019.6
    [19]
    Ben Greenman, Matthias Felleisen, and Christos Dimoulas. 2019. Complete Monitors for Gradual Types. Proceedings of the ACM on Programming Languages 3, OOPSLA (Oct. 2019 ), 122 : 1-122 : 29. https://doi.org/10.1145/3360548
    [20]
    Atsushi Igarashi, Peter Thiemann, Yuya Tsuda, Vasco T. Vasconcelos, and Philip Wadler. 2019. Gradual Session Types. Journal of Functional Programming 29 ( 2019 ). https://doi.org/10.1017/S0956796819000169
    [21]
    Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Aleš Bizjak, Lars Birkedal, and Derek Dreyer. 2018. Iris from the ground up: A modular foundation for higher-order concurrent separation logic. Journal of Functional Programming 28 ( 2018 ).
    [22]
    Jacob Matthews and Amal Ahmed. 2008. Parametric Polymorphism through Run-Time Sealing or, Theorems for Low, Low Prices! LNCS, Vol. 4960. 16-31. https://doi.org/10.1007/978-3-540-78739-6_2
    [23]
    Max S New, William J Bowman, and Amal Ahmed. 2016. Fully abstract compilation via universal embedding. In ACM SIGPLAN Notices, Vol. 51. ACM, 103-116. https://doi.org/10.1145/3022670.2951941
    [24]
    Max S. New, Dustin Jamner, and Amal Ahmed. 2019. Graduality and Parametricity: Together Again for the First Time. Proceedings of the ACM on Programming Languages 4, POPL (Dec. 2019 ), 46 : 1-46 : 32. https://doi.org/10.1145/3371114
    [25]
    Joachim Parrow. 2008. Expressiveness of Process Algebras. Elec. Not. Theo. Comp. Sci. 209, 0 ( 2008 ), 173-186. https: //doi.org/10.1016/j.entcs. 2008. 04.011
    [26]
    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, 2 (April 2015 ), 6 : 1-6 : 50. https://doi.org/10.1145/ 2699503
    [27]
    Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019a. Formal Approaches to Secure Compilation: A Survey of Fully Abstract Compilation and Related Work. ACM Comput. Surv. 51, 6 (Feb. 2019 ), 125 : 1-125 : 36. https://doi.org/10.1145/ 3280984
    [28]
    Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019b. Formal approaches to secure compilation: A survey of fully abstract compilation and related work. ACM Computing Surveys (CSUR) 51, 6 ( 2019 ), 1-36. https://doi.org/10.1145/3280984
    [29]
    J. C. Reynolds. 1983. Types, Abstraction, and Parametric Polymorphism. In Information Processing. North Holland, 513-523.
    [30]
    Ilya Sergey and Dave Clarke. 2012. Gradual Ownership Types. In Programming Languages and Systems. Springer, Berlin, Heidelberg, 579-599. https://doi.org/10.1007/978-3-642-28869-2_29
    [31]
    Jeremy Siek. 2019. GitHub-jsiek/gradual-typing-in-agda: Formalizations of Gradually Typed Languages in Agda. https: //github.com/jsiek/gradual-typing-in-agda. (Accessed on 10/18/ 2019 ).
    [32]
    Jeremy G Siek and Walid Taha. 2006. Gradual typing for functional languages. In Scheme and Functional Programming Workshop, Vol. 6. 81-92.
    [33]
    Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015. Refined Criteria for Gradual Typing. In 1st Summit on Advances in Programming Languages (SNAPL 2015 ) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 32 ), Thomas Ball, Rastislav Bodik, Shriram Krishnamurthi, Benjamin S. Lerner, and Greg Morrisett (Eds.). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 274-293. https://doi.org/10.4230/LIPIcs.SNAPL. 2015.274
    [34]
    Amin Timany and Lars Birkedal. 2019. Mechanized Relational Verification of Concurrent Programs with Continuations. Proc. ACM Program. Lang. 3, ICFP, Article 105 ( July 2019 ), 28 pages. https://doi.org/10.1145/3341709
    [35]
    Amin Timany, Robbert Krebbers, and Lars Birkedal. 2017a. Logical relations in Iris. In CoqPL, Date: 2017 /01/21-2017/01/21, Location: Paris.
    [36]
    Amin Timany, Léo Stefanesco, Morten Krogh-Jespersen, and Lars Birkedal. 2017b. A Logical Relation for Monadic Encapsulation of State: Proving Contextual Equivalences in the Presence of RunST. Proc. ACM Program. Lang. 2, POPL, Article 64 ( Dec. 2017 ), 28 pages. https://doi.org/10.1145/3158152
    [37]
    Sam Tobin-Hochstadt and Matthias Felleisen. 2008. The Design and Implementation of Typed Scheme. ACM SIGPLAN Notices 43, 1 (Jan. 2008 ), 395-406. https://doi.org/10.1145/1328897.1328486
    [38]
    Matías Toro, Ronald Garcia, and Éric Tanter. 2018. Type-Driven Gradual Security with References. ACM Trans. Program. Lang. Syst. 40, 4 (Dec. 2018 ), 16 : 1-16 : 55. https://doi.org/10.1145/3229061
    [39]
    Matías Toro, Elizabeth Labrada, and Éric Tanter. 2019. Gradual Parametricity, Revisited. Proc. ACM Program. Lang. 3, POPL (Jan. 2019 ), 17 : 1-17 : 30. https://doi.org/10.1145/3290330
    [40]
    Philip Wadler and Robert Bruce Findler. 2009. Well-typed programs can't be blamed. In European Symposium on Programming. Springer, 1-16.
    [41]
    A. K. Wright and M. Felleisen. 1994. A Syntactic Approach to Type Soundness. Information and Computation 115, 1 (Nov. 1994 ), 38-94. https://doi.org/10.1006/inco. 1994.1093

    Cited By

    View all
    • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
    • (2024)Trillium: Higher-Order Concurrent and Distributed Separation Logic for Intensional RefinementProceedings of the ACM on Programming Languages10.1145/36328518:POPL(241-272)Online publication date: 5-Jan-2024
    • (2022)Propositional equality for gradual dependently typed programmingProceedings of the ACM on Programming Languages10.1145/35476276:ICFP(165-193)Online publication date: 31-Aug-2022
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Proceedings of the ACM on Programming Languages
    Proceedings of the ACM on Programming Languages  Volume 5, Issue POPL
    January 2021
    1789 pages
    EISSN:2475-1421
    DOI:10.1145/3445980
    Issue’s Table of Contents
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 04 January 2021
    Published in PACMPL Volume 5, Issue POPL

    Permissions

    Request permissions for this article.

    Check for updates

    Badges

    Author Tags

    1. fully abstract compilation
    2. fully abstract embedding
    3. gradual typing

    Qualifiers

    • Research-article

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)109
    • Downloads (Last 6 weeks)24
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
    • (2024)Trillium: Higher-Order Concurrent and Distributed Separation Logic for Intensional RefinementProceedings of the ACM on Programming Languages10.1145/36328518:POPL(241-272)Online publication date: 5-Jan-2024
    • (2022)Propositional equality for gradual dependently typed programmingProceedings of the ACM on Programming Languages10.1145/35476276:ICFP(165-193)Online publication date: 31-Aug-2022
    • (2022)Two Parametricities Versus Three Universal TypesACM Transactions on Programming Languages and Systems10.1145/353965744:4(1-43)Online publication date: 31-Dec-2022
    • (2022)Purity of an ST monad: full abstraction by semantically typed back-translationProceedings of the ACM on Programming Languages10.1145/35273266:OOPSLA1(1-27)Online publication date: 29-Apr-2022
    • (2022)Plausible sealing for gradual parametricityProceedings of the ACM on Programming Languages10.1145/35273146:OOPSLA1(1-28)Online publication date: 8-Dec-2022
    • (2021)Label dependent lambda calculus and gradual typingProceedings of the ACM on Programming Languages10.1145/34854855:OOPSLA(1-29)Online publication date: 15-Oct-2021
    • (2021)Fully Abstract and Robust CompilationProgramming Languages and Systems10.1007/978-3-030-89051-3_6(83-101)Online publication date: 12-Oct-2021
    • (2020)Mac Lane’s Comparison Theorem for the Kleisli Construction Formalized in CoqMathematics in Computer Science10.1007/s11786-020-00450-814:3(533-549)Online publication date: 8-Feb-2020

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media