Contract language for Catala scopes #691
Labels
🔧 compiler
Issue concerns the compiler
💡 language
Language design
#️⃣ syntax
Concerns the syntax committee
Currently, Catala has
assertion
s that let the user specify boolean facts that should hold true when the program runes (else the program crashes). These assertions are actually triple-use : they also stand in as checks of an expected value for test cases, and they are hypothesis that the verification engine can rely on.It is essential to distinguish the three different uses of current assertions. In particular, testing and verification requires more than assertions, they require a true contract language with preconditions and post-conditions on functions and scopes.
Hence, I propose we add two new keywords to the language,
requires
andensures
(requiert
etgarantit
). Semantics-wise, these would be syntactic sugars forassertions
. But, they could be picked up and receive special treatment by the testing system (@AltGr, @rprimet) or by the verification engine (@R1kM, @pierregoutagny, @rmonat).What do you think ?
The text was updated successfully, but these errors were encountered: