123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293(************************************************************************)(* * 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) *)(************************************************************************)openPpopenNamesopenLibnamesopenConstrexpropenConstrexpr_opsopenNotationopenNumber(** * String notation *)letqualid_of_refn=n|>Coqlib.lib_ref|>Nametab.shortest_qualid_of_globalId.Set.emptyletq_option()=qualid_of_ref"core.option.type"letq_list()=qualid_of_ref"core.list.type"letq_byte()=qualid_of_ref"core.byte.type"lethas_typeenvsigmafty=letc=mkCastC(mkRefCf,Glob_term.CastConvty)intrylet_=Constrintern.interp_constrenvsigmacintruewithPretype_errors.PretypeError_->falselettype_error_tofty=CErrors.user_err(pr_qualidf++str" should go from Byte.byte or (list Byte.byte) to "++pr_qualidty++str" or (option "++pr_qualidty++str").")lettype_error_ofgty=CErrors.user_err(pr_qualidg++str" should go from "++pr_qualidty++str" to Byte.byte or (option Byte.byte) or (list Byte.byte) or (option (list Byte.byte)).")letvernac_string_notationlocaltyfgviascope=letenv=Global.env()inletsigma=Evd.from_envenvinletappxy=mkAppC(x,[y])inletcrefq=mkRefCqinletcbyte=cref(q_byte())inletclist=cref(q_list())inletcoption=cref(q_option())inletoptr=appcoptionrinletclist_byte=appclistcbyteinletty_name=tyinletty,via=matchviawithNone->ty,via|Some(ty',a)->ty',Some(ty,a)inlettyc,params=locate_global_inductive(via=None)tyinletto_ty=Smartlocate.global_with_aliasfinletof_ty=Smartlocate.global_with_aliasginletcty=creftyinletarrowxy=mkProdC([CAst.makeAnonymous],DefaultGlob_term.Explicit,x,y)in(* Check the type of f *)letto_kind=ifhas_typeenvsigmaf(arrowclist_bytecty)thenListByte,Directelseifhas_typeenvsigmaf(arrowclist_byte(optcty))thenListByte,Optionelseifhas_typeenvsigmaf(arrowcbytecty)thenByte,Directelseifhas_typeenvsigmaf(arrowcbyte(optcty))thenByte,Optionelsetype_error_toftyin(* Check the type of g *)letof_kind=ifhas_typeenvsigmag(arrowctyclist_byte)thenListByte,Directelseifhas_typeenvsigmag(arrowcty(optclist_byte))thenListByte,Optionelseifhas_typeenvsigmag(arrowctycbyte)thenByte,Directelseifhas_typeenvsigmag(arrowcty(optcbyte))thenByte,Optionelsetype_error_ofgtyinletto_post,pt_refs=matchviawith|None->elaborate_to_post_paramsenvsigmatycparams|Some(ty,l)->elaborate_to_post_viaenvsigmatytyclinleto={to_kind;to_ty;to_post;of_kind;of_ty;ty_name;warning=()}inleti={pt_local=local;pt_scope=scope;pt_interp_info=StringNotationo;pt_required=Nametab.path_of_global(GlobRef.IndReftyc),[];pt_refs;pt_in_match=true}inenable_prim_token_interpretationi