Semantics, Logics, and Calculi pp 1-32

Part of the Lecture Notes in Computer Science book series (LNCS, volume 9560)

Effect Systems Revisited—Control-Flow Algebra and Semantics

Chapter

Abstract

Effect systems were originally conceived as an inference-based program analysis to capture program behaviour—as a set of (representations of) effects. Two orthogonal developments have since happened. First, motivated by static analysis, effects were generalised to values in an algebra, to better model control flow (e.g. for may/must analyses and concurrency). Second, motivated by semantic questions, the syntactic notion of set- (or semilattice-) based effect system was linked to the semantic notion of monads and more recently to graded monads which give a more precise semantic account of effects.

We give a lightweight tutorial explanation of the concepts involved in these two threads and then unify them via the notion of an effect-directed semantics for a control-flow algebra of effects. For the case of effectful programming with sequencing, alternation and parallelism—illustrated with music—we identify a form of graded joinads as the appropriate structure for unifying effect analysis and semantics.

References

  1. 1.
    Aaron, S., Orchard, D., Blackwell, A.F.: Temporal semantics for a live coding language. In: Proceeding 2nd ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design, pp. 37–47. ACM (2014)Google Scholar
  2. 2.
    Amtoft, T., Nielson, F., Nielson, H.: Type and Effect Systems Behaviours for Concurrency. Imperial College Press (1999)Google Scholar
  3. 3.
    Atkey, R.: Parameterised notions of computation. Cambridge University Press. In: Proceedings of MSFP (2006)Google Scholar
  4. 4.
    Benton, N., Kennedy, A., Hofmann, M.O., Beringer, L.: Reading, writing and relations. In: Kobayashi, N. (ed.) APLAS 2006. LNCS, vol. 4279, pp. 114–130. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Brunel, A., Gaboardi, M., Mazza, D., Zdancewic, S.: A core quantitative coeffect calculus. In: Shao, Z. (ed.) ESOP 2014 (ETAPS). LNCS, vol. 8410, pp. 351–370. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  6. 6.
    Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Proceedings of POPL, pp. 238–252. ACM (1977)Google Scholar
  7. 7.
    Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: Proceedings of PLDI 2003. ACM (2003)Google Scholar
  8. 8.
    Ghica, D.R., Smith, A.I.: Bounded linear types in a resource semiring. In: Shao, Z. (ed.) ESOP 2014 (ETAPS). LNCS, vol. 8410, pp. 331–350. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  9. 9.
    Gifford, D.K., Lucassen, J.M.: Integrating functional and imperative programming. In: Proceedings of Conference on LISP and Functional Programming, LFP 1986 (1986)Google Scholar
  10. 10.
    Goncharov, S., Schröder, L., Mossakowski, T.: Kleene monads: handling iteration in a framework of generic effects. In: Kurz, A., Lenisa, M., Tarlecki, A. (eds.) CALCO 2009. LNCS, vol. 5728, pp. 18–33. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  11. 11.
    Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type discipline for structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, pp. 122–138. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  12. 12.
    Jouvelot, P., Gifford, D.K.: Communication Effects for Message-Based Concurrency. Technical report, Massachusetts Institute of Technology (1989)Google Scholar
  13. 13.
    Jouvelot, P., Gifford, D.K.: Reasoning about continuations with control effects. In: Proceedings of PLDI 1989. ACM (1989)Google Scholar
  14. 14.
    Kammar, O.: Algebraic theory of type-and-effect systems, Ph.D. dissertation. The University of Edinburgh (2014)Google Scholar
  15. 15.
    Kammar, O., Plotkin, G.D.: Algebraic foundations for effect-dependent optimisations. In: Proceedings of POPL 2012, pp. 349–360. ACM (2012)Google Scholar
  16. 16.
    Katsumata, S.: Parametric effect monads and semantics of effect systems. In: Proceedings of POPL 2014, pp. 633–645. ACM (2014)Google Scholar
  17. 17.
    Kiselyov, O., Shan, C.C., Friedman, D.P., Sabry, A.: Backtracking, interleaving, and terminating monad transformers (functional pearl). In: Proceedings of ICFP 2005, pp. 192–203. ACM (2005)Google Scholar
  18. 18.
    Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 47–57. ACM (1988)Google Scholar
  19. 19.
    Madhavapeddy, A., Mortier, R., Rotsos, C., Scott, D., Singh, B., Gazagnaire, T., Smith, S., Hand, S., Crowcroft, J.: Unikernels: library operating systems for the cloud. SIGPLAN Not. 48(4), 461–472 (2013)CrossRefGoogle Scholar
  20. 20.
    Mellies, P.A.: Parametric monads and enriched adjunctions (2012) http://www.pps.univ-paris-diderot.fr/mellies/tensorial-logic.html
  21. 21.
    Milius, S., Pattinson, D., Schröder, L.: Generic trace semantics and graded monads. In: Proceedings of 6th International Conference in Algebra and Coalgebra in Computer Science (2015)Google Scholar
  22. 22.
    Milner, R.: Communication and Concurrency, vol. 84. Prentice Hall, New York (1989)MATHGoogle Scholar
  23. 23.
    Moggi, E.: Computational lambda-calculus and monads. In: Fourth Annual Symposium on Logic in Computer Science, pp. 14–23. IEEE (1989)Google Scholar
  24. 24.
    Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991)MATHMathSciNetCrossRefGoogle Scholar
  25. 25.
    Nielson, F., Cousot, P., Dam, M., Degan, P., Jouvelot, P., Mycroft, A., Thomsen, B.: Logical and operational methods in the analysis of programs and systems. In: Dam, M. (ed.) LOMAPS-WS 1996. LNCS, vol. 1192, pp. 1–12. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  26. 26.
    Nielson, F., Riis Nielson, H.: Type and Effect Systems. In: Olderog, E.-R., Steffen, B. (eds.) Correct System Design. LNCS, vol. 1710, pp. 114–136. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  27. 27.
    Orchard, D., Petricek, T.: Embedding effect systems in Haskell. In: Proceedings of ACM SIGPLAN symposium on Haskell, pp. 13–24. ACM (2014)Google Scholar
  28. 28.
    Orchard, D.A., Petricek, T., Mycroft, A.: The semantic marriage of monads and effects. CoRR, abs/1401.5391 (2014)Google Scholar
  29. 29.
    Petricek, T., Mycroft, A., Syme, D.: Extending monads with pattern matching. In: Proceedings of Haskell Symposium, Haskell (2011)Google Scholar
  30. 30.
    Petricek, T., Orchard, D., Mycroft, A.: Coeffects: unified static analysis of context-dependence. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013, Part II. LNCS, vol. 7966, pp. 385–397. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  31. 31.
    Petricek, T., Orchard, D., Mycroft, A.: Coeffects: a calculus of context-dependent computation. In: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, pp. 123–135. ACM (2014)Google Scholar
  32. 32.
    Petricek, T., Syme, D.: Joinads: a retargetable control-flow construct for reactive, parallel and concurrent programming. In: Rocha, R., Launchbury, J. (eds.) PADL 2011. LNCS, vol. 6539, pp. 205–219. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  33. 33.
    Plotkin, G., Power, J.: Notions of computation determine monads. In: Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 342–356. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  34. 34.
    Plotkin, G., Pretnar, M.: A logic for algebraic effects. In: Logic in Computer Science, LICS 2008, pp. 118–129. IEEE (2008)Google Scholar
  35. 35.
    Rivas, E., Jaskelioff, M., Schrijvers, T.: From monoids to near-semirings: the essence of monadplus and alternative. In: Proceeding of International Symposium on Principles and Practice of Declarative Programming, pp. 196–207. ACM (2015)Google Scholar
  36. 36.
    Smirnov, A.L.: Graded monads and rings of polynomials. J. Math. Sci. 151(3), 3032–3051 (2008)MATHMathSciNetCrossRefGoogle Scholar
  37. 37.
    Talpin, J.P., Jouvelot, P.: The type and effect discipline. In: Logic in Computer Science, LICS 1992, pp. 162–173. IEEE (1992)Google Scholar
  38. 38.
    Vouillon, J.: Lwt: a cooperative thread library. In: Proceedings of ACM SIGPLAN Workshop on ML, pp. 3–12. ACM, New York (2008)Google Scholar
  39. 39.
    Wadler, P., Thiemann, P.: The marriage of effects and monads. ACM Trans. Comput. Logic 4, 1–32 (2003)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.University of CambridgeCambridgeUK
  2. 2.Imperial College LondonLondonUK

Personalised recommendations