【发布时间】:2016-01-26 10:19:29
【问题描述】:
我正在尝试在 BES 中定义变量的等级。 BES被定义为方程列表,变量是命题变量集合的居民,不是归纳类型:
Variable propVar : Set.
Definition rank (E:BES)(x:propVar) : nat :=
let fix block(E':BES)(curMu:bool) : nat :=
match E' with
| nil => fail
| cons (mu xc _) E2 =>
if xc=x then (if curMu then O else S(O))
else (if curMu then block E2 true else S(block E2 false))
| cons (nu xc _) E2 =>
if eqb xc x then (if curMu then S(O) else O)
else (if curMu then S(block E2 false) else block E2 true)
end
in
block E false.
但是,Coq 不接受这个定义,因为 xc=x 是 Prop 类型,而 Coq 需要 Bool 类型的东西。
是否可以在propVar 上定义类似于bool_dec 的可判定相等性,以便我可以使用它来代替xc=x?
【问题讨论】: