(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* raise (RefinerError (hyps, sigma, NoSuchHyp id)) in sign let pf_get_hyp_typ id gl = pf_get_hyp id gl |> NamedDecl.get_type let pf_hyps_types gl = let env = Proofview.Goal.env gl in let sign = Environ.named_context env in List.map (function LocalAssum (id,x) | LocalDef (id,_,x) -> id.Context.binder_name, EConstr.of_constr x) sign let pf_last_hyp gl = let hyps = Proofview.Goal.hyps gl in List.hd hyps let pf_nf_concl (gl : Proofview.Goal.t) = (* We normalize the conclusion just after *) let concl = Proofview.Goal.concl gl in let sigma = project gl in nf_evar sigma concl let pf_whd_all gl t = pf_apply whd_all gl t let pf_get_type_of gl t = pf_apply Retyping.get_type_of gl t let pf_hnf_constr gl t = pf_apply hnf_constr gl t let pf_hnf_type_of gl t = pf_whd_all gl (pf_get_type_of gl t) let pf_compute gl t = pf_apply compute gl t let pf_whd_compute gl t = pf_apply whd_compute gl t let pf_nf_evar gl t = nf_evar (project gl) t open Pp let pr_gls gl = let sigma = project gl in let env = pf_env gl in let concl = Proofview.Goal.concl gl in let penv = Termops.Internal.print_named_context env sigma in let pc = Termops.Internal.print_constr_env env sigma concl in let g = str" " ++ hv 0 (penv ++ fnl () ++ str "============================" ++ fnl () ++ str" " ++ pc) ++ fnl () in hov 0 (pr_evar_map (Some 2) env sigma ++ fnl () ++ g)