让路径归纳在Agda中工作

use*_*420 4 types agda

我无法弄清楚为什么我的路径归纳不是正确的类型检查.当提到C(refl x)时,它说"C x应该是一个函数类型,但它不是".也许我对refl的定义是错误的,或者我的{}和()有什么问题?

data _?_ {A : Set}(a : A) : A ? Set where
      refl : a ? a
infix 4 _?_

pathInd : ? {u} ? {A : Set} ? 
          (C : {x y : A} ? x ? y ? Set u) ? 
          (c : (x : A) ? C (refl x)) ? 
          ({x y : A} (p : x ? y) ? C p)
pathInd C c (refl x) = c x
Run Code Online (Sandbox Code Playgroud)

use*_*465 7

refl不是一个功能.这是您需要的定义:

pathInd : ? {u} ? {A : Set} ? 
          (C : {x y : A} ? x ? y ? Set u) ? 
          (c : (x : A) ? C {x} refl) ? 
          ({x y : A} (p : x ? y) ? C p)
pathInd C c {x} refl = c x
Run Code Online (Sandbox Code Playgroud)

此外,您的pathInd正确定义_?_:

data _?_ {A : Set} : A ? A ? Set where
      refl : ? a -> a ? a
Run Code Online (Sandbox Code Playgroud)