Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file sertop_arg.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198(************************************************************************)(* * 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 *)(************************************************************************)openCmdliner[@@@ocaml.warning"-44-45"]letprelude=letdoc="Load Coq.Init.Prelude from $(docv); plugins/ and theories/ should live there."inArg.(value&optstringCoq_config.coqlib&info["coqlib"]~docv:"COQPATH"~doc)letrequire_lib=letdoc="Coq module to require."inArg.(value&opt(somestring)None&info["require-lib"]~doc)letstr_pp=letdoc="Pretty-print constr strings."inArg.(value&flag&info["str-pp"]~doc)letde_bruijn=letdoc="Print constrs with de Bruijn indices."inArg.(value&flag&info["de-bruijn"]~doc)letbody=letdoc="Print bodies of constrs."inArg.(value&flag&info["body"]~doc)letasync=letdoc="Enable async support using Coq binary $(docv) (experimental)."inArg.(value&opt(somestring)None&info["async"]~doc~docv:"COQTOP")letquick=letdoc="Skip checking opaque proofs (very experimental)."inArg.(value&flag&info["quick"]~doc)letasync_full=letdoc="Enable Coq's async_full option."inArg.(value&flag&info["async-full"]~doc)letdeep_edits=letdoc="Enable Coq's deep document edits option."inArg.(value&flag&info["deep-edits"]~doc)letasync_workers=letdoc="Maximum number of async workers."inArg.(value&optint3&info["async-workers"]~doc)leterror_recovery=letdoc="Enable Coq's error recovery inside tactics and commands."inArg.(value&flag&info["error-recovery"]~doc)letimplicit_stdlib=letdoc="No-op (used to allow loading unqualified stdlib libraries, which is now the default)."inArg.(value&flag&info["implicit"]~doc)letprint_args=letopenSertop_serinArg.(enum["sertop",SP_Sertop;"human",SP_Human;"mach",SP_Mach])letprint_args_doc=Arg.doc_alts["sertop, a custom printer (UTF-8 with emacs-compatible quoting)";"human, sexplib's human-format printer (recommended for debug sessions)";"mach, sexplib's machine-format printer"]letprinter=letopenSertop_serin(* XXX Must improve argument information *)(* let doc = "Select S-expression printer." in *)Arg.(value&optprint_argsSP_Sertop&info["printer"]~doc:print_args_doc)letdebug=letdoc="Enable debug mode for Coq."inArg.(value&flag&info["debug"]~doc)letdisallow_sprop=letdoc="Forbid using the proof irrelevant SProp sort (allowed by default)"inArg.(value&flag&info["disallow-sprop"]~doc)letindices_matter=letdoc="Levels of indices (and nonuniform parameters) contribute to the level of inductives (disabled by default)"inArg.(value&flag&info["indices-matter"]~doc)letprint0=letdoc="End responses with a \\\\0 char."inArg.(value&flag&info["print0"]~doc)letlength=letdoc="Emit a byte-length header before output. (deprecated)."inArg.(value&flag&info["length"]~doc)(* We handle the conversion here *)letno_init=letdoc="Omits the creation of a new document; this means the user \
will have to call `(NewDoc ...)` before Coq can be used \
and set there the proper loadpath, requires, ..."inArg.(value&flag&info["no_init"]~doc)lettopfile=letdoc="Set the toplevel name as though compiling $(docv)"inArg.(value&opt(somestring)None&info["topfile"]~doc~docv:"TOPFILE")letno_prelude=letdoc="Omits requiring any module on start, thus `Prelude`, ltac, etc... won't be available"inArg.(value&flag&info["no_prelude"]~doc)letcoq_lp_conv~implicit(unix_path,lp)=Loadpath.{coq_path=Libnames.dirpath_of_stringlp;unix_path;has_ml=true;recursive=true;implicit}letrload_path:Loadpath.vo_pathlistTerm.t=letdoc="Bind a logical loadpath LP to a directory DIR and implicitly open its namespace."inTerm.(constList.(map(coq_lp_conv~implicit:true))$Arg.(value&opt_all(pairdirstring)[]&info["R";"rec-load-path"]~docv:"DIR,LP"~doc))letload_path:Loadpath.vo_pathlistTerm.t=letdoc="Bind a logical loadpath LP to a directory DIR"inTerm.(constList.(map(coq_lp_conv~implicit:false))$Arg.(value&opt_all(pairdirstring)[]&info["Q";"load-path"]~docv:"DIR,LP"~doc))letml_include_path:stringlistTerm.t=letdoc="Include DIR in default loadpath, for locating ML files"inArg.(value&opt_alldir[]&info["I";"ml-include-path"]~docv:"DIR"~doc)(* Low-level serialization options for display *)letomit_loc:boolTerm.t=letdoc="[debug option] shorten location printing"inArg.(value&flag&info["omit_loc"]~doc)letomit_att:boolTerm.t=letdoc="[debug option] omit attribute nodes"inArg.(value&flag&info["omit_att"]~doc)letexn_on_opaque:boolTerm.t=letdoc="[debug option] raise an exception on non-serializeble terms"inArg.(value&flag&info["exn_on_opaque"]~doc)(* sertop options *)typecomp_mode=|C_parse|C_stats|C_print|C_sexp|C_check|C_vo|C_envletcomp_mode_args=Arg.(enum["parse",C_parse;"stats",C_stats;"print",C_print;"sexp",C_sexp;"check",C_check;"vo",C_vo;"kenv",C_env])letcomp_mode_doc=Arg.doc_alts["parse: parse the file and remain silent (except for Coq output)";"stats: output stats on the input file";"print: output using the Coq pretty printer";"sexp: output serialized version of the input file";"check: check proofs in the file and remain silent (except for Coq output)";"vo: check proofs and output .vo version of the input file";"kenv: check proofs and output the final kernel enviroment"]letcomp_mode=Arg.(value&optcomp_mode_argsC_parse&info["mode"]~doc:comp_mode_doc)typecomp_input=|I_vernac|I_sexpletcomp_input_args=Arg.(enum["vernac",I_vernac;"sexp",I_sexp])letcomp_input_doc=Arg.doc_alts["vernac: Coq vernacular";"sexp: serialized Coq vernacular"]letcomp_input=Arg.(value&optcomp_input_argsI_vernac&info["input"]~doc:comp_input_doc)