Analysis and Prediction of the Long-Run Behavior of Probabilistic Sequential Programs with Recursion (Extended Abstract) Tom´ s Br´ azdil * , Faculty of Informatics, Masaryk University, Botanick´ a 68a, 60200 Brno, Czech Republic. brazdil@fi.muni.cz Javier Esparza Institute for Formal Methods in Computer Science, University of Stuttgart, Universit¨ at str. 38, 70569 Stuttgart, Germany. esparza@informatik.uni-stuttgart.de Anton´ ın Kuˇ cera Faculty of Informatics, Masaryk University, Botanick´ a 68a, 60200 Brno, Czech Republic. tony@fi.muni.cz Abstract We introduce a family of long-run average properties of Markov chains that are useful for purposes of performance and reliability analysis, and show that these properties can effectively be checked for a subclass of infinite-state Markov chains generated by probabilistic programs with recursive procedures. We also show how to predict these properties by analyzing finite prefixes of runs, and present an efficient prediction algorithm for the mentioned subclass of Markov chains. 1. Introduction Probabilistic methods are widely used in the design, analy- sis, and verification of computer systems that exhibit some kind of “quantified uncertainty” such as coin-tossing in ran- domized algorithms, subsystem failures (caused, e.g., by communication errors or bit flips with an empirically evalu- ated probability), or underspecification in some components of the system [24]. The underlying semantic model for these systems are Markov chains or Markov decision processes, depending mainly on whether the systems under considera- tion are sequential or parallel. Properties of such systems can formally be specified as formulae of suitable temporal log- * Supported by the Czech Science Foundation, grant No. 201/03/1161. Supported by the Alexander von Humboldt Foundation and by the re- search centre Institute for Theoretical Computer Science (ITI), project No. 1M0021620808. ics such as LTL, PCTL, or PCTL [22]. In these logics, one can express properties like “the probability of termination is at least 98%”, “the probability that each request will even- tually be granted is 1”, etc. Model-checking algorithms for these logics have been developed and implemented mainly for finite-state Markov chains and finite-state Markov de- cision processes [13, 28, 22, 12, 14]. This is certainly a limitation, because many implementations use unbounded data structures (counters, queues, stacks, etc.) that cannot al- ways be faithfully abstracted into finite-state models. The question whether one can go beyond this limit has been rapidly gaining importance and attention in recent years. Positive results exist mainly for probabilistic lossy channel systems [6, 9, 23, 25, 2]. Examples of more generic results are [1, 26]. Very recently, probabilistic aspects of recursive sequen- tial programs have also been taken into account [17, 10, 21, 20, 18]. In the non-probabilistic setting, the literature offers two natural models for such programs: pushdown automata (PDA), see e.g. [16, 19, 29, 5], where the stack symbols correspond to individual procedures and their local data, and the global data is modeled in the finite-state control; recursive state machines (RSM), see e.g. [4, 3], where the behavior of each procedure is specified by a finite-state automaton which can possibly invoke the computation of another automaton in a recursive fashion. Since PDA and RSM are fully equivalent (in a well-defined sense) and there are linear-time translations between them, the results achieved for one model immediately apply to the 1