Foundations of logic programming; (2nd extended ed.)