Next: , Previous: Lexicon, Up: Compiler


4.7 Lattices

The XDK grammar file compiler uses lattices to model the notions of default values and conjunction. Each type corresponds to a lattice having a top value, a bottom value, a greatest lower bound operation, and a least upper bound operation. The XDK grammar file compiler only utilizes the top value, bottom value, and the greatest lower bound operation; it does not use the least upper bound operation. I.e., lattices are only traversed downwards, not upwards.

4.7.1 Top values

The XDK grammar file compiler sets values which are not provided in a lexical class or lexical to the top value of the type. As we give a complete list of types and their corresponding lattices in Types reference, for the present purposes, it suffices to say that:

Currently, top values serve two purposes:

  1. they provide default values for omitted values
  2. they are used to make the output of the pretty output functor more readable (values with top values are abbreviated to top)

In the UL, the top value can be obtained by 1) writing top, 2) omitting the value.

4.7.1.1 Example (top values)

We come back to the example lexical entry for “der” in Lexicon above, repeated below:

     defentry {
       dim id {in: {det}
               out: {}
               agrs: ($ fem & (dat|gen) & sg & def)
               agree: {}
               govern: {det: $ ()
                        subj: $ ()
                        obj: $ ()
                        vbse: $ ()
                        vprt: $ ()
                        vinf: $ ()
                        prt: $ ()}}
       dim lp {in: {df}
               out: {}
               on: {d}}
       dim idlp {blocks: {}
                 end: {d: {}
                       df: {}
                       n: {}
                       mf: {}
                       vcf: {}
                       p: {}
                       pf: {}
                       v: {}
                       vxf: {}
       dim lex {word: "der"}}

First, we replace all values which are identical to the default values by top:

     defentry {
       dim id {in: {det}
               out: top
               agrs: ($ fem & (dat|gen) & sg & def)
               agree: top
               govern: top}
       dim lp {in: {df}
               out: top
               on: {d}}
       dim idlp {blocks: top
                 end: top}
       dim lex {word: "der"}}

Next, we remove all these features. What we end up with is a much more succinct lexical entry:

     defentry {
       dim id {in: {det}
               agrs: ($ fem & (dat|gen) & sg & def)
       dim lp {in: {df}
               on: {d}
       dim lex {word: "der"}}

4.7.2 Bottom values

All types have bottom values. As we give a complete list of types and their corresponding lattices in Types reference, it suffices to say here that the bottom value of an accumulative set is the full set (containing all elements of the domain of the set).

Currently, bottom values serve two purposes:

  1. for accumulative sets, they can be used as an abbreviation replacing an explicit specification of the full set
  2. they are used to make the output of the pretty output functor more readable (values with bottom values are abbreviated to bot)

In the UL, the bottom value can be obtained by writing bot.

4.7.2.1 Example (bottom values)

As an example, consider the following definition of the class fin:

     defclass "fin" Word Agrs {
       dim id {in: {}
               out: {subj}
               agrs: Agrs
               agree: {subj}
               govern: {subj: $ nom}}
       dim lp {in: {}
               out: {mf* vxf?}
               on: {v}}
       dim idlp {blocks: {det subj obj vbse vprt vinf prt}}
       dim lex {word: Word}}

The value of blocks on the idlp dimension includes all elements of the domain of the set ({det subj obj vbse vprt vinf prt}). The type of blocks is accumulative set; i.e. its bottom value is the full set. Thus, we can replace the value of blocks by its bottom value to obtain a more succinct lexical class:

     defclass "fin" Word Agrs {
       dim id {in: {}
               out: {subj}
               agrs: Agrs
               agree: {subj}
               govern: {subj: $ nom}}
       dim lp {in: {}
               out: {mf* vxf?}
               on: {v}}
       dim idlp {blocks: bot}
       dim lex {word: Word}}

4.7.3 Greatest lower bound operation

As we give a complete list of types and their corresponding lattices in Types reference, for the present purposes, it suffices to say here that

The greatest lower bound operation has only the purpose of specializing values. It can be thought of as what is called lexical inheritance in other grammar formalisms.

In the following, we will call the greatest lower bound operation conjunction

4.7.3.1 Example (greatest lower bound operation; accumulative sets)

Here is a second example. First, we define the two lexical classes block_subj and block_obj:

     defclass "blocks_subj" {
       dim idlp {blocks: {subj}}}
     
     defclass "blocks_obj" {
       dim idlp {blocks: {obj}}}

Next, we use the greatest lower bound operation (conjunction) to combine the two lexical classes:

     defclass "blocks_subj_obj" {
       "blocks_subj" &
       "blocks_obj"}

The type of the blocks feature on the idlp dimension is accumulative set. Hence in the resulting lexical class, the blocks value on the lp dimension is the union of the blocks value of the class blocks_subj ({subj}) and the blocks value of the class blocks_obj ({obj}), i.e. {subj obj}.

If the type of the feature would be intersective set, we would have used intersection instead of union.

4.7.3.2 Example (combining conjunction and disjunction)

Conjunction and disjunction can be combined. Here is an example. First, we define five lexical classes:

     defclass "class_1" { ... }
     
     defclass "class_2" { ... }
     
     defclass "class_3" { ... }
     
     defclass "class_4" { ... }
     
     defclass "class_5" { ... }

Next, we combine the classes using both conjunction and disjunction in a defentry expression:

     defentry {
       ("class_1" |
        "class_2" |
        "class_3") &
       ("class_4" |
        "class_5")}

The expression defines six lexical entries which we could write less succinctly without disjunction as:

     defentry {
       "class_1" &
       "class_4"}
     
     defentry {
       "class_1" &
       "class_5"}
     
     defentry {
       "class_2" &
       "class_4"}
     
     defentry {
       "class_2" &
       "class_5"}
     
     defentry {
       "class_3" &
       "class_4"}
     
     defentry {
       "class_3" &
       "class_5"}