+
+(* FG: **********************************************************************)
+
+let get_name context index =
+ try match List.nth context (pred index) with
+ | Some (Cic.Name name, _) -> Some name
+ | _ -> None
+ with Invalid_argument "List.nth" -> None
+
+let get_rel context name =
+ let rec aux i = function
+ | [] -> None
+ | Some (Cic.Name s, _) :: _ when s = name -> Some (Cic.Rel i)
+ | _ :: tl -> aux (succ i) tl
+ in
+ aux 1 context