Results 1  10
of
24
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 74 (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...
EQUIVALENCES AND TRANSFORMATIONS OF REGULAR SYSTEMS  APPLICATIONS TO RECURSIVE PROGRAM SCHEMES AND GRAMMARS
, 1986
"... This work presents a unified theory of recursive program schemes, contextfree grammars, grammars on arbitrary algebraic structures and, in fact, recursive definitions of all kind by means of regular systems. The equivalences of regular systems associated with either all their solutions or their le ..."
Abstract

Cited by 27 (5 self)
 Add to MetaCart
This work presents a unified theory of recursive program schemes, contextfree grammars, grammars on arbitrary algebraic structures and, in fact, recursive definitions of all kind by means of regular systems. The equivalences of regular systems associated with either all their solutions or their least solutions (in all domains of appropriate type satisfying a set of algebraic laws expressed by equations) are systematically investigated and characterized (in some cases) in terms of system transformations by folding, unfolding and rewriting according to the equational algebraic laws. Grammars are better characterized in terms of polynomial systems which are regular systems involving the operation of set union, and the same questions are raised for them. We also examine conditions insuring the uniqueness of the solution of a regular or of a polynomial system. This theory applies to grammars of many kinds which generate trees, graphs, etc. We formulate some classical transformations of contextfree grammars in terms of correct transformations which only use folding, unfolding and algebraic laws and we immediately obtain their correctness.
Declarative Program Transformation: a Deforestation casestudy
, 1999
"... Software engineering has to reconcile modularity with e ciency. One way to grapple with this dilemma is to automatically transform a modularspecied program into an ecientimplementable one. ..."
Abstract

Cited by 15 (2 self)
 Add to MetaCart
Software engineering has to reconcile modularity with e ciency. One way to grapple with this dilemma is to automatically transform a modularspecied program into an ecientimplementable one.
On traced monoidal closed categories
, 2008
"... ... focus on a simple observation that a traced monoidal category C is closed if and only if the canonical inclusion from C into Int C has a right adjoint. Thus, every traced monoidal closed category arises as a monoidal coreflexive full subcategory of a tortile monoidal category. From this, we der ..."
Abstract

Cited by 12 (2 self)
 Add to MetaCart
... focus on a simple observation that a traced monoidal category C is closed if and only if the canonical inclusion from C into Int C has a right adjoint. Thus, every traced monoidal closed category arises as a monoidal coreflexive full subcategory of a tortile monoidal category. From this, we derive a series of facts for traced models of linear logic, and some for models of fixedpoint computation. To make the paper more selfcontained, we also include various background results for traced monoidal categories.
Generation of LR Parsers by Partial Evaluation
 ACM Transactions on Programming Languages and Systems
, 2000
"... this paper appeared in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and SemanticsBased Program Manipulation, 1995 under the title "The Essence of LR Parsing." Authors' addresses: Michael Sperber, WilhelmSchickardInstitut fur Informatik, Universitat Tubingen, Sand ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
this paper appeared in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and SemanticsBased Program Manipulation, 1995 under the title "The Essence of LR Parsing." Authors' addresses: Michael Sperber, WilhelmSchickardInstitut fur Informatik, Universitat Tubingen, Sand 13, D72076 Tubingen, Germany, sperber@informatik.unituebingen.de.
Symbolic Composition
, 1998
"... The deforestation of a functional program is a transformation which gets rid of intermediate data structures constructions that appear when two functions are composed. The descriptional composition, initially introduced by Ganzinger and Giegerich, is a deforestation method dedicated to the compositi ..."
Abstract

Cited by 7 (4 self)
 Add to MetaCart
The deforestation of a functional program is a transformation which gets rid of intermediate data structures constructions that appear when two functions are composed. The descriptional composition, initially introduced by Ganzinger and Giegerich, is a deforestation method dedicated to the composition of two attribute grammars. This article presents a new functional deforestation technique, called symbolic composition, based on the descriptional composition mechanism, but extending it. An automatic translation from a functional program into an equivalent attribute grammar allows symbolic composition to be applied, and then the result can be translated back into a functional program. This yields a source to source functional program transformation. The resulting deforestation method provides a better deforestation than other existing functional techniques. Symbolic composition, that uses the declarative and descriptional features of attribute grammars is intrinsically more powerful th...
Structuredirected Genericity in Functional Programming and Attribute Grammars
, 1997
"... Generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of datastructurebased transformations. This is achieved by making the structure of the data more explicit in program specifications. We argue that this very important pro ..."
Abstract

Cited by 5 (3 self)
 Add to MetaCart
Generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of datastructurebased transformations. This is achieved by making the structure of the data more explicit in program specifications. We argue that this very important property is one of the original concepts of attribute grammars. In this paper, we present the similarities between the fold formalism and attribute grammars. In particular, we show the equivalence of their respective deforestation methods. Given these results and the fundamental role of deforestation in the concept of structuredirected genericity, first devised for attribute grammars with descriptional composition, we show how the fold operator with its fusion method allow us to transport this concept in the area of functional programming.
Attribute Grammars and Functional Programming Deforestation
 IN FOURTH INTERNATIONAL STATIC ANALYSIS SYMPOSIUM  POSTER SESSION
, 1997
"... The functional programming community is paying increasing attention to static structurebased transformations. For example, generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of a particular kind of static transformation, c ..."
Abstract

Cited by 4 (3 self)
 Add to MetaCart
The functional programming community is paying increasing attention to static structurebased transformations. For example, generic control operators, such as fold, have been introduced in functional programming to increase the power and applicability of a particular kind of static transformation, called deforestation, which prevents the construction of useless intermediate data structures in function composition. This is achieved by making the structure of the data more explicit in program specifications. We argue that one of the original concepts of Attribute Grammars is precisely to make data structures explicit in program specifications. Furthermore, there exists a powerful static deforestationlike transformation in their context. In this paper, we present similarities between deforestation methods, on the one hand with the functional approach, and on the other hand with the Attribute Grammars approach. In order to gain a grasp of these similarities, we first make a simple compar...
Topdown parsing with simultaneous evaluation of noncircular attribute grammars
 FUNDAMENTA INFORMATICAE
, 1994
"... This paper introduces a machinery called attributed topdown parsing automaton which performs topdown parsing of strings and, simultaneously, the evaluation of arbitrary noncircular attribute grammars. The strategy of the machinery is based on a single depthfirst lefttoright traversal over the ..."
Abstract

Cited by 4 (4 self)
 Add to MetaCart
This paper introduces a machinery called attributed topdown parsing automaton which performs topdown parsing of strings and, simultaneously, the evaluation of arbitrary noncircular attribute grammars. The strategy of the machinery is based on a single depthfirst lefttoright traversal over the syntax tree. There is no need to traverse parts of the syntax tree more than once, and hence, the syntax tree itself does not have to be maintained. Attribute values are stored in a graph component, and values of attributes which are needed but not yet computed are represented by particular nodes. Values of attributes which refer to such uncomputed attributes are represented by trees over operation symbols in which pointers to the particular nodes at their leaves are maintained. Whenever eventually the needed attribute value is computed, it is glued into the graph at the appropriate nodes.
Strictness analysis for attribute grammars
 In PLILP'92, volume 631 of LNCS
, 1992
"... Attribute grammars may be seen as a (rather specialised) lazy or demanddriven programming language. The “programs ” in this language take text or parse trees as input and return values of the synthesised attributes to the root as output. From this observation we establish a framework for abstract i ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Attribute grammars may be seen as a (rather specialised) lazy or demanddriven programming language. The “programs ” in this language take text or parse trees as input and return values of the synthesised attributes to the root as output. From this observation we establish a framework for abstract interpretation of attribute grammars. The framework is used to construct a strictness analysis for attribute grammars. Results of the analysis enable us to transform an attribute grammar such that attributes are evaluated during parsing, if possible. The analysis is proved correct by relating it to a fixpoint semantics for attribute grammars. An implementation of the analysis is discussed and some extensions to the analysis are mentioned. 1