Results 11  20
of
43
Between Functions and Relations in Calculating Programs
, 1992
"... This thesis is about the calculational approach to programming, in which one derives programs from specifications. One such calculational paradigm is Ruby, the relational calculus developed by Jones and Sheeran for describing and designing circuits. We identify two shortcomings with derivations made ..."
Abstract

Cited by 15 (4 self)
 Add to MetaCart
(Show Context)
This thesis is about the calculational approach to programming, in which one derives programs from specifications. One such calculational paradigm is Ruby, the relational calculus developed by Jones and Sheeran for describing and designing circuits. We identify two shortcomings with derivations made using Ruby. The first is that the notion of a program being an implementation of a specification has never been made precise. The second is to do with types. Fundamental to the use of type information in deriving programs is the idea of having types as special kinds of programs. In Ruby, types are partial equivalence relations (pers). Unfortunately, manipulating some formulae involving types has proved difficult within Ruby. In particular, the preconditions of the `induction' laws that are much used within program derivation often work out to be assertions about types; such assertions have typically been verified either by informal arguments or by using predicate calculus, rather than by ap...
Prolog's Control Constructs in a Functional . . .
 INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE
"... The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs including the cut, all solution collecting functions, and error handling facilities. Embedded Prolog lacks some concepts such as logical variables but it inherits all of Haskell's strengths, eg static polymorphic typing, higher order functions etc. Technically, the integration is achieved using monads and monad transformers. One of the main innovations is the de nition of a backtracking monad transformer, which allows us to combine backtracking with exception handling and interaction. Second, we work towards an axiomatization of the operations, through which the computational features are accessed. Equations are used to lay down the meaning of the various operations and their interrelations enabling the programmer to reason about programs in a simple calculational style. The axiomatization is applied to show that each nite computation has a simple canonical form.
More Advice on Proving a Compiler Correct: Improve a Correct Compiler
, 1994
"... This paper is a condensed version of the author's PhD thesis [19]. Besides the compiler for the im perative language described in this paper, the thesis derives implementations of a simple functional and a simple logic programming language ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
(Show Context)
This paper is a condensed version of the author's PhD thesis [19]. Besides the compiler for the im perative language described in this paper, the thesis derives implementations of a simple functional and a simple logic programming language
Total Parser Combinators
, 2009
"... A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library’s interface is similar to that of many other parser combinator libraries, with two important differences: one is that the interface clearly specif ..."
Abstract

Cited by 10 (3 self)
 Add to MetaCart
(Show Context)
A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library’s interface is similar to that of many other parser combinator libraries, with two important differences: one is that the interface clearly specifies which parts of the constructed parsers may be infinite, and which parts have to be finite, using a combination of induction and coinduction; and the other is that the parser type is unusually informative. The library comes with a formal semantics, using which it is proved that the parser combinators are as expressive as possible. The implementation
Constructing Functional Programs for Grammar Analysis Problems
 In Conference Record of FPCA '95, SIGPLANSIGARCHWG2.8 Conference on Functional Programming Languages and Computer Architecture
, 1995
"... This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of n ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
(Show Context)
This paper discusses the derivation of functional programs for grammar analysis problems, such as the Empty problem and the Reachable problem. Grammar analysis problems can be divided into two classes: topdown problems such as Follow and Reachable, which are described in terms of the contexts of nonterminals, and bottomup problems such as Empty and First, which do not refer to contexts. In a previous paper we derive a program for bottomup grammar analysis problems. In this paper we derive a program for topdown grammar analysis problems by transforming the specification of an arbitrary topdown problem into a program. The existence of a solution is guaranteed provided some natural conditions are satisfied. Furthermore, we describe a general transformation that applies to both classes of grammar analysis problems. The result of this transformation is a program that avoids unnecessary computations in the computation of a fixed point. Constructor classes, which are used to abstract fr...
A Systematic Study of Functional Language Implementations
 ACM Transactions on Programming Languages and Systems
, 1998
"... : We introduce a unified framework to describe, relate, compare and classify functional language implementations. The compilation process is expressed as a succession of program transformations in the common framework. At each step, different transformations model fundamental choices. A benefit of t ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
(Show Context)
: We introduce a unified framework to describe, relate, compare and classify functional language implementations. The compilation process is expressed as a succession of program transformations in the common framework. At each step, different transformations model fundamental choices. A benefit of this approach is to structure and decompose the implementation process. The correctness proofs can be tackled independently for each step and amount to proving program transformations in the functional world. This approach also paves the way to formal comparisons by making it possible to estimate the complexity of individual transformations or compositions of them. Our study aims at covering the whole known design space of sequential functional languages implementations. In particular, we consider callbyvalue, callbyname and callbyneed reduction strategies as well as environment and graphbased implementations. We describe for each compilation step the diverse alternatives as program tr...
Back to Basics: Deriving Representations Changers Without Relations
, 1994
"... A representation changer is a function that can be specified in a particular way in terms of two other functions. Examples of representation changers include binary addition and multiplication, base conversion, and compilers. There has been much recent work in using a relational language, namely ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
A representation changer is a function that can be specified in a particular way in terms of two other functions. Examples of representation changers include binary addition and multiplication, base conversion, and compilers. There has been much recent work in using a relational language, namely Jones and Sheerans' Ruby, to derive representation changers from their specifications using equational reasoning. In this paper
Calculate categorically
 Formal Aspects of Computing
, 1992
"... Diagram chasing is an established proof technique in Category Theory. Algebraic calculation is a good alternative; made possible thanks to a notation for various unique arrows and a suitable formulation of initiality, and the calculational properties brought forward by initiality. ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
(Show Context)
Diagram chasing is an established proof technique in Category Theory. Algebraic calculation is a good alternative; made possible thanks to a notation for various unique arrows and a suitable formulation of initiality, and the calculational properties brought forward by initiality.
From Interpreter to Compiler using Staging and Monads
, 1998
"... In writing this paper we had two goals. First, to promote MetaML, a programming language for writing staged programs, and second, to demonstrate that staging a program can have significant benefits. We do this by example: the derivation of an executable compiler for a small language. We derive the c ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
(Show Context)
In writing this paper we had two goals. First, to promote MetaML, a programming language for writing staged programs, and second, to demonstrate that staging a program can have significant benefits. We do this by example: the derivation of an executable compiler for a small language. We derive the compiler in a rigorous fashion from a semantic description of the language. This is done by staging a denotational semantics, expressed as a monadic interpreter. The compiler is a program generator, taking a program in the source language "a whileprogram" as input and producing an ML program as target. The ML program produced is in a restricted subset of ML over which the programmer has complete control. It is encapsulated in a special datastructure called code. The metaprogramming capabilities of MetaML allow this datastructure to be directly executed "runtime code generation", or to be analysed. We illustrate this analysis of generated code to build a source to source transf...
Structurally Recursive Descent Parsing
, 2008
"... Recursive descent parsing does not terminate for left recursive grammars. We turn recursive descent parsing into structurally recursive descent parsing, acceptable by total dependently typed languages like Agda, by using the type system to rule out left recursion. The resulting library retains much ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Recursive descent parsing does not terminate for left recursive grammars. We turn recursive descent parsing into structurally recursive descent parsing, acceptable by total dependently typed languages like Agda, by using the type system to rule out left recursion. The resulting library retains much of the flavour of ordinary “list of successes ” combinator parsers. In particular, the type indices used to rule out left recursion can in many cases be inferred automatically, so that