Coq 如何将set策略引入的变量添加到提示数据库中?

Coq 如何将set策略引入的变量添加到提示数据库中?,coq,Coq,我想使用一个提示数据库,其中包含set引入的变量。比如说, Example foo : forall n : nat, n + n = n + n. Proof. intro. set (m := n + n). Hint Unfold m. 但是,科克说: 错误:在当前环境中找不到引用m 有没有办法做到这一点,还是不可能 我使用的是Coq 8.7。不可能像您建议的那样执行此操作,因为使用Qed完成foo后,局部变量m将超出范围,但提示会直接进入某个全局数据库 但是,您可以使用节机

我想使用一个提示数据库,其中包含
set
引入的变量。比如说,

Example foo : forall n : nat, n + n = n + n.
Proof.
  intro.
  set (m := n + n).
  Hint Unfold m.
但是,科克说:

错误:在当前环境中找不到引用
m

有没有办法做到这一点,还是不可能


我使用的是Coq 8.7。

不可能像您建议的那样执行此操作,因为使用
Qed
完成
foo
后,局部变量
m
将超出范围,但提示会直接进入某个全局数据库

但是,您可以使用
机制,因为节中声明的提示是该节的本地提示:

Section LocalHints.

  Variable n : nat.
  Let m := n + n.
  Hint Unfold m.

  Example bar : m = m.
  Proof.
    autounfold with core.
    reflexivity.
  Qed.
End LocalHints.