International Journal of Information, Control and Computer Sciences ISSN: 2517-9942 Vol:3, No:3, 2009 638 A CTL Specification of Serializability for Transactions Accessing Uniform Data Rafat Alshorman, Walter Hussak Abstract—Existing work in temporal logic on representing the execution of infinitely many transactions, uses linear-time temporal logic (LTL) and only models two-step transactions. In this paper, we use the comparatively efficient branching-time computational tree logic CTL and extend the transaction model to a class of multi- step transactions, by introducing distinguished propositional variables to represent the read and write steps of n multi-step transactions accessing m data items infinitely many times. We prove that the well known correspondence between acyclicity of conflict graphs and serializability for finite schedules, extends to infinite schedules. Furthermore, in the case of transactions accessing the same set of data items in (possibly) different orders, serializability corresponds to the absence of cycles of length two. This result is used to give an efficient encoding of the serializability condition into CTL. Keywords—computational tree logic, serializability, multi-step transactions. I. I NTRODUCTION A S concurrent users access and update databases in terms of transactions, a reliable condition of correctness is needed for the execution of these transactions. The established correctness condition is that of serializability, where an inter- leaved schedule of concurrent transactions is equivalent to a serial schedule of the transactions. Most work on serializability has modelled histories to be finite with a known fixed bound [8], [9]. Recently, with the emergence of new techniques such as web transactions and mobile databases, where an unlimited number of transactions may be incoming and outgoing to the databases in continuous streams, the importance of represent- ing infinite histories has been recognised [5], [6], [7]. One way of representing infinite histories is as models of temporal logic formulae. A benefit of using temporal logic is the availability of powerful model checkers such as NuSMV [2]. Model checkers can carry out exhaustive checks of a correctness criterion such as serializability, and are fully automatic and therefore require no special expertise to carry out the verification. The drawback with model checking is that even the most powerful model checkers cannot overcome the theoretical worst-case complexity of model checking inherent from the temporal logic being used. The most benign tem- poral logic in this respect is CTL which can check whether executions represented by a finite-state machine satisfy a specification with time complexity O((|S| + |R|).|f |), where |S| is the number of states in the finite state machine, |R| the number of transitions, and |f | is the length of the specification R. Alshorman is with the Department of computer science, Loughborough University, Loughborough, LE11 3TU, UK, e-mail: R.alshorman@lboro.ac.uk. W. Hussak is with the Department of computer science, Loughborough University, Loughborough, LE11 3TU, UK, e-mail: W.Hussak@lboro.ac.uk. Manuscript received June 24, 2009; revised July 8, 2009. formula. This is marginally better than for LTL which has a corresponding time complexity of O((|S| + |R|).2 O(|f |) [3]. However, the temporal logics that have been used to specify transactional concurrency include the partial-order temporal logic ISTL in [10], quantified propositional temporal logic QPTL in [5], LTL in [6], a first-order temporal logic in the first part of [11] and a monodic fragment of first-order temporal logic in [7]. With the exception of LTL these are, at best, of exponential space complexity, and, at worst, undecidable. In this paper, we give a computationally efficient specifi- cation of serializability in CTL. The serializability condition expressed in CTL is based on acyclicity of conflict graphs. To be able to use such a condition, we prove that acyclicity of conflict graphs corresponds to serializability for infinite schedules. We then assume the further property for our transac- tions, that they access the same set of data items in different orders. We show that serializability then corresponds to the efficient condition where only cycles of length two need be checked, and this condition is used for the CTL specification. This work advances that of [5] and [6], which both deal with two-step transactions, to the more normal case of multi-step transactions. We also produces the specification in the slightly more efficient CTL rather than LTL. The paper is organized as follows. In Section II, we give a mathematical model of concurrent multi-step transactions. In Section III, the results on acyclicity of conflict graphs and serializability for infinite schedules are given. From these, serializability is characterized mathematically in a way to be encoded into CTL. The CTL specification is given in Section IV, and conclusions are drawn in Section V. II. A MODEL OF CONCURRENT MULTI - STEP TRANSACTIONS A. Steps and histories The model of concurrent two-step transactions in [5] com- prises n transactions {T 1 ,...,T n } occurring infinitely many times, with each transaction containing a read step and a write step each accessing a finite number of data items. In this paper, we define transactions as containing multiple alternate read and write steps, each accessing a single data item. We shall denote a read step and the corresponding write step on the data item x j by transaction T i , as r i (x j ) and w i (x j ), respectively, and the set of data items accessed by all transactions as D. We say that two steps are conflicting if they belong to different transactions, they access the same data item and at least one of them is a write step. Later in this paper, we shall assume that, given transactions T i and T i ′ , the data items accessed by both are the same, but that the order of access of data