let add c =
    let l = S.memo (fun _ -> ref []) c in
    fun s -> l := s :: !l