12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061(************************************************************************)(* * 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-2018 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias *)(************************************************************************)(* Status: Very Experimental *)(************************************************************************)(******************************************************************************)(* Coq Prelude Loading Defaults (to be improved) *)(******************************************************************************)letcoq_loadpath_default~implicit~coq_path=letopenLoadpathinletmk_pathprefix=coq_path^"/"^prefixin(* let mk_ml = () in *)letmk_vo~has_ml~coq_path~dir~implicit={unix_path=mk_pathdir;coq_path;has_ml;recursive=true;implicit}in(* in 8.8 we can use Libnames.default_* *)letcoq_root=Names.DirPath.make[Libnames.coq_root]inletdefault_root=Libnames.default_root_prefixinletml_paths=letplugins_dirs=System.all_subdirs~unix_path:(mk_path"plugins")inList.mapfstplugins_dirsinml_paths,[mk_vo~has_ml:false~coq_path:coq_root~implicit~dir:"theories";mk_vo~has_ml:true~coq_path:default_root~implicit:false~dir:"user-contrib";]@List.map(fundir->mk_vo~has_ml:true~coq_path:default_root~implicit:false~dir)Envars.coqpath(******************************************************************************)(* Generate a module name given a file *)(******************************************************************************)letdirpath_of_filef=letldir0=tryletlp=Loadpath.find_load_path(Filename.dirnamef)inLoadpath.logicallpwithNot_found->Libnames.default_root_prefixinletfile=Filename.chop_extension(Filename.basenamef)inletid=Names.Id.of_stringfileinLibnames.add_dirpath_suffixldir0id