Skip to main content
ubuntuask.com

Back to all posts

What Does the /2 /3 Mean In Prolog?

Published on
3 min read
What Does the /2 /3 Mean In Prolog? image

Best Prolog Operator Guides to Buy in October 2025

1 Learn Prolog Now! (Texts in Computing, Vol. 7)

Learn Prolog Now! (Texts in Computing, Vol. 7)

  • AFFORDABLE OPTION FOR BUDGET-CONSCIOUS READERS.
  • QUALITY ASSURANCE ENSURES RELIABLE READING EXPERIENCE.
  • ECO-FRIENDLY CHOICE PROMOTES SUSTAINABLE HABITS.
BUY & SAVE
$22.21 $31.00
Save 28%
Learn Prolog Now! (Texts in Computing, Vol. 7)
2 PROLOG: Obstetrics, Ninth Edition (Assessment & Critique)

PROLOG: Obstetrics, Ninth Edition (Assessment & Critique)

BUY & SAVE
$200.00
PROLOG: Obstetrics, Ninth Edition (Assessment & Critique)
3 PROLOG: Patient Management in the Office, Eighth Edition

PROLOG: Patient Management in the Office, Eighth Edition

BUY & SAVE
$190.00
PROLOG: Patient Management in the Office, Eighth Edition
4 Programming in Prolog: Using The Iso Standard

Programming in Prolog: Using The Iso Standard

  • QUALITY ASSURANCE: AFFORDABLE, QUALITY READS WITH MINIMAL WEAR.
  • ECO-FRIENDLY CHOICE: SUPPORT SUSTAINABILITY BY BUYING USED BOOKS.
  • BUDGET-FRIENDLY: ACCESS GREAT TITLES AT A FRACTION OF RETAIL PRICE!
BUY & SAVE
$71.24 $74.99
Save 5%
Programming in Prolog: Using The Iso Standard
5 Clause and Effect: Prolog Programming for the Working Programmer

Clause and Effect: Prolog Programming for the Working Programmer

  • QUALITY ASSURANCE: EVERY BOOK IS INSPECTED FOR GOOD CONDITION.
  • AFFORDABLE PRICES: ENJOY SAVINGS COMPARED TO NEW BOOKS!
  • ECO-FRIENDLY CHOICE: SUPPORT SUSTAINABILITY BY BUYING USED.
BUY & SAVE
$80.06 $84.99
Save 6%
Clause and Effect: Prolog Programming for the Working Programmer
6 PROLOG: Gynecologic Oncology and Critical Care, Eighth Edition (Assessment & Critique)

PROLOG: Gynecologic Oncology and Critical Care, Eighth Edition (Assessment & Critique)

BUY & SAVE
$170.99 $190.00
Save 10%
PROLOG: Gynecologic Oncology and Critical Care, Eighth Edition (Assessment & Critique)
+
ONE MORE?

In Prolog, the /2 and /3 notation refer to the arity of a predicate. The number following the slash indicates the number of arguments that the predicate takes. For example, a predicate with /2 means it takes two arguments, and a predicate with /3 means it takes three arguments. This notation is used to specify the signature of a predicate and allows the Prolog compiler to differentiate between predicates with the same name but different arities.

What does the /3 signify in Prolog terms?

In Prolog terms, the /3 signifies the arity (or number of arguments) of a predicate. For example, a predicate with /3 would have 3 arguments.

How to define predicates with the /2 in Prolog programming.

In Prolog, predicates can be defined using the "/" operator followed by the number of arguments the predicate takes. For example, a predicate with 2 arguments would be defined as follows:

predicate_name(Arg1, Arg2).

This predicate can now be used with two arguments in queries. For example:

?- predicate_name(value1, value2).

This will query the predicate with the values value1 and value2 as arguments.

How to use the /2 in Prolog predicates.

In Prolog, the /2 operator is used to define binary predicates, meaning predicates that take two arguments.

For example, a simple binary predicate in Prolog might look like this:

parent(john, mary).

This predicate parent/2 states that john is a parent of mary.

To use the /2 operator in Prolog, you can define predicates in a similar way. Here is an example of a predicate that checks if one number is greater than the other:

greater_than(X, Y) :- X > Y.

In this example, greater_than/2 is a predicate that takes two arguments X and Y, and checks if X is greater than Y.

You can call the greater_than/2 predicate in Prolog like this:

?- greater_than(5, 3).

This will return true, indicating that 5 is greater than 3.

In summary, the /2 operator in Prolog is used to define binary predicates that take two arguments.

How does the /2 impact Prolog's deduction mechanism?

In Prolog, the "/2" operator is used to denote the division operation. It does not directly impact Prolog's deduction mechanism, which is based on unification and resolution of rules and queries. The division operation is simply a mathematical function that can be used within Prolog programs to perform arithmetic calculations. It does not alter the fundamental logic-based deduction mechanism of Prolog.