Abstract
Asynchronous programming is a ubiquitous systems programming idiom for managing concurrent interactions with the environment. In this style, instead of waiting for time-consuming operations to complete, the programmer makes a non-blocking call to the operation and posts a callback task to a task buffer that is executed later when the time-consuming operation completes. A cooperative scheduler mediates the interaction by picking and executing callback tasks from the task buffer to completion (and these callbacks can post further callbacks to be executed later). Writing correct asynchronous programs is hard because the use of callbacks, while efficient, obscures program control flow.
We provide a formal model underlying asynchronous programs and study verification problems for this model. We show that the safety verification problem for finite-data asynchronous programs is expspace-complete. We show that liveness verification for finite-data asynchronous programs is decidable and polynomial-time equivalent to Petri net reachability. Decidability is not obvious, since even if the data is finite-state, asynchronous programs constitute infinite-state transition systems: both the program stack for an executing task and the task buffer of pending calls to tasks can be potentially unbounded.
Our main technical constructions are polynomial-time, semantics-preserving reductions from asynchronous programs to Petri nets and back. The first reduction allows the use of algorithmic techniques on Petri nets for the verification of asynchronous programs, and the second allows lower bounds on Petri nets to apply also to asynchronous programs.
We also study several extensions to the basic models of asynchronous programs that are inspired by additional capabilities provided by implementations of asynchronous libraries and classify the decidability and undecidability of verification questions on these extensions.
- Abdulla, P. A., Cerans, K., Jonsson, B., and Tsay, Y.-K. 1996. General decidability theorems for infinite-state systems. In Proceedings of the 11th Annual IEEE Symposium on Logic in Computer Science (LICS'96). IEEE Computer Society, 313--321. Google Scholar
Digital Library
- Abdulla, P. A. and Mayr, R. 2009. Minimal cost reachability/coverability in priced timed petri nets. In Proceedings of the 12th International Conference on Foundations of Software Science and Computational Structures (FOSSACS'09). Lecture Notes in Computer Science, vol. 5504, Springer, 348--363. Google Scholar
Digital Library
- Aho, A., Sethi, R., and Ullman, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley. Google Scholar
Digital Library
- Atig, M. F., Bouajjani, A., and Touili, T. 2008. Analyzing asynchronous programs with preemption. In Proceedings of the 28th International Conference on Foundation of Software Technology and Theoretical Computer Science (FSTTCS'08). Leibniz International Proceedings in Informatics, vol. 2, Leibniz-Zentrum fuer Informatik, 37--48.Google Scholar
- Atig, M. F. and Habermehl, P. 2009. On Yen's path logic for Petri nets. In Proceedings of the 3rd Workshop on Reachability Problems. Lecture Notes in Computer Science, vol. 5797, Springer, 51--63. Google Scholar
Digital Library
- Bouajjani, A., Esparza, J., and Maler, O. 1997. Reachability analysis of pushdown automata: Application to model-checking. In Proceedings of the 8th International Conference on Concurrency Theory (CONCUR'97). Lecture Notes in Computer Science, vol. 1243, Springer, 135--150. Google Scholar
Digital Library
- Burkart, O. and Steffen, B. 1994. Pushdown processes: Parallel composition and model checking. In Proceedings of the 5th International Conference on Concurrency Theory (CONCUR'94). Lecture Notes in Computer Science, vol. 836, Springer, 98--113. Google Scholar
Digital Library
- Chadha, R. and Viswanathan, M. 2007. Decidability results for well-structured transition systems with auxiliary storage. In Proceedings of the 18th International Conference on Concurrency Theory (CONCUR'07). Lecture Notes in Computer Science, vol. 4703, Springer, 136--150. Google Scholar
Digital Library
- Chadha, R. and Viswanathan, M. 2009. Deciding branching time properties for asynchronous programs. Theor. Comput. Sci. 410, 42, 4169--4179. Google Scholar
Digital Library
- Dickson, L. E. 1913. Finiteness of the odd perfect and primitive abundant numbers with $n$ distinct prime factors. Amer. J. Math. 35, 413--422.Google Scholar
Cross Ref
- Dufourd, C., Finkel, A., and Schnoebelen, P. 1998. Reset nets between decidability and undecidability. In Proceedings of the 25th International Colloquium on Automata, Languages and Programming (ICALP'98). Lecture Notes in Computer Science, vol. 1443, Springer, 103--115. Google Scholar
Digital Library
- Esparza, J. 1997. Petri nets, commutative context-free grammars, and basic parallel processes. Fundamenta Informaticae 31, 13--26. Google Scholar
Digital Library
- Esparza, J. 1998. Decidability and complexity of petri net problems -- an introduction. In Lectures on Petri Nets I: Basic Models. Lecture Notes in Computer Science, vol. 1491, Springer, 374--428. Google Scholar
Digital Library
- Esparza, J., Finkel, A., and Mayr, R. 1999. On the verification of broadcast protocols. In Proceedings of the 14th Annual IEEE Symposium on Logic in Computer Science (LICS'99). 352--359. Google Scholar
Digital Library
- Esparza, J., Ganty, P., Kiefer, S., and Luttenberger, M. 2011. Parikh's theorem: A simple and direct automaton construction. Inform. Process. Letters 111, 614--619. Google Scholar
Digital Library
- Esparza, J., Kiefer, S., and Luttenberger, M. 2010. Newtonian program analysis. J. ACM 57, 6. Google Scholar
Digital Library
- Esparza, J. and Nielsen, M. 1994. Decibility issues for Petri nets—a survey. J. Informatik Process. Cybernet. 30, 3, 143--160.Google Scholar
- Finkel, A. and Sangnier, A. 2010. Mixing coverability and reachability to analyze vass with one zero-test. In Proceedings of the 36th Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM'10). Lecture Notes in Computer Science, vol. 5901, Springer, 394--406. Google Scholar
Digital Library
- Finkel, A. and Schnoebelen, P. 2001. Well-structured transition systems everywhere&excel; Theor. Comput. Sci. 256, 1-2, 63--92. Google Scholar
Digital Library
- Ganty, P. and Majumdar, R. 2009. Analyzing real-time event-driven programs. In Proceedings of the 7th International Conference on Formal Modeling and Analysis of Timed Systems (FORMATS'09). Lecture Notes in Computer Science, vol. 5813, Springer, 164--178. Google Scholar
Digital Library
- Ganty, P., Majumdar, R., and Rybalchenko, A. 2009. Verifying liveness for asynchronous programs. In Proceedings of the 36th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL'09). 102--113. Google Scholar
Digital Library
- Hack, M. H. T. 1976. Decidability questions for Petri nets. Tech. rep. 161, MIT. Google Scholar
Digital Library
- Hill, J. L., Szewczyk, R., Woo, A., Hollar, S., Culler, D. E., and Pister, K. S. J. 2000. System architecture directions for networked sensors. In Proceedings of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS'00). 93--104. Google Scholar
Digital Library
- Jhala, R. and Majumdar, R. 2007. Interprocedural analysis of asynchronous programs. In Proceedings of the 34th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL'07). 339--350. Google Scholar
Digital Library
- Karp, R. M. and Miller, R. E. 1969. Parallel program schemata. J. Comput. Syst. Sci. 3, 2, 147--195. Google Scholar
Digital Library
- Kohler, E., Morris, R., Chen, B., Jannotti, J., and Kaashoek, M. 2000. The click modular router. ACM Trans. Comput. Syst. 18, 3, 263--297. Google Scholar
Digital Library
- Kosaraju, S. R. 1982. Decidability of reachability in vector addition systems (preliminary version). In Proceedings of the of 14th ACM Symposium on Theory of Computing (STOC'82). 267--281. Google Scholar
Digital Library
- Krohn, M., Kohler, E., and Kaashoek, M. 2007. Events can make sense. In Proceedings of the USENIX Annual Technical Conference. USENIX Association. Google Scholar
Digital Library
- Lambert, J. L. 1992. A structure to decide reachability in petri nets. Theor. Comput. Sci. 99, 1, 79--104. Google Scholar
Digital Library
- Lamport, L. 1977. Proving the correctness of multiprocess programs. IEEE Trans. Softw. Eng. 3, 2, 125--143. Google Scholar
Digital Library
- Lange, M. and Leiss, H. 2008-2010. To CNF or not to CNF? An efficient yet presentable version of the CYK algorithm. Informatica Didactica 8, 1--21.Google Scholar
- Lipton, R. 1976. The reachability problem is exponential-space hard. Tech. rep. 62, Department of Computer Science, Yale University.Google Scholar
- Mayr, E. W. 1981. An algorithm for the general petri net reachability problem. In Proceedings of the 13th ACM Symposium on Theory of Computing (STOC'81). 238--246. Google Scholar
Digital Library
- Mayr, E. W. and Meyer, A. R. 1981. The complexity of the finite containment problem for Petri nets. J. ACM 28, 3, 561--576. Google Scholar
Digital Library
- Minsky, M. 1967. Finite and Infinite Machines. Prentice-Hall, Englewood Cliffs, N.J. Google Scholar
Digital Library
- Pai, V., Druschel, P., and Zwaenepoel, W. 1999. Flash: An efficient and portable web server. In Proceedings of the USENIX Technical Conference. 199--212. Google Scholar
Digital Library
- Parikh, R. J. 1966. On context-free languages. J. ACM 13, 4, 570--581. Google Scholar
Digital Library
- Rackoff, C. 1978. The covering and boundedness problems for vector addition systems. Theor. Comput. Sci. 6, 2, 223--231.Google Scholar
Cross Ref
- Reisig, W. 1986. Petri Nets. An Introduction. Springer. Google Scholar
Digital Library
- Reps, T., Horwitz, S., and Sagiv, M. 1995. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the 22nd ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL'95). 49--61. Google Scholar
Digital Library
- Sen, K. and Viswanathan, M. 2006. Model checking multithreaded programs with asynchronous atomic methods. In Proceedings of the 18th International Conference on Computer Aided Verification (CAV'06). Lecture Notes in Computer Science, vol. 4144, Springer, 300--314. Google Scholar
Digital Library
- Sharir, M. and Pnueli, A. 1981. Two approaches to interprocedural data flow analysis. In Program Flow Analysis: Theory and Applications. Prentice-Hall, Inc., 189--233.Google Scholar
- Vardi, M. Y. 1991. Verification of concurrent programs—the automata-theoretic approach. Annal. Pure Appl. Logic 51, 79--98.Google Scholar
Cross Ref
- Walukiewicz, I. 2001. Pushdown processes: Games and model-checking. Inform. Comput. 164, 2, 234--263. Google Scholar
Digital Library
- Yen, H.-C. 1992. A unified approach for deciding the existence of certain petri net paths. Inform. Comput. 96, 1, 119--137. Google Scholar
Digital Library
Index Terms
Algorithmic verification of asynchronous programs
Recommendations
Context-bounded verification of liveness properties for multithreaded shared-memory programs
We study context-bounded verification of liveness properties of multi-threaded, shared-memory programs, where each thread can spawn additional threads. Our main result shows that context-bounded fair termination is decidable for the model; context-...
Verifying liveness for asynchronous programs
POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesAsynchronous or 'event-driven' programming is a popular technique to efficiently and flexibly manage concurrent interactions. In these programs, the programmer can post tasks that get stored in a task buffer and get executed atomically by a non-...
Verifying liveness for asynchronous programs
POPL '09Asynchronous or 'event-driven' programming is a popular technique to efficiently and flexibly manage concurrent interactions. In these programs, the programmer can post tasks that get stored in a task buffer and get executed atomically by a non-...






Comments