Functional Programming in Sublinear Space

We consider the problem of functional programming with data in external memory, in particular as it appears in sublinear space computation. Writing programs with sublinear space usage often requires one to use special implementation techniques for otherwise easy tasks, e.g. one cannot compose functions directly for lack of space for the intermediate result, but must instead compute and recompute small parts of the intermediate result on demand. In this paper, we study how the implementation of such techniques can be supported by functional programming languages. Our approach is based on modeling computation by interaction using the Int construction of Joyal, Street & Verity. We derive functional programming constructs from the structure obtained by applying the Int construction to a term model of a given functional language. The thus derived functional language is formulated by means of a type system inspired by Baillot & Terui's Dual Light Affine Logic. We assess its expressiveness by showing that it captures logspace.

[1]  Ross Street,et al.  Traced monoidal categories , 1996 .

[2]  Lars Kristiansen,et al.  Neat function algebraic characterizations of logspace and linspace , 2005, computational complexity.

[3]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[4]  Glynn Winskel,et al.  The formal semantics of programming languages - an introduction , 1993, Foundation of computing series.

[5]  Paul-André Melliès Functorial Boxes in String Diagrams , 2006, CSL.

[6]  Andrzej Szepietowski Turing Machines with Sublogarithmic Space , 1994, Lecture Notes in Computer Science.

[7]  Guillaume Bonfante Some Programming Languages for Logspace and Ptime , 2006, AMAST.

[8]  Ian Mackie,et al.  The geometry of interaction machine , 1995, POPL '95.

[9]  Harry G. Mairson From Hilbert Spaces to Dilbert Spaces: Context Semantics Made Simple , 2002, FSTTCS.

[10]  Kazushige Terui,et al.  Light types for polynomial time computation in lambda-calculus , 2004, LICS 2004.

[11]  G. Winskel The formal semantics of programming languages , 1993 .

[12]  Alex K. Simpson,et al.  Computational Adequacy in an Elementary Topos , 1998, CSL.

[13]  Shin-ya Katsumata,et al.  Attribute Grammars and Categorical Semantics , 2008, ICALP.

[14]  Masahito Hasegawa,et al.  On traced monoidal closed categories , 2009, Mathematical Structures in Computer Science.

[15]  Samson Abramsky,et al.  Geometry of Interaction and linear combinatory algebras , 2002, Mathematical Structures in Computer Science.

[16]  Ron Dinishak The optimal implementation of functional programming languages , 2000, SOEN.

[17]  Peter Møller Neergaard A Functional Language for Logarithmic Space , 2004, APLAS.

[18]  Radha Jagadeesan,et al.  New foundations for the geometry of interaction , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[19]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.

[20]  Ulrich Sch Stratified Bounded Affine Logic for Logarithmic Space , 2007 .

[21]  Manindra Agrawal,et al.  FST TCS 2002: Foundations of Software Technology and Theoretical Computer Science , 2002, Lecture Notes in Computer Science.

[22]  Naohiko Hoshino,et al.  Int Construction and Semibiproducts , 2009 .