Abstract
We present a new approach to the old problem of adding global mutable state to purely functional languages. Our idea is to extend the language with “witnesses,” which is based on an arguably more pragmatic motivation than past approaches. We give a semantic condition for correctness and prove it is sufficient. We also give a somewhat surprising static checking algorithm that makes use of a network flow property equivalent to the semantic condition via reduction to a satisfaction problem for a system of linear inequalities.
- Achten, P., van Groningen, J. H. G., and Plasmeijer, R. 1993. High level specification of I/O in functional languages. In Proceedings of the 1992 Glasgow Workshop on Functional Programming. Springer-Verlag, New York, 1--17. Google Scholar
Digital Library
- Ariola, Z. M. and Felleisen, M. 1997. The call-by-need lambda calculus. J. Funct. Prog. 7, 3, 265--301. Google Scholar
Digital Library
- Ariola, Z. M., Maraist, J., Odersky, M., Felleisen, M., and Wadler, P. 1995. A call-by-need lambda calculus. In Proceedings of the 22nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Francisco, CA). ACM, New York, 233--246. Google Scholar
Digital Library
- Ariola, Z. M. and Sabry, A. 1998. Correctness of monadic state: an imperative call-by-need calculus. In Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Diego, CA). 62--74. Google Scholar
Digital Library
- Boyland, J. 2003. Checking interference with fractional permissions. In Static Analysis, Tenth International Symposium (San Diego, CA). 55--72. Google Scholar
Digital Library
- 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 (San Antonio, TX). 262--275. Google Scholar
Digital Library
- Fähndrich, M., Foster, J. S., Su, Z., and Aiken, A. 1998. Partial online cycle elimination in inclusion constraint graphs. In Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (Montreal, Ont., Canada). ACM, New York, 85--96. Google Scholar
Digital Library
- Grossman, D., Morrisett, G., Jim, T., Hicks, M., Wang, Y., and Cheney, J. 2002. Region-based memory management in Cyclone. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (Berlin, Germany). ACM, New York. Google Scholar
Digital Library
- Guzman, J. C. and Hudak, P. 1990. Single-threaded polymorphic lambda calculus. In Proceedings of the 5th Annual IEEE Symposium on Logic in Computer Science (Philadelphia, PA). IEEE Computer Society Press, Los Alamitos, CA, 42--51.Google Scholar
- Launchbury, J. 1993. A natural semantics for lazy evaluation. In Proceedings of the 20th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 144--154. Google Scholar
Digital Library
- Launchbury, J. and Sabry, A. 1997. Monadic state: Axiomatization of type safety. In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming (Amsterdam, The Netherlands). ACM, New York, 227--238. Google Scholar
Digital Library
- Matthews, J. and Findler, R. B. 2005. An operational semantics for r5rs scheme. In Proceedings of the 2005 Workshop on Scheme and Functional Programming.Google Scholar
- Moggi, E. 1991. Notions of computation and monads. Inf. Comput. 93, 1, 55--92. Google Scholar
Digital Library
- Moggi, E. and Sabry, A. 2001. Monadic encapsulation of effects: a revised approach (extended version). J. Funct. Prog. 11, 6, 591--627. Google Scholar
Digital Library
- Odersky, M., Rabin, D., and Hudak, P. 1993. Call by name, assignment, and the lambda calculus. In Proceedings of the 20th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 43--56. Google Scholar
Digital Library
- Peyton Jones, S. L. and Wadler, P. 1993. Imperative functional programming. In Proceedings of the 20th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 71--84. Google Scholar
Digital Library
- Plotkin, G. D. 1975. Call-by-name, call-by-value and the lambda-calculus. Theoret. Comput. Sci. 1, 125--159.Google Scholar
Cross Ref
- Sabry, A. 1998. What is a purely functional language? J. Funct. Prog. 8, 1, 1--22. Google Scholar
Digital Library
- Semmelroth, M. and Sabry, A. 1999. Monadic encapsulation in ml. In Proceedings of the 4th ACM SIGPLAN International Conference on Functional Programming (Paris, France). ACM, New York, 8--17. Google Scholar
Digital Library
- Sestoft, P. 1989. Replacing function parameters by global variables. In FPCA '89 Conference on Functional Programming Languages and Computer Architecture (London, United Kingdom). Google Scholar
Digital Library
- Terauchi, T. and Aiken, A. 2004. Memory management with use-counted regions. Tech. Rep. UCB//CSD-04-1314, University of California, Berkeley, CA. Mar.Google Scholar
- Terauchi, T. and Aiken, A. 2005. Witnessing side-effects. In Proceedings of the 8th ACM SIGPLAN International Conference on Functional Programming (Tallinn, Estonia). ACM, New York, 105--115. Google Scholar
Digital Library
- Terauchi, T. and Aiken, A. 2006. A capability calculus for concurrency and determinism. In CONCUR 2006—Concurrency Theory, 17th International Conference (Bonn, Germany). 218--232. Google Scholar
Digital Library
- Tofte, M. and Talpin, J.-P. 1994. Implementation of the typed call-by-value λ-calculus using a stack of regions. In Proceedings of the 21st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Portland, OR). ACM, New York, 188--201. Google Scholar
Digital Library
- Turner, D. N., Wadler, P., and Mossin, C. 1995. Once upon a type. In FPCA '95 Conference on Functional Programming Languages and Computer Architecture (La Jolla, CA), 1--11. Google Scholar
Digital Library
- Wadler, P. 1990. Linear types can change the world! In IFIP TC 2, Proceedings of the Working Conference on Programming Concepts and Methods (Sea of Galilee, Israel), M. Broy and C. Jones, Eds. North Holland, Amsterdam, The Netherlands, 347--359.Google Scholar
- Wright, A. K. and Felleisen, M. 1994. A syntactic approach to type soundness. Inf. Comput. 115, 1, 38--94. Google Scholar
Digital Library
Index Terms
Witnessing side effects
Recommendations
Witnessing side-effects
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingWe present a new approach to the old problem of adding side effects to purely functional languages. Our idea is to extend the language with "witnesses," which is based on an arguably more pragmatic motivation than past approaches. We give a semantic ...
Witnessing side-effects
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingWe present a new approach to the old problem of adding side effects to purely functional languages. Our idea is to extend the language with "witnesses," which is based on an arguably more pragmatic motivation than past approaches. We give a semantic ...
Epistemic Side Effects: An AI Safety Problem
AAMAS '23: Proceedings of the 2023 International Conference on Autonomous Agents and Multiagent SystemsAI safety research has investigated the problem of negative side effects -- undesirable changes made by AI systems in pursuit of an underspecified objective. However, the focus has been on physical side effects, such as a robot breaking a vase while ...








Comments