Results 1 
5 of
5
Attribute Grammars as a Functional Programming Paradigm
 Functional Programming Languages and Computer Architecture, volume 274 of LNCS
, 1987
"... The purpose of this paper is twofold. Firstly we show how attributes in an attribute grammar can be simply and efficiently evaluated using a lazy functional language. The class of attribute grammars we can deal with are the most general ones possible: attributes may depend on each other in an arbitr ..."
Abstract

Cited by 73 (2 self)
 Add to MetaCart
The purpose of this paper is twofold. Firstly we show how attributes in an attribute grammar can be simply and efficiently evaluated using a lazy functional language. The class of attribute grammars we can deal with are the most general ones possible: attributes may depend on each other in an arbitrary way, as long as there are no truly circular data dependencies. Secondly, we describe a methodology based on attribute grammars, where, in a fairly straightforward way, we can develop efficient functional programs where direct, conventional solutions yield less efficient programs. We review two examples from a paper by R. Bird (Using circular programs to eliminate multiple traversals of data, Acta Informatica, 21, 1984) where he transforms simple but inefficient multipass programs into more efficient single pass ones, but which on their own can be very hard to understand. We show how such efficient but tangled programs can have natural formulations as attribute grammars. We also propose a...
Type Theory and Programming
, 1994
"... This paper gives an introduction to type theory, focusing on its recent use as a logical framework for proofs and programs. The first two sections give a background to type theory intended for the reader who is new to the subject. The following presents MartinLof's monomorphic type theory and an im ..."
Abstract

Cited by 21 (2 self)
 Add to MetaCart
This paper gives an introduction to type theory, focusing on its recent use as a logical framework for proofs and programs. The first two sections give a background to type theory intended for the reader who is new to the subject. The following presents MartinLof's monomorphic type theory and an implementation, ALF, of this theory. Finally, a few small tutorial examples in ALF are given.
Precedences in Specifications and Implementations of Programming Languages
 Theoretical Computer Science
, 1991
"... Although precedences are often used to resolve ambiguities in programming language descriptions, there has been no parserindependent definition of languages which are generated by grammars with precedence rules. This paper gives such a definition for a subclass of contextfree grammars. The defi ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
Although precedences are often used to resolve ambiguities in programming language descriptions, there has been no parserindependent definition of languages which are generated by grammars with precedence rules. This paper gives such a definition for a subclass of contextfree grammars. The definition is shown to be equivalent to the implicit definition an operator precedence parser gives. A problem with a language containing infix, prefix and postfix operators of different precedences is that the wellknown algorithm, which transforms a grammar with infix operator precedences to an ordinary unambiguous contextfree grammar, does not work. This paper gives an algorithm that works also for prefix and postfix operators, and the correctness of it is proved. An application of the algorithm is also presented. 1 Introduction Precedences are used in many language descriptions to resolve ambiguities. The reason for resolving ambiguities with precedences, instead of using an unambig...
Compiling Lazy Functional Languages: An introduction
, 1987
"... Machine (FAM) [Car83] and the Categorical Abstract Machine (CAM) [CCM85] can be considered as variations of the SECD theme. Wadsworth [Wad71] describes an interpreter for the calculus which performs normalorder graph reduction. In graph reduction, the expression being reduced is represented A by ..."
Abstract
 Add to MetaCart
Machine (FAM) [Car83] and the Categorical Abstract Machine (CAM) [CCM85] can be considered as variations of the SECD theme. Wadsworth [Wad71] describes an interpreter for the calculus which performs normalorder graph reduction. In graph reduction, the expression being reduced is represented A by a directed graph (in Wadsworth's reducer it is also acyclic). When a reduction rule is applied, be it fireduction as in this case, or e.g. combinator reduction, the root of the reducible expression is overwritten with the result of the reduction. In Wadsworth's graph reducer, when applying the reduction rule (v:e)e 0 ) e[e 0 =v], a copy of the graph of the body e is created, with pointers to e 0 substituted for free occurrences of vif v occurs twice or more e 0 thus becomes shared. When reducing a shared subgraph, all other uses of this subgraph benefit from the first reduction. Wadsworth coins the term callbyneed for the mechanism whereby an expression is reduced at most o...
A Set Constructor for Inductive Sets in MartinLof's Type Theory
 In Category Theory and Computer Science
, 1989
"... this paper, we will define a set constructor that one could use for defining many inductive data types ..."
Abstract
 Add to MetaCart
this paper, we will define a set constructor that one could use for defining many inductive data types