Debian Codegraph @

engine/univGen.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 Constr
13 open Environ
14 open Univ
15 open UVars
16
17 module QualityOrSet : sig
18 type t = Qual of Sorts.Quality.t | Set
19
20 val equal : t -> t -> bool
21 val compare : t -> t -> int
22 val of_quality : Sorts.Quality.t -> t
23 val of_sort : Sorts.t -> t
24 val quality : t -> Sorts.Quality.t
25
26 val eliminates_to : t -> t -> bool
27
28 val set : t
29
30 val qtype : t
31 val prop : t
32 val sprop : t
33
34 val is_type : t -> bool
35 val is_set : t -> bool
36 val is_prop : t -> bool
37 val is_sprop : t -> bool
38
39 val pr : (Sorts.QVar.t -> Pp.t) -> t -> Pp.t
40 val raw_pr : t -> Pp.t
41
42 val all_constants : t list
43 val all : t list
44 end
45
46 type univ_length_mismatch = {
47 gref : GlobRef.t;
48 actual : int * int;
49 expect : int * int;
50 }
51 (* Due to an OCaml bug ocaml/ocaml#10027 inlining this record will cause
52 compliation with -rectypes to crash. *)
53 exception UniverseLengthMismatch of univ_length_mismatch
54
55 (** Side-effecting functions creating new universe levels. *)
56
57 val new_univ_global : unit -> UGlobal.t
58 val new_sort_global : Id.t -> Sorts.QGlobal.t
59 val fresh_level : unit -> Level.t
60 val fresh_sort_quality : unit -> Sorts.QVar.t
61
62 (** Build a fresh instance for a given context, its associated substitution and
63 the instantiated constraints. *)
64
65 (* TODO: move this type and its associated functions somewhere reasonable *)
66
67 type sort_context_set = (Sorts.QVar.Set.t * Univ.Level.Set.t) * PConstraints.t
68
69 type 'a in_sort_context_set = 'a * sort_context_set
70
71 val sort_context_union : sort_context_set -> sort_context_set -> sort_context_set
72
73 val empty_sort_context : sort_context_set
74
75 val is_empty_sort_context : sort_context_set -> bool
76
77 val diff_sort_context : sort_context_set -> sort_context_set -> sort_context_set
78
79 val pr_sort_context : (Sorts.QVar.t -> Pp.t) -> (Univ.Level.Set.elt -> Pp.t) ->
80 sort_context_set -> Pp.t
81
82 val fresh_instance : AbstractContext.t -> Instance.t in_sort_context_set
83
84 (** The globref is only used for the error message when there is a mismatch. *)
85 val fresh_instance_from : ?loc:Loc.t -> AbstractContext.t -> (GlobRef.t * Instance.t) option ->
86 Instance.t in_sort_context_set
87
88 val fresh_sort_in_quality : QualityOrSet.t -> Sorts.t in_sort_context_set
89 (** NB: QSort is treated as QType *)
90
91 val fresh_constant_instance : env -> Constant.t ->
92 pconstant in_sort_context_set
93 val fresh_inductive_instance : env -> inductive ->
94 pinductive in_sort_context_set
95 val fresh_constructor_instance : env -> constructor ->
96 pconstructor in_sort_context_set
97 val fresh_array_instance : env ->
98 Instance.t in_sort_context_set
99
100 val fresh_global_instance : ?loc:Loc.t -> ?names:UVars.Instance.t -> env -> GlobRef.t ->
101 constr in_sort_context_set
102
103 val fresh_sort_context_instance : sort_context_set ->
104 sort_level_subst * sort_context_set
105
106 (** Create a fresh global in the environment argument, without side effects.
107 BEWARE: this raises an error on polymorphic constants/inductives:
108 the constraints should be properly added to an evd.
109 See Evd.fresh_global, Evarutil.new_global, and pf_constr_of_global for
110 the proper way to get a fresh copy of a polymorphic global reference. *)
111 val constr_of_monomorphic_global : env -> GlobRef.t -> constr