Academia.eduAcademia.edu

Outline

Monads, Effects and Transformations

1999, Electronic Notes in Theoretical Computer Science

https://doi.org/10.1016/S1571-0661(05)80280-4

Abstract

We de ne a typed compiler intermediate language, MIL-lite, which incorporates computational types re ned with e ect information. We characterise MIL-lite observational congruence by using Howe's method to prove a ciu theorem for the language in terms of a termination predicate de ned directly on the term. We then de ne a logical predicate which captures an observable version of the intended meaning of each of our e ect annotations. Having proved the fundamental theorem for this predicate, we use it with the ciu theorem to validate a number of e ect-based transformations performed by the MLj compiler for Standard ML.

References (16)

  1. P. N. Benton. A uni ed approach to strictness analysis and optimising transformations. Technical Report 388, Computer Laboratory, University of Cambridge, February 1996.
  2. P. N . B e n ton, A. J. Kennedy, and G. Russell. Compiling Standard ML to Java bytecodes. In 3rd ACM SIGPLAN International Conference on Functional Programming, September 1998.
  3. D. K. Gi ord and J. M. Lucassen. Integrating functional and imperative programming. In ACM Conference on Functional Programming and Computer Architecture, Cambridge, Massachusetts, August 1986.
  4. A. Gordon. Functional Programming and Input/Output. PhD thesis, University of Cambridge, 1992. Published as Distinguished Dissertation in Computer Science, CUP, 1 9 9 4 .
  5. D. J. Howe. Proving congruence of bisimulation in functional programming languages. Information and Computation, 124(2):103{112, February 1996.
  6. S . L . P eyton Jones, J. Launchbury, M. B. Shields, and A. P. T olmach. Bridging the gulf: a common intermediate language for ML and Haskell. In ACM Symposium on Principles of Programming Languages, 1998.
  7. S. Peyton Jones and K. Wansbrough. Once upon a polymorphic type. In ACM Symposium on Principles of Programming Languages, pages 15{28, 1999.
  8. I. Mason and C. L. Talcott. Equivalence in functional languages with e ects. Journal of Functional Programming, 1:287{327, 1991.
  9. E. Moggi. Notions of computation and monads. Information and Computation, 93:55{92, 1991.
  10. A. M. Pitts. Operationally-based theories of program equivalence. In P. Dybjer and A. M. Pitts, editors, Semantics and Logics of Computation, Publications of the Newton Institute, pages 241{298. Cambridge University Press, 1997.
  11. A. M. Pitts. Reasoning about local variables with operationally-based logical relations. In P. W. O'Hearn and R. D. Tennent, editors, Algol-Like Languages, volume 2, chapter 17, pages 173{193. Birkhauser, 1997. Reprinted from Proceedings Eleventh Annual IEEE Symposium on Logic in Computer Science, Brunswick, NJ, July 1996, pp 152{163.
  12. A. M. Pitts. Parametric polymorphism and operational equivalence. Technical Report 453, Cambridge University Computer Laboratory, 1998. A preliminary version appeared in Proceedings, Second Workshop on Higher Order Operational Techniques in Semantics (HOOTS II), Stanford C A , D e cember 1997, Electronic Notes in Theoretical Computer Science 10, 1998.
  13. A. M. Pitts and I. D. B. Stark. Operational reasoning for functions with local state. In A. D. Gordon and A. M. Pitts, editors, Higher Order Operational Techniques in Semantics, Publications of the Newton Institute, pages 227{273. Cambridge University Press, 1998.
  14. J.-P. Talpin and P. Jouvelot. The type and e ect discipline. Information and Computation, 111(2), June 1994. Revised from LICS 1992.
  15. A. Tolmach. Optimizing ML using a hierarchy of monadic types. In Workshop on Types in Compilation, volume 1473 of Lecture Notes in Computer Science, pages 97{113, 1998.
  16. P. Wadler. The marriage of e ects and monads. In International Conference on Functional Programming, pages 63{74, Baltimore, September 1998. ACM.