Linguistics 482 - Computational Linguistics Prolog Notes A. C. Brett
Department of Linguistics
University of Victoria
Clearihue C139
Last updated: 23 October 1999


Atoms are the fundamental word-like entities in the Prolog language. They are analogous to the root or stem morphemes of a natural language in that, although they might appear by themselves, they normally form the basis for the derivation or construction of more complex words. Their normal role in Prolog is as data objects, and they can serve as names.

Atoms are often represented by sequences of one or more lower case letters; but, they can include both upper case letters and numbers as well as underscore characters, "_", and dollar signs, "$". The sequence of characters must begin, however, with a lower case letter.

The particular sequences of characters used to represent atoms are often determined by the domain or application with which one is working. For example, if you are working with a natural language, many of the atoms will correspond to the words of the language such as the following:

Other atoms might be chosen to correspond to category labels, features, and feature values such as the following:
Atoms may also be represented by any sequence of characters as long as they are enclosed in apostrophes (single quote marks) such as the following:
   'Cape St. James'
This device is convenient for representing data objects such as proper nouns that begin with upper case letters or include special characters; but, it is incovenient for identifying atoms that serve as names in a program. Hence, atoms used as category labels are normally represented with the corresponding lower case letter sequences such as
The Prolog interpreter attaches no meaning to the particular sequences employed to represent atoms beyond their serving to identify, and distinguish among individual data elements and names. Thus, except for those circumstances wherein you might be constrained by the data with which you are working, you are free to select any sequences of characters to represent atoms that are meaningful to you, subject of course to the representation rules cited above.

Atoms can take the role data values, such as the words of a natural language, or values of the features that might characterise the words, in a natureal language processing program. Atoms can also be used to construct more complex entities in the Prolog language such as structures.

In addition to the atoms with the representations described above, there are some special atoms that are represented by characters or character sequences such as, for example, "+", "=", "-", "\=", and "@<". Such atoms serve as the names of operators.

Linguistics 482 Prolog Introductory Notes Top of Page