Added function: check if a rule is a resursive rule