diff options
author | Amin Timany <amintimany@gmail.com> | 2017-03-30 18:12:43 +0200 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-06-16 04:45:19 +0200 |
commit | 4dd4f186895d16510f217778bb83933be8956082 (patch) | |
tree | 94c4b2b18c013be0305e37a49c2bf63f475a8a64 /engine/universes.ml | |
parent | 44f462aa380de847452c0809d15c86649d5d6a7a (diff) |
New datastructure for universes of inductive types
Diffstat (limited to 'engine/universes.ml')
-rw-r--r-- | engine/universes.ml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engine/universes.ml b/engine/universes.ml index f20108186..955e1d8b5 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 |