Agda,with关键字和refl

时间:2018-07-14 07:50:12

标签: agda

TL;我想要的DR:

f with g
f | constructor1 val = {!!}

在该目标的背景下,如何获得g ≡ constructor1 val类型的东西?


我对平等的定义如下:

data _≡_ {a} {A : Set a} (x : A) : A → Set a where
    refl : x ≡ x

以及函数定义的以下子句(对不起,我在那里没有定义的所有函数;类型很重要,最后只有一个目标是正确的):

f (negSucc a) (negSucc x) c d pr with (negSucc x +Z nonneg d)
f (negSucc a) (negSucc x) c d pr | nonneg int = identityOfIndiscernablesRight (negSucc a +Z nonneg (succ c)) (nonneg (succ int)) (negSucc x +Z nonneg (succ d)) _≡_ (addNonnegSucc (negSucc a) c int pr) (equalityCommutative (addNonnegSucc (negSucc x) d int {!refl!}))

孔的类型必须为negSucc x +Z nonneg d ≡ nonneg int

但是,即使refl子句将nonneg int定义为等于withnegSucc x +Z nonneg d也不会在那里进行类型检查。

0 个答案:

没有答案