12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455(************************************************************************)(* * 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=letopenMltopinletmk_pathprefix=coq_path^"/"^prefixinletmk_lp~ml~root~dir~implicit={recursive=true;path_spec=VoPath{unix_path=mk_pathdir;coq_path=root;has_ml=ml;implicit;};}in(* in 8.8 we can use Libnames.default_* *)letcoq_root=Names.DirPath.make[Libnames.coq_root]inletdefault_root=Libnames.default_root_prefixin[mk_lp~ml:AddRecML~root:coq_root~implicit~dir:"plugins";mk_lp~ml:AddNoML~root:coq_root~implicit~dir:"theories";mk_lp~ml:AddRecML~root:default_root~implicit:false~dir:"user-contrib";](******************************************************************************)(* 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