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 

S

Index


String

Context

A term in programming.

Definition

A string is a sequence of characters. A character can be defined as the encoding of any single glyph which your computer screen can display.

In Prolog+CG, strings are enclosed in "double quotes".

Examples

For example, the following are all strings (in fact, they are string constants) in Prolog+CG:

  • "This is a string"
  • "SoIsThis"
  • "Bah bah black sheep"
  • "[Peter,Paul,Mary]"
  • "c3p0"

All of these are strings because they are sequences of characters enclosed in double quotes. This is in spite of the fact that, had the double quotes not been there, some of the strings would have been either identifiers, lists, or variables.


String constant

Context

A term in Prolog.

Definition

A string constant is a string enclosed in double quotes.

See the string entry (above) for examples of string constants.


Structure

Context

A term in Prolog.

Definition

A structure conforms to the following syntax:

A structure is:

  1. Either: A functor,
  2. Or:
    1. A functor followed by
    2. an open-parenthesis ('(') followed by
    3. a comma-separated list of arguments followed by
    4. a close-parenthesis (')')

Examples

For example, the following are all structures:

  • student(name(Nick), semester(9))
  • ancestor(A,D)
  • student(course(MA301), prof(Alfred), semester(9), name(Nick))
  • Abraham

The last is a structure because it consists of a functor. Such structures are also called atomic constants (or atoms).


Subgoal

Context

A term in Prolog.

Definition

A subgoal is part of the body of either a rule or a query. It is any kind of term (including variables) that can match with the head of a clause.

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).

The rule

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

has two subgoals, while the rule

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

has only one subgoal.


Subtype

Context

A term in ontology.

Definition

A subtype B of another type A is either:

  • "A" itself (i.e., A is always a subtype of itself), or
  • a type that is lower in the type hierarchy than A, and there is a path of "subtype-links" upwards from B to A.

Example

For example, "Animal" is a subtype of "Animal". In addition, "Mammal" is a subtype of "Animal", and "Elephant" is a subtype of "Mammal" (and of "Animal", since there is a path of links upwards from Elephant to Animal).

This can be illustrated as follows:



"Simple lattice of types"

Absurdity

The one type which is a subtype of everything else is Absurdity.


Supertype

Context

A term in ontology.

Definition

A supertype A of another type B is either:

  • "B" itself (i.e., B is always a supertype of itself), or
  • A type that is higher in the type-hierarchy than B, and there is a path of "subtype-links" downwards from A to B.

Example

For example, "Mammal" is a supertype of "Elephant", and "Animal is a supertype of "Mammal" (and of "Elephant, since there is a path downwards from Animal to Elephant).

This can be illustrated as follows:



"Simple lattice of types"

Entity

The one type which is a supertype of everything else is Entity.


Syntax

Context

A term in formal language theory.

Definition

The syntax of a language-construct is a specification of the order and names of the elements making up the language-construct.

Examples

For example, the syntax of rules says that a rule is:

  1. A head followed by
  2. An 'entails' symbol (":-") followed by
  3. A body followed by
  4. A period (".").

Then elsewhere, we need to say what a head and a body is. Here, we simply specify the order and names of the constituent elements making up the rule.


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