Groundwork laid for term rewrite