Professional Documents
Culture Documents
CSC462 Artificial Intelligence Lab2
CSC462 Artificial Intelligence Lab2
CSC462-Artificial Intelligence
Lab Assignment # 2
Problem Statement:
We can think of a Prolog knowledge base as a collection of actual and virtual tables, just like a
database. Prolog queries can emulate SQL queries such as project, select, and join.
instructor(Instructor)
teaches(Instructor, Course)
prerequisite(Course, PreReqCourse)
course Y
from instructor Y
a prerequisite course
Careful, this last one is tricky. You might think this would work:
But this is true if X has taken any prerequisite of course Y. Try using Prolog's meta-predicate:
Page 2 of 2