dhh1128 / intent

the intent formal language
https://intentlang.org
2 stars 1 forks source link

consider an "implies" operator #115

Open dhh1128 opened 9 years ago

dhh1128 commented 9 years ago

Consider this snippet of dafny code from http://rise4fun.com/Dafny/tutorial/guide:

screen shot 2015-07-03 at 4 02 15 pm

The second line would be read "0 <= x" implies "x == y". Implies is a boolean operator with lower precedence than && or ||; it is used in postconditions ("ensures") to make claims that are conditioned on other things. This allows more flexible preconditions and postconditions, without requiring the coder to enter the main body of a function and write traditional conditional expressions before stating the pre/postconditions.