Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Types Isabelle:对构造函数使用公理化和数据类型有区别吗_Types_Constructor_Isabelle - Fatal编程技术网

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

Types Isabelle:对构造函数使用公理化和数据类型有区别吗,types,constructor,isabelle,Types,Constructor,Isabelle,基本上,有两种方法可以为我的数据类型定义构造函数: 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

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

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

有很多差异。只有前者为您的数据类型提供了正确的归纳原则,即确保
加上ab
af b
不同的引理,并允许您通过
af
加上
上的模式匹配来定义函数

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


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

作为一般原则,命令
打印定理
可以在一些规范命令之后使用,判断哪些是表征新引入的逻辑实体的相关定理。或者,Prover IDE提供一个带有“打印上下文/定理”的查询面板

对于上述
typedecl
公理化
(无实际公理),结果为空

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

旁白:

  • 在Isabelle中不使用驼峰格,单词用下划线分隔
  • 类型名、大多数常量名等都是小写的(主要例外:数据类型构造函数是大写的)
  • 理论名称大写(概念通常为单数)