New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cbn
and /=
have different behaviors when SimplIsCbn
#17251
Comments
Apparently From Coq Require Import ssreflect.
Set SimplIsCbn.
Section Iteration.
Variable T : Type.
Definition iter (n : nat) (f : T -> T) (x : T) :=
let fix loop m := if m is S i then f (loop i) else x in loop n.
Arguments iter !n f x /.
Lemma iterSr n f x : iter (S n) f x = iter n f (f x).
Proof.
(* unfolds [iter], does not reduce the fixpoint, and does not refold [iter]: *)
elim: n => //=.
Restart.
(* unfolds [iter], reduces the fixpoint, and does not refold [iter]: *)
elim: n => //. cbn.
Restart.
(* unfolds [iter], reduces the fixpoint, and refolds [iter]: *)
elim: n => //. rewrite /=.
Abort.
End Iteration. ping @gares |
In the case of coq/plugins/ssr/ssrequality.ml Lines 45 to 49 in 1556881
SimplIsCbn flag is handled by reduction_of_red_expr_val : Lines 254 to 257 in 1556881
In the case of coq/plugins/ssr/ssrequality.ml Line 231 in 1556881
SimplIsCbn flag (given that Tacred.simpl is invoked by reduction_of_red_expr_val above): Lines 1080 to 1085 in 1556881
So, the issue seems twofold:
Apparently, we can also conclude that |
Indeed, Definition iter n f x := let fix loop m := if m is S i then f (loop i) else x in loop n. In particular |
@pi8027, sorry for the delay, I realize only now that you posted this comment.
What #18601 does is only to address an issue with mutual fix. Regarding non-standard global fixpoints (e.g. of the form Regarding Finally, regarding |
Description of the problem
I attempted to globally set
SimplIsCbn
in MathComp to see what happens and discovered the following issue.Coq Version
8.16.1
The text was updated successfully, but these errors were encountered: