[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Parallel complexity analysis with temporal session types

Published: 30 July 2018 Publication History

Abstract

We study the problem of parametric parallel complexity analysis of concurrent, message-passing programs. To make the analysis local and compositional, it is based on a conservative extension of binary session types, which structure the type and direction of communication between processes and stand in a Curry-Howard correspondence with intuitionistic linear logic. The main innovation is to enrich session types with the temporal modalities next (◯ A), always (□ A), and eventually (◇ A), to additionally prescribe the timing of the exchanged messages in a way that is precise yet flexible. The resulting temporal session types uniformly express properties such as the message rate of a stream, the latency of a pipeline, the response time of a concurrent queue, or the span of a fork/join parallel program. The analysis is parametric in the cost model and the presentation focuses on communication cost as a concrete example. The soundness of the analysis is established by proofs of progress and type preservation using a timed multiset rewriting semantics. Representative examples illustrate the scope and usability of the approach.

Supplementary Material

WEBM File (a91-das.webm)

References

[1]
Elvira Albert, Jesús Correas, Einar Broch Johnsen, and Guillermo Román-Díez. 2015. Parallel Cost Analysis of Distributed Systems. In Static Analysis, Sandrine Blazy and Thomas Jensen (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 275–292.
[2]
Martin Avanzini, Ugo Dal Lago, and Georg Moser. 2015. Analysing the Complexity of Functional Programs: Higher-Order Meets First-Order. In 29th Int. Conf. on Functional Programming (ICFP’15).
[3]
Stephanie Balzer and Frank Pfenning. 2017. Manifest Sharing with Session Types. In International Conference on Functional Programming (ICFP). ACM, 37:1–37:29.
[4]
Gérard Berry and Georges Gonthier. 1992. The ESTEREL Synchronous Programming Language: Design, Semantics, Implementation. Sci. Comput. Program. 19, 2 (Nov. 1992), 87–152.
[5]
Guy E. Blelloch and Margaret Reid-Miller. 1997. Pipelining with Futures. In Proceedings of the Ninth Annual ACM Symposium on Parallel Algorithms and Architectures (SPAA ’97). ACM, New York, NY, USA, 249–259.
[6]
Laura Bocchi, Weizhen Yang, and Nobuko Yoshida. 2014. Timed Multiparty Session Types. In CONCUR 2014 – Concurrency Theory, Paolo Baldan and Daniele Gorla (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 419–434.
[7]
Luís Caires, Jorge A. Pérez, Frank Pfenning, and Bernardo Toninho. 2013. Behavioral Polymorphism and Parametricity in Session-Based Communication. In Proceedings of the European Symposium on Programming (ESOP’13), M.Felleisen and P.Gardner (Eds.). Springer LNCS 7792, Rome, Italy, 330–349.
[8]
Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In Proceedings of the 21st International Conference on Concurrency Theory (CONCUR 2010). Springer LNCS 6269, Paris, France, 222–236.
[9]
Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear Logic Propositions as Session Types. Mathematical Structures in Computer Science 26, 3 (2016), 367–423.
[10]
Iliano Cervesato and Andre Scedrov. 2009. Relating State-Based and Process-Based Concurrency through Linear Logic. Information and Computation 207, 10 (Oct. 2009), 1044–1077.
[11]
Norman Danner, Daniel R. Licata, and Ramyaa Ramyaa. 2015. Denotational Cost Semantics for Functional Languages with Inductive Types. In 29th Int. Conf. on Functional Programming (ICFP’15).
[12]
Ankush Das, Jan Hoffmann, and Frank Pfenning. 2017. Work Analysis with Resource-Aware Session Types. CoRR abs/1712.08310 (2017). arXiv: 1712.08310 http://arxiv.org/abs/1712.08310
[13]
Rowan Davies. 1996. A Temporal Logic Approach to Binding-Time Analysis. In Proceedings of the Eleventh Annual Symposium on Logic in Computer Science, E. Clarke (Ed.). IEEE Computer Society Press, New Brunswick, New Jersey, 184–195. http://www.cs.cmu.edu/afs/cs/user/rowan/www/papers/multbta.ps.Z
[14]
Nicolas Feltman, Carlo Angiuli, Umut Acar, and Kayvon Fatahalian. 2016. Automatically Splitting a Two-Stage Lambda Calculus. In Proceedings of the 25th European Symposium on Programming (ESOP), P. Thiemann (Ed.). Springer LNCS 9632, Eindhoven, The Netherlands, 255–281.
[15]
Jérôme Fortier and Luigi Santocanale. 2013. Cuts for Circular Proofs: Semantics and Cut Elimination. In 22nd Conference on Computer Science Logic (LIPIcs), Vol. 23. 248–262.
[16]
Simon J. Gay and Malcolm Hole. 2005. Subtyping for Session Types in the π -Calculus. Acta Informatica 42, 2–3 (2005), 191–225.
[17]
Dan R. Ghica and Alex I. Smith. 2014. Bounded Linear Types in a Resource Semiring. In Proceedings of the 23rd European Symposium on Programming Languages and Systems - Volume 8410. Springer-Verlag New York, Inc., New York, NY, USA, 331–350.
[18]
Stéphane Gimenez and Georg Moser. 2016. The Complexity of Interaction. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’16). ACM, New York, NY, USA, 243–255.
[19]
Dennis Griffith. 2016. Polarized Substructural Session Types. Ph.D. Dissertation. University of Illinois at Urbana-Champaign.
[20]
Dennis Griffith and Elsa L. Gunter. 2013. Liquid Pi: Inferrable Dependent Session Types. In Proceedings of the NASA Formal Methods Symposium. Springer LNCS 7871, 186–197.
[21]
Sumit Gulwani, Krishna K. Mehra, and Trishul M. Chilimbi. 2009. SPEED: Precise and Efficient Static Estimation of Program Computational Complexity. In 36th ACM Symp. on Principles of Prog. Langs. (POPL’09). 127–139.
[22]
N. Halbwachs, P. Caspi, P. Raymond, and D. Pilaud. 1991. The synchronous data flow programming language LUSTRE. Proc. IEEE 79, 9 (Sep 1991), 1305–1320.
[23]
Robert H. Halstead, Jr. 1985. MULTILISP: A Language for Concurrent Symbolic Computation. ACM Trans. Program. Lang. Syst. 7, 4 (Oct. 1985), 501–538.
[24]
Jan Hoffmann, Ankush Das, and Shu-Chun Weng. 2017. Towards Automatic Resource Bound Analysis for OCaml. In 44th Symposium on Principles of Programming Languages (POPL’17).
[25]
Jan Hoffmann and Zhong Shao. 2015. Automatic Static Cost Analysis for Parallel Programs. In Proceedings of the 24th European Symposium on Programming on Programming Languages and Systems - Volume 9032. Springer-Verlag New York, Inc., New York, NY, USA, 132–157.
[26]
Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. 1998. Language Primitives and Type Discipline for Structured Communication-Based Programming. In 7th European Symposium on Programming Languages and Systems (ESOP’98). Springer LNCS 1381, 122–138.
[27]
Naoki Kobayashi. 2002. A Type System for Lock-Free Processes. Information and Computation 177 (2002), 122–159.
[28]
Neelakantan R. Krishnaswami and Nick Benton. 2011. Ultrametric Semantics of Reactive Programs. In 26th IEEE Symposium on Logic in Computer Science, (LICS’11). 257–266.
[29]
Ugo Dal Lago and Marco Gaboardi. 2011. Linear Dependent Types and Relative Completeness. In 26th IEEE Symp. on Logic in Computer Science (LICS’11). 133–142.
[30]
Julien Lange and Nobuko Yoshida. 2017. On the Undecidability of Asynchronous Session Subtyping. In Proceedings of the 20th International Conference on Foundations of Software Science and Computation Structures (FoSSaCS). Springer LNCS 10203, 441–457.
[31]
Hugo A. López, Carlos Olarte, and Jorge A. Pérez. 2009. Towards a Unified Framework for Declarative Structure Communications. In Proceedings of the Workshop on Programming Language Approaches to Concurrency and Communication-Centric Software (PLACES), A. Beresford and S. Gay (Eds.). EPTCS 17, 1–15.
[32]
Hiroshi Nakano. 2000. A Modality for Recursion. In 15th IEEE Symposium on Logic in Computer Science (LICS’00). 255–266.
[33]
Rumyana Neykova, Laura Bocchi, and Nobuko Yoshida. 2014. Timed Runtime Monitoring for Multiparty Conversations. In 3rd International Workshop on Behavioural Types (BEAT 2014).
[34]
W. Paul, U. Vishkin, and H. Wagener. 1983. Parallel dictionaries on 2–3 trees. In Automata, Languages and Programming, Josep Diaz (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 597–609.
[35]
Frank Pfenning and Dennis Griffith. 2015. Polarized Substructural Session Types. In Proceedings of the 18th International Conference on Foundations of Software Science and Computation Structures (FoSSaCS 2015), A. Pitts (Ed.). Springer LNCS 9034, London, England, 3–22. Invited talk.
[36]
Amir Pnueli. 1977. The Temporal Logic of Programs. In Proceedings of the 18th Symposium on Foundations of Computer Science (FOCS’77). IEEE Computer Society, 46–57.
[37]
Marc Pouzet. 2006. Lucid Synchrone Release, version 3.0 Tutorial and Reference Manual. (2006).
[38]
Neda Saeedloei and Gopal Gupta. 2014. Timed π -Calculus. In 8th International Symposium on Trustworthy Global Computing - Volume 8358 (TGC 2013). Springer-Verlag New York, Inc., New York, NY, USA, 119–135.
[39]
Miguel Silva, Mário Florido, and Frank Pfenning. 2016. Non-Blocking Concurrent Imperative Programming with Session Types. In Fourth International Workshop on Linearity.
[40]
Bernardo Toninho, Luís Caires, and Frank Pfenning. 2013. Higher-Order Processes, Functions, and Sessions: A Monadic Integration. In Proceedings of the European Symposium on Programming (ESOP’13), M.Felleisen and P.Gardner (Eds.). Springer LNCS 7792, Rome, Italy, 350–369.
[41]
Bernardo Toninho, Luís Caires, and Frank Pfenning. 2014. Corecursion and Non-Divergence in Session-Typed Processes. In Proceedings of the 9th International Symposium on Trustworthy Global Computing (TGC 2014), M. Maffei and E. Tuosto (Eds.). Springer LNCS 8902, Rome, Italy, 159–175.
[42]
Philip Wadler. 2012. Propositions as Sessions. In Proceedings of the 17th International Conference on Functional Programming (ICFP 2012). ACM Press, Copenhagen, Denmark, 273–286.
[43]
Ezgi Çiçek, Gilles Barthe, Marco Gaboardi, Deepak Garg, and Jan Hoffmann. 2017. Relational Cost Analysis. In 44th Symposium on Principles of Programming Languages (POPL’17).

Cited By

View all
  • (2025)Semantic Logical Relations for Timed Message-Passing ProtocolsProceedings of the ACM on Programming Languages10.1145/37048959:POPL(1750-1781)Online publication date: 9-Jan-2025
  • (2025)Flexible Type-Based Resource Estimation in Quantum Circuit Description LanguagesProceedings of the ACM on Programming Languages10.1145/37048839:POPL(1386-1416)Online publication date: 9-Jan-2025
  • (2023)Validating IoT Devices with Rate-Based Session TypesProceedings of the ACM on Programming Languages10.1145/36228547:OOPSLA2(1589-1617)Online publication date: 16-Oct-2023
  • Show More Cited By

Index Terms

  1. Parallel complexity analysis with temporal session types

        Recommendations

        Comments

        Please enable JavaScript to view thecomments powered by Disqus.

        Information & Contributors

        Information

        Published In

        cover image Proceedings of the ACM on Programming Languages
        Proceedings of the ACM on Programming Languages  Volume 2, Issue ICFP
        September 2018
        1133 pages
        EISSN:2475-1421
        DOI:10.1145/3243631
        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: 30 July 2018
        Published in PACMPL Volume 2, Issue ICFP

        Permissions

        Request permissions for this article.

        Check for updates

        Author Tags

        1. Concurrency
        2. Linear logic
        3. Resource analysis
        4. Session Types

        Qualifiers

        • Research-article

        Contributors

        Other Metrics

        Bibliometrics & Citations

        Bibliometrics

        Article Metrics

        • Downloads (Last 12 months)90
        • Downloads (Last 6 weeks)15
        Reflects downloads up to 02 Mar 2025

        Other Metrics

        Citations

        Cited By

        View all
        • (2025)Semantic Logical Relations for Timed Message-Passing ProtocolsProceedings of the ACM on Programming Languages10.1145/37048959:POPL(1750-1781)Online publication date: 9-Jan-2025
        • (2025)Flexible Type-Based Resource Estimation in Quantum Circuit Description LanguagesProceedings of the ACM on Programming Languages10.1145/37048839:POPL(1386-1416)Online publication date: 9-Jan-2025
        • (2023)Validating IoT Devices with Rate-Based Session TypesProceedings of the ACM on Programming Languages10.1145/36228547:OOPSLA2(1589-1617)Online publication date: 16-Oct-2023
        • (2023)Intuitionistic Metric Temporal LogicProceedings of the 25th International Symposium on Principles and Practice of Declarative Programming10.1145/3610612.3610621(1-13)Online publication date: 22-Oct-2023
        • (2023)Modular Hardware Design with Timeline TypesProceedings of the ACM on Programming Languages10.1145/35912347:PLDI(343-367)Online publication date: 6-Jun-2023
        • (2023)Comparing perfomance abstractions for collective adaptive systemsInternational Journal on Software Tools for Technology Transfer (STTT)10.1007/s10009-023-00728-925:5-6(785-798)Online publication date: 1-Dec-2023
        • (2022)Nested Session TypesACM Transactions on Programming Languages and Systems10.1145/353965644:3(1-45)Online publication date: 15-Jul-2022
        • (2022)A cost-aware logical frameworkProceedings of the ACM on Programming Languages10.1145/34986706:POPL(1-31)Online publication date: 12-Jan-2022
        • (2022)Types for Complexity of Parallel Computation in Pi-calculusACM Transactions on Programming Languages and Systems10.1145/349552944:3(1-50)Online publication date: 15-Jul-2022
        • (2022)On Model-Based Performance Analysis of Collective Adaptive SystemsLeveraging Applications of Formal Methods, Verification and Validation. Adaptation and Learning10.1007/978-3-031-19759-8_17(266-282)Online publication date: 17-Oct-2022
        • Show More Cited By

        View Options

        View options

        PDF

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        Login options

        Full Access

        Figures

        Tables

        Media

        Share

        Share

        Share this Publication link

        Share on social media