123456789101112131415161718(* A more advanced example of how to explore the structure of terms of
type constr is given in the coq-dpdgraph plugin. *)letsimple_body_accessgref=letopenNames.GlobRefinmatchgrefwith|VarRef_->failwith"variables are not covered in this example"|IndRef_->failwith"inductive types are not covered in this example"|ConstructRef_->failwith"constructors are not covered in this example"|ConstRefcst->letcb=Environ.lookup_constantcst(Global.env())inmatchGlobal.body_of_constant_bodyLibrary.indirect_accessorcbwith|Some(e,_,_)->EConstr.of_constre|None->failwith"This term has no value"