Web : Discrete Addict: Oktober 2009 - URL : http://discreteaddict.blogspot.com/2009/10/
www.kang-musa.co.cc
.

How to Make All Possible Combinations of 2 Sets with Prolog


On this first post, we will give a tutorial using the Prolog (Programming Logic) Language. The title of this post is "How to Make All Possible Combination of 2 Sets with Prolog". From the title we can get general description of this first tutorial. Okay, let's start!

But, before that, we need some preparation,
1. First, you need a computer that has text-editor program like notepad, wordpad, ms word etc.
2. Then, you also need prolog language compiler (in this tutorial we use swi-prolog).
3. And the last one, you need some spirit. So that we can finish this. Hehehehehe. Let's Begin!

To Make All Possible Combination of 2 Sets with Prolog, that must be done is:

First, type the elements of 2 sets in notepad like this!


Student and course is the name of 2 sets. Musa, Kukuh, Nanda is the elements of student set. Discrete and alpro is the elements of the course set. Then, save the file with prolog extension (*.pl) to the harddrive.

Second, open swi-prolog (you must install this software first to your computer). Then click file, and select consult menu.



Find the last prolog file (*.pl extension) that edited in notepad then press ok.

Third, type "student(X), course(Y)." without quotes. But, before that you must know that now we are in prolog compiler (swi-prolog) work layer. Okay, back to the topic, if you typed, press enter. After that you'll see like this,



The image show all combination of 2 sets (student and course). You also can type "course(X), student(Y)." to see other combination like this,



How about we type "student(X), course(Y)."? It means gives all elements which are both a student and a course (there are no such elements in the database). So, the result of the program is "No". You can see here,



Okay, maybe just it tutorial for this time. We'll continued to another time with the next tutorial and still with prolog. Hopefully this first post is helpfully.

http://discreteaddict.blogspot.com/2009/10/how-to-make-all-possible-combinations.html

About Us

This blog development team consists of 3 persons, namely Musa Abdul Hamid, Benediktus Kukuh Ganang Indarto and Nanda Fitrianto Nugraha which is student majoring in Information System, Sepuluh Nopember Institute of Technology. To find out more info, we present their data.


Name : Musa Abdul Hamid
NRP : 5209100013
Address: Kompleks Pesma Thaybah, Sukolilo Park Regency, Keputih Tegal Timur, Surabaya
Email : canna_muse@yahoo.co.id





Name : Benediktus Kukuh Ganang Indarto
NRP : 5209100028
Address: Pondok Sidokare Indah C-8 Sidoarjo
Email : ben_kuku1415@yahoo.com





Name : Nanda Fitrianto Nugraha
NRP : 5209100030
Address: Hidrodinamika 3, Blok T-59, Perumdos ITS
Email : nfitrianto19@yahoo.com




Okay, that's all. If you have a criticism and suggestions about this blog, you can send an email to one of the development team or to discrete.addict@gmail.com. We would be very grateful to you. Thanks!

http://discreteaddict.blogspot.com/2009/10/about-us.html

Welcome to This Blog!

This blog purpose is to keep updating about our discrete mathematic final project about prolog. The author of this blog is Musa Abdul Hamid, Benediktus Kukuh Ganang Indarto and Nanda Fitrianto which is the Sepuluh Nopember Institute of Technology students. We are students majoring in information systems.

Okay, end of the word, thank you very much to Mr. Ahmad Mukhlason that teaching Discrete Mathematics. And to each visitor of this blog, please provide feedback to us if the final project in progress in this blog there is a lack or even a mistake. We will be very happy if you submit it to us to discrete.addict@gmail.com. Let's have some fun!

http://discreteaddict.blogspot.com/2009/10/welcome-to-this-blog.html
 

Home - About Us - Profile - Tutorial - Literature - Relation