Continuing on from ideas in: Are there any provable real-world languages?
I don\'t know about you, but I\'m sick of writing code that I can\'t guarantee.
Your seemingly simple example, add(a,b), is actually difficult to verify - floating point, overflow, underflow, interrupts, is the compiler verified, is the hardware verified, etc.
Habit is a simplified dialect of Haskell that allows for proving program properties.
Hume is a language with 5 levels, each more limitedand therefore easier to verify:
Full Hume Full recursion PR−Hume Primitive Recursive functions Template−Hume Predefined higher−order functions Inductive data structures Inductive Non−recursive first−order functions FSM−Hume Non−recursive data structures HW−Hume No functions Non−recursive data structures
Of course, the most popular method today for proving program properties is unit testing, which provides strong theorems, but these theorems are overly specific. "Types Considered Harmful", Pierce, slide 66