I am a beginner and trying to figure out how to work with finite sets and maps in Coq. I want to define an inductive type X with a single constructor that takes as an argument a finite set of elements of type X, for example:
Inductive X : Set := | constr : FinSet X -> X.
I am unsure which data structure to use for finite sets here. I looked into the std++ library but do not understand the data structure provided there: Set_ seems to require two types, A and C, and I do not know why the second type C is needed. Ideally I want a finite set constructor that takes one type as an argument (the type of elements), which is countable but not necessarily ordered. I am a beginner so I have a hard time reading Coq library files; can someone maybe post a code snippet? Thank you.
stdpp
the type you want to use isgset
, defined ingmap.v
. $\endgroup$