Arbitrary Lisp expressions may be called from rules. See Forward Chaining Syntax.
KnowledgeWorks and Prolog User Guide (Macintosh version) - 26 Feb 2015