Overhaul of the `Infinite`/`Fresh` infrastructure.
- The class `Infinite A` is now defined as having a function `fresh : list A → A`, that given a list `xs`, gives an element `x ∉ xs`. - For most types this `fresh` function has a sensible computable behavior, for example: + For numbers, it yields one added to the maximal element in `xs`. + For strings, it yields the first string representation of a number that is not in `xs`. - For any type `C` of finite sets with elements of infinite type `A`, we lift the fresh function to `C → A`. As a consequence: - It is now possible to pick fresh elements from _any_ finite set and from _any_ list with elements of an infinite type. Before it was only possible for specific finite sets, e.g. `gset`, `pset`, ... - It makes the code more uniform. There was a lot of overlap between having a `Fresh` and an `Infinite` instance. This got unified.
Showing
- theories/base.v 18 additions, 8 deletionstheories/base.v
- theories/fin_sets.v 78 additions, 0 deletionstheories/fin_sets.v
- theories/gmap.v 0 additions, 6 deletionstheories/gmap.v
- theories/infinite.v 132 additions, 93 deletionstheories/infinite.v
- theories/nmap.v 0 additions, 17 deletionstheories/nmap.v
- theories/pmap.v 0 additions, 63 deletionstheories/pmap.v
- theories/sets.v 0 additions, 63 deletionstheories/sets.v
Loading
Please register or sign in to comment