Rewriting ADT