Deductive Databases: Theory and Applications