aboutsummaryrefslogtreecommitdiff
path: root/kernel/declarations.ml
diff options
context:
space:
mode:
authorMaxime Dénès2018-06-23 12:48:08 +0200
committerMaxime Dénès2018-06-23 12:48:08 +0200
commit38b180984b09840e0b1023cc441917acc77dd438 (patch)
tree789a228bc09ea801116745dff353483d22fa605c /kernel/declarations.ml
parentf337d237c97db0b29619e15d21a022bba953a794 (diff)
parent50105b474cb2daaad997ebbd4eab096600dadcd9 (diff)
Merge PR #7750: Handle mutual records in the kernel
Diffstat (limited to 'kernel/declarations.ml')
-rw-r--r--kernel/declarations.ml21
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/declarations.ml b/kernel/declarations.ml
index 7bd7d6c9ca..58fb5d66b7 100644
--- a/kernel/declarations.ml
+++ b/kernel/declarations.ml
@@ -50,7 +50,7 @@ type inline = int option
always transparent. *)
type projection_body = {
- proj_ind : MutInd.t;
+ proj_ind : inductive;
proj_npars : int;
proj_arg : int; (** Projection index, starting from 0 *)
proj_type : types; (* Type under params *)
@@ -109,13 +109,22 @@ v}
*)
(** Record information:
- If the record is not primitive, then None
- Otherwise, we get:
+ If the type is not a record, then NotRecord
+ If the type is a non-primitive record, then FakeRecord
+ If it is a primitive record, for every type in the block, we get:
- The identifier for the binder name of the record in primitive projections.
- The constants associated to each projection.
- - The checked projection bodies. *)
+ - The checked projection bodies.
-type record_body = (Id.t * Constant.t array * projection_body array) option
+ The kernel does not exploit the difference between [NotRecord] and
+ [FakeRecord]. It is mostly used by extraction, and should be extruded from
+ the kernel at some point.
+*)
+
+type record_info =
+| NotRecord
+| FakeRecord
+| PrimRecord of (Id.t * Constant.t array * projection_body array) array
type regular_inductive_arity = {
mind_user_arity : types;
@@ -181,7 +190,7 @@ type mutual_inductive_body = {
mind_packets : one_inductive_body array; (** The component of the mutual inductive block *)
- mind_record : record_body option; (** The record information *)
+ mind_record : record_info; (** The record information *)
mind_finite : recursivity_kind; (** Whether the type is inductive or coinductive *)