Compile the rule application functions