dhh1128 / intent

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

consider supporting loop invariants and "decreases" #117

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 30 03 pm

The loop invariant is obvious. The "decreases" annotation tells the compiler that a variable gets smaller (can often be inferred); clearly "increases" would be a desirable form of annotation as well. Both of these could be covered by marks instead of requiring key words in the language.