What's the difference between Map and Mapping in Isabelle?

Viewed 139
1 Answers

Map.thy gives you some vocabulary to talk about partial functions, written as 'a ⇀ 'b, which is an abbreviation for '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. 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 e.g. things like asking for the domain of such a function will simply not be executable.

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.

So, short answer: Don't worry about Mapping except if (and when) you want to export executable code.

Related