aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/mod_subst.ml8
-rw-r--r--kernel/mod_subst.mli2
2 files changed, 10 insertions, 0 deletions
diff --git a/kernel/mod_subst.ml b/kernel/mod_subst.ml
index 3b3d280900..0df3e66317 100644
--- a/kernel/mod_subst.ml
+++ b/kernel/mod_subst.ml
@@ -404,6 +404,14 @@ let join_alias (subst1 : substitution) (subst2 : substitution) =
mp',resolve'' in
Umap.mapi (apply_subst subst2) subst1
+let remove_alias subst =
+ let rec remove key (mp,resolve) sub =
+ match key with
+ MPI _ -> sub
+ | _ -> Umap.add key (mp,resolve) sub
+ in
+ Umap.fold remove subst empty_subst
+
let rec occur_in_path uid path =
match uid,path with
diff --git a/kernel/mod_subst.mli b/kernel/mod_subst.mli
index b54ae6f3b4..5384d0f85a 100644
--- a/kernel/mod_subst.mli
+++ b/kernel/mod_subst.mli
@@ -88,3 +88,5 @@ val update_subst_alias : substitution -> substitution -> substitution
val subst_key : substitution -> substitution -> substitution
val join_alias : substitution -> substitution -> substitution
+
+val remove_alias : substitution -> substitution