Inductive reasoning about effectful data types

We present a pair of reasoning principles, definition and proof by rigid induction, which can be seen as proper generalizations of lazy-datatype induction to monadic effects other than partiality. We further show how these principles can be integrated into logical-relations arguments, and obtain as a particular instance a general and principled proof that the success-stream and failure-continuation models of backtracking are equivalent. As another application, we present a monadic model of general search trees, not necessarily traversed depth-first. The results are applicable to both lazy and eager languages, and we emphasize this by presenting most examples in both Haskell and SML.

[1]  Daniel Lehmann,et al.  Algebraic specification of data types: A synthetic approach , 1981, Mathematical systems theory.

[2]  Andrew M. Pitts,et al.  Relational Properties of Domains , 1996, Inf. Comput..

[3]  Olivier Danvy,et al.  A unifying approach to goal-directed evaluation , 2001, New Generation Computing.

[4]  KiselyovOleg,et al.  Backtracking, interleaving, and terminating monad transformers , 2005 .

[5]  Roy L. Crole,et al.  New Foundations for Fixpoint Computations: FIX-Hyperdoctrines and the FIX-Logic , 1992, Inf. Comput..

[6]  Andrzej Filinski On the relations between monadic semantics , 2007, Theor. Comput. Sci..

[7]  John C. Reynolds,et al.  On the Relation between Direct and Continuation Semantics , 1974, ICALP.

[8]  Andrzej Filinski,et al.  Representing layered monads , 1999, POPL '99.

[9]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[10]  J. Michael Spivey Algebras for combinatorial search , 2009, J. Funct. Program..

[11]  Gordon D. Plotkin,et al.  An axiomatisation of computationally adequate domain theoretic models of FPC , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

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

[13]  Mitchell Wand,et al.  Relating models of backtracking , 2004, ICFP '04.

[14]  Chris Reade,et al.  Elements of functional programming , 1989, International computer science series.

[15]  John Hughes,et al.  The Design of a Pretty-printing Library , 1995, Advanced Functional Programming.

[16]  Amr Sabry,et al.  Backtracking, interleaving, and terminating monad transformers: (functional pearl) , 2005, ICFP '05.