1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495(************************************************************************)(* * 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."])|Guardedkn->Pp.(seq[Names.Constant.printkn;str"is positive."])|TemplatePolymorphicm->Pp.(seq[Printer.pr_inductiveenv(m,0);spc();strbrk"is assumed template polymorphic on all its universe parameters."])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)]))