Tree-adjoining grammar (TAG) is a grammar formalism defined by Aravind Joshi. Tree-adjoining grammars are somewhat similar to context-free grammars, but the elementary unit of rewriting is the tree rather than the symbol. Whereas context-free grammars have rules for rewriting symbols as strings of other symbols, tree-adjoining grammars have rules for rewriting the nodes of trees as other trees (see tree (graph theory) and tree (data structure)).
TAG originated in investigations by Joshi and his students into the family of adjunction grammars (AG), the "string grammar" of Zellig Harris. AGs handle exocentric properties of language in a natural and effective way, but do not have a good characterization of endocentric constructions; the converse is true of rewrite grammars, or phrase-structure grammar (PSG). In 1969, Joshi introduced a family of grammars that exploits this complementarity by mixing the two types of rules. A few very simple rewrite rules suffice to generate the vocabulary of strings for adjunction rules. This family is distinct from the Chomsky-Schützenberger hierarchy but intersects it in interesting and linguistically relevant ways. The center strings and adjunct strings can also be generated by a dependency grammar, avoiding the limitations of rewrite systems entirely.
A TAG can be defined as a 5-tuple with:
Additionally, TAGs with adjunction constraints on nodes have been introduced. An adjunction constraint on a node can: completely disallow adjunction (NA, for null adjunction); make it obligatory (OA); or only allow selected auxiliary trees to adjoin (SA).
The two types of basic tree in TAGâÂÂinitial trees (often denoted by ) and auxiliary trees ()âÂÂare together called elementary trees. Initial trees represent basic valency relations, while auxiliary trees allow for recursion.
A derivation starts with an initial tree, which is combined with further trees via either substitution or adjunction. Substitution replaces a frontier node with an initial tree whose root node has the same label as the leaf for which it is substituted. Adjunction inserts an auxiliary treeâÂÂat either a frontier or an internal nodeâÂÂwhose root and foot labels both match the label of the node whereat it adjoins. Adjunction can thus have the effect of inserting an auxiliary tree into the center of another tree, which operation may be applied recursively.
For every context-free grammar, a tree-adjoining grammar can be generated which accepts the same string-language. Thus, TAGs can generate all context-free languages; they can generate, as well, someâÂÂbut not allâÂÂcontext-sensitive languages.
Two examples of context-sensitive/non-context-free languages that TAGs (with adjunction constraints) can generate are:
Tree-adjoining grammars are more powerful (in terms of weak generative capacity) than context-free grammars, but less powerful than linear context-free rewriting systems, indexed, or context-sensitive grammars.
Two examples of context-sensitive languages that TAGs cannot generate are:
The processing of languages that TAGs can generate may be represented by an embedded pushdown automaton.
Tree-adjoining grammars are often described as mildly context-sensitive. These grammar classes are conjectured to be powerful enough to model natural languages while remaining efficiently parsable in the general case.
Vijay-Shanker and Weir (1994) demonstrated that linear indexed grammars, combinatory categorial grammar, tree-adjoining grammars, and head grammars are weakly equivalent formalisms, in that they all define the same string languages.
Lexicalized tree-adjoining grammars (LTAG) are a variant of TAG in which each elementary tree (initial or auxiliary) is associated with a lexical item. Each tree has at least one terminal as a leaf node, which is then called the (lexical) anchor of the tree. A lexicalized grammar for English has been developed by the XTAG Research Group of the Institute for Research in Cognitive Science at the University of Pennsylvania.
Other variants of TAG allow multi-component trees, trees with multiple foot nodes, and other extensions.