Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Prolog to create a knowledge base that contains facts and rules about regulations on completion of degrees in a university. A

Write a program in Prolog to create a knowledge base that contains facts and rules about regulations on completion of degrees in a university. A user can then ask queries about the information contained in the knowledge base. Assume that you are building a prototype for testing, and the information for facts and rules is as follows. 1. A student earns a grade in a course. 2. Departments to be included in the knowledge base: Computer Science, Math, and Physics. 3. Courses offered in CS: CS111, CS211, CS311, CS315, CS421, CS436. 4. Courses offered in Math: MATH270, MATH242, MATH372, MATH480. 5. Courses offered in Physics: PHYS201, PHYS301. 6. Students taking courses at the university: Newton, Galileo, Lovelace, Turing. 7. Newton is enrolled in CS311, CS421, and MATH372. Turing is enrolled in MATH480, CS421, and PHYS301. Galileo is enrolled in CS436, and CS421. Lovelace is enrolled in PHYS301, and MATH372. 8. A student satisfies the degree requirements if the student has: - completed the core courses of the department, and - fulfilled the electives requirement. 9. Completed core courses is true if the student has passed each of the core courses in the department with the minimum passing grade of C. 10. Core courses: CS111, CS211, CS311, MATH270, and PHYS201. 11. Elective courses: CS315, CS436, MATH242, MATH372, PHYS301. 12. Fulfilled electives requirement is true if the student has passed three different courses, each course in a different department in the College of Science, e.g., MATH242, MATH372, CS315, CS436, PHYS301. 13. Galileo has taken and passed CS111, CS211, CS311, MATH270, PHYS201, MATH242, CS436. 14. Turing has taken and passed CS111, CS211, CS311, MATH270, PHYS201, PHYS301, MATH372. 1 15. For the rest of the students assume that they have taken and passed CS111 and CS211. Your program must be able to answer these queries in Prolog. Which students have satisfied the requirements and What are the elective requirements fulfilled by a student

I already have the facts down, seems like a confussion to get the rules:

%fact %students student(newton). student(galileo). student(lovelace). student(turing).

%fact %courses offered in CS course(cs111, cs). course(cs211, cs). course(cs311, cs). course(cs315, cs). course(cs421, cs). course(cs436, cs).

%fact %courses offered in Math course(math270, math). course(math242, math). course(math372, math). course(math480, math).

%fact %courses offered in Physics course(phys201, physics). course(phys301, physics).

%fact %enrollement of student newton enrolled(newton, cs311). enrolled(newton, cs421). enrolled(newton, math372).

%fact %enrollement of student Turing enrolled(turing, math480). enrolled(galileo, cs421). enrolled(galileo, phys301).

%fact %enrollement of student galileo enrolled(galileo, cs436). enrolled(galileo, cs421).

%fact %enrollement of student lovelace enrolled(lovelace, phys301). enrolled(lovelace, math372).

%fact %core courses core(cs111). core(cs211). core(cs311). core(math270). core(phys201).

%fact %elective courses elective(cs315). elective(cs436). elective(math372). elective(phys301).

%fact %courses passed by the student galileo passed(galileo, cs111). passed(galileo, cs211). passed(galileo, cs311). passed(galileo, cs436). passed(galileo, math270). passed(galileo, math242). passed(galileo, phys201).

%fact %courses passed by the student turing passed(turing, cs111). passed(turing, cs211). passed(turing, cs311). passed(turing, math270). passed(turing, math372). passed(turing, phys201). passed(turing, phys301).

%fact %courses passed by student newton passed(newton, cs111). passed(newton, cs211).

%fact %courses passed by student lovelace passed(lovelace, cs111). passed(lovelace, cs211).

%fact %fulfilled electives requirement fullfilledelectives(galileo, cs). fullfilledelectives(galileo, math). fullfilledelectives(galileo, phys). fullfilledelectives(turing, cs). fullfilledelectives(turing, math). fullfilledelectives(turing, phys). fullfilledelectives(newton, cs). fullfilledelectives(lovelce, cs).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago