123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)(* <O___,, * (see CREDITS file for the list of authors) *)(* \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) *)(************************************************************************)(************************************************************************)(* Coq serialization API/Plugin *)(* Copyright 2016-2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias *)(************************************************************************)(* Status: Very Experimental *)(************************************************************************)typeax_ctx=(Names.Label.t*Constr.rel_context*Constr.t)listtypet={predicative:Declarations.set_predicativity;type_in_type:bool;vars:(Names.Id.t*Constr.t)list;axioms:(Printer.axiom*Constr.t*ax_ctx)list;opaque:(Names.Constant.t*Constr.t)list;trans:(Names.Constant.t*Constr.t)list}letbuildenvctxmap=letopenPrinterinletfoldttypaccu=let(v,a,o,tr)=accuinmatchtwith|Variableid->((id,typ)::v,a,o,tr)|Axiom(axiom,l)->(v,(axiom,typ,l)::a,o,tr)|Opaquekn->(v,a,(kn,typ)::o,tr)|Transparentkn->(v,a,o,(kn,typ)::tr)inlet(vars,axioms,opaque,trans)=ContextObjectMap.foldfoldctxmap([],[],[],[])in{predicative=Environ.engagementenv;type_in_type=Environ.type_in_typeenv;vars;axioms;opaque;trans}letprintenvsigma{predicative;type_in_type;vars;axioms;opaque;trans}=letpr_engamente=matchewith|Declarations.ImpredicativeSet->Pp.str"Set is Impredicative"|Declarations.PredicativeSet->Pp.str"Set is Predicative"inletpr_varenvsigma(id,typ)=Pp.(seq[Names.Id.printid;str" : ";Printer.pr_ltype_envenvsigmatyp])inletpr_constantenvsigma(cst,typ)=Pp.(seq[Names.Constant.printcst;str" : ";Printer.pr_ltype_envenvsigmatyp])inletpr_axiomenvsigma(ax,typ,lctx)=letpr_axenvsigmatypa=letopenPrinterinmatchawith|Constantkn->Pp.(seq[Names.Constant.printkn;str" : ";Printer.pr_ltype_envenvsigmatyp])|Positivem->Pp.(seq[Printer.pr_inductiveenv(m,0);str"is positive."])|Guardedgr->Pp.(seq[Printer.pr_globalgr;str"is positive."])|TypeInTypegr->Pp.(seq[Printer.pr_globalgr;spc();strbrk"relies on an unsafe hierarchy."])|UIPm->Pp.(seq[Printer.pr_inductiveenv(m,0);spc();strbrk"relies on UIP."])inPp.(seq[pr_axenvsigmatypax;prlist(fun(lbl,ctx,ty)->str" used in "++Names.Label.printlbl++str" to prove:"++Printer.pr_ltype_envEnviron.(push_rel_contextctxenv)sigmaty)lctx])inPp.(v0(prlist_with_sep(fun_->cut())(funx->x)[iftype_in_typethenstr"type_in_type is on"elsemt();pr_engamentpredicative;hov1(prlist(pr_varenvsigma)vars);hov1(prlist(pr_constantenvsigma)opaque);hov1(prlist(pr_constantenvsigma)trans);hov1(prlist(pr_axiomenvsigma)axioms)]))