Feature

What is a feature?

A feature is an attribute of an object. Thus it is a typed value which an object stores as part of itself.

The object type of an object determines which features an object has.

You said the value was typed?

Yes. The type can be any of the following:

  • STRING (8-bit string)
  • ASCII (7-bit string)
  • INTEGER (32-bit value)
  • ID_D (pointer to another object)
  • an enumeration (set of named constants)
  • LIST OF INTEGER
  • LIST OF ID_D
  • LIST OF enumeration name
  • Set of monads

If it is a STRING, then the feature can hold arbitrarily long (even megabytes long) 8-bit strings.

If it is ASCII, then the feature can hold arbitrary long (even megabytes long) 7-bit strings. The bottom line difference between a STRING and an ASCII string is that ASCII strings are stored much more space-efficiently (i.e., raw, instead of encoded).

If it is an INTEGER, then the feature can hold signed 32-bit values.

If it is an ID_D, then the feature can hold pointers to other objects. That is, each ID_D feature value points to another object. The value can be "NIL", in which case it doesn't point to any object.

If it is an enumeration, then the feature can hold enumeration constants from that enumeration.

If it is a LIST OF something, then the feature can hold a list of values of the given "something" type.

If it is a Set of monads, then the feature can hole arbitrary set-values of sets of monads. For example, the monad-set { 1,2,3,8,9,10 } would be a valid monad-set. Similarly, the monad sets { 37 } and { 47,48,49 } would be valid monad sets. When constructing monads sets in MQL, you don't need to specify each monad in a range of monads. You could have specified the first and last of the preceding three monad sets as { 1-3, 8-10 } and { 47-49 } respectively.

I've heard rumours of "monads" being a feature?

Yes. The "priviliged" set of monads (of which the object consists) is actually a feature called "monads". (This is new as of Emdros version 3.3.1.)

Since "Set of monads" is a valid feature-type, however, you can have other features which have "Set of monads" as their type. Hence, you could (for example) have a feature called "monads_of_my_parallel_object", in a database of parallel sentences, for example.

I've heard rumours of "self" being a feature?

Yes. Every object always has at least one feature, namely "self". Its type is ID_D, and it gives the id_d of the object in question.

This means that, in topographic queries, you can use "self" to compare with ID_D features on other objects, using object references. For example:

SELECT ALL OBJECTS
WHERE
[Clause AS c1
  [Phrase
    // parent is here an id_d feature which 
    // points to the parent in the syntax tree.
    parent = c1.self  
  ]
]

What's the minimum an object can be/have?

  • The minimum an object can be is a non-empty set of monads.

  • The minimum an object can have is a unique id_d, given by its feature "self". It can also have other features, but then it is no longer minimal.

  • The minimum an object can belong to is one object type. But that is also the maximum it can belong to: Every object belongs to exactly one object type. (There is no inheritance mechanism in EMdF, so there is no concept of "super object type" or "parent object type".)

So an id_d is a "person's name", the monads are "his/her body", what's a feature, then?

The analogy was first introduced on this page. You might say that a feature is an attribute of the person, like height, weight, eye-color, shoe-size, preferred pet-animal, social security number, etc.


Previous:Object type
Up:EMdF model
Next:Enumeration