An Abstract Monadic Semantics for Value Recursion

This paper proposes an operational semantics for value recursion in the context of monadic metalanguages. Our technique for combining value recursion with computational effects works uniformly for all monads. The operational nature of our approach is related to the implementation of recursion in Scheme and its monadic version proposed by Friedman and Sabry, but it defines a different semantics and does not rely on assignments. When contrasted to the axiomatic approach proposed by Erkok and Launchbury, our semantics for the continuation monad invalidates one of the axioms, adding to the evidence that this axiom is problematic in the presence of continuations.

[1]  Peter Aczel,et al.  Infinite trees and completely iterative theories: a coalgebraic view , 2003, Theor. Comput. Sci..

[2]  Didier Parigot,et al.  Attribute Grammars and Functional Programming Deforestation , 1997, SAS.

[3]  Raymond Lo,et al.  Register promotion by sparse partial redundancy elimination of loads and stores , 1998, PLDI.

[4]  Lawrence S. Moss Parametric corecursion , 2001, Theor. Comput. Sci..

[5]  John Hughes,et al.  Report on the Programming Language Haskell 98 , 1999 .

[6]  M. Barr Coequalizers and free triples , 1970 .

[7]  Gordon D. Plotkin,et al.  Complete axioms for categorical fixed-point operators , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[8]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

[9]  Horst Herrlich,et al.  Abstract and concrete categories , 1990 .

[10]  Didier Parigot,et al.  Symbolic Composition , 1997 .

[11]  Andrzej Filinski,et al.  Representing monads , 1994, POPL '94.

[12]  John Launchbury,et al.  On embedding a microarchitectural design language within Haskell , 1999, ICFP '99.

[13]  Edmund Robinson,et al.  Premonoidal categories and notions of computation , 1997, Mathematical Structures in Computer Science.

[14]  Sonia Fagorzi,et al.  A Monadic Multi-stage Metalanguage , 2003, FoSSaCS.

[15]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[16]  Andrew D. Gordon Operational equivalences for untyped and polymorphic object calculi , 1999 .

[17]  Joost Engelfriet,et al.  SOME OPEN QUESTIONS AND RECENT RESULTS ON TREE TRANSDUCERS AND TREE LANGUAGES , 1980 .

[18]  Gérard Boudol The Recursive Record Semantics of Objects Revisited , 2001, ESOP.

[19]  Pierre-Louis Curien,et al.  The Categorical Abstract Machine , 1987, Sci. Comput. Program..

[20]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[21]  Derek Dreyer,et al.  A type system for well-founded recursion , 2004, POPL.

[22]  Roope Kaivola On Modal mu-Calculus and Büchi Tree Automata , 1995, Inf. Process. Lett..

[23]  Stefan Milius On Iteratable Endofunctors , 2002, CTCS.

[24]  Gordon D. Plotkin,et al.  Abstract syntax and variable binding , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[25]  Joost Engelfriet,et al.  Macro Tree Transducers , 1985, J. Comput. Syst. Sci..

[26]  Andrew M. Pitts,et al.  Parametric polymorphism and operational equivalence , 2000, Mathematical Structures in Computer Science.

[27]  Joost Engelfriet,et al.  Bottom-up and top-down tree transformations— a comparison , 1975, Mathematical systems theory.

[28]  Tom Hirschowitz,et al.  Compilation of extended recursion in call-by-value functional languages , 2003, PPDP '03.

[29]  Zoltán Fülöp On attributed tree transducers , 1981, Acta Cybern..

[30]  Nick Benton,et al.  Traced Premonoidal Categories , 2003, RAIRO Theor. Informatics Appl..

[31]  Nick Benton,et al.  Traced pre-monoidal categories , 2002, FICS.

[32]  William R. Cook,et al.  A denotational semantics of inheritance , 1989 .

[33]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[34]  Igor Walukiewicz,et al.  Games for synthesis of controllers with partial observation , 2003, Theor. Comput. Sci..

[35]  Tom Hirschowitz,et al.  Mixin modules in a call-by-value setting , 2002, TOPL.

