Abstract
In this article, we introduce eXtensible MetaGrammar (XMG), a framework for specifying tree-based grammars such as Feature-Based Lexicalized Tree-Adjoining Grammars (FB-LTAG) and Interaction Grammars (IG). We argue that XMG displays three features that facilitate both grammar writing and a fast prototyping of tree-based grammars. Firstly, XMG is fully declarative. For instance, it permits a declarative treatment of diathesis that markedly departs from the procedural lexical rules often used to specify tree-based grammars. Secondly, the XMG language has a high notational expressivity in that it supports multiple linguistic dimensions, inheritance, and a sophisticated treatment of identifiers. Thirdly, XMG is extensible in that its computational architecture facilitates the extension to other linguistic formalisms. We explain how this architecture naturally supports the design of three linguistic formalisms, namely, FB-LTAG, IG, and Multi-Component Tree-Adjoining Grammar (MC-TAG). We further show how it permits a straightforward integration of additional mechanisms such as linguistic and formal principles. To further illustrate the declarativity, notational expressivity, and extensibility of XMG, we describe the methodology used to specify an FB-LTAG for French augmented with a unification-based compositional semantics. This illustrates both how XMG facilitates the modeling of the tree fragment hierarchies required to specify tree-based grammars and of a syntax/semantics interface between semantic representations and syntactic trees. Finally, we briefly report on several grammars for French, English, and German that were implemented using XMG and compare XMG with other existing grammar specification frameworks for tree-based grammars.
1. Introduction
In the late 1980s and early 1990s, many grammar engineering environments were developed to support the specification of large computational grammars for natural language. One may, for instance, cite xle (Kaplan and Newman 1997) for specifying Lexical-Functional Grammars (LFG), lkb (Copestake and Flickinger 2000) for specifying Head-driven Phrase Structure Grammars (HPSG), and DotCCG (Baldridge et al. 2007) for specifying Combinatory Categorial Grammars (CCG). Concretely, such environments usually rely on (i) a formal language used to describe a target computational grammar, and (ii) a processor for this language, which aims at generating the actual described grammar (and potentially at checking it, e.g., by feeding it to a parser).
Although these environments were tailored for specific grammar formalisms, they share a number of features. Firstly, they are expressive enough to characterize subsets of natural language. Following Shieber (1984), we call this feature weak completeness. Secondly, they are notationally expressive enough to relatively easily formalize important theoretical notions. Thirdly, they are rigorous, that is, the semantics of their underlying language is well defined and understood. Additionally, for an environment to be useful in practice, it should be simple to use (by a linguist), and make it possible to detect errors in the described target grammar.
If we consider a particular type of computational grammar, namely, tree-based grammars—that is, grammars where the basic units are trees (or tree descriptions) of arbitrary depth, such as Tree-Adjoining Grammar (TAG; Joshi, Levy, and Takahashi 1975), D-Tree Grammar (DTG; Rambow, Vijay-Shanker, and Weir 1995), Tree Description Grammars (TDG; Kallmeyer 1999) or Interaction Grammars (IG; Perrier 2000)—environments sharing all of the listed features are lacking. As we shall see in Section 7 of this article, there have been some proposals for grammar engineering environments for tree-based grammar (e.g., Candito 1996; Xia, Palmer, and Vijay-Shanker 1999, but these lack notational expressivity. This is partly due to the fact that tree-based formalisms offer an extended domain of locality where one can encode constraints between remote syntactic constituents. If one wants to define such constraints while giving a modular and incremental specification of the grammar, one needs a high level of notational expressivity, as we shall see throughout the article (and especially in Section 4).
In this article, we present XMG (eXtensible MetaGrammar), a framework for specifying tree-based grammars. Focusing mostly on Feature-Based Lexicalized Tree-Adjoining Grammars (FB-LTAG) (but using Interaction Grammars [IG] and Multi-Component Tree-Adjoining Grammars [MC-TAG] to illustrate flexibility), we argue that XMG departs from other existing computational frameworks for designing tree-based grammars in three main ways:
First, XMG is a declarative language. In other words, grammaticality is defined in an order-independent fashion by a set of well-formedness constraints rather than by procedures. In particular, XMG permits a fully declarative treatment of diathesis that markedly departs from the procedural rules (called meta-rules or lexical rules) previously used to specify tree-based grammars.
Second, XMG is notationally expressive. The XMG language supports full disjunction and conjunction of grammatical units, a modular treatment of multiple linguistic dimensions, multiple inheritance of units, and a sophisticated treatment of identifiers. We illustrate XMG's notational expressivity by showing (i) how it facilitates the modeling of the tree fragment hierarchies required to specify tree-based grammars and (ii) how it permits a natural modeling of the syntax/semantics interface between semantic representations and syntactic trees as can be used in FB-LTAG.
Third, XMG is extensible in that its computational architecture facilitates (i) the integration of an arbitrary number of linguistic dimensions (syntax, semantics, etc.), (ii) the modeling of different grammar formalisms (FB-LTAG, MC-TAG, IG), and (iii) the specification of general linguistic principles (e.g., clitic ordering in French).
The article is structured as follows. Section 2 starts by giving a brief introduction to FB-LTAG, the grammar formalism we used to illustrate most of XMG's features. The next three sections then go on to discuss and illustrate XMG's three main features—namely, declarativity, notational expressivity, and flexibility. In Section 3, we focus on declarativity and show how XMG's generalized disjunction permits a declarative encoding of diathesis. We then contrast the XMG approach with the procedural methods previously resorted to for specifying FB-LTAG. Section 4 addresses notational expressivity. We present the syntax of XMG and show how the sophisticated identifier handling it supports or permits a natural treatment (i) of identifiers in tree based hierarchies and (ii) of the unification-based syntax/semantics interface often used in FB-LTAG. In Section 5, we concentrate on extensibility. We first describe the operational semantics of XMG and the architecture of the XMG compiler. We then show how these facilitate the adaptation of the basic XMG language to (i) different grammar formalisms (IG, MC-TAG, FB-LTAG), (ii) the integration of specific linguistic principles such as clitic ordering constraints, and (iii) the specification of an arbitrary number of linguistic dimensions. In Section 6, we illustrate the usage of XMG by presenting an XMG specification for the verbal fragment of a large scale FB-LTAG for French augmented with a unification-based semantics. We also briefly describe the various other tree-based grammars implemented using XMG. Section 7 discusses the limitations of other approaches to the formal specification of tree-based grammars, and Section 8 concludes with pointers for further research.
2. Tree-Adjoining Grammar
A Tree-Adjoining Grammar (TAG) consists of a set of auxiliary or initial elementary trees and of two tree composition operations, namely, substitution and adjunction. Initial trees are trees whose leaves are either substitution nodes (marked with ↓) or terminal symbols (words). Auxiliary trees are distinguished by a foot node (marked with ⋆) whose category must be the same as that of the root node. Substitution inserts a tree onto a substitution node of some other tree and adjunction inserts an auxiliary tree into a tree. Figure 1 shows a toy TAG generating the sentence Marie a vu Jean ‘Mary has seen John’ and sketches its derivation.1
Among existing variants of TAG, one commonly used in practice is Lexicalized FB-LTAG (Vijay-Shanker and Joshi 1988). A lexicalized TAG is such that each elementary tree has at least one leaf labeled with a lexical item (word), whereas in an FB-LTAG, tree nodes are additionally decorated with two feature structures (called top and bottom). These feature structures are unified during derivation as follows. On substitution, the top features of the substitution node are unified with the top features of the root node of the tree being substituted in. On adjunction, the top features of the root of the auxiliary tree are unified with the top features of the node where adjunction takes place; and the bottom features of the foot node of the auxiliary tree are unified with the bottom features of the node where adjunction takes place. At the end of a derivation, the top and bottom feature structures of all nodes in the derived tree are unified.
Implementation of Tree-Adjoining Grammars. Most existing implementations of TAGs follow the three-layer architecture adopted for the XTAG grammar (XTAG Research Group 2001), a feature-based lexicalized TAG for English. Thus the grammar consists of (i) a set of so-called tree schemas (i.e., elementary trees having a leaf node labeled with a ⋄ referring to where to anchor lexical items2), (ii) a morphological lexicon associating words with lemmas, and (iii) a syntactic lexicon associating lemmas with tree schemas (these are gathered into families according to syntactic properties, such as the sub-categorization frame for verbs). Figure 2 shows some of the tree schemas associated with transitive verbs in the XTAG grammar. The tree corresponds (a) to a declarative sentence, (b) to a WH-question on the subject, (c) to a passive clause with a BY-agent, and (d) to a passive clause with a WH-object. As can be seen, each tree schema contains an anchor node (marked with ⋄). During parsing this anchor node can be replaced by any word morphologically related to a lemma listed in the syntactic lexicon as anchoring the transitive tree family.
This concept of tree family allows us to share structural information (tree schemas) between words having common syntactic properties (e.g., sub-categorization frames). There still remains a large redundancy within the grammar because many elementary tree schemas share common subtrees (large coverage TAGs usually consist of hundreds, sometimes thousands, of tree schemas). An important issue when specifying such grammars is thus structure sharing. Being able to share structural information is necessary not only for a faster grammar development, but also for an easier grammar maintenance (modifications to be applied to the tree schemas would be restricted to shared structures). In the next section, we will see how XMG declarativity can be efficiently used to factorize TAGs. In addition, Section 4 will show how XMG notational expressivity facilitates the specification of another commonly used tree sharing device, namely, inheritance hierarchies of tree fragments.
Extending TAG with a Unification-Based Semantics. To extend FB-LTAG with a compositional semantics, Gardent and Kallmeyer (2003) propose to associate each elementary tree with a flat semantic representation. For instance, in Figure 3, the trees3 for John, runs, and often are associated with the semantics l0:name(j,john), l1:run(e,s), and l2:often(x), respectively. Importantly, the arguments of semantic functors are represented by unification variables which occur both in the semantic representation of this functor and on some nodes of the associated syntactic tree. Thus in Figure 3, the semantic index s occurring in the semantic representation of runs also occurs on the subject substitution node of the associated elementary tree. The value of semantic arguments is then determined by the unifications resulting from adjunction and substitution. For instance, the semantic index s in the tree for runs is unified during substitution with the semantic index j labeling the root node of the tree for John. As a result, the semantics of John often runs is {l0:name(j,john), l1:run(e,j), l2:often(e)}.
Gardent and Kallmeyer's (2003) proposal was applied to various semantic phenomena (Kallmeyer and Romero 2004a, 2004b, 2008). Its implementation, however, relies on having a computational framework that associates syntactic trees with flat semantic formulae while allowing for shared variables between trees and formulae. In the following sections, we will show how XMG notational expressivity makes it possible to specify an FB-LTAG equipped with a unification-based semantics.
3. Declarativity
In this section, we show how a phenomenon which is often handled in a procedural way by existing approaches can be provided with a declarative specification in XMG. Concretely, we show how XMG supports a declarative account of diathesis that avoids the drawbacks of lexical rules (e.g., information erasing). We start by presenting the lexical rule approach. We then contrast it with the XMG account.
3.1 Capturing Diathesis Using Lexical Rules
Following Flickinger (1987), redundancy among grammatical descriptions is often handled using two devices: an inheritance hierarchy and a set of lexical rules. Whereas the inheritance hierarchy permits us to encode the sharing of common substructures, lexical rules (sometimes called meta-rules) permit us to capture relationships between trees by deriving new trees from already specified ones. For instance, passive trees will be derived from active ones.
Although Flickinger's (1987) approach was developed for HPSGs, several similar approaches have been put forward for FB-LTAG (Vijay-Shanker and Schabes 1992; Becker 1993; Evans, Gazdar, and Weir 1995; XTAG Research Group 2001). One important drawback of these approaches, however, is that they are procedural in that the order in which lexical rules apply matters. For instance, consider again the set of trees given in Figure 2. In the meta-rule representation scheme adopted by Becker (1993), the base tree (a) would be specified in the inheritance hierarchy grouping all base trees, and the derived trees (b, c, d) would be generated by applying one or more meta-rules on this base tree. Figure 4 sketches these meta-rules. The left-hand side of the meta-rule is a matching pattern replaced with the right-hand side of the meta-rule in the newly generated tree. Symbol “?” denotes a meta-variable whose matching subtree in the input is substituted in place of the variable in the output tree. Given these, the tree family in Figure 2 is generated as follows: (b) and (c) are generated by application to the base tree (a) of the Wh-Subject and Passive meta-rules, respectively. Further, (d) is generated by applying first, the Wh-Subject meta-rule and second, the Passive meta-rule to the base tree.
More generally a meta-rule is a procedural device that, given a tree instance, generates a new tree instance by adding, suppressing (hence possibly substituting) information in grammatical units. Prolo (2002) defines a set of meta-rules that can be used to specify a large FB-LTAG for English. Given an ordered set of meta-rules, however, there is no guarantee that the trees they derive are linguistically appropriate and that the derivation process terminates. Thus, to ensure termination and consistency, Prolo needs to additionally provide rule ordering schemes (expressed as automata).
3.2 XMG: Capturing Diathesis Using Disjunction
XMG provides an alternative account for describing tree sets such as that of Figure 2 without lexical rules and without the related ordering constraints. In essence, the approach consists of enumerating trees by combining tree fragments using conjunction and disjunction.
The first clause (Subject) groups together two subtrees representing the possible realizations of a subject (canonical and wh). The next two clauses define a tree set for active and passive transitive verbs, respectively. The last clause defines the TransitiveVerb family as a disjunction of the two verb forms (passive or active). In sum, the TransitiveVerb clause defines the tree set sketched in Figure 2 as a disjunction of conjunctions of tree fragments.
One of the issues of meta-rules reported by Prolo (2002) is the handling of feature equations. For a number of cases (including subject relativization in passive trees), ad hoc meta-rules are needed, for a unified tree transformation cannot be defined. In a declarative approach such as the one here, dealing with feature equations can be done relatively easily. Let us imagine that we now want to extend the trees of Figure 2 with feature equations for subject–number agreement. We can for instance do so by defining the following tree fragment (the dashed line indicates that the VP node can be a descendant, not only a daughter, of the S node):5
To summarize, using a declarative language to specify a tree-based grammar offers an adequate level of control on the structures being described while avoiding having to deal with ordering and termination issues. It facilitates grammar design and maintenance, by providing an abstract view on grammar trees, uniquely made of monotonic (no information removal) combinations of tree fragments.
4. Notational Expressivity
We now focus on notational expressivity and show how XMG supports a direct encoding of (i) distinct linguistic dimensions (here syntax, semantics and the syntax/semantics interface) and (ii) the various types of coreferences7 that arise in the development of tree-based grammars.
Here and in what follows, we use the following notational conventions. Ci denote variables over class names; xi, x, and y are variables ranging over tree nodes or feature values; ni refer to node variables; f, fi are features and v, vi and feature values (constants or variables); li, hj, p, and Ei are variables over semantic labels, semantic holes, predicates, and predicate arguments in flat semantic formulae, respectively.8 [ ] are used to associate a node variable with some feature constraint. ( ) are used to associate a node variable with some property constraint (e.g., node colors, see Section 5). ci and cvi denote a property constraint and a property constraint value, respectively. Ci.y denotes the y variable declared in class Ci and = is unification; ≺ and → denote linear precedence and immediate dominance relations between nodes. Finally, +, * represent the transitive and transitive-reflexive closure of a relation, respectively.
The first two clauses of the formal definition here specify XMG classes and how they combine. The next three clauses define the languages supported for describing three linguistic dimensions, namely, syntax (SYN), semantics (SEM), and the syntax/semantics interface (called DYN for dynamic interface). We now discuss each of these in more detail starting bottom–up with the three linguistic dimensions and ending with the control language that permits us to combine basic linguistic units into bigger ones.
It includes tree node variables, feature names, feature values, and feature variables. Tree node variables can be related by equality (node identification), precedence (immediate or non-immediate), and dominance (immediate or non-immediate). Tree nodes can also be labeled with feature structures of depth 2, that is, sets of feature/value pairs where feature values are either variables, constants (e.g., syntactic category), or non-recursive feature structure (e.g., top and bottom feature structures).
One distinguishing feature of the XMG tree language is the introduction of node constraints (n1(c : cv)) that generalize Muskens and Krahmer's (1998) use of positive and negative node markings. Concretely, node constraints are attribute-value matrices, which contain information to be used when solving tree descriptions to produce grammar trees. In other words, node constraints are used to further restrict the set of models satisfying a tree description. As an example of node constraint, consider node annotations in FB-LTAG (foot node, substitution node, null-adjunction, etc.). Such annotations can be used as node constraints to allow the description solver to apply well-formedness constraints (e.g., there is at most one foot node).
Another interesting feature of XMG concerns the inclusion of the dot operator, which permits us to identify variables across classes in cases where name sharing cannot be resorted to. When a variable y is declared in a class C, the latter being instantiated within a class D, y can be accessed from D by C.y (the identifier y still being available in D's namespace).
In other words, the DYN feature structure allows us to extend the scope of some specific variables so that they can be unified with variables (or values) introduced in some other classes of the metagrammar. This concept of scope extension can be compared with that of hook in Copestake, Lascarides, and Flickinger (2001).
The XMG control language differs from other frameworks used to specify tree-based grammars (Vijay-Shanker and Schabes 1992; Xia et al. 1998; Candito 1999) in two main ways. First, it supports generalized conjunctions and disjunctions of classes. As shown in Section 3, this permits us, inter alia, a declarative treatment of diathesis.
Second, it allows for both local and exported variables. As mentioned in Section 3, a common way to share structure within a tree-based grammar is to define an inheritance hierarchy of either tree fragments (Evans, Gazdar, and Weir 1995) or tree descriptions (Vijay-Shanker and Schabes 1992; Candito 1996; Xia 2001). When considering an FB-LTAG augmented with unification semantics, the hierarchy will additionally contain semantic representations and/or tuples made of tree fragments and semantic representations. In all cases, the question arises of how to handle identifiers across classes and, more specifically, how to share them.
In Candito's (1996) approach, tree nodes are referred to using constants so that multiple occurrences of the same node constant refer to the same node. As pointed out in Gardent and Parmentier (2006), global names have several non-trivial shortcomings. First, they complicate grammar writing in that the grammar writer must remember the names used and their intended interpretation. Second, they fail to support multiple uses of the same class within one class. For instance, in French, some verbs sub-categorize for two prepositional phrases (PP). A natural way of deriving the tree for such verbs would be to combine a verbal tree fragment with two instances of a PP fragment. If, however, the nodes in the PP fragment are labeled with global names, then the two occurrences of these nodes will be identified thereby blocking the production of the appropriate tree.11
A less restrictive treatment of identifiers is proposed by Vijay-Shanker and Schabes (1992), where each tree description can be associated with a set of declared node variables and subsets of these node variables can be referred to by descriptions in the hierarchy that inherit from the description in which these node variables were declared. For instance, if entity A in the hierarchy declares such a special node variable X and B inherits from A, then X can be referred to in B using the notation A.X.12
XMG generalizes Vijay-Shanker and Schabes's (1992) approach by integrating an export mechanism that can be used to extend the scope of a given identifier (node or feature value variable) to classes that inherit from the exporting class. Thus if class B inherits from class A and class A exports variable X, then X is visible in B and its reuse forces identity. If B inherits from several classes and two (or more) of these inherited classes export the same variable name X, then X is not directly visible from B. It can be accessed though using the dot operator. First A is identified with a local variable (e.g., T = A), then T.X can be used to refer to the variable X exported by A.
To summarize, XMG allows for local variables to be exported to sub-classes as well as for prefixed variables—that is, variables that are prefixed (using the dot operator) with a reference to the class in which they are declared. In this way, the pitfalls introduced by global names are avoided while providing enough expressivity to handle variable coreference (via the definition of variable namespaces). Section 6 will further illustrate the use of the various coreference devices made available by XMG showing how they concretely facilitate grammar writing.
5. Extensibility
A third distinguishing feature of XMG is extensibility. XMG is extensible in that (i) dimensions can be added and (ii) each dimension can be associated with its own interpreter. In order to support an arbitrary number of dimensions, XMG relies on a device permitting the accumulation of an arbitrary number of types of literals, namely, Extensible Definite Clause Grammar (edcg) (Van Roy 1990). Once literals are accumulated according to their type (i.e., each type of literals is accumulated separately), they can be fed to dedicated interpreters. Because each of these sets of literals represents formulas of a description language, these interpreters are solvers whose role is to compute models satisfying the accumulated formulas.
Via this concept of separated dimensions, XMG allows us (i) to describe different levels of language (not only syntax, but also semantics and potentially morphology,13 etc.), and (ii) to define linguistic principles (well-formedness constraints to be applied on the structures being described). These principles depend either on the dimension (e.g., scope constraints in flat semantics), the target formalism (e.g. cooccurrence predicate-arguments in FB-LTAG), or the natural language (e.g., clitic ordering in Romance languages) being described.
In what follows, we start by showing how XMG handles dimensions independently from each other introducing edcg (Section 5.1). We then summarize the architecture of the XMG system (Section 5.2). We finally show how different solvers can be used to implement various constraints on each of these dimensions (Section 5.3). In particular, we discuss three kinds of extensions implemented in XMG: extension to several grammar formalisms, integration of explicit linguistic generalizations, and inclusion of color-based node marking to facilitate grammar writing.
5.1 XMG: Accumulating and Interpreting an Arbitrary Number of Descriptions
Accumulating (tree) descriptions. First, let us notice that XMG is nothing other than a logic language à la Prolog (Duchier, Parmentier, and Petitjean 2012). More precisely, an XMG specification is a collection of Horn clauses, which contribute a declarative description of what a computational tree grammar is.
Recall that the descriptions handled by XMG are in fact tuples of the form 〈SYN, SEM, DYN〉. An XMG class can thus describe, in a non-exclusive way, any of these three levels of description. If one wants to add another level of description (i.e., another dimension), one needs to extend the arity of this tuple. Before discussing this, let us first see how such tuples are processed by XMG.
As mentioned earlier, XMG's control language is comparable to Horn clauses. A common way to represent Horn clauses is by using Definite Clause Grammar (dcg) (Pereira and Warren 1980). Concretely, a dcg is a rewriting system (namely, a context-free grammar), where the symbols of the rewriting rules are equipped with pairs of unification variables (these are usually called difference list or accumulator) (Blackburn, Bos, and Striegnitz 2006, page 100). As an illustration, consider the following toy example.
The string language described by this dcg can be obtained by submitting the query s(X,[]) where X is a unification variable to be bound with lists of facts (these being the sentences belonging to the string language). As we can easily see, this language contains the sentences “a cat eats,” “the cat eats,” “a mouse eats,” “the mouse eats,” “a cat eats a mouse,” “a mouse eats a cat,” and so on.
Similarly, we can represent XMG classes as dcg clauses. For instance, the combinations of syntactic fragments given in relations (1)–(4) can be rewritten as dcg clauses as follows:
Disjunctions (e.g., the subject specification) translate to multiple clauses with identical heads and conjunctions (e.g., activeTransitiveVerb) to a clause body.
In our case, the terminal symbols of the underlying dcg are not just facts, but tuples of descriptions. In other words, the dcg clause whose head is canonicalSubject is associated with a tuple of the following form (the dots have to be replaced with adequate descriptions, these can contain unification variables, whose scope is by default local to the clause):
In order to allow for an extension of XMG to an arbitrary number of dimensions, instead of compiling XMG classes into a dcg whose accumulator stores tuples with a fixed arity, these classes are compiled into an edcg (Van Roy 1990). edcg are dcg with multiple accumulators. In XMG, each dimension is thus allocated a dedicated accumulator in the underlying edcg.
Note that although the content of the various dimensions is accumulated separately, dimensions may nevertheless share information either via local unification variables (if the XMG class defines several dimensions locally), via exported unification variables (in case of class instantiation or inheritance), or via the shared unification variables supported by the DYN dimension.
At the end of the edcg execution, we obtain, for each axiom of the metagrammar (i.e., for each class name to be valuated), a list of description formulas per accumulator. These lists are grouped together into a tuple of lists of the following form (N is the number of dimensions, and consequently of accumulators):
Each element (i.e., list Li) of such a tuple is a complete description of a given dimension, where shared variables have been unified (via unification with backtracking).
Solving (tree) descriptions. As illustrated earlier, interpreting XMG's control language in terms of an edcg yields tuples whose arity is the number of dimensions defined by the linguist, that is, triples of the form 〈SYN, SEM, DYN〉 if syntax, semantics, and the dynamic interface are described.
For each dimension D, XMG includes a constraint solver SD that computes the set of minimal models MD = SD(dD) satisfying the description (dD) of that dimension. In other words, each dimension is interpreted separately by a specific solver. For instance, the syntactic dimension is handled by a tree description solver that produces, for a given tree description, the set of trees satisfying that description, whereas the solver for the semantic dimension simply outputs the flat semantic representation (list of semantic literals) built by the edcg through accumulation.
Note that, although solvers are distinct, the models computed in each dimension may nonetheless be coupled through shared variables. In that case, these variables can constrain the models computed by the respective solvers. For instance, shared variables can be used for the syntactic tree description solver to be parametrized by some value coming from the semantic input description. Note that the output of the solving process is a Cartesian product of the sets of minimal models of each solver. As a consequence, the worst case complexity of metagrammar compilation is that of the various solvers associated with relevant dimensions.
In addition to having separate solvers for each dimension, the constraint-solving approach used in XMG permits us to modularize a given solver by combining different principles. Each such principle enforces specific constraints on the models satisfying the description of a given dimension. For instance, for the syntactic dimension of an FB-LTAG, a set of principles is used to enforce that the structures produced by the compiler are trees, and that these conform to the FB-LTAG formalism (e.g., there is no tree having two foot nodes).
5.2 Architecture
The XMG compiler14 consists of the following three modules:
A compiler that parses XMG's concrete syntax and compiles XMG classes into clauses of an EDCG.
A virtual machine (VM), which interprets edcg. This VM performs the accumulation of dimensions along with scope management and identifiers resolution. This VM is basically a unification engine equipped with backtracking, and which is extended to support edcg. Although its architecture is inspired by the Warren Abstract Machine (Aït-Kaci 1991), it uses structure-sharing to represent and unify prolog terms, and, given a query on a class, processes the conjunctions, disjunctions, inheritance, and export statements related to that class to produce its full definition, namely, a tree description for the SYN dimension, a flat semantic formula for the SEM dimension, and a feature structure for the DYN dimension.
A constraint-solving phase that produces for each dimension the minimal models satisfying the input description as unfolded by the preceding two steps.
As already mentioned, the first part is extensible in that new linguistic dimensions can be added by specifying additional dedicated accumulators to the underlying edcg. The second part is a unification engine that interprets edcg while performing both term unification and polarized unification (i.e., unification of polarized feature structures, as defined by (Perrier 2000), and discussed in Section 5.3.1). This extended unification is the reason why XMG does not merely recourse to an existing Prolog engine to process edcg, but relies on a specific VM instead.
The third part is completely modular in that various constraint solvers can be plugged in depending on the requirements set by the dimensions used, and the chosen grammatical framework. For instance, the SYN dimension is solved in terms of tree models, and the SEM dimension is solved in terms of underspecified flat semantic formulae (i.e., the input semantics remains untouched modulo the unification of its shared variables).
Importantly, these additional solvers can be “turned on/off” (via a primitive of the XMG language) so that, for instance, the same processor can be used to compile an XMG specification for an FB-LTAG using linguistic principles such as those defined in the next section (i.e., clitic ordering principle) or not.
5.3 Three Extensions of XMG
We now show (i) how the modular architecture of the XMG compiler permits us to specify grammars for several tree-based linguistic formalisms; (ii) how it can be extended to enforce language specific constraints on the syntactic trees; and (iii) how additional formal constraints (namely node marking) can be integrated to simplify node identifications (and consequently grammar writing).
5.3.1 TAG, MC-TAG, and IG: Producing Trees, Tree Sets, or Tree Descriptions
XMG integrates a generic tree solver that computes minimal tree models from tree description logic formulae built on the language SYN introduced in Section 4. This solver integrates the dominance solving technique proposed by Duchier and Niehren (2000) and can be summarized as follows. A minimal tree model is described in terms of the relative positions of its nodes. For each node n in a minimal tree model T, the set of all the nodes of T can be partitioned in five subsets, depending on their position relative to n. Hence, for each node variable n appearing in a tree description, it is first associated with an integer (called node id). We then define the five sets of node ids (i.e., sets of integers) Downn, Upn, Leftn, Rightn, and Eqn referring to the ids of the nodes located below, above, on the left, on the right, or identified with n, respectively (see Figure 6). Note that we require that these sets are a partition of all node ids.
Once all input relations are translated into set constraints, the solver uses standard Constraint Satisfaction techniques (e.g., a first-fail exploration of the search tree) to find a set of consistent partitions. Finally, the nodes of the models are obtained by considering nodes with distinct Eqn.
FB-LTAG trees. To support the specification of FB-LTAG trees, the XMG compiler extends the generic tree solver described here with a set of constraints ensuring that the trees are well-formed TAG trees. In effect, these constraints require the trees to be linear ordered trees with appropriate decorations. Each node must be labeled with a syntactic category. Leaf nodes are either terminal, foot, or substitution nodes. There is at most one foot node per tree and the category of the foot node must be identical to that of the root node. Finally, each tree must have at least one leaf node that is an anchor.
MCTAG tree sets. Where FB-LTAG consists of trees, MC-TAG (Weir 1988) consists of sets of trees. To support the specification of MC-TAG, the sole extension needed concerns node variables that are not dominated by any other node variable in the tree description. Whereas for FB-LTAG, these are taken to denote either the same root node or nodes that are connected to some other node (i.e., uniqueness of the root), for MC-TAG they can be treated as distinct nodes, thereby allowing for models that are sets of trees rather than trees (Parmentier et al. 2007). In other words, the only modification brought to the tree description solver is that, in MC-TAG mode, it does not enforce the uniqueness of a root node in a model.
IG polarized tree descriptions. IG (Perrier 2000) consist of tree descriptions whose node variables are labeled with polarized feature structures. A polarized feature structure is a set of polarized feature triples (f,p,v) where f and v are standard features and feature values, respectively, and p is a polarity value in {→, ←, =, ≈}. Polarities are used to guide parsing in that a valid derivation structure must neutralize polarities.
To support an XMG encoding of IG, two extensions are introduced, namely, (i) the ability to output tree descriptions rather than trees, and (ii) the ability to write polarized feature structures. The first extension is trivially realized by specifying a description solver that ensures that any output description has at least one tree model. For the second point, the SYN language is extended to define polarized feature structures and the unification engine to support unification of polarized features (for instance, a → feature will unify with a neutral (=) feature to yield a → polarized feature value triple).
5.3.2 Adding Specific Linguistic Constraints: The Case of Clitics
XMG can be extended to support specific constraints on tree descriptions (e.g., constraints on node linear order), which make it possible to describe linguistic-dependent phenomena, such as, for instance, clitic ordering in French, at a meta-level (i.e., within the metagrammar).
To support a direct encoding of Perlmutter's observation, XMG includes both a node uniqueness principle and a node ordering principle. The latter allows us to label nodes with some property (let us call it rank) whose value is an integer (for instance, one can define a node as n1 (rank : 2) [cat : Cl]). When solving tree descriptions, XMG further requires that in a valid tree model, (i) there are no two nodes with the same rank and (ii) sibling nodes labeled with a rank are linearly ordered according to their rank.
Accordingly, in the French grammar of Crabbé (2005), each node labeled with a clitic category is also labeled with a numerical node property representing its rank.17 XMG ordering principle then ensures that the ill-formed tree crossed out in Figure 7 is not produced. Note that in Figure 7, every type of clitic is defined locally (i.e., in a separate class), and that the interactions between these local definitions are handled by XMG using this rank principle, to produce only one valid description (pictured to the right of the arrow).
That is, XMG ordering constraints permit a simple, declarative encoding of the interaction between clitics. This again contrasts with systems based on lexical rules. As noted by Perlmutter (1970), if clitics are assumed to be moved by transformations, then the order in which lexical rules apply this movement must be specified.
To implement the uniqueness principle, one needs to express the fact that in a valid model φ, there is only one node having a given property p (i.e., a parameter of the constraint, here the value of the rank node property). This can be done by introducing, for each node n of the description, a Boolean variable pn indicating whether the node denoting n in the model has this property or not (i.e., are there two nodes of identical rank?). Then, if we call the set of integers referring to nodes having the property p in a model, we have: . Finally, if we represent pn being true with 1 and pn being false with 0,18 and we sum pn for each n in the model, we have that in a valid model this sum is strictly lower than 2: ∑ n ∈ φpn < 2.
5.3.3 Adding Color Constraints to Facilitate Grammar Writing
To further ease grammar development, XMG supports a node coloring mechanism that permits nameless node identification (Crabbé and Duchier 2004), reminiscent of the polarity-based node identification first proposed by Muskens and Krahmer (1998) and later used by Duchier and Thater (1999) and Perrier (2000). Such a mechanism offers an alternative to explicit node identification using equations between node variables. The idea is to label node variables with a color property, whose value (either red, black, or white) can trigger node identifications.
This mechanism is another parameter of the tree solver. When in use, the valid tree models must satisfy some color constraints, namely, they must only have red or black nodes (no remaining white nodes; these have to be identified with some black nodes). As shown in the following table, node identification must observe the following constraints: A white node must be identified with a black node; a red node cannot be identified with any other node; and a black node may be identified with one or more white nodes.20
Node coloring offers an alternative to complex namespace management. The main advantage of this particular identification mechanism is its economy: Not only is there no longer any need to remember node identifiers, there is in fact no need to choose a name for node variables.
It is worth stressing that the XMG node identification process is reduced to a constraint-solving problem and so it is not a sequential process. Thus the criticisms leveled by Cohen-Sygal and Wintner (2007, 2009) against non-associative constraints on node unification do not apply.
Briefly, in their work, Cohen-Sygal and Wintner (2007, 2009) showed that any polarity-based tree description formalism is not associative. In other words, when describing trees in terms of combinations of polarized structures, the order in which the structures are combined matters (i.e., the output structures depend on the combination order). This feature makes such formalisms not appropriate for a modular and collaborative grammar engineering, such as that of Cohen-Sygal and Wintner (2011) for Unification Grammar.
In the XMG case, when using node colors, the tree description solver does not rely on any specific fragment combination order. It computes all possible combination orders. In this context, the grammar designer cannot think in terms of sequences of node identifications. This would lead to tree overgeneration.
Again, it is important to remember that tree solving computes any valid tree model, independently of any specific sequence of node identifications (all valid node identifications are computed). In this context, non-associativity of color-based node identification is not an issue, but rather a feature, as it allows for a compact description of a large number of node identifications (and thus of tree structures).
6. Writing Grammars with XMG
In this section, we first provide a detailed example showing how XMG can be used to specify the verbal trees of a large FB-LTAG for French extended with unification-based semantics. We then give a brief description of several large- and middle-scale grammars that were implemented using XMG.
6.1 SemTag: A large FB-LTAG for French Covering Syntax and Semantics
We now outline the XMG specification for the verbal trees of SemTag, a large FB-LTAG for French. This specification further illustrates how the various features of XMG (e.g., combined use of disjunction and conjunction, node colors) permit us to specify compact and declarative grammar descriptions. We first discuss the syntactic dimension (SYN). We then go on to show how the semantic dimension (SEM) and the syntax/semantic interface (DYN) are specified.
6.1.1 The Syntactic Dimension
The methodology used to implement the verbal fragment of SemTag can be summarized as follows. First, tree fragments are defined that represent either a possible realization of a verb argument or a possible realization of the verb. The verbal elementary TAG trees of SemTag are then defined by appropriately combining these tree fragments.
To maximize structure sharing, we work with four levels of abstraction. First, basic tree fragments describing verb or verb argument realizations are defined. Second, grammatical functions are defined as disjunctions of argument realizations. Third, verbal diathesis alternatives are defined as conjunctions of verb realizations and grammatical functions. Fourth, diathesis alternatives are gathered into tree families. In the next paragraphs, we explain each of these levels in more detail.
Tree fragments. Tree fragments are the basic building blocks used to define SemTag. These are the units that are shared and reused in the definition of many elementary trees. For instance, the fragment for a canonical subject will be used by all FB-LTAG elementary trees involving a canonical subject.
As mentioned earlier, to specify the verbal elementary trees of SemTag, we begin by defining tree fragments which describe the possible syntactic realizations of the verb arguments and of the verb itself. Figure 8 provides some illustrative examples of these fragments. Here and in the following, we omit the feature structures decorating the trees to facilitate reading.21
To further factorize information and facilitate grammar maintenance, the basic tree fragments are organized in an inheritance hierarchy.22Figure 9 shows a partial view of this hierarchy illustrating how the tree fragments for argument realization depicted in Figure 8 are organized to maximize the sharing of common information. The hierarchy classifies the verbal arguments depicted in Figure 8 into four categories:
- 1.
The canonical subject is a noun realized in front of the verb.
- 2.
Canonical complements occur after the verb. The canonical object is a noun phrase whereas prepositional complements are introduced by specific prepositions, namely, à for the canonical indirect object and par for the canonical by object.
- 3.
Wh-arguments (or questioned arguments) occur in front of a sentence headed by a verb. A Wh-object is an extracted noun whereas questioned prepositional objects are extracted prepositional phrases that are introduced by a specific preposition.
- 4.
Finally, the relativized subject is a relative pronoun realized in front of the sentence. Extracted subjects in French cannot be realized at an unbounded distance from the predicate.
6.1.2 The Semantic Dimension and the Syntax/Semantic Interface
We now show how to extend the XMG specification presented in the previous section to integrate a unification-based compositional semantics. Three main changes need to be carried out:
- 1.
Each elementary tree must be associated with a semantic formula. This is done using the SEM dimension.
- 2.
The nodes of elementary trees must be labeled with the appropriate semantic indices. This involves introducing the correct attribute-value pair in the correct feature structure (top or bottom) on the appropriate node.
- 3.
Syntax and semantics need to be synchronized—that is, variable sharing between semantic formulae and tree indices need to be enforced. To this end we use the DYN dimension.
Co-indexing trees and formulae indices. Assuming that tree nodes are appropriately decorated with semantic indices by the specification scheme described in the next paragraph, we now show how to enforce the correct mapping between syntactic and semantic arguments. This is done in two steps.
Labeling tree nodes with semantic indices. This scheme relies on the assumption that tree nodes are appropriately labeled with semantic indices (e.g., the subject node must be labeled with a semantic index) and that these indices are appropriately named (arg1 must denote the parameter representing the first argument of a binary relation and indexsubject the value of the index feature on a subject node). As suggested by Gardent (2007), a complete semantic labeling of a TAG with the semantic features necessary to enrich this TAG with the unification-based compositional semantics sketched in the previous section can be obtained by applying the following labeling principles:26
Argument labeling: In trees associated with semantic functors, each argument node is labeled with a semantic index27 named after the grammatical function of the argument node (e.g., indexsubject for a subject node).
Controller/Controllee: In trees associated with control verbs, the semantic index of the controller is identified with the value of the controlled index occurring on the sentential argument node.
Anchor projection: The anchor node projects its index up to its maximal projection.
Foot projection: A foot node projects its index up to the root.28
The Argument Labeling principle states that, in the tree associated with a syntactic functor (e.g., a verb), each node representing a syntactic argument (e.g., the subject node) should be labeled with a semantic index named after the grammatical function of that node (e.g., indexsubject).29
Value sharing between the semantic index of the controller (e.g., the subject of the control verb) and that of the controllee (e.g., the empty subject of the infinitival complement) is enforced using linking constraints between the semantic index labeling the controller node and that labeling the sentential argument node of the control verb. Control verb definitions then import the appropriate (object or subject control) linking constraint.
The anchor (respectively, foot) projection principle stipulates the projection of semantic indices from the anchor (respectively, foot) node up to the maximal projection (respectively, root). Concretely, this means that the top and bottom features of the nodes located on this path between the anchor (respectively, foot) and the maximal projection (respectively, root) all include an index feature whose value is shared between adjacent nodes (see variables Ei in Figure 10).30 Once the top and bottom structures are unified, so are the semantic indices along this path (modulo expected adjunctions realized on the projection).
To implement these principles, we define a set of anchor projection classes {Depth1, Depth2, Depth3} as illustrated in Figure 10. We then “glue” these projection skeletons onto the relevant syntactic trees by importing the skeletons in the syntactic tree description and explicitly identifying the anchor node of the semantic projection classes with the anchor or foot node of these syntactic tree descriptions. Because the models must be trees, the nodes dominating the anchor node of the projection class will deterministically be identified with those dominating the anchor or foot node of the trees being combined with. For instance, for verbs, the class specifying the verbal spine (e.g., ActiveVerbForm, see Figure 10) equates the anchor node of the verbal spine with that of the projection skeleton. As a result, the verb projects its index up to the root.
6.1.3 Some Figures About SemTag
As mentioned previously, SemTag is a large FB-LTAG for French equipped with semantics (Gardent 2008); it extends the purely syntactic FTAG of Crabbé (2005) with a unification based compositional semantics as described by Gardent and Kallmeyer (2003).31 The syntactic FTAG in essence implements Abeillé's (2002) proposal for an FB-LTAG-based modeling of French syntax. FTAG contains around 6,000 elementary trees built from 293 XMG classes and covers some 40 basic verbal sub-categorization frames. For each of these frames, FTAG defines a set of argument alternations (active, passive, middle, neuter, reflexivization, impersonal, passive impersonal) and of argument realizations (cliticization, extraction, omission, permutations, etc.) possible for this frame. Predicative (adjectival, nominal, and prepositional) and light verb constructions are also covered as well as some common sub-categorizing noun and adjective constructions. Basic descriptions are provided for the remaining constructions namely, adverbs, determiners, and prepositions.
FTAG and SemTag were both evaluated on the Test Suite for Natural Language Processing (Tsnlp) (Lehmann et al. 1996), using a lexicon designed specifically on the test suite, hence reducing lexical ambiguity (Crabbé 2005; Parmentier 2007). This test suite focuses on difficult syntactical phenomena, providing grammatical and ungrammatical sentences. These competence grammars accept 76% of the grammatical items, reject 83% of the ungrammatical items, and have an average ambiguity of 1.64 parses per sentence. To give an idea of the compilation time, under architectures made of a 2-Ghz processor with 1 Gb of RAM, it takes XMG 10 minutes to compile the whole SemTag (recall that there is no semantic description solving, hence the compilation times between FTAG and SemTag do not differ).32
Note that SemTag can be used for assigning semantic representations to sentences when combined with an FB-LTAG parser and a semantic construction module as described by Gardent and Parmentier (2005, 2007).33 Conversely, it can be used to verbalize the meaning denoted by a given semantic representation when coupled with the GenI surface realizer described by Gardent and Kow (2007).
6.2 Other Grammars Designed with XMG
XMG has been used mainly to design FB-LTAG and IG for French or English. More recently, it has also been used to design a FB-LTAG for Vietnamese and a TreeTuple MC-TAG for German. We now briefly describe each of these resources.
SemXTAG. The English grammar, SemXTag (Alahverdzhieva 2008), reimplements the FB-LTAG developed for English at the University of Pennsylvania (XTAG Research Group 2001) and extends it with a unification-based semantics. It contains 1,017 trees and covers the syntactic fragment of XTAG, namely, auxiliaries, copula, raising and small clause constructions, topicalization, relative clauses, infinitives, gerunds, passives, adjuncts, ditransitives (and datives), ergatives, it-clefts, wh-clefts, PRO constructions, noun–noun modification, extraposition, determiner sequences, genitives, negation, noun–verb contractions, sentential adjuncts, imperatives, and resultatives. The grammar was tested on a handbuilt test-suite of 998 sentences illustrating the various syntactic constructions meant to be covered by the grammar. All sentences in the test suite can be parsed using the grammar.
FrenchIG. The extended XMG framework was used to design a core IG for French consisting of 2,059 tree descriptions compiled out of 448 classes (Perrier 2007). The resulting grammar is lexicalized, and its coverage was evaluated using the previously mentioned Tsnlp. The French IG accepts 88% of the grammatical sentences and rejects 85% of the ungrammatical sentences, although the current version of the French IG does not yet cover all the syntactic phenomena presented in the test suite (for example, causative and superlative constructions).
Vietnamese TAG. The XMG language was used by Le Hong, N'Guyen, and Roussanaly (2008) to produce a core FB-LTAG for Vietnamese. Their work is rather a proof of concept than a large-scale implementation. They focused on Vietnamese's categorization frames, and were able to produce a TAG covering the following frames: intransitive (tree family N0V), transitive with a nominal complement (N0VN1), transitive with a clausal complement (N0VS1), transitive with modal complement (N0V0V1), ditransitive (N0VN1N2), ditransitive with a preposition (N0VN1ON2), ditransitive with a verbal complement (N0V0N1V1), ditransitive with an adjectival complement (N0VN1A), movement verbs with a nominal complement (N0V0V1N1), movement verbs with an adjectival complement (N0V0AV1), and movement ditransitive (N0V0N1V1N2).
GerTT. Another XMG-based grammar corresponds to the German MC-TAG of Kallmeyer et al. (2008). This grammar, called GerTT, is in fact an MC-TAG with Tree Tuples (Lichte 2007). This variant of MCTAG has been designed to model free word order phenomena. This is done by imposing node sharing constraints on MCTAG derivations (Kallmeyer 2005). GerTT covers phenomena such as scrambling, coherent constructions, relative clauses, embedded questions, copula verbs, complementized sentences, verbs with various sub-categorization frames, nouns, prepositions, determiners, adjectives, and partly includes semantics. It is made of 103 tree tuples, compiled from 109 classes.
7. Related Work
We now compare XMG with existing environments for designing tree-based grammars and briefly report on the grammars designed with these systems.
7.1 Environments for Designing Tree-Based Grammars
Candito's Metagrammar Compiler. The concept of metagrammar was introduced by Candito (1996). In her paper, Candito presented a compiler for abstract specifications of FB-LTAG trees (the so-called metagrammars). Such specifications are based on three dimensions, each of them being encoded in a separate inheritance hierarchy of linguistic descriptions. Dimension 1 describes canonical sub-categorization frames (e.g., transitive), the Dimension 2 describes redistributions of syntactic functions (e.g., active to passive), and Dimension 3 the tree descriptions corresponding to the realizations of the syntactic functions defined in Dimension 2. This three-dimensional metagrammatical description is then processed by a compiler to compute FB-LTAG tree schemas. In essence, these tree schemas are produced by associating a canonical sub-categorization frame (Dimension 1) with a compatible redistribution schema (Dimension 2), and with exactly one function realization (Dimension 3) for each function required by the sub-categorization frame.
Candito's (1996, 1999) approach improves on previous proposals by Vijay-Shanker and Schabes (1992) and Evans, Gazdar, and Weir (1995) in that it provides a linguistically principled basis for structuring the inheritance hierarchy. As shown in Section 6.1, the XMG definition of SemTag uses similar principles. Candito's approach differs, however, from the XMG account in several important ways:
Much of the linguistic knowledge used to determine which classes to combine is hard-coded in the compiler (unlike in XMG, there is no explicit control on class combinations). In other words, there is no clear separation between the linguistic knowledge needed to specify a high-level FB-LTAG description and the algorithm used to compile an actual FB-LTAG from this description. This makes grammar extension and maintenance by linguists extremely difficult.
As in Vijay-Shanker and Schabes (1992) Evans, Gazdar, and Weir (1995), the linguistic description is non-monotonic in that some erasing classes are used to remove information introduced by other dimensions (e.g., agentless passive).
The approach fails to provide an easy means to state exceptions. These are usually encoded in the compiling algorithm.
The tree description language used to specify classes in Dimension 3 relies on global node variables. Thus, two variables with identical names introduced in different classes are expected to refer to the same tree node. As argued in Section 4, this makes it hard to design large-scale metagrammars.
LexOrg suffers from similar limitations as Candito's compiler. Much of the linguistic knowledge is embedded in the compiling algorithm, making it difficult for linguists to extend the grammar description and to handle exceptions. Unlike in Candito's framework, the tree description language uses local node variables and lets the tree description solver determine node identifications. Although this avoids having to memorize node names, this requires that the descriptions be constrained enough to impose the required node identifications and prevent the unwanted ones. In practice, this again complicates grammar writing. In contrast, XMG provides an intermediate solution which, by combining local variables with export declarations, avoids having to memorize too many node variable names (only those local to the relevant sub-hierarchy need memorizing) while allowing for explicit node identification.
The Metagrammar Compiler of Gaiffe, Crabbé, and Roussanaly. Gaiffe, Crabbé, and Roussanaly (2002) proposed a compiler for FB-LTAG that aims to remedy both the lack of a clear separation between linguistic information and compilation algorithm, and the lack of explicit control on the class combinations prevalent in Candito (1996), Xia et al. (1998), and Xia (2001). In their approach, the linguistic specification consists of a single inheritance hierarchy of classes, each class containing a tree description. The description logic used is similar to Candito's. That is, global node names are used. To trigger class combinations, classes are labeled with two types of information: needs and resources. The compiler selects all final classes of the hierarchy, performs all possible combinations, and only keeps those combinations that neutralize the stated needs and resources. The tree descriptions contained in these neutral combinations are then solved to produce the expected trees.
Although this approach implements a clear separation between linguistic information and compilation algorithm, the fully automatic derivation of FB-LTAG trees from the inheritance hierarchy makes it difficult in practice to control overgeneration. In contrast, XMG's explicit definitions of class combinations by conjunction, disjunction, and inheritance makes it easier to control the tree set that will be generated by the compiler from the grammar specification. Additionally, the issues raised by global variables remain (no way to instantiate twice a given class, and cumbersome definition of variables in large metagrammars).
The MGCOMP System. More recently, Villemonte de la Clergerie (2005, 2010) proposed a compiler for FB-LTAG that aims at preserving a high degree of factorization in both the abstract grammar specification and the grammar which is compiled from it. Thus, the MGCOMP system does not compute FB-LTAG elementary trees, but factorized trees.
In MGCOMP, like in Gaiffe, Crabbé, and Roussanaly's (2002) approach, a metagrammar consists of a single hierarchy of classes. The classes are labeled with needs and resources, and final classes of the hierarchy are combined to compute tree descriptions. The main differences with Gaiffe, Crabbé, and Roussanaly (2002), lies in the fact that (i) a description can include new factorizing operators, such as repetition (Kleene-star operator), shuffling (interleaving of nodes), optionality, and disjunctions; and (ii) it offers namespaces to specify the scope of variables. MGCOMP's extended tree descriptions are not completely solved by the compiler. Rather, it compiles underspecified trees (also called factorized trees). With this approach, a large grammar is much smaller in terms of number of grammatical structures than a classical FB-LTAG. As a result, the grammars it compiles are only compatible with the DyALog parsing environment (Villemonte de La Clergerie 2005). And, because the linguist designs factorized trees and not actual TAG trees, debugging the metagrammar becomes harder.
7.2 Resources Built Using Candito, Xia, and De La Clergerie's Systems
Candito's system has been used by Candito (1999) herself to design a core FB-LTAG for French and Italian, and later by Barrier (2006) to design a FB-LTAG for adjectives in French. Xia's system (LexOrg) has been used to semi-automatically generate XTAG (Xia 2001). De La Clergerie's system (MGCOMP) has been used to design a grammar for French named FRMG (FRench MetaGrammar) (Villemonte de la Clergerie 2010). FRMG makes use of MGCOMP's factorizing operators (e.g., shuffling operator), thus producing not sensu stricto a FB-LTAG, but a factorized FB-LTAG. FRMG is freely available, contains 207 factorized trees (having optional branches, etc.) built from 279 metagrammatical classes, and covers 95% of the Tsnlp.
8. Conclusion
In this article, we presented the eXtensible MetaGrammar framework and argued that, contrary to other existing grammar writing environments for tree-based grammar, XMG is declarative, extensible, and notationally expressive. We believe that these features make XMG particularly appropriate for a fast prototyping of the kind of deep tree-based grammars that are used in applications requiring high precision in grammar modeling (e.g., language teaching, man/machine dialogue systems, data-to-text generation).
The XMG language is documented on-line, and its compiler is open source software, freely available under the terms of the GPL-compliant CeCILL license.34 Many grammars designed with XMG (FB-LTAG and IG for French and English, TT-MCTAG for German) are also open-source and available on-line.35
Future research will focus on extensibility. So far, XMG has been used to design tree-based grammars for different languages. We plan to extend XMG to handle other types of formalisms36 such as dependency grammars, and to support dimensions other than syntax and semantics such as for instance, phonology or morphology. As mentioned here, XMG offers a modular architecture, making it possible to extend it relatively easily. Nonetheless, in its current state, such extensions imply modifying XMG's code. We are exploring new extensions of the formalism, which would allow the linguist to dynamically define her/his metagrammar formalism (e.g., which principles or descriptions to use) depending on the target formalism.
Another interesting question concerns cross-language grammar engineering. So far, the metagrammar allows for dealing with structural redundancy. As pointed out by Kinyon et al. (2006), a metagrammar can be used to capture generalizations across languages and is surely worth further investigating.
Finally, we plan to extend XMG with features borrowed from Integrated Development Environments (IDE) for programming languages. Designing a grammar is, in some respect, similar to programming an application. Grammar environments should benefit from the same tools as those used for the development of applications (incremental compilation, debugger, etc.).
Acknowledgements
We are grateful to the three anonymous reviewers for their valuable comments. Any remaining errors are ours.
Notes
The elementary trees displayed in this article conform to Abeillé (2002), that is, we reject the use of a VP constituent in French.
As mentioned earlier, we describe lexicalized TAG, thus every tree schema has to contain at least one anchor (node labeled ⋄).
Cx/Cx abbreviate a node with category C and a top/bottom feature structure including the feature-value pair {index :x}.
For now, let us consider that the tree fragments are combined in order to produce minimal trees by merging nodes whose categories (and features) unify. In the next section, we will see how to precisely control node identification using either node variables or node constraints.
Note that in XMG, it is not mandatory to define any tree structure inside SubjAgreement. We could define independent NP and VP nodes, and associate them with variables, say n1 and n2. n1 and n2 would then be exported and reused directly in the classes CanonicalSubject and Wh-NP-Subject, respectively.
Note that these clauses only consider canonical subjects to avoid having both a Wh-subject and a Wh-object. This is not entirely satisfactory, as we would prefer to define a single abstraction over objects (as was done for subjects) and use it wherever possible. There would then be another mechanism to capture this exception and cause the invalid combination to fail (that is, the resulting tree description not to have any model). Such a mechanism exists in XMG, and is called linguistic principle (see Section 5).
By coreference, we mean the sharing of information between distinct elementary fragments of the grammar specification.
See Gardent and Kallmeyer (2003) for a detailed introduction to flat semantics.
For more details on the interpretation of flat semantics and on its association with a grammar of natural language, see Gardent (2008).
Although formally precise, this notation can be cumbersome. In the interest of legibility we adopt throughout the convention that SYN stands for 〈SYN, , 〉, SEM for 〈 ,SEM, 〉, and DYN for 〈 , ,DYN〉.
An analogous situation may arise in English with ditransitive verbs requiring two direct objects.
In fact, the notation used by Vijay-Shanker and Schabes (1992) is attr:X with attr an attribute variable ranging over a finite set of attributes, to indicate special node variables that scope outside their class; and attr(A) to refer to such variables from outside the entity in which they were declared. We use a different notation here to enforce consistency with the XMG notation.
Recently, XMG has been used to describe the morphology of verbs in Ikota, a Bantu language spoken in Gabon (Duchier, Parmentier, and Petitjean 2012).
The XMG compiler is open source software released under the terms of the CeCILL GPL-compliant licence. See http://sourcesup.renater.fr/xmg.
⊎ represents disjoint union.
In (Examples 25a–c), the numbers on the clitics indicate their rank.
Recall that node properties are features whose values are used by the tree description solver in order to restrict the set of valid models. These properties may not appear in the trees produced from the input metagrammar. For instance, the rank property is not part of the FB-LTAG formalism, and thus does not appear in the FB-LTAG elementary trees produced by XMG.
These integer representations are usually called reified constraints.
In fact, rather than adding strict precedence constraints to the tree description, we directly add to the solver their equivalent set constraints on Eq, Up, Left, Right, Down, introduced earlier.
In other words, node colors can be seen as information on node saturation.
See Crabbé (2005) for a complete description of SemTag tree fragments, including feature structures.
Recall from Section 4 that inheritance is used to share namespaces. Thus, (node or feature) variables introduced in a given class C can be directly reused in the sub-classes of C.
Note that, when these abstractions will be combined to describe for instance transitive verbs, the combination of WhObj with WhByObj will be ruled out by using a uniqueness principle such as introduced in Section 5.
It is often argued that a language of grammatical representation must be equipped with an “erasing device” like lexical rules because of phenomena such as the passive without agent. In this framework it turns out that this kind of device is not needed because we do not grant any special status to base trees.
Note that number and gender agreements are dealt with using coreferences between features labeling syntactic nodes, see Crabbé (2005).
The principles required to handle quantification are omitted. We refer the reader to Gardent (2007) for a more extensive presentation of how semantics is implemented using XMG.
For simplicity, we only mention indices. To be complete, however, labels should also be used.
The foot projection principle only applies to foot nodes that are not argument nodes (i.e., to modifiee nodes).
In other words, this argument labeling principle defines an explicit and normalized reference to any realization of a semantic argument. Following FB-LTAG predicate–argument co-occurrence principle (Abeillé, Candito, and Kinyon 1999), we know that any elementary tree includes a leaf node for each realized semantic argument of its anchor. This principle thus holds in any FB-LTAG. Its implementation, however, is closely related to the architecture of the metagrammar; here we benefit from the fact that verbal arguments are described in dedicated classes to reach a high degree of factorization.
For sake of brevity, we write for [bot:[index:E1] top:[index:E2]]. 〈 〉 refers to the anchor / foot.
FTAG and SemTag are freely available under the terms of the GPL-compliant CeCILL license, the former at https://sourcesup.renater.fr/scm/viewvc.php/trunk/METAGRAMMARS/FrenchTAG/?root=xmg, and the latter on request.
As a comparison, about one hour was needed by Candito's (1999) compiler to produce a French FB-LTAG containing about 1,000 tree schemas.
As an alternative way to parse FB-LTAG grammars equipped with flat semantics such as those produced by XMG, one can use the Tübingen Linguistic Parsing Architecture (TuLiPA) (Kallmeyer et al. 2010).
The French TAG and French and English IG are available on XMG's website, and the German TreeTuple MC-TAG is available at http://www.sfs.uni-tuebingen.de/emmy/res.html.
Preliminary work on cross-framework grammar engineering has been realized by Clément and Kinyon (2003), who used Gaiffe et al.'s compiler to produce both a TAG and a LFG from a given metagrammar.
References
Author notes
UFR de Linguistique, Université Paris Diderot-Paris 7, Case 7003, 2, F-75205 Paris Cedex 13, France. E-mail: [email protected].
Laboratoire d'Informatique Fondamentale d'Orléans, Bâtiment IIIA, Rue Léonard de Vinci, B.P. 6759, F-45067 Orléans Cedex 2, France. E-mail: [email protected].
Laboratoire LORIA - CNRS, Projet Synalp, Bâtiment B, BP 239, Campus Scientifique, F-54506 Vandœuvre-Lès-Nancy Cedex, France. E-mail: [email protected].
Laboratoire d'Informatique de Paris Nord, UMR CNRS 7030, Institut Galilée - Université Paris-Nord, 99, avenue Jean-Baptiste Clément, F-93430 Villetaneuse, E-mail: [email protected].
Laboratoire d'Informatique Fondamentale d'Orléans, Bâtiment IIIA, Rue Léonard de Vinci, B.P. 6759, F-45067 Orléans Cedex 2, France. E-mail: [email protected].