Debian Codegraph @

pretyping/patternops.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 Mod_subst
13 open Glob_term
14 open Pattern
15
16 (** {5 Functions on patterns} *)
17
18 val constr_pattern_eq : Environ.env -> constr_pattern -> constr_pattern -> bool
19
20 val subst_pattern : Environ.env -> Evd.evar_map -> substitution -> constr_pattern -> constr_pattern
21 val subst_uninstantiated_pattern : Environ.env -> Evd.evar_map -> substitution -> uninstantiated_pattern -> uninstantiated_pattern
22
23 val noccurn_pattern : int -> _ constr_pattern_r -> bool
24
25 exception BoundPattern
26
27 (** [head_pattern_bound t] extracts the head variable/constant of the
28 type [t] or raises [BoundPattern] (even if a sort); it raises an anomaly
29 if [t] is an abstraction *)
30
31 val head_pattern_bound : constr_pattern -> GlobRef.t
32
33 (** [pattern_of_constr c] translates a term [c] with metavariables into
34 a pattern; currently, no destructor (Cases, Fix, Cofix) and no
35 existential variable are allowed in [c] *)
36
37 val pattern_of_constr : Environ.env -> Evd.evar_map -> EConstr.constr -> constr_pattern
38
39 (** Do not use, for internal Rocq use only. *)
40 val legacy_bad_pattern_of_constr : Environ.env -> Evd.evar_map -> EConstr.constr -> constr_pattern
41
42 (** [pattern_of_glob_constr l c] translates a term [c] with metavariables into
43 a pattern; variables bound in [l] are replaced by the pattern to which they
44 are bound *)
45
46 val pattern_of_glob_constr : Environ.env -> glob_constr -> Id.Set.t * uninstantiated_pattern
47
48 val map_pattern_with_binders : (Name.t -> 'a -> 'a) ->
49 ('a -> 'i constr_pattern_r -> 'i constr_pattern_r) -> 'a -> 'i constr_pattern_r -> 'i constr_pattern_r
50
51 val lift_pattern : int -> 'i constr_pattern_r -> 'i constr_pattern_r
52
53 (** Interp genargs *)
54
55 type 'a pat_interp_fun = Environ.env -> Evd.evar_map -> Ltac_pretype.ltac_var_map
56 -> 'a -> Pattern.constr_pattern
57
58 val interp_pattern : uninstantiated_pattern pat_interp_fun
59
60 val register_interp_pat : (_, 'g, _) Genarg.genarg_type -> 'g pat_interp_fun -> unit