+let suffixes = [".ind"; "_rec.con"; "_rect.con"; "_ind.con"; ".con"]
+
+let replacements =
+ let map s = String.length s, s, Str.regexp_string s, "_discharged" ^ s in
+ List.map map suffixes
+
+let replacement (ok, u) (l, s, x, t) =
+ if ok then ok, u else
+ if Str.last_chars u l = s then true, Str.replace_first x t u else ok, u