Results 1 - 10
of
35
Inductive and Coinductive types with Iteration and Recursion
- Proceedings of the 1992 Workshop on Types for Proofs and Programs, Bastad
, 1992
"... We study (extensions of) simply and polymorphically typed lambda calculus from a point of view of how iterative and recursive functions on inductive types are represented. The inductive types can usually be understood as initial algebras in a certain category and then recursion can be defined in ter ..."
Abstract
-
Cited by 49 (0 self)
- Add to MetaCart
We study (extensions of) simply and polymorphically typed lambda calculus from a point of view of how iterative and recursive functions on inductive types are represented. The inductive types can usually be understood as initial algebras in a certain category and then recursion can be defined in terms of iteration. However, in the syntax we often have only weak initiality, which makes the definition of recursion in terms of iteration inefficient or just impossible. We propose a categorical notion of (primitive) recursion which can easily be added as computation rule to a typed lambda calculus and gives us a clear view on what the dual of recursion, corecursion, on coinductive types is. (The same notion has, independently, been proposed by [Mendler 1991].) We look at how these syntactic notions work out in the simply typed lambda calculus and the polymorphic lambda calculus. It will turn out that in the syntax, recursion can be defined in terms of corecursion and vice versa using polymo...
The Under-Appreciated Unfold
- In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming
, 1998
"... Folds are appreciated by functional programmers. Their dual, unfolds, are not new, but they are not nearly as well appreciated. We believe they deserve better. To illustrate, we present (indeed, we calculate) a number of algorithms for computing the breadth-first traversal of a tree. We specify brea ..."
Abstract
-
Cited by 43 (10 self)
- Add to MetaCart
Folds are appreciated by functional programmers. Their dual, unfolds, are not new, but they are not nearly as well appreciated. We believe they deserve better. To illustrate, we present (indeed, we calculate) a number of algorithms for computing the breadth-first traversal of a tree. We specify breadth-first traversal in terms of level-order traversal, which we characterize first as a fold. The presentation as a fold is simple, but it is inefficient, and removing the inefficiency makes it no longer a fold. We calculate a characterization as an unfold from the characterization as a fold; this unfold is equally clear, but more efficient. We also calculate a characterization of breadth-first traversal directly as an unfold; this turns out to be the `standard' queue-based algorithm.
Termination Checking with Types
, 1999
"... The paradigm of type-based termination is explored for functional programming with recursive data types. The article introduces , a lambda-calculus with recursion, inductive types, subtyping and bounded quanti cation. Decorated type variables representing approximations of inductive types ..."
Abstract
-
Cited by 25 (6 self)
- Add to MetaCart
The paradigm of type-based termination is explored for functional programming with recursive data types. The article introduces , a lambda-calculus with recursion, inductive types, subtyping and bounded quanti cation. Decorated type variables representing approximations of inductive types are used to track the size of function arguments and return values. The system is shown to be type safe and strongly normalizing. The main novelty is a bidirectional type checking algorithm whose soundness is established formally.
Hidden Coinduction: Behavioral Correctness Proofs for Objects
- Mathematical Structures in Computer Science
, 1999
"... This paper unveils and motivates an ambitious programme of hidden algebraic research in software engineering, beginning with our general goals, continuing with an overview of results, and including some future plans. The main contribution is powerful hidden coinduction techniques for proving behavio ..."
Abstract
-
Cited by 24 (8 self)
- Add to MetaCart
This paper unveils and motivates an ambitious programme of hidden algebraic research in software engineering, beginning with our general goals, continuing with an overview of results, and including some future plans. The main contribution is powerful hidden coinduction techniques for proving behavioral correctness of concurrent systems; several mechanical proofs are given using OBJ3. We also show how modularization, bisimulation, transition systems, concurrency and combinations of the functional, constraint, logic and object paradigms fit into hidden algebra. 1. Introduction
Monadic Maps and Folds for Arbitrary Datatypes
- Memoranda Informatica, University of Twente
, 1994
"... Each datatype constructor comes equiped not only with a so-called map and fold (catamorphism), as is widely known, but, under some condition, also with a kind of map and fold that are related to an arbitrary given monad. This result follows from the preservation of initiality under lifting from the ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
Each datatype constructor comes equiped not only with a so-called map and fold (catamorphism), as is widely known, but, under some condition, also with a kind of map and fold that are related to an arbitrary given monad. This result follows from the preservation of initiality under lifting from the category of algebras in a given category to a certain other category of algebras in the Kleisli category related to the monad.
Generalized Iteration and Coiteration for Higher-Order Nested Datatypes
- PROC. OF FOSSACS 2003
, 2003
"... We solve the problem of extending Bird and Paterson's generalized folds for nested datatypes and its dual to inductive and coinductive constructors of arbitrarily high ranks by appropriately generalizing Mendler-style (co)iteration. Characteristically to Mendler-style schemes of disciplined (co)recu ..."
Abstract
-
Cited by 8 (5 self)
- Add to MetaCart
We solve the problem of extending Bird and Paterson's generalized folds for nested datatypes and its dual to inductive and coinductive constructors of arbitrarily high ranks by appropriately generalizing Mendler-style (co)iteration. Characteristically to Mendler-style schemes of disciplined (co)recursion, the schemes we propose do not rest on notions like positivity or monotonicity of a constructor and facilitate programming in a natural and elegant style close to programming with the customary letrec construct, where the typings of the schemes, however, guarantee termination. For rank 2, a smoothened version of Bird and Paterson's generalized folds and its dual are achieved; for rank 1, the schemes instantiate to Mendler's original (re)formulation of iteration and coiteration. Several examples demonstrate the power of the approach. Strong normalization of our proposed extension of system F of higherorder parametric polymorphism is proven by a reduction-preserving embedding into pure F .
(Co-)iteration for higher-order nested datatypes
- POST-CONF. PROC. OF IST WG TYPES 2ND ANN. MEETING, TYPES'02, LECT. NOTES IN COMPUT. SCI
, 2003
"... The problem of defining iteration for higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higher-order parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the sh ..."
Abstract
-
Cited by 8 (5 self)
- Add to MetaCart
The problem of defining iteration for higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System F ω of higher-order parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the shape of the type constructors such as positivity or even being polynomial. Its use is demonstrated for some rank-2 heterogeneous/nested datatypes such as powerlists and de Bruijn terms with explicit substitutions. An important feature is the availability of an iterative definition of the mapping operation (the functoriality) for those rank-1 type transformers (i. e., functions from types to types) arising as least fixed-points of monotone rank-2 type transformers. Strong normalization is shown by an embedding into F ω. The results dualize to greatest fixed-points, hence to coinductive constructors with coiteration.
Programming with inductive and co-inductive types
, 1992
"... Abstract We look at programming with inductive and co-inductive datatypes, which are inspired theoretically by initial algebras and final co-algebras, respectively. A predicative calculus which incorporates these datatypes as primitive constructs is presented. This calculus allows reduction sequence ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
Abstract We look at programming with inductive and co-inductive datatypes, which are inspired theoretically by initial algebras and final co-algebras, respectively. A predicative calculus which incorporates these datatypes as primitive constructs is presented. This calculus allows reduction sequences which are significantly more efficient for two dual classes of common programs than do previous calculi using similar primitives. Several techniques for programming in this calculus are illustrated with numerous examples. A short survey of related work is also included.
Tuning Task Granularity and Data Locality of Data Parallel GpH Programs
, 2001
"... The performance of data parallel programs often hinges on two key coordination aspects: the computational costs of the parallel tasks relative to their management overhead | task granularity ; and the communication costs induced by the distance between tasks and their data | data locality . In da ..."
Abstract
-
Cited by 7 (3 self)
- Add to MetaCart
The performance of data parallel programs often hinges on two key coordination aspects: the computational costs of the parallel tasks relative to their management overhead | task granularity ; and the communication costs induced by the distance between tasks and their data | data locality . In data parallel programs both granularity and locality can be improved by clustering, i.e. arranging for parallel tasks to operate on related sub-collections of data.

