123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657(************************************************************************)(* * 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^"/"^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";]@List.map(fundir->mk_lp~ml:AddRecML~root: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