The following program results in a Viper encoding with invalid triggers.
In particular, the first two assert stmts have valid triggers while the latter two end up having invalid triggers.
It's however unclear to me why the end up being invalid as the difference (also in the encoding) is 1 vs i-1 and it seems that Viper does not like the subtraction.
package search
func foo() (r []int, i int) {
r = make([]int, 10)
i = 2
// @ assert forall j int :: { r[1:][j] } 0 <= j && j < len(r[1:]) ==> &r[1:][j] == &r[1+j]
// @ assert forall j int :: { &r[1:][j] } 0 <= j && j < len(r[1:]) ==> &r[1:][j] == &r[1+j]
// @ assert forall j int :: { r[i-1:][j] } 0 <= j && j < len(r[i-1:]) ==> &r[i-1:][j] == &r[i-1+j]
// @ assert forall j int :: { &r[i-1:][j] } 0 <= j && j < len(r[i-1:]) ==> &r[i-1:][j] == &r[i-1+j]
}
The following program results in a Viper encoding with invalid triggers.
In particular, the first two assert stmts have valid triggers while the latter two end up having invalid triggers.
It's however unclear to me why the end up being invalid as the difference (also in the encoding) is
1vsi-1and it seems that Viper does not like the subtraction.