Logo 
Search:

Artificial Intelligence Articles

Submit Article
Home » Articles » Artificial Intelligence » ProLogRSS Feeds

ProLog Program to find animals leaving in water and land

Posted By: Milind Mishra     Category: Artificial Intelligence     Views: 3246

Program to find animals leaving in water and land.........

Code for ProLog Program to find animals leaving in water and land in Artificial Intelligence

predicates
   type(symbol, symbol)
   is_a(symbol, symbol)
   lives(symbol, symbol)
   can_swim(symbol)

goal
   can_swim(What) ,
   write("A ", What, " can swim.").

clauses
   type(ungulate, animal).
   type(fish, animal).

   is_a(zebra, ungulate).
   is_a(herring, fish).
   is_a(shark, fish).

   lives(zebra, on_land).
   lives(frog, on_land).
   lives(frog, in_water).
   lives(shark, in_water).

   can_swim(Y) :- 
    type(X, animal) ,
    is_a(Y, X) ,
    lives(Y, in_water). 
  
Share: 


Didn't find what you were looking for? Find more on ProLog Program to find animals leaving in water and land Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of ProLog Program to find animals leaving in water and land is from India.
 
View All Articles

 

Other Interesting Articles in Artificial Intelligence:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!