aboutsummaryrefslogtreecommitdiffhomepage
path: root/library/global.mli
blob: 0a5edc9ad1420a9f96e3360d30bfc993dd53b8a6 (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
(***********************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team    *)
(* <O___,, *        INRIA-Rocquencourt  &  LRI-CNRS-Orsay              *)
(*   \VV/  *************************************************************)
(*    //   *      This file is distributed under the terms of the      *)
(*         *       GNU Lesser General Public License Version 2.1       *)
(***********************************************************************)

(*i $Id$ i*)

(*i*)
open Names
open Univ
open Term
open Declarations
open Indtypes
open Safe_typing
(*i*)

(* This module defines the global environment of Coq. 
   The functions below are exactly the same as the ones in [Typing],
   operating on that global environment. *)

val safe_env : unit -> safe_environment
val env : unit -> Environ.env

val universes : unit -> universes
val named_context : unit -> Sign.named_context

(* Extending env with variables, constants and inductives *)
val push_named_assum : (identifier * types) -> Univ.constraints
val push_named_def   : (identifier * constr) -> Univ.constraints
val pop_named_decls  : identifier list -> unit

val add_parameter           : constant -> types -> unit
val add_constant            : constant -> constant_entry -> unit
val add_discharged_constant : constant -> Cooking.recipe -> unit

val add_mind        : mutual_inductive -> mutual_inductive_entry -> unit
val add_constraints : constraints -> unit

(* Queries *)
val lookup_named     : variable -> named_declaration
val lookup_constant  : constant -> constant_body
val lookup_inductive : inductive -> mutual_inductive_body * one_inductive_body
val lookup_mind      : mutual_inductive -> mutual_inductive_body

(* Modules *)
val export : dir_path -> Environ.compiled_env
val import : Environ.compiled_env -> unit

(*s Function to get an environment from the constants part of the global
    environment and a given context. *)

val env_of_context : Sign.named_context -> Environ.env