- with CicUnification.UnificationFailure _ as e ->
- raise (Fail (Printexc.to_string e))
-
-let intros_tac
- ?(mk_fresh_name_callback = ProofEngineHelpers.mk_fresh_name) ()
- ~status:(proof, goal)
-=
- let module C = Cic in
- let module R = CicReduction in
- let (_,metasenv,_,_) = proof in
- let metano,context,ty = List.find (function (m,_,_) -> m=goal) metasenv in
- let newmeta = new_meta_of_proof ~proof in
- let (context',ty',bo') =
- lambda_abstract context newmeta ty mk_fresh_name_callback
- in
- let (newproof, _) =
- subst_meta_in_proof proof metano bo' [newmeta,context',ty']
- in
- (newproof, [newmeta])
-
-let cut_tac
- ?(mk_fresh_name_callback = ProofEngineHelpers.mk_fresh_name)
- term ~status:(proof, goal)
-=
- let module C = Cic in
- let curi,metasenv,pbo,pty = proof in
- let metano,context,ty = List.find (function (m,_,_) -> m=goal) metasenv in
- let newmeta1 = new_meta_of_proof ~proof in
- let newmeta2 = newmeta1 + 1 in
- let fresh_name =
- mk_fresh_name_callback context (Cic.Name "Hcut") ~typ:term in
- let context_for_newmeta1 =
- (Some (fresh_name,C.Decl term))::context in
- let irl1 =
- CicMkImplicit.identity_relocation_list_for_metavariable
- context_for_newmeta1
- in
- let irl2 =
- CicMkImplicit.identity_relocation_list_for_metavariable context
- in
- let newmeta1ty = CicSubstitution.lift 1 ty in
- let bo' =
- C.Appl
- [C.Lambda (fresh_name,term,C.Meta (newmeta1,irl1)) ;
- C.Meta (newmeta2,irl2)]
- in
- let (newproof, _) =
- subst_meta_in_proof proof metano bo'
- [newmeta2,context,term; newmeta1,context_for_newmeta1,newmeta1ty];
- in
- (newproof, [newmeta1 ; newmeta2])