Model Checking with Strong Fairness \Lambda Yonit Kesteny Amir Pnueliz Li-on Ravivz Elad Shaharz July 4, 2001 Abstract In this paper we present a coherent framework for symbolic model checking of linear-time temporal logic (ltl) properties over finite state reactive systems, taking full fairness constraints into consideration. We use the computational model of a fair discrete system (fds) which takes into account both justice (weak fairness) and compassion (strong fairness). The approach presented here reduces the model checking problem into the question of whether a given fds is feasible (i.e. has at least one computation). The contribution of the paper is twofold: On the methodological level, it presents a direct self-contained exposition of full ltl symbolic model checking without resorting to reductions to either ctl or automata. On the technical level, it extends previous methods by dealing with compassion at the algorithmic level instead of adding it to the specification, and providing the first symbolic method for checking feasibility of fds's (equivalently, symbolically checking for the emptiness of Streett automata), based on the Emerson-Lei fixpoint characterization of both weak and strong fairness. Finally, we extend ctl* with past operators, and show that the basic symbolic feasibility algorithm presented here, can be used to model check an arbitrary ctl* formula over an fds with full fairness constraints. 1 Introduction Two brands of temporal logics have been proposed over the years for specifying the properties of reactive systems: the linear time brand ltl [GPSS80] and the branching time variant ctl [CE81]. Also two methods for the formal verification of the temporal properties of reactive systems have been developed: the deductive approach based on interactive theorem proving, and the fully automatic algorithmic approach, widely known as model checking. Tracing the evolution of these ideas, we find that the deductive approach adopted ltl as its main vehicle for specification, while the model checking approach used ctl as the specification language [CE81], [QS82]. This is more than a historical coincidence or a matter of personal preference. The main advantage of ctl for model checking is that it is state-based and, therefore, the process of verification can be performed by straightforward labeling of the existing states in the discrete structure, leading to no further expansion or unwinding of the structure. In contrast, ltl is path-based and, since many paths can pass through a single state, labeling a structure by the ltl sub-formulas it satisfies necessarily requires splitting the state into several copies. This is the reason why the development \Lambda This research was supported in part by an infra-structure grant from the Israeli Ministry of Science and Art, a grant from the U.S.-Israel Binational Science Foundation, and a gift from Intel. yDept. of Communication Systems Engineering, Ben Gurion University, ykesten@bgumail.bgu.ac.il -- Contact author zWeizmann Institute of Science, famir,eladg@wisdom.weizmann.ac.il 1 of model checking algorithms for ltl always lagged several years behind their first introduction for the ctl logic. The first model checking algorithms were based on the enumerative approach, constructing an explicit representation of all reachable states of the considered system [CE81], and were developed for the branching-time temporal logic ctl. The ltl version of these algorithms was developed in [LP84] for the future fragment of propositional ltl (ptl), and extended in [LPZ85] to the full ptl. The basic fixed-point computation algorithm for the identification of fair computations presented in [LP84], was developed independently in [EL85] for fctl (fair ctl). Observing that upgrading from justice to full fairness (i.e., adding compassion) is reflected in the automata view of verification as an upgrade from a Buchi to a Streett automaton, we can view the algorithms presented in [EL85] and [LP84] as algorithms for checking the emptiness of Streett automata [VW86]. An improved algorithm solving the related problem of emptiness of Streett automata, was later presented in [HT96]. The development of the impressively efficient symbolic verification methods and their application to ctl [BCM+92] raised the question whether a similar approach can be applied to ptl. The first satisfactory answer to this question was given in [CGH97], which showed how to reduce model checking of a future ptl formula into ctl model checking. The advantage of this approach is that, following a preliminary transformation of the ptl formula and the given system, the algorithm proceeds by using available and efficient ctl model checkers such as smv. A certain weakness of all the available symbolic model checkers is that, in their representation of fairness, they only consider the concept of justice (weak fairness). As suggested by many researchers, another important fairness requirement is that of compassion (strong fairness) (e.g., [GPSS80], [LPS81], [Fra86]). This type of fairness is particularly useful in the analysis of systems that use semaphores, synchronous communication, and other special coordination primitives. A partial answer to this criticism is that, since compassion can be expressed in ltl (but not in ctl), once we developed a model checking method for ltl, we can always add the compassion requirements as an antecedent to the property we wish to verify. A similar answer is standardly given for symbolic model checkers that use the _-calculus as their specification language, because compassion can also be expressed as a _-calculus formula [SdRG89]. The only question remaining is how practical this is. In this paper we present an approach to the symbolic model checking of ptl formulas, which takes into account full fairness, including both justice and compassion. The approach is selfcontained and does not depend on a reduction to either ctl model checking (as in [CGH97]) or to automata. The main advantage of such a self-contained approach is that the end users no longer need to deal with two different kinds of logics. The treatment of the ptl component is essentially that of a symbolic construction of a tableau by assigning a new auxiliary variable to each temporal sub-formula of the property we wish to verify. In that, our approach resembles very much the reduction method used in [CGH97] which, in turn, is an extension of the statification method used in [MP91a] and [MP95] to deal with the past fragment of ltl. The model checking problem is then reduced into the question of feasibility of an fds. The symbolic feasibility algorithm, similar to the enumerative algorithm of [LP84], identifies all computations satisfying a given set of fairness constraints. This involves the identification of all fair strongly connected components (SCC). However, while the enumerative algorithm identifies each SCC separately, the BDD-based symbolic algorithm is more efficient, identifying all states participating in some fair SCC simulataneously. Our symbolic algorithm can be viewed as a straightforward implementation of the nested fixed-point characterization of Emerson-Lei for fully fair computations [EL86], as opposed to the ctl model checkers which consider only the weak-fairness part of this characterization. 2 Another work related to the approach developed here is presented in [HKSV97], where a bddbased symbolic algorithm for bad cycle detection is presented. This algorithm solves the problem of finding all those cycles within the computation graph, which satisfy a given set of weak fairness constraints. The presented algorithm gives a heuristics which improves the performance of the Emerson-Lei algorithm. We use the same heuristics in our algorithm, while dealing with both types of fairness constraints. According to the automata-theoretic view, [HKSV97] presents a symbolic algorithm for the problem of emptiness of Buchi automata, while the algorithms presented here provide a symbolic solution to the emptiness problem of Streett automata. The symbolic feasibility algorithm presented here is not restricted to the treatment of ptl formulas. With minor modifications it can be applied to check the ctl formula Efair Gp, where the fair subscript refers now to full fairness. In [EL85], Emerson and Lei observed that the problem of ctl* model checking of finite state systems can be resolved by recursive calls to an ltl model checking algorithm. Taking a similar approach, we augment ctl* with past operators and show that the symbolic feasibility algorithm presented here, can be used to model check an arbitrary ctl* formula over a finite state fds D, taking the full fairness constraints of D into consideration. The rest of the paper is organized as follows. In section 2 we present the computational model of fair discrete systems (fds). In section 3 we define the parallel composition of two fdss into a single fds. Both synchronous and asynchronous compositions are considered. In section 4 we present ptl, the propositional fragment of linear temporal logic, including the past operators. Next, in section 5 we discuss the construction of a tester for a ptl formula ', which is an fds characterizing all the sequences which satisfy '. Having transformed the model checking problem into the feasibility problem of an fds, we present the symbolic feasibility algorithm in section 6, followed by an algorithm for extracting a witness (a counter example) in section 7. In section 8 we augment ctl* with past operators and use the feasibility algorithm to model check an arbitrary ctl* formulas over a finite state fds. We conclude in section 9 with experimental results and final conclusions. A (partial) conference version of this paper appeared in [KPR98]. 2 Fair Discrete Structure As a computational model for reactive systems, we take the model of fair discrete system (fds). The computational model is used for modeling both the verified system and the temporal properties. The fds model replaces the earlier model of fair transition system (fts) presented in [MP91b] and [MP95]. The main difference between these two models is in the representation of fairness constraints. The advantage of the new representation is that it enables a unified representation of fairness constraints arising from both the system being verified, and the temporal property. An fds D : hV; \Theta ; ae; J ; Ci consists of the following components. ffl V = fu1; :::; ung : A finite set of typed state variables. For the case of finite-state systems, we assume that all state variables range over finite domains. We define a state s to be a typeconsistent interpretation of V , assigning to each variable u 2 V a value s[u] in its domain. We denote by \Sigma the set of all states. ffl \Theta : The initial condition. This is an assertion characterizing all the initial states of an fds. A state is defined to be initial if it satisfies \Theta . 3 ffl ae : A transition relation. This is an assertion ae(V; V 0), relating a state s 2 \Sigma to its D-successor s0 2 \Sigma by referring to both unprimed and primed versions of the state variables. An unprimed version of a state variable refers to its value in s, while a primed version of the same variable refers to its value in s0. For example, the transition relation x0 = x + 1 asserts that the value of x in s0 is greater by 1 than its value in s. ffl J = fJ1; : : : ; Jkg : A set of assertions expressing the justice requirements (also called weak fairness requirements). Intentionally, the justice requirement J 2 J stipulates that every computation contains infinitely many J-states (states satisfying J ). ffl C = fhp1; q1i; : : : hpn; qnig : A set of assertions expressing the compassion requirements (also called strong fairness requirements). Intentionally, the compassion requirement for hp; qi 2 C stipulates that every computation containing infinitely many p-states also contains infinitely many q-states. The transition relation ae(V; V 0) identifies state s0 as a D-successor of state s if hs; s0i j= ae(V; V 0); where hs; s0i is the joint interpretation which interprets x 2 V as s[x], and interprets x0 as s0[x]. Let oe : s0; s1; s2; :::; be an infinite sequence of states, ' be an assertion (state formula), and let j * 0 be a natural number. We say that j is a '-position of oe if sj is a '-state. Let D be an fds for which the above components have been identified. We define a fair run of D to be an infinite sequence of states oe : s0; s1; s2; :::; satisfying the following requirements: ffl Consecution: For each j = 0; 1; :::, the state sj+1 is a D-successor of the state sj. ffl Justice: For each J 2 J , oe contains infinitely many J -positions ffl Compassion: For each hp; qi 2 C, if oe contains infinitely many p-positions, it must also contain infinitely many q-positions. A fair run of is a computation of D if it satisfies the requirement ffl Initiality: s0 is initial, i.e., s0 j= \Theta . For an fds D, we denote by Comp(D) the set of all computations of D. 3 Parallel Composition of fds's Fair discrete systems can be composed in parallel. Let D1 = hV1; \Theta 1; ae1; J1; C1i and D2 = hV2; \Theta 2; ae2; J2; C2i be two fair discrete systems. We consider two versions of parallel composition. 3.1 Asynchronous Parallel Composition We define the asynchronous parallel composition of two fds's to be hV; \Theta ; ae; J ; Ci = hV1; \Theta 1; ae1; J1; C1i k hV2; \Theta 2; ae2; J2; C2i; 4 where, V = V1 [ V2 \Theta = \Theta 1 ^ \Theta 2 ae = (ae1 ^ pres (V2 \Gamma V1)) . (ae2 ^ pres (V1 \Gamma V2)) J = J1 [ J2 C = C1 [ C2: The asynchronous parallel composition of systems D1 and D2 is a new system D whose basic actions are chosen from the basic actions of its components, i.e., D1 and D2. Thus, we can view the execution of D as the interleaved execution of D1 and D2, and can use asynchronous composition in order to construct big concurrent systems from smaller components. As seen from the definition, D1 and D2 may have different as well as common state variables, and the variables of D are the union of all of these variables. The initial condition of D is the conjunction of the initial conditions of D1 and D2. The transition relation of D states that at any step, we may choose to perform a step of D1 or a step of D2. However, when we select one of the two systems, we should also take care to preserve the private variables of the other system. For example, choosing to execute a step of D1, we should preserve all variables in V2 \Gamma V1. The justice and compassion sets of D are formed as the respective unions of the justice and compassion sets of the component systems. Asynchronous parallel composition is used to assemble an assynchronous system from its components. 3.2 Synchronous Parallel Composition We define the synchronous parallel composition of two fds's to be hV; \Theta ; ae; J ; Ci = hV1; \Theta 1; ae1; J1; C1i kj hV2; \Theta 2; ae2; J2; C2i; where, V = V1 [ V2 \Theta = \Theta 1 ^ \Theta 2 ae = ae1 ^ ae2 J = J1 [ J2 C = C1 [ C2: The synchronous parallel composition of systems D1 and D2 is a new system D, each of whose basic actions consists of the joint execution of an action of D1 and an action of D2. Thus, we can view the execution of D as the joint execution of D1 and D2. In some cases, in particular when considering hardware designs which are naturally synchronous, we may use synchronous composition to assemble a system from its components. However, our primary use of synchronous composition is for combining a system with a tester T' for an ltl property '; as described in Section 5. 4 Linear Temporal Logic As a requirement specification language for reactive systems we take the propositional fragment of linear temporal logic (ptl) [MP91b]. Let P be a finite set of propositions. A state formula is constructed out of propositions and the boolean operators : and .. A temporal formula is constructed out of state formulas to which we apply the boolean operators and the following basic temporal operators: 5 2 - Next ' - Previous U - Until S - Since A model for a temporal formula p is an infinite sequence of states oe : s0; s1; :::; where each state sj provides an interpretation for the variables mentioned in p. Given a model oe, as above, we present an inductive definition for the notion of a temporal formula p holding at a position j * 0 in oe, denoted by (oe; j) j= p. ffl For a state formula p, (oe; j) j= p () sj j= p That is, we evaluate p locally, using the interpretation given by sj. ffl (oe; j) j= :p () (oe; j) 6j= p ffl (oe; j) j= p . q () (oe; j) j= p or (oe; j) j= q ffl (oe; j) j= 2 p () (oe; j + 1) j= p ffl (oe; j) j= p U q () for some k * j; (oe; k) j= q; and for every i such that j ^ i ! k; (oe; i) j= p ffl (oe; j) j= ' p () j ? 0 and (oe; j \Gamma 1) j= p ffl (oe; j) j= p S q () for some k ^ j; (oe; k) j= q; and for every i such that j * i ? k; (oe; i) j= p We refer to the set of variables that occur in a formula p as the vocabulary of p. For a state formula p and a state s such that p holds on s, we say that s is a p-state. If (oe; 0) j= p, we say that p holds on oe, and denote it by oe j= p. A formula p is called satisfiable if it holds on some model. A formula is called temporally valid if it holds on all models. The notion of validity requires that the formula holds over all models. Given an fds D, we can restrict our attention to the set of models which correspond to computations of D, i.e., Comp(D). This leads to the notion of D-validity, by which a temporal formula p is D-valid (valid over fds D) if it holds over all the computations of P . Obviously, any formula that is (generally) valid is also D-valid for any fds D. In a similar way, we obtain the notion of D-satisfiability. Additional temporal operators may be defined as follows: 1 p = t U p \Gamma Eventually p 0 p = : 1 :p \Gamma Always, henceforth p p W q = :((:q) U (:p ^ :q) \Gamma Waiting-for, unless, weak until bib 5 Construction of Testers for ptl Formulas In this section, we present the construction of a tester for a ptl formula ', which is an fds T' characterizing all the sequences which satisfy '. Without loss of generality, assume that the only temporal operators occurring in ' are 2 , U , ' and S . For a formula , we write 2 ' to denote that is a sub-formula of (possibly equal to) '. Formula is called principally temporal if its main operator is a temporal operator. The fds T' is given by T': DV'; \Theta '; ae'; J'; C'E; where the components are specified as follows: 6 System Variables The system variables of T' consist of the vocabulary of ' plus a set of auxiliary boolean variables X': fxp j p 2 ' a principally temporal sub-formula of 'g; which includes an auxiliary variable xp for every p, a principally temporal sub-formula of '. The auxiliary variable xp is intended to be true in a state of a computation iff the temporal formula p holds at that state. We define a mapping O/ which maps every sub-formula of ' into an assertion over V'. O/() = 8???!???: for a state formula :O/(p) for = :p O/(p) . O/(q) for = p . q x for a principally temporal formula The mapping O/ distributes over all boolean operators. When applied to a state formula it yields the formula itself. When applied to a principally temporal sub-formula p it yields xp. Initial Condition The initial condition of T' is given by \Theta ' = past-init ('); where past-init (') = ^ ' p2' :x' p ^ ^ pSq2' (xp Sq $ O/(q)) Thus, the initial condition requires that all auxiliary variables encoding "Previous" formulas are initially false. This corresponds to the observation that all formulas of the form ' p are false at the first state of any sequence. In addition, past-init (') requires that the truth value of xp Sq equals the truth value of O/(q), corresponding to the observation that the only way to satisfy the formula p Sq at the first state of a sequence is by satisying q. Note that, unlike the definition of testers presented in [KPR98, KP00], the assertion O/(') is not a conjunct of \Theta '. Namely, the initial condition of a tester T' does not assert O/('). This will permit the use of algorithm feasible presented in Section 6, for model checking both ltl and ctl* properties. Transition Relation The transition relation of T' is given by ae': 8????????????: ^ ^ ' p2' (x0' p $ O/(p)) ^ ^ pSq2' (x0pSq $ (O/0(q) . (O/0(p) ^ xpSq ))) ^ ^ 2 p2' (x2 p $ O/0(p)) ^ ^ p Uq2' (xp Uq $ (O/ (q) . (O/ (p) ^ x0p Uq ))) 9?????????? ??; Note that we use the form x when we know that is principally temporal and the form O/() in all other cases. The expression O/0() denotes the primed version of O/(). The conjuncts of the transition relation corresponding to the Since and the Until operators are based on the following expansion formulas: p S q () q . (p ^ ' (p S q)) p U q () q . (p ^ 2 (p U q)) 7 Fairness Requirements For each formula p U q 2 ' which has a positive occurrence in ' (i.e., an occurrence under an even number of negations), we include in J the disjunction O/(q) . :xa U q This justice requirement ensures that the sequence contains infinitely many states at which O/(q) is true, or infinitely many states at which xp Uq is false. The compassion set of T' is always empty. Correctness of the Construction For a set of variables U , we say that sequence eoe is a U -variant of sequence oe if oe and eoe agree on the interpretation of all variables, except possibly the variables in U . The following claim states that the construction of the tester T' correctly captures the set of sequences satisfying the formula '. Claim 1 A state sequence oe = s0; : : : satisfies the temporal formula ' iff oe is an X'-variant of a computation eoe = es0; : : : of T'; and es0 j= O/('). 6 Checking for Feasibility Let D be an fds. We define a run of D to be a finite or infinite sequence of states which satisfy the requirements of initiality and consecution but not necessarily any of the justice or compassion requirements. We say that a state s is D-accessible if it appears in some run of D. When D is understood from the context, we simply say that state s is accessible. We say that D is feasible if D has at least one computation. We say that a state s is D-feasible, if D has a computation oe : s0; s1; s2; :::; such that s = si for some i * 0. In this section we present a symbolic algorithm for computing the set of D-feasible states. The symbolic algorithm presented here, is inspired by the full state-enumeration algorithm originally presented in [LP84] and [EL85] (for full explanations and proofs see [Lic91] and [MP95]). The enumerative algorithm was designed for ltl model checking, and was concerned with checking feasibility of an fds. Since we want to use the same basic algorithm for both ltl and ctl* model checking, our basic symbolic algorithm computes the set of D-feasible states, from which the feasibility of D is trivially obtained. The enumerative algorithm constructs a state-transition graph GD for D. This is a directed graph whose nodes are all the D-accessible states, and whose edges connect node s to node s0 iff s0 is a D-successor of s. If system D has a computation it corresponds to an infinite path in the graph GD which starts at a D-initial state. We refer to such paths as initialized paths. Subgraphs of GD can be specified by identifying a subset S ` GD of the nodes of GD . It is implied that as the edges of the subgraph we take all the original GD -edges connecting nodes (states) of S. A subgraph S is called just if it contains a J-state for every justice requirement J 2 J . The subgraph S is called compassionate if, for every compassion requirement (p; q) 2 C, S contains a q-state, or S does not contain any p-state. A subgraph is singular if it is composed of a single state which is not connected to itself. A subgraph S is fair if it is a non-singular strongly connected subgraph which is both just and compassionate. For ss, an infinite initialized path in GD, we denote by Inf (ss) the set of states which appear infinitely many times in ss. The following claims, which are proved in [Lic91], connect computations of D with fair subgraphs of GD. 8 Claim 2 The infinite initialized path ss is a computation of D iff Inf(ss) is a fair subgraph of GD. The Symbolic algorithm The symbolic algorithm, aimed at exploiting the data structure of obdd's, is presented in a general set notation. Let \Sigma denote the set of all states of an fds D. A predicate over \Sigma is any subset U ` \Sigma . A (binary) relation over \Sigma is any set of pairs R ` \Sigma \Theta \Sigma . Since both predicates and relations are sets, we can freely apply the set-operations of union, intersection, and complementation to these objects. In addition, we define two operations of composition of predicates and relations. For a predicate U and relation R, we define the operations of pre- and post-composition as follows: R ffi U = fs 2 \Sigma j (s; s0) 2 R for some s0 2 U g U ffi R = fs 2 \Sigma j (s0; s) 2 R for some s0 2 U g If we view R as a transition relation, then R ffi U is the set of all R-predecessors of U -states, and U ffi R is the set of all R-successors of U -states. To capture the set of all states that can reach a U -state in a finite number of R-steps (including zero), we define R\Lambda ffi U = U [ R ffi U [ R ffi (R ffi U ) [ R ffi (R ffi (R ffi U )) [ \Delta \Delta \Delta : It is easy to see that R\Lambda ffi U converges after a finite number of steps. In a similar way, we define U ffi R\Lambda = U [ U ffi R [ (U ffi R) ffi R [ ((U ffi R) ffi R) ffi R [ \Delta \Delta \Delta ; which captures the set of all states reachable in a finite number of R-steps from a U -state. For predicates U and W , we define the relation U \Theta W as U \Theta W = f(s1; s2) 2 \Sigma 2 j s1 2 U; s2 2 W g: For an assertion ' over VD (the system variables of fds D), we denote by k'k the predicate consisting of all states satisfying '. Similarly, for an assertion ae over (VD ; V 0D ), we denote by kaek the relation consisting of all state pairs hs; s0i satisfying ae. Algorithm feasible presented in fig. 1, denotes by R the transition relation implied by aeD . The predicate variable new represents a set of states. We use the shorthand notation R " new def= R " (new \Theta \Sigma ): Algorithm feasible consists of a main loop which converges when the values of the predicate variable new coincide on two successive visits to line 4. Prior to entry to the main loop we compute in new the set of all accessible states in D, and place in R the transition relation implied by aeD , restricted to pairs (s1; s2) where s1 is an accessible state in D. The main loop (lines 4-11), contains three inner loops. The inner loop at lines 6-7, successively removes from new all states which do not have a successor in new. The loop at lines 8-9 removes from new all states which are not R\Lambda -predecessors of some J -state, for all justice requirements J 2 J . The term R " new restricts R to pairs (s1; s2) where s1 is currently in new. This is done to avoid regeneration of states which have already been eliminated. The loop at lines 10-11, removes from new all p-states which are not R\Lambda -predecessors of some q-state for some (p; q) 2 C. The term R " new restricts R again to pairs (s1; s2) where s1 is currently in new. Finally, line 12 augments new with all its R\Lambda -predecessors. 9 Algorithm feasible (D) : predicate -- Compute the set of D-feasible states new; old : predicate R : relation 1. old := ; 2. new := k\Theta D k ffi kaeD k\Lambda ; 3. R := kaeD k " new 4. while (new 6= old) do begin 5. old := new 6. while (new 6= new " R ffi new) do 7. new := new " (R ffi new) 8. for each J 2 J do 9. new := (R " new)\Lambda ffi (new " kJ k) 10. for each (p; q) 2 C do 11. new := (new \Gamma kpk) [ (R " new)\Lambda ffi (new " kqk) end 12. new := R\Lambda ffi new 13. return(new) Figure 1: Algorithm feasible Correctness of the Set-Based Algorithm Let D be an fds, s be a D-accessible state and UD be the set of states resulting from the application of algorithm feasible over D. The following sequence of claims establish the correctness of the algorithm. Claim 3 (Termination) Algorithm feasible terminates. Proof: Let us denote by new4i the value of variable new on the i'th visit (i = 0; 1; : : :) to line 4 of the algorithm. Since all assignments to variable new within the main loop, are of the form new := E where E ` new; it is not difficult to see that new41 ` new40. From this, it can be established by induction on i that new4i+1 ` new4i , for every i = 0; 1; : : : . It follows that the sequence jnew40j * jnew41j * jnew42j \Delta \Delta \Delta , is a non-increasing sequence of natural numbers which must eventually stabilize. At the point of stabilization, we have that new4i+1 = new4i , implying termination of the algorithm. Claim 4 (Completeness) If s is D-feasible then s 2 UD . Proof: Assume that s is D-feasible. Then by definition, s is on an initialized infinite fair path ss in D. From Claim 2, Inf (ss) is a fair subgraph S ` GD . Namely, S is a non-singular stronglyconnected subgraph (scs) which contains a J -state for every J 2 J , and such that, for every (p; q) 2 C, S contains a q-state or contains no p-state. Lete S : S [ fs0 j s0 is on an initialized path to a state in Sg 10 Obviously s 2 eS. Following the operations performed by algorithm feasible, we can show thate S is contained in the set new at all locations beyond the first visit to line 4. This is because any removal of states from new which is carried out in lines 7, 9, and 11, cannot remove any state of eS. Consequently, eS must remain throughout the process and will be contained in UD , implying that s 2 UD . Claim 5 (Soundness) If s 2 UD then s is D-feasible. Proof: Assume that s 2 UD . Let S ` UD be the set of states in UD , accessible from s by a UD -path. Since s 2 UD ; s is D-accessible. For every J 2 J , s can reach a J -state by a path fully contained within S. For every (p; q) 2 C, either s is not a p-state, or s can reach a q-state by an S-path. Let us decompose S into maximal strongly-connected subgraphs. At least one subgraph St is terminal in this decomposition, in the sense that every S-edge exiting an St-state also leads to an St-state. We argue that St is fair. By definition, it is strongly connected. It cannot be singular, because then it would consist of a single state that would have been removed on the last execution of the loop at lines 6-7. Let r be an arbitrary state within St. For every J 2 J , r can reach some J -state er 2 UD by an S-path. Since St is terminal within S, this path must be fully contained within St and, therefore, er 2 St. In a similar way, we can show that St satisfies all the compassion requirements. We can conclude that s is on an initialized path to a fair subgraph, which establishes that s is D-feasible. The Claims Completeness and Soundness lead to the following conclusion: Corollary 6 s is D-feasible iff s 2 UD. Corollary 7 D is feasible iff the set UD " \Theta D 6= ;. Proof: A direct result of Corollary 6 and the definition of feasibility. Algorithm feasible for ctl* Versus ltl In [KP98], algorithm feasible is designed for model-checking ltl properties. For ltl model checking, algorithm feasible needs to assert the existence (non-existence) of a reachable fair scs in D. The original enumerative algorithms of [EL85] and [LP84] were based on recursive exploration of strongly connected subgraphs. Strongly connected subgraphs require closure under both successors and predecessors. As our algorithm (and its proof) in [KP98] show, it is possible to relax the requirement of bi-directional closure into either closure under predecessors and looking for terminal scs components, or symmetrically requiring closure under successors and looking for initial scs components. This may be an idea worth exploring even in the enumerative case, and to which we can again apply the lock-step search optimization described in [HT96]. In addition to the choice between forward, backward and bi-directional closures, there are other possible variations of algorithm feasible. An experimental comparison of some of these variations is presented in section 9. 11 In this paper, however, algorithm feasible is designed for model-checking both ltl and ctl* properties, as discussed in section 8. While for ltl model-checking algorithm feasible has to provide us with a boolean (yes-no) answer, for ctl* model-checking algorithm feasible has to evaluate a set of states, namely, the set of D-feasible states. In this case, we can no longer choose arbitrarily between forward and backward closure evaluation. The only appropriate choice is backward closure, ensuring that all terminal scs are fair. This is the version of feasible presented in Figure 1. Model Checking ltl Properties Having presented an algorithm for verifying whether a finite-state fds is feasible, we can now model check an ltl property ' over an fds D as follows. Let \Theta D;' = \Theta D ^ O/(:'). Namely, \Theta D;' is an assertion representing the set of states that satisfy the initial condition of D and the temporal formula :', in the combined fds DkjT:'. To model check the D-validity D j= ', ffl Construct the tester T:'. ffl Construct the synchronous parallel composition DkjT:'. ffl Evaluate feasible(DkjT:') " \Theta D;'. The verification is based on the following Claim. Claim 8 D j= ' iff feasible(DkjT:') " \Theta D;' = ; The proof of equivalent claims can be found in [VW86], [LP84]. 7 Extracting a Witness To use formal verification as an effective debugging tool in the context of verification of finite-state reactive systems checked against temporal properties, a most useful information is a computation of the system which violates the requirement, to which we refer as a witness or a counter-example. Since we reduced the problem of checking D j= ' to checking the feasibility of D kj T:', such a witness can be provided by a computation of the combined fds D kj T:'. In the following we present an algorithm which produces a computation of an fds that has been declared feasible. We introduce the list data structure to represent a linear list of states. We use \Lambda to denote the empty list. For two lists L1 = (s1; : : : ; sa) and L2 = (sa; : : : ; sb), we denote by L1 \Lambda L2 their fusion, defined by L1 \Lambda L2 = (s1; : : : ; sa; : : : ; sb): Finally, for a list L, we denote by last (L) the last element of L. For a non-empty predicate U ` \Sigma , we denote by choose(U ) a consistent choice of one of the members of U . The function path (source; destination; R), presented in Fig. 2, returns a list which contains the shortest R-path from a state in source to a state in destination. In the case that source and destination have a non-empty intersection, path will return a state belonging to this intersection which can be viewed as a path of length zero. The algorithm presented in figure 2 is not optimal since its time complexity is the square of the length of the returned path. It can be improved to linear time complexity at te cost of linear space complexity. Finally, in figure 3 we present an algorithm which produces a computation of a given fds. Although a computation is an infinite sequence of states, if D is feasible, it always has an ultimately 12 Function path (source; destination : predicate; R : relation) : list -- -- -- Compute shortest path from source to destination start; f : predicate L : list s : state start := source L := \Lambda while (start " destination = ;) do begin f := R ffi destination while (start " f = ;) do f := R ffi f s := choose(start " f ) L := L \Lambda (s) start := s ffi R end return L \Lambda (choose(start " destination)) Figure 2: Function path . periodic computation of the following form: oe: s0; s1; : : : ; sk-- -z "" prefix ; sk+1; : : : ; sk-- -z "" period ; sk+1; : : : ; sk-- -z "" period ; \Delta \Delta \Delta ; sk+1; : : : ; sk-- -z "" period ; \Delta \Delta \Delta Based on this observation, our witness extracting algorithm will return as result the two finite sequences prefix and period . The algorithm starts by checking whether fds D is feasible. It uses Algorithm feasible to perform this check. If D is found to be infeasible, the algorithm exits while providing a pair of empty lists as a result. If D is found to be feasible, we store in final the set of states returned by feasible. This set contains the set of all states participating in a computation of D. We restrict the transition relation R to pairs (s1; s2) where both s1 and s2 are states within final . Next, we perform a search for a terminal maximal strongly connected subgraph (terminal mscs) within final . The search starts at s 2 final , an arbitrarily chosen state within final . In the loop at lines 5 and 6 we search for a state s satisfying fsg ffi R\Lambda ` R\Lambda ffi fsg. i.e. a state all of whose R\Lambda -successors are also R\Lambda - predeccessors. This is done by successively replacing s by a state s 2 fsg ffi R\Lambda \Gamma R\Lambda ffi fsg; as long as the set of s-succcessors is not contained in the set of s-predeccessors. Eventually, execution of the loop must terminate when s reaches a terminal mscs within final . Termination is guaranteed because each such replacement moves the state from one mscs to a proceeding mscs in the canonical decomposition of final into mscs's. A central point in the proof of correctness of Algorithm feasible established that any terminal mscs within final is a fair subgraph. Line 7 computes the mscs containing s and assigns it to the variable final , while line 8 restricts the transition relation to edges connecting states within final . Line 9 draws a (shortest) path from an initial state to the subgraph final . Lines 10 - 17 construct in period a traversing path, starting at last (prefix ) and returning to the 13 Algorithm witness (D) : [list; list] -- Extract a witness for a feasible fds. final : predicate R : relation prefix ; period : list s : state 1. final := feasible (D) 2. if (final = ;) then return (\Lambda ; \Lambda ) 3. R := kaeD k " (final \Theta final ) 4. s := choose(f inal) 5. while (fsg ffi R\Lambda \Gamma R\Lambda ffi fsg 6= ;) do 6. s := choose(fsg ffi R\Lambda \Gamma R\Lambda ffi fsg) 7. final := fsg ffi R\Lambda 8. R := R " (final \Theta final ) 9. prefix := path(k\Theta D k; final ; kaeD k) 10. period := (choose(flast (prefix )g ffi R)) 11. for each J 2 J do 12. if (list-to-set (period ) " kJ k = ;) then 13. period := period \Lambda path (flast (period )g; final " kJ k; R) 14. for each (p; q) 2 C do 15. if (list-to-set (period ) " kqk = ; ^ final " kpk 6= ;) then 16. period := period \Lambda path (flast (period )g; final " kqk; R) 17. period := period \Lambda path (flast (period )g; flast (prefix )g; R) 18. return (prefix ; period ) Figure 3: Algorithm witness. same state, while visiting on the way states that ensure that an infinite repetition of the period will fulfill all the fairness requirements. Lines 11-13 ensure that period contains a J -state, for each J 2 J . To prevent unnecessary visits to state, we extend the path to visit the next J-state only if the part of period that has already been constructed did not visit any J -state. Lines 14-16 similarly take care of compassion. Here we extend the path to visit a q-state only if the constructed path did not already do so and the mscs final contains some p-state. Finally, in line 17, we complete the path to form a closed cycle by looping back to last (prefix ). 8 Symbolic Model Checking of ctl* Properties In the following, we show that algorithm feasible can be used to model check an arbitrary ctl* formula over a finite state fds, taking weak and strong fairness constraints into consideration. We define ctl* with both future and past temporal operators. We denote the fragment of ctl* without the past operators as the future fragment of ctl*. An enumerative algorithm for model checking the future fragment of ctl* is presented in [EL87]. In this work, Emerson and Lei show that model checking a ctl* formula over a finite state system, can be performed by recursive calls to an ltl model checker. We take a similar approach, using algorithm feasible to verify an arbitrary ctl* formula over a finite state fds D; taking the 14 full fairness constraints of D into consideration. First we define the model of fair computation structures, which is the semantical model for ctl* formulas. Next, we present the syntax and semantics of ctl* with past operators (see [Eme90] for the future fragment of ctl*). Finally we present the symbolic model checking algorithm. 8.1 Fair Computation Structures Let V be a finite set of variables. A fair computation structure over V is a tuple KV : hS; S0; R; J; Ci; consisting of the following components. ffl S : A (possibly infinite) set of all states over V . ffl S0 ` S : A subset of initial states. ffl R ` S \Theta S : A transition relation, relating a state s 2 S to its K-successor s0 2 S. ffl J = (K1; : : : ; Kk) : A set of justice sets, where Ki ` S for every i 2 [1::k]. ffl C = (hr1; t1i; : : : ; hrm; tmi) : A set of compassion sets, where ri; ti ` S for every i 2 [1::m]. The set of justice and compassion sets is denoted the fairness set. Let ss : s0; s1; : : : be an infinite sequence of states, and S be a set of states. We say that j is an S-position in ss if ssj 2 S, where ssj is the state at position j of ss. Let K be a fair computation structure. The sequence ss = s0; s1; : : : is said to be a path in K1 if it satisfies the following requirements: ffl Initiality: s0 2 S0. ffl Consecution: (si; si+1) 2 R; for every i * 0: ffl Justice: For every K 2 J; ss contains infinitely many K-positions, ffl Compassion: For every hr; ti 2 C, if ss contains infinitely many r-positions, it must contain infinitely many t-positions. 8.2 The Logic ctl* There are two types of formulas in ctl*: State formulas which are interpreted over states and path formulas which are interpreted over paths. Let P be a finite set of propositions. The syntax of a ctl* formula is defined inductively as follows. State formulas: ffl Every proposition p 2 P is a state formula. ffl If p is a path formula, then Ef p and Af p are state formulas. We refer to Ef and Af as path quantifiers. ffl If p and q are state formulas then so are :p and p . q. Path formulas: ffl Every state formula is a path formula. ffl If p and q are path formulas then so are :p, p . q, 2 p; p U q; ' p and p S q. ctl* is the set of state formulas generated by the above rules. 1A path in a fair computation structure is defined as a fair path. A ctl* path formula is interpreted over a path in the structure, which is assumed to be a fair path. A similar approach is presented in [CGP99]. 15 The semantics of a ctl\Lambda formula p is defined with respect to a fair computation structure K over the vocabulary of p. The semantics is defined inductively as follows. State formulas are interpreted over states in K. We define the notion of a ctl* formula p holding at a state s in K, denoted (K; s) j= p, as follows: ffl For an assertion p, (K; s) j= p () s j= p ffl (K; s) j= :p () (K; s) 6j= p ffl (K; s) j= p . q () (K; s) j= p or (K; s) j= q ffl (K; s) j= Ef p () (K; ss; j) j= p for some path ss 2 K and position j satisfying ssj = s. Path formulas are interpreted over a path in K . We define the notion of a ctl* formula p holding at position j * 0 of a path ss in K, denoted (K; ss; j) j= p, as follows: ffl For an assertion p, (K; ss; j) j= p () (K; s) j= p; for s = ssj ffl (K; ss; j) j= :p () (K; ss; j) 6j= p ffl (K; ss; j) j= p . q () (K; ss; j) j= p or (K; ss; j) j= q ffl (K; ss; j) j= 2 p () (K; ss; j + 1) j= p ffl (K; ss; j) j= p U q () (K; ss; k) j= q for some k * j and (K; ss; i) j= p for every i; j ^ i ! k ffl (K; ss; j) j= ' p () (K; ss; j \Gamma 1) j= p ffl (K; ss; j) j= p S q () (K; ss; k) j= q for some k ^ j and (K; ss; i) j= p for every i; j * i ? k In the case that (K; s0) j= p, we say that the state formula p holds on K, and denote it by K j= p. The notion of temporal validity (satisfiabilityty) of a ctl* formula is similar to that of an ltl formula. The notion of D-satisfiability (validity) is also similar, as follows. Let D : hV; \Theta ; ae; J ; Ci be an fds. Then D generates a fair computation structure KV : hS; S0; R; J; Ci as follows: ffl The states of K are all the V -states of D. ffl s 2 S0 iff s j= \Theta . ffl (si; si+1) 2 R iff ae(Vi; Vi+1) = t. ffl s 2 Ki iff s j= Ji. ffl s 2 ri (ti) iff s j= pi (s j= qi). A ctl* formula p is D-valid if it holds over all initial states of D. 8.3 Model Checking ctl* Let D be a finite state fds and Ef ' be a ctl* formula with no embedded path quantifiers. Figure 4 presents algorithm sat-ef which uses algorithm feasible to evaluate the set of D-accessible states satisfying the formula. Note that, since ' is a ctl* formula with no embedded path quantifiers, it is also an ltl formula, for which a tester can be constructed. The following claim asserts that the set SD;E' evaluated by algorithm sat-ef is exactly the set of D-accessible states satisfying the ctl*formula Ef '. Claim 9 (D; s) j= Ef ' () s 2 SD;E' 16 Algorithm sat-ef (D; ') : predicate -- Set of D-accessible states satisfying Ef ' 1. Construct the temporal tester T' for ': 2. Construct the synchronous parallel composition DkjT'. 3. Compute = O/(') ^ feasible(DkjT') 4. Project away the auxiliary variables of T', returning SD;E' : 9X' : . Figure 4: Algorithm sat-ef Similarly, let D be an fds and Af ' be a ctl* formula with no embedded path quantifiers. To evaluate the set of D-accessible states satisfying the formula, we use the ctl* congruence Af ' ss :Ef :': Using ealgorithm sat-ef we first evaluate Ef :'; then negate the resulting assertion. Finally, to model check an arbitrary ctl* formula p, namely, a ctl* formula with embedded path quantifiers, consider the formula from right to left, evaluating a single path quantifier at a time. The result of each step is an assertion (SD;E') used to evaluate the next (embedding) ctl* formula. Note that at each step, we evaluate a single ctl* formula with no embedded path quantifiers. 9 Experimental Results The algorithms described in this paper have been implemented within the tlv system [PS96]. In the following section, we summarize our experimental results, all related to the main algorithm, namely algorithm feasible. Some of these experiments are only relevant for ltl model checking. The rest are relevant for both ltl and ctl* model checking. The experiments were carried on a Sun Ultra with 1 Gigabyte of memory. The programs used for experimentation are parametric programs. In the following tables summarizing our results, timing results are given in seconds and the columns titled N indicate the number of processes for which the programs have been tested. 9.1 Compassion at the Algorithmic Level To test the advantage of dealing with compassion at the algorithmic level, we consider the program dine presented in Fig. 5. This program is a simple solution to the dining philosophers problem, using semaphores for coordination between processes. Program dine satisfies the safety requirement of mutual exclusion (no neighboring philosophers can dine at the same time), however, this naive algorithm fails to satisfy the liveness requirement of accessibility for the first process: 1 : 0 (at `2 ! 1 at `4); which states that when the first philosopher wishes to dine it will eventually do so. To ensure accessibility, we add two compassion requirements for each of the processes, associated with locations `2 and `3 . 17 in n : integer where n * 2 local c : array [1::n] where c = 1 n j=1 P [j] :: 26666 6666664 `0 : loop forever do2666 66664 `1 : noncritical `2 : request c[j] `3 : request c[j \Phi n 1] `4 : critical `5 : release c[j] `6 : release c[j \Phi n 1] 37777 7775 37777 7777775 Figure 5: Program dine: The Dining Philosophers. We checked the property of accessibility over program dine, using algorithm feasible in which compassion is dealt with at the algorithmic level. The verification attempt failed because program dine does not satisfy the property of accessibility. We then compared the results of these runs with two other methods used with verification algorithms that do not permit compassion at the algorithmic level. The first, transforms the compassion requirements into an ltl formula which is added as antecedent to the verified property. Let ' be the property we wish to verify. Let C be the set of compassion requirements. The new property to be verified is:0B @ ^ hp; qi2C (0 1 p ! 0 1 q)1CA ! ' This case is considered in subsection 9.1.1. The second method transforms compassion requirements into justice, and is discussed in subsection 9.1.2. 9.1.1 Compassion as Antecedent to the Verified Property Each process of program dine contributes two compassion requirements, due to program locations `2 and `3. Table 1 summarizes the results of verifying accessibility for program dine with 3 and 4 processes. The column headed dine represents the case in which all compassion requirements are dealt with at the algorithmic level. Column dine\Gamma 1 (dine\Gamma 2) represents the cases that one (two) of the compassion requirements for each of the proceeses is transformed into an ltl formula, added as an antecedent to the verified property. The advantage of dealing with compassion at the algorithmic level is clear. N dine dine\Gamma 1 dine\Gamma 2 3 0.18 0.45 1.73 4 0.66 4.02 51.08 Table 1: Compassion as Antecedent to the Verified Property 18 9.1.2 Transforming Compassion into Justice Every compassion requirement can be transformed into a justice requirement, at the price of introducing an extra boolean variable. Let D : hV; \Theta ; ae; J ; Ci be an fds. For every hpi; qii 2 C we introduce a new variable ri and modify D as follows:e V : V [ frige \Theta : \Theta ^ (ri = f)e ae : ae ^ (r ! (:p ^ r0))e J : J [ f(r . q)ge C : C \Gamma f(pi; qi)g Table 2 compares the result of verifying the accessibility property for program dine with various number of processes. Column dine represents the results of algorithm feasible, with all compassion requirements dealt with at the algorithmic level. Column dine-1 (dine-2) presents the result with one (two) of the compassion requirements of each process transformed into justice requirement. Again, handling the compassion requirements explicitly is preferable according to this test. N dine dine\Gamma 1 dine\Gamma 2 3 0.18 0.24 0.34 4 0.65 1.18 1.82 5 3.24 6.02 12.02 6 17.14 39.69 120.95 Table 2: Compassion Transformed into Justice 9.2 Forward, Backward and Bi-directional Algorithm feasible finds closures under predecessors. We call this direction of searching backward . It is possible to modify algorithm feasible to find closures under successors (forward) or both successors and predecessors (bi-directional). As discussed in section 6, algorithm feasible with forward closure, can only be used for ltl model-checking. The following is a comparison of these three variants of algorithm feasible. In figure 6 we present program term-det, which detects termination in a distributed system [DFvG83]. Each process in program term-det consists of two submodules. Module M is the main part of the process. Statement Active is a schematic statement representing the normal activity of the process. At any point, module M may decide to become inactive by moving to location `2. On becoming inactive process P [j] sets variable A[j] to 0, signaling that it enters an inactive phase. An inactive process may be reactivated. Statement `3 allows the process to become non-deterministically active, provided there is still some active process in the system. Module C is responsible for the termination detection mechanism. The n processes are arranged in a ring spanned by the array of channels ch[1]; : : : ; ch[n]. Process P [1] initiates the detection process by sending its right neighbor a token 1 on channel ch[2] as soon as P [1] becomes inactive. Each process receiving the token sends it to its right neighbor when the process becomes inactive. The token of 1 eventually should come back to process P [1]. When this token arrives, process P [1] sends a token of 2 (computed at m6) to P [2] and this new token starts another circle around the 19 in n : integer where n * 2 local ch : array[1::n] of channel[1] of [0::2] local A : array[1::n] of boolean where A = 1 n j=1 P [j] :: 26666 6666666 6666666 6666666 6666666 6666666 6666666 66664 changed : boolean where changed = 0 M :: 26666 6664 `0 : loop forever do2666 64 `1 : Active `2 : A[j] := 0 `3 : when n. i=1 A[i] do (A[j]; changed ) := (1; 1) 37777 5 37777 7775 C :: 26666 6666666 6666666 6666666 64 first : boolean where first = (j = 1) token : [0::2] where token = 0 m0 : loop forever do2666 6666666 6666666 4 m1 : if first then m2 : first := 0 else m3 : ch[j] ) token m4 : if j = 1 ^ token = 2 then m5 : Terminate m6 : if j = 1 then m7 : token := token + 1 m8 : await :A[j] m9 : * ch[j \Phi n 1] ( max(token \Gamma changed ; 1)changed := 0 + 37777 7777777 7777775 37777 7777777 7777777 7777777 75 37777 7777777 7777777 7777777 7777777 7777777 7777777 77775 Figure 6: Program term-det: Termination Detection in a Distributed Dystem. ring. Each process maintains a local boolean variable changed which is initially 0. This variable is set to 1 whenever a process changes its status from inactive to active, and is cleared to 0 when a process sends its token to a right neighbor. Thus at any point, changed = 1 implies that the process was reactivated since the last time it sent the token. If a process receives a token of value 2, yet it was reactivated since the last time it sent the token, it sends a token of 1 instead. When P [1] receives back a token of 2, it decides that all the processes are inactive and the system has terminated. This is signified by process P [1] moving to location m5. We verify the liveness property stating that when all processes are inactive ( i.e. at location `3 ) the first process moving to m5, detecting termination: 2 : 0 (( n^ j=1 :A[j]) ! 1 (at m5[1])) Table 3 presents the results of comparing forward, backward and bi-directional closure in al20 gorithm feasible, verifying the property 2 over program term-det. In Table 4 we present the results of a similar comparison for the accessibility property 1 over program dine. In these tests forward and bi-directional directions have the best performance. N Forward Backward Bi-directional 2 0.58 0.36 0.35 3 2.22 2.08 1.42 4 9.90 11.02 6.06 5 49.63 51.76 31.78 Table 3: Termination Detection for Program term-det N Forward Backward Bi-directional 4 0.66 2.70 1.00 5 3.19 14.89 5.16 6 17.27 95.56 28.13 Table 4: Accessibility for Program dine 9.3 Removing States with no Successors In lines 6-7 of algorithm feasible, all states with no successors in the set of states new , are removed at each external iteration. However, this may be too exhaustive. If the external loop is executed many times and the strands of such states are short, these states will be removed even if we just remove the first state of such strands at each iteration. To test this we checked a version of algorithm feasible, where lines 6-7 are replaced by a single execution of the body of the loop. Tables 5 and 6 compare this new version of algorithm feasible to the original one, for both programs dine and term-det. In both examples, the original algorithm has a better performance. N Exhaustive One step 3 2.32 2.14 4 10.20 11.26 5 51.01 53.67 Table 5: Program term-det N Exhaustive One step 4 0.65 2.64 5 3.20 14.79 6 17.15 95.32 Table 6: Program dine 21 9.4 Reducing the Number of Justice Conditions When we define the fds associated with a given program, we introduce a justice requirement for each of the program locations, to ensure that the process does not remain in that location indefinitely. However, this creates many justice conditions which may slow the algorithm down. In the following, we verified the effect of reducing the number of justice requirements, on the performance of algorithm feasible. We use the following simple cycle program. Each process cycles through m program locations. All of the program locations except the first, have an associated justice condition. For each process i, program cycle has program location `1; : : : ; `m. The original system contains, for each process i and for each 2 ^ j ^ m , a justice condition of the form :at `j. Therefore, a program of m program locations and p processes has p\Lambda (m\Gamma 1) justice conditions. In the modified system each process i has a single justice condition: at `1. We verified the following accessibility property, for the first process: 3 : 0 (at `2 ! 1 at `m) Tables 7 and 8 compare executions of programs with 6 and 10 program locations. These tables show a slight improvement when less justice conditions are generated. However, program cycle was tailored to simplify the reduction of justice conditions. In other programs we have checked, such as dine the price of reducing the number of justice conditions was either adding a single, complex justice requirement, or adding variables to the verified system. In these cases, the result of reducing the number of justice requirements were slowing down the feasibility algorithm. Table 7: Six Program Locations N 5 Justice cond. 1 Justice Cond. 10 0.57 0.26 14 4.74 4.44 18 12.57 11.62 22 26.90 26.24 26 49.90 49.58 30 89.49 87.60 Table 8: Ten Program Locations N 9 Justice Cond. 1 Justice Cond. 6 0.81 0.23 8 4.26 3.26 10 10.44 9.11 12 21.05 18.79 14 38.66 35.74 16 64.68 60.94 We thus conclude that reducing the number of justice conditions is usually not recommended. References [BCM+92] J.R. Burch, E.M. Clarke, K.L. McMillan, D.L. Dill, and J. Hwang. Symbolic model checking: 1020 states and beyond. Information and Computation, 98(2):142-170, 1992. [CE81] E.M. Clarke and E.A. Emerson. Design and synthesis of synchronization skeletons using branching time temporal logic. In Proc. IBM Workshop on Logics of Programs, pages 52-71. Lec. Notes in Comp. Sci. 131, Springer-Verlag, 1981. 22 [CGH97] E.M. Clarke, O. Grumberg, and K. Hamaguchi. Another look at ltl model checking. Formal Methods in System Design, 10(1), 1997. [CGP99] E. M. Clarke, O. Grumberg, and D. A. Peled. Model Checking. MIT Press, 1999. [DFvG83] E.W. Dijkstra, W.H. Feijen, and A.J.M van Gasteren. Derivation of a terminatio detection algorithm for disrtibued computations. Info. Proc. Lett., 16:217-219, 1983. [EL85] E.A. Emerson and C.L. Lei. Modalities for model checking: Branching time strikes back. In Proc. 12th ACM Symp. Princ. of Prog. Lang., pages 84-96, 1985. [EL86] E. A. Emerson and C. L. Lei. Efficient model-checking in fragments of the propositional modal _-calculus. In Proc. First IEEE Symp. Logic in Comp. Sci., pages 267-278, 1986. [EL87] E. A. Emerson and C. Lei. Modalities for model checking: Branching time logic strikes back. Science of Computer Programming, 8:275-306, 1987. [Eme90] E.A. Emerson. Temporal and modal logics. In J. van Leeuwen, editor, Handbook of theoretical computer science, volume B, pages 995-1072. Elsevier, 1990. [Fra86] N. Francez. Fairness. Springer-Verlag, 1986. [GPSS80] D. Gabbay, A. Pnueli, S. Shelah, and J. Stavi. On the temporal analysis of fairness. In Proc. 7th ACM Symp. Princ. of Prog. Lang., pages 163-173, 1980. [HKSV97] R. H. Hardin, R. P. Kurshan, S. K. Shukla, and M. Y. Vardi. A new heuristic for bad cycle detection using BDDs. In O. Grumberg, editor, Proc. 9th Intl. Conference on Computer Aided Verification (CAV'97), Lect. Notes in Comp. Sci., pages 268 - 278. Springer-Verlag, 1997. [HT96] M. R. Henzinger and J. A. Telle. Faster algorithms for the nonemptiness of street automata and for communication protocol prunning. In Proceedings of the 5th Scandinavian Workshop on Algorithm Theory, pages 10-20, 1996. [KP98] Y. Kesten and A. Pnueli. Algorithmic verification of linear temporal logic specifications. In ??, editor, Proc. 25th Int. Colloq. Aut. Lang. Prog., Lect. Notes in Comp. Sci. Springer-Verlag, 1998. [KP00] Y. Kesten and A. Pnueli. Verification by augmented finitary abstraction. Information and Computation, a special issue on Compositionality, 163:203-243, 2000. [KPR98] Y. Kesten, A. Pnueli, and L. Raviv. Algorithmic verification of linear temporal logic specifications. In K.G. Larsen, S. Skyum, and G. Winskel, editors, Proc. 25th Int. Colloq. Aut. Lang. Prog., volume 1443 of Lect. Notes in Comp. Sci., pages 1-16. SpringerVerlag, 1998. [Lic91] O. Lichtenstein. Decidability, Completeness, and Extensions of Linear Time Temporal Logic. PhD thesis, The Weizmann Institute if Science, Israel, 1991. [LP84] O. Lichtenstein and A. Pnueli. Checking that finite state concurrent programs satisfy their linear specification. In Proc. 11th ACM Symp. Princ. of Prog. Lang., pages 97-107, 1984. 23 [LPS81] D. Lehmann, A. Pnueli, and J. Stavi. Impartiality, justice and fairness: The ethics of concurrent termination. In Proc. 8th Int. Colloq. Aut. Lang. Prog., pages 264-277. Lec. Notes in Comp. Sci. 115, Springer-Verlag, 1981. [LPZ85] O. Lichtenstein, A. Pnueli, and L. Zuck. The glory of the past. In Proc. Conf. Logics of Programs, volume 193 of Lect. Notes in Comp. Sci., pages 196-218. Springer-Verlag, 1985. [MP91a] Z. Manna and A. Pnueli. Completing the temporal picture. Theor. Comp. Sci., 83(1):97- 130, 1991. [MP91b] Z. Manna and A. Pnueli. The Temporal Logic of Reactive and Concurrent Systems: Specification. Springer Verlag, New York, 1991. [MP95] Z. Manna and A. Pnueli. Temporal Verification of Reactive Systems: Safety. SpringerVerlag, New York, 1995. [PS96] A. Pnueli and E. Shahar. A platform for combining deductive with algorithmic verification. In R. Alur and T. Henzinger, editors, Proc. 8th Intl. Conference on Computer Aided Verification (CAV'96), Lect. Notes in Comp. Sci., pages 184-195. Springer-Verlag, 1996. [QS82] J.P. Queille and J. Sifakis. Specification and verification of concurrent systems in cesar. In M. Dezani-Ciancaglini and M. Montanari, editors, International Symposium on Programming, volume 137 of Lect. Notes in Comp. Sci., pages 337-351. Springer-Verlag, 1982. [SdRG89] F.A. Stomp, W.-P. de Roever, and R.T. Gerth. The _-calculus as an assertion language for fairness arguments. Inf. and Comp., 82:278-322, 1989. [VW86] M.Y. Vardi and P. Wolper. An automata-theoretic approach to automatic program verification. In Proc. First IEEE Symp. Logic in Comp. Sci., pages 332-344, 1986. 24