0
下面是一个简单的语言环境的一个示例:如何在locale中定义归纳谓词?
locale test =
fixes test_less_eq :: "'a ⇒ 'a ⇒ bool"
begin
inductive test_eq where
"test_less_eq x y ⟹ test_less_eq y x ⟹ test_eq x y"
end
它定义感应test_eq
。它可以使用definition
定义,但我需要它是一个归纳谓词。
然后我定义的语言环境的一个微不足道的解释,并尝试使用它:
interpretation interp: test "op <" .
inductive some_pred where
"interp.test_eq x y ⟹
some_pred x y"
code_pred [show_modes] some_pred .
的问题是,我得到了code_pred
以下错误:
Type mismatch of predicate test.test_eq (trying to match ?'a
⇒ ?'a ⇒ bool and ('a ⇒ 'a ⇒ bool)
⇒ 'a ⇒ 'a ⇒ bool) in ?x1 < ?y1 ⟹
?y1 < ?x1 ⟹ interp.test_eq ?x1 ?y1
是什么原因错误和如何解决它?