Is the definition of "predicate" correct in the Glossary of Terms?

Difficult stuff. The ISO docs uses predicate, predicate indicator and procedure. I cannot really find the right definitions in the ISO part I document (note that part II has not been implemented by any vendor AFAIK).

I think nobody would disagree that a predicate indicator is name/arity (or name//arity when accepting DCG notation). I never understood the difference between predicate and procedure. ISO says

3.21 built-in predicate: A procedure whose execution is implemented by the processor (see 8).

This (to me) indicate predicate and procedure are synonyms. Before ISO I think the term procedure was rarely used in the context of Prolog.

Does anyone know the history of this terminology?

edit Seems some people here were earlier involved in a StackOverflow discussion on this

It helps a little, notably the quote from “Programming in Prolog (5th ed.)” (Clocksin & Mellish 2003), it is simply said on p. 188"

The collection of clauses for a given predicate is called a procedure .

I’m not terribly happy :frowning: More in general it seems a procedure is claimed to be a reusable piece of code and a predicate is a procedure with a boolean result. That seems to come from mathematical logic, according to Wikipedia. A bit further on this page we find:

Informally, a predicate is a statement that may be true or false depending on the values of its variables.

Now the terminology relation between logic and Prolog is a bit of a mess (think of atom), but the above is really what we are doing and this claims a predicate is a statement. I can live with that :slight_smile:

Maybe this is similar to function, which in many languages also both has a function declaration and a function definition/implementation while we typically simply talk about a function?

I propose to add procedure to the glossary and make some adjustments. Any volunteers?

1 Like