(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *)(************************************************************************) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \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) *) (************************************************************************)
let
prerr_endline;
let error_missing_arg s =
prerr_endline":extraargument expected after option""")
prerr_endlineSeeforsyntax .;
exit 1
let error_debug java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
prerr_endline:java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
prerr_endline "For an OCaml backtrace use -bt instead.";
prerr_endline "See -help rcfile : string option;
exit
type ={
profile stringoptionjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
;
type_in_type : bool;
rewrite_rules : bool;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
:bool
ml_includes list
type coqargs_config = {
logic : coqargs_logic_config;
rcfile :stringoption;
coqlib : stringoption;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
native_compilerdefault_logic_config
native_output_dir:.physical_path
indices_matter;
= ;
TopLogicaldefault_topleveljava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
beautify : bool ;
=true
fig;
test_mode ="coq-native;
profilenative_include_dirs[;
print_emacsbool
}
type (* Quiet / verbos should here)
| Queries of Boot.Usage.query list
| Run
typeload_rcfile=true;
memory_stat : bool
}
type t={
config : coqargs_config;
pre : coqargs_pre;
main : coqargs_main;
post load_vernacular_list ]java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}
let
let default_native = Coq_config.native_compiler
let pre = default_pre = default_pre = Run;
java.lang.StringIndexOutOfBoundsException: Range [80, 25) out of bounds for length 25
let default_config = {
logic = default_logic_config;
rcfile ;
coqlib = None;
enable_VMt;
default_native
native_output_dir =
native_include_dirs because four make,even
areaccessible the at .The the
exclude_dirs = [];
beautify = false;
quiet = false;
time ;
test_mode , java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
|-N =}
print_emacs = |(n" )-
(* Quiet / verbosity options should be here *)expected native-compiler
}
let default_post = {
memory_stat = letparse_args stringlist
}letargs java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
let default |[ >
config = default_config;
pre = default_pre(,. extras
;
args;
}
(******************************************************************************) let add_ml_include opts s =
{ opts
unix_path implicit let v = { unix_path; rocq_pathjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{opts pre .pre v :.pre }
let add_vo_require opts l d
{opts {. {=dprefixexport}:opts. }
let add_load_vernacular opts verb s =
{ opts with pre = { opts.pre with load_vernacular_list = (CUnix.make_suffix s ".v",verb) :: opts.pre.load_vernacular_list }}
let add_set_option opts opt_name value =
{ opts with pre = { oval java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
let add_set_debug opts flags =
add_set_option opts (* -R Coq ... is only used by Dune in conjunction with the -boot
(** Options for proof general *)
updated let optsadd_vo_include p
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
let foval
{ oval with}java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
let set_query opts q =
{ opts with main = match opts.main with
|Run>Queriesdefault_queries[]java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
queries>Queries queries)
}
(******************************************************************************) (* Parsing helpers *) (******************************************************************************) let get_bool ~opt = function.config =next: .config }}
| " |"-i"- withconfig . withrcfile = Some Some (;}
-
error_wrong_arg ("Error: yes/no expected after option "^opt oval ( (java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
try int_of_string withFailure-java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
error_wrong_arg": integer expecteda option "opt" let get_int_opt ~opt n = if [Mangle Names ]OptionSet( ))) else Some (get_int ~opt n)
let get_float ~opt n = try float_of_string n
let= oval[LtacProfiling( None
error_wrong_arg ovalLtac ;"" ( Somenext())
let to_opt_key = Str.(split (regexp
let parse_option_set opt = match. opt=with
| None -> to_opt_key opt, None
| |-"|-"- next Some) let len -"|-" >add_vo_require next)None Export let . opteqi)(len eqi-1 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
to_opt_key.sub 0eqi v
let get_native_compiler s = (* We use two boolean flags because the four states make sense, even if only three are accessible to the user at the moment. The selection of the produced artifact(s) (`.vo`, `.coq-native`, ...) should be done by a separate flag, and the "ondemand" value removed. Once this is done, use
[get_bool] here. *) let n = match s with
| ("yes" | "on") -> NativeOn {ondemand=false}
| "ondemand"
| _ ->from (((from )
error_wrong_argjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 in if n = NativeOff then n, elselettopname ( java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
error_wrong_arg"Need non toplevel name"java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 else n . with
(* Main parsing routine *) (*s Parsing of the command line *)
let parse_args ~init arglist : t * stringlist = let args = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 let =ref]in let rec parse oval = match !args with
>
(oval, List.rev !extras none add_set_optionoval[" OptionSet( w)
| opt :: rem ->
: ; let next () = match !args with
| x:: config .config = get_boolopt( ()}
|]- opt in let noval = beginmatch opt let,w = ( ()in
(* Complex options with many args *)
oval (()
|"-Q" -> letjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 let p = next () in let dirFilename dirthen Filename.concat (Sys.getcwd ()) dir else dir in
add_vo_include oval d p false
|-"- let d = next letp next ( in let p = ifString.equal include_dir ()in (* -R Coq ... is only used by Dune in conjunction with the -boot option. The above line should be removed once we require an
updated version of Dune. *)
add_vo_include(* Options with zero arg *)|test-mode oval . = truejava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
(* Options with one arg *)
|">
{ oval with config = { oval.config with ( "" D > (()
|"-compat" ->
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 let rocq_name|e"- java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 (* remove the above and replace by "Rocq" once theories/Compat/Coq820.v is removed *) String"rocq_name :arg in
add_vo_require oval xy ~allow_failure:"disallow-sprop"-
|->
{ oval with config "allow-rewrite-rules"> fun>{ rewrite_rules ) java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
"require-from""rfrom >
from ( add_vo_require ( () (Some)None
|"-compat-from" -> let from
|"-require-import-from" | "-rifrom" -> let , =parse_args~ args
|"-require-export-from" | "-refrom" { with let from ={optspre
"top > let topname = next () in
. topname
error_wrong_arg "Need a non empty toplevel module name.";
with
config = {
.config
logic = {
ovaljava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
toplevel_name= }}
|"-topfile" ->
{ oval with config = { java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
|"-w" | "-W" -> letw= next ( in
_ ""(w) else add_set_option oval ["Warnings"] (OptionSet (Some w))
|"-bytecode-compiler" ->
{ oval with config = { oval.config with enable_VM = get_bool ~opt (next ()) }}
|"-native-compiler" -> let native_compiler, warn = get_native_compiler (next ()) in
{ oval with config = { oval.config with native_compiler };
pre = { oval.pre with injections = warn @ oval.pre.injections }}
| "-set" -> let opt, v = parse_option_set @@ next() in
add_set_option oval opt (OptionSet v)
| "-unset" ->
add_set_option oval (to_opt_key @@ next ()) OptionUnset
|"-native-output-dir" -> let native_output_dir = next () in
{ oval with config = { oval.config with native_output_dir } }
|"-output-dir" | "-output-directory" -> let dir = next () in let dir = if Filename.is_relative dir then Filename.concat (Sys.getcwd ()) dir else dir in
{ oval with config = { oval.config with output_directory = Some dir } }
|"-nI" -> let include_dir = next () in
{ oval with config = {oval.config with native_include_dirs = include_dir :: oval.config.native_include_dirs } }
(* Options with zero arg *)
|"-test-mode" -> { oval with config = { oval.config with test_mode = true } }
|"-beautify" -> { oval with config = { oval.config with beautify = true } }
|"-config"|"--config" -> set_query oval PrintConfig
|"-diffs" ->
add_set_option oval ["Diffs"] @@ OptionSet (Some (next ()))
|"-emacs" -> set_emacs oval
|"-impredicative-set" ->
set_logic (fun o -> { o with impredicative_set = true }) oval
|"-allow-sprop" ->
add_set_option oval ["Allow"; "StrictProp"] (OptionSet None)
|"-disallow-sprop" ->
add_set_option oval ["Allow"; "StrictProp"] OptionUnset
|"-allow-rewrite-rules" -> set_logic (fun o -> { o with rewrite_rules = true }) oval
|"-indices-matter" -> set_logic (fun o -> { o with indices_matter = true }) oval
|"-m"|"--memory" -> { oval with post = { memory_stat = true }}
|"-noinit"|"-nois" -> { oval with pre = { oval.pre with load_init = false }}
|"-boot" -> { oval with pre = { oval.pre with boot = true }}
|"-profile-ltac" -> add_set_option oval ["Ltac"; "Profiling"] (OptionSet None)
|"-q" -> { oval with pre = { oval.pre with load_rcfile = false; }}
|"-quiet"|"-silent" -> { oval with config = { oval.config with quiet = true } }
|"-time" -> { oval with config = { oval.config with time = Some ToFeedback }}
|"-time-file" -> { oval with config = { oval.config with time = Some (ToFile (next())) }}
| "-profile" -> { oval with config = { oval.config with profile = Some (next()) } }
|"-type-in-type" -> set_logic (fun o -> { o with type_in_type = true }) oval
|"-unicode" -> add_vo_require oval "Utf8_core" None (Some Import)
|"-where" -> set_query oval PrintWhere
|"-h"|"-H"|"-?"|"-help"|"--help" -> set_query oval PrintHelp
|"-v"|"--version" -> set_query oval PrintVersion
|"-print-version"|"--print-version" -> set_query oval PrintMachineReadableVersion
(* Unknown option *)
| s ->
extras := s :: !extras;
oval endin
parse noval in
parse init
(* We need to reverse a few lists *) let parse_args ~init args = let opts, extra = parse_args ~init args in let opts =
{ opts with
pre = { opts.pre with
ml_includes = List.rev opts.pre.ml_includes
; vo_includes = List.rev opts.pre.vo_includes
; load_vernacular_list = List.rev opts.pre.load_vernacular_list
; injections = List.rev opts.pre.injections
}
} in
opts, extra
(******************************************************************************) (* Startup LoadPath and Modules *) (******************************************************************************)
(* prelude_data == From Corelib Require Import Prelude. *) let prelude_data = RequireInjection { lib = "Prelude"; prefix = Some "Corelib"; export = Some Import; allow_failure = false }
let injection_commands opts = if opts.pre.load_init then prelude_data :: opts.pre.injections else opts.pre.injections
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.