Debian Codegraph @

pretyping/glob_ops.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 open Names
12 open Glob_term
13
14 val map_glob_sort_gen : ('a -> 'b) -> 'a glob_sort_gen -> 'b glob_sort_gen
15
16 val glob_Type_sort : glob_sort
17 val glob_SProp_sort : glob_sort
18 val glob_Prop_sort : glob_sort
19 val glob_Set_sort : glob_sort
20
21 (** Equalities *)
22
23 val glob_sort_gen_eq : ('a -> 'a -> bool) -> 'a glob_sort_gen -> 'a glob_sort_gen -> bool
24
25 val glob_sort_eq : Glob_term.glob_sort -> Glob_term.glob_sort -> bool
26
27 val glob_qvar_eq : glob_qvar -> glob_qvar -> bool
28
29 val glob_quality_eq : glob_quality -> glob_quality -> bool
30
31 val glob_level_eq : Glob_term.glob_level -> Glob_term.glob_level -> bool
32
33 val relevance_info_eq : relevance_info -> relevance_info -> bool
34
35 val cases_pattern_eq : 'a cases_pattern_g -> 'a cases_pattern_g -> bool
36
37 (** Expect a Prop/SProp/Set/Type universe; raise [ComplexSort] if
38 contains a max, an increment, or a flexible universe *)
39 exception ComplexSort
40 val glob_sort_quality : glob_sort -> UnivGen.QualityOrSet.t
41 val fresh_glob_sort_in_quality : Evd.evar_map -> glob_sort -> Evd.evar_map * Evd.esorts
42
43 val alias_of_pat : 'a cases_pattern_g -> Name.t
44
45 val set_pat_alias : Id.t -> 'a cases_pattern_g -> 'a cases_pattern_g
46
47 val cast_kind_eq : Constr.cast_kind -> Constr.cast_kind -> bool
48
49 val glob_constr_eq : 'a glob_constr_g -> 'a glob_constr_g -> bool
50
51 (** Operations on [glob_constr] *)
52
53 val cases_pattern_loc : 'a cases_pattern_g -> Loc.t option
54
55 val cases_predicate_names : 'a tomatch_tuples_g -> Name.t list
56
57 (** Apply a list of arguments to a glob_constr *)
58 val mkGApp : ?loc:Loc.t -> 'a glob_constr_g -> 'a glob_constr_g list -> 'a glob_constr_g
59
60 val map_glob_constr :
61 (glob_constr -> glob_constr) -> glob_constr -> glob_constr
62
63 (** Equality on [binding_kind] *)
64 val binding_kind_eq : binding_kind -> binding_kind -> bool
65
66 (** Ensure traversal from left to right *)
67 val map_glob_constr_left_to_right :
68 (glob_constr -> glob_constr) -> glob_constr -> glob_constr
69
70 val map_glob_constr_left_to_right_with_names :
71 (glob_constr -> glob_constr) -> (Name.t -> Name.t) -> glob_constr -> glob_constr
72
73 val warn_variable_collision : ?loc:Loc.t -> Id.t -> unit
74
75 val mk_glob_constr_eq : (glob_constr -> glob_constr -> bool) ->
76 (Name.t -> Name.t -> glob_constr option -> glob_constr option -> bool) ->
77 glob_constr -> glob_constr -> bool
78
79 val fold_glob_constr : ('a -> glob_constr -> 'a) -> 'a -> glob_constr -> 'a
80 val fold_glob_constr_with_binders : (Id.t -> 'a -> 'a) -> ('a -> 'b -> glob_constr -> 'b) -> 'a -> 'b -> glob_constr -> 'b
81 val iter_glob_constr : (glob_constr -> unit) -> glob_constr -> unit
82 val occur_glob_constr : Id.t -> 'a glob_constr_g -> bool
83 val free_glob_vars : 'a glob_constr_g -> Id.Set.t
84 val bound_glob_vars : glob_constr -> Id.Set.t
85 (* Obsolete *)
86 val loc_of_glob_constr : 'a glob_constr_g -> Loc.t option
87 val glob_visible_short_qualid : 'a glob_constr_g -> Id.Set.t
88
89 (* Renaming free variables using a renaming map; fails with
90 [UnsoundRenaming] if applying the renaming would introduce
91 collision, as in, e.g., renaming [P x y] using substitution [(x,y)];
92 inner alpha-conversion done only for forall, fun, let but
93 not for cases and fix *)
94
95 exception UnsoundRenaming
96 val rename_var : (Id.t * Id.t) list -> Id.t -> Id.t
97 val rename_glob_vars : (Id.t * Id.t) list -> 'a glob_constr_g -> 'a glob_constr_g
98
99 (** [map_pattern_binders f m c] applies [f] to all the binding names
100 in a pattern-matching expression ({!Glob_term.GCases}) represented
101 here by its relevant components [m] and [c]. It is used to
102 interpret Ltac-bound names both in pretyping and printing of
103 terms. *)
104 val map_pattern_binders : (Name.t -> Name.t) ->
105 tomatch_tuples -> cases_clauses -> (tomatch_tuples*cases_clauses)
106
107 (** [map_pattern f m c] applies [f] to the return predicate and the
108 right-hand side of a pattern-matching expression
109 ({!Glob_term.GCases}) represented here by its relevant components
110 [m] and [c]. *)
111 val map_pattern : (glob_constr -> glob_constr) ->
112 tomatch_tuples -> cases_clauses -> (tomatch_tuples*cases_clauses)
113
114 (** Conversion from glob_constr to cases pattern, if possible
115
116 Evaluation is forced.
117 Take the current alias as parameter,
118 @raise Not_found if translation is impossible *)
119 val cases_pattern_of_glob_constr : Environ.env -> Name.t -> 'a glob_constr_g -> 'a cases_pattern_g
120
121 val glob_constr_of_closed_cases_pattern : Environ.env -> 'a cases_pattern_g -> Name.t * 'a glob_constr_g
122
123 (** A canonical encoding of cases pattern into constr such that
124 composed with [cases_pattern_of_glob_constr Anonymous] gives identity *)
125 val glob_constr_of_cases_pattern : Environ.env -> 'a cases_pattern_g -> 'a glob_constr_g
126
127 val add_patterns_for_params_remove_local_defs : Environ.env -> constructor ->
128 'a cases_pattern_g list -> 'a cases_pattern_g list
129
130 val empty_lvar : Ltac_pretype.ltac_var_map
131
132 val kind_of_glob_kind : glob_evar_kind -> Evar_kinds.t
133
134 val naming_of_glob_kind : glob_evar_kind -> Namegen.intro_pattern_naming_expr