123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155(************************************************************************)(* * 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) *)(************************************************************************)openUnivtypefamily=InSProp|InProp|InSet|InTypeletall_families=[InSProp;InProp;InSet;InType]typet=|SProp|Prop|Set|TypeofUniverse.tletsprop=SPropletprop=Propletset=Setlettype1=TypeUniverse.type1letsort_of_univu=ifUniverse.is_type0uthensetelseTypeuletcompares1s2=ifs1==s2then0elsematchs1,s2with|SProp,SProp->0|SProp,(Prop|Set|Type_)->-1|(Prop|Set|Type_),SProp->1|Prop,Prop->0|Prop,(Set|Type_)->-1|Set,Prop->1|Set,Set->0|Set,Type_->-1|Typeu1,Typeu2->Universe.compareu1u2|Type_,(Prop|Set)->1letequals1s2=Int.equal(compares1s2)0letsuper=function|SProp|Prop|Set->Type(Universe.type1)|Typeu->Type(Universe.superu)letis_sprop=function|SProp->true|Prop|Set|Type_->falseletis_prop=function|Prop->true|SProp|Set|Type_->falseletis_set=function|Set->true|SProp|Prop|Type_->falseletis_small=function|SProp|Prop|Set->true|Type_->falseletlevelss=matchswith|SProp|Prop->Level.Set.empty|Set->Level.Set.singletonLevel.set|Typeu->Universe.levelsuletfamily=function|SProp->InSProp|Prop->InProp|Set->InSet|Type_->InTypeletfamily_compareab=matcha,bwith|InSProp,InSProp->0|InSProp,_->-1|_,InSProp->1|InProp,InProp->0|InProp,_->-1|_,InProp->1|InSet,InSet->0|InSet,_->-1|_,InSet->1|InType,InType->0letfamily_equal=(==)letfamily_leqab=family_compareab<=0openHashset.Combinelethash=function|SProp->combinesmall10|Prop->combinesmall11|Set->combinesmall12|Typeu->leth=Univ.Universe.hashuincombinesmall2hmoduleHsorts=Hashcons.Make(structtype_t=ttypet=_ttypeu=Universe.t->Universe.tlethashconshuniv=function|Typeuasc->letu'=hunivuinifu'==uthencelseTypeu'|s->sleteqs1s2=match(s1,s2)with|Prop,Prop|Set,Set->true|(Typeu1,Typeu2)->u1==u2|_->falselethash=hashend)lethcons=Hashcons.simple_hconsHsorts.generateHsorts.hconshcons_univ(** On binders: is this variable proof relevant *)typerelevance=Relevant|Irrelevantletrelevance_equalr1r2=matchr1,r2with|Relevant,Relevant|Irrelevant,Irrelevant->true|(Relevant|Irrelevant),_->falseletrelevance_of_sort_family=function|InSProp->Irrelevant|_->Relevantletrelevance_hash=function|Relevant->0|Irrelevant->1letrelevance_of_sort=function|SProp->Irrelevant|_->Relevantletdebug_print=function|SProp->Pp.(str"SProp")|Prop->Pp.(str"Prop")|Set->Pp.(str"Set")|Typeu->Pp.(str"Type("++Univ.Universe.pru++str")")letpr_sort_family=function|InSProp->Pp.(str"SProp")|InProp->Pp.(str"Prop")|InSet->Pp.(str"Set")|InType->Pp.(str"Type")