(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(** This file implements type inference. It maps [glob_constr] (i.e.untypedtermswhosenamesarelocated)to[constr].In particular,itdrivescomplexpattern-matchingproblems("match") intoelementaryones,insertionofcoercionsandresolutionof
implicit arguments. *)
open Names open Environ open Evd open EConstr open Glob_term open Ltac_pretype
val add_bidirectionality_hint : GlobRef.t -> int -> unit (** A bidirectionality hint `n` for a global `g` tells the pretyper to use typinginformationfromthecontextaftertypingthe`n`forargumentsofan
application of `g`. *)
val get_bidirectionality_hint : GlobRef.t -> int option
val clear_bidirectionality_hint : GlobRef.t -> unit
(** An auxiliary function for searching for fixpoint guard indices *)
(* Tells the possible indices liable to guard a fixpoint *) type possible_fix_indices = int listlist
(* Tells if possibly a cofixpoint or a fixpoint over the given list of possible indices *) type possible_guard = {
possibly_cofix : bool;
possible_fix_indices : possible_fix_indices;
} (* Note: if no fix indices are given, it has to be a cofix *)
val search_guard :
?loc:Loc.t -> ?evars:CClosure.evar_handler -> env ->
possible_guard -> Constr.rec_declaration -> int array option
val search_fix_guard : (* For Fixpoints only *)
?loc:Loc.t -> ?evars:CClosure.evar_handler -> env ->
possible_fix_indices -> Constr.rec_declaration -> int array
val esearch_guard :
?loc:Loc.t -> env -> evar_map -> possible_guard ->
EConstr.rec_declaration -> int array option
val esearch_fix_guard : (* For Fixpoints only *)
?loc:Loc.t -> env -> evar_map -> possible_fix_indices ->
EConstr.rec_declaration -> int array
val esearch_cofix_guard : ?loc:Loc.t -> env -> evar_map -> EConstr.rec_declaration -> unit
type typing_constraint =
| IsType (** Necessarily a type *)
| OfType of types (** A term of the expected type *)
| WithoutTypeConstraint (** A term of unknown expected type *)
type use_typeclasses = NoUseTC | UseTCForConv | UseTC (** Typeclasses are used in 2 ways:
val default_inference_flags : bool -> inference_flags
val no_classes_no_fail_inference_flags : inference_flags
val all_no_fail_flags : inference_flags
val all_and_fail_flags : inference_flags
(** Generic calls to the interpreter from glob_constr to open_constr; bydefault,inference_flagstelltousetypeclassesand heuristics(butnoexternaltacticsolverhooks),aswellasto ensurethatconversionproblemsareallsolvedandexpandevars, butunresolvedevarscanremain.Thedifferenceisinwhetherthe
evar_map is modified explicitly or by side-effect. *)
(** As [understand_tcc] but also returns the type of the elaborated term.
The [expand_evars] flag is not applied to the type (only to the term). *) val understand_tcc_ty : ?flags:inference_flags -> env -> evar_map ->
?expected_type:typing_constraint -> glob_constr -> evar_map * constr * types
(** More general entry point with evars from ltac *)
(** Generic call to the interpreter from glob_constr to constr
(** [hook env sigma ev] returns [Some (sigma', term)] if [ev] can be instantiatedwithasolution,[None]otherwise.Usedtoextend
[solve_remaining_evars] below. *) type inference_hook = env -> evar_map -> Evar.t -> (evar_map * constr) option
(** Trying to solve remaining evars and remaining conversion problems possiblyusingtypeclasses,heuristics,externaltacticsolver
hook depending on given flags. *) (* For simplicity, it is assumed that current map has no other evars withcandidateandnootherconversionproblemsthattheonein
[pending], however, it can contain more evars than the pending ones. *) val solve_remaining_evars : ?hook:inference_hook -> inference_flags ->
env -> ?initial:evar_map -> (* current map *) evar_map -> evar_map
(** Checking evars and pending conversion problems are all solved,
reporting an appropriate error message *)
val check_evars_are_solved :
program_mode:bool -> env -> ?initial:evar_map -> (* current map: *) evar_map -> unit
(** [check_evars env ?initial sigma c] fails if some unresolved evar remainsin[c]whichisn'tin[initial](anyunresolvedevarif
[initial] not provided) *) val check_evars : env -> ?initial:evar_map -> evar_map -> constr -> unit
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.