[36]  Ralf Hinze,et al.  Deriving backtracking monad transformers , 2000, ICFP '00.

[37]  Davide Ancona,et al.  Mixin Modules and Computational Effects , 2003, ICALP.

[38]  Jirí Adámek,et al.  Free iterative theories: a coalgebraic view , 2003, Mathematical Structures in Computer Science.

[39]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[40]  Damian Niwinski,et al.  Fixed Point Characterization of Büchi Automata on Infinite Trees , 1990, J. Inf. Process. Cybern..

[41]  Gilad Bracha,et al.  The programming language jigsaw: mixins, modularity and multiple inheritance , 1992 .

[42]  Vincent Danos,et al.  Labeled Markov processes: stronger and faster approximations , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[43]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[44]  John Power,et al.  Combining computational effects: commutativity and sum , 2001 .

[45]  Levent Erkok,et al.  Value recursion in monadic computations , 2002 .

[46]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[47]  Davide Ancona,et al.  A Primitive Calculus for Module Systems , 1999, PPDP.

[48]  Peter Aczel,et al.  A Coalgebraic View of Infinite Trees and Iteration , 2001, CMCS.

[49]  Andrew M. Pitts Existential Types: Logical Relations and Operational Equivalence , 1998, ICALP.

[50]  Dominic Duggan,et al.  Mixin modules , 1996, ICFP '96.

[51]  Andrew Moran,et al.  Semantics of value recursion for Monadic Input/Output , 2002, RAIRO Theor. Informatics Appl..

[52]  Patricia Johann Short Cut Fusion: Proved and Improved , 2001, SAIG.

[53]  William Chesley Rounds Trees, transducers, and transformations , 1968 .

[54]  John Launchbury,et al.  Recursive monadic bindings , 2000, ICFP '00.

[55]  Pascal Zimmer,et al.  Recursion in the call-by-value lambda-calculus , 2002, FICS.

[56]  Davide Ancona,et al.  Modular Formal Frameworks for Module Systems , 1998 .

[57]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[58]  David E. Muller,et al.  Alternating Automata, the Weak Monadic Theory of Trees and its Complexity , 1992, Theor. Comput. Sci..

[59]  Andrew John Gill,et al.  Cheap deforestation for non-strict functional languages , 1996 .

[60]  Damian Niwinski,et al.  Fixed point characterization of weak monadic logic definable sets of trees , 1992, Tree Automata and Languages.

[61]  Christoph Lüth Categorical term rewriting : monads and modularity , 1998 .

[62]  Christoph Lüth,et al.  Monads and Modularity , 2002, FroCoS.

[63]  Bruno Courcelle,et al.  Attribute Grammars and Recursive Program Schemes I , 1982, Theoretical Computer Science.

[64]  N. P. Mendler,et al.  Recursive Types and Type Constraints in Second-Order Lambda Calculus , 1987, LICS.

[65]  Akihiko Takano,et al.  Shortcut deforestation in calculational form , 1995, FPCA '95.

[66]  Jens Palsberg,et al.  A Denotational Semantics af Inheritance and its Correctness , 1989 .

[67]  Chris Okasaki,et al.  From fast exponentiation to square matrices: an adventure in types , 1999, ICFP '99.

[68]  Jens Palsberg,et al.  A Denotational Semantics of Inheritance and Its Correctness , 1994, Inf. Comput..

[69]  Ross Paterson,et al.  A new notation for arrows , 2001, ICFP '01.

[70]  Heiko Vogler,et al.  Syntactic composition of top-down tree transducers is short cut fusion , 2004, Math. Struct. Comput. Sci..

[71]  Chris Okasaki,et al.  Purely functional data structures , 1998 .

[72]  G. Kelly A unified treatment of transfinite constructions for free algebras, free monoids, colimits, associated sheaves, and so on , 1980, Bulletin of the Australian Mathematical Society.

[73]  Davide Ancona,et al.  A calculus of module systems , 2002, J. Funct. Program..

[74]  Jonathan Rees,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[75]  R. Kent Dybvig,et al.  Robust and Effective Transformation of Letrec , 2002 .