aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/cinstr.mli
blob: f42c46175ccc2c2712040117e1ef6e7feb5e9f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
open Names
open Constr
open Cbytecodes

(** This file defines the lambda code for the bytecode compiler. It has been
extracted from Clambda.ml because of the retroknowledge architecture. *)

type uint =
  | UintVal of Uint31.t
  | UintDigits of lambda array
  | UintDecomp of lambda

and lambda =
  | Lrel          of Name.t * int
  | Lvar          of Id.t
  | Levar         of Evar.t * lambda array
  | Lprod         of lambda * lambda
  | Llam          of Name.t array * lambda
  | Llet          of Name.t * lambda * lambda
  | Lapp          of lambda * lambda array
  | Lconst        of pconstant
  | Lprim         of pconstant * int (* arity *) * instruction * lambda array
  | Lcase         of case_info * reloc_table * lambda * lambda * lam_branches
  | Lfix          of (int array * int) * fix_decl
  | Lcofix        of int * fix_decl (* must be in eta-expanded form *)
  | Lmakeblock    of int * lambda array
  | Lval          of structured_constant
  | Lsort         of Sorts.t
  | Lind          of pinductive
  | Lproj         of int * Constant.t * lambda
  | Luint         of uint

(* Cofixpoints have to be in eta-expanded form for their call-by-need evaluation
to be correct. Otherwise, memoization of previous evaluations will be applied
again to extra arguments (see #7333). *)

and lam_branches =
  { constant_branches : lambda array;
    nonconstant_branches : (Name.t array * lambda) array }

and fix_decl =  Name.t array * lambda array * lambda array