Structural Induction Principles for Functional Programmers
نویسنده
چکیده
User defined recursive types are a fundamental feature of modern functional programming languages like Haskell, Clean, and the ML family of languages. Properties of programs defined by recursion on the structure of recursive types are generally proved by structural induction on the type. It is well known in the theorem proving community how to generate structural induction principles from data type declarations. These methods deserve to be better know in the functional programming community. Existing functional programming textbooks gloss over this material. And yet, if functional programmers do not know how to write down the structural induction principle for a new type how are they supposed to reason about it? In this paper we describe an algorithm to generate structural induction principles from data type declarations. We also discuss how these methods are taught in the functional programming course at the University of Wyoming. A Haskell implementation of the algorithm is included in an appendix.
منابع مشابه
A Tutorial on Co-induction and Functional Programming
Co-induction is an important tool for reasoning about unbounded structures. This tutorial explains the foundations of co-induction, and shows how it justiies intuitive arguments about lazy streams, of central importance to lazy functional programmers. We explain from rst principles a theory based on a new formulation of bisimilarity for functional programs, which coincides exactly with Morris-s...
متن کاملStructural and electronic properties of N-doped TiO2 anatase nanoparticles and their effects on the adsorption of Hydrazine (N2H4) molecule: A first-principles study
We have performed a density functional theory investigation on the structural and electronic properties of pristine and Nitrogen-doped TiO2 anatase nanoparticles as the adsorbents for removal and degradation of hydrazine molecules in the environment. We have presented the most stable adsorption configurations and examined the interaction of hydrazine molecule with these doped and undoped nanopa...
متن کاملStructural and electronic properties of N-doped TiO2 anatase nanoparticles and their effects on the adsorption of Hydrazine (N2H4) molecule: A first-principles study
We have performed a density functional theory investigation on the structural and electronic properties of pristine and Nitrogen-doped TiO2 anatase nanoparticles as the adsorbents for removal and degradation of hydrazine molecules in the environment. We have presented the most stable adsorption configurations and examined the interaction of hydrazine molecule with these doped and undoped nanopa...
متن کاملSliced bananas on opaque data
Algebraic data types and catamorphisms (folds) play a central role in functional programming as they allow programmers to define recursive data structures and operations on them uniformly by structural recursion. Likewise, in object-oriented (OO) programming, recursive hierarchies of object types with virtual methods play a central role for the same reason. There is a semantical correspondence ...
متن کاملThe Expression Lemma
Algebraic data types and catamorphisms (folds) play a central role in functional programming as they allow programmers to define recursive data structures and operations on them uniformly by structural recursion. Likewise, in object-oriented (OO) programming, recursive hierarchies of object types with virtual methods play a central role for the same reason. There is a semantical correspondence ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013