Abstract
Cooperative scheduling enables efficient sequential implementations of concurrency. It is widely used to provide lightweight threads facilities as libraries or programming constructs in many programming languages. However, it is up to programmers to actually cooperate to ensure the reactivity of their programs.
We present a static analysis that checks the reactivity of programs by abstracting them into so-called behaviors using a type-and-effect system. Our objective is to find a good compromise between the complexity of the analysis and its precision for typical reactive programs. The simplicity of the analysis is mandatory for the programmer to be able to understand error messages and how to fix reactivity problems.
Ourwork is applied and implemented in the functional synchronous language ReactiveML. It handles recursion, higher-order processes and firstclass signals. We prove the soundness of our analysis with respect to the big-step semantics of the language: a well-typed program with reactive effects is reactive. The analysis is easy to implement and generic enough to be applicable to other models of concurrency such as coroutines.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abel, A., Pientka, B.: Well-founded recursion with copatterns. In: International Conference on Functional Programming (2013)
Amadio, R., Dabrowski, F.: Feasible reactivity in a synchronous π-calculus. In: Principles and Practice of Declarative Programming, pp. 221–230 (2007)
Amtoft, T., Nielson, F., Nielson, H.: Type and Effect Systems: Behaviours for Concurrency. Imperial College Press (1999)
Atkey, R., McBride, C.: Productive coprogramming with guarded recursion. In: International Conference on Functional Programming (2013)
Barthe, G., Frade, M.J., Giménez, E., Pinto, L., Uustalu, T.: Type-based termination of recursive definitions. Mathematical Structures in Computer Science 14(01), 97–141 (2004)
Benveniste, A., Caspi, P., Edwards, S.A., Halbwachs, N., Guernic, P.L., De Simone, R.: The synchronous languages twelve years later. In: Proc. of the IEEE (2003)
Boudol, G.: ULM: A core programming model for global computing. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 234–248. Springer, Heidelberg (2004)
Boudol, G.: Typing termination in a higher-order concurrent imperative language. Information and Computation 208(6), 716–736 (2010)
Boussinot, F.: Reactive C: an extension of C to program reactive systems. Software: Practice and Experience 21(4), 401–428 (1991)
Cuoq, P., Pouzet, M.: Modular Causality in a Synchronous Stream Language. In: Sands, D. (ed.) ESOP 2001. LNCS, vol. 2028, pp. 237–251. Springer, Heidelberg (2001)
Dimino, J.: Lwt User Manual (2014), http://ocsigen.org/lwt/
Engelschall, R.: Portable multithreading: The signal stack trick for user-space thread creation. In: USENIX Annual Technical Conference (2000)
Huet, G.: A unification algorithm for typed λ-calculus. Theoretical Computer Science 1(1), 27–57 (1975)
Jeffrey, A.: Functional reactive programming with liveness guarantees. In: International Conference on Functional Programming (2013)
Jones, S., Gordon, A., Finne, S.: Concurrent Haskell. In: Principles of Programming Languages, pp. 295–308 (1996)
Lee, O., Yi, K.: Proofs about a folklore let-polymorphic type inference algorithm. Transactions on Programming Languages and Systems 20(4), 707–723 (1998)
Leroy, X., Pessaux, F.: Type-based analysis of uncaught exceptions. Transactions on Programming Languages and Systems 22(2), 340–377 (2000)
Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Principles of Programming Languages (1988)
Mandel, L., Pouzet, M.: ReactiveML: A reactive extension to ML. In: Principles and Practice of Declarative Programming (2005)
Mandel, L., Pasteur, C.: Reactivity of cooperative systems – extended version. Research Report 8549, INRIA (2014), http://reactiveml.org/sas14
Mandel, L., Pasteur, C., Pouzet, M.: Time refinement in a functional synchronous language. In: Principles and Practice of Declarative Programming. (2013)
Marlow, S., Jones, S., Thaller, W.: Extending the Haskell foreign function interface with concurrency. In: Haskell 2004, pp. 22–32. ACM (2004)
Nielson, F., Nielson, H.: Type and effect systems. Correct System Design (1999)
Pierce, B.: Types and programming languages. The MIT Press (2002)
Potop-Butucaru, D., Edwards, S.A., Berry, G.: Compiling Esterel. Springer (2007)
Rémy, D.: Type inference for records in a natural extension of ML. Theoretical Aspects of Object-Oriented Programming. MIT Press (1993)
Rémy, D.: Using, understanding, and unraveling the OCaml language from practice to theory and vice versa. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) Applied Semantics. LNCS, vol. 2395, pp. 413–536. Springer, Heidelberg (2002)
Reppy, J.: Concurrent programming in ML. Cambridge University Press (2007)
Sijtsma, B.A.: On the productivity of recursive list definitions. Transactions on Programming Languages and Systems 11(4), 633–649 (1989)
Syme, D., Petricek, T., Lomov, D.: The F# asynchronous programming model. Practical Aspects of Declarative Languages, 175–189 (2011)
Talpin, J.P., Jouvelot, P.: The type and effect discipline. In: Logic in Computer Science (1992)
Tardieu, O., de Simone, R.: Loops in Esterel. Transaction on Embedded Computing 4(4), 708–750 (2005)
Tofte, M.: Type inference for polymorphic references. Information and computation 89(1), 1–34 (1990)
Vouillon, J.: Lwt: A cooperative thread library. In: ACM workshop on ML (2008)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Mandel, L., Pasteur, C. (2014). Reactivity of Cooperative Systems. In: Müller-Olm, M., Seidl, H. (eds) Static Analysis. SAS 2014. Lecture Notes in Computer Science, vol 8723. Springer, Cham. https://doi.org/10.1007/978-3-319-10936-7_14
Download citation
DOI: https://doi.org/10.1007/978-3-319-10936-7_14
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-10935-0
Online ISBN: 978-3-319-10936-7
eBook Packages: Computer ScienceComputer Science (R0)