Logical foundations of artificial intelligence