Idris Nat类型中的文本

Idris Nat类型中的文本,idris,Idris,我想让Idris证明testMult:mult3=9是有人居住的 不幸的是,这被键入为 mult (fromInteger 3) (fromInteger 3) = fromInteger 9 : Type 我可以这样做: n3 : Nat; n3 = 3 n9 : Nat; n9 = 9 testMult : mult n3 n3 = n9 testMult = Refl 有没有类似于mult(3:Nat)(3:Nat)=(9:Nat)的方法?当类型推断失败时,您可以使用函数the:(a:

我想让Idris证明
testMult:mult3=9
是有人居住的

不幸的是,这被键入为

mult (fromInteger 3) (fromInteger 3) = fromInteger 9 : Type
我可以这样做:

n3 : Nat; n3 = 3
n9 : Nat; n9 = 9
testMult : mult n3 n3 = n9
testMult = Refl

有没有类似于
mult(3:Nat)(3:Nat)=(9:Nat)
的方法?

当类型推断失败时,您可以使用函数
the:(a:Type)->a->a
指定类型

testMult : the Nat (3 * 3) = the Nat 9
testMult = Refl
注意,您需要在等式的两侧都有
这个
,因为Idris具有异构等式,即,
(=):{a:Type}->{b:Type}->a->b->Type

或者,你可以写

testMult : the Nat 3 * the Nat 3 = the Nat 9
testMult = Refl
如果你喜欢那种风格