Logo 
Search:

Artificial Intelligence Articles

Submit Article
Home » Articles » Artificial Intelligence » ProLogRSS Feeds

Predicate logic representation and then converting them to prolog, prove the proof.

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

write predicate logic representation and then
converting them to prolog, prove the proof.

Code for Predicate logic representation and then converting them to prolog, prove the proof. in Artificial Intelligence

predicates

    man(symbol)
    pompeian(symbol)
    roman(symbol)
    ruler(symbol)
    loyalto(symbol,symbol)
    notloyalto(symbol,symbol)
    hate(symbol,symbol)
    person(symbol)
    tryassassinate(symbol,symbol)
    
clauses
    
    person(X):- man(X).
    
    man(marcus).
    
    ruler(caeser).
    
    tryassassinate(marcus,caeser).
    
    notloyalto(X,Y) :-
            person(X),
            ruler(Y),
            tryassassinate(X,Y),
            write("Person - ",X),nl,
            write("Ruler -",Y),nl.
            
    
    hate(X,caeser) :- roman(X).
    loyalto(X,caeser) :- roman(X).
    
    
    pompeian(marcus).
    roman(X) :- pompeian(X).
            
            
goal
    clearwindow,

    notloyalto(Marcus,caeser).
    
  
Share: 



Milind Mishra
Milind Mishra author of Predicate logic representation and then converting them to prolog, prove the proof. is from India.
 
View All Articles

 
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!