alt stands for ``alternation''. The syntax for using alt is:
((att1 val1)
(att2 val2)
...
(ALT {annotations*} (fd1 fd2 ... fdn))
...
(attn valn))
|
The meaning of a pair with an alt attribute is the following: the unifier tries to unify the total FD by replacing first the pair alt by the FD fd1, if this unification fails, then the unifier will try the following alternatives. If all branches of the alt fail, the unification fails.
The order in which branches are put within the alt does not change the result of the unification. (This is an important feature of the process of unification: the result is always order-independent.) However, since only the first successful unification is returned, order can be used to specify default values. For example, if you want to specify that a sentence should be at the active voice by default, the following order should be used:
(ALT (((voice active)
...)
((voice passive)
...)))
|
When the order is truly not relevant and there is no reason to choose a default branch, then you can use the ralt keyword instead of alt. ralt has exactly the same syntax as alt and also expresses a disjunction, but the unifier will choose one of the branches at random instead of always trying the first untried branch. (ralt stands for ``random alt'')
Alternatively, the :order annotation can be used to specify whether the branches should be order in random or sequential order. The syntax is as follows:
(alt (:order :sequential) is equivalent to (alt (fd1...fdn))
(fd1 ... fdn))
|
An alt can be embedded within another alt or it can be the value of a feature as in:
((a (alt (1 2 3 4))))
|