Module Classops
type cl_typ=|CL_SORT|CL_FUN|CL_SECVAR of Names.variable|CL_CONST of Names.Constant.t|CL_IND of Names.inductive|CL_PROJ of Names.Projection.Repr.tThis is the type of class kinds
val subst_cl_typ : Mod_subst.substitution -> cl_typ -> cl_typval cl_typ_ord : cl_typ -> cl_typ -> intComparison of
cl_typ
type coe_typ= Names.GlobRef.tThis is the type of coercion kinds
type coe_info_typ={coe_value : Names.GlobRef.t;coe_local : bool;coe_is_identity : bool;coe_is_projection : Names.Projection.Repr.t option;coe_param : int;}This is the type of infos for declared coercions
type inheritance_path= coe_info_typ listThis is the type of paths from a class to another
Access to classes infos
val class_exists : cl_typ -> boolval class_info : cl_typ -> cl_index * cl_info_typ- raises Not_found
if this type is not a class
val class_info_from_index : cl_index -> cl_typ * cl_info_typval find_class_type : Evd.evar_map -> EConstr.types -> cl_typ * EConstr.EInstance.t * EConstr.constr listfind_class_type env sigma creturns the head reference ofc, its universe instance and its arguments
val class_of : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.types * cl_indexraises
Not_foundif not convertible to a class
val inductive_class_of : Names.inductive -> cl_indexraises
Not_foundif not mapped to a class
val class_args_of : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.constr list
type coercion={coercion_type : coe_typ;coercion_local : bool;coercion_is_id : bool;coercion_is_proj : Names.Projection.Repr.t option;coercion_source : cl_typ;coercion_target : cl_typ;coercion_params : int;}declare_coercionadds a coercion in the graph of coercion paths
val subst_coercion : Mod_subst.substitution -> coercion -> coercionval declare_coercion : Environ.env -> Evd.evar_map -> coercion -> unitval coercion_exists : coe_typ -> boolAccess to coercions infos
Lookup functions for coercion paths
val lookup_path_between_class : (cl_index * cl_index) -> inheritance_pathval lookup_path_between : Environ.env -> Evd.evar_map -> (EConstr.types * EConstr.types) -> EConstr.types * EConstr.types * inheritance_pathval lookup_path_to_fun_from : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.types * inheritance_pathval lookup_path_to_sort_from : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.types * inheritance_pathval lookup_pattern_path_between : Environ.env -> (Names.inductive * Names.inductive) -> (Names.constructor * int) list
val string_of_class : cl_typ -> stringThis is for printing purpose
val pr_class : cl_typ -> Pp.tval pr_cl_index : cl_index -> Pp.tval inheritance_graph : unit -> ((cl_index * cl_index) * inheritance_path) listval classes : unit -> cl_typ listval coercions : unit -> coe_info_typ listval hide_coercion : coe_typ -> int optionhide_coercionreturns the number of params to skip if the coercion must be hidden,Noneotherwise; it raisesNot_foundif not a coercion