Pergunta

In a tree structure, is there a standard term (in software engineering industry practice, Computer Science or Mathematics), for the predicate f(x, y) defined in human language as "x is an ancestor of or identical to y"?

Example:

Given the tree:

    A
   / \
  B   E
 / \
C   D

Then f(x, C) is satisfied by x in {A, B, C} but not D or E.

The best term I can find is "ancestor or self", but I am doubtful that is a standard term because I can find so few references to it.

Foi útil?

Solução

The usual mathematical diction is just to use "ancestor". If the nonequality condition is actually important, you can say "proper ancestor", but often it isn't.

Outras dicas

It is difficult to give an answer that does not involve personal taste or personal experience. But we can resort to authorities:

In XPath, the language for navigating in XML document trees, the concept is named "ancestor-or-self". This indicates to me that no "better" name for the concept has been around (in the context of computing). After all, XPath was specified by the W3C consortium - which also set the standard for HTML, CSS and so on.

Be aware that in computer science the term ancestor is strongly associated with inheritance relationships in the context of object orientation. We do speak of inheritance trees but only in an OO-context.

For tree structures like folders with files in it or more abstract linked entities we speak of parents, childs and siblings.

The difference is that in the first case there is a clear passing on of traits where in the latter case it is just an indication of a path, of the way nodes are connected.

You may want to take into account the semantics of your model before you pick your nomenclature and talk to a software engineer.

Licenciado em: CC-BY-SA com atribuição
scroll top