optimizing grounding for distribute rule