declare takes/3.When a student drops a course, the program decrements the enrollment total and when a professor is relieved from teaching a course, the professor's course load is decremented.
declare enrolled/2 key 1.
declare load/2 key 1.
drop(Stud,Crs,Sec) <- destroy(takes(Stud,Crs,Sec) sc decr_enrolled(Crs).
relieve(Prof,Crs,Sec) <- destroy(instructs(Prf,Crs,Sec)) sc decr_load(Prof).
decr_encrolled(Crs) <- enrolled(Crs,N) sc N1 is N-1 sc set(enrolled(Crs,N1)).
decr_load(Prof) <- load(Prof,N) sc N1 is N-1 sc set(load(Prof,N1)).
Back to the main page