Ltac checkForall H :=
let T := type of H in
match T with
| forall x, ?P x =>
idtac
| _ =>
fail 1 "not a forall"
end.
Example test : (forall x, x) -> True.
Proof.
intros H.
Fail checkForall H. (* not a forall *)
Abort.
私は素朴に成功することを期待checkForall H
しますが、そうではありません。
Adam Chlipalaは、彼の著書Certified Programming with Dependent Typesで、依存型に対するパターン マッチングの制限について説明しています。
問題は、統合変数にローカルにバインドされた変数が含まれていない可能性があることです。
これが私がここで見ている動作の理由ですか?