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

Ltac, move:, and name resolution #6687

Open
vbgl opened this issue Feb 2, 2018 · 3 comments
Open

Ltac, move:, and name resolution #6687

vbgl opened this issue Feb 2, 2018 · 3 comments
Labels
part: ssreflect The SSReflect proof language.

Comments

@vbgl
Copy link
Contributor

vbgl commented Feb 2, 2018

A name, that is bound in a Ltac tactic, fails to be resolved when the tactic is used in a different module. A minimal non-working example follows. The expected behavior is the one of generalize, so it seems a bug related to the move: tactic.

Versions

The Coq Proof Assistant, version 8.7.1 (January 2018)
compiled on Jan 20 2018 9:56:24 with OCaml 4.04.2

The Coq Proof Assistant, version 8.8+alpha (February 2018)
compiled on Feb 2 2018 13:36:42 with OCaml 4.04.2

Operating system

macOS

Description of the problem

a.v

Require Import ssreflect.

Definition truth := I.

Ltac t :=
  move: truth.

Ltac t' :=
  generalize truth.

b.v

Require a.

Goal True.
  Fail a.t.
(* The reference truth was not found in the current environment. *)
  a.t'.
  refine (@id _).
Qed.
gares added a commit to gares/coq that referenced this issue Feb 5, 2018
gares added a commit to gares/coq that referenced this issue Feb 5, 2018
@Zimmi48 Zimmi48 added the part: ssreflect The SSReflect proof language. label Aug 20, 2018
@Zimmi48
Copy link
Member

Zimmi48 commented Aug 20, 2018

@gares It seems like you had started working on this issue. What stopped you?

@gares
Copy link
Member

gares commented Aug 24, 2018

I've opened #8314 with that commit, it needs a rebase I guess.
I think I did not open the PR when I made the commit because the fix is partial, and the full fix is much more involved. But yea, better than nothing.

@eponier
Copy link
Contributor

eponier commented Jan 13, 2022

Actually, it seems that truth is evaluated in the context where the tactic is called.

Require Import ssreflect.

Module Import A.
Definition truth := I.

Ltac t :=
  move: truth.

Ltac t' :=
  generalize truth.
End A.

Definition truth := 2.
Goal True.
  t.
  (* nat -> True *)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: ssreflect The SSReflect proof language.
Projects
None yet
Development

No branches or pull requests

4 participants