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

Unfolding predicates with implicits tagged with default arguments #205

Open
nikswamy opened this issue Sep 10, 2024 · 0 comments
Open

Unfolding predicates with implicits tagged with default arguments #205

nikswamy opened this issue Sep 10, 2024 · 0 comments

Comments

@nikswamy
Copy link
Contributor

This works:

let pred (x:int) : slprop = emp
fn test (x:int)
requires pred x
ensures emp
{
  unfold pred;
}

But, this fails and the error location blamed spans part of the definition of pred2 and part of the definition of test2.
If you remove the implict argument f then it succeeds.

let gpu_array (a:Type0) (sz:nat) : Type0 = unit
let pred2 (#a:Type0)
  (#sz:nat)
  (arr : gpu_array a sz)
  (#[exact (`1.0R)] f : perm)
  (i:nat)
  (v:a)
: slprop
= emp
fn test2 #a #sz (arr:gpu_array a sz) i v
requires pred2 arr i v
ensures emp
{
  unfold pred2;
}

A smaller variant behaves similarly, but this time the error range blamed on failure is different ... it blames both the unfold and the arr:tt binder in pred3.

let tt : Type0 = unit
let pred3 
  (arr : tt)
  (#[exact (`1.0R)] f : perm)
  (i:nat)
: slprop
= emp
fn test3 (arr:tt) i
requires pred3 arr i
ensures emp
{
  unfold pred3;
}
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

1 participant