Relaxed Effective Callback Freedom: A Parametric Correctness Condition for Sequential Modules With Callbacks

Elvira Albert, Shelly Grossman, Noam Rinetzky, Clara Rodriguez-Nunez*, Albert Rubio, Mooly Sagiv

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review


Callbacks are an essential mechanism for event-driven programming. Unfortunately, callbacks make reasoning challenging because they introduce behaviors where calls to the module are interleaved. We present a parametric method that, from a particular invariant of the program, allows reducing the problem of verifying the invariant in the presence of callbacks, to the callback-free setting. Intuitively, we allow callbacks to introduce behaviors that cannot be produced by callback free executions, as long as they do not affect correctness. A chief insight is that the user is aware of the potential effect of the callbacks on the program state. To this end, we present a parametric verification technique which accepts this insight as a relation between callback and callback free executions. We implemented our approach and applied it successfully to a large set of real-world programs.

Original languageEnglish
Pages (from-to)2256-2273
Number of pages18
JournalIEEE Transactions on Dependable and Secure Computing
Issue number3
StatePublished - 1 May 2023


FundersFunder number
Federación Española de Enfermedades RarasRTI2018-094403-B-C33, RTI2018-094403-B-C31
Agencia Estatal de Investigación


    • Callbacks
    • Event-driven programming
    • Smart contract verification
    • Unbounded re-entrancy

    Cite this