< Prolog

This is (or will be) a glossary of common Prolog terms.

Argument
Definition missing
Arity
The number of arguments that a predicate takes. E.g. member(X,List) has arity 2. In documentation, the arity of a predicate is written as predicate/arity. E.g. member/2.
Backtracking
If a sub-goal fails, the built-in Prolog search mechanism will go back to the parent-goal. Any variables that were instantiated in the sub-goal will be un-instantiated. Prolog will then search for a new way of satisfying the sub-goal. This process is called backtracking.
Clause
A single clause of a relation, usually defined as Head :- Body, but see also Fact.
Fact
A Clause with no body, that is a Head on its own.
Functor
Definition missing
Goal
See query.
Ground Term
A Term which has no logic variables in it.
Predicate
A set of clauses or a relation.
Query
Definition missing
Relation
Synonym for Predicate.
Recursion/Recursive
Definition missing
Rule
See clause.
Term
Every object in Prolog is a term, that includes variables, compounds, numbers, source code.
Unification
Definition missing
Singleton Variable
If a variable is named only once in a clause, usually it is replace with _.
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.