Search and First Order Logic Problems using Prolog