rewrite rules: analysis: attribute name resolution and value type check