While or For Loop in function #2524
-
Hi All, What is the correct way to use Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi there,
|
Beta Was this translation helpful? Give feedback.
-
Okay, thank you! |
Beta Was this translation helpful? Give feedback.
-
This point also argues for having a library of stream functions in Dafny -- they can stand in for many loops |
Beta Was this translation helpful? Give feedback.
Hi there,
while
andforall
statements are not supported in functions — in fact, no statements are! Function bodies can only use expressions (that and the fact that methods are opaque are the main differences between functions and methods).