sdthompson1 / babylon

An experimental new programming language with verification features.
https://www.solarflare.org.uk/babylon
Other
1 stars 0 forks source link

Allow "let", "assert", "hide", "show" in function pre/post condition blocks #8

Open sdthompson1 opened 1 month ago

sdthompson1 commented 1 month ago

e.g. we might want to do something like let x = (some complex expression) and then use x in several different preconditions. This allows us to avoid repeating the complex expression.

assert is useful in case the solver needs some help showing that the preconditions and/or postconditions are well-defined. Same for hide and show.

There may also be some value in allowing to call "lemma" functions within pre/postcondition blocks. Maybe ghost lemma_name(x,y,z); could be used here.