Arbitrary Lisp expressions may be called from rules. See Forward Chaining Syntax.
KnowledgeWorks and Prolog User Guide (Unix version) - 6 Dec 2011