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

Flychecking Pulse? #122

Open
JonasAlaif opened this issue Jun 28, 2024 · 3 comments
Open

Flychecking Pulse? #122

JonasAlaif opened this issue Jun 28, 2024 · 3 comments

Comments

@JonasAlaif
Copy link

In the following snippet

open Pulse.Lib.Pervasives

```pulse
fn cond_lemma
  (#b: bool)
  (#x #y: vprop)
  requires (if b then x else y) ** (pure (not (b)))
  ensures  y
{
  ()
}

fn fold_pre
  (b: bool)
  (y: vprop)
  requires (if b then emp else y)
  ensures  (if b then emp else y)
{
  if not (b) {
    assert (pure (not (b)));
    cond_lemma #b #emp #y;
  } else {
    ()
  }
}
```pulse

I get the error

- Cannot prove:
    match b with
    | true -> emp
    | _ -> y
- In the context:
    emp

If I comment out the assert, the error goes away.

@mtzguido
Copy link
Member

Making a note that this is an error from the flycheck: with verification enabled we do not get the error.

@gebner
Copy link
Contributor

gebner commented Jul 1, 2024

I can no longer reproduce this with the recent changes to the matcher. FWIW, the vscode extension now discards errors from the flycheck process if we've already checked the top-level definition using the main process, and errors from the flycheck process are shown as warnings.

@mtzguido
Copy link
Member

mtzguido commented Jul 1, 2024

This PR made this particular issue go away, but this one still shows a spurious error for me (flycheck fails on cond_lemma, normal mode fails on the assert):

```pulse
fn fold_pre
  (b: bool)
  (y: vprop)
  requires (if b then emp else y)
  ensures  (if b then emp else y)
{
  assert (pure False);
  if not (b) {
    assert (pure (not (b)));
    cond_lemma #b #emp #y;
  } else {
    ()
  }
}
```

let _ = assert False

I think FStarLang/FStar#3337 would solve it, at the cost of verifying the Pulse fragment twice (one for each process). Until we maybe add flychecking support to the Pulse checker as we discussed today.

Relabeling this issue.

@mtzguido mtzguido changed the title Assert clears context? Flychecking Pulse? Jul 1, 2024
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

Successfully merging a pull request may close this issue.

3 participants