我在isabelle中有以下两个表达式:
consts drives ::"(Person × Car) set"
type_synonym drives="(Person × Car) set"
它们的语义如何不同?
我认为 type_synonym 只是前面指定类型的简短名称。正确?
但 const 是为了什么? (Isabelle教程文档 - 第119页 - 说:"这是Isabelle在不定义它的情况下声明常量的方式。"但在什么意义上,上面的表达式可以是常数?!!)
由于
答案 0 :(得分:2)
实际上, type_synonym 只是指定类型的同义词,它不会引入任何新类型。
consts 只是声明您将定义给定类型的新常量,而不实际指定它的定义方式。 (注意,因为在Isabelle / HOL中,每种类型都是居住的,所以不需要证明这样的常数甚至可以存在)。之后,您可以定义可能已经使用新定义的常量的其他函数,定义等(在您的示例中为drives
,在下面的示例中为drives_c
)。在某些时候,您可以通过 defs 实际提供常量的定义。
type_synonym drives_t = "(int * nat) set"
consts drives_c :: "(int * nat) set"
(* test_drives already used drives_c *)
definition test_drives :: "int => bool" where
"test_drives x == (x, 5) : drives_c"
(* here, you actually define drives_c *)
defs drives_c_def: "drives_c == {(3,2), (7,5)}"
但是,可以通过定义更直接地执行标准定义。
definition drives_c :: drives_t where
"drives_c == {(3,2), (7,5)}"
希望这有帮助, 勒