AbstractGroundRule now caches function.