** Next:** Examples
** Up:** The definition of a
** Previous:** Output Generation

In the previous subsections we have considered only the aspects of a metarule
involving the structural part of the XTAG trees. In a feature based grammar
as XTAG is, accounting for features is essential. A metarule is not really
worth if it doesn't account for the proper change of feature
equations^{25.9} from the input to the output tree.
The aspects that have to be considered here are:
- Which feature equations should be required to be present in
**inp**
in order for the match to succeed.
- Which feature equations should be generated in the output tree as a
function of the feature equations in the input tree.

Based on the possible combinations of these requirements we partition the
feature equations into the following five classes^{25.10}:
*Require & Retain:* Feature equations in this class
are required to be in **inp** in order for matching to succeed.
Upon matching, these equations will be copied to the output tree.
To achieve this behaviour, the equation must be placed in
the **lhs** tree of the metarule preceded by a plus character
(e.g.
+*V*.*t*:<*trans*>=+)^{25.11}
*Require & Don't Copy:* The equation is required to be in
**inp**
for matching, but should not be copied to the output tree.
Those equations must be in **lhs** preceded by minus character
(e.g.
-*NP*_{1}:<*case*>=*acc*).
*Optional & Don't Copy:*
The equation is not required for matching,
but we have to make sure not to copy it to the output tree set of
equations, regardless of it being present or not in **inp**.
Those equations must be in **lhs** in raw form, i.e. neither preceded
by a plus nor minus character
(e.g.
*S*_{r}.*b*:<*perfect*>=*VP*.*t*:<*perfect*>).
*Optional & Retain:*
The equation is not required for matching but,
in case it is found in **inp** it must be copied to the output tree.
This is the *default* case, and hence these equations should not be
present in the metarule specification.
*Add:* The equation is not required for matching but we want it to
be put in the output tree anyway.
These equations are placed in raw form in the **rhs** (notice in this
case it is the right hand side).

Typed variables can be used in feature equations in both **lhs** and
**rhs**. They are intended to represent the nodes of the input tree to which
they have been instantiated. For each resulting match
from the structural matching process the following is done:
- The (typed) variables in the equations at
**lhs** and **rhs** are
substituted by the names of the nodes they have been instantiated to.
- The requirements concerning feature equations are checked, according
to the above rules.
- If the match survives feature equation checking, the proper output tree
is generated, according to Section B.2.3 and to the
rules described above for the feature equations.

Finally, a new kind of metavariable, which is not used at the nodes, can be
introduced in the feature equations part. They have the same form of the
non-typed variables, i.e. quotation mark, followed by a number, and are used
in the place of feature values and feature names. Hence, if the equation
?*NP*_{?}.*b*:<?2> = ?3 appears in **lhs**, this means, that all feature
equations of **inp** that match a bottom attribute of some *NP* to any
feature value (but not to a feature path) will not be copied to the output.

** Next:** Examples
** Up:** The definition of a
** Previous:** Output Generation
*XTAG Project*

*1998-09-14*