Prolog operator: caching