[英]Inconsistent behavior of Coq concerning implicit parameters of Let definitions
我發現了Coq關於隱式參數的某種不一致行為。
Section foo.
Let id1 {t : Set} (x : t) := x.
Let id2 {t : Set} (x : t) : t. assumption. Qed.
Check id2 (1:nat).
Check id1 (1:nat). (* Fails with "The term "1:nat" has type "nat" while it is expected to have type "Set"." *)
End foo.
該Let
定義id1
似乎並沒有讓t
隱式的,而當你更換Let
通過Definition
不會發生錯誤。 我有什么不對或這是一個錯誤嗎?
我認為這是一個錯誤,是的。 在id1的情況下,忽略聲明隱式參數的符號,正如您可以使用Print Implicit id1
命令看到的那樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.