Modeling Asynchronous Message Passing for C Programs

  • Everett Morse
  • Nick Vrvilo
  • Eric Mercer
  • Jay McCarthy
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7148)


This paper presents a formal modeling paradigm that is callable from C, the dominant language for embedded systems programming, for message passing APIs that provides reasonable assurance that the model correctly captures intended behavior. The model is a suitable reference solution for the API, and it supports putative what-if queries over API scenarios for behavior exploration, reproducibility for test and debug, full exhaustive search, and other advanced model checking analysis methods for C programs that use the API. This paper illustrates the modeling paradigm on the MCAPI interface, a growing industry standard message passing library, showing how the model exposes errors hidden by the C reference solution provided by the Multicore Association.


Model Checking Concurrency Test Debug Validation 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    The 4M modeling language,
  2. 2.
    Abrial, J.R.: The B-book: assigning programs to meanings. Cambridge University Press (1996)Google Scholar
  3. 3.
    Dijkstra, E.W.: Self-stabilizing systems in spite of distributed control. Communications of the ACM 17, 643–644 (1974)CrossRefzbMATHGoogle Scholar
  4. 4.
    Dill, D.L., Drexler, A.J., Hu, A.J., Yang, C.H.: Protocol verification as a hardware design aid. In: IEEE International Conference on Computer Design: VLSI in Computers and Processors, pp. 522–525 (1992)Google Scholar
  5. 5.
    Elwakil, M., Yang, Z.: CRI: Symbolic Debugger for MCAPI Applications. In: Bouajjani, A., Chin, W.-N. (eds.) ATVA 2010. LNCS, vol. 6252, pp. 353–358. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  6. 6.
    Elwakil, M., Yang, Z.: Debugging support tool for MCAPI applications. In: Parallel and Distributed Systems (2010)Google Scholar
  7. 7.
    Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. The MIT Press (2009)Google Scholar
  8. 8.
    Flatt, M.: PLT: Reference: Racket. Tech. Rep. PLT-TR-2010-1, PLT Inc. (2010),
  9. 9.
    Georgelin, P., Pierre, L., Nguyen, T.: A formal specification of the MPI primitives and communication mechanisms. Tech. rep., LIM (1999)Google Scholar
  10. 10.
    Godefroid, P.: Model checking for programming languages using Verisoft. In: Principles of Programming Languages, pp. 174–186 (1997)Google Scholar
  11. 11.
    Holzmann, G.J.: The model checker SPIN. IEEE Transactions on Software Engineering 23, 279–295 (1997)CrossRefGoogle Scholar
  12. 12.
    Jackson, D.: Software Abstractions: Logic, Language, and Analysis. The MIT Press (April 2006)Google Scholar
  13. 13.
    Jongmans, S.-S.T.Q., Hindriks, K.V., van Riemsdijk, M.B.: Model Checking Agent Programs by Using the Program Interpreter. In: Dix, J., Leite, J., Governatori, G., Jamroga, W. (eds.) CLIMA XI. LNCS, vol. 6245, pp. 219–237. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  14. 14.
    Lamport, L.: TLA - the temporal logic of actions,
  15. 15.
    Li, G., DeLisi, M., Gopalakrishnan, G., Kirby, R.M.: Formal specification of the MPI-2.0 standard in TLA+. In: Principles and Practices of Parallel Programming, pp. 283–284 (2008)Google Scholar
  16. 16.
    Li, G., Gopalakrishnan, G., Kirby, R.M., Quinlan, D.: A symbolic verifier for CUDA programs. In: Principles and Practice of Parallel Programming, pp. 357–358 (2010)Google Scholar
  17. 17.
    McMillan, K.L.: Symbolic Model Checking: An approach to the state explosion problem. Ph.D. thesis, Carnegie Mellon University (1992)Google Scholar
  18. 18.
    Mercer, E.G., Jones, M.: Model Checking Machine Code with the GNU Debugger. In: Godefroid, P. (ed.) SPIN 2005. LNCS, vol. 3639, pp. 251–265. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  19. 19.
    Musuvathi, M., Qadeer, S.: Iterative context bounding for systematic testing of multithreaded programs. In: Programming Language Design and Implementation (2007)Google Scholar
  20. 20.
    Palmer, R., DeLisi, M., Gopalakrishnan, G., Kirby, R.M.: An Approach to Formalization and Analysis of Message Passing Libraries. In: Leue, S., Merino, P. (eds.) FMICS 2007. LNCS, vol. 4916, pp. 164–181. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  21. 21.
    Pǎsǎreanu, C.S., Mehlitz, P.C., Bushnell, D.H., Gundy-Burlet, K., Lowry, M., Person, S., Pape, M.: Combining unit-level symbolic execution and system-level concrete execution for testing NASA software. In: International Symposium on Software Testing and Analysis, pp. 15–26 (2008)Google Scholar
  22. 22.
    Roscoe, A.W.: Model-checking CSP, pp. 353–378. Prentice Hall International (UK) Ltd., Hertfordshire (1994)Google Scholar
  23. 23.
    Sharma, S., Gopalakrishnan, G., Mercer, E., Holt, J.: MCC: A runtime verification tool for MCAPI user applications. In: Formal Methods in Computer-Aided Design, pp. 41–44 (2009)Google Scholar
  24. 24.
    Siegel, S.F., Avrunin, G.: Analysis of mpi programs. Tech. Rep. UM-CS-2003-036, Department of Computer Science, University of Massachusetts Amherst (2003)Google Scholar
  25. 25.
    Spivey, J.M.: The Z notation: a reference manual. Prentice-Hall International Series In Computer Science, p. 155 (1989)Google Scholar
  26. 26.
    The Multicore Association,
  27. 27.
    Vakkalanka, S., Gopalakrishnan, G., Kirby, R.M.: Dynamic Verification of MPI Programs with Reductions in Presence of Split Operations and Relaxed Orderings. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 66–79. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  28. 28.
    Šimša, J., Bryant, R., Gibson, G.: dBug: Systematic Testing of Unmodified Distributed and Multi-threaded Systems. In: Groce, A., Musuvathi, M. (eds.) SPIN Workshops 2011. LNCS, vol. 6823, pp. 188–193. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  29. 29.
    Wang, C., Chaudhuri, S., Gupta, A., Yang, Y.: Symbolic pruning of concurrent program executions. In: The Foundations of Software Engineering, pp. 23–32 (2009)Google Scholar
  30. 30.
    Wang, C., Yang, Y., Gupta, A., Gopalakrishnan, G.: Dynamic Model Checking with Property Driven Pruning to Detect Race Conditions. In: Cha, S., Choi, J.-Y., Kim, M., Lee, I., Viswanathan, M. (eds.) ATVA 2008. LNCS, vol. 5311, pp. 126–140. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  31. 31.
    Yang, J., Chen, T., Wu, M., Xu, Z., Liu, X., Lin, H., Yang, M., Long, F., Zhang, L., Zhou, L.: MODIST: transparent model checking of unmodified distributed systems. In: Networked Systems Design and Implementation, pp. 213–228 (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Everett Morse
    • 1
  • Nick Vrvilo
    • 1
  • Eric Mercer
    • 1
  • Jay McCarthy
    • 1
  1. 1.Brigham Young UniversityProvoUSA

Personalised recommendations