【发布时间】:2015-10-14 19:42:30
【问题描述】:
考虑以下片段:
import Data.List
%default total
x : Elem 1 [1, 2]
x = Here
type : Type
type = Elem 1 [1, 2]
y : type
y = Here
这给出了错误:
检查 y 的右侧时: 类型不匹配 Elem x (x :: xs) (这里的类型) 和 iType(预期类型)
y的类型,查询时为:
type : Type
-----------
y : type
是否可以在y的类型归属期间或之前强制评估type,使y的类型为Elem 1 [1, 2]?
我的用例是我希望能够定义通用谓词,以返回正确的命题术语以进行证明,例如:
subset : List a -> List a -> Type
subset xs ys = (e : a) -> Elem e xs -> Elem e ys
thm_filter_subset : subset (filter p xs) xs
【问题讨论】:
标签: theorem-proving idris