Skip to content
Snippets Groups Projects

Draft: Add law `map_fold_foldr` to `FinMap` interface.

Closed Robbert Krebbers requested to merge robbert/map_fold_foldr into master
1 unresolved thread

See the discussion at https://mattermost.mpi-sws.org/iris/pl/dmdsga9stjgebfwwnjmike56do

This rule expresses a form of "parametricity": it says that regardless of A, B, f, and b, the function map_fold f b m will always traverse the map m in the same order. Namely the order of converting the map into a list.

This law holds for all instances of FinMap we currently have, and I think without weird non-constructive axioms (that allow one to define non-parametric functions) it is impossible to define a FinMap instance that does not satisfy this law.

/cc @johannes @ivanbakel

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1317 1327 Proof. rewrite elem_of_map_to_set. naive_solver. Qed.
1318 1328
1319 1329 (** ** The fold operation *)
1320 Lemma map_fold_foldr {A B} (R : relation B) `{!PreOrder R} (l : list (K * A))
  • Robbert Krebbers marked this merge request as draft

    marked this merge request as draft

  • Marked as draft, don't review, since the proposed law might not be strong enough. See discussion on Mattermost.

  • Robbert Krebbers mentioned in merge request !566 (merged)

    mentioned in merge request !566 (merged)

  • Closing in favor of !566 (merged).

  • Please register or sign in to reply
    Loading