Debian Codegraph @

pretyping/retyping.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 Evd
12 open Environ
13 open EConstr
14
15 (** This family of functions assumes its constr argument is known to be
16 well-typable. It does not type-check, just recompute the type
17 without any costly verifications. On non well-typable terms, it
18 either produces a wrong result or raise an anomaly. Use with care.
19 It doesn't handle predicative universes too. *)
20
21 (** The "polyprop" optional argument is used by the extraction to
22 disable "Prop-polymorphism" *)
23
24 (** The "lax" optional argument provides a relaxed version of
25 [get_type_of] that won't raise any anomaly but RetypeError instead *)
26
27 type retype_error
28 exception RetypeError of retype_error
29
30 val get_type_of :
31 ?metas:(Constr.metavariable -> types option) ->
32 ?polyprop:bool -> ?lax:bool -> env -> evar_map -> constr -> types
33
34 (** No-evar version of [get_type_of] *)
35 val get_type_of_constr : ?polyprop:bool -> ?lax:bool
36 -> env -> ?uctx:UState.t -> Constr.t -> Constr.types
37
38 val get_sort_of :
39 ?polyprop:bool -> env -> evar_map -> types -> ESorts.t
40
41 val get_sort_quality_of :
42 ?polyprop:bool -> env -> evar_map -> types -> UnivGen.QualityOrSet.t
43
44 (** Makes an unsafe judgment from a constr *)
45 val get_judgment_of : env -> evar_map -> constr -> unsafe_judgment
46
47 val type_of_global_reference_knowing_parameters : env -> evar_map -> constr ->
48 constr array -> types
49
50 val sorts_of_context : env -> evar_map -> rel_context -> ESorts.t list
51
52 val expand_projection : env -> evar_map -> Names.Projection.t -> constr -> constr list -> constr
53
54 val reinterpret_get_type_of : src:Names.Id.t -> env -> evar_map -> constr -> types
55
56 val print_retype_error : retype_error -> Pp.t
57
58 val relevance_of_projection_repr : env -> Names.Projection.Repr.t EConstr.puniverses -> ERelevance.t
59
60 val relevance_of_term : env -> evar_map -> constr -> ERelevance.t
61 val relevance_of_type : env -> evar_map -> types -> ERelevance.t
62 val relevance_of_sort : ESorts.t -> ERelevance.t
63
64 val is_term_irrelevant : env -> Evd.evar_map -> Evd.econstr -> bool
65
66 (** The "polyprop" optional argument above controls
67 the "Prop-polymorphism". By default, it is allowed.
68 But when "polyprop=false", the following exception is raised
69 when a polymorphic singleton inductive type becomes Prop due to
70 parameter instantiation. This is used by the Ocaml extraction,
71 which cannot handle (yet?) Prop-polymorphism. *)
72
73 exception SingletonInductiveBecomesProp of Names.inductive