Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Algorithmic verification of asynchronous programs

Published: 04 May 2012 Publication History

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.

References

[1]
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.
[2]
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.
[3]
Aho, A., Sethi, R., and Ullman, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley.
[4]
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.
[5]
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.
[6]
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.
[7]
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.
[8]
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.
[9]
Chadha, R. and Viswanathan, M. 2009. Deciding branching time properties for asynchronous programs. Theor. Comput. Sci. 410, 42, 4169--4179.
[10]
Dickson, L. E. 1913. Finiteness of the odd perfect and primitive abundant numbers with $n$ distinct prime factors. Amer. J. Math. 35, 413--422.
[11]
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.
[12]
Esparza, J. 1997. Petri nets, commutative context-free grammars, and basic parallel processes. Fundamenta Informaticae 31, 13--26.
[13]
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.
[14]
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.
[15]
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.
[16]
Esparza, J., Kiefer, S., and Luttenberger, M. 2010. Newtonian program analysis. J. ACM 57, 6.
[17]
Esparza, J. and Nielsen, M. 1994. Decibility issues for Petri nets—a survey. J. Informatik Process. Cybernet. 30, 3, 143--160.
[18]
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.
[19]
Finkel, A. and Schnoebelen, P. 2001. Well-structured transition systems everywhere&excel; Theor. Comput. Sci. 256, 1-2, 63--92.
[20]
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.
[21]
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.
[22]
Hack, M. H. T. 1976. Decidability questions for Petri nets. Tech. rep. 161, MIT.
[23]
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.
[24]
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.
[25]
Karp, R. M. and Miller, R. E. 1969. Parallel program schemata. J. Comput. Syst. Sci. 3, 2, 147--195.
[26]
Kohler, E., Morris, R., Chen, B., Jannotti, J., and Kaashoek, M. 2000. The click modular router. ACM Trans. Comput. Syst. 18, 3, 263--297.
[27]
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.
[28]
Krohn, M., Kohler, E., and Kaashoek, M. 2007. Events can make sense. In Proceedings of the USENIX Annual Technical Conference. USENIX Association.
[29]
Lambert, J. L. 1992. A structure to decide reachability in petri nets. Theor. Comput. Sci. 99, 1, 79--104.
[30]
Lamport, L. 1977. Proving the correctness of multiprocess programs. IEEE Trans. Softw. Eng. 3, 2, 125--143.
[31]
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.
[32]
Lipton, R. 1976. The reachability problem is exponential-space hard. Tech. rep. 62, Department of Computer Science, Yale University.
[33]
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.
[34]
Mayr, E. W. and Meyer, A. R. 1981. The complexity of the finite containment problem for Petri nets. J. ACM 28, 3, 561--576.
[35]
Minsky, M. 1967. Finite and Infinite Machines. Prentice-Hall, Englewood Cliffs, N.J.
[36]
Pai, V., Druschel, P., and Zwaenepoel, W. 1999. Flash: An efficient and portable web server. In Proceedings of the USENIX Technical Conference. 199--212.
[37]
Parikh, R. J. 1966. On context-free languages. J. ACM 13, 4, 570--581.
[38]
Rackoff, C. 1978. The covering and boundedness problems for vector addition systems. Theor. Comput. Sci. 6, 2, 223--231.
[39]
Reisig, W. 1986. Petri Nets. An Introduction. Springer.
[40]
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.
[41]
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.
[42]
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.
[43]
Vardi, M. Y. 1991. Verification of concurrent programs—the automata-theoretic approach. Annal. Pure Appl. Logic 51, 79--98.
[44]
Walukiewicz, I. 2001. Pushdown processes: Games and model-checking. Inform. Comput. 164, 2, 234--263.
[45]
Yen, H.-C. 1992. A unified approach for deciding the existence of certain petri net paths. Inform. Comput. 96, 1, 119--137.

Cited By

View all
  • (2023)Coverability in 2-VASS with One Unary Counter is in NPFoundations of Software Science and Computation Structures10.1007/978-3-031-30829-1_10(196-217)Online publication date: 21-Apr-2023
  • (2023)Parameterized Verification under TSO with Data TypesTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-031-30823-9_30(588-606)Online publication date: 22-Apr-2023
  • (2022)Context-bounded verification of thread poolsProceedings of the ACM on Programming Languages10.1145/34986786:POPL(1-28)Online publication date: 12-Jan-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 34, Issue 1
April 2012
225 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/2160910
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 May 2012
Accepted: 01 March 2012
Revised: 01 November 2011
Received: 01 April 2011
Published in TOPLAS Volume 34, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Asynchronous (event-driven) programming
  2. Petri nets
  3. fair termination
  4. liveness

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)98
  • Downloads (Last 6 weeks)9
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Coverability in 2-VASS with One Unary Counter is in NPFoundations of Software Science and Computation Structures10.1007/978-3-031-30829-1_10(196-217)Online publication date: 21-Apr-2023
  • (2023)Parameterized Verification under TSO with Data TypesTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-031-30823-9_30(588-606)Online publication date: 22-Apr-2023
  • (2022)Context-bounded verification of thread poolsProceedings of the ACM on Programming Languages10.1145/34986786:POPL(1-28)Online publication date: 12-Jan-2022
  • (2022)A co-evolutionary genetic algorithms approach to detect video game bugsJournal of Systems and Software10.1016/j.jss.2022.111261188:COnline publication date: 18-May-2022
  • (2022)Automated Synthesis of AsynchronizationsStatic Analysis10.1007/978-3-031-22308-2_7(135-159)Online publication date: 2-Dec-2022
  • (2022)Compatibility checking for cyber‐physical systems based on microservicesSoftware: Practice and Experience10.1002/spe.313152:11(2393-2410)Online publication date: 31-Jul-2022
  • (2021)Abduction of trap invariants in parameterized systemsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.346.1346(1-17)Online publication date: 16-Sep-2021
  • (2021)Context-bounded verification of liveness properties for multithreaded shared-memory programsProceedings of the ACM on Programming Languages10.1145/34343255:POPL(1-31)Online publication date: 4-Jan-2021
  • (2021)Automata and fixpoints for asynchronous hyperpropertiesProceedings of the ACM on Programming Languages10.1145/34343195:POPL(1-29)Online publication date: 4-Jan-2021
  • (2021)Verifying higher-order concurrency with data automataProceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science10.1109/LICS52264.2021.9470691(1-13)Online publication date: 29-Jun-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media