First, we create predicates consist of two sets called “books” and “sports” with notepad. Members of The Set of books are "math" and "art". Members of the set of sports are "swim" and "run".
Creating of sets shown below:
Save file as "set.pl". Don't forget the file's extention is "pl" and file's type is "all files".
Then go to PROLOG program, choose at menus: File>Consult,
Choose file named "set.pl"
Make sure that it is succesfully compiled like this:
Let's check in PROLOG our sets:
a. type: books(X). then press return,
b. type ; then return,
c. type: sports(X). then return,
d. type ; then return.
The results is like this:
The end, type books(X),sports(Y). . The mean is that elements of books combine with elements of sports.
The results shown below:
Hope useful for you :).

Tidak ada komentar:
Posting Komentar