簡體   English   中英

Coq關於Let定義的隱式參數的不一致行為

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM