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) *)(************************************************************************)openUtilopenNamegenopenTermopsopenReductionopsopenTypingopenTacredopenLogicopenContext.Named.DeclarationmoduleNamedDecl=Context.Named.Declaration(* Variants of [Tacmach] functions built with the new proof engine *)letprojectgl=Proofview.Goal.sigmaglletpf_applyfgl=f(Proofview.Goal.envgl)(projectgl)letpf_env=Proofview.Goal.envletpf_concl=Proofview.Goal.conclletpf_type_ofglt=pf_applytype_ofgltletpf_conv_xglt1t2=pf_applyis_convglt1t2letpf_ids_of_hypsgl=(* We only get the identifiers in [hyps] *)lethyps=Proofview.Goal.hypsglinids_of_named_contexthypsletpf_ids_set_of_hypsgl=(* We only get the identifiers in [hyps] *)letenv=Proofview.Goal.envglinEnviron.ids_of_named_context_val(Environ.named_context_valenv)letpf_get_new_ididgl=letids=pf_ids_set_of_hypsglinnext_ident_awayididsletpf_get_hypidgl=lethyps=Proofview.Goal.envglinletsigma=projectglinletsign=tryEConstr.lookup_namedidhypswithNot_found->raise(RefinerError(hyps,sigma,NoSuchHypid))insignletpf_get_hyp_typidgl=pf_get_hypidgl|>NamedDecl.get_typeletpf_hyps_typesgl=letenv=Proofview.Goal.envglinletsign=Environ.named_contextenvinList.map(functionLocalAssum(id,x)|LocalDef(id,_,x)->id.Context.binder_name,EConstr.of_constrx)signletpf_last_hypgl=lethyps=Proofview.Goal.hypsglinList.hdhypsletpf_nf_concl(gl:Proofview.Goal.t)=(* We normalize the conclusion just after *)letconcl=Proofview.Goal.conclglinletsigma=projectglinnf_evarsigmaconclletpf_whd_allglt=pf_applywhd_allgltletpf_get_type_ofglt=pf_applyRetyping.get_type_ofgltletpf_hnf_constrglt=pf_applyhnf_constrgltletpf_hnf_type_ofglt=pf_whd_allgl(pf_get_type_ofglt)letpf_computeglt=pf_applycomputegltletpf_whd_computeglt=pf_applywhd_computegltletpf_nf_evarglt=nf_evar(projectgl)topenPpletpr_glsgl=letsigma=projectglinletenv=pf_envglinletconcl=Proofview.Goal.conclglinletpenv=Termops.Internal.print_named_contextenvsigmainletpc=Termops.Internal.print_constr_envenvsigmaconclinletg=str" "++hv0(penv++fnl()++str"============================"++fnl()++str" "++pc)++fnl()inhov0(pr_evar_map(Some2)envsigma++fnl()++g)