Prove gram_rule_vars_in_keys.