Skip to content

Commit c8587b4

Browse files
committed
wip
1 parent 0d62bc4 commit c8587b4

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

pretyping/evarconv.ml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty
10361036
let appr2 = whd_betaiota_deltazeta_for_iota_state flags.open_ts env sigma vsk2' in
10371037
get_cs flags env sigma p1 appr1 appr2 in
10381038
ise_try sigma [eq_head appr1 appr2; cs; red] in
1039-
let () = debug_unification (fun () -> Pp.(v 0 (str "main loop" ++ pr_state env evd appr1 ++ cut () ++ pr_state env evd appr2 ++ cut ()))) in
1039+
let () = debug_unification (fun () -> Pp.(v 0 (str "main loop " ++ pr_state env evd appr1 ++ cut () ++ pr_state env evd appr2 ++ cut () ++ str "last reduction was " ++ str (match lastUnfolded with None -> "none" | Some true -> "RHS" | _ -> "LHS") ++ cut() ))) in
10401040
match (match (flex_kind_of_term flags env evd term1 sk1,
10411041
flex_kind_of_term flags env evd term2 sk2) with
10421042
| Flexible (sp1,al1), Flexible (sp2,al2) ->
@@ -1124,7 +1124,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty
11241124
flags.open_ts env evd vsk1')
11251125
(whd_betaiota_deltazeta_for_iota_state
11261126
flags.open_ts env evd vsk2'))]
1127-
| Proj.CS p1, _ ->
1127+
| Proj.CS p1, _ when flags.with_cs ->
11281128
let () = debug_unification (fun () -> Pp.(v 0 (str "LHS is CS" ++ cut ()))) in
11291129
ise_try evd [
11301130
(fun i ->
@@ -1137,7 +1137,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty
11371137
evar_eqappr_x flags env evd pbty hds (Some true) appr1
11381138
(whd_betaiota_deltazeta_for_iota_state
11391139
flags.open_ts env evd vsk2'))]
1140-
| _, Proj.CS p2 ->
1140+
| _, Proj.CS p2 when flags.with_cs ->
11411141
let () = debug_unification (fun () -> Pp.(v 0 (str "RHS is CS" ++ cut ()))) in
11421142
ise_try evd [
11431143
(fun i ->
@@ -1153,9 +1153,12 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty
11531153
appr2)]
11541154
| Proj.Reducible n1, Proj.Reducible n2 ->
11551155
let () = debug_unification (fun () -> Pp.(v 0 (str "both sides are reducible" ++ cut ()))) in
1156-
let appr1 = whd_betaiota_deltazeta_for_iota_state flags.open_ts env evd vsk1' in
1157-
let appr2 = whd_betaiota_deltazeta_for_iota_state flags.open_ts env evd vsk2' in
1158-
evar_eqappr_x flags env evd pbty (if n1 = n2 then (appr1, appr2) else hds) None appr1 appr2
1156+
ise_try evd [
1157+
(fun evd -> let appr1 = whd_betaiota_deltazeta_for_iota_state flags.open_ts env evd vsk1' in
1158+
let appr2 = whd_betaiota_deltazeta_for_iota_state flags.open_ts env evd vsk2' in
1159+
evar_eqappr_x flags env evd pbty (if n1 = n2 then (appr1, appr2) else hds) None appr1 appr2);
1160+
eq_head]
1161+
11591162
| Proj.Reducible _, _ ->
11601163
let () = debug_unification (fun () -> Pp.(v 0 (str "LHS is reducible" ++ cut ()))) in
11611164
evar_eqappr_x flags env evd pbty hds (Some false)
@@ -1249,7 +1252,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty
12491252
if (not flags.with_cs) || lastUnfolded = Some false then UnifFailure (i,NoCanonicalStructure)
12501253
else
12511254
(match get_proj_case appr2 with
1252-
| Proj.CS p2 ->
1255+
| Proj.CS p2 when flags.with_cs ->
12531256
let () = debug_unification (fun () -> Pp.(v 0 (str "CS with rigid LHS" ++ cut ()))) in
12541257
get_cs flags env evd p2 appr2 (fst hds)
12551258
| _ -> quick_fail i)
@@ -1491,9 +1494,7 @@ and eta_constructor flags env evd ((ind, i), u) sk1 (term2,sk2) =
14911494
EConstr.mkProj (Projection.make p false, r, term))
14921495
(Array.to_list projs)
14931496
in
1494-
let () = debug_unification (fun () -> Pp.(v 0 (str "eta_constructor: ts" ++ cut ()))) in
14951497
let f i t1 t2 = evar_conv_x { flags with with_cs = false } env i CONV t1 t2 in
1496-
let () = debug_unification (fun () -> Pp.(v 0 (str "eta_constructor: ls" ++ cut ()))) in
14971498
ise_list2 evd f l1' l2'
14981499
with
14991500
| Failure _ ->
@@ -1503,21 +1504,21 @@ and eta_constructor flags env evd ((ind, i), u) sk1 (term2,sk2) =
15031504
| _ -> UnifFailure (evd,NotSameHead)
15041505

15051506
let evar_conv_x flags env evd pbty term1 term2 =
1506-
debug_unification Pp.(fun () ->
1507+
(*debug_unification Pp.(fun () ->
15071508
str "Starting unification:" ++ spc() ++
15081509
Termops.Internal.print_constr_env env evd term1 ++
15091510
(match pbty with CONV -> strbrk " =~= " | CUMUL -> strbrk " <~= ") ++
1510-
Termops.Internal.print_constr_env env evd term2);
1511+
Termops.Internal.print_constr_env env evd term2);*)
15111512
let res =
15121513
evar_conv_x flags env evd pbty term1 term2
15131514
in
1514-
let () = debug_unification Pp.(fun () ->
1515+
(*let () = debug_unification Pp.(fun () ->
15151516
let success = match res with
15161517
| Success _ -> "success"
15171518
| UnifFailure _ -> "failure"
15181519
in
15191520
str "Leaving unification with " ++ str success)
1520-
in
1521+
in*)
15211522
res
15221523

15231524
let evar_unify = conv_fun evar_conv_x

0 commit comments

Comments
 (0)