A Generalized Modality for Recursion

Nakano's later modality allows types to express that the output of a function does not immediately depend on its input, and thus that computing its fixpoint is safe. This idea, guarded recursion, has proved useful in various contexts, from functional programming with infinite data structures to formulations of step-indexing internal to type theory. Categorical models have revealed that the later modality corresponds in essence to a simple reindexing of the discrete time scale. Unfortunately, existing guarded type theories suffer from significant limitations for programming purposes. These limitations stem from the fact that the later modality is not expressive enough to capture precise input-output dependencies of functions. As a consequence, guarded type theories reject many productive definitions. Combining insights from guarded type theories and synchronous programming languages, we propose a new modality for guarded recursion. This modality can apply any well-behaved reindexing of the time scale to a type. We call such reindexings time warps. Several modalities from the literature, including later, correspond to fixed time warps, and thus arise as special cases of ours.

[1]  Noam Zeilberger,et al.  Functors are Type Refinement Systems , 2015, POPL.

[2]  Robert Atkey Substructural Simple Type Theories for Separation and In-place Update , 2006 .

[3]  Rasmus Ejlers Møgelberg A type theory for productive coprogramming via guarded recursion , 2014, CSL-LICS.

[4]  Nicolas Halbwachs,et al.  LUSTRE: a declarative language for real-time programming , 1987, POPL '87.

[5]  Nicolas Halbwachs,et al.  LUSTRE: A declarative language for programming synchronous systems* , 1987 .

[6]  Marc Pouzet,et al.  Synchronous Kahn networks , 1996, ICFP '96.

[7]  Marc Pouzet,et al.  N-synchronous Kahn networks: a relaxed model of synchrony for real-time systems , 2006, POPL '06.

[8]  Rasmus Ejlers Møgelberg,et al.  Guarded Dependent Type Theory with Coinductive Types , 2016, FoSSaCS.

[9]  Nick Benton,et al.  Ultrametric Semantics of Reactive Programs , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[10]  Nada Amin,et al.  Type soundness proofs with definitional interpreters , 2017, POPL.

[11]  Marc Pouzet,et al.  Lucid Synchrone - version 2.0: Tutorial and reference manual , 2001 .

[12]  Giorgio Ghelli,et al.  Coherence of Subsumption , 1990, CAAP.

[13]  Frédéric Boniol,et al.  A Multi-Periodic Synchronous Data-Flow Language , 2008, 2008 11th IEEE High Assurance Systems Engineering Symposium.

[14]  Conor McBride,et al.  Applicative programming with effects , 2008, J. Funct. Program..

[15]  Florence Plateau Modèle n-synchrone pour la programmation de réseaux de Kahn à mémoire bornée , 2010 .

[16]  J. Lambek,et al.  Introduction to higher order categorical logic , 1986 .

[17]  B Jean,et al.  Distributors at Work , 2000 .

[18]  Thierry Coquand,et al.  Inheritance as Implicit Coercion , 1991, Inf. Comput..

[19]  Bas Spitters,et al.  Guarded Cubical Type Theory: Path Equality for Guarded Recursion , 2016, CSL.

[20]  Pierre-Louis Curien,et al.  A theory of effects and resources: adjunction models and polarised calculi , 2016, POPL.

[21]  Valeria de Paiva,et al.  On an Intuitionistic Modal Logic , 2000, Stud Logica.

[22]  Rasmus Ejlers Møgelberg,et al.  First Steps in Synthetic Guarded Domain Theory: Step-Indexing in the Topos of Trees , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[23]  Robert Atkey,et al.  Productive coprogramming with guarded recursion , 2013, ICFP.

[24]  Frank Pfenning,et al.  A judgmental reconstruction of modal logic , 2001, Mathematical Structures in Computer Science.

[25]  Rasmus Ejlers Møgelberg,et al.  The clocks are ticking: No more delays! , 2017, 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[26]  Neelakantan R. Krishnaswami,et al.  Higher-order functional reactive programming without spacetime leaks , 2013, ICFP.

[27]  Martin Hyland,et al.  Some reasons for generalising domain theory , 2010, Mathematical Structures in Computer Science.

[28]  Hiroshi Nakano,et al.  A modality for recursion , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[29]  Noam Zeilberger,et al.  A bifibrational reconstruction of Lawvere’s presheaf hyperdoctrine , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[30]  Adrien Guatto,et al.  A synchronous functional language with integer clocks , 2016 .

[31]  Rasmus Ejlers Møgelberg,et al.  The clocks are ticking: no more delays!: reduction semantics for type theory with guarded recursion , 2017, LICS 2017.

[32]  Paula Severi,et al.  A Light Modality for Recursion , 2017, FoSSaCS.