-Facts and Rules Exercise-
Part 2
You have learn basic of prolog in the previous posting. Now, we will teach you an extreem prolog. But, don't be afraid! Relax.. (hehe.. ). No, it just kidding. :D This prolog is easy. Because we will explain you a tutorial using picture suppose that easier to learned.
The title is Foodding Engine (In Indonesia, it means 'mesin pencari makanan'). You can input some restaurant names and it's menu list. Then, write down in this prolog. Just follow this tutorial step by step and you will get an extreem prolog by yourself. It looks more interesting, isn't it? ;) Now, follow this steps:
Firstly, make sure that you have prolog program (SWI-Prolog) in your PC or Notebook.
It's very important step. You can't go the next step if you don't have this program.
It's very important step. You can't go the next step if you don't have this program.
Now, we will make twice prolog in one program. (Look at the picture). It means that one prolog using to write down the atribute, like menu list, restaurant names, etc.
List cuisine in each restaurant
show the description to make easier the customer
Look at the picture (above), this notepad shows all of the facts. And other notepad to show how it works (rules) Look at the below this:
Don't forget to add dot(.) after you finish the ruler.
To call the first notepad, you can using -consult(place of .pl)
Finish..!!
Now you have a extreem prolog system..
Well done..!! It's easy right??
Okay,,that's all.. see you next tutorial
Now you have a extreem prolog system..
Well done..!! It's easy right??
Okay,,that's all.. see you next tutorial

0 komentar:
Posting Komentar