【发布时间】:2020-04-29 14:57:20
【问题描述】:
如果我试图证明 Nat 和 Bool 在 Agda 中不相等:
open import Data.Nat
open import Data.Bool
open import Data.Empty
open import Relation.Binary.PropositionalEquality
noteq : ℕ ≡ Bool -> ⊥
noteq ()
我得到错误:
Failed to solve the following constraints:
Is empty: ℕ ≡ Bool
我知道不可能对类型本身进行模式匹配,但令我惊讶的是编译器看不到 Nat 和 Bool 具有不同的(类型)构造函数。
有没有办法在 Agda 中证明这样的事情?还是不支持涉及 Agda 中类型的不等式?
【问题讨论】:
标签: functional-programming agda dependent-type