]> matita.cs.unibo.it Git - helm.git/blob - helm/software/helena/src/common/options.ml
level disambiguation cmpleted! the Grafite file is succesfully generated.
[helm.git] / helm / software / helena / src / common / options.ml
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.              
9      \ /   This software is distributed as is, NO WARRANTY.              
10       V_______________________________________________________________ *)
11
12 module F = Filename
13
14 module C = Cps
15
16 type uri_generator = string -> string
17
18 type kernel = Crg | Brg | Bag
19
20 (* interface functions ******************************************************)
21
22 let version_string = "Helena 0.8.2 M - November 2014"
23
24 let stage = ref 3            (* stage *)
25
26 let trace = ref 0            (* trace level *)
27
28 let summary = ref false      (* log summary information *)
29
30 let xdir = ref ""            (* directory for XML output *)
31
32 let kernel = ref Brg         (* kernel type *)
33
34 let si = ref false           (* use sort inclusion *)
35
36 let cover = ref ""           (* initial uri segment *)
37
38 let cc = ref false           (* activate conversion constraints *)
39
40 let expand = ref false       (* always expand global definitions *)
41
42 let indexes = ref false      (* show de Bruijn indexes *)
43
44 let icm = ref 0              (* complexity measure of relocated terms *)
45
46 let unquote = ref false      (* do not quote identifiers when lexing *)
47
48 let debug_parser = ref false (* output parser debug information *)
49
50 let debug_lexer = ref false  (* output lexer debug information *)
51
52 let ma_dir = ref ""          (* directory for grafite output *)
53
54 let ma_preamble = ref ""     (* location of grafite preamble file *)
55
56 let alpha = ref ""           (* prefix of numeric identifiers *)
57
58 let kernel_id () = 
59    let id = match !kernel with
60       | Crg -> "crg"
61       | Brg -> "brg"
62       | Bag -> "bag"
63    in
64    let si = if !si then "_si" else "" in
65    id ^ si
66
67 let get_baseuri () =
68    String.concat "/" ["ld:"; kernel_id (); !cover; "" ]
69
70 let get_mk_uri () =
71    let bu = get_baseuri () in
72    fun s -> F.concat bu (s ^ ".ld")
73
74 let clear () =
75    stage := 3; trace := 0; summary := false; 
76    xdir := ""; kernel := Brg; si := false; cover := ""; 
77    expand := false; indexes := false; icm := 0; unquote := false;
78    debug_parser := false; debug_lexer := false;
79    ma_dir := ""; ma_preamble := ""