Question: PLEASE SOLVE IT COMPLETELY. SO I CAN SUBMIT MY HOMEEWORK. Course: Artificial Intelligence Write a Prolog program which defines clauses of the following predicates to
PLEASE SOLVE IT COMPLETELY. SO I CAN SUBMIT MY HOMEEWORK.
Course: Artificial Intelligence
Write a Prolog program which defines clauses of the following predicates to define the timetable:




Consider the following simplified timetabling problem: In each semester, the university offers certain courses to the students. Each course is taught by a teacher and has two lectures in a week. There are 5 weekdays from Monday to Friday and 6 time slots per day. Each lecture is held in a classroom, and there are 10 classrooms available for this purpose. Write a Prolog program which defines clauses of the following predicates to define the timetable: day predicate clauses: day(mon) day(tue). day(wed) day(thu). day(fri). slot predicate clauses: slot(sl). slot(s2). slot(s3). slot(s4) slot(s5). slot(s6). room predicate clauses: room(rl). room(12) room(13) room(14) room(r5). room(r6). room(r7). room(r8). room(19) room(r10). course predicate clauses: course itp). courseloop) course(ds). course(db). coursese). course(os). course(cen). course(sre). course(hci). coursesa) course(fmse). course(sed). coursesqe). course(ai). course(spm). teacher predicate clauses: teacher(aamer). teacher(afrah). teacher(anam). teacher anwar). teacher(awais). teacher(azhar). teacher(bilal). teacher(bushra). teacher(hammad). teacher(ibrar). teacher(mudassar). teacher(nadeem). teacher(qamar). teacher(rabia). teacher(samir). teacher(shahid). teacher(shahzad). lecture predicate clauses: lecture(aamer, ai, rl, tue, s2). lecture(aamer, ai, r2, wed, s4). (add more clauses to test your program) Define rules to check the following types of clashes: a) A teacher has two classes at the same time on the same day. b) Two lectures are in the same classroom at the same time and on the same day. c) Two lectures of the same course are on the same day. d) A teacher has more than two classes on the same day. e) A course has only one lecture in a week. f) A course has more than two lectures in a week
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
