Proper terminology for Logic Programming and Prolog. The word "atom"


I am somewhat confused about how to use the word “atom” in a paper we are writing.

(1) In Prolog an atom is said to be a “Textual constant. Used as name for compound terms, to represent constants or text.”. See here. Accordingly these are atoms: john, grandparent, etc.

(2) In texts about logic programming, e.g. Riguzzi (2018) and Baral and Gelfond (1994), “atoms” are said to be terms with the form p(t1, t2, ..., tn), where the ts are terms and p is a predicate symbol. This corresponds to the use of “atom” in classical first order logic.

Am I correct in assuming that (1) is the proper definition for “atom” when talking about Prolog, and that (2) is the proper definition for “atom” when talking about logic programming? I think that a reason for my confusion is that I think of Prolog as an instance of logic programming.


Thanks for the suggestions Jan!

This is cross posted at StackOverflow.

This isn’t intended as a serious answer, just what atom/1 defines as an atom.

atom("Textual constant").

So double quoted text, no. Single quoted text, however:

atom('Textual constant').

The same applies to numbers. Regarding something like p(t1, t2, ..., tn) or any other compound:


As long as something is single quoted or starts with a lower case letter followed by alphanumeric characters or underscores, it’s an atom.

So basically, I just think of Prolog atoms as what other languages call literals. But I’m not an academic.

1 Like