作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图证明一个使用可判定相等的函数的一些简单的事情。这是一个非常简单的例子:
open import Relation.Nullary
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
module Foo {c} {ℓ} (ds : DecSetoid c ℓ) where
open DecSetoid ds hiding (refl)
data Result : Set where
something something-else : Result
check : Carrier → Carrier → Result
check x y with x ≟ y
... | yes _ = something
... | no _ = something-else
_≟_
的两边是相同的。
check-same : ∀ x → check x x ≡ something
check-same x = {!!}
(check ds x x | x ≟ x) ≡ something
。如果
x ≟ x
是单独的,我会使用类似
refl
的东西来解决它,但在这种情况下,我能想到的最好的方法是这样的:
check-same x with x ≟ x
... | yes p = refl
... | no ¬p with ¬p (DecSetoid.refl ds)
... | ()
最佳答案
由于我的函数(如示例中的函数)不关心 x ≟ y
返回的证明对象,因此我能够用返回 bool 值的 ⌊ x ≟ y ⌋
替换它。
这允许我写这个引理
≟-refl : ∀ x → ⌊ x ≟ x ⌋ ≡ true
≟-refl x with x ≟ x
... | yes p = refl
... | no ¬p = ⊥-elim (¬p (DecSetoid.refl ds))
rewrite
来简化我的证明
check-same x rewrite ≟-refl x = refl
关于agda - 涉及可判定相等的证明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13096297/
libnetfilter_queue 似乎只支持两个判断:NF_ACCEPT 和 NF_DROP。 NF_REJECT 是否有任何解决方法。 最佳答案 我想你可以使用 NF_Drop。它应该提供您正在
我是一名优秀的程序员,十分优秀!