diff options
| author | Matthieu Sozeau | 2018-11-27 11:20:57 +0100 |
|---|---|---|
| committer | Matthieu Sozeau | 2018-11-27 11:20:57 +0100 |
| commit | f6a2d21b6c2a93cb70fde235fc897fb75ea51384 (patch) | |
| tree | 8913811d7ff06686a0ec837296545cae12007f85 /kernel/environ.ml | |
| parent | dddb72b2f45f39f04e91aa9099bcd1064c629504 (diff) | |
| parent | c58ea20fba5a5ce54aaf62182dfd3ee8a368d529 (diff) | |
Merge PR #8850: Private universes for opaque polymorphic constants.
Diffstat (limited to 'kernel/environ.ml')
| -rw-r--r-- | kernel/environ.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/environ.ml b/kernel/environ.ml index 7835a807ba..38a428d9a1 100644 --- a/kernel/environ.ml +++ b/kernel/environ.ml @@ -382,6 +382,18 @@ let add_universes_set strict ctx g = let push_context_set ?(strict=false) ctx env = map_universes (add_universes_set strict ctx) env +let push_subgraph (levels,csts) env = + let add_subgraph g = + let newg = Univ.LSet.fold (fun v g -> UGraph.add_universe v false g) levels g in + let newg = UGraph.merge_constraints csts newg in + (if not (Univ.Constraint.is_empty csts) then + let restricted = UGraph.constraints_for ~kept:(UGraph.domain g) newg in + (if not (UGraph.check_constraints restricted g) then + CErrors.anomaly Pp.(str "Local constraints imply new transitive constraints."))); + newg + in + map_universes add_subgraph env + let set_engagement c env = (* Unsafe *) { env with env_stratification = { env.env_stratification with env_engagement = c } } |
