<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Coupled Transformations of Shared Packed Parse Forests</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vadim Zaytsev</string-name>
          <email>vadim@grammarware.net</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universiteit van Amsterdam</institution>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>SPPF (shared packed parse forest) is the best known graph representation of a parse forest (family of related parse trees) used in parsing with ambiguous/conjunctive grammars. Systematic general purpose transformations of SPPFs have never been investigated and are considered to be an open problem in software language engineering. In this paper, we motivate the necessity of having a transformation operator suite for SPPFs and extend the state of the art grammar transformation operator suite to metamodel/model (grammar/graph) cotransformations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
      <p>
        Classically, parsing consumes a string of characters or tokens, recognises its
grammatical structure and produces a corresponding parse tree [
        <xref ref-type="bibr" rid="ref1 ref52">1,52</xref>
        ].
However, sometimes we end up in situations when trees are not expressive enough.
The most common scenarios include generalised parsing and Boolean
grammarbased parsing. Generalised parsing algorithms (GLR [
        <xref ref-type="bibr" rid="ref43">43</xref>
        ], SGLR [
        <xref ref-type="bibr" rid="ref44">44</xref>
        ], GLL [
        <xref ref-type="bibr" rid="ref39">39</xref>
        ],
RIGLR [
        <xref ref-type="bibr" rid="ref38">38</xref>
        ], etc) differ from the classic ones in dealing with ambiguities [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]:
instead of trying to avoid, ignore or report them, ambiguous parses result in
so called parse forests — sets of equally grammatically correct parse trees. In
practice, these sets usually need to be filtered or ranked in order to make full use
of the available tree-based approaches to program analysis and transformation.
In Boolean grammars [
        <xref ref-type="bibr" rid="ref34">34</xref>
        ] and conjunctive grammars [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ], we have conjunctive
clauses in a grammar as first class citizens and must treat them properly when
parsing, which means having special kinds of nodes in a parse tree whose
descendant subtrees share leaves [
        <xref ref-type="bibr" rid="ref35">35</xref>
        ]. Both kinds of structures defined by these two
related approaches conceptually are parse forests.
      </p>
      <p>
        There have been various attempts in the past to represent parse forests.
The earliest ones required a grammar to be in a Chomsky Normal Form [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]
— theoretically a reasonable assumption since any context-free grammar can
be normalised to CNF, but ultimately we need a parse forest for the original
grammar, not for the normalised one, which would require bidirectional grammar
transformations [
        <xref ref-type="bibr" rid="ref46">46</xref>
        ] to be coupled with tree and forest transformations, which
is far from trivial.
      </p>
      <p>
        The next attempt in representing parse forests revolved around tree
merging [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]: such a parse forest representation would result in a tree-like DAG with
all the edges of all the trees in the forest. This is obviously an
overapproximation of the forest (see Figure 1), which requires additional information in order
to be unfolded into a set of trees — in other words, in order for any sensible
manipulation to happen. Obviously, having a data structure that requires so much
nontrivial postprocessing overhead, is highly undesirable.
      </p>
      <p>The best representation of a conceptual parse forest (a set of trees with
equal lists of leaves) so far is a so-called shared packed parse forest [43, §2.4],
SPPF from now on: its components are merged from the top until the divergent
nodes, and due to maximal sharing the leaves and perhaps even entire subtrees
grouping leaves together, are also merged. An example of such a graph is given
on Figure 2. Formally, an SPPF is an acyclic ordered directed graph where each
edge is a tuple from a vertex to a linearly ordered list of successors and each
vertex may have more than one successor list. If V is a set of vertices, then edges
are:</p>
      <p>E = fhvi; (vi1; vi2; :::; viki )i j vi 2 V; vij 2 V g
V</p>
      <p>V</p>
      <p>
        SPPF-like structures are used nowadays both in software language toolkits
that allow explicit ambiguities (such as Rascal [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]) and those that allow explicit
conjunctive clauses (such as TXL [
        <xref ref-type="bibr" rid="ref42">42</xref>
        ]). For a detailed view on the
