X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Ftactics%2Funiverse.ml;h=def2279ca180072e3439506db0e854879452d437;hb=d072c3ea699cf33189d18d8431fda9750fc2eb93;hp=8fb71075589ce85b73efe175942f6f3b3c31c3f7;hpb=910c252965fe17d6b5af92e4658e7d02bac82d58;p=helm.git diff --git a/helm/software/components/tactics/universe.ml b/helm/software/components/tactics/universe.ml index 8fb710755..def2279ca 100644 --- a/helm/software/components/tactics/universe.ml +++ b/helm/software/components/tactics/universe.ml @@ -28,7 +28,7 @@ module Codomain = struct let compare = Pervasives.compare end module S = Set.Make(Codomain) -module TI = Discrimination_tree.DiscriminationTreeIndexing(S) +module TI = Discrimination_tree.Make(Discrimination_tree.CicIndexable)(S) type universe = TI.t let empty = TI.empty @@ -38,6 +38,21 @@ let get_candidates univ ty = S.elements (TI.retrieve_unifiables univ ty) ;; +let in_universe univ ty = + let candidates = get_candidates univ ty in + List.fold_left + (fun res cand -> + match res with + | Some found -> Some found + | None -> + let candty,_ = + CicTypeChecker.type_of_aux' [] [] cand CicUniv.oblivion_ugraph in + let same ,_ = + CicReduction.are_convertible [] candty ty CicUniv.oblivion_ugraph in + if same then Some cand else None + ) None candidates +;; + let rec unfold context = function | Cic.Prod(name,s,t) -> let t' = unfold ((Some (name,Cic.Decl s))::context) t in