【问题标题】:Why does Ltac not match the clause?为什么 Ltac 不匹配该子句?
【发布时间】:2023-02-10 22:00:04
【问题描述】:

在以下 Coq 证明中:

Ltac easy_ltac t  := match goal with
  | [Z: @eq nat t ?Y |- _ ] => pose ?Y as N 
  end.

Lemma easy: forall (n: nat), (n >= O)%nat.
Proof.
intros n. destruct n eqn: M.  easy_ltac n. 

我收到错误消息:“没有匹配的匹配子句。”,虽然我有假设

M : @eq nat n O

我不懂为什么。

【问题讨论】:

    标签: coq-tactic


    【解决方案1】:

    罪魁祸首是 Y 第二次出现之前的无关?

    如果你只是写它应该工作:

    Ltac easy_ltac t := match goal with
      | [Z: @eq nat t ?Y |- _ ] => pose Y as N 
      end.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-20
      • 2013-03-20
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多