Results 1  10
of
13
Structuring DepthFirst Search Algorithms in Haskell
, 1995
"... Depthfirst search is the key to a wide variety of graph algorithms. In this paper we express depthfirst search in a lazy functional language, obtaining a lineartime implementation. Unlike traditional imperative presentations, we use the structuring methods of functional languages to construct alg ..."
Abstract

Cited by 28 (0 self)
 Add to MetaCart
Depthfirst search is the key to a wide variety of graph algorithms. In this paper we express depthfirst search in a lazy functional language, obtaining a lineartime implementation. Unlike traditional imperative presentations, we use the structuring methods of functional languages to construct algorithms from individual reusable components. This style of algorithm construction turns out to be quite amenable to formal proof, which we exemplify through a calculationalstyle proof of a far from obvious stronglyconnected components algorithm. Classifications: Computing Paradigms (functional programming) ; Environments, Implementations, and Experience (programming, graph algorithms). 1 Introduction The importance of depthfirst search (DFS) for graph algorithms was established twenty years ago by Tarjan (1972) and Hopcroft and Tarjan (1973) in their seminal work. They demonstrated how depthfirst search could be used to construct a variety of efficient graph algorithms. In practice, this...
A golden ratio notation for the real numbers
, 1991
"... Several methods to perform exact computations on real numbers have been proposed in the literature. In some of these methods real numbers are represented by infinite (lazy) strings of digits. It is a well known fact that, when this approach is taken, the standard digit notation cannot be used. New f ..."
Abstract

Cited by 11 (0 self)
 Add to MetaCart
(Show Context)
Several methods to perform exact computations on real numbers have been proposed in the literature. In some of these methods real numbers are represented by infinite (lazy) strings of digits. It is a well known fact that, when this approach is taken, the standard digit notation cannot be used. New forms of digit notations are necessary. The usual solution to this representation problem consists in adding new digits in the notation, quite often negative digits. In this article we present an alternative solution. It consists in using non natural numbers as “base”, that is, in using a positional digit notation where the ratio between the weight of two consecutive digits is not necessarily a natural number, as in the standard case, but it can be a rational or even an irrational number. We discuss in full detail one particular example of this form of notation: namely the one having two digits (0 and 1) and the golden ratio as base. This choice is motivated by the pleasing properties enjoyed by the golden ratio notation. In particular, the algorithms for the arithmetic operations are quite simple when this notation is used.
Functional Graph Algorithms with DepthFirst Search (Preliminary Summary)
 in Glasgow Functional Programming Workshop
, 1993
"... Performing a depthfirst search of a graph is one of the fundamental approaches for solving a variety of graph algorithms. Implementing depthfirst search efficiently in a pure functional language has only become possible with the advent of imperative functional programming. In this paper we mix the ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
(Show Context)
Performing a depthfirst search of a graph is one of the fundamental approaches for solving a variety of graph algorithms. Implementing depthfirst search efficiently in a pure functional language has only become possible with the advent of imperative functional programming. In this paper we mix the techniques of pure functional programming in the same cauldron as depthfirst search to yield a more lucid approach to viewing a variety of graph algorithms. This claim will be illustrated with several examples. 1 Introduction Graph algorithms have long been a challenge to functional programmers. It has not been at all clear how to express such algorithms without using side effects to achieve efficiency. For example, many texts provide implementations of search algorithms which are quadratic in the size of the graph (see [7, 3, 2], for instance), compared with the standard linear implementations given for imperative languages (see [1], for instance). In this paper we implement a variety of ...
Dynamic Cyclic Data Structures in Lazy Functional Languages
, 1995
"... Many popular myths have evolved about functional programming languages and their power of expression; one such myth is that "functional languages cannot construct arbitrary cyclic data structures at runtime" and therefore that functional languages are not appropriate for problems which re ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Many popular myths have evolved about functional programming languages and their power of expression; one such myth is that "functional languages cannot construct arbitrary cyclic data structures at runtime" and therefore that functional languages are not appropriate for problems which require efficient representations of dynamicallyspecified cyclic graph structures (such as a routefinding robot in a maze). This myth persists despite ample published work to the contrary (see for example [All89]) and is a recurring subject of debate [USE]. We provide a survey of some of the related work in this area; we then build on this work by presenting methods for both the dynamic construction of complex cyclic structures and their direct manipulation using circular programming techniques. 1 Introduction "A" "B" "C" "D" Figure 1: A small, directed, cyclic graph If one were asked to use a functional language to construct the directed graph given in Figure 1 then the resulting code might typically...
A golden ratio notation . . .
, 1996
"... Several methods to perform exact computations on real numbers have been proposed in the literature. In some of these methods real numbers are represented by infinite (lazy) strings of digits. It is a well known fact that, when this approach is taken, the standard digit notation cannot be used. New f ..."
Abstract
 Add to MetaCart
