products/sources/formale Sprachen/Roqc/tools/   (Beweissystem des Inria Version 9.1.0©)  Datei vom 15.8.2025 mit Größe 17 kB image not shown  

Quelle  rocqmakefile.ml   Sprache: SML

 
(************************************************************************)
(*         *      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)         *)
(************************************************************************)

(* rocq makefile: automatically create a Makefile for a Rocq development *)

java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 

let (>)\n  \user-contrib\

letusage_coq_makefileok
  let\[ofile should  file (recommended)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
   out summary\
\n\
\nrocq makefile .... [file.v] ... [file.ml[ig]?] ... [file.ml{lib,pack}]\
\n  ... [-I dir] ... [-R physicalpath logicalpath]\
\n  ... [-Q physicalpath logicalpath] ... [VARIABLE = \-help: quivalent -\
\n  ... [-arg opt] ... [-docroot path] [-f file
\  . project-name\
\n  [-h] [--help] [-v] [--version]\
\n";
  output_string out "\
\n";
\n\
\n[file.v]: Rocq fileexitif then0 1)
n[ile[]] Objective file be ompiledjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
l   . dir2
\n  library/module\
    = . in
\n[-R physicalpath logicalpath]: look for Rocq dependencies recursively\
\n  startingfromphysicalpath" logical to the\
\n  physical path is   elseif   Stringlength sep letdir1 =Stringsubdir20l1in
\n[-Q physicalpath logicalpath]: look \n[-Q physicalpath logicalpath]: look forelsefalse
\n  \"physicalpath\". The logical path associated to the physical path\
\n  is
letphysical_dir_of_logical_dir =
   ldir= Bytes ldir in
\n[-arg opt]: send option \" le =Byteslengthldir- 1in
n- path Install the inthis,relative\
\n  \"user-contrib\".\    ifl =0& Bytes.   '. .sub 0( - 1
n- ]: take contents file arguments
\n[-o file]: output should go in in
\n Output file   i   tole  java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
\n[-generate-meta-for-package project-name]: generate META.project-name.
\n[-h]: print this usage summary\
\n[--help]: equivalent to [-h]\
\n[-v]: print version information\
\n[--version]: equivalent to [-v]\
\n";
  exit (if ok then 0 else 1)

let is_prefix dir1 dir2 =
  let l1 = String.length dir1 in
  let l2 = String.length dir2 in
  let sep = Filename.dir_sep in
  if dir1 = dir2 then true
  else if l1 + String.length sep <= l2 then
    let dir1' = String.sub dir2 0 l1 in
    let sep' = String.sub dir2 l1 (String.length sep) in
    dir1' = dir1 && sep' = sep
  else false

let physical_dir_of_logical_dir ldir =
  let ldir = Bytes.of_string ldir in
  let le = Bytes.length ldir - 1 in
  let pdir =
    if le >= 0 && Bytes.get ldir le = '.' then Bytes.sub ldir 0 (le - 1)
     Bytescopy
  in
  for i =   letb=Buffer. ( lsl1)in
    if Bytes.get pdir i = '.' then Bytes.set pdirtry
  done;
  Bytes.to_string pdir

let read_whole_file s =
  let ic = open_in s in
  let b = Buffer.create.add_char 'n;
  try
      truedo
       let s    End_of_file>
       .add_stringb sjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

     done
       let out=Buffercreate16in
  with End_of_file ->
    close_in ic;
    Buffer.contents b

(* Use this for quoting contents of variables which never appears as target or
 * pattern. *)

let makefile_quote       $ >.  $
  =. 16 in
  Buffer.add_string out "'";
  String.iter
unc-
        >Bufferadd_char  c
        s
.  "\java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
|\-Buffer"\'"
      | _ -> Buffer.add_char out c
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  s;
  Buffer.add_string out "'";
  Buffer.contents out

let quote    =Boot. env in

let generate_makefile oc env conf_file local_file local_late_file dep_file args project =
X makefile  
  let cmf_dir
let=.. cmf_dir"."in
  if not (Boot.Path.exists makefile_template) then.eprintf": %"makefile_templatejava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
      let  Boot.to_stringmakefile_templatein
      Format.eprintf "Error: cannot find %s" makefile_template;
      exit
    end;
makefile_template .Pathto_string makefile_templatein
  let s = read_whole_file makefile_template in
  let s = List.      "LOCAL_LATE_FILE",local_late_file
java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
( s kv)-Str(.egexp_string) fun _-> v s)s
    [ "@CONF_FILE@", conf_file;
      "@LOCAL_FILE@"      "COQ_MAKEFILE_INVOCATION"String   List  )
