[英]What's the difference between Map and Mapping in Isabelle?
So I went to the internet, and I found these:所以我上网,我发现了这些:
https://isabelle.in.tum.de/library/HOL/HOL/Map.html (Map) https://isabelle.in.tum.de/library/HOL/HOL/Map.html (地图)
https://isabelle.in.tum.de/library/HOL/HOL-Library/Mapping.html (Mapping) https://isabelle.in.tum.de/library/HOL/HOL-Library/Mapping.html (映射)
Two theories beginning with the word "Map".以“地图”一词开头的两种理论。 I read through them for a good while and I couldn't really discern any notable differences between them.
我通读了很长时间,但我无法真正辨别它们之间的任何显着差异。 Is there a time when I should use the former rather than the latter and vice versa?
有没有时候我应该使用前者而不是后者,反之亦然?
Thanks in advance!提前致谢!
Map.thy
gives you some vocabulary to talk about partial functions, written as 'a ⇀ 'b
, which is an abbreviation for 'a ⇒ 'b option
. Map.thy
给你一些词汇来谈论偏函数,写成'a ⇀ 'b
,它是'a ⇒ 'b option
的缩写。
The Mapping
theory, on the other hand, wraps that into a new type of partial functions, which is useful for code generation.另一方面,
Mapping
理论将其包装成一种新型的偏函数,这对于代码生成很有用。 If you tried to export code for things involving partial functions of type 'a ⇀ 'b
, you would get literally 'a ⇒ 'b option
in the exported code, which means that eg things like asking for the domain of such a function will simply not be executable.如果您尝试为涉及
'a ⇀ 'b
类型的部分函数的事物导出代码,您将在导出的代码中得到字面上'a ⇒ 'b option
,这意味着例如询问此类 function 的域之类的事情将简单不可执行。
With Mapping
, on the other hand, you can export to a more sensible implementation of (finite) maps, such as association lists or red-black trees.另一方面,使用
Mapping
,您可以导出到更合理的(有限)映射实现,例如关联列表或红黑树。
So, short answer: Don't worry about Mapping
except if (and when) you want to export executable code.所以,简短的回答:不要担心
Mapping
,除非(以及何时)您想要导出可执行代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.