flintlang / flint

The Flint Programming Language for Smart Contracts
MIT License
245 stars 18 forks source link

Forloop returns- verification problem #475

Open wmanshu opened 5 years ago

wmanshu commented 5 years ago
contract A {
  var arr1: [Int] = []
}

A :: (any) {
  public init() {}

  func joinedAlready(participant: Int) -> Bool
  post (returns (exists (i, Int, arr1[i] == participant)))
  {
    for var i: Int in arr1 {
      if i == participant {
        return true
      }
    }
    return false
  }
}

cannot verify the post conditions.