1

I am getting an invalid Ident error in the forall line (from is to the first i), does anybody know why? This is unusual.

predicate SumMaxToRight(v:array<int>,i:int,s:int)
   reads v
   requires 0<=i<v.Length
  {forall l, is {:induction l} :: 0<=l<=i && is==i+1 ==> Sum(v,l,is)<=s}

Version 3.0.0.

Theo Deep
  • 666
  • 4
  • 15

1 Answers1

1

It looks like is is a keyword in Dafny now, so it cannot be used as a variable name.

James Wilcox
  • 5,307
  • 16
  • 25
  • Totally, thanks! I change ```is``` with ```iss``` and it works. By the way, I answered you (will delete this) that I cannot find the bugs in: https://stackoverflow.com/questions/66563130/dafny-cannot-prove-function-method-equivalence-with-high-order-polymorphic-recu – Theo Deep Apr 06 '21 at 18:50
  • 1
    Ah, yeah, sorry I never got back to you. I just posted over there. – James Wilcox Apr 06 '21 at 21:58