Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI and kernel out of sync from aborting tactics? #764

Open
AndreasLoow opened this issue Apr 25, 2024 · 1 comment
Open

UI and kernel out of sync from aborting tactics? #764

AndreasLoow opened this issue Apr 25, 2024 · 1 comment

Comments

@AndreasLoow
Copy link
Contributor

Hi,

it seems that aborting long-running tactics (using C-c C-c) can cause the UI and kernel to go out of sync. I have noticed this with CoqHammer's tactics specifically, e.g. best or sauto. I initially reported this problem as CoqHammer issue here: lukaszcz/coqhammer#180. However, after Łukasz pointed that it is unlikely that it is something CoqHammer is doing causing this problem I tried the CoqHammer tactics in both Coqtail and vscode and indeed the same issue seems to not appear there.

The following seems to be a somewhat reliable way to reproduce an example of the issue. Take this proof script (just some fragment from the Coq standard library with CoqHammer loaded):

From Coq Require Import List.

From Hammer Require Import Tactics.

Import ListNotations.

Fixpoint nth_ok {A : Type} (n:nat) (l:list A) (default:A) : bool :=
  match n, l with
    | O, x :: l' => true
    | O, other => false
    | S m, [] => false
    | S m, x :: t => nth_ok m t default
  end.

Lemma nth_in_or_default : forall (A:Type) (n:nat) (l:list A) (d:A),
 {In (nth n l d) l} + {nth n l d = d}.
Proof.
 best.

Now, invoking best and aborting (using C-c C-c) a few times seems to confuse the UI of Proof General. E.g. if you C-c Enter just before the Fixpoint definition and then try to move beyond it (e.g. doing C-c Enter just after it), then Coq complains that the definition exists already.

Could this be a Proof General problem? I haven't noticed this with any long-running non-CoqHammer tactics, such as e.g. firstorder.

@z5146542
Copy link

Also facing the same issue using Proof General – it's slightly inconvenient needing to restart my emacs session because of this, so a fix to this would be wonderful!

I'm using the latest version (i.e. v4.5) of Proof General if this is of any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants