ultimate-pa / ultimate

The Ultimate program analysis framework.
https://ultimate-pa.org/
200 stars 41 forks source link

Support atomic types #688

Closed schuessf closed 3 weeks ago

schuessf commented 1 month ago

This PR adds support for atomic types (_Atomic). To do so, I performed the following steps:

maul-esel commented 1 month ago

We have to ensure that all operations on atomic variables are actually performed atomically. Our translation seems to ensure this for read and write operations (I am not 100% sure though).

I think we should ensure this by adding atomic statements in Boogie.

This would also solve the current unsoundness on this branch when using the setting --rcfgbuilder.only.consider.context.switches.at.boundaries.of.atomic.blocks true aka the "assume no data race"-LBE.

schuessf commented 1 month ago

I think we should ensure this by adding atomic statements in Boogie.

This would also solve the current unsoundness on this branch when using the setting --rcfgbuilder.only.consider.context.switches.at.boundaries.of.atomic.blocks true aka the "assume no data race"-LBE.

Thanks, that's a good point. With this settings, it actually makes a difference, whether we translate to a single Boogie statement st or atomic { st }. So I guess, the only C expressions where the translation neeeds to be adapted for atomic types, are assignments (also sth. like +=) and reads (probably only for variables on the heap).