ssprove icon indicating copy to clipboard operation
ssprove copied to clipboard

Replace extructures with finmap

Open MarkusKL opened this issue 9 months ago • 12 comments

This issue is about replacing the dependecy extructures with finmap

In my attempt to do so I have made the following observations:

  • Advantage: finmap is based on choiceType rather than ordType, which would simplify this codebase
  • Advantage: finmap follows the development of math-comp more closely.
  • Incompatibility: unionm (extructures) is left-biased while + (finmap) is right-biased.
  • Missing: I have not been able to find suitable replacements for the following operations
    • mapm used to define package linking.
    • mapim used to define the identity module
    • mkfmap with notation [fmap ... ] used to generate a finmap from a list of key-value pairs.
    • A theory of permutations to be used by nomninal definitions.

MarkusKL avatar Apr 27 '25 16:04 MarkusKL

@CohenCyril, @arthuraa Do you have any input on this? Should these lemmas be moved/ported to finmap? https://github.com/arthuraa/extructures/issues/22

We can probably also upstream any utility libraries we create around this. e.g. from https://github.com/SSProve/ssprove/pull/65

spitters avatar May 13 '25 11:05 spitters

I have started porting some extructures definitions to finmap. Some features (e.g. the bias of unionm) might not make it, but maybe we could release a compatibility wrapper if there is interest.

I am drafting a standalone version of the permutation module of extructures as a separate library based on finmap.

arthuraa avatar May 13 '25 12:05 arthuraa

@MarkusKL Maybe you can give an overview here of your additions to finmap.

spitters avatar May 13 '25 12:05 spitters

There is also this development from 10 years ago: https://github.com/lewer/nominal-coq (joint work by @mattam82, @lewer and myself) that I started updating to mathcomp 2 in january, which contains some theory of finite permutations in a choiceType and nominal (choice)Types. I did not have time to finish the update to mathcomp 2 yet.

CohenCyril avatar May 14 '25 11:05 CohenCyril

Thanks @CohenCyril . FYI, we're trying to integrate @MarkusKL nominal-SSProve into the main repo. Maybe there's a possibility to refactor more to be inline with your work? github.com/MarkusKL/nominal-ssprove/blob/master/theories/Nominal.v

There's also work by @annenkov on using nominal sets in Rocq: https://github.com/annenkov/stlcnorm https://dannenkov.me/papers/nominal_slides.pdf

spitters avatar May 14 '25 12:05 spitters

FYI, I have ported the permutation library of extructures to use finmap:

https://github.com/arthuraa/finperm

arthuraa avatar May 21 '25 01:05 arthuraa

@CohenCyril What are the plans on nominal Rocq. Will it be moved to Rocq community? We can probably integrate @MarkusKL code into a joint library.

spitters avatar Jun 06 '25 13:06 spitters

This header introduces the extra fmap definitions: https://github.com/SSProve/ssprove/blob/main/theories/Crypt/package/fmap_extra.v#L13 They are defined in Prop to not require EqDec on the values of the map.

My work on nominals is to be included here over the next week: #82 Originating from nominal-ssprove.

MarkusKL avatar Jun 06 '25 14:06 MarkusKL

@CohenCyril Nominal SSProve has now been merged. Would it make sense to move the general nominal part to a more general place?

spitters avatar Aug 07 '25 12:08 spitters

@MarkusKL what is the status of this, now that nominal has been merged?

spitters avatar Sep 02 '25 10:09 spitters

The issues is still relevant since SSProve is still based on extructures.

MarkusKL avatar Sep 02 '25 19:09 MarkusKL

@CohenCyril there is now also this Nominal Sets library: https://arxiv.org/pdf/2509.25883

spitters avatar Oct 07 '25 11:10 spitters