Skip to content
Snippets Groups Projects

Draft: Overlay for PR#15518

Closed Matthieu Sozeau requested to merge mattam82/stdpp:coq-pr-15518 into master
3 unresolved threads

This is an overlay for Coq PR #15518: moving apply to the evar-based unifier. This includes a breaking fix for apply of conjunction which has the unnatural behavior of trying Q -> P before P -> Q when applying a P <-> Q hypothesis. I think the rest is backwards compatible: mostly about using eapply in places where new existential are created, which the new apply forbids (rightfully).

Edited by Ralf Jung

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
3994 3994 Qed.
3995 3995 Lemma NoDup_fmap_2 `{!Inj (=) (=) f} l : NoDup l NoDup (f <$> l).
3996 3996 Proof. apply NoDup_fmap_2_strong. intros ?? _ _. apply (inj f). Qed.
3997 Lemma NoDup_fmap `{!Inj (=) (=) f} l : NoDup (f <$> l) NoDup l.
3997 Lemma NoDup_fmap `{!Inj (=) (=) f} l : NoDup l NoDup (f <$> l).
  • 1263 1263 m !! i = Some x
    1264 1264 P (i, x)
    1265 1265 filter P m !! i = Some x.
    1266 Proof. intros. by apply map_filter_lookup_Some. Qed.
    1266 Proof. intros. by apply (proj2 (map_filter_lookup_Some _ _ _)). Qed.
  • 1021 1021 Lemma Qp_add_le_mono_r p q r : p q p + r q + r.
    1022 1022 Proof. rewrite !(comm_L Qp_add _ r). apply Qp_add_le_mono_l. Qed.
    1023 1023 Lemma Qp_add_le_mono q p n m : q n p m q + p n + m.
    1024 Proof. intros. etrans; [by apply Qp_add_le_mono_l|by apply Qp_add_le_mono_r]. Qed.
    1024 Proof. intros. etrans; [by eapply Qp_add_le_mono_l|by apply Qp_add_le_mono_r]. Qed.
  • This includes a breaking fix for apply of conjunction which has the unnatural behavior of trying Q -> P before P -> Q when applying a P <-> Q hypothesis.

    Especially considering the NoDup_fmap example and the inconsistency with rewrite, I'm not sure what's the "right" direction to try first. What's the reason why you favor left-to-right first over right-to-left first?

  • The main issue I see is that if you apply R A B when R is a record the projections are tried in left to right order, while when R is only an inductive type with a single constructor they are tried right to left. It's just an unnecessary discrepancy in apply's code. But let's leave it to another PR :) The new overlay doesn't change this anymore.

  • added 1 commit

    Compare with previous version

  • Ok, sounds like a good idea to leave that (discussion) for later.

    What's the status of this MR? It's marked as "Draft". Does this mean it's blocked on the Coq PR? For what it is worth, the changes seem fine to me on a quick look.

  • Ralf Jung changed the description

    changed the description

  • @mattam82 it is not clear to us what the status of this MR is, but it doesn't seem to be immediately actionable on our side? We are going to close the MR, but feel free to reopen when you get back to this.

  • closed

  • Please register or sign in to reply
    Loading