Much more work on Prolog generation.