aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/sign.mli
blob: 4325fe90c1757a5bafe97791f0f8adeb5b1ac422 (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
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

open Names
open Term

(** {6 Signatures of ordered named declarations } *)

type named_context = named_declaration list
type section_context = named_context

val empty_named_context : named_context
val add_named_decl : named_declaration -> named_context -> named_context
val vars_of_named_context : named_context -> identifier list

val lookup_named : identifier -> named_context -> named_declaration

(** number of declarations *)
val named_context_length : named_context -> int

(** named context equality *)
val named_context_equal : named_context -> named_context -> bool

(** {6 Recurrence on [named_context]: older declarations processed first } *)
val fold_named_context :
  (named_declaration -> 'a -> 'a) -> named_context -> init:'a -> 'a

(** newer declarations first *)
val fold_named_context_reverse :
  ('a -> named_declaration -> 'a) -> init:'a -> named_context -> 'a

(** {6 Section-related auxiliary functions } *)
val instance_from_named_context : named_context -> constr array

(** {6 ... } *)
(** Signatures of ordered optionally named variables, intended to be
   accessed by de Bruijn indices *)

val push_named_to_rel_context : named_context -> rel_context -> rel_context

(** {6 Recurrence on [rel_context]: older declarations processed first } *)
val fold_rel_context :
  (rel_declaration -> 'a -> 'a) -> rel_context -> init:'a -> 'a

(** newer declarations first *)
val fold_rel_context_reverse :
  ('a -> rel_declaration -> 'a) -> init:'a -> rel_context -> 'a

(** {6 Map function of [rel_context] } *)
val map_rel_context : (constr -> constr) -> rel_context -> rel_context

(** {6 Map function of [named_context] } *)
val map_named_context : (constr -> constr) -> named_context -> named_context

(** {6 Map function of [rel_context] } *)
val iter_rel_context : (constr -> unit) -> rel_context -> unit

(** {6 Map function of [named_context] } *)
val iter_named_context : (constr -> unit) -> named_context -> unit