Learning Robust Rule Representations for Abstract Reasoning via Internal Inferences