2
votes

I'm tinkering with Prolog and ran into the following problem. Assume I want to create a little knowledge base about the courses of an university. I need the following two relation schemes:

relation scheme for lecturer: lecturer(Name,Surname)
relation scheme for course:   course(Topic,Lecturer,Date,Location).

I have a lecturer, John Doe:

lecturer(doe,john).

John Doe teaches the complexity class:

course(complexity,lecturer(doe,john),monday,roomA).

Now I have a redundancy in the information - not good!
Is there any way to achieve something like this:

l1 = lecturer(doe,john).

course(complexity,l1,monday,roomA).

Many thanks in advance!

1

1 Answers

3
votes

The same normalization possibilities as in data bases apply:

id_firstname_surname(1, john, doe).

and:

course_day_room_lecturer(complexity, monday 'A', 1).

That is, we have introduced a unique ID for each lecturer, and use that to refer to the person.