Automated Theorem Proving: A Logical Basis