Add annotations to avoid evars
There are a few iApply
in theories/logrel/F_mu_ref_conc/binary/fundamental.v
that introduce evars, which causes the subsequent done
s to be very slow (~10s each). This was also very fragile to https://github.com/coq/coq/pull/19987.
Merge request reports
Activity
560 560 Theorem binary_fundamental Γ e τ : 561 561 Γ ⊢ₜ e : τ → ⊢ Γ ⊨ e ≤log≤ e : τ. 562 562 Proof. 563 induction 1. 564 - iApply bin_log_related_var; done. 563 elim=> {}Γ {e τ}. This is equivalent to
induction 1
elim; clear Γ e τ; intro Γ.
Edited by Quentin VERMANDE
580 - move=> e1 e2 τ1 τ2 ? ? ? ?. 581 iApply (bin_log_related_seq _ _ _ _ _ τ1); done. 582 - move=> e1 e2 τ1 τ2 ? ? ? ?. 583 iApply (bin_log_related_app _ _ _ _ _ τ1); done. 584 - intros; iApply bin_log_related_tlam; done. 585 - intros; iApply bin_log_related_tapp; done. 586 - intros; iApply bin_log_related_pack; done. 587 - intros; iApply bin_log_related_unpack; done. 588 - intros; iApply bin_log_related_fold; done. 589 - intros; iApply bin_log_related_unfold; done. 590 - intros; iApply bin_log_related_fork; done. 591 - intros; iApply bin_log_related_alloc; done. 592 - intros; iApply bin_log_related_load; done. 593 - move=> e1 e2 τ ? ? ? ?; iApply (bin_log_related_store _ _ _ _ _ τ); done. 594 - intros; iApply bin_log_related_CAS; done. 595 - intros; iApply bin_log_related_FAA; done. Something is wrong if we need to write different scripts for the different cases here -- they should all be entirely uniform.
Cc @amintimany @robbertkrebbers who wrote this code IIRC.
The behavior of Rocq on the different goals is not the same, since sometimes there are uninstantiated evars left in the goal by
iApply
, so I am not sure why the scripts should all be exactly the same. As it happens, Rocq spendsa minute and a halfhalf a minute here figuring out the correct values for these evars, and even more with the above mentioned PR.Edited by Quentin VERMANDEThe fact that Rocq takes 1 minute there seems like a bug (in Rocq or Iris).
Are you able to produce a minimal example?
Any idea if it's due to unification or TC resolution? Do you see an endless log if you enable
Typeclasses eauto := debug
.Edited by Robbert KrebbersThe behavior of Rocq on the different goals is not the same, since sometimes there are uninstantiated evars left in the goal by
iApply
, so I am not sure why the scripts should all be exactly the same.Each of these lemmas is specifically stated to match the case in this induction. So there shouldn't be large differences in what
iApply
has to do.Each of these lemmas is specifically stated to match the case in this induction. So there shouldn't be large differences in what
iApply
has to do.The issue is that
tau1
does not appear in the goal, so unless it is given explicitly, Rocq will not guess it until it reachesdone
and tries to apply the wrong hypothesis, which does indeed trigger an ages long unification.Sounds like unification. I wonder if this is the "usual" bug (due to Rocq's unification being a random number generator) and we should seal more. E.g., seal the semantic typing judgment.
That looks indeed to be the case, I killed Rocq at a million lines of log. That could be a solution. I have no idea how you seal things or what exactly would best be sealed, may I ask for help?