Optimize the performance of closures corresponding to backend Prolog built-in predicates