Skip to content
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 leaves behind unnamable constants when asked to reduce Pos.add_carry #17897

Closed
JasonGross opened this issue Jul 28, 2023 · 1 comment · Fixed by #18616
Closed

cbn leaves behind unnamable constants when asked to reduce Pos.add_carry #17897

JasonGross opened this issue Jul 28, 2023 · 1 comment · Fixed by #18616
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: reduction strategies The Strategy command for defining reduction straegies. part: tactics
Milestone

Comments

@JasonGross
Copy link
Member

Description of the problem

From Coq Require Import PArith.
Local Open Scope positive_scope.
Goal Pos.add 1021 53 = Pos.add 1021 53.
  assert_succeeds (cbv [Pos.add Pos.add_carry Pos.succ]; assert_fails progress cbv).
  assert_succeeds (cbn; assert_fails progress cbv).
  cbn [Pos.add Pos.add_carry Pos.succ]; assert_succeeds progress cbv. (* huh? *)

  lazymatch goal with
  | [ |- (?f 510 26)~0 = (?f 510 26)~0 ]
    => unify f Pos.add_carry;
       idtac f (* Pos.add_carry *)
  end.
  Fail lazymatch goal with
  | [ |- (?f 510 26)~0 = (?f 510 26)~0 ]
    => constr_eq f Pos.add_carry
       end.
  (* The command has indeed failed with message:
Tactic failure: Not equal.
   *)
  Fail progress cbv [Pos.add_carry].
  (* The command has indeed failed with message:
Failed to progress.
   *)
  Set Debug "Cbv".
  cbv [Coq.PArith.BinPos.Pos.add_carry].
  (* Huh? Debug: [Cbv] Not unfolding Coq.PArith.BinPos.Pos.add_carry
Debug: [Cbv] Not unfolding Coq.PArith.BinPos.Pos.add_carry
*)
  cbv. (* Debug: [Cbv] Unfolding Coq.PArith.BinPos.Pos.add_carry
Debug: [Cbv] Unfolding Coq.PArith.BinPos.Pos.succ
*)

Presumably this is something to do with mismatched kernel/canonical names?

Coq Version

8.17

@JasonGross JasonGross added part: tactics kind: bug An error, flaw, fault or unintended behaviour. part: reduction strategies The Strategy command for defining reduction straegies. labels Jul 28, 2023
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 3, 2024
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 3, 2024
@herbelin
Copy link
Member

herbelin commented Feb 3, 2024

Indeed a canonical/user name problem! Fixed in #18616.

herbelin added a commit to herbelin/github-coq that referenced this issue Feb 3, 2024
herbelin added a commit to herbelin/github-coq that referenced this issue Feb 3, 2024
coqbot-app bot added a commit that referenced this issue Feb 4, 2024
…nstants of mutual fix/cofix at refolding time in "cbn"

Reviewed-by: ppedrot
Co-authored-by: ppedrot <ppedrot@users.noreply.github.com>
@coqbot-app coqbot-app bot added this to the 8.20+rc1 milestone Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour. part: reduction strategies The Strategy command for defining reduction straegies. part: tactics
Projects
None yet
2 participants