randy macaspac
randy macaspac

Reputation: 21

What does the /2 /3 mean in prolog?

What do those /2 /3 that I see in example code do?

Like this one:

4 ?- trace([equals,contains]).

% equals/2: [call, redo, exit, fail]

% contains/2: [call, redo, exit, fail]

Upvotes: 2

Views: 2709

Answers (1)

Daimrod
Daimrod

Reputation: 5020

Learn Prolog Now! is a nice tutorial.

In Prolog, lines starting with a '%' are comments.

equals/2 describes a functor named equals with the arity of two, which means that it expects two arguments.

Upvotes: 4

Related Questions