Implement a Prolog-style proof procedure