123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106(************************************************************************)(* * 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) *)(************************************************************************)openNamesopenGenargmoduleStore=Store.Make()typeintern_variable_status={intern_ids:Id.Set.t;notation_variable_status:(boolref*Notation_term.subscopesoptionref*Notation_term.notation_var_bindersoptionref*Notation_term.notation_var_internalization_type)Id.Map.t}typeglob_sign={ltacvars:Id.Set.t;genv:Environ.env;extra:Store.t;intern_sign:intern_variable_status;strict_check:bool;}letempty_intern_sign={intern_ids=Id.Set.empty;notation_variable_status=Id.Map.empty;}letempty_glob_sign~strictenv={ltacvars=Id.Set.empty;genv=env;extra=Store.empty;intern_sign=empty_intern_sign;strict_check=strict;}(** In globalize tactics, we need to keep the initial [constr_expr] to recompute
in the environment by the effective calls to Intro, Inversion, etc
The [constr_expr] field is [None] in TacDef though *)typeglob_constr_and_expr=Glob_term.glob_constr*Constrexpr.constr_exproptiontypeglob_constr_pattern_and_expr=Id.Set.t*glob_constr_and_expr*Pattern.constr_patterntype('raw,'glb)intern_fun=glob_sign->'raw->glob_sign*'glbtype'glbntn_subst_fun=Id.Set.t->Glob_term.glob_constrId.Map.t->'glb->'glbmoduleInternObj=structtype('raw,'glb,'top)obj=('raw,'glb)intern_funletname="intern"letdefault_=NoneendmoduleNtnSubstObj=structtype('raw,'glb,'top)obj='glbntn_subst_funletname="notation_subst"letdefault_=NoneendmoduleIntern=Register(InternObj)moduleNtnSubst=Register(NtnSubstObj)letintern=Intern.objletregister_intern0=Intern.register0letgeneric_internist(GenArg(Rawwitwit,v))=let(ist,v)=internwitistvin(ist,in_gen(glbwitwit)v)type('raw,'glb)intern_pat_fun=?loc:Loc.t->('raw,'glb)intern_funmoduleInternPatObj=structtype('raw,'glb,'top)obj=('raw,'glb)intern_pat_funletname="intern_pat"letdefaulttag=Some(fun?loc->letname=Genarg.(ArgT.repr(get_arg_tagtag))inCErrors.user_err?locPp.(str"This quotation is not supported in tactic patterns ("++strname++str")"))endmoduleInternPat=Register(InternPatObj)letintern_pat=InternPat.objletregister_intern_pat=InternPat.register0letgeneric_intern_pat?locist(GenArg(Rawwitwit,v))=let(ist,v)=intern_patwit?locistvin(ist,in_gen(glbwitwit)v)(** Notation substitution *)letsubstitute_notation=NtnSubst.objletregister_ntn_subst0=NtnSubst.register0letgeneric_substitute_notationavoidenv(GenArg(Glbwitwit,v)asorig)=letv'=substitute_notationwitavoidenvvinifv'==vthenorigelsein_gen(glbwitwit)v'