aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/ind_tables.ml
blob: 5df33d4593d6ec89c51070b1e1d088e3f02be340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id$ i*)

open Names
open Mod_subst

let eq_scheme_map = ref Indmap.empty 

let cache_scheme (_,(ind,const)) = 
    eq_scheme_map := Indmap.add ind const (!eq_scheme_map)

let export_scheme obj =
    Some obj



let _ = Summary.declare_summary "eqscheme"
    { Summary.freeze_function = (fun () -> !eq_scheme_map);
      Summary.unfreeze_function = (fun fs -> eq_scheme_map := fs);
      Summary.init_function = (fun () -> eq_scheme_map := Indmap.empty) }

let find_eq_scheme ind = 
  Indmap.find ind !eq_scheme_map

let check_eq_scheme ind = 
  Indmap.mem ind !eq_scheme_map

let bl_map = ref Indmap.empty
let lb_map = ref Indmap.empty
let dec_map = ref Indmap.empty


let cache_bl (_,(ind,const)) = 
    bl_map := Indmap.add ind const (!bl_map)

let cache_lb (_,(ind,const)) = 
    lb_map := Indmap.add ind const (!lb_map)

let cache_dec (_,(ind,const)) = 
    dec_map := Indmap.add ind const (!dec_map)

let export_bool_leib obj =
    Some obj

let export_leib_bool obj =
    Some obj

let export_dec_proof obj =
    Some obj



let _ = Summary.declare_summary "bl_proof"
    { Summary.freeze_function = (fun () -> !bl_map);
      Summary.unfreeze_function = (fun fs -> bl_map := fs);
      Summary.init_function = (fun () -> bl_map := Indmap.empty) }

let find_bl_proof ind = 
  Indmap.find ind !bl_map

let check_bl_proof ind =
  Indmap.mem ind !bl_map

let _ = Summary.declare_summary "lb_proof"
    { Summary.freeze_function = (fun () -> !lb_map);
      Summary.unfreeze_function = (fun fs -> lb_map := fs);
      Summary.init_function = (fun () -> lb_map := Indmap.empty) }

let find_lb_proof ind = 
  Indmap.find ind !lb_map

let check_lb_proof ind =
  Indmap.mem ind !lb_map

let _ = Summary.declare_summary "eq_dec_proof"
    { Summary.freeze_function = (fun () -> !dec_map);
      Summary.unfreeze_function = (fun fs -> dec_map := fs);
      Summary.init_function = (fun () -> dec_map := Indmap.empty) }

let find_eq_dec_proof ind = 
  Indmap.find ind !dec_map

let check_dec_proof ind =
  Indmap.mem ind !dec_map