]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaMisc.ml
added get_proof_conclusione and list_tl_at
[helm.git] / helm / matita / matitaMisc.ml
index 3ed1f001c2d17f5c2b185362b71f1fd0f0e443a8..1ebe49e39c2e442a1b6a922373c5efe24ba93c74 100644 (file)
@@ -270,6 +270,13 @@ let get_proof_context status =
       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
@@ -297,6 +304,15 @@ let rec list_uniq = function
   | 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