ArticlePDF Available

First steps towards the theory of rose trees

Authors:
  • Kestrel Institute
... Informally, the catamorphism gradually breaks down its inductively defined argument, replacing constructors with the given algebra alg. The name cata dubbed by Meertens (1988) is from Greek κατά meaning 'downwards along' or 'according to'. Catamorphisms enjoy an important universal property as follows. ...
Preprint
Full-text available
This document is a 'dictionary' of structured recursion schemes in functional programming. Each recursion scheme is motivated and explained with concrete programming examples in Haskell, and the dual of each recursion scheme is also presented.
... Next, consider a typed language where we have e V→nest(V) , n list(nest(V))→nest(V) , plus the list constructors. This language implements rose trees [56,170], i. e., trees where the number of children of each node is not fixed. This example illustrates a phenomenon that accounts for a lot of complication in the formalism I developed [9]: the ⊳⊳-relation is not closed under type instantiation! ...
... Part of the contribution of this paper is the design of a likelihood that conforms to our intuitions, such that structures with higher likelihoods also tend to be the ones that are subjectively simpler. We refer to trees in this broadened hypothesis space as rose trees, as they are known in the functional programming literature (Bird 1998;Meertens 1988), and our model as Bayesian rose tree mixture models. The non-binary tree given in Figure 1.1(right) is in fact the structure discovered by our model. ...
Chapter
Rich hierarchical structures are common across many disciplines, making the discovery of hierarchies a fundamental exploratory data analysis and unsupervised learning problem. Applications with natural hierarchical structure include topic hierarchies in text (Blei et al. 2010), phylogenies in evolutionary biology (Felsenstein 2003), hierarchical community
... There have been many studies on parallel skeletons for lists or arrays3456789 and for binary trees9101112131415, but there were few studies for general trees of arbitrary shapes. This paper addresses parallel programming on rose trees [16] , trees of arbitrary shapes. Many tree structures are straightforwardly formalized as rose trees, and many tree algorithms can be specified on these rose trees. ...
Article
Trees are important datatypes that are often used in representing structured data such as XML. Though trees are widely used in sequential programming, it is hard to write efficient parallel programs manipulating trees, because of their irregular and ill-balanced structures. In this paper, we propose a solution based on the skeletal approach. We formalize a set of skeletons (abstracted computational patterns) for rose trees (general trees of arbitrary shapes) based on the theory of Constructive Algorithmics. Our skeletons for rose trees are extensions of those proposed for lists and binary trees. We show that we can implement the skeletons efficiently in parallel, by combining the parallel binary-tree skeletons for which efficient parallel implementations are already known. As far as we are aware, we are the first who have formalized and implemented a set of simple but expressive parallel skeletons for rose trees.
... In this paper we broaden the hypothesis space of our hierarchical clustering algorithm to include trees with arbitrary branching structure at each internal node. We refer to these as rose trees, as they are known in the functional programming literature (Meertens, 1988). Since there are many more options for branching structure, the space of rose trees is larger than binary trees 1 , and the search for good trees is correspondingly harder. ...
Article
Full-text available
Hierarchical structure is ubiquitous in data across many domains. There are many hierarchical clustering methods, frequently used by domain experts, which strive to discover this structure. However, most of these methods limit discoverable hierarchies to those with binary branching structure. This limitation, while computationally convenient, is often undesirable. In this paper we explore a Bayesian hierarchical clustering algorithm that can produce trees with arbitrary branching structure at each node, known as rose trees. We interpret these trees as mixtures over partitions of a data set, and use a computationally efficient, greedy agglomerative algorithm to find the rose trees which have high marginal likelihood given the data. Lastly, we perform experiments which demonstrate that rose trees are better models of data than the typical binary trees returned by other hierarchical clustering algorithms.
Chapter
Structured recursion schemes have been widely used in constructing, optimizing, and reasoning about programs over inductive and coinductive datatypes. Their plain forms, catamorphisms and anamorphisms, are restricted in expressivity. Thus many generalizations have been proposed, which further led to several unifying frameworks of structured recursion schemes. However, the existing work on unifying frameworks typically focuses on the categorical foundation, and thus is perhaps inaccessible to practitioners who are willing to apply recursion schemes in practice but are not versed in category theory. To fill this gap, this expository paper introduces structured recursion schemes from a practical point of view: a variety of recursion schemes are motivated and explained in contexts of concrete programming examples. The categorical duals of these recursion schemes are also explained.
Article
By definition, apartition of a list is a division of that list into nonempty contiguous segments. Many programming and operations research problems can be specified in terms of list partitions, and we present a hierarchy of theorems for deriving programs from such specifications. Throughout, reasoning is conducted in an equational style using the calculus for program synthesis developed by Bird and Meertens.
Article
The construction of structure-preserving maps, “homomorphisms”, is described for an arbitrary data type, and a “promotion” theorem is derived for proving equalities of homomorphisms. Examples are given for finite lists, tree structures and types defined by mutual induction; the construction is then dualised to data types with infinite objects, such as infinite lists. The promotion theorem allows the development of concise, calculational proofs: several examples are given of its application to program transformation.
Conference Paper
Full-text available
Precise mode information is important for compiler optimisations and in program development tools. Within the framework of abstract compilation, the precision of a mode analysis depends, in part, on the expressiveness of the abstract domain and its associated abstraction function. This paper considers abstract domains for polymorphically typed logic programs and shows how specialised domains may be constructed for each type in the program. These domains capture the degree of instantiation to a high level of precision. By providing a generic definition of abstract unification, the abstraction of a program using these domains is formalised. The domain construction procedure is fully implemented using the Gödel language and tested on a number of example programs to demonstrate the viability of the approach. Note: Some proofs have been omitted for space reasons. They can be found in the full version of this paper [17].
Conference Paper
The construction of structure-preserving maps, or homomorphisms, is described for an arbitrary data type: examples of these functions are given for list- and tree-like structures and types defined by mutual induction. From the definition of a data type it is also possible to infer a promotion theorem for proving equalities of homomorphisms.
ResearchGate has not been able to resolve any references for this publication.