The Meaning of Datalog Rules
Repeat the following until you cannot derive any new facts:
Consider every assignment from the variables in the body
to the constants in the database.
If each of the atoms in the body is made true by the assignment,
add the tuple for the head into the relation of the head.
Start with the facts in the EDB and iteratively derive facts for IDBs.