Foundations of AI