Debian Codegraph @

kernel/conversion.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 Constr
12 open Environ
13
14 (***********************************************************************
15 s conversion functions *)
16
17 type 'a kernel_conversion_function = env -> 'a -> 'a -> (unit, unit) result
18 type 'a extended_conversion_function =
19 ?l2r:bool -> ?reds:TransparentState.t -> env ->
20 ?evars:CClosure.evar_handler ->
21 'a -> 'a -> (unit, unit) result
22
23 type conv_pb = CONV | CUMUL
24
25 type ('a, 'err) universe_compare = {
26 compare_sorts : conv_pb -> Sorts.t -> Sorts.t -> 'a -> ('a, 'err option) result;
27 compare_instances: flex:bool -> UVars.Instance.t -> UVars.Instance.t -> 'a -> ('a, 'err option) result;
28 compare_cumul_instances : conv_pb -> UVars.Variance.t array ->
29 UVars.Instance.t -> UVars.Instance.t -> 'a -> ('a, 'err option) result;
30 }
31
32 type ('a, 'err) universe_state = 'a * ('a, 'err) universe_compare
33
34 type ('a, 'err) generic_conversion_function = ('a, 'err) universe_state -> constr -> constr -> ('a, 'err option) result
35
36 val get_cumulativity_constraints : conv_pb -> UVars.Variance.t array ->
37 UVars.Instance.t -> UVars.Instance.t -> UVars.QPairSet.t * Univ.UnivConstraints.t
38
39 val inductive_cumulativity_arguments : (Declarations.mutual_inductive_body * int) -> int
40 val constructor_cumulativity_arguments : (Declarations.mutual_inductive_body * int * int) -> int
41
42 val sort_cmp_universes : conv_pb -> Sorts.t -> Sorts.t ->
43 'a * ('a, 'err) universe_compare -> ('a, 'err option) result * ('a, 'err) universe_compare
44
45 (* [flex] should be true for constants, false for inductive types and
46 constructors. *)
47 val convert_instances : flex:bool -> UVars.Instance.t -> UVars.Instance.t ->
48 'a * ('a, 'err) universe_compare -> ('a, 'err option) result * ('a, 'err) universe_compare
49
50 (** This function never returns an non-empty error. *)
51 val checked_universes : (UGraph.t, 'err) universe_compare
52
53 (** These two functions can only fail with unit *)
54 val conv : constr extended_conversion_function
55
56 val conv_leq : types extended_conversion_function
57
58 (** The failure values depend on the universe state functions
59 (for better error messages). *)
60 val generic_conv : conv_pb -> l2r:bool
61 -> TransparentState.t -> env -> ?evars:CClosure.evar_handler
62 -> ('a, 'err) generic_conversion_function
63
64 val default_conv : conv_pb -> types kernel_conversion_function
65 val default_conv_leq : types kernel_conversion_function
66
67 type graph_inconsistency = Univ of UGraph.univ_inconsistency | Qual of QGraph.elimination_error