【发布时间】:2020-03-02 05:31:35
【问题描述】:
这里有一段代码:
-- transitivity
trans : {A : Set} {x y z : A} -> x == y -> y == z -> x == z
trans refl refl = refl
union-pair' : {A : Set} -> (m n : S {A}) -> (x : A) ->
(ismember (set-union (set-pair m n)) x) == (ismember (union m n) x)
union-pair' m n x with ismember m x | ismember n x | ismember (set-union (set-pair m n)) x
union-pair' : {A : Set} -> (m n : S {A}) -> (x : A) ->
(ismember (set-union (set-pair m n)) x) == (ismember (union m n) x)
union-pair' m n x with ismember m x | ismember n x | ismember (set-union (set-pair m n)) x
... | false | false | false = trans {x = ismember (set-union (set-pair m n)) x} {y = false}
refl -- line #102
(union-match m n x)
-- more code available on request, although I can't see why that would matter
产生错误:
code.agda:102,54-58
(ismember (set-union (set-pair m n)) x) != false of type Bool
when checking that the expression refl has type
ismember (set-union (set-pair m n)) x == false
我有一个with 声明,它准确地确定了ismember (set-union (set-pair m n)) x 是false 的事实。为什么不能确定是false?
好的,我什至可以看到一些已知问题 https://agda.readthedocs.io/en/v2.5.2/language/with-abstraction.html#ill-typed-with-abstractions,但对于如何进行模式匹配仍然没有更明智的选择。
【问题讨论】:
标签: agda