3 ms·
This is a great achievement in making formal methods accessible in pragmatic terms - something that actually works and can be used by normal humans. Would be n
by pjc50 7y ago
This is a great achievement in making formal methods accessible in pragmatic terms - something that actually works and can be used by normal humans.
Would be nice to have an actual microcontroller example.
> The standard library is fully stack based and heap allocation is strongly discouraged
:/ - I can see why this is done, as it's hard, so banning it to make the problem tractable works. But it's also quite inconvenient. On the other hand, "MISRA C:2004, 20.4 - Dynamic heap memory allocation shall not be used."
- Nursie 7y agoThere's the third sort of allocation that's often used in embedded systems - preallocated buffers, which are neither stack nor heap but set up by the .bss section of the executable. These allow you to have very predictable memory usage.
- pjmlp 7y agoUnless it has changed, SPARK also forbids dynamic allocation.
- yannickmoy 7y agoIt has changed: https://blog.adacore.com/pointer-based-data-structures-in-spark https://blog.adacore.com/pointer-based-data-structures-in-sp...
- a3p 7y agothe standard library does not allocate any heap memory, but heap modelling will be added to the prover eventually. note that there are convenience tools to deal with heap-free targets (microcontrollers) such as tail variants (statically enforced flexible arrays): https://github.com/aep/zz#metaprogramming-or-templates-tail-variants https://github.com/aep/zz#metaprogramming-or-templates-tail-...