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

pure in assert_ does not work (Pulse) #30

Closed
tdardinier opened this issue Jun 30, 2023 · 1 comment
Closed

pure in assert_ does not work (Pulse) #30

tdardinier opened this issue Jun 30, 2023 · 1 comment

Comments

@tdardinier
Copy link
Member

Pulse treats pure (...) in asserts in an opaque way. As an example, Pulse is not able to verify a statement like assert_ (pure (5 = 5));. It fails with the following error message:

(Error) Failed to prove the following goals:
... Steel.ST.Util.pure (Prims.op_Equality 5 5)
The remaining conjuncts in the separation logic context available for use are:...

This behavior also happens with with ... assert ..., as shown by the following example (that Pulse fails to verify for the same reason):

fn test_with_assert_pure(r: R.ref nat)
    requires R.pts_to r full_perm 5 
    ensures R.pts_to r full_perm 5
{
    with v. assert (R.pts_to r full_perm v ** pure (v = 5));
    ()
}
nikswamy added a commit that referenced this issue Jul 4, 2023
@nikswamy
Copy link
Collaborator

nikswamy commented Jul 4, 2023

This fails with "Impossible: instantiated abstraction is not an F* term"

fn trivial (x:unit)
requires emp
ensures emp
{
  assert (pure (5 == 5));
  ()
}

Whereas this succeeds:

fn trivial (x:unit)
requires emp
ensures emp
{
  assert_ (pure (5 == 5));
  ()
}

and so does this:

fn test_with_assert_pure(r: R.ref nat)
    requires R.pts_to r full_perm 5 
    ensures R.pts_to r full_perm 5
{
    with v. assert (R.pts_to r full_perm v ** pure (v = 5));
    ()
}

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