4.12 Records

Records are the central data structure in Oz. Records are equally important in computational linguistics, where they are called feature trees. For instance, one might wish to represent the English word girl and its features as the following record:

word(cat:noun phon:[girl] subcat:determiner)  

The main operation on records is feature selection which allows to access a field belonging to some feature. Feature selection is denoted by a dot. For instance:

{Inspect word(cat:noun phon:[girl] subcat:determiner).phon}
{Inspect word(cat:noun phon:[girl] subcat:determiner).phon.1}

Note that feature selection is a very efficient operation in Oz which can be done in constant time. A record is implemented as a hash table whose keys are the features of the record.

The base environment of Oz is provided by a set of records that are also called modules. Global variables denoting modules Number, Record, List, FD, and many more. For instance if you want to see the functionality provided for finite domains or records in Oz then simply browse the modules FD and Record.

{Inspect FD}
{Inspect Record}  

This also explains the syntax of FD.distribute in our introductory example: a procedure for distribution is selected from the record FD.

For further information on records, we refer to `The Oz Base Environment'.


Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)