let copy_state s = match s with
  | Single graph -> Single (copy_graph graph)
  | Alternatives gl -> Alternatives (List.map copy_graph gl)