123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540(************************************************************************)(* * 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) *)(************************************************************************)openPpopenUtilopenNamesopenLibnamesopenConstrexpropenConstrexpr_opsopenNotationmoduleCSet=CSet.Make(Constr)moduleCMap=CMap.Make(Constr)letmkRefenvsigmag=letsigma,c=Evd.fresh_globalenvsigmaginsigma,EConstr.Unsafe.to_constrc(** * Number notation *)typenumber_string_via=qualid*(bool*qualid*qualid)listtypenumber_option=|Afterofnumnot_option|Viaofnumber_string_vialetwarn_abstract_large_num_no_op=CWarnings.create~name:"abstract-large-number-no-op"~category:CWarnings.CoreCategories.numbers(funf->strbrk"The 'abstract after' directive has no effect when "++strbrk"the parsing function ("++Nametab.pr_global_env(Termops.vars_of_env(Global.env()))f++strbrk") targets an "++strbrk"option type.")letget_constructorsind=letmib,oib=Global.lookup_inductiveindinletmc=oib.Declarations.mind_consnamesinArray.to_list(Array.mapi(funjc->GlobRef.ConstructRef(ind,j+1))mc)letqualid_of_refn=n|>Coqlib.lib_ref|>Nametab.shortest_qualid_of_globalId.Set.emptyletq_option()=qualid_of_ref"core.option.type"letunsafe_locate_indq=matchNametab.locateqwith|GlobRef.IndRefi->i|_->raiseNot_foundletlocate_z()=letzn="num.Z.type"inletpn="num.pos.type"inifCoqlib.has_refzn&&Coqlib.has_refpnthenletq_z=qualid_of_refzninletq_pos=qualid_of_refpninSome({z_ty=unsafe_locate_indq_z;pos_ty=unsafe_locate_indq_pos;},mkRefCq_z)elseNoneletlocate_number()=letdint="num.int.type"inletduint="num.uint.type"inletdec="num.decimal.type"inlethint="num.hexadecimal_int.type"inlethuint="num.hexadecimal_uint.type"inlethex="num.hexadecimal.type"inletint="num.num_int.type"inletuint="num.num_uint.type"inletnum="num.number.type"inifCoqlib.has_refdint&&Coqlib.has_refduint&&Coqlib.has_refdec&&Coqlib.has_refhint&&Coqlib.has_refhuint&&Coqlib.has_refhex&&Coqlib.has_refint&&Coqlib.has_refuint&&Coqlib.has_refnumthenletq_dint=qualid_of_refdintinletq_duint=qualid_of_refduintinletq_dec=qualid_of_refdecinletq_hint=qualid_of_refhintinletq_huint=qualid_of_refhuintinletq_hex=qualid_of_refhexinletq_int=qualid_of_refintinletq_uint=qualid_of_refuintinletq_num=qualid_of_refnuminletint_ty={dec_int=unsafe_locate_indq_dint;dec_uint=unsafe_locate_indq_duint;hex_int=unsafe_locate_indq_hint;hex_uint=unsafe_locate_indq_huint;int=unsafe_locate_indq_int;uint=unsafe_locate_indq_uint;}inletnum_ty={int=int_ty;decimal=unsafe_locate_indq_dec;hexadecimal=unsafe_locate_indq_hex;number=unsafe_locate_indq_num;}inSome(int_ty,mkRefCq_int,mkRefCq_uint,mkRefCq_dint,mkRefCq_duint,num_ty,mkRefCq_num,mkRefCq_dec)elseNoneletlocate_int63()=letint63n="num.int63.type"inletpos_neg_int63n="num.int63.pos_neg_int63"inifCoqlib.has_refint63n&&Coqlib.has_refpos_neg_int63nthenletq_pos_neg_int63=qualid_of_refpos_neg_int63ninSome({pos_neg_int63_ty=unsafe_locate_indq_pos_neg_int63},mkRefCq_pos_neg_int63)elseNoneletlocate_float()=letfloatn="num.float.type"inifCoqlib.has_reffloatnthenSome(mkRefC(qualid_of_reffloatn))elseNonelethas_typeenvsigmafty=letc=mkCastC(mkRefCf,SomeConstr.DEFAULTcast,ty)inletflags=Pretyping.{all_and_fail_flagswithuse_coercions=false}intrylet_=Constrintern.interp_constr~flagsenvsigmacintruewithPretype_errors.PretypeError_->falselettype_error_tofty=CErrors.user_err(pr_qualidf++str" should go from Number.int to "++pr_qualidty++str" or (option "++pr_qualidty++str")."++fnl()++str"Instead of Number.int, the types Number.uint or Z or PrimInt63.pos_neg_int63 or PrimFloat.float or Number.number could be used (you may need to require BinNums or Number or PrimInt63 or PrimFloat first).")lettype_error_ofgty=CErrors.user_err(pr_qualidg++str" should go from "++pr_qualidty++str" to Number.int or (option Number.int)."++fnl()++str"Instead of Number.int, the types Number.uint or Z or PrimInt63.pos_neg_int63 or PrimFloat.float or Number.number could be used (you may need to require BinNums or Number or PrimInt63 or PrimFloat first).")leterror_paramsind=CErrors.user_err(str"Wrong number of parameters for inductive"++spc()++Printer.pr_global(GlobRef.IndRefind)++str".")letremapping_error?loctyty'ty''=CErrors.user_err?loc(Printer.pr_globalty++str" was already mapped to"++spc()++Printer.pr_globalty'++str" and cannot be remapped to"++spc()++Printer.pr_globalty''++str".")leterror_missingc=CErrors.user_err(str"Missing mapping for constructor "++Printer.pr_globalc++str".")letwarn_via_remapping=CWarnings.create~name:"via-type-remapping"~category:CWarnings.CoreCategories.numbers(fun(env,sigma,ty,ty',ty'')->letconstr=Printer.pr_constr_envenvsigmainconstrty++str" was already mapped to"++spc()++constrty'++str", mapping it also to"++spc()++constrty''++str" might yield ill typed terms when using the notation.")letwarn_via_type_mismatch=CWarnings.create~name:"via-type-mismatch"~category:CWarnings.CoreCategories.numbers(fun(env,sigma,g,g',exp,actual)->letconstr=Printer.pr_constr_envenvsigmainstr"Type of"++spc()++Printer.pr_globalg++str" seems incompatible with the type of"++spc()++Printer.pr_globalg'++str"."++spc()++str"Expected type is: "++constrexp++spc()++str"instead of "++constractual++str"."++spc()++str"This might yield ill typed terms when using the notation.")letmultiple_via_error()=CErrors.user_err(Pp.str"Multiple 'via' options.")letmultiple_after_error()=CErrors.user_err(Pp.str"Multiple 'warning after' or 'abstract after' options.")letvia_abstract_error()=CErrors.user_err(Pp.str"'via' and 'abstract' cannot be used together.")letlocate_global_sort_inductive_or_constantenvsigmaqid=letlocate_sortqid=matchNametab.locate_extendedqidwith|Globnames.TrueGlobal_->raiseNot_found|Globnames.Abbrevkn->matchAbbreviation.search_abbreviationknwith|[],Notation_term.NSortr->letsigma,c=Evd.fresh_sort_in_familysigma(Glob_ops.glob_sort_familyr)inletc=EConstr.ESorts.kindsigmacinsigma,Constr.mkSortc|_->raiseNot_foundintrylocate_sortqidwithNot_found->letg=Smartlocate.global_with_aliasqidinlet()=matchgwith|IndRef_|ConstRef_->()|VarRef_|ConstructRef_->CErrors.user_errPp.(pr_qualidqid++spc()++str"is not an inductive type or a constant.")inmkRefenvsigmagletlocate_global_constructor_inductive_or_constantenvsigmaqid=letg=Smartlocate.global_with_aliasqidinlet()=matchgwith|ConstructRef_|IndRef_|ConstRef_->()|VarRef_->CErrors.user_errPp.(pr_qualidqid++spc()++str"is a section variable.")inletsigma,c=mkRefenvsigmaginsigma,g,c(* [get_type env sigma c] retrieves the type of [c] and returns a pair
[l, t] such that [c : l_0 -> ... -> l_n -> t]. *)letget_typeenvsigmac=(* inspired from [compute_implicit_names] in "interp/impargs.ml" *)letrecauxenvacct=lett=Reductionops.whd_allenvsigmatinmatchEConstr.kindsigmatwith|Constr.Prod(na,a,b)->leta=Reductionops.whd_allenvsigmaainletrel=Context.Rel.Declaration.LocalAssum(na,a)inaux(EConstr.push_relrelenv)((na,a)::acc)b|_->List.revacc,tinlett=Retyping.get_type_ofenvsigma(EConstr.of_constrc)inletl,t=auxenv[]tinList.map(fun(na,a)->na,EConstr.Unsafe.to_constra)l,EConstr.Unsafe.to_constrt(* [elaborate_to_post_params env sigma ty_ind params] builds the
[to_post] translation (c.f., interp/notation.mli) for the numeral
notation to parse/print type [ty_ind]. This translation is the
identity ([ToPostCopy]) except that it checks ([ToPostCheck]) that
the parameters of the inductive type [ty_ind] match the ones given
in [params]. *)letelaborate_to_post_paramsenvsigmaty_indparams=letto_post_for_constructorindc=letsigma,c=matchindcwith|GlobRef.ConstructRef_->mkRefenvsigmaindc|_->assertfalsein(* c.f. get_constructors *)letargs,t=get_typeenvsigmacinletparams_indc=matchConstr.kindtwith|Constr.App(_,a)->Array.to_lista|_->[]inletsz=List.lengthargsinleta=Array.makeszToPostCopyinifList.lengthparams<>List.lengthparams_indcthenerror_paramsty_ind;List.iter2(funparamparam_indc->matchparam,Constr.kindparam_indcwith|Somep,Constr.Reliwheni<=sz->a.(sz-i)<-ToPostCheckp|_->())paramsparams_indc;indc,indc,Array.to_listainletpt_refs=get_constructorsty_indinletto_post_0=List.mapto_post_for_constructorpt_refsinletto_post=letonly_copy(_,_,args)=List.for_all((=)ToPostCopy)argsinif(List.for_allonly_copyto_post_0)then[||]else[|to_post_0|]into_post,pt_refs(* [elaborate_to_post_via env sigma ty_name ty_ind l] builds the [to_post]
translation (c.f., interp/notation.mli) for the number notation to
parse/print type [ty_name] through the inductive [ty_ind] according
to the pairs [constant, constructor] in the list [l]. *)letelaborate_to_post_viaenvsigmaty_namety_indl=letsigma,ty_name=locate_global_sort_inductive_or_constantenvsigmaty_nameinletsigma,ty_ind=mkRefenvsigma(IndRefty_ind)in(* Retrieve constants and constructors mappings and their type.
For each constant [cnst] and inductive constructor [indc] in [l], retrieve:
* its location: [lcnst] and [lindc]
* its GlobRef: [cnst] and [indc]
* its type: [tcnst] and [tindc] (decomposed in product by [get_type] above)
* [impls] are the implicit arguments of [cnst] *)letsigma,l=letreadsigma(consider_implicits,cnst,indc)=letlcnst,lindc=cnst.CAst.loc,indc.CAst.locinletsigma,cnst,ccnst=locate_global_constructor_inductive_or_constantenvsigmacnstinletindc=GlobRef.ConstructRef(Smartlocate.global_constructor_with_aliasindc)inletsigma,cindc=mkRefenvsigmaindcinletget_type_wo_paramsc=(* ignore parameters of inductive types *)letrm_paramsc=matchConstr.kindcwith|Constr.App(c,_)whenConstr.isIndc->c|_->cinletlc,tc=get_typeenvsigmacinList.map(fun(n,c)->n,rm_paramsc)lc,rm_paramstcinlettcnst,tindc=get_type_wo_paramsccnst,get_type_wo_paramscindcinletimpls=ifnotconsider_implicitsthen[]elseImpargs.(select_stronger_impargs(implicits_of_globalcnst))insigma,(lcnst,cnst,tcnst,lindc,indc,tindc,impls)inList.fold_left_mapreadsigmalinleteq_indcindc(_,_,_,_,indc',_,_)=Environ.QGlobRef.equalenvindcindc'in(* Collect all inductive types involved.
That is [ty_ind] and all final codomains of [tindc] above. *)letinds=List.fold_left(funs(_,_,_,_,_,tindc,_)->CSet.add(sndtindc)s)(CSet.singletonty_ind)lin(* And for each inductive, retrieve its constructors. *)letconstructors=CSet.fold(funindm->letinductive,_=Constr.destIndindinCMap.addind(get_constructorsinductive)m)indsCMap.emptyin(* Error if one [constructor] in some inductive in [inds]
doesn't appear exactly once in [l] *)let_:_list=(* check_for duplicate constructor and error *)List.fold_left(funalready_seen(_,cnst,_,loc,indc,_,_)->tryletcnst'=List.assoc_f(func1c2->Environ.QGlobRef.equalenvc1c2)indcalready_seeninremapping_error?locindccnst'cnstwithNot_found->(indc,cnst)::already_seen)[]linlet()=(* check for missing constructor and error *)CMap.iter(fun_ctors->List.iter(funcstr->ifnot(List.exists(eq_indccstr)l)thenerror_missingcstr)ctors)constructorsin(* Perform some checks on types and warn if they look strange.
These checks are neither sound nor complete, so we only warn. *)let()=(* associate inductives to types, and check that this mapping is one to one
and maps [ty_ind] to [ty_name] *)letind2ty,ty2ind=letaddlocckeycvalm=matchCMap.find_optckeymwith|None->CMap.addckeycvalm|Someold_cval->ifnot(Constr.eq_constr_nounivsold_cvalcval)thenwarn_via_remapping?loc(env,sigma,ckey,old_cval,cval);minList.fold_left(fun(ind2ty,ty2ind)(lcnst,_,(_,tcnst),lindc,_,(_,tindc),_)->addlcnsttindctcnstind2ty,addlindctcnsttindcty2ind)CMap.(singletonty_indty_name,singletonty_namety_ind)lin(* check that type of constants and constructors mapped in [l]
match modulo [ind2ty] *)letrm_implsimpls(l,t)=letrecauximplsl=matchimpls,lwith|Some_::impls,_::b->auximplsb|None::impls,(n,a)::b->(n,a)::auximplsb|_->linauximplsl,tinletreplacem(l,t)=letapply_mc=tryCMap.findcmwithNot_found->cinList.fold_right(fun(na,a)b->Constr.mkProd(na,(apply_ma),b))l(apply_mt)inList.iter(fun(_,cnst,tcnst,loc,indc,tindc,impls)->lettcnst=rm_implsimplstcnstinlettcnst'=replaceCMap.emptytcnstinifnot(Constr.eq_constr_nounivstcnst'(replaceind2tytindc))thenletactual=replaceCMap.emptytindcinletexpected=replacety2indtcnstinwarn_via_type_mismatch?loc(env,sigma,indc,cnst,expected,actual))lin(* Associate an index to each inductive, starting from 0 for [ty_ind]. *)letind2num,num2ind,nb_ind=CMap.fold(funind_(ind2num,num2ind,i)->CMap.addindiind2num,Int.Map.addiindnum2ind,i+1)(CMap.removety_indconstructors)(CMap.singletonty_ind0,Int.Map.singleton0ty_ind,1)in(* Finally elaborate [to_post] *)letto_post=letrecmap_prodimplstindc=matchimplswith|Some_::impls->ToPostHole::map_prodimplstindc|_->matchtindcwith|[]->[]|(_,a)::b->lett=matchCMap.find_optaind2numwith|Somei->ToPostAsi|None->ToPostCopyinletimpls=matchimplswith[]->[]|_::t->tint::map_prodimplsbinArray.initnb_ind(funi->List.map(funindc->let_,cnst,_,_,_,tindc,impls=List.find(eq_indcindc)linindc,cnst,map_prodimpls(fsttindc))(CMap.find(Int.Map.findinum2ind)constructors))in(* and use constants mapped to constructors of [ty_ind] as triggers. *)letpt_refs=List.map(fun(_,cnst,_)->cnst)(to_post.(0))into_post,pt_refstypetarget_type=|TargetIndof(inductive*Constr.toptionlist)|TargetPrimofconstr_expr*GlobRef.tlist*required_moduleletlocate_global_inductive_with_paramsallow_paramsqid=ifnotallow_paramsthenraiseNot_foundelsematchNametab.locate_extendedqidwith|Globnames.TrueGlobal_->raiseNot_found|Globnames.Abbrevkn->matchAbbreviation.search_abbreviationknwith|[],Notation_term.(NApp(NRef(GlobRef.IndRefi,None),l))->i,List.map(function|Notation_term.NHole_->None|n->letg=Notation_ops.glob_constr_of_notation_constrninletc,_=letenv=Global.env()inletsigma=Evd.from_envenvinPretyping.understandenvsigmaginSome(EConstr.Unsafe.to_constrc))l|_->raiseNot_foundletlocate_global_inductiveallow_paramsqid=trylocate_global_inductive_with_paramsallow_paramsqidwithNot_found->Smartlocate.global_inductive_with_aliasqid,[]letlocate_global_inductive_or_int63_or_floatenvallow_paramsqid=tryTargetInd(locate_global_inductive_with_paramsallow_paramsqid)withNot_found->letint63n="num.int63.type"inletint63c="num.int63.wrap_int"inletint63w="Coq.Numbers.Cyclic.Int63.PrimInt63.int_wrapper"inletfloatn="num.float.type"inletfloatc="num.float.wrap_float"inletfloatw="Coq.Floats.PrimFloat.float_wrapper"inifallow_params&&Coqlib.has_refint63n&&Environ.QGlobRef.equalenv(Smartlocate.global_with_aliasqid)(Coqlib.lib_refint63n)thenTargetPrim(mkRefC(qualid_of_stringint63w),[Coqlib.lib_refint63c],(Nametab.path_of_global(Coqlib.lib_refint63n),[]))elseifallow_params&&Coqlib.has_reffloatn&&Environ.QGlobRef.equalenv(Smartlocate.global_with_aliasqid)(Coqlib.lib_reffloatn)thenTargetPrim(mkRefC(qualid_of_stringfloatw),[Coqlib.lib_reffloatc],(Nametab.path_of_global(Coqlib.lib_reffloatn),[]))elseTargetInd(Smartlocate.global_inductive_with_aliasqid,[])letvernac_number_notationlocaltyfgoptsscope=letrecparse_opts=function|[]->None,Nop|h::opts->letvia,opts=parse_optsoptsinletvia=matchh,viawith|Via_,Some_->multiple_via_error()|Viav,None->Somev|_->viainletopts=matchh,optswith|After_,(Warning_|Abstract_)->multiple_after_error()|Aftera,Nop->a|_->optsinvia,optsinletvia,opts=parse_optsoptsin(matchvia,optswithSome_,Abstract_->via_abstract_error()|_->());letenv=Global.env()inletsigma=Evd.from_envenvinletnum_ty=locate_number()inletz_pos_ty=locate_z()inletint63_ty=locate_int63()inletfloat_ty=locate_float()inletty_name=tyinletty,via=matchviawithNone->ty,via|Some(ty',a)->ty',Some(ty,a)inlettyc_params=locate_global_inductive_or_int63_or_floatenv(via=None)tyinletto_ty=Smartlocate.global_with_aliasfinletof_ty=Smartlocate.global_with_aliasginletcty=mkRefCtyinletappxy=mkAppC(x,[y])inletarrowxy=mkProdC([CAst.makeAnonymous],DefaultGlob_term.Explicit,x,y)inletoptr=app(mkRefC(q_option()))rin(* Check the type of f *)letto_kind=matchnum_tywith|Some(int_ty,cint,_,_,_,_,_,_)whenhas_typeenvsigmaf(arrowcintcty)->Intint_ty,Direct|Some(int_ty,cint,_,_,_,_,_,_)whenhas_typeenvsigmaf(arrowcint(optcty))->Intint_ty,Option|Some(int_ty,_,cuint,_,_,_,_,_)whenhas_typeenvsigmaf(arrowcuintcty)->UIntint_ty,Direct|Some(int_ty,_,cuint,_,_,_,_,_)whenhas_typeenvsigmaf(arrowcuint(optcty))->UIntint_ty,Option|Some(_,_,_,_,_,num_ty,cnum,_)whenhas_typeenvsigmaf(arrowcnumcty)->Numbernum_ty,Direct|Some(_,_,_,_,_,num_ty,cnum,_)whenhas_typeenvsigmaf(arrowcnum(optcty))->Numbernum_ty,Option|_->matchz_pos_tywith|Some(z_pos_ty,cZ)whenhas_typeenvsigmaf(arrowcZcty)->Zz_pos_ty,Direct|Some(z_pos_ty,cZ)whenhas_typeenvsigmaf(arrowcZ(optcty))->Zz_pos_ty,Option|_->matchint63_tywith|Some(pos_neg_int63_ty,cint63)whenhas_typeenvsigmaf(arrowcint63cty)->Int63pos_neg_int63_ty,Direct|Some(pos_neg_int63_ty,cint63)whenhas_typeenvsigmaf(arrowcint63(optcty))->Int63pos_neg_int63_ty,Option|_->matchfloat_tywith|Somecfloatwhenhas_typeenvsigmaf(arrowcfloatcty)->Float64,Direct|Somecfloatwhenhas_typeenvsigmaf(arrowcfloat(optcty))->Float64,Option|_->type_error_toftyin(* Check the type of g *)letcty=matchtyc_paramswithTargetPrim(c,_,_)->c|TargetInd_->ctyinletof_kind=matchnum_tywith|Some(int_ty,cint,_,_,_,_,_,_)whenhas_typeenvsigmag(arrowctycint)->Intint_ty,Direct|Some(int_ty,cint,_,_,_,_,_,_)whenhas_typeenvsigmag(arrowcty(optcint))->Intint_ty,Option|Some(int_ty,_,cuint,_,_,_,_,_)whenhas_typeenvsigmag(arrowctycuint)->UIntint_ty,Direct|Some(int_ty,_,cuint,_,_,_,_,_)whenhas_typeenvsigmag(arrowcty(optcuint))->UIntint_ty,Option|Some(_,_,_,_,_,num_ty,cnum,_)whenhas_typeenvsigmag(arrowctycnum)->Numbernum_ty,Direct|Some(_,_,_,_,_,num_ty,cnum,_)whenhas_typeenvsigmag(arrowcty(optcnum))->Numbernum_ty,Option|_->matchz_pos_tywith|Some(z_pos_ty,cZ)whenhas_typeenvsigmag(arrowctycZ)->Zz_pos_ty,Direct|Some(z_pos_ty,cZ)whenhas_typeenvsigmag(arrowcty(optcZ))->Zz_pos_ty,Option|_->matchint63_tywith|Some(pos_neg_int63_ty,cint63)whenhas_typeenvsigmag(arrowctycint63)->Int63pos_neg_int63_ty,Direct|Some(pos_neg_int63_ty,cint63)whenhas_typeenvsigmag(arrowcty(optcint63))->Int63pos_neg_int63_ty,Option|_->matchfloat_tywith|Somecfloatwhenhas_typeenvsigmag(arrowctycfloat)->Float64,Direct|Somecfloatwhenhas_typeenvsigmag(arrowcty(optcfloat))->Float64,Option|_->type_error_ofgtyinletto_post,pt_required,pt_refs=matchtyc_paramswith|TargetPrim(_,refs,path)->[||],path,refs|TargetInd(tyc,params)->letto_post,pt_refs=matchviawith|None->elaborate_to_post_paramsenvsigmatycparams|Some(ty,l)->elaborate_to_post_viaenvsigmatytyclinto_post,(Nametab.path_of_global(GlobRef.IndReftyc),[]),pt_refsinleto={to_kind;to_ty;to_post;of_kind;of_ty;ty_name;warning=opts}in(matchopts,to_kindwith|Abstract_,(_,Option)->warn_abstract_large_num_no_opo.to_ty|_->());leti={pt_local=local;pt_scope=scope;pt_interp_info=NumberNotationo;pt_required;pt_refs;pt_in_match=true}inenable_prim_token_interpretationi