Debian Codegraph @

plugins/ltac2/tac2intern.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 Tac2expr
14
15 type context = (Id.t * type_scheme) list
16
17 val intern : strict:bool -> context -> raw_tacexpr -> glb_tacexpr * type_scheme
18 val intern_typedef : (KerName.t * int) Id.Map.t -> raw_quant_typedef -> glb_quant_typedef
19 val intern_open_type : raw_typexpr -> type_scheme
20 val intern_notation_data : Id.Set.t -> raw_tacexpr -> Tac2env.notation_data
21
22 (** [check_unused] is default true *)
23 val genintern_warn_not_unit : ?check_unused:bool ->
24 Genintern.glob_sign ->
25 (Name.t * Tac2typing_env.mix_type_scheme) list ->
26 raw_tacexpr ->
27 glb_tacexpr
28
29 val genintern : ?check_unused:bool ->
30 Genintern.glob_sign ->
31 (Name.t * Tac2typing_env.mix_type_scheme) list ->
32 Tac2typing_env.TVar.t glb_typexpr ->
33 raw_tacexpr ->
34 glb_tacexpr
35
36 type not_value_reason =
37 | MutString
38 | Application
39 | MutDef of ltac_constant
40 | MutCtor of type_constant
41 | MutProj of type_constant
42 | MaybeValButNotSupported
43
44 (** Check that a term is a value. Only values are safe to marshall between
45 processes. *)
46 val check_value : glb_tacexpr -> not_value_reason option
47
48 val is_pure_constructor : type_constant -> bool
49
50 val check_unit : ?loc:Loc.t -> type_scheme -> unit
51
52 val check_subtype : type_scheme -> type_scheme -> bool
53 (** [check_subtype t1 t2] returns [true] iff all values of instances of type [t1]
54 also have type [t2]. *)
55
56 val subst_type : substitution -> 'a glb_typexpr -> 'a glb_typexpr
57 val subst_expr : substitution -> glb_tacexpr -> glb_tacexpr
58 val subst_quant_typedef : substitution -> glb_quant_typedef -> glb_quant_typedef
59 val subst_type_scheme : substitution -> type_scheme -> type_scheme
60
61 val subst_rawexpr : substitution -> raw_tacexpr -> raw_tacexpr
62
63 (** {5 Notations} *)
64
65 val globalize : Id.Set.t -> raw_tacexpr -> raw_tacexpr
66 (** Replaces all qualified identifiers by their corresponding kernel name. The
67 set represents bound variables in the context. *)
68
69 val debug_globalize_allow_ext : Id.Set.t -> raw_tacexpr -> raw_tacexpr
70 (** Variant of globalize which can accept CTacExt using the provided function.
71 Intended for debugging. *)
72
73 (** Errors *)
74
75 val error_nargs_mismatch : ?loc:Loc.t -> ltac_constructor -> int -> int -> 'a
76 val error_nparams_mismatch : ?loc:Loc.t -> int -> int -> 'a
77
78 (** Misc *)
79
80 val drop_ltac2_env : Genintern.Store.t -> Genintern.Store.t