Automatic Refinement of Split Binary Semaphore

  • Damián Barsotti
  • Javier O. Blanco
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4711)


Binary semaphores can be used to implement conditional critical regions by using the split binary semaphore (SBS) technique. Given a specification of a conditional critical regions problem, the SBS technique provides not only the resulting programs but also some invariants which ensure the correctness of the solution. The programs obtained in this way are generally not efficient. However, they can be optimized by strengthening these invariants and using them to eliminate unnecessary tests.

We present a mechanical method to perform these optimizations. The idea is to use the backward propagation technique over a guarded transition system that models the behavior of the programs generated by the SBS. This process needs proving heavy implications and simplifying growing invariants. Our method automatically entrusts these tasks to the Isabelle theorem prover and the CVC Lite validity checker. We have tested our method on a number of classical examples from concurrent programming.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Dijkstra, E.W.: A tutorial on the split binary semaphore (March 1979),
  2. 2.
    Schneider, F.B.: On Concurrent Programming. Graduate texts in computer science. Springer, New York, Inc. (1997)MATHGoogle Scholar
  3. 3.
    Bjorner, N., Browne, A., Manna, Z.: Automatic generation of invariants and intermediate assertions. Theor. Comput. Sci. 173(1), 49–87 (1997)CrossRefMathSciNetGoogle Scholar
  4. 4.
    Barrett, C., Berezin, S.: CVC Lite: A new implementation of the cooperating validity checker. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 515–518. Springer, Heidelberg (2004)Google Scholar
  5. 5.
    Paulson, L.C.: The Isabelle reference manual (2004),
  6. 6.
    Andrews, G.: Foundations of Multithreaded, Parallel, and Distributed Programming. Addison-Wesley, Reading, Massachusetts, USA (1999)Google Scholar
  7. 7.
    Martin, A., van de Snepscheut, J.: Design of synchronization algorithms. Constructive Methods in Computing Science, pp. 445–478 (1989)Google Scholar
  8. 8.
    Barsotti, D., Blanco, J.O.: (Im)proving split binary semaphores. Tecnical Report (2007), Available at
  9. 9.
    Tiwari, A., Rueß, H., Saïdi, H., Shankar, N.: A technique for invariant generation. In: Margaria, T., Yi, W. (eds.) ETAPS 2001 and TACAS 2001. LNCS, vol. 2031, pp. 113–127. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  10. 10.
    Manna, Z., Pnueli, A.: On the faithfulness of formal models. In: Mathematical Foundations of Computer Science, pp. 28–42 (1991)Google Scholar
  11. 11.
    Dijkstra, E.W., Scholten, C.S.: Predicate calculus and program semantics. Springer, New York, Inc. (1990)MATHGoogle Scholar
  12. 12.
    Kessels, J.L.W.: An alternative to event queues for synchronization in monitors. Commun. ACM 20(7), 500–503 (1977)MATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Damián Barsotti
    • 1
  • Javier O. Blanco
    • 1
  1. 1.Fa.M.A.F., Universidad Nacional de Córdoba, Córdoba 5000Argentina

Personalised recommendations