]> matita.cs.unibo.it Git - helm.git/blob - helm/software/helena/src/common/options.ml
exportation to \lambda\delta representation in elpi
[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 KF = Filename
13
14 module C = Cps
15
16 type uri_generator = string -> string
17
18 type kernel = V4 | V3 | V0
19
20 type manager = Quiet
21              | Coq
22              | Matita
23              | ELPI
24
25 (* interface functions ******************************************************)
26
27 let version_string = "Helena 0.8.2 M (May 2015)"
28
29 let stage = ref 3            (* stage *)
30
31 let trace = ref 0            (* trace level *)
32
33 let summary = ref false      (* log summary information *)
34
35 let xdir = ref ""            (* directory for XML output *)
36
37 let kernel = ref V3          (* kernel type *)
38
39 let si = ref false           (* use sort inclusion *)
40
41 let cover = ref ""           (* initial uri segment *)
42
43 let cc = ref false           (* activate conversion constraints *)
44
45 let expand = ref false       (* always expand global definitions *)
46
47 let indexes = ref false      (* show de Bruijn indexes *)
48
49 let icm = ref 0              (* complexity measure of relocated terms *)
50
51 let unquote = ref false      (* do not quote identifiers when lexing *)
52
53 let debug_parser = ref false (* output parser debug information *)
54
55 let debug_lexer = ref false  (* output lexer debug information *)
56
57 let manager_dir = ref ""     (* output directory for manager *)
58
59 let manager = ref Quiet      (* manager *)
60
61 let preamble = ref ""        (* preamble file for manager *)
62
63 let alpha = ref ""           (* prefix of numeric identifiers *)
64
65 let kernel_id () = 
66    let id = match !kernel with
67       | V4 -> "Environment"
68       | V3 -> "Environment_V3"
69       | V0 -> "Environment_V0"
70    in
71    let si = if !si then "_si" else "" in
72    id ^ si
73
74 let get_baseuri () =
75    String.concat "/" ["ld:"; kernel_id (); !cover; "" ]
76
77 let get_mk_uri () =
78    let bu = get_baseuri () in
79    fun s -> KF.concat bu (s ^ ".ld")
80
81 let clear () =
82    stage := 3; trace := 0; summary := false; 
83    xdir := ""; kernel := V3; si := false; cover := ""; 
84    expand := false; indexes := false; icm := 0; unquote := false;
85    debug_parser := false; debug_lexer := false;
86    manager_dir := ""; manager := Quiet