X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Ftactics%2FreductionTactics.ml;h=9c39caa6f4cee2a4f03fbf505591398a65c24fda;hb=e016b4d32f05113a882e83a9fc8319751224c975;hp=3afef8eede4884141ab3c23aab3f79e73a842d61;hpb=fbdd1cc46819d19ed135391a4a954c19d1b92c0c;p=helm.git diff --git a/components/tactics/reductionTactics.ml b/components/tactics/reductionTactics.ml index 3afef8eed..9c39caa6f 100644 --- a/components/tactics/reductionTactics.ml +++ b/components/tactics/reductionTactics.ml @@ -135,7 +135,7 @@ exception NotConvertible reference variables that are local to the term that is going to be replaced. To fix this we should parse with_what in the context of the term(s) to be replaced. *) -let change_tac ~pattern with_what = +let change_tac ?(with_cast=false) ~pattern with_what = let change_tac ~pattern ~with_what (proof, goal) = let curi,metasenv,_subst,pbo,pty, attrs = proof in let (metano,context,ty) as conjecture = CicUtil.lookup_meta goal metasenv in @@ -206,7 +206,19 @@ let change_tac ~pattern with_what = | _ as t -> t) metasenv in - (curi,metasenv',_subst,pbo,pty, attrs), [metano] + let proof,goal = (curi,metasenv',_subst,pbo,pty, attrs), metano in + if with_cast then + let metano' = ProofEngineHelpers.new_meta_of_proof ~proof in + let (newproof,_) = + let irl= CicMkImplicit.identity_relocation_list_for_metavariable context' + in + ProofEngineHelpers.subst_meta_in_proof + proof metano + (Cic.Cast (Cic.Meta(metano',irl),ty')) [metano',context',ty'] + in + newproof, [metano'] + else + proof,[goal] in mk_tactic (change_tac ~pattern ~with_what)