Question: Artificial intelligence Knowledge Representation and Reasoning with Prolog.. SWI-Prolog. Please, I want a complete solution to all existing requirements. I do not want a

" Artificial intelligence"
Knowledge Representation and Reasoning with Prolog..
SWI-Prolog.
Please, I want a complete solution to all existing requirements. I do not want a previous solution or a copy. Please focus on reading the question, and a picture of the code.
Q:
" Artificial intelligence" Knowledge Representation and Reasoning with Prolog.. SWI-Prolog. Please, I
Your task is to create a knowledge base describing courses and their prerequisites. The graph below shows the courses and their prerequisites.
As shown in the graph, a solid directed arrow from CS15 to CS16 indicates that CS15 is a prerequisite to CS16. A dotted arrow means that ONE of these courses is a prerequisite of the course. For example, to take CS33, you have to take either CS16 or CS18. Course names are constants, so you have to use lowercase letters (cs22, cs33, etc.) in your code. More facts about the transcript are:
-CS15, CS17, CS33, CS141 and CS126 are only offered in the fall.
-CS16, CS18, CS22, CS32, CS166 are only offered in the spring.
You also have a set of rules as follows:
1-A course is introductory if it's offered in the fall and has no prerequisites, or if it's offered in the spring and its prerequisite that has no prerequisites.
2- A course is intermediate if it is not introductory, but its prerequisites are all introductory courses.
3- A course is upper level if its prerequisites are not introductory courses, or if its prerequisites are CS22 and introductions.
4- Course may only be of one level; i.e., introductory courses may not also be intermediate courses, etc.
You can now add a set of facts that students have taken some courses using the has taken predicate (i.e., has_taken (sarah, cs15)). Then, you need to add one more rule to test the eligibility of a student to take a course:
- can_take (Student, Course), true when Student is eligible to take Course (i.e., they have taken the necessary prerequisites).
Now that you have implemented the knowledge base (facts and rules), you can test your implementation by querying the knowledge base:
1- Add a fact that a student (e.g., sarah) has only taken one intermediate course and the prerequisites for this intermediate course. Then test whether sarah can take any other courses from the curriculum.
2- The only course that manal can take is cs32 (thus insert the required facts to make the answer to this query true).
3-Retrieve the introduction, intermediate and upper-level courses in the curriculum.
I want a picture of the code and the results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!