-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Consider the following example:
package exercises
// ##(--hyperMode extended --enableExperimentalHyperFeatures)
// @ ghost
// @ decreases
func GetInt() (res int)
// @ requires rel(t, 0) != rel(t, 1)
func test5_RelationalIndexBug(t uint64) {
steps := make([]uint64, 20)
//@ ghost var t0 uint64 = rel(t, 0)
//@ ghost var t1 uint64 = rel(t, 1)
//@ idx1 := GetInt()
//@ assume t0 < t1 ==> 0 <= idx1 && idx1 < rel(len(steps), 0)
//@ assume t0 < t1 ==> 0<= idx1 && idx1 < len(rel(steps,0))
/*@
ghost if t0 < t1 {
ghost var TStar uint64 = rel(steps[idx1], 0)
}
@*/
}
If we run on Gobra, Gobra will return the following error:
[info] Error at: </.../exercises/relissues8.go:30:18> Assignment might fail.
[info] Permission to steps[idx1] might not suffice.
(Did an initial mistake with analysis, as my example was bad. Please see the comments below.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels