aboutsummaryrefslogtreecommitdiffhomepage
path: root/library/global.mli
blob: 48b647c6abcc32c544cce89831e1ee5bbf9e9a72 (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
(***********************************************************************)
(*  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 * types option) -> Univ.constraints
val pop_named_decls  : identifier list -> unit

val add_constant    : constant -> global_declaration -> 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 type_of_global : Nametab.global_reference -> types
val env_of_context : Sign.named_context -> Environ.env