Debian Codegraph @

pretyping/typing.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 Environ
13 open EConstr
14 open Evd
15
16 (** This module provides the typing machine with existential variables
17 and universes. *)
18
19 (** Typecheck a term and return its type + updated evars, optionally refreshing
20 universes *)
21 val type_of : ?refresh:bool -> env -> evar_map -> constr -> evar_map * types
22
23 (** Typecheck a type and return its sort *)
24 val sort_of : env -> evar_map -> types -> evar_map * ESorts.t
25
26 (** Typecheck a term has a given type (assuming the type is OK) *)
27 val check : env -> evar_map -> constr -> types -> evar_map
28
29 (** Type of a variable. *)
30 val type_of_variable : env -> variable -> types
31
32 (** Solve existential variables using typing *)
33 val solve_evars : env -> evar_map -> constr -> evar_map * constr
34
35 (** Raise an error message if incorrect elimination for this inductive
36 (first constr is term to match, second is return predicate) *)
37 val check_allowed_sort : env -> evar_map -> inductive puniverses -> constr -> constr ->
38 evar_map * ERelevance.t
39
40 (** Raise an error message if bodies have types not unifiable with the
41 expected ones *)
42 val check_type_fixpoint : ?loc:Loc.t -> env -> evar_map ->
43 Names.Name.t EConstr.binder_annot array -> types array -> unsafe_judgment array -> evar_map
44
45 (** Variant of {!check} that assumes that the argument term is well-typed. *)
46 val check_actual_type : env -> evar_map -> unsafe_judgment -> types -> evar_map
47
48 val type_judgment : env -> evar_map -> unsafe_judgment -> evar_map * unsafe_type_judgment
49
50 val judge_of_sprop : unsafe_judgment
51 val judge_of_prop : unsafe_judgment
52 val judge_of_set : unsafe_judgment
53 val judge_of_variable : env -> Id.t -> unsafe_judgment
54 val judge_of_apply : env -> evar_map -> unsafe_judgment -> unsafe_judgment array ->
55 evar_map * unsafe_judgment
56 val judge_of_abstraction : Environ.env -> evar_map -> Name.t ->
57 unsafe_type_judgment -> unsafe_judgment -> unsafe_judgment
58 val judge_of_product : Environ.env -> evar_map -> Name.t ->
59 unsafe_type_judgment -> unsafe_type_judgment -> unsafe_judgment
60 val judge_of_projection : env -> evar_map -> Projection.t -> unsafe_judgment -> unsafe_judgment
61 val judge_of_int : Environ.env -> Uint63.t -> unsafe_judgment
62 val judge_of_float : Environ.env -> Float64.t -> unsafe_judgment
63 val judge_of_string : Environ.env -> Pstring.t -> unsafe_judgment
64
65 val checked_appvect : env -> evar_map -> constr -> constr array -> evar_map * constr
66 val checked_applist : env -> evar_map -> constr -> constr list -> evar_map * constr
67
68 (** hack *)
69 val recheck_against : Environ.env -> evar_map -> constr -> constr -> evar_map * types
70
71 type ('constr,'types,'r) bad_relevance =
72 | BadRelevanceBinder of 'r * ('constr,'types,'r) Context.Rel.Declaration.pt
73 | BadRelevanceCase of 'r * 'constr
74
75 val bad_relevance_msg : (Environ.env * evar_map * (constr, types, ERelevance.t) bad_relevance) CWarnings.msg
76
77 (** Template typing *)
78
79 val get_template_parameters : env -> evar_map -> inductive -> ?refresh_all:bool -> unsafe_judgment array -> evar_map * Inductive.param_univs