context
   | _ -> []
  
+let get_proof_conclusion status =
+  match status.proof_status with
+  | Incomplete_proof ((_, metasenv, _, _), goal) ->
+      let (_, _, conclusion) = CicUtil.lookup_meta goal metasenv in
+      conclusion
+  | _ -> statement_error "no ongoing proof"
+ 
 let get_proof_aliases status = status.aliases
 
 let qualify status name = get_string_option status "baseuri" ^ "/" ^ name
   | h1::h2::tl when h1 = h2 -> list_uniq (h2 :: tl) 
   | h1::tl (* when h1 <> h2 *) -> h1 :: list_uniq tl
 
+let list_tl_at ?(equality=(==)) e l =
+  let rec aux =
+    function
+    | [] -> raise Not_found
+    | hd :: tl as l when equality hd e -> l
+    | hd :: tl -> aux tl
+  in
+  aux l
+
 let debug_wrap name f =
   prerr_endline (sprintf "debug_wrap: ==>> %s" name);
   let res = f () in
 
 
 val list_uniq: 'a list -> 'a list (* uniq unix filter on lists *)
 
+  (** @return tl tail of a list starting at a given element
+   * @param eq equality to be used, defaults to physical equality (==)
+   * @raise Not_found *)
+val list_tl_at: ?equality:('a -> 'a -> bool) -> 'a -> 'a list -> 'a list
+
   (** @raise Failure *)
 val unopt: 'a option -> 'a
 
 val get_proof_status: MatitaTypes.status -> ProofEngineTypes.status
 val get_proof_metasenv: MatitaTypes.status ->  Cic.metasenv
 val get_proof_context: MatitaTypes.status -> Cic.context 
+val get_proof_conclusion: MatitaTypes.status -> Cic.term 
 val get_proof_aliases: MatitaTypes.status -> DisambiguateTypes.environment 
 
   (** given the base name of an image, returns its full path *)