Logic for Programming Artificial Intelligence and Reasoning