A Functional Semantics of Attribute Grammars

A Functional Semantics of Attribute Grammars

A definition of the semantics of attribute grammars is given,
using the lambda calculus. We show how this semantics allows us to prove
results about attribute grammars in a calculational style.

I didn't encounter attribute grammars since school, so it was refreshing to see them in this light.
I have to check yet, whether "abstract interpretation" used in this paper is related to the one from Oleg's paper.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Use futures...?

In practice, for such problems I would prefer to use some language with futures instead of fix points :-)

Need to investigate, how related they are... I can see some similarity between fix point and unification.

I said it hurts :-)

An earlier paper by one of the authors:
First-class Attribute Grammars

There exists a well-known encoding of attribute grammars into programming languages that have lazy evaluation. This encoding has been dismissed by others on the following grounds:
• Lazy evaluation is inherently inefficient, and therefore an attribute evaluator based on it must
be inefficient.
• The resulting programs are highly convoluted and much less modular than standard attribute
grammars.

The first objection has been refuted...
...The second objection remains valid, however...

Scary? Well, I cheated a bit, the above is the context of the paper, not its achievement.
Now the true stuff:


It is the compositional semantics (of well known structuring mechanisms) that is the contribution of this paper. The fact that the semantics is an executable prototype is a pleasant side effect of expressing ourselves in a lazy functional programming
language.

and


We believe that it is beneficial
to give a semantics to aspects, so that they are first-class values...

It's interesting to explore an evolution of a paper in time, seeing how the ideas change. For example, the later paper dropped notion of aspects. Is AOP really popular?