0

I am wondering if there exists an example attribute grammar that is non-circular but not l-ordered (l-ORD) as well.

The reason I am asking this is one can find an attribute grammar that is circular, then it will obviously not be an l-ORD. But I am wondering if there even exists a non-circular AG that is also not l-ORD.

Node.JS
  • 151
  • 1
  • 12

3 Answers3

1

In Figure 12 of my paper on conditional attribute grammars, it gives the following strongly non-circular attribute grammar that is not doubly non-circular (and therefore not l-ORD):

S -> 0 L
    L.inh1 = 0
    L.inh2 = L.syn1
    S.result = L.syn2

S -> 1 L L.inh2 = 0 L.inh1 = L.syn2 S.result = L.syn1

L -> L.syn1 = L.inh1 L.syn2 = L.syn2

It is non-circular (even strongly non-circular) since each synthesized attribute of L depends only on the corresponding inherited attribute, but depending on the context, each may need to be done before the other. Hence no fixed order of attributes can be required.

0

You could take an L-Ord Attribute Grammar, replace all inherit attributes by synthetic attributes and all synthetic attributes by inherit ones and reverse all assignments... then you have a grammar that isn't L-Ord and still non-circular. I would call that R-Ord, because you have reversed all arrows and can traverse it right-to-left instead of left-to-right.

Algoman
  • 156
  • 4
0

The Grammar in my answer to Full circularity vs strong circularity for attribute grammars (that you had already found) is also not L-Ord, because L-Ord Attribute Grammars are strongly-non-circular. Since said grammar isn't strongly-non-circular, it's not L-Ord. (And it's also not circular).

Algoman
  • 156
  • 4