UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge Notes for Ch.3 of Poole et al. CSCE 580 Marco Valtorta
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Case Study: University Rules This is an example of representing regulatory knowledge. –(Another great example: Sergot, M.J. et al., “The British Nationality Act as a Logic Program.” CACM, 29, 5 (may 1986), ) DB of relations about the university (univ.pl) Rules about satisfying degree requirements (univ.pl) Lists are used (lists.pl)
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Some facts grade(St, Course, Mark) dept(Dept,Fac) – We would say College, not Faculty course(Course, Dept, Level) core_courses(Dept,CC, MinPass) –CC is a list
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering A Rule satisfied_degree_requirements(St,Dept) <- covers_core_courses(St,Dept) & dept(Dept, Fac) & satisfies_faculty_req(St, Fac) & fulfilled_electives(St, Dept) & enough_units(St, Dept).
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering More Rules Covers_core_courses(St, Dept) <- core_courses(dept, CC, MinPass) & passed_each(CC, St, MinPass)
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering More Rules passed(St, C, MinPass) <- grade(St, C, Gr) & Gr >= MinPass. A recursive rule that traverses a list. passed_each([], S, M). passed_each([C|R], St, MinPass) <- passed(St, C, MinPass) & passed_each(R, St, MinPass).
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering More Rules passed_one(CL, St, MinPass) <- member(C, CL) & passed(St, C, MinPass).