I am trying to use a tree based map in Coq, specifically Coq.FSets.FMapAVL.
I found this 4 year old question: Finite map example
Looking at the standard lib documentation referenced in the comments, I see this note:
NB: This file is here only for compatibility with earlier version of FSets and FMap. Please use Structures/Orders.v directly now.
What does this mean? When I google "Structures.v" or "Orders.v" I always end up at other documentation pages with related deprecation warnings.
What is the proper, non-deprecated way to use an FMap in Coq 8.6?
Since the
OrderedTypeExmodule is deprecated, we won't useNat_as_OTdefined in it.There is
Nat_as_OTinOrdersEx(just a synonym forPeanoNat.Nat), which is useful for our purposes.Unfortunately, the following code
won't work, because signatures
OrderedType.OrderedType(currently used byFMapAVL) andOrders.OrderedTypeare not compatible.However, the
OrdersAltmodule contains functors, which allow to build a module of one type from another. In this case, we are interested inBackport_OT. The following code shows how to useFMapAVL.Make, the rest of the code can be copied from the linked question:The situation with
FMapAVLwas explained by Pierre Letouzey in this Coq-Club post: