Isabelle:构造函数使用公理化和数据类型有区别吗

Isabelle: Is there a difference between using axiomatization and datatype for constructors

基本上有两种方法可以为我的数据类型定义构造函数:

typedecl basicTest
datatype test= af basicTest | plus test test (infixl "+" 35)

或者我使用公理化:

typedecl basicTest
datatype test= af basicTest
axiomatization
plus :: "test ⇒ test ⇒ test " (infixl "+" 35)

我很幸运地没有意识到任何差异,但我想还是有一些 :D

有很多不同之处。只有前者为您的数据类型提供了正确的归纳原则,确保 plus a baf b 不同的引理,并且允许您通过 af 和 [ 上的模式匹配来定义函数=13=].

后者确实将 test 定义为与 basicTest 同构的类型,并声称其上存在一个未指定的函数 plus

换句话说,这两个定义定义了非常不同的类型(plus 的公理化不会改变类型)。

作为一般原则,可以在一些规范命令之后使用命令print_theorems,告诉哪些是表征新引入的逻辑实体的相关定理。或者,Prover IDE 提供一个带有 "Print context / theorems".

的查询面板

对于上述 typedeclaxiomatization(没有实际公理),结果为空。

对于 datatype 你会得到大量的事实,这些事实可能会在以后的证明中使用。

Side-remarks:

  • camel-case没有用在伊莎贝尔身上,words_are_separated_by_underscore
  • 类型名称、大多数常量名称等在 lower_case 中(主要例外:数据类型构造函数是大写的)
  • 理论名称大写(概念通常为单数)