;MSACS graduation program checklist program ; July 11, 2004 ;gradchk1.clp (deffacts initial-facts "These are defaults needed prior to execution" (minimum-hours-to-graduate 36) (maximum-C-hours 8) (phase atstart) ) (defrule example-rule "This is the core set of graduation requirements" (student-hours ?stuhours) (student-C-hours ?stuChours) (minimum-hours-to-graduate ?min-hours) (maximum-C-hours ?maxChours) (test (>= ?stuhours ?min-hours)) (test (<= ?stuChours ?maxChours)) => (assert (OK to graduate)) (fprintout t crlf crlf " >> OK to graduate!" crlf crlf) ) (defrule askfordata (phase atstart) => (fprintout t "Enter the number of hours that " crlf) (fprintout t "will be completed by the semester of graduation:") (assert (student-hours = (read))) (fprintout t "Enter the number of hours completed " crlf) (fprintout t "with a grade of C or worse:") (assert (student-C-hours = (read))) )