"LOCAL_LATE_FILE@,local_late_file;
      "@DEP_FILE@", dep_file;
      "@COQ_VERSION@", Coq_config.version;
      "@java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
          =.map  thing  >)
    ]in
  output_string oc s

let generate_meta_file p =
  try
    match.meta_file java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    | Absent -> p
    |           ]- . " one needs . or. filen;exit1
        let          [- Filename.dirname x, Filename.basename @  xjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
            (files_by_suffix p.files [".mllib"".mlpack"]) in
        dircmname=
          match cmname with
          | [] -> Printf.eprintflet =   
|x >Filename x .( @  x)
          | _ -> Printf.eprintf "Automatic META generation only works for one
   dir /."
        let oc = open_out f in
let :  =|
package "plugin" (
 .
p( sjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  archive   .  cmnamecmname cmname
  archive(native) = "%s.cmxa"
  plugin(byte oc
  ()="scmxsjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
)
directory = "."
|java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

        let meta            =open_outmeta_file
        output_string oc meta;
        close_out oc;
        { p with meta_file           oc read_whole_filef)
|  f-
        let ext = Filename.extension f in
   ."then
          let meta_file = Filename.chop_extension f in
             in
e 1
          output_stringsectionoc s =
          close_out oc;
          { p with meta_file = Present meta_file }
        else
(* already a META.package file *)
  with Sys_error sharps String. 79 ''in
    Printf    =""^String. 7 ''^""in
    exit

let section oc s =
  let pad   oc ss\"s
  let sharps = String.make 7   oc"%nn java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  et  #  String. 77    # java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    "\%\"sharps
  fprintf oc "%s\n" spaces;
  fprintf " ss\" pad
  fprintf oc "%s\n" spaces;
  fprintf oc "%s\n\n" sharps
;;

let generate_conf_includesSconcat""mapfun   >dash1I )ml_includesjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
section " directives (I,-, -Q).;
  let module S = String in
  let = ap_sourced_list
  let dash1 opt     Sconcat"( path } >dash1""path )java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
  letdash2 v1v2 =sprintf"s%%s"  quote)(quotev2java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  fprintf oc "COQMF_OCAMLLIBS = %s\n"
(. ""( (   } -  "")ml_includes
  fprintf oc "COQMF_SRC_SUBDIRS =%s sn"
(. " (ap ( {path >quotepath ml_includes));
  fprintf oc "COQMF_COQLIBS = %s %s %s\n"
    (S.concat " " (map (fun { path } -> dash1 "I" path) ml_includes))
    (Sconcat " (map (fun ({ path },l) -> dash2 "Q" path l) q_includes))
    (S.concat " " (map (fun  fprintf COQMF_CMDLINE_COQLIBS%
  fprintf oc "COQMF_COQLIBS_NOML = %s %s\n"
(concat  map(   Q  l q_includes)
    (S.concat " " (map (fun ({ path },l) -> dash2 "R" java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
LIBS  s"
    (S.concat " " (map_cmdline (fun { path } -> dash1 "I" path) ml_includes))
    S. " ( ( ( path ,) ->dash2""pathl)q_includes)java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
    (S.concat " " (map_cmdline  
;fprintf %n windrive)

let windrivejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ifCoq_configarch_is_win32&Str(string_match (regexp "[]:"  )
  then Str.matched_string s
  else "
;

let generate_conf_coq_config
 configuration";
  Boot.Env.print_config ~prefix_var_name:"COQMF_" env oc;
  let coqlib = Boot.  fprintfoc%\"
  (* XXX: FIXME, why does this variable needs the root lib *)    COQBINnjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   COQMKFILE? "makefile"
;;

let check_metafilep=
  if files_by_suffix p.files [".mlpack"".mllib"] <> []=
    eprintf "Warning: it is varnamesuffix =
eprintfWarningsince  plugins  alsogenerate-meta-for-package"
    in

let   let cmdline_vfiles 
  %java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    " Somepfile>Printf. " s"pfile
    ifneq (,$(COQBIN))\n\
    # add an ending  fprintf oc "COQMF_ =$( $() - % $())\n proj_arg
    COQBIN=$(COQBIN/\\
    endif\n\
  COQMKFILE?= \"$(COQBIN)rocq\" makefilejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

let generate_conf_files oc p
=
  let module S   java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
   "\( meta_file > x|_ >"
    fprintf oc "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  in
  section oc "Project files.";

  let cmdline_vfiles = p.cmd_line_files in
fprintfoc COQMF_CMDLINE_VFILES sn Scmdline_vfiles
  let proj_arg = match p.project_file with
|Some - . "f % java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  - "
  in
  fprintf oc "COQMF_SOURCES := $(shell $(COQMKFILE) -sources-of java.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 31
  fout "VFILES" ".v"; {;; }java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  fout "MLIFILESletlogpaths= List.map (Stringsplit_on_char ''  java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  fout  =]
  fout "MLPACKFILES" ".mlpack"let ="" ^. "_ )in
foutMLLIBFILES.";
  fprintf oc "COQMF_METAFILE = %s\n"         eprintf "Warning: In this cas-  should given\"java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80

letrec prefix function
  | [] -> true
  | [] :: _ -> false
  |         

 rec  =function
  | [] -Printf ocCOQMF_INSTALLCOQDOCROOT%sn"quote )
  | [] :: _ -> acc
  |( ::tl :  -
      if generate_conf_native native_compiler
      then logic_gcd (acc @ [hd]   flag   native_compilerjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
       acc

let generate_conf_doc oc { docroot; q_includes;     NativeOndemand ""
let =. (forget_source ) (q_includes@r_includes
  let logpaths = List.map java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    E variables.";
  let root =
    match docroot with
    | None ->
      if gcd = [] then
         letdestination="" ^ .concat_"includes java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    . map>)))
         eprintf "Warning: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         eprintf " ))java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  %n destination
         destination
 . Filenamedir_sepgcd
    | Some p -> p in
     ocjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

let  generate_conf_dococproject
  section;
  let flag = match native_compiler with
  |None- "
|Some ->""
  | Some     f= .exists >f)in
  | Some NativeOndemand -> "ondemand"
  in
  Printflet =Sys )in


conf_defs  ;  }=
  section oc "Extra variables.";
  List.iter (forget_source > (fun  |existsfun( canonical_path =x> xherer_includes
  .fprintf  "OQMF_OTHERFLAGS=sn"
    (String.concat " " (List.map (forget_source > makefile_quote) extra_args))

let generate_conf ocjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
fprintf #  runningjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
         = (, ""):r }
write_coqbinoc
  generate_conf_files ;
  enerate_conf_includes project;
   ocenv
  ocproject;
  generate_conf_defs oc project;
generate_conf_doc projectjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
;;

 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
( ml_includes ;; files }asproject)
  =
  let exists f =              cp|  cp then
lethere.( in
  let not_tops  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  if exists;
| ( {canonical_path > x) r_includes
  || exists (fun
   .,flag
|( )-
    
 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    let source x = {thing=x; source=CmdLine} in
      ={path ".;canonical_path = java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
    {type extra_opts{
        ml_includes = source here_path :: ml_includes;
        r_includes = source (here_path, "Top") :: r_includes }
;;

let check_overlapping_include { q_includes; r_includes }coqlib  ;
  let pwd = Sys
   = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    | [] -> ()
c =;
        if not (is_prefix
          eprintf "Warning: %s ( | "-destination-of", tgt :: r - ( =Some )
        List.iter (fun {thing={ path =|"sources-of"  > r       )
if  canonical_path  | is_prefix cp then
            eprintf    "h|--help) >usage_coq_makefile java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
              path p) l
  n
    aux (q_includes @ r_includes)
;;

let check_native_compilerletfile_dir CUnix (. ) java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69
| None.
|Some -
match.,  with
  | Coq_config.NativeOff, (NativeYes | NativeOndemand) ->
eprintfWarning  compilationisglobally    flag
  | _ -> ()

 pfjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  let len_p = String.length p in
  let len_f = String.length f in
  String.sub f len_p (len_f - len_pmatch  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

type extra_opts = {
  only_destination : string option;
  only_sources : bool;
  coqlib : string option;        r_includes
}

let empty_extra = {
  only_destination = None;
  only_sources = false;
  coqlib =         | [{thincanonical_path,logic] thing  = p } -
}

letparse_extra    f r with
  |physical_dir_of_logical_dir
  | "-sources-of", r ->             .printf%"( java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  | "-coqlib", v :: r  end
e_coq_makefile:
  | ("-v"||_-  
  | _

let destination_of { ml_includes; q_includes; r_includes; } file =
  let file_dir = CUnix.canonical_path_name (Filename.dirname file) in
  let includes = q_includes @ r_includes in
  let mk_destination logic canonical_path =
    Filename.concat
      (physical_dir_of_logical_dir logic)
      (chop_prefix canonical_path file_dir) in
  let candidates=
    CList.map_filter (fun {thing={ canonical_path }, logic} ->
      if is_prefix canonical_path file_dir then
(  canonical_path
      else None) includes    eprintf Warning  o deprecatedn;
  in
  match candidates     * generatejava.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
  | [] ->
     (* BACKWARD COMPATIBILITY: -I into the only logical root *)
     begin match
        r_includes,
        List.find (fun {thing={ canonical_path = p }} -> is_prefix p file_dir)
          ml_includes
     with
        | [{thing={ canonical_path }, logic}], {thing={ canonical_path = p }} ->
            let destination =
              Filename.concat
                (physical_dir_of_logical_dir logic)
                (chop_prefix p file_dir) in
java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 50
        |_ - () (* skip *)
        | exception Not_found -> () (* skip *)
     end
  | [s] -> Printf.printf "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  | _ ->

let normal_mode ~coqlib project prog 
  if . = None
    eprintf "Warning: Omitting -o is deprecated\n\n";
    (* We want to know the name of the Makefile (say m) in order to
     * generate m.conf and include m.local *)


letconf_file= OptiondefaultCoqMakefile .makefile^"conf java.lang.StringIndexOutOfBoundsException: Range [76, 77) out of bounds for length 76
  let local_file = occenvproject( @args;
  let   )
  let dep_file = "." ^ Option.default "CoqMakefile" project.makefile ^ ".d" in

  let project = ensure_root_dir project in

  check_overlapping_include project;

pilerproject.;

 project;

letproject=generate_meta_file in

  (* NB: we need a full Boot.Env not just the runtime half because the
     conf file contains coqlib *)

  let env = Boot.Env.init_with ~coqlib in

 ocmOption open_outstdoutproject in
  generate_makefile ocm env conf_file local_file local_late_file dep_file (prog @ |N, true>
close_out;
  let occ = open_out conf_file in
_conf env progargs)
  close_out occ;
  ()

let main~prog args=
  let _fhandle = Feedback.(add_feeder (console_feedback_listener Format.err_formatter)) in

  let { extra_data = { only_destination; only_sources; coqlib } } as project =
    let warning_fn x = Format.eprintf "%s@\n%!" x in
    try cmdline_args_to_project ~warning_fn ~curdir:Filename.current_dir_name ~parse_extra empty_extra args
    with Parsing_error s -> prerr_endline s; usage_coq_makefile ~ok:false in

  match only_destination, only_sources with
  | None, false -> normal_mode ~coqlib project prog args
  | Some dest, false ->
    destination_of project dest
  | None, true ->
    let paths = String.concat " " (List.map (fun i -> i.thing) project.files) in
    Printf.printf "%s" paths
  | Some _, true ->
    prerr_endline "Cannot combine -destination-of and -sources-of";
    usage_coq_makefile ~ok:false

100%


¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.