Type checking arithmetic expressions