Several methods to perform exact computations on real numbers have been proposed in the literature. In some of these methods real numbers are represented by infinite (lazy) strings of digits. It is a well known fact that, when this approach is taken, the standard digit notation cannot be used. New forms of digit notations are necessary. The usual solution to this representation problem consists in adding new digits in the notation, quite often negative digits. In this article we present an alternative solution. It consists in using non natural numbers as "base", that is, in using a positional digit notation where the ratio between the weight of two consecutive digits is not necessarily a natural number, as in the standard case, but it can be a rational or even an irrational number. We discuss in full detail one particular example of this form of notation: namely the one having two digits (0 and 1) and the golden ratio as base. This choice is motivated by the pleasing properties enjoyed...
Teaching Functional Programming to FirstYear Students
 in International Relations—International Studies Notes Special Issue
, 1993
"... In the period 19861991, experiments have been carried out with an introductory course in computer programming, based on functional programming. Due to thorough educational design and evaluation, a successful course has been developed. This has led to a revision of the computer programming education ..."
Abstract
 Add to MetaCart
In the period 19861991, experiments have been carried out with an introductory course in computer programming, based on functional programming. Due to thorough educational design and evaluation, a successful course has been developed. This has led to a revision of the computer programming education in the first year of the computer science curriculum at the University of Twente. This article describes the approach, the aim of the computer programming course, the outline and subject matter of the course and the evaluation. Educational research has been done to assess the quality of the course. Contents 1 Introduction 50 1.1 Motivation 50 1.2 The students 51 2 The computer programming course 51 2.1 Functional Programming 52 2.2 Imperative Programming 53 2.3 Programming techniques 53 2.4 Instructional material 54 3 Evaluations 55 3.1 Observations 55 3.2 Problems 56 3.3 Functional versus imperative programming 58 4 Programming project 60 4.1 Organisation 61 4.2 Railway information sys...
La programacion funcional en Haskell
, 1995
"... o se entiende aqu'i como, a la vez, mayor lejan'ia al computador y mayor cercan'ia al modo de razonar de los programadores. La distancia entre los lenguajes imperativos y la arquitectura del computador subyacente, la arquitectura Von Neumann, es mucho m'as peque~na que en el caso ..."
Abstract
 Add to MetaCart
o se entiende aqu'i como, a la vez, mayor lejan'ia al computador y mayor cercan'ia al modo de razonar de los programadores. La distancia entre los lenguajes imperativos y la arquitectura del computador subyacente, la arquitectura Von Neumann, es mucho m'as peque~na que en el caso funcional. De hecho, las construcciones de un lenguaje imperativo son un recubrimiento edulcorado de los correspondientes dispositivos del hardware. As'i, la memoria est'a representada por las variables del programa, los saltos condicionales e incondicionales del computador, por las instrucciones de control del lenguaje, y las operaciones de transferencia de datos entre la memoria y la UCP, por la instrucci'on de asignaci'on. No es posible establecer este paralelismo en el caso de la PF. Su modelo de c'omputo est'a basado, como se ha dicho, en la l'ogica ecuacional. De hecho, esta mayor distancia entre el modelo de c'omputo de la PF y el computador Von Neumann es uno de los obst'aculos para que la PF alcance u...
Strictness Analysis  Another Method
, 1993
"... Strictness analysis is a compile time analysis applicable to lazy functional programming languages. Strictness analysis can be used to significantly improve uniprocessor implementation speed and to derive nonspeculative parallelism. Many methods for doing strictness analysis have been proposed. Mos ..."
Abstract
 Add to MetaCart
Strictness analysis is a compile time analysis applicable to lazy functional programming languages. Strictness analysis can be used to significantly improve uniprocessor implementation speed and to derive nonspeculative parallelism. Many methods for doing strictness analysis have been proposed. Most of these are based on abstract interpretation and require fixpoint iteration. In this thesis we survey existing methods and then go on to define a new method which does not require fixpoint iteration. The new method is significantly more efficient than methods based on abstract interpretation. The abstract domain used is not fixed and can be expanded to obtain better accuracy. Our method is also easy to prove correct. We discuss further work necessary for the new method to realise its potential as a framework for fast and practical analyses.