How to list all combination of two sets ??

This tutorial will help you to determine all possible combinations of two sets that have two elements using PROLOG

Read more…

Method :

1. First of all, installing SWI PROLOG is important thing.

2. After it has been installed, run and open it.

3. Creating new file by choose File menu > New

4. Give name for the file of program as “sets.pl”

5. Declaring the facts that consists of predicate and fact as below :

6. Save it

7. Choose File > Consult on your SWI PROLOG

8. Write rule code firstsets(X),secondsets(Y) as below :

9. Press ENTER button on your keyboard, then it will show you a combination of two set.

10. To show others, press semicolon (;) button on your keyboard and you will see 4 combinations of the elements of two sets


Try it carefully, mistakes is something make our can do…

No worries if you found the about mistakes…


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

0 Response to "How to list all combination of two sets ??"

Posting Komentar