let remove_fresh i s = let fi = Fresh i in if S.mem fi s then Some (S.remove fi s) else None