From: Enrico Tassi Date: Fri, 11 Apr 2008 10:21:45 +0000 (+0000) Subject: added a parameter to unshare universes X-Git-Tag: make_still_working~5364 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=0ba52f4592974fc2f4aeba0135cec03f07cf662d;p=helm.git added a parameter to unshare universes --- diff --git a/helm/software/components/cic/unshare.ml b/helm/software/components/cic/unshare.ml index e4d2cc74a..3205e4f62 100644 --- a/helm/software/components/cic/unshare.ml +++ b/helm/software/components/cic/unshare.ml @@ -25,8 +25,9 @@ (* $Id$ *) -let rec unshare = +let unshare ?(fresh_univs=false) t = let module C = Cic in + let rec unshare = function C.Rel m -> C.Rel m | C.Var (uri,exp_named_subst) -> @@ -43,6 +44,8 @@ let rec unshare = ) l in C.Meta(i,l') + | C.Sort s when not fresh_univs -> C.Sort s + | C.Sort (C.Type _) -> C.Sort (C.Type (CicUniv.fresh ())) | C.Sort s -> C.Sort s | C.Implicit info -> C.Implicit info | C.Cast (te,ty) -> C.Cast (unshare te, unshare ty) @@ -83,3 +86,6 @@ let rec unshare = fl in C.CoFix (i, liftedfl) + in + unshare t +;; diff --git a/helm/software/components/cic/unshare.mli b/helm/software/components/cic/unshare.mli index 5582abcbf..a40be17ba 100644 --- a/helm/software/components/cic/unshare.mli +++ b/helm/software/components/cic/unshare.mli @@ -23,4 +23,4 @@ * http://cs.unibo.it/helm/. *) -val unshare : Cic.term -> Cic.term +val unshare : ?fresh_univs:bool -> Cic.term -> Cic.term