skip to main content
research-article
Free Access

A capability calculus for concurrency and determinism

Published:04 September 2008Publication History
Skip Abstract Section

Abstract

This article presents a static system for checking determinism (technically, partial confluence) of communicating concurrent processes. Our approach automatically detects partial confluence in programs communicating via a mix of different kinds of communication methods: rendezvous channels, buffered channels, broadcast channels, and reference cells. Our system reduces the partial confluence checking problem in polynomial time (in the size of the program) to the problem of solving a system of rational linear inequalities, and is thus efficient.

References

  1. Aiken, A. and Gay, D. 1998. Barrier inference. In Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 342--354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Blom, S. and van de Pol, J. 2002. State space reduction by proving confluence. In Proceedings of the 14th International Conference on Computer Aided Verification. 596--609. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Boudol, G. 1992. Asynchrony and the pi-calculus. Tech. rep. 1702, INRIA Sophia Antipolis.Google ScholarGoogle Scholar
  4. Boyland, J. 2003. Checking interference with fractional permissions. In Proceedings of the 10th International Symposium on Static Ananysis. 55--72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Coates, W. S., Lexau, J. K., Jones, I. W., Fairbanks, S. M., and Sutherland, I. E. 2001. Fleetzero: An asynchronous switching experiment. In Proceedings of the 7th International Symposium on Advanced Research in Asynchronous Circuits and Systems (ASYNC'01). IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Crary, K., Walker, D., and Morrisett, G. 1999. Typed memory management in a calculus of capabilities. In Proceedings of the 26th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 262--275. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. DeLine, R. and Fähndrich, M. 2001. Enforcing High-Level Protocols in Low-Level Software. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 1, 59--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Edwards, S. A. and Tardieu, O. 2005. Shim: a deterministic model for heterogeneous embedded systems. In Proceedings of the 5th ACM International Conference On Embedded Software. 264--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Foster, J. S., Terauchi, T., and Aiken, A. 2002. Flow-sensitive type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Gordon, A. D. and Jeffrey, A. 2001. Typing correspondence assertions for communication protocols. Theor. Comput. Sci. 45. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Gordon, A. D. and Jeffrey, A. 2002. Types and Effects for Asymmetric Cryptographic Protocols. IEEE Computer Society.Google ScholarGoogle Scholar
  12. Groote, J. F. and van de Pol, J. 2000. State space reduction using partial tau-confluence. In Proceedings of 25th International Symposium on the Mathematical Foundations of Computer Science. 383--393. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hansen, H. and Valmari, A. 2006. Operational determinism and fast algorithms. In Concurrency Theory, 17th International Conference (CONCUR'06). Vol. 4137. Springer, 188--202. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Honda, K. and Tokoro, M. 1992. On asynchronous communication semantics. In Proceedings of the European Conference on Object-Oriented Programming Workshop on Object-Based Concurrent Computing. Springer-Verlag, 21--51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Igarashi, A. and Kobayashi, N. 2004. A generic type system for the pi-calculus. Theor. Comput. Sci. 311, 1-3, 121--163. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Kahn, G. 1974. The semantics of a simple language for parallel programming In Information Processing. Stockholm, Sweden, 471--475.Google ScholarGoogle Scholar
  17. Kobayashi, N. 2007. Personal communication.Google ScholarGoogle Scholar
  18. Kobayashi, N., Nakade, M., and Yonezawa, A. 1995. Static analysis of communication for asynchronous concurrent programming languages. In Proceedings of the 2nd International Symposium on Static Analysis. Glasgow, Scotland, 225--242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Kobayashi, N., Pierce, B. C., and Turner, D. N. 1999. Linearity and the pi-calculus. ACM Trans. Program. Lang. Syst. 21, 5, 914--947. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. König, B. 2000. Analysing input/output-capabilities of mobile processes with a generic type system. In Proceedings of the 27th International Colloquium on Automata, Languages and Programming. 403--414. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Lee, E. A. 2006. The problem with threads. Tech. rep. UCB/EECS-2006-1, EECS Department, University of California, Berkeley.Google ScholarGoogle Scholar
  22. Megacz, A. 2006. CCCD implementation. http://research.cs.berkeley.edu/project/cccd-impl/README.Google ScholarGoogle Scholar
  23. Nestmann, U. and Steffen, M. 1997. Typing confluence. In Proceedings of FMICS '97. 77--101.Google ScholarGoogle Scholar
  24. Smith, F., Walker, D., and Morrisett, G. 2000. Alias Types. In Proceedings of the 9th European Symposium on Programming, G. Smolka, Ed. Lecture Notes in Computer Science, vol. 1782. Springer-Verlag, Berlin, Germany, 366--381. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Sutter, H. and Larus, J. 2005. Software and the concurrency revolution. Queue 3, 7, 54--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Terauchi, T. and Aiken, A. 2005. Witnessing side-effects. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming. ACM, 105--115. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Terauchi, T. and Aiken, A. 2006. A capability calculus for concurrency and determinism. In Concurrency Theory, 17th International Conference (CONCUR'06). Vol. 4137. Springer, Bonn, Germany, 218--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Walker, D. and Morrisett, G. 2000. Alias types for recursive data structures. In Proceedings of the International Workshop on Types in Compilation. Montreal, Canada. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Wang, X. and Kwiatkowska, M. 2006. Compositional state space reduction using untangled actions. In Proceedings of the 13th International Workshop on Expressiveness in Concurrency (EXPRESS'06). 16--28.Google ScholarGoogle Scholar
  30. Yoshida, N., Berger, M., and Honda, K. 2004. Strong normalisation in the pi-calculus. Inform. Comput. 191, 2, 145--202. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A capability calculus for concurrency and determinism

      Recommendations

      Reviews

      Wolfgang Schreiner

      One of the most difficult aspects of concurrent programs is their nondeterminism: since such programs consist of asynchronously executing processes, different runs may yield different results. This paper introduces a calculus that rules out nondeterministic program behaviors by the concept of "capabilities." A capability is the right of a process to read from a specific communication channel, and respectively write to it. A process' ownership (fractions) of capabilities is modeled by mapping every capability to a rational number from 0 to 1. A communication operation is only allowed if both processes have the necessary capabilities on the corresponding channel; by performing the operation, capabilities can be transferred. The central theorem of the paper states that a program is deterministic if every execution obeys some capability-respecting discipline. The existence of such a discipline can be ensured by an approximated (static) version of the calculus, which is implemented by mapping the program to a system of rational linear inequalities; if this system has a solution, the program is deterministic. The main ideas are clearly presented at an appropriate level of detail. Only the translation of the static calculus into a linear programming problem is informally sketched; here, a more comprehensive treatment would have been desirable. Further work is needed to deal with the impreciseness of the static calculus (which may reject some deterministic programs). Also, the requirement that a program must be fully deterministic seems to be too strict in practice; further extensions might allow "harmless" forms of nondeterminism. Online Computing Reviews Service

      Access critical reviews of Computing literature here

      Become a reviewer for Computing Reviews.

      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

      • Published in

        cover image ACM Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 30, Issue 5
        August 2008
        193 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/1387673
        Issue’s Table of Contents

        Copyright © 2008 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 4 September 2008
        • Accepted: 1 November 2007
        • Revised: 1 October 2007
        • Received: 1 September 2007
        Published in toplas Volume 30, Issue 5

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      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!