Checking a Multithreaded Algorithm with  + CAL

  • Leslie Lamport
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4167)


A colleague told me about a multithreaded algorithm that was later reported to have a bug. I rewrote the algorithm in the  +  cal algorithm language, ran the TLC model checker on it, and found the error. Programs are not released without being tested; why should algorithms be published without being model checked?


Model Check Error Trace Spin Model Checker Algorithm Language Heap Location 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Detlefs, D.L., Flood, C.H., Garthwaite, A.T., Martin, P.A., Shavit, N.N., Steele Jr., G.L.: Even better DCAS-based concurrent deques. In: Herlihy, M.P. (ed.) DISC 2000. LNCS, vol. 1914, pp. 59–73. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  2. 2.
    Doherty, S., Detlefs, D.L., Groves, L., Flood, C.H., Luchangco, V., Martin, P.A., Moir, M., Shavit, N., Steele Jr., G.L.: Dcas is not a silver bullet for nonblocking algorithm design. In: Gibbons, P.B., Adler, M. (eds.) SPAA 2004: Proceedings of the Sixteenth Annual ACM Symposium on Parallel Algorithms, Barcelona, pp. 216–224. ACM, New York (2004)CrossRefGoogle Scholar
  3. 3.
    Lamport, L.: The  + CAL algorithm language. The page can also be found by searching the Web for the 25-letter string obtained by removing the “-” from uid-lamportpluscalhomepage, URL
  4. 4.
    Lamport, L.: An example of using  + CAL to find a bug. The page can also be found by searching the Web for the 28-letter string formed by concatenating uid and lamportdcaspluscalexample,
  5. 5.
    Abadi, M., Lamport, L.: The existence of refinement mappings. Theoretical Computer Science 82(2), 253–284 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Azul Systems: Web page,
  7. 7.
    Lamport, L.: Specifying Systems. Addison-Wesley, Boston (2003)Google Scholar
  8. 8.
    Holzmann, G.J.: The Spin Model Checker. Addison-Wesley, Boston (2004)Google Scholar
  9. 9.
    Moir, M.: Private communication (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Leslie Lamport
    • 1
  1. 1.Microsoft Research 

Personalised recommendations