Skip to content

Commit dbb6de3

Browse files
committed
Fix 'don't expose cases' in cbn
1 parent 8cee2c7 commit dbb6de3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pretyping/reductionops.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,14 @@ let rec whd_state_gen ?csts tactic_mode flags env sigma =
842842
let (tm',sk'),cst_l' =
843843
whrec (Cst_stack.add_cst (mkConstU const) cst_l) (body, app_sk)
844844
in
845-
if equal_stacks (x, app_sk) (tm', sk') || Stack.will_expose_iota sk'
845+
let rec is_case x = match kind_of_term x with
846+
| Lambda (_,_, x) | LetIn (_,_,_, x) | Cast (x, _,_) -> is_case x
847+
| App (hd, _) -> is_case hd
848+
| Case _ -> true
849+
| _ -> false in
850+
if equal_stacks (x, app_sk) (tm', sk')
851+
|| Stack.will_expose_iota sk'
852+
|| is_case tm'
846853
then fold ()
847854
else whrec cst_l' (tm', sk' @ sk)
848855
else match recargs with

pretyping/tacred.ml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,13 +597,6 @@ let reduce_proj env sigma whfun whfun' c =
597597
| _ -> raise Redelimination
598598
in redrec c
599599

600-
601-
let dont_expose_case = function
602-
| EvalVar _ | EvalRel _ | EvalEvar _ -> false
603-
| EvalConst c ->
604-
Option.cata (fun (_,_,z) -> List.mem `ReductionDontExposeCase z)
605-
false (ReductionBehaviour.get (ConstRef c))
606-
607600
let whd_nothing_for_iota env sigma s =
608601
let rec whrec (x, stack as s) =
609602
match kind_of_term x with

0 commit comments

Comments
 (0)