next up previous contents
Next: Drawing Type Hierarchies Up: Typed Features: define-feature-type Previous: Type Definition

     
The under Family of Constructs

     

When a type hierarchy is defined, it is possible to check if an input value is more or less ``instantiated'' within the hierarchy. Using the under and sunder constructs, one can check if a value is more (resp strictly more) specific than a symbol within a hierarchy. The syntax is the following:

          

((a #(under <v>))) will unify with ((a w)) only if w is a specialization of v or v itself.

((a #(sunder <v>))) will unify with ((a w)) only if w is a specialization of v but not v itself.

The following notations are equivalent: ((a #(under v))) ((a #(<= v))) ((a #(=< v)))

((a #(sunder v))) ((a #(< v)))

Example:

> (define-feature-type a (aa ab ac)) > (define-feature-type aa (aaa aab))

> (u '((x #(under aa))) '((x a))) ;; a is not a specialization of aa :fail

> (u '((x #(under aa))) '((x nil))) ;; nil is the least specific of all :fail ;; it is not a specialization of aa

> (u '((x #(<= aa))) '((x aab))) ;; Ok, aab is a specialization of aa ((x aab))

> (u '((x #(under z))) '((x z))) ;; Even if z is not in a hierarchy ((x z)) ;; can check for its presence

> (u '((x #(< z))) '((x z))) ;; z is not strictly under z. :fail

NOTE: when under is used with a symbol z which is not part of a type hierarchy, #(under z) unifies with z only. In particular, it will NOT unify with NIL. So the expression ((a #(under z))) is equivalent to the expression ((a given) (a z)). In fact, under is the typed extension of the notion of given. Note that ((a #(under z))) is the equivalent of LFG's notation a =c z.  


next up previous contents
Next: Drawing Type Hierarchies Up: Typed Features: define-feature-type Previous: Type Definition
Michael Elhadad - elhadad@cs.bgu.ac.il