diff options
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/universes.ml | 20 | ||||
| -rw-r--r-- | engine/universes.mli | 11 |
2 files changed, 31 insertions, 0 deletions
diff --git a/engine/universes.ml b/engine/universes.ml index f201081862..955e1d8b5b 100644 --- a/engine/universes.ml +++ b/engine/universes.ml @@ -1118,3 +1118,23 @@ let solve_constraints_system levels level_bounds level_min = done; done; v + + +(** Operations for universe_info_ind *) + +(** Given a universe context representing constraints of an inductive + this function produces a UInfoInd.t that with the trivial subtyping relation. *) +let univ_inf_ind_from_universe_context univcst = + let freshunivs = Instance.of_array + (Array.map (fun _ -> new_univ_level ()) + (Instance.to_array (UContext.instance univcst))) + in UInfoInd.from_universe_context univcst freshunivs + +(** This function adds universe constraints to the universe + constraints of the given universe_info_ind. However one must be + CAUTIOUS as it resets the subtyping constraints to equality. *) +let univ_inf_ind_union uinfind univcst' = + let freshunivs = Instance.of_array + (Array.map (fun _ -> new_univ_level ()) + (Instance.to_array (UContext.instance univcst'))) + in UInfoInd.union uinfind univcst' freshunivs diff --git a/engine/universes.mli b/engine/universes.mli index 83ca1ea606..17a9deb3a2 100644 --- a/engine/universes.mli +++ b/engine/universes.mli @@ -227,3 +227,14 @@ val pr_universe_opt_subst : universe_opt_subst -> Pp.std_ppcmds val solve_constraints_system : universe option array -> universe array -> universe array -> universe array + +(** Operations for universe_info_ind *) + +(** Given a universe context representing constraints of an inductive + this function produces a UInfoInd.t that with the trivial subtyping relation. *) +val univ_inf_ind_from_universe_context : universe_context -> universe_info_ind + +(** This function adds universe constraints to the universe + constraints of the given universe_info_ind. However one must be + CAUTIOUS as it resets the subtyping constraints to equality. *) +val univ_inf_ind_union : universe_info_ind -> universe_context -> universe_info_ind |
