Automatic theorem proving: A logical basis