X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2FprimitiveTactics.ml;h=06e83a125335ea218df3a3e25f2c02f197910397;hb=b84c60ff48a21a62a08e636f32cf0df46dfbe45a;hp=07cdd5bfe7c77586e800a7a812e4f1d10bfedb26;hpb=80fc89019bcb7fb7e0e1fb8bb111b708be49d19f;p=helm.git diff --git a/helm/ocaml/tactics/primitiveTactics.ml b/helm/ocaml/tactics/primitiveTactics.ml index 07cdd5bfe..06e83a125 100644 --- a/helm/ocaml/tactics/primitiveTactics.ml +++ b/helm/ocaml/tactics/primitiveTactics.ml @@ -574,69 +574,20 @@ let elim_tac ~term = mk_tactic (elim_tac ~term) ;; -let elim_intros_tac ~term = - Tacticals.then_ ~start:(elim_tac ~term) - ~continuation:(intros_tac ()) +let elim_intros_tac ?(mk_fresh_name_callback = FreshNamesGenerator.mk_fresh_name ~subst:[]) + ?depth ?using what = + Tacticals.then_ ~start:(elim_tac ~term:what) + ~continuation:(intros_tac ~mk_fresh_name_callback ?howmany:depth ()) ;; (* The simplification is performed only on the conclusion *) -let elim_intros_simpl_tac ~term = - Tacticals.then_ ~start:(elim_tac ~term) +let elim_intros_simpl_tac ?(mk_fresh_name_callback = FreshNamesGenerator.mk_fresh_name ~subst:[]) + ?depth ?using what = + Tacticals.then_ ~start:(elim_tac ~term:what) ~continuation: (Tacticals.thens - ~start:(intros_tac ()) + ~start:(intros_tac ~mk_fresh_name_callback ?howmany:depth ()) ~continuations: [ReductionTactics.simpl_tac ~pattern:(ProofEngineTypes.conclusion_pattern None)]) ;; - -exception NotConvertible - -(*CSC: Bug (or feature?). [with_what] is parsed in the context of the goal, *) -(*CSC: while [what] can have a richer context (because of binders) *) -(*CSC: So it is _NOT_ possible to use those binders in the [with_what] term. *) -(*CSC: Is that evident? Is that right? Or should it be changed? *) -let change_tac ~pattern with_what = -(* - let change_tac ~what ~with_what ~pattern (proof, goal) = - let curi,metasenv,pbo,pty = proof in - let metano,context,ty = CicUtil.lookup_meta goal metasenv in - (* are_convertible works only on well-typed terms *) - let _,u = - CicTypeChecker.type_of_aux' metasenv context with_what - CicUniv.empty_ugraph - in (* TASSI: FIXME *) - let b,_ = - CicReduction.are_convertible context what with_what u - in - if b then - begin - let replace = - ProofEngineReduction.replace - ~equality:(==) ~what:[what] ~with_what:[with_what] - in - let ty' = replace ty in - let context' = - List.map - (function - Some (name,Cic.Def (t,None))-> - Some (name,Cic.Def ((replace t),None)) - | Some (name,Cic.Decl t) -> Some (name,Cic.Decl (replace t)) - | None -> None - | Some (_,Cic.Def (_,Some _)) -> assert false - ) context - in - let metasenv' = - List.map - (function - (n,_,_) when n = metano -> (metano,context',ty') - | _ as t -> t - ) metasenv - in - (curi,metasenv',pbo,pty), [metano] - end - else - raise (ProofEngineTypes.Fail "Not convertible") - in - mk_tactic (change_tac ~what ~with_what ~pattern) -*) assert false