# (hash)

The hash mark is used in tdl syntax to indicate an identity constraint between the values of two features in a type definition (or a type addendum). For example:

foo := bar &
  [ BAZ #coref & quux,
    ZXC #coref ].

This constraint says that the value of ZXC has to be the same as the value of BAZ, and further more that the value of BAZ (and therefore of "ZXC") is quux.

More than two features can be constrained to have the same value:

foo := bar & 
   [ F1 #coref,
     F2 #coref, 
     F3 #coref ].

You can have more than one identity constraint in the same type definition, in which case the strings after # are different, to distinguish the pairs. Here, F1 and F3 have the same value (whatever it is), and F2 and F4 have the same value. However, nothing says that those two values have to be the same.

foo := bar & 
  [ F1 #coref1,
    F2 #coref2,
    F3 #coref1,
    F4 #coref2 ].

The coref strings are only interpreted within a single type definition. In other words, the following does NOT mean that F1 and F2 have the same value.

type1 := parent &
  [ F1 #coref ].

type2 := parent &
  [ F2 #coref ].

In fact, the above would generate a syntax error, since in each type definition, there is a coref string which is used only once.

Related topics

Back to glossary page
Go to FAQs page
Back to main course page