by MaxBarraclough · 6y ago · 0 comments
I don't think Ada supports arbitrary user-specified constraints, but I'm no expert.
[0] https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gnat_ugn/Run-Time-...
[1] https://docs.adacore.com/spark2014-docs/html/ug/en/usage_sce...
Ada has Dynamic_Predicate(s) which "can be any Boolean expression". [0] So, I'm guessing, you can write a pointless Predicate which does not terminate in some cases or takes unreasonably long.
[0] http://www.ada-auth.org/standards/12rat/html/Rat12-2-5.html
> In the case of Dynamic_Predicate, the expression can be any Boolean expression.
Ada functions are permitted to have side-effects (although this is disallowed in SPARK), so I imagine it would be possible to make a real mess if you wanted to.