3

I was reading my notes, and I came across this:

Another example would be to find the names of the lecturers teaching all modules. We might reach for the following incorrect expression:

{<N> | ∃M ∀C ∀MN ∀Cr (lecturer(M, N) ∧ module(C, MN, Cr) ∧ teach(M, C))}

Instead, the following is more accurate:

{<N> | ∃M ∀C ∀MN ∀Cr (lecturer(M, N) ∧ (module(C, MN, Cr) → teach(M, C)))}

The first one states that as long as there exists a lecturer who has taught a module that exists in the database, the name will be returned (which is not what we want). Or at least that is how I interpreted this.

Is there any reason why the first expression is incorrect and (more importantly) the second one is correct?

CR241
  • 1,565
  • 3
  • 18
  • 32
fer
  • 91
  • 1
  • 5

0 Answers0