Debian Codegraph @

kernel/nativevalues.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 open Constr
11 open Names
12
13 (** This modules defines the representation of values internally used by
14 the native compiler. Be careful when removing apparently dead code from this
15 interface, as it may be used by programs generated at runtime. *)
16
17 type t
18
19 val apply : t -> t -> t
20 val of_fun : (t -> t) -> t
21
22 val eta_expand : t -> t
23
24 type ('a,'b) eq = ('a,'b) Util.eq = Refl : ('a,'a) eq
25 val t_eq : (t, t -> t) eq
26 (** When -rectypes, matching on this makes [t = ('a -> 'a) as 'a].
27 When not -rectypes, it does nothing AFAICT so you have to generalize your problem to use this. *)
28
29 type accumulator
30
31 type tag = int
32 type arity = int
33
34 type reloc_table = (tag * arity) array
35
36 type annot_sw = {
37 asw_ind : inductive;
38 asw_reloc : reloc_table;
39 asw_prefix : string
40 }
41
42 type sort_annot = string * int
43
44 type rec_pos = int array
45
46 val eq_rec_pos : rec_pos -> rec_pos -> bool
47
48 type vcofix
49
50 type atom =
51 | Arel of int
52 | Aconstant of pconstant
53 | Aind of pinductive
54 | Asort of Sorts.t
55 | Avar of Id.t
56 | Acase of annot_sw * accumulator * t * t
57 | Afix of t array * t array * rec_pos * int
58 | Acofix of t array * t array * int * t array * vcofix
59 | Aevar of Evar.t * t array (* arguments *)
60 | Aproj of (inductive * int) * accumulator
61
62 type symbol =
63 | SymbValue of t
64 | SymbSort of Sorts.t
65 | SymbName of Name.t
66 | SymbConst of Constant.t
67 | SymbMatch of annot_sw
68 | SymbInd of inductive
69 | SymbEvar of Evar.t
70 | SymbInstance of UVars.Instance.t
71 | SymbProj of (inductive * int)
72
73 type symbols = symbol array
74
75 val empty_symbols : symbols
76
77 (* Constructors *)
78
79 val mk_accu : atom -> t
80 val mk_rel_accu : int -> t
81 val mk_rels_accu : int -> int -> t array
82 val mk_constant_accu : Constant.t -> UVars.Instance.t -> t
83 val mk_ind_accu : inductive -> UVars.Instance.t -> t
84 val mk_sort_accu : Sorts.t -> t
85 val mk_var_accu : Id.t -> t
86 val mk_sw_accu : annot_sw -> accumulator -> t -> (t -> t)
87 val mk_fix_accu : rec_pos -> int -> t array -> t array -> t
88 val mk_cofix_accu : int -> t array -> t array -> (unit -> t) -> t array -> t
89 val mk_evar_accu : Evar.t -> t array -> t
90 val mk_proj_accu : (inductive * int) -> accumulator -> t
91 val force_cofix : t -> t
92 val mk_const : tag -> t
93 val mk_block : tag -> t array -> t
94 val mk_prod : Name.t -> t -> t -> t
95
96 val mk_bool : bool -> t
97
98 val mk_int : int -> t
99
100 val mk_uint : Uint63.t -> t
101
102 val mk_float : Float64.t -> t
103
104 val mk_string : Pstring.t -> t
105
106 val napply : t -> t array -> t
107 (* Functions over accumulators *)
108
109 val atom_of_accu : accumulator -> atom
110 val args_of_accu : accumulator -> t list
111 val accu_nargs : accumulator -> int
112
113 val cast_accu : t -> accumulator
114
115 (* Functions over block: i.e constructors *)
116
117 type block
118
119 val block_size : block -> int
120 val block_field : block -> int -> t
121 val block_tag : block -> int
122
123 (* kind_of_value *)
124
125 type kind = (t, accumulator, t -> t, Name.t * t * t, Util.Empty.t, Util.Empty.t, block) Values.kind
126
127 val kind_of_value : t -> kind
128
129 val str_encode : 'a -> string
130 val str_decode : string -> 'a
131
132 (** Support for machine integers *)
133
134 val val_to_int : t -> int
135
136 val is_int : t -> bool
137
138 (* function with check *)
139 val head0 : t -> t -> t
140 val tail0 : t -> t -> t
141
142 val add : t -> t -> t -> t
143 val sub : t -> t -> t -> t
144 val mul : t -> t -> t -> t
145 val div : t -> t -> t -> t
146 val rem : t -> t -> t -> t
147 val divs : t -> t -> t -> t
148 val rems : t -> t -> t -> t
149
150 val l_sr : t -> t -> t -> t
151 val l_sl : t -> t -> t -> t
152 val a_sr : t -> t -> t -> t
153 val l_and : t -> t -> t -> t
154 val l_xor : t -> t -> t -> t
155 val l_or : t -> t -> t -> t
156
157 val addc : t -> t -> t -> t
158 val subc : t -> t -> t -> t
159 val addCarryC : t -> t -> t -> t
160 val subCarryC : t -> t -> t -> t
161
162 val mulc : t -> t -> t -> t
163 val diveucl : t -> t -> t -> t
164
165 val div21 : t -> t -> t -> t -> t
166 val addMulDiv : t -> t -> t -> t -> t
167
168 val eq : t -> t -> t -> t
169 val lt : t -> t -> t -> t
170 val le : t -> t -> t -> t
171 val lts : t -> t -> t -> t
172 val les : t -> t -> t -> t
173 val compare : t -> t -> t -> t
174 val compares : t -> t -> t -> t
175
176 val print : t -> t
177
178 (* Function without check *)
179 val no_check_head0 : t -> t
180
181 val no_check_tail0 : t -> t
182
183 val no_check_add : t -> t -> t
184
185 val no_check_sub : t -> t -> t
186
187 val no_check_mul : t -> t -> t
188
189 val no_check_div : t -> t -> t
190
191 val no_check_rem : t -> t -> t
192
193 val no_check_divs : t -> t -> t
194
195 val no_check_rems : t -> t -> t
196
197 val no_check_l_sr : t -> t -> t
198
199 val no_check_l_sl : t -> t -> t
200
201 val no_check_a_sr : t -> t -> t
202
203 val no_check_l_and : t -> t -> t
204
205 val no_check_l_xor : t -> t -> t
206
207 val no_check_l_or : t -> t -> t
208
209 val no_check_addc : t -> t -> t
210
211 val no_check_subc : t -> t -> t
212
213 val no_check_addCarryC : t -> t -> t
214
215 val no_check_subCarryC : t -> t -> t
216
217 val no_check_mulc : t -> t -> t
218
219 val no_check_diveucl : t -> t -> t
220
221 val no_check_div21 : t -> t -> t -> t
222
223 val no_check_addMulDiv : t -> t -> t -> t
224
225 val no_check_eq : t -> t -> t
226
227 val no_check_lt : t -> t -> t
228
229 val no_check_le : t -> t -> t
230
231 val no_check_lts : t -> t -> t
232
233 val no_check_les : t -> t -> t
234
235 val no_check_compare : t -> t -> t
236
237 val no_check_compares : t -> t -> t
238
239 (** Support for machine floating point values *)
240
241 val is_float : t -> bool
242
243 val fopp : t -> t -> t
244 val fabs : t -> t -> t
245 val feq : t -> t -> t -> t
246 val flt : t -> t -> t -> t
247 val fle : t -> t -> t -> t
248 val fcompare : t -> t -> t -> t
249 val fequal : t -> t -> t -> t
250 val fclassify : t -> t -> t
251 val fadd : t -> t -> t -> t
252 val fsub : t -> t -> t -> t
253 val fmul : t -> t -> t -> t
254 val fdiv : t -> t -> t -> t
255 val fsqrt : t -> t -> t
256 val float_of_int : t -> t -> t
257 val normfr_mantissa : t -> t -> t
258 val frshiftexp : t -> t -> t
259 val ldshiftexp : t -> t -> t -> t
260 val next_up : t -> t -> t
261 val next_down : t -> t -> t
262
263 (* Function without check *)
264 val no_check_fopp : t -> t
265
266 val no_check_fabs : t -> t
267
268 val no_check_feq : t -> t -> t
269
270 val no_check_flt : t -> t -> t
271
272 val no_check_fle : t -> t -> t
273
274 val no_check_fcompare : t -> t -> t
275
276 val no_check_fequal : t -> t -> t
277
278 val no_check_fclassify : t -> t
279
280 val no_check_fadd : t -> t -> t
281
282 val no_check_fsub : t -> t -> t
283
284 val no_check_fmul : t -> t -> t
285
286 val no_check_fdiv : t -> t -> t
287
288 val no_check_fsqrt : t -> t
289
290 val no_check_float_of_int : t -> t
291
292 val no_check_normfr_mantissa : t -> t
293
294 val no_check_frshiftexp : t -> t
295
296 val no_check_ldshiftexp : t -> t -> t
297
298 val no_check_next_up : t -> t
299
300 val no_check_next_down : t -> t
301
302 (** Support for strings *)
303
304 val is_string : t -> bool
305
306 val no_check_string_make : t -> t -> t
307 val no_check_string_length : t -> t
308 val no_check_string_get : t -> t -> t
309 val no_check_string_sub : t -> t -> t -> t
310 val no_check_string_cat : t -> t -> t
311 val no_check_string_compare : t -> t -> t
312
313 val string_make : t -> t -> t -> t
314 val string_length : t -> t -> t
315 val string_get : t -> t -> t -> t
316 val string_sub : t -> t -> t -> t -> t
317 val string_cat : t -> t -> t -> t
318 val string_compare : t -> t -> t -> t
319
320 (** Support for arrays *)
321
322 val parray_of_array : t -> t -> t
323 val is_parray : t -> bool
324
325 val arraymake : t -> t -> t -> t -> t (* accu A n def *)
326 val arrayget : t -> t -> t -> t -> t (* accu A t n *)
327 val arraydefault : t -> t -> t -> t (* accu A t *)
328 val arrayset : t -> t -> t -> t -> t -> t (* accu A t n v *)
329 val arraycopy : t -> t -> t -> t (* accu A t *)
330 val arraylength : t -> t -> t -> t (* accu A t *)
331
332 val no_check_arraymake : t -> t -> t
333
334 val no_check_arrayget : t -> t -> t
335
336 val no_check_arraydefault : t -> t
337
338 val no_check_arrayset : t -> t -> t -> t
339
340 val no_check_arraycopy : t -> t
341
342 val no_check_arraylength : t -> t