Foundations of Artificial Intelligence