Prolog Rules (Predicates) -


i'm new in prolog swi can me solve this. suppose have database predicates likes (person1, person2) , hobbies (person1, hobby). now, how can design rule such system answers 2 people have same kind of liking or not depending on hobbies.

likes (john, jake).   true  

finally, did

hobby(harry,music). hobby(harry,running). hobby(jocker,swimming). hobby(jocker,movies). hobby(jocker,art). hobby(curl,running). hobby(curl,art). hobby(curl,movies).  same_hobby(p1,p2) :-         dif(p1,p2),         hobby(p1,h),         hobby(p2,h). 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -