next up previous contents
Next: Co-routining Up: Definite Clauses Previous: Definite Clauses   Contents

Type Constraints Revisited

The type constraints mentioned in the last chapter can also incorporate relational constraints defined by definite clauses, with the optional operator goal. Consider the following example from HPSG:

  word cons W
       goal (single_rel_constraint(W),
             clausal_rel_prohibition(W)).
In this example, the constraint from the description language is simply the variable W, which is used to match any feature structure of type word. That feature structure is then passed as an argument to the two procedural attachments single_rel_constraint/1 and clausal_rel_prohibition/1, which each represent a principle from HPSG which governs words (among other objects). Notice that the goal, when non-literal, must occur within parentheses.

While every type constraint must have a description, procedural attachments are optional. If they do occur, they occur after the description. The syntax is given in BNF as:

  <cons_spec> ::= <type> cons <desc>
                | <type> cons <desc>
                         goal <goal>



TRALE User's Manual