Fundamentals of AI: from Theory to Practice