Inference with nested refinements
- Dominant language
- No language data
- Stars
- 36
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Nested refinement types are not inferred correctly in Pulse, requiring additional annotation
```fstar
module BugRealRefinement
#lang-pulse
open Pulse.Lib.Pervasives
assume
val p (#a:Type0) (_:(option perm & a)) : slprop
[@@expect_failure]
fn test (#a:Type0) (x:a)
requires emp
ensures p (Some 1.0R, x) //this fails
{
admit()
}
fn test (#a:Type0) (x:a)
requires emp
ensures p (Some #perm 1.0R, x) //needs a #perm annotation
{
admit()
}
let full #a (x:a) : (option perm & a) = (Some 1.0R, x)
fn test2 (#a:Type0) (x:a)
requires emp
ensures p (full x) //or an indirection
{
admit()
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the BugRealRefinement Pulse module from the issue, comparing the failing `Some 1.0R` case with the explicit `#perm` and `full x` variants. Trace the type-inference behavior involved in nested refinements; done means the first `test` case no longer requires the additional annotation and the regression is covered.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100