Logo 
Search:

Artificial Intelligence Articles

Submit Article
Home » Articles » Artificial Intelligence » ProLogRSS Feeds

Program to find easy courses person likes

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

Assuming Following Facts
1. Steve Only Likes Easy Courses.
2. Science Courses Are Hard.
3. All The Courses In The BasketWeaving Department Are Easy.
4. BK301 is a BasketWeaving Course.
Use Resolution To Answer The Question :
"What Course Would Steve Like ?"

Code for Program to find easy courses person likes in Artificial Intelligence

Domains
    subject,name,department=string
Predicates
    easyCourse(subject)
    hardCourse(subject)
    likes(name,subject)
    course(subject,department)
    startup
Clauses
    course("BK301","BasketWeaving").
    course("BK302","BasketWeaving").
    course("BK303","Science").
    course("BK304","Science").
    course("BK305","BasketWeaving").
    
    easyCourse(Subject) :-
        course(Subject,"BasketWeaving").

    hardCourse(Subject) :-
        course(Subject,"Science").
    
    likes(_,Subject) :-
        easyCourse(Subject).            
    
    startup :-
        write("\nWhich Course Would Steve Like ?\n"),
        likes("Steve",Subject),
        write("\n",Subject),
        fail.
    
Goal
    clearwindow,
    makewindow(1,2,3,"Steve Like Courses",0,0,25,80),
    startup.

Output :->

+------------------------------Steve Like Courses------------------------------+
¦                                                                              ¦
¦Which Course Would Steve Like ?                                               ¦
¦                                                                              ¦
¦BK301                                                                         ¦
¦BK302                                                                         ¦
¦BK305                                                                         ¦
¦Press the SPACE bar                                                           ¦
¦                                                                              ¦
+------------------------------------------------------------------------------+

  
Share: 


Didn't find what you were looking for? Find more on Program to find easy courses person likes Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of Program to find easy courses person likes is from India.
 
View All Articles

Related Articles and Code:


 

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!