Fibrational Induction Meets Effects

This paper provides several induction rules that can be used to prove properties of effectful data types. Our results are semantic in nature and build upon Hermida and Jacobs' fibrational formulation of induction for polynomial data types and its extension to all inductive data types by Ghani, Johann, and Fumex. An effectful data type μ(TF) is built from a functor F that describes data, and a monad T that computes effects. Our main contribution is to derive induction rules that are generic over all functors F and monads T such that μ(TF) exists. Along the way, we also derive a principle of definition by structural recursion for effectful data types that is similarly generic. Our induction rule is also generic over the kinds of properties to be proved: like the work on which we build, we work in a general fibrational setting and so can accommodate very general notions of properties, rather than just those of particular syntactic forms. We give examples exploiting the generality of our results, and show how our results specialize to those in the literature, particularly those of Filinski and Stovring.

[1]  Patricia Johann,et al.  Generic Fibrational Induction , 2012, Log. Methods Comput. Sci..

[2]  Robert Atkey,et al.  When Is a Type Refinement an Inductive Type? , 2011, FoSSaCS.

[3]  Bart Jacobs,et al.  Categorical Logic and Type Theory , 2001, Studies in logic and the foundations of mathematics.

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

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

[6]  Bart Jacobs,et al.  Structural Induction and Coinduction in a Fibrational Setting , 1998, Inf. Comput..

[7]  Alberto Pardo Combining Datatypes and Effects , 2004, Advanced Functional Programming.

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

[9]  Ian Stark,et al.  Free-Algebra Models for the pi-Calculus , 2005, FoSSaCS.

[10]  Bart Jacobs Comprehension Categories and the Semantics of Type Dependency , 1993, Theor. Comput. Sci..

[11]  Patricia Johann,et al.  Fibrational Induction Rules for Initial Algebras , 2010, CSL.

[12]  Graham Hutton,et al.  The worker/wrapper transformation , 2009, Journal of Functional Programming.

[13]  Maarten M. Fokkinga Monadic Maps and Folds for Arbitrary Datatypes , 1994 .

[14]  Philip Wadler XQuery: A Typed Functional Language for Querying XML , 2002, Advanced Functional Programming.

[15]  Rod M. Burstall,et al.  Proving Properties of Programs by Structural Induction , 1969, Comput. J..

[16]  Andrzej Filinski,et al.  Inductive reasoning about effectful data types , 2007, ICFP '07.

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

[18]  Roy L. Crole,et al.  New foundations for fixpoint computations , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.