aboutsummaryrefslogtreecommitdiffhomepage
path: root/checker/environ.mli
blob: 0ec14cc922b1b81713c7a19040bd740e99d2d3a5 (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
open Names
open Term

(* Environments *)

type globals = {
  env_constants : Declarations.constant_body Cmap_env.t;
  env_inductives : Declarations.mutual_inductive_body Mindmap_env.t;
  env_inductives_eq : kernel_name KNmap.t;
  env_modules : Declarations.module_body MPmap.t;
  env_modtypes : Declarations.module_type_body MPmap.t}
type stratification = {
  env_universes : Univ.universes;
  env_engagement : Declarations.engagement option;
}
type env = {
  env_globals : globals;
  env_named_context : named_context;
  env_rel_context : rel_context;
  env_stratification : stratification;
  env_imports : Digest.t MPmap.t;
}
val empty_env : env

(* Engagement *)
val engagement : env -> Declarations.engagement option
val set_engagement : Declarations.engagement -> env -> env

(* Digests *)
val add_digest : env -> Dir_path.t -> Digest.t -> env
val lookup_digest : env -> Dir_path.t -> Digest.t

(* de Bruijn variables *)
val rel_context : env -> rel_context
val lookup_rel : int -> env -> rel_declaration
val push_rel : rel_declaration -> env -> env
val push_rel_context : rel_context -> env -> env
val push_rec_types : name array * constr array * 'a -> env -> env

(* Named variables *)
val named_context : env -> named_context
val push_named : named_declaration -> env -> env
val lookup_named : Id.t -> env -> named_declaration
val named_type : Id.t -> env -> constr

(* Universes *)
val universes : env -> Univ.universes
val add_constraints : Univ.constraints -> env -> env

(* Constants *)
val lookup_constant : constant -> env -> Declarations.constant_body
val add_constant : constant -> Declarations.constant_body -> env -> env
type const_evaluation_result = NoBody | Opaque
exception NotEvaluableConst of const_evaluation_result
val constant_value : env -> constant -> constr
val evaluable_constant : constant -> env -> bool

(* Inductives *)
val mind_equiv : env -> inductive -> inductive -> bool

val lookup_mind :
  mutual_inductive -> env -> Declarations.mutual_inductive_body

val add_mind :
  mutual_inductive -> Declarations.mutual_inductive_body -> env -> env

(* Modules *)
val add_modtype :
  module_path -> Declarations.module_type_body -> env -> env
val shallow_add_module :
  module_path -> Declarations.module_body -> env -> env
val shallow_remove_module : module_path -> env -> env
val lookup_module : module_path -> env -> Declarations.module_body
val lookup_modtype : module_path -> env -> Declarations.module_type_body