Subscribe:

Just like we said before,
we'll try to figure out the Pratical Exercise 4 Page 68 with the images of captured prolog work.
Nah...this is the time,
please enjoy our journey of learning...

This program is based on Animals Program given in Chapter 3


Convert the seven predicates used to operator form and test your revised program. The output should be the same as the output from the program above. Include directives to define the operators in your program.
To make it more easier to read, then we can change the database. We're gonna convert seven predicates in the database, they are :



How to use xf and xfy :
1. First of all, load the database with consult predicate ?-consult('database2.pl')
2. The is_a_dog predicate



3. The is_a_cat predicate


4. The is_large predicate


5. The is_small predicate


6. The is_large_dog predicate


7. The is_small_animal predicate


8. The chases predicate





You can see that both of the prolog have the same result. Converted predicates are easier to read.
fido chases mary is easier to understand than chases(fido,mary).
Basicly, they are the same, the different between them is just the way of writing.

Hope you are not being confused with this concept.
Okay...see you in the next lesson.
See youuuu...
Keep the spirit of learning...
\(^.^)/


Regards,
Mathlovers

Tidak ada komentar:

Posting Komentar

 
Copyright 2009 mathlovers