Results 1 -
5 of
5
Free Theorems for Functional Logic Programs
- SUBMITTED TO PLPV’10
, 2010
"... Type-based reasoning is popular in functional programming. In particular, parametric polymorphism constrains functions in such a way that statements about their behavior can be derived without consulting function definitions. Is the same possible in a strongly, and polymorphically, typed functional ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Type-based reasoning is popular in functional programming. In particular, parametric polymorphism constrains functions in such a way that statements about their behavior can be derived without consulting function definitions. Is the same possible in a strongly, and polymorphically, typed functional logic language? This is the question we study in this paper. Logical features like nondeterminism and free variables cause interesting effects, which we examine based on examples and address by identifying appropriate conditions that guarantee standard free theorems or inequational versions thereof to hold.
When Is a Container a Comonad?
"... Abstract. Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry addi ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Abstract. Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry additional structure that containers alone do not account for. We introduce directed containers to capture the common situation where every position in a datastructure determines another datastructure, informally, the sub-datastructure rooted by that position. Some natural examples are non-empty lists and node-labelled trees, and datastructures with a designated position (zippers). While containers denote set functors via a fully-faithful functor, directed containers interpret fully-faithfully into comonads. But more is true: every comonad whose underlying functor is a container is represented by a directed container. In fact, directed containers are the same as containers that are comonads. We also describe some constructions of directed containers. We have formalized our development in the dependently typed programming language Agda. 1
Proving Properties About Functions on Lists Involving Element Tests
"... Abstract. Bundy and Richardson [4] developed a method for reasoning about functions manipulating lists which is based on separating shape from content, and then exploiting a mathematically convenient representation for expressing shape-only manipulations. Later, Prince et al. [7] extended the techni ..."
Abstract
- Add to MetaCart
Abstract. Bundy and Richardson [4] developed a method for reasoning about functions manipulating lists which is based on separating shape from content, and then exploiting a mathematically convenient representation for expressing shape-only manipulations. Later, Prince et al. [7] extended the technique to other data structures, and gave it a more formal basis via the theory of containers. All these results are restricted to fully polymorphic functions. For example, functions using equality tests on list elements are out of reach. We remedy this situation by developing new abstractions and representations for less polymorphic functions. In Haskell speak, we extend the earlier approach to be applicable in the presence of (certain) type class constraints. 1
Minimally Strict Polymorphic Functions
"... In this paper we show how to efficiently check whether a polymorphic function is minimally strict. A function is minimally strict if it is the minimal element of a specific less-strict ordering. We prove that we can check whether two polymorphic functions are related by the less-strict ordering by e ..."
Abstract
- Add to MetaCart
In this paper we show how to efficiently check whether a polymorphic function is minimally strict. A function is minimally strict if it is the minimal element of a specific less-strict ordering. We prove that we can check whether two polymorphic functions are related by the less-strict ordering by either checking it a) for an arbitrary monomorphic instance of the functions or b) for all shapes of the functions ’ argument type. A shape is a value of a monomorphic instance of a polymorphic data type where each polymorphic component is replaced by an element that identifies its position in the data structure. In contrast to recent publications that characterize polymorphic functions by monomorphic instances we consider non-termination and selective strictness, i.e., a language closer to
Journal of Automated Reasoning manuscript No. (will be inserted by the editor) Deciding Properties of Lists using Containers
"... Abstract We exploit the ability to represent data types as container functors [2,1,3] to develop a novel approach to proving properties of lists using arithmetic decision procedures. Containers capture the idea that concrete data types can be characterised by specifying the shape values take and for ..."
Abstract
- Add to MetaCart
Abstract We exploit the ability to represent data types as container functors [2,1,3] to develop a novel approach to proving properties of lists using arithmetic decision procedures. Containers capture the idea that concrete data types can be characterised by specifying the shape values take and for every possible shape, explaining where positions within that shape are stored. More importantly, a representation theorem guarantees that polymorphic functions between container data types are given by container morphisms, which are characterised by mappings between shapes and positions. The key to our approach is to restrict the shape maps of container morphisms to functions that have decidable equality, but which allow for a large class of functions. We also capture the behaviour of position mappings of container morphisms as functions on the natural numbers. The shape maps which we consider are given by piecewise-linear functions, of type N n → N. Such functions are decidable, and this enables us to implement decision procedures for lists.

