Course rules

Description

Course rules

Source: The Art of Prolog

Download

Program source code: course_rules.pl

Listing

	lecturer(Lecturer,Course) :-
		course(Course,Time,Lecturer,Location).
 
	duration(Course,Length) :-
		course(Course,time(Day,Start,Finish),Lecturer,Location),
		plus(Start,Length,Finish).
 
	teaches(Lecturer,Day) :-
		course(Course,time(Day,Start,Finish),Lecturer,Location).
 
	occupied(Room,Day,Time) :-
		course(Course,time(Day,Start,Finish),Lecturer,Location),
		Start =< Time, Time =< Finish.
 
%	Program 2.4: Course rules

Comments

pl/prolog/pllib/course_rules.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0