X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Ftactics%2Funiverse.ml;h=f7c3932dc688abf1e5ca3c4acb0308d59b1d4a66;hb=d0defade97cf8cf1b5426c73b16b7ea63ccaffbc;hp=c8d370f04ff8807f08cbf2afd6a12459bd42af63;hpb=002ad23d3995439a265b9879432a30835b8d3395;p=helm.git diff --git a/helm/software/components/tactics/universe.ml b/helm/software/components/tactics/universe.ml index c8d370f04..f7c3932dc 100644 --- a/helm/software/components/tactics/universe.ml +++ b/helm/software/components/tactics/universe.ml @@ -41,7 +41,7 @@ let get_candidates univ ty = let rec unfold context = function | Cic.Prod(name,s,t) -> let t' = unfold ((Some (name,Cic.Decl s))::context) t in - Cic.Prod(name,s,t') + Cic.Prod(name,s,t') | t -> ProofEngineReduction.unfold context t let rec collapse_head_metas t = @@ -74,25 +74,27 @@ let rec collapse_head_metas t = let rec dummies_of_coercions = function | Cic.Appl (c::l) when CoercDb.is_a_coercion' c -> - Cic.Meta (-1,[]) + Cic.Meta (-1,[]) | Cic.Appl l -> - let l' = List.map dummies_of_coercions l in Cic.Appl l' + let l' = List.map dummies_of_coercions l in Cic.Appl l' | Cic.Lambda(n,s,t) -> - let s' = dummies_of_coercions s in - let t' = dummies_of_coercions t in - Cic.Lambda (n,s',t') + let s' = dummies_of_coercions s in + let t' = dummies_of_coercions t in + Cic.Lambda (n,s',t') | Cic.Prod(n,s,t) -> - let s' = dummies_of_coercions s in - let t' = dummies_of_coercions t in - Cic.Prod (n,s',t') - | Cic.LetIn(n,s,t) -> - let s' = dummies_of_coercions s in - let t' = dummies_of_coercions t in - Cic.LetIn (n,s',t') - | Cic.MutCase _ -> prerr_endline "mutcase";Cic.Meta (-1,[]) + let s' = dummies_of_coercions s in + let t' = dummies_of_coercions t in + Cic.Prod (n,s',t') + | Cic.LetIn(n,s,ty,t) -> + let s' = dummies_of_coercions s in + let ty' = dummies_of_coercions ty in + let t' = dummies_of_coercions t in + Cic.LetIn (n,s',ty',t') + | Cic.MutCase _ -> Cic.Meta (-1,[]) | t -> t ;; + let rec head remove_coercions t = let clean_up t = if remove_coercions then dummies_of_coercions t @@ -118,6 +120,8 @@ let keys context ty = [head true ty; head true (unfold context ty)] with ProofEngineTypes.Fail _ -> [head true ty] +let key term = head false term;; + let index_term_and_unfolded_term univ context t ty = let key = head true ty in let univ = index univ key t in @@ -158,7 +162,7 @@ let remove univ context term ty = let remove_uri univ uri = let term = CicUtil.term_of_uri uri in - let ty,_ = CicTypeChecker.type_of_aux' [] [] term CicUniv.empty_ugraph in + let ty,_ = CicTypeChecker.type_of_aux' [] [] term CicUniv.oblivion_ugraph in remove univ [] term ty