implementation details we refer the readers to a paper on ATerms [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. However, the theory
of their transformations is underdeveloped — this was pointed out as one of the
major open problems in modern software language engineering by James Cordy
and explained in his recent keynote at the OOPSLE workshop [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Transformation</title>
      <p>
        For many years trees have been the dominant data structure for representing
hierarchical data in software language processing. They are remarkably easy
to define, formalise, implement, validate, visualise and transform. There are
many ways to circumvent data representation as graphs by considering a tree
together with a complementary component such as a relation between its vertices
that would have turned a tree into a cyclic graph, as well as many
optimisations of graph algorithms that work on skeleton trees of a graph. Take, for
instance, traversing a tree — it can be done hierarchically from the root
towards the leaves or incrementally from the leaves towards the root, each case
guaranteed termination even if the traversal is not supposed to stop when a
match is made. This naturally provides us with four traversal strategies found
in metaprogramming: bottom-up-continue, bottom-up-break, top-down-continue
and top-down-break [
        <xref ref-type="bibr" rid="ref22 ref8">8,22</xref>
        ]. More sophisticated and flexible traversal strategies
exist (e.g., Nuthatch [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]), but the actual need for them is rather rare. For a
detailed overview of visiting functions, strategic programming and typed/untyped
rewriting we refer the readers to the work of van den Brand et al [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and the
bibliography thereof. This section is focused on finding existing techniques that
can be or are in fact SPPF transformations.
+
2
2
      </p>
      <p>+
E
+
E
+
(f)</p>
      <p>E
+
2
(d)
E
+
2</p>
      <p>2
(g)</p>
      <p>E
+
E
+
2
2
2+2+2
(b)</p>
      <p>E
+
2</p>
      <p>2
(e)
2</p>
      <p>E
+</p>
      <p>
        E
+
2
2
2
One of the relatively well-researched kind of SPPF transformations is
disambiguation — it is commonly practised with ambiguous generalised parsing
because static detection of ambiguity is undecidable for context-free grammars [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
However, most of the time the intention of an average grammarware engineer is
to produce one parse tree, so this line of research is mostly about leveraging
additional sources of information to obtain a parse tree from a parse forest. There
are three main classes of disambiguation techniques:
      </p>
      <p>
        Ordered choice, dynamic lookahead and other conventions aimed to prevent
ambiguities altogether or avoid them. These are fairly static, relatively
wellunderstood and widely used in TXL [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], ANTLR [
        <xref ref-type="bibr" rid="ref37">37</xref>
        ] and PEG [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
Follow/precede restrictions, production rule priorities, associativity rules and
other annotations for local sorting (preference, avoidance, priorities) that
help to prune the parse forest during its creation. Since these are algorithmic
approaches in a sense that they modify the generation process of an SPPF
and thus are not proper mappings from SPPFs to SPPFs, we will not consider
e2
e4
      </p>
      <p>E
E</p>
      <p>
        Disambiguation filters that are run after the parsing process has yielded a
fully formed SPPF: their main objective is to reduce the number of
ambiguities and ultimately to shave all of them off, leaving one parse tree. An
example of this would be how processing production rules marked for
rejection is done for SGLR [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and GLL [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] — even though recursive descent
parsers can handle an equivalent construct (and-not clause) during parsing
without any trouble [
        <xref ref-type="bibr" rid="ref42">42</xref>
        ].
      </p>
      <p>
        Formally speaking, the first class never produces parse forests; the second
class works with disambiguators (higher order functions that take a parser and
return a parser that produces less ambiguous SPPFs) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]; the third class uses
filters (functions that take an SPPF and produce a less ambiguous SPPF) [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ].
In some sources approaches with disambiguators are called “semantics-directed
parsing” and approaches with filters are called “semantics-driven
disambiguation” [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], since both indeed rely on semantic information to aid in the syntactic
analysis. Disambiguation filters are still but a narrow case of SPPF
transformation, but they have apparent practical application and are therefore
wellresearched.
2.2
      </p>
      <sec id="sec-2-1">
        <title>Grammar programming</title>
        <p>Grammar programming is like normal programming, but with grammars: there is
a concrete problem at hand which can be solved with a grammar, which is then
being adjusted until an acceptable solution emerges. A representative pattern
here is working with a high level software artefact describing a language (we
assume it to be a grammar for the sake of simplicity, but in a broad sense it
can be a schema, a metamodel, an ontology, etc), from which a tool solving the
problem at hand is inferred automatically.</p>
        <p>
          There are at least three common approaches to grammar programming:
manual, semi-automated and operator-based. Manual grammar programming
involves textual/visual editing of the grammar file by a grammarware engineer.
It is the easiest method in practice and is used quite often, especially for minor
tweaks during grammar debugging. However, it leads to hidden inconsistencies
within grammars (which require advanced methods like grammar convergence
to uncover [
          <xref ref-type="bibr" rid="ref31">31</xref>
          ]), between changed grammars and cached trees (which demand
reparsing) and between grammars and program transformations (which requires
more manual labour). Semi-automated grammar programming adds a level of
automation to that and thus is typically used in scenarios when a baseline
grammar needs to be adjusted in different ways to several tasks (parsing language
dialects, performing transformations, collecting metrics, etc). Usually the
grammarware toolkit provides means to extend the grammar or rewrite parts of it —
examples include TXL [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], GDK [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ] and GRK [
          <xref ref-type="bibr" rid="ref28">28</xref>
          ]. Arguably the latter two
of these examples also venture into the next category since they contain other
grammar manipulation instruments like folding/unfolding. If we extend this
arsenal with even more means like merging nonterminals, removing grammar
fragments, injecting/projecting symbols from production rules, chaining/unchaining
productions, adding/removing disjunctive clauses, permuting the order and
narrowing/widening repetitions, we end up having an operator suite for grammar
programming. The advantage of having such a suite lies in the simple fact that
each of the operators can be studied and implemented in isolation, and the actual
process of grammar programming will involve calling these operators with proper
arguments in the desired order. Examples of operator suites include FST [
          <xref ref-type="bibr" rid="ref29">29</xref>
          ],
XBGF [
          <xref ref-type="bibr" rid="ref31">31</xref>
          ], BGF [
          <xref ref-type="bibr" rid="ref46">46</xref>
          ] and SLEIR [
          <xref ref-type="bibr" rid="ref49">49</xref>
          ].
2.3
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Coupled transformation</title>
        <p>
          We speak of coupled transformations when two or more kinds of mutually
dependent software artefacts are transformed together to preserve consistency among
them: usually one changes, and others co-evolve with it [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ]. Naturally, the first
coupled transformation scenario we should think of, involves an SPPF and a
grammar that defines its structure. This change can be initiated from either
side, let us consider both.
        </p>
        <p>
          Assuming that we have a sequence of grammar transformation steps, we may
want to execute them on the language instances (programs) as well, to make
them compatible with the updated grammar. Such a need arises in the case of
grammar convergence [
          <xref ref-type="bibr" rid="ref30">30</xref>
          ], when a relationship between two grammars is reverse
engineered by programming the steps necessary to turn one into the other, and a
co-transformation can help to migrate instances obtained with one grammar to
fit with the other. For example, we could have a grammar for the concrete syntax
and a schema for serialisation of the same data — a transformation sequence that
strips the concrete grammar from elements not found in the schema (typically
terminals guiding the parsing process such as semicolons and brackets), could
also be coupled with a transformation sequence that removes the corresponding
parts from the graphs defined by them (e.g., a parse tree and an XML document).
        </p>
        <p>
          Consider another scenario where we have the change on language instances
and want to lift it to the level of language definitions. An example could be
found in program transformation, a common software engineering practice of
metaprogramming. If we want a refactoring like extracting a method, renaming
a variable or removing a go-to statement, it is easy and practical to express it in
terms of matching/rewriting paradigm: in Spoofax [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ], Rascal [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], TXL [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ],
ATL [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ], XSLT [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], etc. However, a correct refactoring should preserve the
meaning of the program, and the first step towards that is syntactic correctness
of this program. For non-refactoring transformations found in aspect-oriented
development, automated bug fixing and other areas, we still want to ascertain
the extent to which the language is extended, reduced or revised. In the case of
strongly typed metaprogramming languages, they will not allow you to create
any ill-formed output, but the development process can lead you to first specify a
breaking transform and then cotransform the grammar so that it “fits” — which
is what coupled transformations are good for.
2.4
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Explicit versus implicit</title>
        <p>This was already mentioned before, but becomes a crucial point from now on:
parse forests can arise from two different sources — conjunctive clauses in the
grammar used for parsing and generalised parsing with ambiguous grammars.
The latter case can be considered implicit conjunction, since it is present on the
level of language instances but not on the grammar level. In that case, instead
of a more cumbersome construction specifying a precise parse, we use a simpler
grammatical definition which yields a forest. If a grammar is both conjunctive
and ambiguous, this can lead to its both implicit and explicit conjunctive clauses
to be found in SPPFs — with no observable difference on an instance level.</p>
        <p>Similarly, some of the transformations will “collapse” conjunctions, making
one branch of a clause equal to another. Formally, for an SPPF node to have
several branches means existence of several edges in the form hvi; (vi1; :::; viki )i,
hvi; (vi01; :::; vi0k0i )i, etc. When a transformation results in all vij becoming equal
to the corresponding vi0j , such edges merge in the set. If such conjunctions
represent ambiguities, this is disambiguation; if they represent parse views, it merges
the views and makes them undistinguishable.</p>
        <p>Language preserved</p>
        <p>Language
extended</p>
        <p>Language
reduced</p>
        <p>
          Language
revised
XBGF (standing for “transformations of BNF-like grammar formalism”) was
an operator suite for grammar programming originally developed for grammar
recovery and convergence experiments [
          <xref ref-type="bibr" rid="ref30 ref31">30,31</xref>
          ] and used for various grammar
maintenance tasks afterwards — e.g., for improving the quality and maturity of
grammars in the Grammar Zoo [
          <xref ref-type="bibr" rid="ref47 ref50">47,50</xref>
          ]. It has operators like eliminate(n) that
checks whether the given nonterminal n is referenced anywhere in the grammar,
and if not, removes its definition harmlessly; or operators like removeN(x; y)
that ensures that the nonterminal x is found in the grammar while y is not,
and subsequently renames x to y; or even operators like redefine(pk; p0k) which
removes all production rules pk defining one nonterminal from the grammar and
replaces them with rules p0k defining the same nonterminal differently. These
operators are relatively well-studied so that we can always make a claim about
the effect that a transformation chain has on the language generated/accepted
by the grammar. Originally [45, §7] XBGF operators were classified according
to their preservation, increase, decrease or revision of the language within two
semantics: the string semantics and the term semantics. The contribution of this
section is their classification according to the coupled effect of the operators on
the SPPFs — see Figure 3 for the overview.
The best kind of coupled transformation is the trivial one where the initial
transformation triggers no change in the linked artefacts.
3.1.1
Many operators that preserve the (string) language associated with the grammar,
also preserve the shared packed parse forests of the instances of this language.
Consider, for instance, the eliminate(n) operator we have just introduced in
the previous paragraph: essentially, it removes an unused construct. Since such
a construct is unused in other production rules, it can never be reached from the
root symbol, so it can also never occur in the graphs representing grammatically
correct programs. Hence, any SPPF which was correct for grammar before the
transformation, is still correct for the grammar with the unused part eliminated.
Similarly, introducing a language construct that was not previously there and is
not (yet) linked to the root, has no impact on the forests. The same
argumentation holds for decorating operators that add/remove labels to/from rules of the
grammar or their subexpressions, or rename them.
        </p>
        <p>The last two operators seen in this cell on Figure 3 are vertical(n) and
horizontal(n) — they facilitate switching between a horizontal style of
grammatical definitions (i.e., “ A ::= B | C;”) and a vertical one (i.e., “ A ::= B; A
::= C;”) — some grammatical frameworks distinguish between them, but never
on an instance level, since a realisation of a disjunction commits to one particular
branch. Hence, these operators also have no impact on SPPFs.
3.1.2</p>
      </sec>
      <sec id="sec-2-4">
        <title>Language-extending operators</title>
        <p>In the same way rearranging alternatives in production rules discussed in the
previous section, has no impact on SPPFs, strict language extension operators
like addV(p) and addH(p) have no impact on the forests. Since disjunctive
clauses are not explicitly visible in SPPFs, any tree or forest derived with the
original grammar, also conforms to the transformed one — the coupled instance
transformation is trivial.</p>
        <p>
          There is even one operator which is very invasive on a grammar level while
being entirely harmless on the instance level — define(p) is a variant of
introduce(p) that adds a definition of a nonterminal that is used in some parts in
the grammar reachable from the top symbol. Having such nonterminals (called
“bottom nonterminals”) in a grammar is not a healthy practice and is in general
considered a sign of bad quality since it signals incompleteness [
          <xref ref-type="bibr" rid="ref26 ref41 ref47">26,41,47</xref>
          ].
However, if we assume for the sake of simplicity that the default semantics for an
undefined nonterminal is immediate failure (or parsing, generation, recognition
or whatever the goal we need the grammar for), we may view define(p) as a
language-extending (not a language-revising) operator. Thus, if we do somehow
obtain a well-formed SPPF for such a grammar, it means it was constructed
while avoiding the bottom nonterminal in question — hence, introducing it is
no different than adding any other unreachable part we have seen so far and as
such has no effect on the SPPFs.
        </p>
        <p>ABP
AP</p>
        <p>AB
b+</p>
        <p>BC
c+</p>
        <p>AB
b+</p>
        <p>BC
c+
a+</p>
        <p>AB
b+</p>
        <p>BC
c+
AB?</p>
        <p>BC?</p>
        <p>AB?</p>
        <p>BC?</p>
        <p>AB?</p>
        <p>BC?
There are several cases when we do not know in advance whether the
cotransformation of SPPFs will be possible: when it is, it is trivial.
3.2.1</p>
      </sec>
      <sec id="sec-2-5">
        <title>Language-reducing operators</title>
        <p>The operators removeV(p) and removeH(p) are the counterparts of addV and
addH operators we have considered above, which remove alternatives instead
of adding them. The effect of such a transformation on a given SPPF is easy to
determine: if the alternative which is being removed, is exercised anywhere in
the graph, the (co)transformation fails; if it is not, then no update of the forest
is required.</p>
        <p>Note that since all branches of the conjunctive clause are present in a given
SPPF, their removal requires a (possibly failing) refactoring: hence, removeC(p)
is considered later in §3.3.2.</p>
        <p>The undefine(n) operator takes a valid nonterminal (defined and used within
the grammar) and turns it into a bottom nonterminal (used yet not defined). It
is a language reducing operator since its effect is a strict decrease in the number
of possible correct programs: any parse graph containing a note related to the
nonterminal n, becomes invalid. Hence, the coupled transformation for it checks
whether such a node is indeed found in the given SPPF: if yes, the transformation
fails; if not, it immediately succeeds without updating the SPPF.
ABC
b+
a+</p>
        <p>AB</p>
        <p>BC
c+
a+</p>
        <p>AB
b+</p>
        <p>BC
c+
AB?</p>
        <p>BC?</p>
        <p>AB?</p>
        <p>BC?
a ε b ε
S ::= ABC &amp; AB c+ &amp; a+ BC;
AB ::= a AB? b;
BC ::= b BC? c;
ABC ::= a+ b+ c+;
(a)
c
In the next subsections we consider cases of less trivial coupled transformations,
when language instances have to change to preserve conformance.
3.3.1</p>
      </sec>
      <sec id="sec-2-6">
        <title>Language-preserving operators</title>
        <p>Many transformation operators that preserve the language associated with a
grammar, still have some impact on the parse graphs. When the impact is easy
to calculate in advance and thus encode the coupled transformations as SPPF
refactorings that are parametrised in the same way the grammar transformations
are, we can run commands like extract(p) on both grammars and SPPFs.</p>
        <p>
          Consider Figure 4(a). It shows a simple grammar of a non-context-free
language fanbncn j n &gt; 0g with three conjunctive views: the first one (a+ b+ c+)
being the most intuitive and hence the most suitable for expressing patterns to
be matched on programs; the remaining two being used to parse the language
(which is well-known to be context-sensitive, so we need the power of two
conjuncts to recognise it precisely). In a sense, the last two conjuncts represent a
recogniser and the first one specifies a parser [
          <xref ref-type="bibr" rid="ref40 ref42">40,42</xref>
          ]. When a transformation
command extract(AP::=a+;) is executed, the effect on the grammar is
apparent: a new nonterminal is introduced and two occurrences of its right hand side
are replaced with it. The effect on an SPPF is also quite easy to calculate: the
node with a+ is replaced with a chain of two nodes (AP and a+); the incoming
edges of the old node are connected as the incoming edges to the first one in the
chain; the outgoing edges of the old node become the outgoing ones of the last in
the chain (shown on Figure 4(b), changes in bold green). A slightly more
complicated case is shown on Figure 4(c), where a new vertex needs to be created when
we extract(ABP::=a+ b+;) because a symbol sequence a+b+ did not correspond
to any vertex in the old graph. For all vertices that had outgoing edges to both
a+ and b+, they got replaced by one edge to the new node. Figure 5 shows the
opposite scenario of inlining a nonterminal in a grammar, coupled with “inlining”
corresponding vertices in a graph by drawing edges through it.
        </p>
        <p>Many other operators of this category from Figure 3 work similarly: chain
replaces a node with a chain of two nodes; fold does the same folding we have
seen above with extract, but without introducing a new nonterminal and
possibly in a limited scope; rassoc and lassoc replace an iterative production rule
with a recursive right/left associative one and thus stretches a node with
multiple children into an unbalanced binary subtree; concatT and splitT merge or
unmerge leaves, etc.
3.3.2</p>
      </sec>
      <sec id="sec-2-7">
        <title>Language-extending operators</title>
        <p>Above we have considered grammar transformation operators that add
disjunctive clauses to the grammar, obviously extending the associated language. In the
case of extended context-free grammars (regular right hand side grammars) that
allow metasyntactic sugar like optionals (x? effectively meaning xj") and
regular closures (x+ for transitive and x for reflexive transitive), the widen(e; e0)
operator is used to transform x? to x or x to x+, together with the appear(p)
operator that transforms " to x? (effectively injecting an optional symbol). The
coupled graph transformations for these cases usually boil down to inserting new
vertices in the right places in order to keep the structural commitments up to
date with the changed grammar.</p>
        <p>An even less trivial case of language extension is called “upgrading” and
involves replacing a nonterminal by an expression that can be reduced to it. For
instance, in A ::= B C; D ::= B|E; we can upgrade B in A (underlined) to D.
Such a transformation increases the string language associated with a grammar,
as well as rearranges the relations between nonterminals. The coupled
transformation for SPPF is still simple and inserts an extra vertex for D between A and
B (E is still not present in the SPPF).</p>
        <p>The removeC(p) operator that eliminates a conjunct, formally also increases
the underlying language since any extra conjunct is possibly an extra condition to
be met, and dropping it makes the combination weaker. Technically the coupled
SPPF transform that removes a conjunct is a disambiguation filter, but it is not
useful to count it as such since the ambiguity being removed is explicit (recall
§2.4).
3.3.3</p>
      </sec>
      <sec id="sec-2-8">
        <title>Language-reducing operators</title>
        <p>The disappear(p) operator is used to transform x? or x to ". The coupled
transformation on SPPFs for it exists, but is completely different from the ones
being considered so far: it is inherently irreversible since if the SPPF in question
actually contains the x? with x as a child node, then that x is removed and
lost. This is contrasting to folding/unfolding vertices and rearranging the edges
around them.
3.3.4</p>
      </sec>
      <sec id="sec-2-9">
        <title>Language-revising operators</title>
        <p>The operators abstractize(p) and concretize(p) eliminate and introduce
terminals from production rules (a common practice when mapping abstract syntax
to concrete syntax, hence the names). Since the terminals are present explicitly
in the arguments, we can easily implement our coupled SPPF transformations
by inserting leaves and connecting them to the appropriate places to the graph,
or removing them. These transformations can have a big effect on the SPPF and
are therefore more similar to the coupled transform from the previous paragraph.
The project operator is a stronger version of abstractize or disappear that
works on any symbol, but the transformation coupled with it, is the same: locate
all the parts being removed from the grammar, remove them from the graph.</p>
        <p>The rest of language revising operators are coupled with less invasive
rearrangements of the parse graph: reordering edges (permute), updating the
contents of the leaves (renameT) and splitting one nonterminal into several
(splitN).
3.4</p>
      </sec>
      <sec id="sec-2-10">
        <title>SPPFs refactored, when possible</title>
        <p>Cotransformations from the previous section were necessary but could never fail:
they were applicable to all possible graphs. Let us now move on to
cotransformations that could seem successful on the grammar level but fail on the instance
level (causing the combination to fail).
3.4.1</p>
      </sec>
      <sec id="sec-2-11">
        <title>Language-reducing operators</title>
        <p>The narrow operator (the reverse of widen discussed above) and the
downgrade operator (the reverse of upgrade) become simple parse graph
rearrangements, if the constructs in the SPPF happen to correspond to the new grammar,
and fail otherwise. For instance, if a “wider” option is found in the SPPF, we
have no automated way to update it.</p>
        <p>
          The addC operator, on the other hand, shows us yet another class of coupled
transforms: namely, the one requiring reparsing. Indeed, if the first branch of the
conjunctive clause of S from Figure 4 were to be introduced as a
transformation step, we would need to reconnect the left subnode of S to the appropriate
children, which formally corresponds to parsing. In the current prototype
implementation we reuse the existing parser — to the best of our knowledge, other
frameworks like TXL [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] do the same — instead of exploring possibly more
efficient alternatives.
The most brutal among language revising operators: redefine that replaces
an entire nonterminal definition with a different one; replace doing the same
for arbitrary subexpressions; reroot that changes the starting symbol of the
grammar, — all require reparsing as a part of their coupled transformation
steps.
3.5
        </p>
      </sec>
      <sec id="sec-2-12">
        <title>Cotransformations destined to fail</title>
        <p>Interestingly, there is one particular operator that is always doomed: inject(p)
that works like appear but can insert any symbol anywhere in the grammar. In
order to construct a coupled SPPF transformation for inject, we need to know
how to connect the new node to its children, but this information is ultimately
lacking from the operator parameters. The only cases where it could have worked,
are already covered by other operators (e.g., injecting terminals is concretize,
injecting possibly empty symbols is appear).
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Related and future work</title>
      <p>
        As said before, we are not the only ones trying to use computation models based
on graphs instead of trees in software language engineering. It remains to be seen
whether systematically using abstract syntax graphs [
        <xref ref-type="bibr" rid="ref36">36</xref>
        ] and general purpose
graph transformation frameworks would be much different. In that case
grammars can also be represented as graphs similar to Wirth’s syntactic charts [
        <xref ref-type="bibr" rid="ref32">32</xref>
        ].
      </p>
      <p>
        Our approach to couple instance transformations to grammar
transformations and not vice versa has its counterparts in other technological spaces such
as modelware [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] or XML [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] or databases [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], obviously with
transformations of metamodels or schemata as the starting point. Coupled transformations
in general have been re-explained to some extent in this paper, but there is a
much more detailed introduction [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ].
      </p>
      <p>
        Grammar mutations [
        <xref ref-type="bibr" rid="ref46 ref49">46,49</xref>
        ] are systematic generalisations of grammar
transformations used for this paper. There does not seem to be any fundamental
problem in combining that generalisation with our couplings, but the implementation
of coupled mutations remains future work.
      </p>
      <p>
        The classification of coupled SPPF transformations from Figure 3
corresponds to the two kinds of negotiated evolution: “adaptation through
tolerance” when SPPFs are preserved and “through adjustment” when they are
refactored [
        <xref ref-type="bibr" rid="ref48">48</xref>
        ].
      </p>
      <p>
        There is a lot of work on disambiguation, parse forest pruning and
shaving, and it remains to be seen whether our approach can usefully complement
similarly-minded techniques from that area such as van den Brand et al [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]’s
implementation of disambiguation filters with term rewriting.
      </p>
      <p>
        SPPF transformations could possibly be represented formally as classical
graph replacement systems that rewrite nodes [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] or (hyper)edges [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. One
of the main objectives of presenting this paper at the workshop is to estimate
potential usefulness of this approach.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we have considered coupled transformations of grammars together
with shared packed parse forests defined by these grammars. An implementation
of a transformation operator suite was proposed. Each grammar change was
coupled to one of the following: (1) no change in the parse graphs; (2) rearranging
the graphs; (3) introducing new elements to graphs based on operator arguments;
(4) reparsing; (5) imminent failure. This classification is complementary to the
previously existing ones based on preserving, increasing, reducing or revising the
semantics chosen for the grammar.</p>
      <p>The examples given in the paper mostly refer to concrete grammars in the
context of parsing, but the research was done with software language engineering
principles, which means that the contribution is applicable to coupled evolution
of grammars as well as ontologies, API, DSLs, XML schemata, libraries, etc. We
have used Boolean grammars as the underlying formalism due to their power
to represent non-context-free languages, ambiguous generalised parses and parse
views in a uniform way. This is the first project involving coupled transformations
of Boolean grammars.</p>
      <p>The computation model proposed in this paper, can be used for formalisations
and proofs of certain properties of transformation chains; for grammar-based
convergence; for manipulating parse views and in general for tasks involving
synchronous consistent changes to Boolean grammars and shared packed parse
forests. This is an area of rapidly growing interest in the software language
engineering community, and its limits, as well as the extent of its usefulness,
remains to be examined.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Aho</surname>
            ,
            <given-names>A.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sethi</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ullman</surname>
            ,
            <given-names>J.D.</given-names>
          </string-name>
          : Compilers: Principles, Techniques and Tools.
          <string-name>
            <surname>Addison-Wesley</surname>
          </string-name>
          (
          <year>1985</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bagge</surname>
            ,
            <given-names>A.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lämmel</surname>
          </string-name>
          , R.:
          <article-title>Walk Your Tree Any Way You Want</article-title>
          .
          <source>In: ICMT. LNCS</source>
          , vol.
          <volume>7909</volume>
          , pp.
          <fpage>33</fpage>
          -
          <lpage>49</lpage>
          . Springer (
          <year>June 2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bagge</surname>
            ,
            <given-names>A.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zaytsev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          : Open and Original Problems in
          <source>Software Language Engineering 2015 Workshop Report. SIGSOFT Software Engineering Notes</source>
          <volume>40</volume>
          (
          <issue>3</issue>
          ),
          <fpage>32</fpage>
          -
          <lpage>37</lpage>
          (May
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Basten</surname>
            ,
            <given-names>H.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vinju</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          :
          <article-title>Parse Forest Diagnostics with Dr</article-title>
          .
          <source>Ambiguity. In: SLE'11. LNCS</source>
          , vol.
          <volume>6940</volume>
          , pp.
          <fpage>283</fpage>
          -
          <lpage>302</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. van den Brand, M.G.J., de Jong, H.A.,
          <string-name>
            <surname>Klint</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Olivier</surname>
            ,
            <given-names>P.A.</given-names>
          </string-name>
          :
          <article-title>Efficient Annotated Terms</article-title>
          .
          <source>Software: Practice &amp; Experience</source>
          <volume>30</volume>
          (
          <issue>3</issue>
          ),
          <fpage>259</fpage>
          -
          <lpage>291</lpage>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. van den Brand, M.G.J.,
          <string-name>
            <surname>Klusener</surname>
            ,
            <given-names>A.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moonen</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vinju</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          :
          <article-title>Generalized Parsing and Term Rewriting: Semantics Driven Disambiguation</article-title>
          .
          <source>ENTCS</source>
          <volume>82</volume>
          (
          <issue>3</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>17</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. van den Brand, M.G.J.,
          <string-name>
            <surname>Scheerder</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vinju</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Visser</surname>
          </string-name>
          , E.:
          <article-title>Disambiguation Filters for Scannerless Generalized LR Parsers</article-title>
          . In: CC. pp.
          <fpage>143</fpage>
          -
          <lpage>158</lpage>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. van den Brand, M.G.J.,
          <string-name>
            <surname>Heering</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klint</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Olivier</surname>
            ,
            <given-names>P.A.</given-names>
          </string-name>
          :
          <article-title>Compiling Language Definitions: The ASF+SDF Compiler</article-title>
          . ACM ToPLaS
          <volume>24</volume>
          (
          <issue>4</issue>
          ),
          <fpage>334</fpage>
          -
          <lpage>368</lpage>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. van den Brand, M.G.J.,
          <string-name>
            <surname>Klint</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vinju</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          :
          <article-title>Term Rewriting with Traversal Functions</article-title>
          . ACM ToSEM
          <volume>12</volume>
          (
          <issue>2</issue>
          ),
          <fpage>152</fpage>
          -
          <lpage>190</lpage>
          (
          <year>Apr 2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Cantor</surname>
            ,
            <given-names>D.G.</given-names>
          </string-name>
          :
          <article-title>On the Ambiguity Problem of Backus Systems</article-title>
          .
          <source>Journal of the ACM</source>
          <volume>9</volume>
          (
          <issue>4</issue>
          ),
          <fpage>477</fpage>
          -
          <lpage>479</lpage>
          (
          <year>1962</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Chomsky</surname>
          </string-name>
          , N.:
          <source>On Certain Formal Properties of Grammars. Information and Control</source>
          <volume>2</volume>
          (
          <issue>2</issue>
          ),
          <fpage>137</fpage>
          -
          <lpage>167</lpage>
          (
          <year>1959</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>T.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cordy</surname>
            ,
            <given-names>J.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malton</surname>
            ,
            <given-names>A.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>K.A.</given-names>
          </string-name>
          :
          <article-title>Grammar Programming in TXL</article-title>
          . In: SCAM. IEEE (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Drewes</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kreowski</surname>
            ,
            <given-names>H.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Habel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Handbook of Graph Grammars and Computing by Graph Transformation</article-title>
          . chap.
          <source>Hyperedge Replacement Graph Grammars</source>
          , pp.
          <fpage>95</fpage>
          -
          <lpage>162</lpage>
          . World Scientific Publishing Co., Inc. (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Earley</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>An Efficient Context-Free Parsing Algorithm</article-title>
          .
          <source>Ph.D. thesis</source>
          , CarnegieMellon University (
          <year>Aug 1968</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Engelfriet</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rozenberg</surname>
          </string-name>
          , G.:
          <article-title>Handbook of Graph Grammars and Computing by Graph Transformation</article-title>
          . chap.
          <source>Node Replacement Graph Grammars</source>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>94</lpage>
          . World Scientific Publishing Co., Inc. (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Ford</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Parsing Expression Grammars: a Recognition-Based Syntactic Foundation</article-title>
          . In: POPL (Jan
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Gîrba</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Favre</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ducasse</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Using Meta-Model Transformation to Model Software Evolution</article-title>
          .
          <source>ENTCS</source>
          <volume>137</volume>
          (
          <issue>3</issue>
          ),
          <fpage>57</fpage>
          -
          <lpage>64</lpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Henrard</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hick</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thiran</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hainaut</surname>
          </string-name>
          , J.:
          <article-title>Strategies for Data Reengineering</article-title>
          . In: WCRE. pp.
          <fpage>211</fpage>
          -
          <lpage>220</lpage>
          . IEEE (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Jouault</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Allilaire</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bézivin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurtev</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valduriez</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>ATL: a QVT-like Transformation Language</article-title>
          . In: OOPSLA. pp.
          <fpage>719</fpage>
          -
          <lpage>720</lpage>
          . ACM (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Kats</surname>
            ,
            <given-names>L.C.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Visser</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>The Spoofax Language Workbench</article-title>
          . In: Cook,
          <string-name>
            <given-names>W.R.</given-names>
            ,
            <surname>Clarke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Rinard</surname>
          </string-name>
          , M.C. (eds.) SPLASH/OOPSLA. pp.
          <fpage>237</fpage>
          -
          <lpage>238</lpage>
          . ACM (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Kay</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>XSL Transformations (XSLT) Version 2</article-title>
          .0. W3C Recommendation (
          <issue>23 January 2007</issue>
          ), http://www.w3.org/TR/2007/REC-xslt20-
          <fpage>20070123</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Klint</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Storm</surname>
          </string-name>
          , T.v.d.,
          <string-name>
            <surname>Vinju</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>RASCAL: A Domain Specific Language for Source Code Analysis and Manipulation</article-title>
          .
          <source>In: Proceedings of SCAM</source>
          . pp.
          <fpage>168</fpage>
          -
          <lpage>177</lpage>
          . IEEE Computer Society (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Klint</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Visser</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>Using Filters for the Disambiguation of Context-Free Grammars</article-title>
          . In: Pighizzini,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Pietro</surname>
          </string-name>
          , P.S. (eds.)
          <source>Proceedings of the ASMICS Workshop on Parsing Theory</source>
          . pp.
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          . Universitá di Milano (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Kort</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verhoef</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>The Grammar Deployment Kit</article-title>
          .
          <source>In: LDTA. ENTCS</source>
          , vol.
          <volume>65</volume>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>2002</year>
          ), 7 pages
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Format Evolution</article-title>
          . In: RETIS. vol.
          <volume>155</volume>
          , pp.
          <fpage>113</fpage>
          -
          <lpage>134</lpage>
          . OCG (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verhoef</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Semi-automatic Grammar Recovery</article-title>
          .
          <source>Software-Practice &amp; Experience</source>
          <volume>31</volume>
          (
          <issue>15</issue>
          ),
          <fpage>1395</fpage>
          -
          <lpage>1438</lpage>
          (
          <year>Dec 2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Lämmel</surname>
          </string-name>
          , R.:
          <source>Transformations Everywhere. Science of Computer Programming (SCP) 52</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.:</given-names>
          </string-name>
          <article-title>The Amsterdam Toolkit for Language Archaeology</article-title>
          . In: ATEM'
          <fpage>04</fpage>
          . ENTCS,
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wachsmuth</surname>
          </string-name>
          , G.:
          <article-title>Transformation of SDF Syntax Definitions in the ASF+SDF Meta-Environment</article-title>
          .
          <source>In: LDTA. ENTCS</source>
          , vol.
          <volume>44</volume>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zaytsev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>An Introduction to Grammar Convergence. In: Integrated Formal Methods (iFM)</article-title>
          .
          <source>LNCS</source>
          , vol.
          <volume>5423</volume>
          , pp.
          <fpage>246</fpage>
          -
          <lpage>260</lpage>
          . Springer-Verlag (
          <year>Feb 2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <surname>Lämmel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zaytsev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Recovering Grammar Relationships for the Java Language Specification</article-title>
          .
          <source>Software Quality Journal (SQJ) 19(2)</source>
          ,
          <fpage>333</fpage>
          -
          <lpage>378</lpage>
          (
          <year>Mar 2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          32.
          <string-name>
            <surname>Martynenko</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Towards the 80th Anniversary of N. Wirth: Wirth's Syntactic Charts in the SYNTAX-Technology</article-title>
          .
          <source>In: SoRuCom</source>
          . pp.
          <fpage>199</fpage>
          -
          <lpage>206</lpage>
          . IEEE (Oct
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          33.
          <string-name>
            <surname>Okhotin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Conjunctive Grammars</article-title>
          .
          <source>Journal of Automata, Languages and Combinatorics</source>
          <volume>6</volume>
          (
          <issue>4</issue>
          ),
          <fpage>519</fpage>
          -
          <lpage>535</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          34.
          <string-name>
            <surname>Okhotin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>Boolean Grammars. Information and Computation</source>
          <volume>194</volume>
          (
          <issue>1</issue>
          ),
          <fpage>19</fpage>
          -
          <lpage>48</lpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          35.
          <string-name>
            <surname>Okhotin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Conjunctive and Boolean Grammars: The True General Case of the Context-Free Grammars</article-title>
          .
          <source>Computer Science Review</source>
          <volume>9</volume>
          ,
          <fpage>27</fpage>
          -
          <lpage>59</lpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          36.
          <string-name>
            <surname>Oliveira</surname>
            ,
            <given-names>B.C.d.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Löh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Abstract Syntax Graphs for Domain Specific Languages</article-title>
          . In: PEPM. pp.
          <fpage>87</fpage>
          -
          <lpage>96</lpage>
          . ACM (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          37.
          <string-name>
            <surname>Parr</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fischer</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>LL(*): the Foundation of the ANTLR Parser Generator</article-title>
          . In: PLDI. pp.
          <fpage>425</fpage>
          -
          <lpage>436</lpage>
          . ACM (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          38.
          <string-name>
            <surname>Scott</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Johnstone</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Generalized Bottom Up Parsers with Reduced Stack Activity</article-title>
          .
          <source>Computer Journal</source>
          <volume>48</volume>
          (
          <issue>5</issue>
          ),
          <fpage>565</fpage>
          -
          <lpage>587</lpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          39.
          <string-name>
            <surname>Scott</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Johnstone</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>GLL Parsing. ENTCS</source>
          <volume>253</volume>
          (
          <issue>7</issue>
          ),
          <fpage>177</fpage>
          -
          <lpage>189</lpage>
          (
          <year>2010</year>
          ),
          <source>LDTA'09</source>
        </mixed-citation>
      </ref>
      <ref id="ref40">
        <mixed-citation>
          40.
          <string-name>
            <surname>Scott</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Johnstone</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Recognition is not Parsing - SPPF-style Parsing from Cubic Recognisers</article-title>
          .
          <source>Science of Computer Programming (SCP) 75</source>
          (
          <issue>1-2</issue>
          ),
          <fpage>55</fpage>
          -
          <lpage>70</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref41">
        <mixed-citation>
          41.
          <string-name>
            <surname>Sellink</surname>
            ,
            <given-names>M.P.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verhoef</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Development</surname>
          </string-name>
          , Assessment, and
          <article-title>Reengineering of Language Descriptions</article-title>
          . In: CSMR. pp.
          <fpage>151</fpage>
          -
          <lpage>160</lpage>
          . IEEE (Mar
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref42">
        <mixed-citation>
          42.
          <string-name>
            <surname>Stevenson</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cordy</surname>
            ,
            <given-names>J.R.</given-names>
          </string-name>
          :
          <article-title>Parse Views with Boolean Grammars</article-title>
          .
          <source>Science of Computer Programming (SCP) 97(1)</source>
          ,
          <fpage>59</fpage>
          -
          <lpage>63</lpage>
          (
          <year>2015</year>
          ),
          <article-title>Special Issue on New Ideas and Emerging Results in Understanding Software</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref43">
        <mixed-citation>
          43.
          <string-name>
            <surname>Tomita</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems</article-title>
          . Kluwer Academic Publishers (
          <year>1985</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref44">
        <mixed-citation>
          44.
          <string-name>
            <surname>Visser</surname>
            ,
            <given-names>E.: Scannerless</given-names>
          </string-name>
          <string-name>
            <surname>Generalized-LR Parsing</surname>
          </string-name>
          .
          <source>Tech. Rep. P9707</source>
          , University of Amsterdam (
          <year>Jul 1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref45">
        <mixed-citation>
          45.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.: Recovery,
          <source>Convergence and Documentation of Languages. Ph.D. thesis</source>
          , Vrije Universiteit, Amsterdam, The Netherlands (Oct
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref46">
        <mixed-citation>
          46.
          <string-name>
            <surname>Zaytsev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Language Evolution, Metasyntactically</article-title>
          .
          <source>EC-EASST; BX</source>
          <volume>49</volume>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref47">
        <mixed-citation>
          47.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.:
          <article-title>Grammar Maturity Model</article-title>
          . In: Pierantonio,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Tamzalit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Schätz</surname>
          </string-name>
          ,
          <string-name>
            <surname>B</surname>
          </string-name>
          . (eds.)
          <source>Ninth Workshop on Models and Evolution (ME</source>
          <year>2014</year>
          ). pp.
          <fpage>42</fpage>
          -
          <lpage>51</lpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref48">
        <mixed-citation>
          48.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.:
          <article-title>Negotiated Grammar Evolution</article-title>
          .
          <source>JOT; XM</source>
          <volume>13</volume>
          (
          <issue>3</issue>
          ), 1:
          <fpage>1</fpage>
          -
          <lpage>22</lpage>
          (
          <year>Jul 2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref49">
        <mixed-citation>
          49.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.:
          <article-title>Software Language Engineering by Intentional Rewriting</article-title>
          .
          <source>EC-EASST; SQM 65 (Mar</source>
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref50">
        <mixed-citation>
          50.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.:
          <article-title>Grammar Zoo: A Corpus of Experimental Grammarware</article-title>
          .
          <source>Science of Computer Programming (SCP) 98</source>
          ,
          <fpage>28</fpage>
          -
          <lpage>51</lpage>
          (
          <year>Feb 2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref51">
        <mixed-citation>
          51.
          <string-name>
            <surname>Zaytsev</surname>
          </string-name>
          , V.:
          <article-title>Guided Grammar Convergence</article-title>
          .
          <source>In: Poster proceedings of SLE'13</source>
          (
          <year>2015</year>
          ), in print, available from CoRR: http://arxiv.org/abs/1503.08476
        </mixed-citation>
      </ref>
      <ref id="ref52">
        <mixed-citation>
          52.
          <string-name>
            <surname>Zaytsev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bagge</surname>
            ,
            <given-names>A.H.</given-names>
          </string-name>
          :
          <article-title>Parsing in a Broad Sense</article-title>
          .
          <source>In: MoDELS. LNCS</source>
          , vol.
          <volume>8767</volume>
          , pp.
          <fpage>50</fpage>
          -
          <lpage>67</lpage>
          . Springer (Oct
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>