Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2718156
timetable-tests.lp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 15, 11:31 AM
Size
1 KB
Mime Type
text/plain
Expires
Tue, Feb 17, 11:31 AM (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
232212
Attached To
rXR Xreate
timetable-tests.lp
View Options
man(brian; joe; chris; bob).
professor(brian; joe).
phd(chris).
asisstant(bob).
lesson(1..10).
day(1..5).
week(even; odd).
course(a;b;c;d;e;f;j;h;k;l;m;n).
time(a, 10).
time(b, 12).
time(c, 20).
time(d, 3).
time(e, 17).
time(f, 15).
time(j, 9).
time(h, 7).
time(k, 11).
time(l, 14).
time(m, 8).
time(n, 17).
room(402; 403; 404).
course_room(a, 402).
course_room(c, 404).
course_room(d, 403).
course_room(d, 404).
% ---- timetable(Teacher, Course, Lesson, Room, Day, Week)
timetable(brian, a, 1, 402, 1, even).
timetable(brian, a, 3, 402, 1, even).
timetable(brian, a, 4, 402, 1, even).
owl(joe) % no first lesson
:- owl(T); timetable(T, _, 1,_, _, _).
earlybird(bob).
earlybird_score(T, Score) :- Score = #count {timetable(T, C, 1, R, D, W): course(C), room(R), day(D), week(W)}; earlybird(T) .
earlybird_score(Score) :- Score = #sum{Score2, 1: earlybird_score(T, Score2)}.
:- earlybird_score(X); X<2.
courseDuration(C, Span) :- Span = #count{(T, C, L, R, D, W):timetable(T, C, L, R, D, W), man(T), room(R), day(D), week(W), lesson(L)};course(C).
#show courseDuration/2.
Event Timeline
Log In to Comment