avoid re-computation for rewrite AGs
port rewrite AGs to GraphFreeNonEmpty