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

rewrite_strat in functor Ltac gives anomalies when called #18463

Closed
JasonGross opened this issue Jan 3, 2024 · 0 comments · Fixed by #18094
Closed

rewrite_strat in functor Ltac gives anomalies when called #18463

JasonGross opened this issue Jan 3, 2024 · 0 comments · Fixed by #18094
Assignees
Labels
kind: anomaly An uncaught exception has been raised. part: modules The module system of Coq. part: rewriting tactics The rewrite, autorewrite, rewrite_strat, and setoid_rewrite tactics.
Milestone

Comments

@JasonGross
Copy link
Member

Module Type Nop. End Nop.
Module nop. End nop.

Module RewriteStratSubstTestF (Nop : Nop).
  Axiom X : Set.

  Axiom f : X -> X.
  Axiom g : X -> X -> X.
  Axiom h : nat -> X -> X.

  Axiom lem0 : forall x, f (f x) = f x.
  Axiom lem1 : forall x, g x x = f x.
  Axiom lem2 : forall n x, h (S n) x = g (h n x) (h n x).
  Axiom lem3 : forall x, h 0 x = x.
  Definition idnat := @id nat.

  Ltac rs1 := rewrite_strat topdown lem2.
  Ltac rs2 := rewrite_strat topdown fold idnat.
  Ltac rs3 := rewrite_strat subterms lem2.
  Ltac rs4 := rewrite_strat eval cbv delta [idnat].
End RewriteStratSubstTestF.

Module RewriteStratSubstTest := RewriteStratSubstTestF nop.

Goal forall x, RewriteStratSubstTest.h 6 x = RewriteStratSubstTest.f x /\ RewriteStratSubstTest.idnat 5 = id 5.
  intros.
  Print Ltac RewriteStratSubstTest.rs1. (* Ltac RewriteStratSubstTest.rs1 := Coq.Init.Ltac.rewrite_strat_#_521927FC _ (* Generic printer *) *)
  RewriteStratSubstTest.rs1. (* Error: Anomaly "Constant rewrite_strat.RewriteStratSubstTestF.lem2 does not appear in the environment."
Please report at http://coq.inria.fr/bugs/. *)
Undo 1.
  RewriteStratSubstTest.rs2.
Undo 1.
  RewriteStratSubstTest.rs3.
Undo 1.
  RewriteStratSubstTest.rs4.
Undo 1.
  split; reflexivity.
Qed.
@JasonGross JasonGross added part: modules The module system of Coq. kind: anomaly An uncaught exception has been raised. part: rewriting tactics The rewrite, autorewrite, rewrite_strat, and setoid_rewrite tactics. labels Jan 3, 2024
@JasonGross JasonGross self-assigned this Jan 3, 2024
JasonGross added a commit to JasonGross/coq that referenced this issue Jan 3, 2024
Support module substitution of rewrite strategies.

Fixes coq#18463
JasonGross added a commit to JasonGross/coq that referenced this issue Jan 3, 2024
Support module substitution of rewrite strategies.

Fixes coq#18463
JasonGross added a commit to JasonGross/coq that referenced this issue Jan 3, 2024
Support module substitution of rewrite strategies.

Fixes coq#18463
JasonGross added a commit to JasonGross/coq that referenced this issue Jan 3, 2024
Support module substitution of rewrite strategies.

Fixes coq#18463
@coqbot-app coqbot-app bot closed this as completed in b48ef88 Jan 5, 2024
@coqbot-app coqbot-app bot modified the milestone: 8.20+rc1 Jan 5, 2024
louiseddp pushed a commit to louiseddp/coq that referenced this issue Feb 27, 2024
Support module substitution of rewrite strategies.

Fixes coq#18463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: anomaly An uncaught exception has been raised. part: modules The module system of Coq. part: rewriting tactics The rewrite, autorewrite, rewrite_strat, and setoid_rewrite tactics.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant