Logical Foundations of Artificial Intelligence