let of_string str = try let i = ref 0 in while !i < num_of_theories do if to_string !i = str then raise(Found(!i)); i := !i + 1 done; raise(Invalid_argument str) with Found(i) -> i