Results 1 - 10
of
18
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 71 (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...
Static Caching for Incremental Computation
- ACM Trans. Program. Lang. Syst
, 1998
"... A systematic approach is given for deriving incremental programs that exploit caching. The cache-and-prune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the final result, (II) the ..."
Abstract
-
Cited by 42 (19 self)
- Add to MetaCart
A systematic approach is given for deriving incremental programs that exploit caching. The cache-and-prune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the final result, (II) the extended program is incrementalized so that computation on a new input can use all intermediate results on an old input, %using existing techniques, and (III) unused results cached by the extended program and maintained by the incremental program are pruned away, leaving a pruned extended program that caches only useful intermediate results and a pruned incremental program that uses and maintains only the useful results. All three stages utilize static analyses and semantics-preserving transformations. Stages I and III are simple, clean, and fully automatable. The overall method has a kind of optimality with respect to the techniques used in Stage II. The method can be applied straightforwardly to provide a systematic approach to program improvement via caching.
Caching Intermediate Results for Program Improvement
- In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation
, 1995
"... A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from non-incremental programs. We exploit a number of program analysis and transformation techniques, centered around effective caching based on its utilization in deriving increment ..."
Abstract
-
Cited by 19 (6 self)
- Add to MetaCart
A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from non-incremental programs. We exploit a number of program analysis and transformation techniques, centered around effective caching based on its utilization in deriving incremental programs, in order to increase the degree of incrementality not otherwise achievable by using only the return values of programs that are of direct interest. Our method can be applied straightforwardly to provide a systematic approach to program improvement via caching. 1 Introduction Incremental programs take advantage of repeated computations on inputs that differ only slightly from one another, making use of the old output in computing a new output rather than computing from scratch. Methods of incremental computation have widespread application, e.g., optimizing compilers [2, 9, 11], transformational programming [29, 32, 42], interactive editing systems [4, 38], etc. In this paper, ...
A scalable formal method for design and automatic checking of user interfaces
- ACM Transactions on Software Engineering and Methodology
, 2005
"... ABSTRACT: The paper addresses the formal specification, design and implementation of the behavioral component of graphical user interfaces. The complex sequences of visual events and actions that constitute dialogs are speci-fied by means of modular, communicating grammars called VEG (Visual Event G ..."
Abstract
-
Cited by 19 (0 self)
- Add to MetaCart
ABSTRACT: The paper addresses the formal specification, design and implementation of the behavioral component of graphical user interfaces. The complex sequences of visual events and actions that constitute dialogs are speci-fied by means of modular, communicating grammars called VEG (Visual Event Grammars), which extend traditional BNF grammars to make them more convenient to model dialogs. A VEG specification is independent of the actual layout of the GUI, but it can easily be integrated with various layout design toolkits. Moreover, a VEG specification may be verified with the model checker SPIN, in order to test consistency and correctness, to detect deadlocks and unreachable states, and also to generate test cases for validation purposes. Efficient code is automatically generated by the VEG toolkit, based on compiler technology. Realistic applica-tions have been specified, verified and implemented, like a Notepad-style editor, a graph construction library and a large real application to medical software. It is also argued that VEG can be used to specify and test voice interfaces and multi-modal dialogs. The major contribution of our work is blending together a set of features coming from GUI design, compilers, software engineering and formal verification. Even though we do not claim novelty in each of the techniques adopted for VEG, they have been united into a toolkit supporting all GUI design phases, i.e., specification, design, verification and validation, linking to applications and coding. 1
Programming Language Specification and Prototyping Using the MAX System
- Programming Language Implementation and Logic Programming
, 1993
"... The paper describes the MAX system, a tool for specification and prototyping of language processors. The MAX system is based on a first--order framework generalizing attribute grammar like frameworks. It allows to refer to syntax tree nodes and "distant" attribute occurrences. Attributes may have ..."
Abstract
-
Cited by 9 (2 self)
- Add to MetaCart
The paper describes the MAX system, a tool for specification and prototyping of language processors. The MAX system is based on a first--order framework generalizing attribute grammar like frameworks. It allows to refer to syntax tree nodes and "distant" attribute occurrences. Attributes may have tree nodes as values, so that global relations between distant tree nodes can be expressed. This enables more compact and readable specifications for a wide class of complex problems. Within the presented framework, context conditions can be globally formulated by first--order predicate formulae. The paper explains the fundamental semantical concepts of the system, shows its application to a small name analysis problem, and describes the main implementation issues. In particular, we present a powerful attribute evaluation algorithm that can handle attribute dependencies arising during evaluation time. Finally, we report on the experiences made by the system and compare it to other s...
Using attribute grammars to derive efficient functional programs
- IN COMPUTING SCIENCE IN THE NETHERLANDS CSN'87
, 1987
"... Two mappings from attribute grammars to lazy functional programs are defined. One of these mappings is an efficient implementation of attribute grammars. The other mapping yields inefficient programs. It is shown how some transformations of functional programs may be better understood by viewing the ..."
Abstract
-
Cited by 9 (1 self)
- Add to MetaCart
Two mappings from attribute grammars to lazy functional programs are defined. One of these mappings is an efficient implementation of attribute grammars. The other mapping yields inefficient programs. It is shown how some transformations of functional programs may be better understood by viewing the programs as inefficient implementations of attribute grammars.
Circular Reference Attributed Grammars - Their Evaluation and Applications
- Science of Computer Programming
, 2003
"... This paper presents a combination of Reference Attributed Grammars (RAGs) and Circular Attribute Grammars (CAGs). While RAGs allow the direct and easy specification of non-locally dependent information, CAGs allow iterative fixed-point computations to be expressed directly using recursive (circular) ..."
Abstract
-
Cited by 9 (2 self)
- Add to MetaCart
This paper presents a combination of Reference Attributed Grammars (RAGs) and Circular Attribute Grammars (CAGs). While RAGs allow the direct and easy specification of non-locally dependent information, CAGs allow iterative fixed-point computations to be expressed directly using recursive (circular) equations. We demonstrate how the combined formalism, Circular Reference Attributed Grammars (CRAGs), can take advantage of both these strengths, making it possible to express solutions to many problems in an easy way. We exemplify with the specification and computation of the nullable, first, andfollow sets used in parser construction, aproblemwhichishighly recursive and normally programmed by hand using an iterative algorithm. We also present a general demand-driven evaluation algorithm for CRAGs and some optimizations of it. The approach has been implemented and experimental results include computations on a series of grammars including that of Java 1.2. We also revisit some of the classical examples of CAGs and show how their solutions are facilitated by CRAGs. 1
Deriving Incremental Implementations from Algebraic Specifications
, 1992
"... We present a technique for deriving incremental implementations for a subclass of algebraic specifications, namely, conditional well-presented primitive recursive schemes. We use concepts of the translation of well-presented primitive recursive schemes to strongly noncircular attribute grammars, ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
We present a technique for deriving incremental implementations for a subclass of algebraic specifications, namely, conditional well-presented primitive recursive schemes. We use concepts of the translation of well-presented primitive recursive schemes to strongly noncircular attribute grammars, storing results of function applications and their parameters as attributes in an abstract syntax tree of the first argument of the function in question. An attribute dependency graph is used to guide incremental evaluation. The evaluation technique is based on a leftmost innermost rewrite strategy. The technique is extended to conditional well-presented primitive recursive schemes. Whereas in the non-conditional case attribute dependency graphs are static and can be constructed before evaluating a term, when working with conditional equations the the attribute dependency graph is adapted upon evaluation. The class of well-presented primitive recursive schemes is a very natural one fo...
Strengthening invariants for efficient computation
- in Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages
, 2001
"... This paper presents program analyses and transformations for strengthening invariants for the purpose of efficient computation. Finding the stronger invariants corresponds to discovering a general class of auxiliary information for any incremental computation problem. Combining the techniques with p ..."
Abstract
-
Cited by 6 (4 self)
- Add to MetaCart
This paper presents program analyses and transformations for strengthening invariants for the purpose of efficient computation. Finding the stronger invariants corresponds to discovering a general class of auxiliary information for any incremental computation problem. Combining the techniques with previous techniques for caching intermediate results, we obtain a systematic approach that transforms non-incremental programs into ecient incremental programs that use and maintain useful auxiliary information as well as useful intermediate results. The use of auxiliary information allows us to achieve a greater degree of incrementality than otherwise possible. Applications of the approach include strength reduction in optimizing compilers and finite differencing in transformational programming.
Circular Attribute Grammars with Remote Attribute References and their Evaluators
- in Proceedings of 3rd Workshop on Attribute Grammars and their Applications (WAGA 2000)(Parigot
, 2002
"... Attribute grammars (AGs) are a suitable formalism for development of language processing systems. However, for languages including unrestricted labeled jumps, like "goto" in C, optimizers in compilers are hard to write in AGs. This is due to two problems which few previous researches could deal ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
Attribute grammars (AGs) are a suitable formalism for development of language processing systems. However, for languages including unrestricted labeled jumps, like "goto" in C, optimizers in compilers are hard to write in AGs. This is due to two problems which few previous researches could deal with simultaneously, i.e., references of attribute values on distant nodes and circularity in attribute dependency. This paper proposes circular remote attribute grammars (CRAGs), an extension of AGs which allows (1) direct relations between two distant attribute instances through pointers referring to other nodes in the derivation tree, and (2) circular dependencies under certain conditions including those which arise from remote references. This extension gives AG programmers a natural way to describe language processors and programming environments for languages including any type of jump structures. We will also show a way to construct an e#cient evaluator for CRAGs called a mostly static evaluator. Performance of the proposed evaluator has been measured and compared with dynamic and static evaluators.

