aboutsummaryrefslogtreecommitdiff
path: root/kernel/reduction.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-09-28 18:55:30 +0200
committerPierre-Marie Pédrot2020-04-06 14:51:54 +0200
commit45e14bdb854fe5da40c2ed1d9ca575ae8d435d36 (patch)
tree7bc43cb8e9561e1355ad99ddd0f10004e1bdf7d4 /kernel/reduction.ml
parent2089207415565e8a28816f53b61d9292d04f4c59 (diff)
Use lists instead of arrays in evar instances.
This corresponds more naturally to the use we make of them, as we don't need fast indexation but we instead keep pushing terms on top of them.
Diffstat (limited to 'kernel/reduction.ml')
-rw-r--r--kernel/reduction.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index 7574d7b21e..4ff90dd70d 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -367,9 +367,9 @@ and eqappr cv_pb l2r infos (lft1,st1) (lft2,st2) cuniv =
let el1 = el_stack lft1 v1 in
let el2 = el_stack lft2 v2 in
let cuniv = convert_stacks l2r infos lft1 lft2 v1 v2 cuniv in
- convert_vect l2r infos el1 el2
- (Array.map (mk_clos env1) args1)
- (Array.map (mk_clos env2) args2) cuniv
+ convert_list l2r infos el1 el2
+ (List.map (mk_clos env1) args1)
+ (List.map (mk_clos env2) args2) cuniv
else raise NotConvertible
(* 2 index known to be bound to no constant *)
@@ -702,6 +702,13 @@ and convert_branches l2r infos ci e1 e2 lft1 lft2 br1 br2 cuniv =
in
Array.fold_right3 fold ci.ci_cstr_nargs br1 br2 cuniv
+and convert_list l2r infos lft1 lft2 v1 v2 cuniv = match v1, v2 with
+| [], [] -> cuniv
+| c1 :: v1, c2 :: v2 ->
+ let cuniv = ccnv CONV l2r infos lft1 lft2 c1 c2 cuniv in
+ convert_list l2r infos lft1 lft2 v1 v2 cuniv
+| _, _ -> raise NotConvertible
+
let clos_gen_conv trans cv_pb l2r evars env univs t1 t2 =
let reds = CClosure.RedFlags.red_add_transparent betaiotazeta trans in
let infos = create_clos_infos ~evars reds env in