1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192(************************************************************************)(* * 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's serialization API *)(* Copyright 2016-2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *)(* Copyright 2019-2022 Inria -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias, Karl Palmskog *)(************************************************************************)letfatal_exnexninfo=letloc=Loc.get_locinfoinletmsg=Pp.(pr_opt_no_spcLoc.prloc++fnl()++CErrors.iprint(exn,info))inFormat.eprintf"Error: @[%a@]@\n%!"Pp.pp_withmsg;exit1letcreate_document~debug~disallow_sprop~ml_path~load_path~rload_path~quick~in_file~indices_matter~omit_loc~omit_att~exn_on_opaque~omit_env~coq_path~async~async_workers~error_recovery=(* initialization *)letoptions=Serlib.Serlib_init.{omit_loc;omit_att;exn_on_opaque;omit_env}inSerlib.Serlib_init.init~options;letdft_ml_path,vo_path=Serapi.Serapi_paths.coq_loadpath_default~implicit:true~coq_pathinletml_path=dft_ml_path@ml_pathinletvo_path=vo_path@load_path@rload_pathinletallow_sprop=notdisallow_spropinletstm_flags={Sertop_init.enable_async=async;deep_edits=false;async_workers=async_workers;error_recovery}inletopenSertop_initin(* coq initialization *)coq_init{fb_handler=(fun__->())(* XXXX *);plugin_load=None;debug;allow_sprop;indices_matter;ml_path;vo_path}Format.std_formatter;(* document initialization *)letstm_options=process_stm_flagsstm_flagsinletstm_options={stm_optionswithasync_proofs_tac_error_resilience=FNone;async_proofs_cmd_error_resilience=false}in(* Disable due to https://github.com/ejgallego/coq-serapi/pull/94 *)letstm_options={stm_optionswithasync_proofs_tac_error_resilience=FNone;async_proofs_cmd_error_resilience=false}inletstm_options=ifquickthen{stm_optionswithasync_proofs_mode=APonLazy}elsestm_optionsinletinjections=[Coqargs.RequireInjection("Coq.Init.Prelude",None,SomeLib.Import)]inletndoc={Stm.doc_type=Stm.VoDocin_file;injections;stm_options}in(* Workaround, see
https://github.com/ejgallego/coq-serapi/pull/101 *)ifquick||stm_flags.enable_async<>NonethenSafe_typing.allow_delayed_constants:=true;Stm.new_docndoc