Prolog Language Data Structures Terms

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

On a very high level, Prolog only has a single data type, called term. In Prolog, all data is represented by Prolog terms. Terms are defined inductively:

  • an atom is a term. Examples of atoms are: x, test and 'quotes and space'.
  • a variable is a term. Variables start with an uppercase letter or underscore _.
  • integers and floating point numbers are terms. Examples: 42 and 42.42.
  • a compound term is a term, defined inductively as follows: If T1, T2, ..., T_n are terms, then F(T1,T2,...,T_n) is also a term, where F is called the functor of the compound term.


Got any Prolog Language Question?