3.1.2 Example

Our rule

Recall the rule used for building a type-hierarchy:

Supertype > Subtype1, Subtype2, ..., SubtypeN.

Example

Below is a type-hierarchy in Prolog+CG.

Note how each line conforms to the recipe given above:

Entity > Physical, Abstract.
Physical > Object, Process, Property.
Object > Animate, Inanimate.
Animate > HumanBeing, Animal, Plant.
Property > Juvenile, Adult, Gender.
Gender > Male, Female.
HumanBeing > Man, Woman, Boy, Girl.
Adult > Man, Woman.
Juvenile > Boy, Girl.
Male > Man, Boy.
Female > Woman, Girl.

We now explain this example.

Explanation

The example starts at the top of the lattice with "Entity". This supertype is then declared to have two immediate subtypes:

  • Physical, and
  • Abstract

The "Abstract" node is then never given any subtypes, and so remains a leaf node.

The "Physical" node is given three immediate subtypes:

  • Object,
  • Process,
  • Property.

These are then each given further subtypes, which may be given further subtypes, and so on down the lattice.


PrevLite: 3.1.1 Syntax
NextLite: 3.1.3 Multiple inheritance

Prev: 3.1.1 Syntax
Up: 3.1 Concept types and type-hierarchies in Prolog+CG
Next: 3.1.3 Multiple inheritance