12345678910111213141516171819202122232425262728293031323334(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)(** Monomorphic universes need to survive sections. *)letname_instanceinst=letmaplvl=matchUniv.Level.namelvlwith|None->(* Having Prop/Set/Var as section universes makes no sense *)assertfalse|Somena->tryletqid=Nametab.shortest_qualid_of_universeNames.Id.Map.emptynainNames.Name(Libnames.qualid_basenameqid)withNot_found->(* Best-effort naming from the string representation of the level.
See univNames.ml for a similar hack. *)Names.Name(Names.Id.of_string_soft(Univ.Level.to_stringlvl))inArray.mapmap(Univ.Instance.to_arrayinst)letdeclare_universe_context~polyctx=ifpolythenletuctx=Univ.ContextSet.to_contextctxinletnas=name_instance(Univ.UContext.instanceuctx)inGlobal.push_section_context(nas,uctx)elseGlobal.push_context_set~strict:truectx