rewrite rules: analysis: tests for typing