123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128(************************************************************************)(* * 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) *)(************************************************************************)openUtilopenNamesletall_opaque=TransparentState.emptyopenTransparentStatetypereds={r_beta:bool;r_delta:bool;r_const:TransparentState.t;r_zeta:bool;r_match:bool;r_fix:bool;r_cofix:bool;}typered_kind=|BETA|DELTA|MATCH|FIX|COFIX|ZETA|CONSTofConstant.t|PROJofProjection.Repr.t|VARofId.tletfBETA=BETAletfDELTA=DELTAletfMATCH=MATCHletfFIX=FIXletfCOFIX=COFIXletfZETA=ZETAletfCONSTkn=CONSTknletfPROJp=PROJpletfVARid=VARidletno_red={r_beta=false;r_delta=false;r_const=all_opaque;r_zeta=false;r_match=false;r_fix=false;r_cofix=false;}letred_addred=function|BETA->{redwithr_beta=true}|DELTA->{redwithr_delta=true}|CONSTkn->letr=red.r_constin{redwithr_const={rwithtr_cst=Cpred.addknr.tr_cst}}|PROJp->letr=red.r_constin{redwithr_const={rwithtr_prj=PRpred.addpr.tr_prj}}|MATCH->{redwithr_match=true}|FIX->{redwithr_fix=true}|COFIX->{redwithr_cofix=true}|ZETA->{redwithr_zeta=true}|VARid->letr=red.r_constin{redwithr_const={rwithtr_var=Id.Pred.addidr.tr_var}}letred_subred=function|BETA->{redwithr_beta=false}|DELTA->{redwithr_delta=false}|CONSTkn->letr=red.r_constin{redwithr_const={rwithtr_cst=Cpred.removeknr.tr_cst}}|PROJp->letr=red.r_constin{redwithr_const={rwithtr_prj=PRpred.removepr.tr_prj}}|MATCH->{redwithr_match=false}|FIX->{redwithr_fix=false}|COFIX->{redwithr_cofix=false}|ZETA->{redwithr_zeta=false}|VARid->letr=red.r_constin{redwithr_const={rwithtr_var=Id.Pred.removeidr.tr_var}}letred_sub_list=List.fold_leftred_subletred_add_list=List.fold_leftred_addletred_transparentred=red.r_constletred_add_transparentredtr={redwithr_const=tr}letmkflags=List.fold_leftred_addno_redletmkfullflags=List.fold_leftred_add{no_redwithr_const=TransparentState.full}letred_setred=function|BETA->red.r_beta|CONSTkn->is_transparent_constantred.r_constkn|PROJp->is_transparent_projectionred.r_constp|VARid->is_transparent_variablered.r_constid|ZETA->red.r_zeta|MATCH->red.r_match|FIX->red.r_fix|COFIX->red.r_cofix|DELTA->(* Used for Rel/Var defined in context *)red.r_deltaletred_projectionredp=ifProjection.unfoldedpthentrueelsered_setred(fPROJ(Projection.reprp))letall=mkfullflags[fBETA;fDELTA;fZETA;fMATCH;fFIX;fCOFIX]letallnolet=mkfullflags[fBETA;fDELTA;fMATCH;fFIX;fCOFIX]letbeta=mkflags[fBETA]letbetadeltazeta=mkfullflags[fBETA;fDELTA;fZETA]letbetaiota=mkflags[fBETA;fMATCH;fFIX;fCOFIX]letbetaiotazeta=mkflags[fBETA;fMATCH;fFIX;fCOFIX;fZETA]letbetazeta=mkflags[fBETA;fZETA]letdelta=mkfullflags[fDELTA]letzeta=mkflags[fZETA]letnored=no_red