From 0ba52f4592974fc2f4aeba0135cec03f07cf662d Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 11 Apr 2008 10:21:45 +0000 Subject: [PATCH] added a parameter to unshare universes --- helm/software/components/cic/unshare.ml | 8 +++++++- helm/software/components/cic/unshare.mli | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.2