Project

General

Profile

Revision 53206908 src/options.ml

View differences:

src/options.ml
33 33
let optimization = ref 2
34 34
let lusi = ref false
35 35
let print_reuse = ref false
36
let traces = ref false
36
let const_unfold = ref false
37
let mpfr = ref false
38
let mpfr_prec = ref 0
37 39

  
38 40
let horntraces = ref false
39 41
let horn_cex = ref false
40
let horn_query = ref true
42
let horn_queries = ref false
41 43

  
44
let salsa_enabled = ref false
42 45

  
46
let set_mpfr prec =
47
  if prec > 0 then (
48
    mpfr := true;
49
    mpfr_prec := prec;
50
    salsa_enabled := false; (* We deactivate salsa *)
51
  )
52
  else
53
    failwith "mpfr requires a positive integer"
54
			
43 55
let options =
44 56
  [ "-d", Arg.Set_string dest_dir,
45
    "uses the specified directory as root for generated/imported object and C files (default: .)";
46
    "-node", Arg.Set_string main_node, "specifies the main node";
57
    "uses the specified directory \x1b[4mdir\x1b[0m as root for generated/imported object and C files <default: .>";
58
    "-node", Arg.Set_string main_node, "specifies the \x1b[4mmain\x1b[0m node";
47 59
    "-init", Arg.Set delay_calculus, "performs an initialisation analysis for Lustre nodes <default: no analysis>";
48 60
    "-dynamic", Arg.Clear static_mem, "specifies a dynamic allocation scheme for main Lustre node <default: static>";
49
    "-ansi", Arg.Set ansi, "specifies that generated C code is ansi C90 compliant <default: C99>";
50 61
    "-check-access", Arg.Set check, "checks at runtime that array accesses always lie within bounds <default: no check>";
62
    "-mpfr", Arg.Int set_mpfr, "replaces FP numbers by the MPFR library multiple precision numbers with a precision of \x1b[4mprec\x1b[0m bits <default: keep FP numbers>";
51 63
    "-lusi", Arg.Set lusi, "only generates a .lusi interface source file from a Lustre source <default: no generation>";
52 64
    "-no-spec", Arg.Unit (fun () -> spec := "no"), "do not generate any specification";
53
    "-acsl-spec", Arg.Unit (fun () -> spec := "acsl"), "generates an ACSL encoding of the specification. Only meaningful for the C backend (default)";
65
    "-acsl-spec", Arg.Unit (fun () -> spec := "acsl"), "generates an ACSL encoding of the specification. Only meaningful for the C backend <default>";
54 66
    "-c-spec", Arg.Unit (fun () -> spec := "c"), "generates a C encoding of the specification instead of ACSL contracts and annotations. Only meaningful for the C backend";
55 67
    "-java", Arg.Unit (fun () -> output := "java"), "generates Java output instead of C";
56 68
    "-horn", Arg.Unit (fun () -> output := "horn"), "generates Horn clauses encoding output instead of C";
57
    "-horn-traces", Arg.Unit (fun () -> output := "horn"; traces:=true), "produce traceability file for Horn backend. Enable the horn backend.";
69
    "-horn-traces", Arg.Unit (fun () -> output := "horn"; horntraces:=true), "produce traceability file for Horn backend. Enable the horn backend.";
58 70
    "-horn-cex", Arg.Unit (fun () -> output := "horn"; horn_cex:=true), "generate cex enumeration. Enable the horn backend (work in progress)";
59
    "-horn-query", Arg.Unit (fun () -> output := "horn"; horn_query:=true), "generate queries in generated Horn file. Enable the horn backend (work in progress)";
71
    "-horn-queries", Arg.Unit (fun () -> output := "horn"; horn_queries:=true), "generate queries in generated Horn file. Enable the horn backend (work in progress)";
72
    "-salsa", Arg.Set salsa_enabled, "activate Salsa optimization <default>";
73
    "-no-salsa", Arg.Clear salsa_enabled, "deactivate Salsa optimization";
60 74
    "-print_reuse", Arg.Set print_reuse, "prints variable reuse policy";
61 75
    "-lustre", Arg.Unit (fun () -> output := "lustre"), "generates Lustre output, performing all active optimizations";
62
    "-inline", Arg.Set global_inline, "inline all node calls (require a main node)";
76
    "-inline", Arg.Unit (fun () -> global_inline := true; const_unfold := true), "inline all node calls (require a main node). Implies constant unfolding";
63 77
    "-witnesses", Arg.Set witnesses, "enable production of witnesses during compilation";
64 78
    "-print_types", Arg.Set print_types, "prints node types";
65 79
    "-print_clocks", Arg.Set print_clocks, "prints node clocks";
66
    "-O", Arg.Set_int optimization, " changes optimization level <default: 2>";
67
    "-verbose", Arg.Set_int verbose_level, " changes verbose level <default: 1>";
80
    "-O", Arg.Set_int optimization, "changes optimization \x1b[4mlevel\x1b[0m <default: 2>";
81
    "-verbose", Arg.Set_int verbose_level, "changes verbose \x1b[4mlevel\x1b[0m <default: 1>";
68 82
    "-version", Arg.Unit print_version, " displays the version";]
69 83

  
70 84

  
85
let plugin_opt (name, activate, options) =
86
  ( "-" ^ name , Arg.Unit activate, "activate plugin " ^ name ) ::
87
    (List.map (fun (opt, act, desc) -> "-" ^ name ^ opt, act, desc) options)
88
 
89

  
71 90
let get_witness_dir filename =
72 91
  (* Make sure the directory exists *)
73 92
  let dir = !dest_dir ^ "/" ^ (Filename.basename filename) ^ "_witnesses" in

Also available in: Unified diff