A compiler for Set operations