Simplifying AST expressions