diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-08-09 18:24:30 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-08-09 18:24:30 +0200 |
commit | c5a4aba58f973898ebc9af5176753c7962bddb3c (patch) | |
tree | ce08feb40859945ea0cf9ba9a67df23c9bb03f4a /kernel | |
parent | 56a6727525e860a155b6ae73da152e558b3ea976 (diff) |
Adding a primitive to merge ContextSets which is more efficient when one
of the argument is smaller than the other one.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/univ.ml | 5 | ||||
-rw-r--r-- | kernel/univ.mli | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/kernel/univ.ml b/kernel/univ.ml index d3201bcb9..942c90aa2 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -1876,6 +1876,11 @@ struct let union (univs, cst) (univs', cst') = LSet.union univs univs', Constraint.union cst cst' + let append (univs, cst) (univs', cst') = + let univs = LSet.fold LSet.add univs univs' in + let cst = Constraint.fold Constraint.add cst cst' in + (univs, cst) + let diff (univs, cst) (univs', cst') = LSet.diff univs univs', Constraint.diff cst cst' diff --git a/kernel/univ.mli b/kernel/univ.mli index 3779c055d..c9b7547f2 100644 --- a/kernel/univ.mli +++ b/kernel/univ.mli @@ -339,6 +339,11 @@ sig val of_set : universe_set -> t val union : t -> t -> t + + val append : t -> t -> t + (** Variant of {!union} which is more efficient when the left argument is + much smaller than the right one. *) + val diff : t -> t -> t val add_universe : universe_level -> t -> t val add_constraints : constraints -> t -> t |