Foundation of Artificial Intelligence