function sumTo( a:array<int>, k:int, j:int) : int
requires a != null;
requires 0 <= k && k <=a.Length;
requires k <= j && j <= a.Length-1;
decreases j;
reads a;
{
if (k == j) then a[k] else sumTo(a, k, j-1) + a[j]
}
method prod(t:array<int>) modifies t
requires t!=null && t.Length>=2
ensures forall k: int :: 0 <= k < t.Length ==> t[k]== sumTo(old(t), k, t.Length-1)
{
var i := t.Length - 2;
while i>=0
invariant t.Length-1>i>=-1;
decreases i;
{
t[i] := t[i]+t[i+1];
i := i-1;
}
}
returns this error :
web.dfy(17,4): Error BP5003: A postcondition might not hold on this return path.
web.dfy(13,8): Related location: This is the postcondition that might not hold.