Debian Codegraph @

kernel/genlambda.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 (** Intermediate language used by both the VM and native. *)
12
13 open Names
14 open Constr
15
16 type reloc_table = (int * int) array
17
18 type case_annot = case_info * reloc_table * Declarations.recursivity_kind
19
20 type 'v lambda
21
22 type 'v node =
23 | Lrel of Name.t * int
24 | Lvar of Id.t
25 | Levar of Evar.t * 'v lambda array (* arguments *)
26 | Lprod of 'v lambda * 'v lambda
27 | Llam of Name.t binder_annot array * 'v lambda
28 | Llet of Name.t binder_annot * 'v lambda * 'v lambda
29 | Lapp of 'v lambda * 'v lambda array
30 | Lconst of pconstant
31 | Lproj of Projection.Repr.t * 'v lambda
32 | Lprim of pconstant * CPrimitives.t * 'v lambda array
33 | Lcase of case_annot * 'v lambda * 'v lambda * 'v lam_branches
34 (* annotations, term being matched, accu, branches *)
35 | Lfix of (int array * inductive array * int) * 'v fix_decl
36 | Lcofix of int * 'v fix_decl
37 | Lint of int
38 | Lparray of 'v lambda array * 'v lambda
39 | Lmakeblock of inductive * int * 'v lambda array
40 (* inductive name, constructor tag, arguments *)
41 | Luint of Uint63.t
42 | Lfloat of Float64.t
43 | Lstring of Pstring.t
44 | Lval of 'v
45 | Lsort of Sorts.t
46 | Lind of pinductive
47
48 and 'v lam_branches =
49 { constant_branches : 'v lambda array;
50 nonconstant_branches : (Name.t binder_annot array * 'v lambda) array }
51
52 and 'v fix_decl = Name.t binder_annot array * 'v lambda array * 'v lambda array
53
54 type evars =
55 { evars_val : CClosure.evar_handler }
56
57 val empty_evars : Environ.env -> evars
58
59 (** {5 Manipulation functions} *)
60
61 val node : 'v lambda -> 'v node
62 val mkLapp : 'v lambda -> 'v lambda array -> 'v lambda
63 val mkLlam : Name.t binder_annot array -> 'v lambda -> 'v lambda
64 val unsafe_mkPArray : 'v lambda array -> 'v lambda -> 'v lambda
65 val unsafe_mkPArray_val : 'v -> 'v lambda -> 'v lambda
66 val decompose_Llam : 'v lambda -> Name.t binder_annot array * 'v lambda
67 val decompose_Llam_Llet : 'v lambda -> (Name.t binder_annot * 'v lambda option) array * 'v lambda
68
69 val free_rels : 'v lambda -> Int.Set.t
70
71 (* {5 Simplification} *)
72
73 val optimize : 'v lambda -> 'v lambda
74
75 (** {5 Translation functions} *)
76
77 val get_alias : Environ.env -> evars -> Constant.t -> Constant.t * bool array
78
79 module type S =
80 sig
81 type value
82 val as_value : int -> value lambda array -> value option
83 val check_inductive : inductive -> Declarations.mutual_inductive_body -> unit
84 end
85
86 module Make (Val : S) :
87 sig
88 val lambda_of_constr : Environ.env -> evars -> Constr.constr -> Val.value lambda
89 end
90
91 (** {5 Printing} *)
92
93 val pp_lam : 'v lambda -> Pp.t