X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2FvariousTactics.ml;h=51f28b3c9e7b6a29c634128afc87a7a37014d147;hb=28ac70d3f475442cda4ef30e0e9c0e6d012b2527;hp=bc6d522b983171aa0adc1ad8018b7d34eb46acbf;hpb=0f4efe6bfd4b4382ca5aab458b0d956c918ab29c;p=helm.git diff --git a/helm/ocaml/tactics/variousTactics.ml b/helm/ocaml/tactics/variousTactics.ml index bc6d522b9..51f28b3c9 100644 --- a/helm/ocaml/tactics/variousTactics.ml +++ b/helm/ocaml/tactics/variousTactics.ml @@ -94,15 +94,21 @@ let generalize_tac let term = match term with None -> None - | Some term -> Some (CicMetaSubst.apply_subst subst term) in - let u,typ,term = - let context_of_t,t = + | Some term -> + Some (fun context metasenv ugraph -> + let term, metasenv, ugraph = term context metasenv ugraph in + CicMetaSubst.apply_subst subst term, metasenv, ugraph) + in + let u,typ,term, metasenv = + let context_of_t, (t, metasenv, u) = match terms_with_context, term with [], None -> raise UnableToDetectTheTermThatMustBeGeneralizedYouMustGiveItExplicitly - | _, Some t -> context,t - | (context_of_t,t)::_, None -> context_of_t,t + | [], Some t -> context, t context metasenv u + | (context_of_t, _)::_, Some t -> + context_of_t, t context_of_t metasenv u + | (context_of_t, t)::_, None -> context_of_t, (t, metasenv, u) in let t,subst,metasenv' = try @@ -116,7 +122,7 @@ let generalize_tac assert (subst = []); assert (metasenv' = metasenv); let typ,u = CicTypeChecker.type_of_aux' ~subst metasenv context t u in - u,typ,t + u,typ,t,metasenv in (* We need to check: 1. whether they live in the context of the goal;