FStarLang / FStarLang/pulse

Need spurious bind to make function check

Open
#181 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
36
Forks
11
PR merge metrics
No merged PRs in 30d

Description

```fstar
assume val p : int
assume val q : int
assume val foo : int -> slprop
assume val lem () : Lemma (foo p == foo q)

ghost
fn test ()
requires foo p
ensures foo q
{
lem();
// ()
}
```
This function fails to check:
```
- Cannot prove:
foo q
- In the context:
foo p
```
But uncommenting the extra `()`, or doing anything, will make it work. I think without it, the lemma is not eliminated into the context and so is not in scope for the query `foo p == foo q`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the minimal Pulse/F* reproducer in the issue and compare checking it with and without the trailing `()`. Investigate why `lem();` is not available for the `foo p == foo q` query until another expression is added; done means the original body checks without a spurious bind and the behavior has a regression test.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.