2
我在Coq中抄錄了2008 PHOAS paper第2.1節中的(非正式)定義。PHOAS in Coq:type mismatch
Inductive tm' {V : Set} : Set :=
| Var : V -> tm'
| App : tm' -> tm' -> tm'
| Abs : (V -> tm') -> tm'.
Definition tm := forall X, @tm' X.
Fail Example id : tm := Abs Var.
輸出:
The term "Abs Var" has type "tm'" while it is expected to have type "tm".
這是相當討厭。我怎樣才能使這種代碼類型檢查?
請使用您問題上的編輯鏈接添加其他信息。後回答按鈕應該只用於問題的完整答案。 - [來自評論](/ review/low-quality-posts/16533671) –
從Jason Gross的回答可以看出,這確實是一個完整的答案。 –