Glossary

Index

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 

I

Index


Identifier

Context

A term in Prolog (and programming in general)

Definition

An identifier is a sequence of letters, underscores, and digits, with the requirement that the first two characters must be letters.

Please note: This definition is valid for Prolog+CG only. Other programming languages may have different definitions of what an identifier is.

Examples

For example, the following are all identifiers:

  • Abraham
  • Nick
  • br
  • This_is_a_long_identifier
  • This_identifier_contains_2_number_2s

Non-examples

The following, however, all fail to be identifiers:

  1. c3po
  2. _red
  3. 3little_fishes

These are not identifiers because they do not start with two letters.


Immediate subtype

Context

A term in ontology.

Definition

An immediate subtype T2 of another type T1 is a subtype which inherits directly from T1.

Example

Consider the following type-hierarchy:

Here, Mammal is an immediate subtype of Animal, because it inherits directly from Animal. There are no types in between.

Similarly, Elephant is an immediate subtype of Mammal, because there are no subtypes in between.

Elephant is not an immediate subtype of Animal, however, because Mammal intervenes.

Related terminology


Individual

Context

A term in ontology.

Definition

The term individual is another name for the term instance of a type.


Inheritance

Context

A term in ontology.

Definition

A type is said to inherit from zero or more supertypes. The type gets all of the properties of the supertypes from which it inherits.

When a type inherits from more than one supertype, we talk about multiple inhertiance.

One type which never inherits from anything is the top-most type, Entity.

Example

Given that we have the following two supertypes:

  • Cat
  • Cuddly

we can form the type

  • CuddlyCat

by multiple inheritance from the two supertypes. That is, the type "CuddlyCat" inherits from both of the types "Cat" and "Cuddly". We can depict this as in the following lattice:

Related terminology


Instance of a type

While a type is a name we give to a group of entities with similar traits, an instance of a type is any entity from the group which the type defines.

In other words, an instance of a type is a specific representatative from the group that the type defines.

For example, if the neighbor's dog is called "Fido", then "Fido" is an instance of the type "dog". Similarly, "42" is an instance of the type "NaturalNumber". In both cases, the instance is a representative of the group to which it belongs.


Invocation of a rule

Context

A term in Prolog.

Definition

A rule is invoked (or called) when a subgoal in a (possibly different) rule consists of some term which matches the head of the rule. When a rule is invoked (or called), we call it an invocation.

Likewise, facts can be invoked if a subgoals' Prolog+CG data matches the head of the fact.

In the same way, we speak of predicates being invoked.

Example

For example, consider the following program:

father(Terah, Abraham).
father(Abraham, Isaac).
father(Isaac, Jacob).
father(Jacob, Judah).

ancestor(A,D) :- father(A,D).
ancestor(A,D) :- father(F,D), ancestor(A,F).

Here, we can speak of the invocation of the father/2 predicate. This predicate is invoked in two places, namely as the first subgoal of each of the two rules making up the ancestor/2 predicate. The ancestor/2 predicate is only invoked in one place.


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z