0 votes
in Prolog by
Explain With An Example What Is “setof” Predicate In Prolog?

1 Answer

0 votes
by

In Prolog, “Setof” predicate can be used to find out all the solutions of a predicate. For example, you have this database:

Wisdom (SAP, Testing Tools)

Wisdom (PHP, Perl)

And if you want to find the solutions of Wisdom(X, Y). We can enter

Setof ([ X,Y] ,Wisdom (X,Y), Z).

Z = [[ SAP , Testing Tools], [ PHP, Perl] ]

...