A Prolog-like Paradigm for Reasoning in First-Order Theories