Results 1 
7 of
7
The UnderAppreciated 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 breadthfirst traversal of a tree. We specify brea ..."
Abstract

Cited by 51 (11 self)
 Add to MetaCart
(Show Context)
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 breadthfirst traversal of a tree. We specify breadthfirst traversal in terms of levelorder 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 breadthfirst traversal directly as an unfold; this turns out to be the `standard' queuebased algorithm.
Generic Downwards Accumulations
 Science of Computer Programming
, 2000
"... . A downwards accumulation is a higherorder operation that distributes information downwards through a data structure, from the root towards the leaves. The concept was originally introduced in an ad hoc way for just a couple of kinds of tree. We generalize the concept to an arbitrary regular d ..."
Abstract

Cited by 25 (6 self)
 Add to MetaCart
. A downwards accumulation is a higherorder operation that distributes information downwards through a data structure, from the root towards the leaves. The concept was originally introduced in an ad hoc way for just a couple of kinds of tree. We generalize the concept to an arbitrary regular datatype; the resulting denition is coinductive. 1 Introduction The notion of scans or accumulations on lists is well known, and has proved very fruitful for expressing and calculating with programs involving lists [4]. Gibbons [7, 8] generalizes the notion of accumulation to various kinds of tree; that generalization too has proved fruitful, underlying the derivations of a number of tree algorithms, such as the parallel prex algorithm for prex sums [15, 8], Reingold and Tilford's algorithm for drawing trees tidily [21, 9], and algorithms for query evaluation in structured text [16, 23]. There are two varieties of accumulation on lists: leftwards and rightwards. Leftwards accumulation ...
On the Generalized BoxDrawing of Trees —Survey and New Technology—
"... Abstract: This paper is on the aesthetic layout of nary trees with nodes of variable size, also referred to as generalized boxdrawing. For this layout problem a few algorithms have been proposed, which differ in their runtime performance and the attained aesthetic criteria. We introduce a new appr ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Abstract: This paper is on the aesthetic layout of nary trees with nodes of variable size, also referred to as generalized boxdrawing. For this layout problem a few algorithms have been proposed, which differ in their runtime performance and the attained aesthetic criteria. We introduce a new approach to this layout problem, which is interesting because of both its simplicity and elegance, and which employs the following piggyback metaphor: The original boxdrawing problem, Π, is topologically reformulated as a layout problem with uniform node size, resulting in a new drawing problem Π ′ , which then is handled by the best tree layout algorithm for uniform node size developed so far. The reformulation step can be done in linear time in the number of nodes of the original tree, resulting in an overall linear time complexity. Compared to the existing approaches our approach fulfills more aesthetic criteria; experiments have also shown its efficiency in complex layout settings.
Accumulating Attributes for Doaitse Swierstra, on his retirement
"... Abstract. Doaitse has always been enthusiastic about attribute grammars, seeing them even where most people don’t. While I was writing up my DPhil thesis, he explained to me where they were in that too. This paper is by way of belated thanks for that perspective—and as a more general rendering of th ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
Abstract. Doaitse has always been enthusiastic about attribute grammars, seeing them even where most people don’t. While I was writing up my DPhil thesis, he explained to me where they were in that too. This paper is by way of belated thanks for that perspective—and as a more general rendering of the observation, with the benefit of hindsight and twenty years of progress. 1
Drawing Nonlayered Tidy Trees in Linear Time A.J. van der Ploeg
, 2013
"... The wellknown ReingoldTilford algorithm produces tidy layered drawings of trees: drawings where all nodes at the same depth are vertically aligned. However, when nodes have varying heights, layered drawing may use more vertical space than necessary. A nonlayered drawing of a tree places children ..."
Abstract
 Add to MetaCart
(Show Context)
The wellknown ReingoldTilford algorithm produces tidy layered drawings of trees: drawings where all nodes at the same depth are vertically aligned. However, when nodes have varying heights, layered drawing may use more vertical space than necessary. A nonlayered drawing of a tree places children at a fixed distance from the parent, thereby giving a more vertically compact drawing. Moreover, nonlayered drawings can also be used to draw trees where the vertical position of each node is given, by adding dummy nodes. In this paper we present the first linear time algorithm for producing nonlayered drawings. Our algorithm is a modification of the ReingoldTilford algorithm, but the original complexity proof of the ReingoldTilford algorithm uses an invariant that does not hold for the nonlayered case. We give an alternative proof of the algorithm and its extension to nonlayered drawings. To improve drawings of trees of unbounded degree, extensions to the ReingoldTilford algorithm have been proposed. These extensions also work in the nonlayered case, but we show that they then cause a O(n2) runtime. We then propose a modification to these extensions that restores the O(n) runtime. 1
Precise Reasoning About Nonstrict Functional Programs
"... This thesis consists of two parts. Both concern reasoning about nonstrict functional programming languages with partial and infinite values and lifted types, including lifted function spaces. The first part is a case study in program verification: We have written a simple parser and a corresponding ..."
Abstract
 Add to MetaCart
(Show Context)
This thesis consists of two parts. Both concern reasoning about nonstrict functional programming languages with partial and infinite values and lifted types, including lifted function spaces. The first part is a case study in program verification: We have written a simple parser and a corresponding prettyprinter in Haskell. A natural aim is to prove that the programs are, in some sense, each other’s inverses. The presence of partial and infinite values makes this exercise interesting. We have tackled the problem in different ways, and report on the merits of those approaches. More specifically, first a method for testing properties of programs in the presence of partial and infinite values is described. By testing before proving we avoid wasting time trying to prove statements that are not valid. Then it is proved that the programs we have written are in fact (more or less) inverses using first fixpoint induction and then the approximation lemma.