I'm just answering my own question here on alternatives to Math::Logic::Predicate. It seems that the AI::Prolog set of modules is just what I was looking for. You might need to look at
this bug report to get one of the dependencies (Hash::AsObject) working though (changing the number of tests in t/02* to 11 and commenting out line 25 seems to be sufficient). The docs for AI::Prolog say that there's another (more complete, faster) module that can interface with SWI Prolog, Language::Prolog::Yaswi, but I haven't had any joy in compiling it. I'm sufficiently impressed with AI::Prolog, though, that I'm not going to investigate these compilation problems now.