Sunteți pe pagina 1din 35

Lin69] P. Lindstrom. On extensions of elementary logic. Theoria, 35:1{11, 1969. LL76] R.E. Ladner and N. Lynch.

Relativization of questions about log{space reducibility. Mathematical Systems Theory, 10:19{32, 1976. Lyn78] N. Lynch. Log space machines with multiple oracle tapes. Theoretical Computer Science, 6:25{39, 1978. MP93] J.A. Makowsky and Y.B. Pnueli. Computable quanti ers and logics over nite structures. To appear in `Quanti ers: Generalizations, extensions and and variants of elementary logic', Kluwer Academic Publishers, preliminary version TR 768, Department of Computer Science, Technion{Israel Institute of Technology, Haifa, Israel, 1993. Orp83] P. Orponen. General nonrelativizability results for parallel models of computation. In Proceedings, Winter School in Theoretical Computer Science, Lammi, Finland, pages 194{205, 1983. Rab65] M.A. Rabin. A simple method for undecidability proofs and some applications. In Y. Bar Hillel, editor, Logic, Methodology and Philosophy of Science II, Studies in Logic, pages 58{68. North Holland, 1965. RST84] W.L. Ruzzo, J. Simon, and M. Tompa. Space bounded hierarchies and probabilistic computations. Journal of Computer and System Sciences, 28:216{230, 1984. Sim77] I. Simon. On some subrecursive reducibilities. PhD thesis, Department of Computer Science, Stanford University, 1977. Ste91] I.A. Stewart. Comparing the expressibility of languages formed using NP{ complete operators. Journal of Logic and Computation, 1(3):305{330, 1991. Ste92] I.A. Stewart. Using the hamiltonian path operator to capture NP. Journal of Computer and System Sciences, 45(1):127{151, 1992. Ste93a] I.A. Stewart. Logical characterizations of bounded query classes I: Logspace oracle machines. Fundamenta Informaticae, 18:65{92, 1993. Ste93b] I.A. Stewart. Logical characterizations of bounded query classes II: Polynomial{time oracle machines. Fundamenta Informaticae, 18:93{105, 1993. Ste94] I.A. Stewart. Context{sensitive transitive closure operators. Annals of Pure and Applied Logic, 66.3:277{301, 1994. Sto87] L. Stockmeyer. Classifying the computational complexity of problems. Journal of Symbolic Logic, 52(1):1{43, 1987. Var82] M. Vardi. The complexity of relational query languages. In STOC'82, pages 137{146. ACM, 1982. Wag90] W. Wagner. Bounded query classes. SIAM Journal of Computing, 19:833{ 846, 1990. Wil86] C.B. Wilson. Parallel computation and the NC hierarchy relativized. In Structure in Complexity Theory, volume 223 of Lecture Notes in Computer Science, pages 362{382. Springer Verlag, 1986.

a This article was processed using the L TEX macro package with LLNCS style

35

Dah82] E. Dahlhaus. Combinatorial and Logical Properties of Reductions to some Complete Problems in NP and NL. PhD thesis, Technische Universitat Berlin, Germany, 1982. Dah83] E. Dahlhaus. Reductions to NP{complete problems by interpretations. In E. Borger et. al., editor, Logic and Machines: Decision Problems and Complexity, volume 171, pages 357{365. Springer Verlag, 1983. Daw94] A. Dawar. Generalized quanti ers and logical reducibilities. Logic and Computation, XX:xx{yy, 1994, to appear. Ebb85] H.D. Ebbinghaus. Extended logics: The general framework. In ModelTheoretic Logics, Perspectives in Mathematical Logic, chapter 2. Springer Verlag, 1985. EFT80] H.D. Ebbinghaus, J. Flum, and W. Thomas. Mathematical Logic. Undergraduate Texts in Mathematics. Springer-Verlag, 1980. ET76] S. Even and R.E. Tarjan. A combinatorial problem which is complete in polynomial space. Journal of ACM, 23(4):710{719, 1976. Fag74] R. Fagin. Generalized rst-order spectra and polynomial time recognizable sets. In R. Karp, editor, Complexity of Computation, volume 7 of American Mathematical Society Proc, pages 27{41. Society for Industrial and Applied Mathematics, 1974. GJ79] M.G. Garey and D.S. Johnson. Computers and Intractability. Mathematical Series. W.H. Freeman and Company, 1979. Gro94] M. Grohe. Linstrom{quanti ers that capture xed{point logics. Preprint, 1994. Gur88] Y. Gurevich. Logic and the challenge of computer science. In E. Borger, editor, Trends in Theoretical Computer Science, Principles of Computer Science Series, chapter 1. Computer Science Press, 1988. Hel89] L. Hella. De nability hierarchies of generalized quanti ers. Annals of Pure and Applied Logic, 43(3):235{271, 1989. Hel92] Lauri Hella. Logical hierarchies in PTIME. In LiCS'92, pages 360{368. IEEE, 1992. HU80] J. E. Hopcroft and J. D. Ullman. Introduction to Automata Theory, Languages and Computation. Addison-Wesley Series in Computer Science. Addison-Wesley, 1980. IL94] N. Immerman and S. Landau. The complexity of iterated multiplication. Information and Computation, XX:xx{yy, 1994, to appear. Imm82] N. Immerman. Relational queries computable in polynomial time. In STOC'82, pages 147{152. ACM, 1982. Imm87] N. Immerman. Languages that capture complexity classes. SIAM Journal on Computing, 16(4):760{778, Aug 1987. Imm88] N. Immerman. Nondeterministic space is closed under complement. SIAM Journal on Computing, 17:935{938, 1988. Imm89] N. Immerman. Expressibility and parallel complexity. SIAM Journal on Computing, 18:625{638, 1989. Joh90] D.S. Johnson. A catalog of complexity classes. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume 1, chapter 2. Elsevier Science Publishers, 1990. JT94] B. Jenner and Jacobo Toran. Computing functions with parallel queries to NP. In Structure in Complexity Theory, pages 280{291. IEEE, 1994. Lin66] P. Lindstrom. First order predicate logic with generalized quanti ers. Theoria, 32:186{195, 1966.

34

All general logic simulations (logics capturing complexity classes) which hold in the absence of an oracle, can be extended to hold for every oracle in a properly relativized model via Lindstrom quanti ers. We have shown evidence for this for L NL and P, cf. proposition 38. We think the same to be true for every `reasonable' complexity class below and including PSpace. L NL and P are de ned via Turing machines whose accessibility relation is well understood. In fact, it is given by deterministic, non{deterministic and alternating transitive closure respectively. These machines also satisfy Buss' relativization thesis. Recently, Stewart has de ned context sensitive transitive closure operators which capture various complexity classes above P, Ste94]. Also our HEX{ operator can be viewed as a generalization of connectivity, hence of transitive closure. The problem in proving that for every regular complexity class containing L, there exists an ordered Gurevich Logic capturing it, consists of two technicalities: First, it is not clear how to de ne oracle computations for arbitrary regular complexity classes without recourse to a speci c machine model. This is why we considered only full regular classes. Second, even for speci c machine models, one would need, that the accessibility relation between states for legal computations could be used to de ne a Lindstrom quanti er. We can see ways of overcoming these problems, by de ning abstractly the regular complexity classes, for which the technicalities are resolved. But such a solution seems arti cial, unless we can show that every regular complexity classes can be represented in such a way. Thus, it remains an open problem how to prove theorems 9 and 10 for arbitrary regular complexity class between L and PSpace.

References
AM77] L. Adelman and K. Manders. Reducibility, randomness and intractability. In STOCS'77, pages 151{163. ACM, 1977. BF85] J. Barwise and S. Feferman, editors. Model-Theoretic Logics. Perspectives in Mathematical Logic. Springer Verlag, 1985. Bus88] J.F. Buss. Alternations and space{bounded computations. Journal of Computer and System Sciences, 36:351{378, 1988. CH80] Ashok K. Chandra and David Harel. Computable queries for relational data bases. Journal of Computer and System Sciences, 21(2):156{178, Oct 1980. CH82] Ashok K. Chandra and David Harel. Structure and complexity of relational queries. Journal of Computer and System Sciences, 25(1):99{128, Aug 1982. CK90] C.C. Chang and H.J. Keisler. Model Theory. Studies in Logic, vol 73. North{ Holland, 3rd edition, 1990. CKS81] Ashok K. Chandra, Dexter C. Kozen, and Larry J. Stockmeyer. Alternation. Journal of ACM, 28:114{133, 1981. Cou92] B. Courcelle. Monadic second order de nable graph transductions. In CAAP'92, volume 581 of Lecture Notes in Computer Science, pages 124{144. Springer, 1992.

33

NON ORACLE NEXTu(i+1) are correct. Proof: REACHABLE follows from the de nition of an alternating machine (x being the last state when the oracle tape did not contain any i ; 1'st or lower depth query). For NON ORACLE NEXTu(i+1) set x as above and a simple case analysis as in claim 49 proves. 2 Corollary 51. By induction for all j NEXTu(j) , REACHABLEu(j ) and NON ORACLE NEXTu(j ) predicates are correct. Claim 52. The set recognizable by M is de nable as 9y0 y1initial(y 0 ) ^ accepting(y1 ) ^ REACHABLEu(i)(y0 y1 ) Parts (i) and (ii) of theorem 10 for the case D = L (NL) are proven by replacing ATC in the above with DTC (T C). The case of D = P follows from corollary 33 for ALu(1)K (i) = Pu(1)K (i). THEOREM 10(iii) - The case of multiple oracles Proof: For each class D as above, the proof proceeds as for the case of one oracle, except that for each oracle used, say Ki , we de ne its own oraclei ponexti and nonexti predicates and also its own set of i formulas. Also, the NEXT predicate is increased by k for each of the oracles used. The de nition of NEXT is then set up so that NEXT(a1 a2 :::an t0 b1 b2:::bn t1) holds either if each ai equals the corresponding bi and the transition can be taken without any oracle consultations, or else each ai equals the corresponding bi , except for some aj 6= bj in which case bj = t1 and the transition is taken according to the answer of the j'th oracle to a query written since state aj , at which time the tape of the j'th oracle was empty. 2 Part (i), (ii) and (iii) of theorem 10 for D = Lu(1)(X ) NLu(1)(X ) Pu(1)(X ), where X is some nite set of oracles, follow through similar arguments.

Claim 50. Assuming that NEXTu i is correct, then REACHABLEu i and


( ) ( )

8 Conclusions
We have presented an abstract framework for logics capturing complexity classes by exhibiting the exact closure properties a relational complexity class should have so that it can be captured by a Lindstrom Logic and we have established its coherence and demonstrated its power in applications. Furthermore, we have used this framework to examine oracle computations models for full complexity classes. We have shown that, in Buss' unbounded model of oracle computation restricted to oracle stacks of constant size, there is a close relationship between Lindstrom quanti ers and oracle complexity classes. This supports our `logical simulation thesis': 32

NEXTu(i) , NON ORACLE NEXTu(i) and REACHABLEu(i) are the predicates as follows: NON ORACLE NEXTu(1) (s0 t0 t1 ) next(t0 t1) NEXTu(i) (s0 t0 s1 t1 ) (s0 = s1 ^ NON ORACLE NEXTu(i) (s0 t0 t1 ) _ s0 id (t0 ) ^ s1 = t1 ^ oracle(t0) ^ ( QK ( s0 ) ^ ponext(t0 t1 ) _ :QK ( s0 ) ^ nonext(t0 t1) ) ] y y REACHABLEu(i) (y0 y1) 9xATCs00 ty0sx t11 NEXTu(i) (s0 t0 s1 t1 ) 0 1 NON ORACLE NEXTu(i) (s0 t0 t1) 9xREACHABLEu(i;1)(s0 x) ^ (NEXTu(i;1)(x t0 x t1 ) _ NEXTu(i;1) (x t0 t1 t1)) One should think of NON ORACLE NEXTu(i) as saying that if M is invoked with an empty oracle tape in state s0 , then it can eventually reach state t0 and move from it in a single transition to state t1 with all transitions being either non oracle consulting or oracle consulting of depth less than i. NEXTu(i) says the same except that the last transition from t0 to t1 can be an i depth oracle consultation (and then s1 = t1 instead of s0 ). REACHABLEu(i) says that if M is invoked with an empty oracle tape in state t0, it can reach state t1 without making oracle consultations of depth more than i. Claim 49. Assuming that NON ORACLE NEXTu(i) is correct, then NEXTu(i) is correct. Proof: I. \can move" implies NEXT: Let M run until it reaches t0 and passes in one step to t1. Denote by s0 the last state in which the oracle tape was empty (it is either the invoked state or the last oracle consultation state for a (i{depth) query). If the transition from t0 to t1 was made without an (i{depth) oracle consultation, set s1 = s0, and since non oracle next(t0 t1 ), NEXT holds. Else set s1 = t1 . As t0 is reachable from s0 without (i{depth) s0 oracle consultation steps, we have id (t0). Now either the move was made via a positive oracle answer, and then QK ( s0 ) and ponext(t0 t1)), or it was made via a negative answer, and then :QK ( s0 ) and nonext(t0 t1 ). Either way NEXT holds. II.NEXT implies \can move": If non oracle next(t0 t1), invoke M in state t0 , and it can reach t1 in one non (i{depth) oracle consulting step. Else s invoke M in state s0 . As id0 (t0 ), t0 is reachable from s0 without (i{depth) oracle consultations, and when M is in state t0 , the content of the oracle tape is the structure s0 . Now either QK ( s0 ) and then we know the oracle answers positively and by ponext(t0 t1 ) we reach t1 or :QK ( s0 ) and we know the oracle answers negatively and by nonext(t0 t1 ) we reach t1 . 2 31

Proof: Follows from the de nitions and claim 45. 2 De nition48. Let s , t , s , t be computation states, then NEXTu ,
0 0 1 1 (1)

empty oracle tape, it can eventually reach, without any intermediate oracle consultations (without asking queries with stack depth of i), the oracle computation state encoded by the single element in the relation id with B written on its oracle tape. Note that the sets of proper 0{structures and 0{structures are L D{ recognizable and hence L{de nable. Notation 44. Let W be the set of 0{structures for which there is a 0 { structure tting for M and let W be the set of 0 {structures for which there is a 0 {structure tting for M . Claim 45. W /D W and hence from theorem 3: W /L W (W /Du(i)(K ) W and hence from theorem 3 and the induction hypothesis that L(K)i captures Du(i)(K ) , W /L(K)i W , where L(K)i is the sub{logic obtained by restricting the nesting of QK quanti ers to depth i). Proof: The reduction machine M 0 operates as follows: First it checks that the input structure is proper. Then it decodes the computation state encoded in the relation id . Then it simulates M from this computation state, as follows: A the {structure part on the original input tape is used as input for M. The characters which M writes on its oracle tape are written on the output tape of M 0 . When M either terminates or enters an oracle consultation state for a (i{ depth) query, M 0 encodes the "current" computation state of M on the output tape and halts. It is easy to see that if M 2 Du(1)(K ) , then M 0 2 D, (M 2 Du(i)(K ) , then 0 2 Du(i+1)(K ) ), and that an input 0{structure is in W i the output of M M 0 is a 0 {structure in W . 2
0 0 0 0 0 0 0 0 0 0 0 0

Notation 46. The reduction formulas (i) Let 0 = h R1 R2 ::: Rm id i be the set of formulas k{feasible for 0 over 0 such that a given 0 structure A 2 W i A 2 W . (ii) Let be the set of formulas h R1 R2 : : : Rm i of 0. y (iii) Let 0y, y , id be the sets of formulas formed from 0, and id by replacing all appearances of the relation symbol id (x) by the formulas x = y where y is a vector of free variables not appearing in any formula of 0, ,
0 0

Note that 0 2 L (2 L(K)i ) and that is k{feasible for over 0 and 0y 0 ( ) over . Claim 47. If M is invoked in computation state s0 with A as input and with ( y ) is k{feasible for

id .

an empty oracle tape, it can eventually reach the computation state t0 with the {structure B written on its oracle tape without passing any oracle consultations (any i{depth oracles consultation) in between, i by substituting s0 for the y free y variables, the formulas of y de ne B and the formula id de nes a relation containing the single element t0 .

30

When an unbounded model is used, it is no longer possible to encode the oracle tape into vectorizations of the input structure. However for M 2 Du(i)(K ) we note that after an i{depth query is answered, the oracle stack is completely empty. Hence we can regard the process of generating such a query string as a Du(i;1)(K ){reduction. This provided, we encode the initial computation state in the input and the nal computation state in the output of the reduction. Therefore, if we assume that Du(i;1)(K ) {reductions are expressible as formulas of L K] with quanti er depth no more than i ; 1, we can write formulas which, given the last computation state when the oracle tape was empty, represent the contents of the oracle tape at those speci c points when it is a structure. Note, however, that we cannot represent the evolution of the oracle tape content through elements of jAjk even for xed k. By appropriately QK { quantifying these formulas, we get a formula for the answer of the oracle. Hence we can write a formula for the relation NEXTu(i) (s0 t0 s1 t1 ) which is true i M can either move from t0 to t1 in a single step which is either non oracle consulting or else is of query depth less than i, and then s0 = s1, or else it can move from t0 to t1 via an i{depth oracle consultation provided that the content of the tape is the reduction produced when M is started in state s0 . In this case s1 = t1. By applying ATC (DT C, TC) to this relation we obtain the reachability relation and the proof follows. As the basis for the induction we use the fact that for M 2 Du(1)(K ) the oracle string is exactly a D{reduction, and hence is expressible in L. Details of the more di cult steps are given below. 2

Notation General { Let M be a Turing machine which recognizes a set of

is the encoding of an oracle consultation state of the computation of M. (iii) The pair (A0 B0) is called tting for M if both A0 and B0 are proper, and whenever M is simulated from the computation state encoded by the single k{tuple in the relation id , with an input tape containing A, and an 29

{ Let A be a -structure and let A0 be a 0{structure extending it. Let B be a {structure and let B0 be a 0 {structure extending it. (Intuitively one should think of B and B0 as structures with a universe of size jAjk). De nition43. Proper structures for M. (i) A0 is called proper for M if the relation id contains a single k{tuple which is the encoding of a state of the computation of M. (ii) B0 is called proper for M if the relation id contains a single element which

{structures K , and uses an oracle for K (a set of {structures) such that M is of complexity Du(1)(K ) (Du(i)(K ) ). { Let k be a number such that for any input A the number of computation states for M is bounded by jAjk. We denote by y the k{tuple of variables y1 y2 :::yk. { Let 0 be an extension of with a new k-ary relation symbol id and let 0 be an extension of with a new unary relation symbol id .

induction on i.

7.2 Expressibility (Theorem 10) Let D be one of L, NL, P, and C be a relational complexity class such that D C. Let L be a D{expressive regular logic. Let M 2 Du 1 K be a Turing machine which recognizes a set of {structures K , using an oracle for K (a set of {structures). We show a formula in L K ] which de nes K . As M 2 Du 1 K implies an i such that M 2 Du i K . Our proof is by
( )( ) ( )( ) ( )( )

Proof Scheme: We view our proofs as extensions to oracle machines of Immerman's classical proofs that L = F OL DT C] FOL TC] FOL ATC] are as expressive as D = L NL AL respectively, hence we brie y outline his proof: { As M is logarithmically bounded in space, for structure A of size jAj the number of states of the computation for M (these include the state of the machine, the contents of the work tape and the position of the heads) is bounded by jAjk for some xed k. Hence all computation states of M can be encoded as elements of Ak for some xed k. { Using this encoding, simple notions such as is id(id), initial(id), accepting(id) etc. indicating that some k{tuple id encodes a state of the computation, an initial state, an accepting state, etc. can be expressed in FOL DTC] L. { The relation next(id1 id2) indicating that the state encoded by id2 can be reached from the state encoded by id1 in one step can be expressed as a formula in L with two k{tuples of free variables. { By applying the ATC (DTC,TC) predicate transformer on next we obtain the relation reachable(id1 id2) indicating that id2 is reachable from id1 . { The formula expressing the structures recognizable by M is given as
9id id initial(id ) ^ accepting(id ) ^ reachable(id id )
1 2 1 2 1 2

The modi cation we make is in replacing the above next relation with a new relation NEXTx that expresses valid transitions of a machine in Dx(K ) . Given a formula for NEXTx , the proof follows as before. The preliminary step for this aim is easy - we write formulas in F OL DTC] L for oracle(id) - indicating that id is an oracle consultation state, ponext(id1 id2) and nonext(id1 id2) indicating that id2 is reachable from the oracle consultation state id1 if the oracle answered positively (negatively). In a bounded oracle computation model, writing NEXTb is simple as the contents of the oracle tape (which is subject to a LogSpace bound) can be included in the encoding of the computation state. Hence NEXTb is simply no oracle next(id1 id2) _

_ Qk (id restricted to its oracle tape part)) ^ ponext(id id ) _ :Qk (id restricted to its oracle tape part)) ^ nonext(id id )
1 1 2 1 1 2

28

7 Proofs of Theorems 9 and 10

7.1 Model Checking (Theorem 9) For this subsection, let D be a full regular complexity class, and C a relational complexity class such that D C. Let K 2 C be a class of {structures, and let L be a D{computable regular logic. Lemma 40. Let = h : : : m i be formulas feasible for in L K] each having a model checker in Du K (Du i K ). Then the formula QK has a model checker in Du K (Du i K ). Proof outline: The required model checker, M, operates as follows: rst, it
1 ( ) ( )( ) ( ) ( +1)( )

produces A on the oracle tape, as outlined for the reduction Turing machine M in proposition 25. Then it enters an oracle consultation state and accepts or rejects according to the answer of the oracle. As in proposition 25, writing the query is of complexity L plus a polynomial number of model checkings and hence is in Du(K ) (Du(i)(K )). Therefore the complexity of M which includes one additional query to the oracle is also Du(K ). However as it writes the reduction structure on the bottom{most oracle tape in the stack, the exact class is Du(i+1)(K ). Note that we used the fact that for input A the size of the input is jAjk for some xed k > 0 and hence in an unbounded model we can ask queries of size jAjn k for any xed n. 2 De nition41. Let 2 L K] be a {formula which contains a sub-formula of the form = QK such that is not nested inside a QK quanti er. Let 0 = fRg be the vocabulary formed by adding to a relation symbol R of arity i, where i is the number of free variables in . We de ne 0 - the -reduced equivalent of as the 0{formula which is formed by replacing every appearance of the sub-formula in by the relation symbol R (over the free variables of ).
and 0 be as above. If both and 0 have model checkers of complexity Du(K ) (Du(i)(K ) ), then so does .

Lemma 42. Let

input tape, M suspends its simulation of M and starts simulating M the model checker of . Upon the termination of M , M resumes its simulation of M using the acceptance or rejection by M as the required bit. Note that as R is not nested within any QK quanti er, when M is invoked, the oracle stack is empty and hence M uses a stack depth of no more than i. 2 We can now prove parts (i) and (ii) of our Theorem 9, and show that every formula of L K] of quanti er depth i has a model checker in Du(K ) (Du(i)(K )) by a simple induction on the quanti er depth. Both the basis of the induction and the inductive step are direct applications of the two lemmas above. (Lemma 40 for sub-formulas where the quanti er is syntactically outer most and lemma 42 when it is not). Part (iii) of our Theorem 9 follows from proposition 37 stating that for regular complexity classes D C, Du(1)(C) = C.
0 0

Proof outline: Let M , the model checker of , simulate M the model checker of 0 with the modi cation that whenever M consults the relation R on its
0 0

27

Proposition38. The following table collects the general inclusions for arbitrary
oracles or sets of oracles K : Comment: (3) (1) (1) (2)
( )

by an application of QK . However FOL AT C] also has a normal form with AT C appearing once and outermost. The resulting formula in FOL ATC] K] is in the required form. 2 For our next application we rst state

(4)
(1)( )

(4)
( )( )

(3)
( )

and 10. 2 This proposition can be viewed as strong support of Buss' relativization thesis. APPLICATION 5. The following oracle complexity classes coincide for NP oracles:

Proof: (1), (2) and (3) are from proposition 35. (4) follows from Theorems 9

b 1 u LTK LuT K Lu T K LT K j j j j u NLb K NLT K NLu 1 K NLu K Tj Tj Tj j Pb K = Pu K = Pu 1 K = Pu K


( ) (1)( ) ( )( ) ( ( ) (1)( ) ( )( ) ( )

LbTNP Lu NP = Lu 1 NP = Lu NP j k k k b NLT NP NLu NP = NLu 1 NP = NLu NP j k k k Pb NP = Pu NP = Pu 1 NP = Pu NP


( ) (1)( ) ( )( ) ( ) ( ) (1)( ) ( )( ) ( ( ) (1)( ) ( )( ) ( ) (1) ( )

Proof: We use proposition 38 and the following: Stewart showed that FOL HAM] captures Lu NP. From Theorems 9 and 10 we have that FOL ATC HAM] captures Pu 1 NP. Using Theorem 3, we note that FOL HAM], F OL DTC HAM] and F OL AT C HAM] have the same expressive power, since DTC 2 L and ATC 2 P. So we conclude Lu NP = Pu 1 NP.
(1) ( )

2 These results may be interpreted as natural or unnatural, depending on one's views about oracle computations. It shows that in these models, the di erence between Log Space and Polynomial Time Turing machines and between stacks of oracles and single tape oracles is absorbed in the oracle computation for NPcomplete oracles. For similar results with parallel oracle consultation cf. also JT94]. Problem39. Can we prove or refute Lb(NP) = NLb(NP) = Pb(NP) ?
26

reducible to HEX MP93]. 2 This result, rst stated in MP93], was the rst characterization of PSpace on ordered structures in terms of a Gurevich Logic based on a single quantier and its vectorizations. Previous characterizations by Vardi and Immerman, Var82, Imm82], were in terms of second order logics. Note that we do not need that HEX is PSpace{complete for First Order Reductions. In fact, our proof does not give this and hence we do not know if FOL HEX] has a normal form. Very recently, Grohe Gro94] and Stewart Ste94] have given other characterizations for PSpace as Gurevich Logics on ordered structures. P Using a problem which is n complete via P{reductions we can also capture P+1 of the polynomial hierarchy with Lindstrom quanti ers: n P APPLICATION 2. Let Kn be a problem which is suitably coded and n P . complete via P{reductions. Then FOL ATC Kn] captures n+1 Our next applications generalize and extend results of Stewart Ste93a, Ste93b], and use theorems 9 and 10. APPLICATION 3. Let K be a problem. (i) If K is NP{complete via P{reductions, FOL ATC] K] captures Pu(1)(NP) and FOL ATC](K) captures NP (over ordered structures). (ii) If K is NP{complete via L{reductions, FOL DTC] K] captures Lu(1)(NP) and FOL DTC](K) captures NP (over ordered structures). In particular FOL ATC](3COL) and FOL ATC](HAM) capture NP, where 3COL is the class of 3 colourable graphs, and HAM is the class of graphs with a Hamiltonian cycle. Using the fact that 3COL and HAM are NP{complete for rst order reductions ( Ste91, Ste92]), we also get that FOL(3COL) and FOL(HAM) capture NP. Next we state a Normal Form Theorem which generalizes Immerman's Normal Form Imm87] and Stewart's corresponding theorem for HAM ( Ste92, Ste93a, Ste93b]). A similar result was observed in IL94]. APPLICATION 4. Let K be a problem NP{complete via P(L){reductions, then the logic F OL AT C] K] (FOL DTC] K]) has a normal form in which the QK quanti er is never nested within itself and appears outside any AT C (DT C) quanti ers and they, too, are never nested within themselves. Proof: Let be a formula in FOL AT C] K]. The set de ned by is in Pu(1)NP, hence it has a de ning formula in FOL HAM]. As this logic has a normal form, can be such that the HAM quanti er is never nested. Since K is NP{ complete, we can replace each HAM in by a F OL ATC] reduction followed 25

Proof: Observe that FOL ATC] captures P by Imm87], HEX is PSpace{ complete for P{reductions by ET76, GJ79], so by theorem 5, F OL AT C] HEX] captures PSpace. To show that FOL HEX] captures PSpace we use that ATC is rst order

5 Capturing Oracle Classes over L NL and P


under isomorphisms, we have (i) If 2 L K] with quanti er nesting bounded by n, then has a model{ checker in Du(n)(K ). (ii) L K] has a model{checker in Du(K ) and even in Du(1)(K ) . (iii) As Du(1)(K ) Du(1)(C) , if, additionally, C is regular, L K] has a model{ checker in C. Let D be one of L, NL, P, Lu(1)(X ) , NLu(1)(X ) , Pu(1)(X ) , where X is some nite set of oracles and let K K1 : : : Kn be classes of {structures closed under isomorphism. THEOREM 10 (Expressive power). Under the assumption above we have: (i) If a problem K is in Du(n)(K1) , then K is de nable in L K1] by a formula with quanti er nesting bounded by n. (ii) If a problem K is in Db(K1) or Du(1)(K1) , then K is de nable in L K1]. (iii) For any nite m, if a problem K is in Db(K1 K2 ::: Km ) or Du(1)(K1 K2 ::: Km ) (The class of Turing machines of complexity D which use the m oracles K1 : : : Km ), then K is de nable in L K1 K2 : : : Km ] (the extension of L with the appropriate m families of quanti ers). (iv) If, furthermore, K1 is C{complete for L{reductions, then all problems K in Db(C) or Du(1)(C) are de nable in L K1]. COROLLARY 11 (Capturing). Let L, D, C be as in theorem 10 and K 2 C be a set of {structures. Then L K] captures Du(1)(K ). If, furthermore, K is C{complete for D{reductions then L K] captures Du(1)(C). Theorems 9 and 10 imply 11 (which is the speci c formulation of (b) from the introduction) for the cases D one of L, NL, P, Lu(1)(X ) , NLu(1)(X ) , Pu(1)(X ) , with X some nite set of oracles. Let D be a full regular complexity class and let L be a regular logic capturing D. Furthermore, let C be a relational complexity class. THEOREM 9 (Model checking). For K 2 C a class of {structures closed

6 Applications
Theorems 3, 5, 9 and 10 allow us now to construct many logics capturing regular complexity classes stepwise, without having to prove that the problem on which the construction is based, is complete via First Order Reductions. In our rst two application we only use theorem 5. Let D = P and C = PSpace. We can turn the generalized HEX problem, cf. GJ79], into a quanti er and show APPLICATION 1. FOL HEX] captures PSpace over ordered structures. 24

0 the state encoded in its current state tape. Whenever MC in mode j answers 0 in the mode (lower than j) in which (accepts or rejects), control returns to MD it called the query. Execution there continues from the state encoded in the 0 current state tape with the acceptance or rejection of MC in mode j as the oracle answer. It is tedious but simple to show that an arrangement composed of all tapes and modes k such that j k asks and answers correctly all the queries of stack depth higher that j. As the depth of the query stack is bounded by i, we are guaranteed never to run out of modes and tapes and hence the entire arrangement correctly simulates the operation of M while using only O(Space(MD ) + Space(MC ) + Log(input)). 2 Putting this together, we have THEOREM 8. For D and C full and regular we have that for every i

C = Du i C = Du 1 C:
( ) ( )

We leave the further complexity theoretic investigation of these classes aside, but note that the unbounded model with constant stack size satis es the relativization thesis to a large part, as our theorems show together with various theorems about logics capturing complexity classes.

our theorems in general can only hold in an oracle computation model which satis es the relativization thesis above. It would be appealing if the relativization thesis were the only restriction necessary, however it turns out that for our model{checking theorem (Theorem 9) below, we need an additional requirement that the oracle model is of the unbounded type. To see this let = fR1 Rm g, K be a set of {structures and = ha = a R0 : : : Rm i. Our model checking theorem implies that we can verify A j= QK . However, the only way to do this for arbitrary K is to ask the oracle, i.e. to copy the entire structure onto the oracle tape and enter the oracle consultation state. For LogSpace bounded complexity classes this can only be done in an unbounded model. However, as any formula with generalized quanti ers has a bound on the nesting of its quanti ers, the unbounded model with constant stack size su ces. On the other hand, for our expressibility theorem (Theorem 10) below, we either need the bounded model of Buss, or the unbounded model with constant stack size. Hence, while for some speci c cases other models work, the unbounded model with constant stack size is the only variation which can accommodate our goals in general. 23

4.5 Logics Capturing Oracles In our framework if D D are regular complexity classes captured by logics L L and D D via general machine simulations, then L L . (the case of containment not via generalized machine simulations occurs only when D or D is not regular). Since L L implies L K] L K] for any K,
1 2 1 2 1 2 1 2 1 2 1 2 1 2

M be a machine which operates as follows: It simulates MD until MD reaches an oracle consultation state. Then it suspends MD and simulates MC until it accepts or rejects. It then resumes MD using the acceptance or rejection of MC as the oracle answer. The place of the oracle tape stack is replaced by some distinguished work tape which is called the communication tape (note that with appropriate separators we can simulate the stack on a single tape). Clearly the complexity of M in time is at most T ime(MD ) T ime(MC ) and the space used is Space(MD ) + Space(MC ) + Space(communication tape). If either D or C is not space bounded, or if C is su ciently powerful, or if we use a bounded oracle model, we have that M 2 C and the proof is done. Otherwise we modify M, MD , MC so that only space equal to O(Space(MD ) + Space(MC ) + Log(input)) is used. Before we present this modi cation, we note that MD is of bounded stack depth i for some i, and that it can know the depth of the stack at any time during its execution by keeping a LogSpace counter of the push and pop operations (start query and answer query states). Also we note that without loss of generality MD and MC use a single work tape each and that the entire con guration of MD (MC ) which includes the contents of the work{tapes, the position of the heads and the state of the machine, can be encoded in space O(Space(MD )) (O(Space(MC ))). 0 0 M 0 - the modi ed M, is composed of MD , a modi cation of MD , and MC , a 0 can operate in i + 1 modes each of which has its own modi cation of MC . MD 0 current state tape and its own initial state tape. MC can operate in i modes each of which has its own current state tape. Additionally i communication tapes are used. 0 Execution begins in the 0'th mode of MD which starts in the initial con guration of MD and simulates it, except for the following modi cations: Whenever it reaches a start query state of depth j it copies its con guration to the j'th initial state tape. It never writes anything on the oracle tape. When it reaches an answer query state of depth j, it writes its con guration on the 0'th 0 current state tape and passes control to MC in mode j. 0 For any j, MC in mode j operates in the same way as MC except that whenever it wants to read a bit from the communication tape, it writes the position of that bit on the communication tape, then writes its complete con guration 0 on its j'th current state tape, and passes control to MD in mode j. 0 in mode j > 0 starts in the initial con guration encoded on the j'th MD initial state tape and simulates MD as in the 0'th mode: a start query of level k (note that k > j) causes it to write its con guration on the k'th initial state tape and an answer query state of depth k causes it to write its con guration on 0 the j'th current state tape and pass control to MC in mode k. The di erence between the 0'th mode and any other mode is that when MD would write a bit to the level j query tape in the position written on the j'th communication tape, 0 MD in mode j does write that bit on the j'th communication tape and passes 0 0 control back to MC in mode j. MC in mode j then resumes its operation from 22

Proof outline: Let MD 2 Du 1 C be a machine recognizing some set KD and let MC 2 C be a machine recognizing some set KC used as the oracle by MD . Let
( )

Corollary33 (Buss). For all i (i) Pb K = Pu i K = Pu 1 K = Pu K (ii) ALb K = ALu i K = ALu 1 K = ALu K .
( ) ( )( ) ( )( ) ( ) ( ) ( )( ) ( )( ) ( )

Note that while the second observation is not stated explicitly in Bus88], it follows directly from the rst by proposition 30. It is possible to enhance the bounded model by a xed or arbitrary stack of query tapes (keeping the total information on the stack within the space bound), however for this case we have:

Proposition34. Enhancing the bounded model with a stack does not increase
the power of the model.

Proof outline: As in the proof of proposition 32, the machine without a stack

\remembers" the contents of the stack on some auxiliary tape (as the total size of information on the stack is bounded by the space complexity). Up to a constant factor there is no increase in complexity as the cost of copying the \current" query to the oracle tape is equal in both space and time to that of asking a query. 2

Proposition35. The following table collects the general inclusions for arbitrary
oracles or sets of oracles K : Comment: (3) (1) (1) (2)
( )

(4)
(1)( )

(4)
( )( )

(3)
( )

b u LTK Lu K Lu 1 K LT K j ? ? j NLb K NLu K NLu 1 K NLu K Tj Tj ? ? Pb K = Pu K = Pu 1 K = Pu K


( ) (1)( ) ( )( ) ( ( ) (1)( ) ( )( ) ( )

Proof: (1) is proposition 31. (2) is corollary 33. (3) is proposition 30.
In section 6 we shall say more about (4).

4.4 Oracles from Regular Complexity Classes Let D C be full regular complexity classes. From the de nitions we have: Proposition36. C Du C.
(1)

Proposition37. Du 1 C C.
( )

Conversely, we prove:

21

possible for a query to be dependent on many previous queries but in LogSpace bounded classes only on a logarithmic amount of information about them, hence our restriction is weaker than the limiting of the adaptivity level among queries. Lynch in Lyn78] considered a restriction, similar to ours, on the number of oracle tapes used in a multi-tape model. (A model similar to the Ladner and Lynch model, except that the machine can use an arbitrary number of oracle tapes). However, this multi-tape model, as well as the multi-tape model suggested in Bus88], is stronger than the stack model (as access to tapes is not restricted to a stack mechanism) and hence we cannot say that the two types of restrictions are identical. In our terminology the models suggested by Ladner and Lynch LL76] for LogSpace Turing machines and by Ruzzo, Simon and Tompa RST84] for LogSpace and non-deterministic LogSpace Turing machines correspond to the case of the unbounded model restricted to a stack depth of one. De nition29. Let D(T) be a full complexity class and X be a set of oracles. We denote by Db(X ) (Du(X ) , Du(i)(X ) , Du(1)(X )) the set of problems recognized by acceptors in D machines using an oracle from X with a bounded oracle tape (stack of unbounded oracle tapes, i{depth stack of unbounded oracle tapes, xed depth stack of unbounded oracle tapes).

4.3 Inclusions Between Oracle Models


In Bus88], Buss proves that both his bounded and unbounded models satisfy the relativization thesis for inclusions between deterministic, non-deterministic and alternating space and time bounded complexity classes. Hence Proposition30 (Buss). For every oracle K we have (i) Lb(K ) NLb(K ) ALb(K ) = Pb(K ) (ii) Lu(K ) NLu(K ) ALu(K ) = Pu(K ) . For full complexity classes D = D(T ) the reader can easily derive some trivial inclusions such as Proposition31. For every 1 i < j

on some auxiliary tape and writes to the oracle tape only the \current" query before it should be answered. The added complexity comes from the copying operation and the time-cost of a query which is higher in the bounded model. 2 20

Db K Du i K Du j K Du 1 K Du K Proposition32 (Buss). For time bounded complexity classes TIME(t)u K TIME(t2 )b K Proof outline: The bounded machine \remembers" the contents of the stack
( ) ( )( ) ( )( ) ( )( ) ( ) ( ) ( )

this situation gives us the characterization we are looking for only in very speci c cases. To obtain a more general theorem, we have a closer look at Buss' models and introduce a new parameter for the stack size used in oracle consultations. We restrict his unbounded model by allowing only constant stack depth.

4.2 Oracle Computations with a Stack of Query Tapes


To allow rigorous proofs, in the sequel we restrict our attention to the models suggested by Buss Bus88] and applied to complexity classes D(T) with T full, cf. de nition 13. The main features of these models are: (i) Conditional Con gurations - Alternation computations are enhanced with a new type of conditional states. A conditional state has two successors T EST and MAIN and its transition function includes three states St Sa Sr . The T EST branch of the computation continues from state St and the MAIN branch of the computation continues from either Sa or Sr depending on whether the TEST computation path eventually accepts or rejects its input. A computation path is said to accept (reject) if its MAIN branch accepts (rejects). (ii) Query States - Three new types of states are introduced: start query, end query, answer query. A start query state signals the beginning of a query and following it non-determinism is not allowed (until an end query or answer query state is reached). (iii) Bounded Model (for deterministic and non-deterministic space bound classes this model is equivalent to the model suggested by Simon Sim77]). { The oracle tape is simply a distinguished work tape. { Answering of a query requires space and time equal to the number of symbols written on the oracle tape (in the given computation branch). (iv) Unbounded Model (for deterministic and non-deterministic classes this model is equivalent to the model suggested by Wilson Wil86]). { Queries (oracle consultations) can be nested via a stack mechanism, so that during the time a query is prepared, others can be asked (in which case the original query is suspended until the nested query is both written, asked and erased). start query states signal the pushing of a new query to the stack. { Each query tape is write only. { Each query is erased (popped) in the same step as it is answered. { The space complexity of a query is logarithmic in the size of the string written on the oracle tape (actually the sum of the lengths of the strings written in the stack) and the time complexity of answering a query is one unit. Common restrictions of these and other models are obtained by limiting the number of queries that can be asked or the interdependence between them Wag90]. Here we propose a di erent restriction by limiting the size of the stack to a xed depth. Note that even without a stack (a depth one stack) it is still 19

Conjecture 28. For D P there are no unordered Gurevich Logics capturing D unless D = NP \ Co ; NP.

We dare the following generalization:

4 Models for Oracle Computations


We now address the question of oracle computations. In the light of our deliberations in section 2.3 we have to be more speci c. We therefore restrict our attention to complexity classes D(T), where T is full as de ned in de nition 13. It is well known that many results regarding space{bounded oracle computations depend heavily on the speci c oracle computation model used. Already in Lyn78] it is noted: The study of these many variations, each with some natural properties, has forced us to the conclusion that space complexity does not have a single natural relativization to oracles], but that di erent reducibilities may prove useful in di erent classi cation situations. Moreover, in many cases various results seem to contradict our intuition of oracle computation as a \program" enhanced by a \subroutine". For example, the complexity classes P (Polynomial time) and AL (alternating LogSpace) are equivalent via general machine simulations CKS81], however using some of the suggested oracle computation models, there are oracles K such that PK 6= ALK . Speci cally, in the bounded model (called so because the oracle tape is subject to the space bounds of the complexity class) suggested by Simon Sim77], there are K such that PK 6 ALK Orp83]. In other, unbounded models (where the oracle tape is write only and erased after each query but is exempt from any space bound), suggested by Ladner and Lynch LL76] and Ruzzo, Simon and Tompa RST84], there are K such that ALK 6 PK . In an attempt to restore our intuition of oracle computations and to suggest criteria for \proper" oracle models, Buss Bus88] proposes the following \relativization thesis": All general machine simulations which hold in the absence of an oracle can be extended to hold for every oracle in a properly relativized model. He also demonstrates the feasibility of this thesis by introducing two models of oracle computation which satisfy it for the relevant deterministic, nondeterministic and alternating complexity classes. As one of these models is bounded and the other unbounded, it is clear that the relativization thesis can accommodate models of both types. We wish to explore the intuitively close relationship between generalized quanti ers, seen as logical subroutines, on the one side, and oracle computations on the other side. We shall see that in Buss' unbounded model we can accommodate model checking, and in his bounded model expressibility. Unfortunately, 18

4.1 Problems with Oracle Computation Models

(iii) is similar to (ii), using as the {atomic formulas in appropriate order for the identity transducer, and sequence of non satis able formulas for the constant transducer producing the empty string. (iv) It is easy to see, using the substitution properties of the logic L, that the composition of 1 and 2 can be written as an L{reduction . (v) Similarly, using that L is closed under boolean operations and (iii). Next we have to verify the properties of regular complexity classes. krelativization and multiple selection together are just the L{reductions and are already required for L, and search corresponds to existential quanti cation. 2 The next theorem shows that any regular complexity class can be captured by a Lindstrom Logic L. THEOREM 7. Let D be a regular complexity class with L D. Then there is a regular Lindstrom Logic LD which captures D.

THEOREM 6. Let L be a regular Lindstrom Logic. Let C consist of classes K of {structures which are de nable in L, i.e. K 2 C i there is 2 L( ) such that A j= i A 2 K. Then C is a regular complexity class. Proof: We rst have to verify the basic assumptions. (i) We view the L{ reductions as transducers and L formulas as acceptors. (ii) follows by using the acceptors ^ 6 and _ 6 respectively.

Proof: For every K 2 D let QK be the quanti er associated with it. De ne a regular Lindstrom Logic by LD = FOL K : K 2 D]. Clearly, every K 2 D is de nable in LD . It remains to show, that every 2 LD has a model checker in D. We show this by induction on 2 LD . 2 FOL: Then has a model checker in L, and therefore in D. is a boolean combination of and , both of which have model checkers in D. Then has a model checker in D, since D is closed under boolean combinations. = 9x (x): Similarly, using the search assumption. = QK x , where is a sequence of formulas as required for QK . By lemma 20, is an LD{reduction from K = fA : A j= g to K. By proposition 25 is a D{reduction. By assumption, K has a model checker in D and D is closed under D{reductions, hence K is in D, which shows that has a model checker in D.
1 2 1 1 1

Using proposition 25 seems to assume that the structures are ordered. However, for unordered structures we note that they can be de ned using an arbitrary ordering, i.e. their de nition is independent of the ordering chosen, cf. Daw94]. 2 Although Theorem 7 gives us a Lindstrom Logic, it does not give us a Gurevich Logic. The additional di culty is essential. In fact, Gurevich conjectures, Gur88]:

Conjecture27 (Gurevich). For P there is no unordered Gurevich Logic capturing P, unless, say, P = NP \ Co ; NP.
17

Remark. The theorem is valid also for unordered structures. However, establish-

ing that a Gurevich logic L captures D for D P requires ordered structures, unless Gurevich's conjecture is false.

Proposition26. Let D be a complexity class such that L D PH Then every D{reduction is polysize. Proof: Let M 2 D be the reduction transducer. Then there is a transducer M 0 and a number k such that M 0 2 ( p ) (the class of machines in the k'th level of k p the polynomial hierarchy) and M 0 simulates M. p is de ned as P k 1 , hence, k there is a xed number m such that for an input of size n, M 0 has no more than
;

nm moves. As it can write at most one output symbol per move the size of the output is at most nm and hence any reduction is polysize. 2 This, together with Theorem 3, gives us
1

to K2 .

COROLLARY 4. Let L be a regular logic capturing a regular complexity class D such that L D PH. Then K is D{reducible to K i K is L{reducible
2 1

3.2 Building Logics in Steps


We now show how to use Theorem 3. {structures closed under isomorphisms. (i) L(K) captures Red(D K). (ii) If, additionally, K is C{complete for D{reductions, then L(K) captures C. (iii) If additionally, C is regular, L K] captures C.
( )

THEOREM 5. Let L be a regular logic capturing the regular complexity class D, and assume that D{reductions are polysize. Let K be any class of

K1 to K. By theorem 3 then there is some which de nes the structure produced by M. Hence K1 = ModL(K )(QK ). (ii) Follows from the (i) and observation 12. (iii) Follows from (ii) and theorem 1. 2

Proof: (i) Assume 2 L(K) of the form = QK , with all formulas of in L. Then M is in D, by proposition 25. Now we have that A j= i A 2 K, hence M is a D{reduction of ModL K ( ) to K, and therefore has a model checker in Red(D K). Conversely, assume K 2 Red(D K). So there is a transducer M 2 D reducing
1

3.3 Regular Complexity Classes and Lindstrom Logics


We have promised in section 2 a justi cation of our de nitions of regular complexity classes. First we note that formulas of a Lindstrom Logic can be viewed as (high level) computation devices. This works also on structures without order. 16

for unordered structures. In applications, however, this means that we either deal with Lindstrom Logics, or ordered Gurevich Logics, when no unordered Gurevich Logic is known to exist.

3.1 L{Reductions and D{Reductions The relationship between our de nition of L{reducibility and regular complexity
classes is given by the following:

Proposition25. Let L be regular and be an L{reduction. Assume further that D is a regular complexity class and L D. If L is D{computable, then there is a transducer M 2 D such that for every A M (A) = A : Proof outline: Note rst that, as D is closed under negations, every 2 L has a model checker which fully recognizes ModL ( ) (computes a function to f0 1g). Next, we observe, that for every {formula 2 with free variables x, the fag{formula (a) has a model checker in D. Now, M can be obtained
2 Remark. This proposition works also for unordered structures. But D uses the ordering inherent in the coding. We can now state and prove the following: THEOREM 3. Let L be a regular logic capturing a regular complexity class D(T) such that L D. Let K1 K2 be classes of 1 2{structures closed under isomorphisms (not necessarily in D). Then K1 is D{reducible to K2 by a polysize reduction i K1 is L{reducible to K2 . Proof: The observation that K1 /L K2 implies K1 /D K2 , is a direct corollary of proposition 25. Now assume K1 /D K2 and let M 2 T be a reduction function transforming 1 { structures into 2{structures. As M is a polysize D{reduction there is an n 2 IN such that for every 1 {structure A we have jM(A)j < jAjn. Let 3 = 2 fR0g, where R0 is a unary relation symbol. Without loss of generality we can assume that there is M 0 2 T such that M 0(A) is a 3 {structure with universe An , and M 0(A) relativized to R0 is isomorphic to M(A). For all 0 i m let KRi = fhA ai : a 2 M 0(A)(Ri )g: Clearly, each KRi is recognizable by some acceptor in T . As L captures D, there is = h 1 : : : m i in L n{feasible for 3 over 1 such that de nes R0 and i de nes Ri 1 i m. (We allow here tacitly the passage from uninterpreted constant symbols to free variables). It now follows from the de nitions that A 2 K1 i A 2 K2 , hence K1 is L{n{reducible to K2 . 2
15 by applying k{relativization and multiple selection.

2.5 Second Order and Gurevich Logics


Logics based on Lindstrom quanti ers are inherently rst order in their formation rules. In contrast, logics based on fragments of second order logic, such as xed point operators or existential second order quanti cation, are still inherently second order in their formation rules. To nd a Lindstrom logic equivalent to, say, xed point logic, one has to add an in nite family of vectorized quanti ers, which can be recursively generated. Hella has shown that xed point logic over arbitrary (unordered) nite structures cannot be obtained as a Lindstrom Logic of the form FOL K1 ::: Km] with nitely many generalized non{vectorizing quanti ers, Hel89, Hel92]. Immerman Imm87] has shown that on ordered structures least xed point logic can be written in the form F OL K1] with one vectorizing family. Grohe has found recently a way of doing this on unordered structures, Gro94]. For our purposes we restrict our attention to logics which are extensions of First Order Logic, F OL, by vectorized families of Lindstrom quanti ers. By theorem 1 every regular logic is, in an arti cial sense, equivalent to F OL Q ] 2X for some set X, cf. also theorem 7. To capture the idea that X be given constructively, Gurevich in Gur88] has considered logics over nite structures (not necessarily ordered) which are Lindstrom Logics with the additional requirement that their de nable classes are recursively indexable. We shall call such logics Gurevich Logics, and ordered Gurevich Logics when the models are assumed to be ordered. Most of the logics in this paper are ordered Gurevich Logics.

2.6 Logics Capturing Complexity Classes De nition24. Let L be a logic and D = D(T) a complexity class. (i) We say that L is D{computable or has a model checker in D if every class of nite ordered structures de nable in L can be recognized by an acceptor in T. (ii) We say that L is D{expressive if every class of nite ordered structures recognized by an acceptor in T can be de ned in L. (iii) We say that L captures D if it is D{computable and D{expressive.
It is by now well known that there are Ordered Gurevich Logics capturing the regular complexity classes L, NL P, and (unordered) Gurevich Logics capturing PSpace and PH, the polynomial hierarchy, Fag74, Imm88, Imm89, Sto87, Ste91]. However, it is still an open problem, whether there are (unordered) Gurevich Logics capturing L NL or P.

3 Regular Logics Capture Regular Complexity Classes


In this section we study the relationship between regular Lindstrom Logics and regular complexity classes without oracle computations. The theorems are true 14

The following theorem now follows from the de nitions and is implicit in BF85] for 1{regular logics and is originally due to Lindstrom, Lin66, Lin69].

THEOREM 1. (i) FOL is the smallest regular logic. (ii) Let L be an n{regular logic and K as above. Then L Kn] is the smallest n{regular logic extending L such that K = ModL Kn ] ( ) for some formula of L Kn]. (iii) For L and K as above, L K] is the smallest regular logic extending L in which K is de nable. (iv) L(Kn ) is the smallest sublogic of L Kn] extending L such that for every class of {structures K1 we have K1 is n{L{reducible to K i K1 = ModL(Kn ) ( ) for some formula of L.
Remark. Note that L(K) is not a regular logic, as it is not closed under negation, iteration or nesting of QK .

We can now build more regular logics. L = FOL K1 : : : Km ] is a regular logic. L K] is the smallest regular extension of L which contains all the vectorized versions of K. Clearly, from our de nitions, L K] = FOL K1 : : : Km K]. This gives us immediately THEOREM 2. Let L be a regular logic. Then there is a set of Lindstrom quanti ers K such that L is equivalent to F OL K]. Let D be a regular complexity class and K 2 D. What about the complexity of the classes K (i) ?

Proposition23. Let D be a regular complexity class containing L, K a set of {structures with K 2 D. Then K i 2 D. Proof: As D is closed under k-relativization this is immediate. 2
( )

n{tuples. For n a natural number, n{vectorization of K is obtained by thinking of the universe of the structure as an n{fold cartesian product of some set A and of a k{ary relation as a n k{ary relation over A. With each relativizing Lindstrom quanti er Q, we can associate a corresponding vectorized quanti er Qn . A logic L is n{regular if with each de nable relativizing quanti er Q in L, also Qn is de nable in L. A logic L is !{regular if it is n{regular for each natural number n. As we only consider !{regular logics, we call them simply regular. The logics introduced by Immerman ( Imm87, Imm89]) to capture complexity classes are all regular in our sense. Hella in Hel89, Hel92] has studied hierarchies of vectorized quanti ers. Dawar has introduced families of vectorized quanti ers under the name uniform sequences of quanti ers, Daw94]. Immerman and Landau, IL94], de ne abstract operators. They are special cases of Lindstrom quanti ers, where constants or terms are allowed, cf. Ebb85]. In MP93] they are called predicate transformers. 13

Vectorization arises from regarding an n k{ary relation as a k{ary relation over

The stronger requirement that be given by R1(x y), would exclude vectorization. The requirement that de ne the lexicographical order on the vectorized universe is unnatural. Now we can give the usual de nition of Lindstrom quanti ers from BF85]. De nition19 (Lindstrom quanti ers). Let L = hL( ) ModLi be a regular logic. Let K be a class of nite 2 {structures closed under isomorphisms. We de ne the logic L K] = hL K]( ) ModL K ]i inductively as follows: (i) For every , and a {formula of L( ) 2 L K]( ) and ModL K ] ( ) = ModL ( ). (ii) For every n 2 IN, and every = h (x) 1(y1 ) : : : m (ym )i in L K]( ) n{feasible for 2 over with all the free variables x yi distinct = QK x y1 : : : ym is in L K]( ) and A 2 ModL K ] ( ) i A 2 K. (iii) Furthermore, L K]( ) is closed under conjunction, negation, existential and universal quanti cation and substitution and ModL K ] is de ned for these operations in the usual way. (iv) We denote by L(K) = hL(K)( ) ModL(K )i the sublogic of L K] obtained by single applications of = QK x y1 : : : ym to in L. The quanti er QK is called a Lindstrom quanti er associated with K. Lindstrom quanti ers and L{reductions are related in the following way: Lemma 20. Let L be a regular logic, and let K1 K2 be classes of 1 2{ structures closed under isomorphisms. Then K1 is L{reducible to K2 via i K1 is de nable in L K2] by the formula QK2 . The logic L K] will in general not be regular even if L is regular. There may be two causes for this: Both relativization and closure under n{reducibility may fail. We shall remedy this in the following way: for each K we de ne K (i) which is a relativized and vectorized version of K. More precisely: De nition21. Let K be a class of nite {structures closed under isomorphisms, with = fR1 : : : Rm g. Let n 2 IN and for each Rj 2 of arity (j) let R(n) j be a n (j){ary relation symbol. Further let R0 be an n{ary relation symbol. Let (n) be the vocabulary consisting of R0 and R(n)j for each Rj 2 . Let n = hR0 R(n)1 : : : R(n)m i. Now we put K (n) to be the class of (n){structures A such that A n 2 K. Notation 22. Let K be a set of {structures. To simplify notation we shall write K for fK (n) : n 2 INg and Kn for fK (j) : j ng. 12

sublogics of each other. In BF85] regular logics are closed under boolean operations, existential and universal quanti cation, renaming, substitution and relativization to de nable unary predicates. Additionally, it is required that de nable model classes be closed under isomorphisms. In our terminology, these will be 1{regular logics. Typical examples of 1{regular logics are Lindstrom{Logics, obtained from First Order Logic by adding any set of relativizing Lindstrom quanti ers. We follow closely our exposition in MP93]. A Lindstrom quanti er is de ned here by a class K of nite (not necessarily) ordered structures over some vocabulary closed under isomorphisms. The vocabulary determines uniquely the syntax of the quanti er, and K determines its semantics. We rst generalize the notion of rst order reductions as introduced by Immerman and Dahlhaus Dah82, Dah83, Imm87] to any regular logic L. We rst presented this concept in MP93]. Our de nition is very close to Rabin's notion of interpretability as described in Rab65]. A similar notion is also used in Cou92] and, for general logics, in Daw94]

L is a sublogic of L , if there is a function f : L ! L which is {preserving and such that ModL1 ( ) = ModL2 (f( )). Two logics are equivalent if they are
1 2 1 2

{structures for which holds. We denote First Order Logic by FOL. A logic

exactly n distinct free variables and each i has n (Ri ) distinct free variables. (ii) Let A be a 1 {structure and be n{feasible for 2 over 1. The structure A is de ned as follows: (ii.a) The universe of A is the set A = fa 2 An : A j= (a)g. (ii.b) The interpretation of Ri in A is the set A (Ri ) = fa 2 A (Ri ) : A j= i (a)g Note that A is a 2 {structure of cardinality at most jAjn. (iii) Let n 2 IN. We say that K1 is L{n{reducible to K2 (K1 /L;n K2 ), if there is a n{feasible for 2 over 1 such that A 2 K1 i A 2 K2 for every 1 {structure A. (iv) We say that K1 is L{reducible to K2 (K1 /L K2 ), if K1 /L;n K2 for some n 2 IN.
Remark. We have to clarify our notion of L{reducibility for the case of ordered structures. Let K1 K2 be classes of ordered 1 ( 2 ){structures with order relation symbols R1 and R2 respectively. Assume that de nes an L{reduction from K1 to K2 and that R2 is de ned by . The notion of L{reducibility only requires the formula to de ne an order, and this is all we need.

De nition18 (L{reducibility). Let K K be classes of {structures closed under isomorphisms and L be a regular logic. (i) Let = fR : : : Rm g and let (Ri ) be the arity of Ri. Let = h : : : m i be {formulas of L. is n{feasible for over if has
1 2 1 2 2 1 1 1 2 1

11

The complexity classes L NL P are obviously full. But also less frequently considered complexity classes, such as linear time or polylog space computable functions are full, Joh90], although not necessarily regular.

Notation 14. For relational complexity classes D(T), where T is full, has a non problematic extension to oracle computations, we denote by DX the relational
complexity class associated with oracle computations in T using oracles from X .

The question whether DX is regular might still depend on the particular choice of the oracle computation model, cf. section 4. To avoid confusion, we end this section with some alternative de nitions of reducibilities which are not used in the sequel. The following are adaptations of standard de nitions to our abstract framework, cf. GJ79]: Assume DX is well de ned. De nition15 (Turing reductions). Let D be a complexity class. We say that K1 is D{Turing reducible to K2 i K1 2 DK2 .

De nition16 (C{hard problems). A class of {structures K is C{hard for D{reductions if there is K 2 C which is C{complete for D{reductions and K is D{Turing reducible to K.
1 1

Recalling that a non consistent transducer can return for the same input di erent outputs, we should also consider the following: ping of {structures to sets of {structures (all possible outcomes of the transducer). (ii) Let K1 be a set of {structures and K2 be a set of {structures. Let F be a { reduction relation. We say that F {reduces K1 to K2 if for all B 2 F(A) it is true that A 2 K1 i B 2 K2 . (iii) Let T be a set of computing devices and D(T ) be a relational complexity class. We say that K1 is D{ {reducible to K2 , if there is a transducer M 2 T which {reduces K1 to K2 . {reductions were rst introduced in Adelman and Manders AM77]. We leave it for further investigations to check whether such abstractions lead to interesting results. However, as L{reductions, as de ned next, are always functions, reduction relations do not t naturally into our framework.

De nition17 (Reduction relations). (i) A { reduction relation is a map-

2.4 L{Reductions and Lindstrom Logics


Now we introduce a notion of !{regular logics which restricts the usual de nition ( BF85]) by the additional requirement that logics be closed under nite vectorization. The class of models admissible for our logics is, unless otherwise stated, the class of nite, ordered {structures. A logic is given by a pair hL( ) ModLi, where L( ) is the set of {formulas and for 2 L( ) ModL ( ) is the class of 10

1. A single oracle consultation at the end of the computation. This amounts to

allowing D{reductions to problems in X. Hence we de ne


1

De nition11. For D regular and X as above, we put Red(D X) = fK : there is K 2 X such thatK /D K g: In other words Red(D X) is the closure of X under D{reductions. However, there is no natural de nition of Red(D X){reducibility. In other words, it is clear what the underlying acceptors are, but not, what the underlying transducers should be. And even if it were clear, Red(D X) need not be closed under it. Nevertheless, the set Red(D X) will be of interest in our developments. For
1

instance, we have

Observation12. If D C and there is K 2 C which is complete for D{ reductions, then Red(D K) = C.


2. Closure under basic or regularity assumptions. Our basic assumptions tell us

that in D(T ), T contains acceptors and transducers and is closed under the formation of straight line programs. The set X can be viewed as a set of acceptors. We can consider T(X), the set of straight line programs built over T X. The corresponding complexity class, we denote by D(X). Here the notion of D(X){reducibility can be naturally de ned using the transducers as reductions. However, for each M 2 T(X) there is only a xed nite number of oracle consultations, independent of the input. This contradicts the standard de nitions in complexity theory. Additionally, problems arise, when T is subject to severe space bounds. In contrast to this, we can consider Treg (X), the smallest set of transducers and acceptors which contains T X and satis es all the closure conditions needed for a regular relational complexity class. This is theoretically sound and well de ned, as shown by theorem 6, but the identi cation of Treg (X) with concrete complexity classes may be non trivial.
3. Involving the model of computation. The third option assumes that T con-

sists of computing devices with oracle consultation states, which corresponds to subroutine calls. In our abstract framework we have not speci ed, how such subroutine calls are to be de ned. In section 4 we discuss this for a large class of deterministic, non{deterministic and alternating Turing machines with logarithmic space bounds. For machines with polynomial space bounds or time bounds, the de nitions are straightforward. To distinguish this situation from the abstract framework we introduce the following:

De nition13 (Full Complexity Classes). Let T be a set of acceptors and

transducers. We say that T is full, if it consists of a set of Turing machines and is closed under time and space bound preserving modi cations of Turing machines. In other words, if M 2 T , and M1 is a Turing machine obeying the same time and space bounds as M, then M1 2 T. 9

(iv) (Multiple replacement:) Like k{replacement, but with containing several relation symbols and 1 containing tuples of constant symbols of the arities corresponding to the relation symbols in .
Remark. (i) Search allows to look for the interpretation of a constant via some

(ii) (iii) (iv) (v)

acceptor, and succeeds if one is found. It is the same as existential quanti cation. k{relativization takes a structure A with universe A and, say, one binary relation (for k = 2), and returns the structure with universe A(P) A2 and the now unary relation A(R) \ A(P ). The new universe consists of a subset of vectors of the old universe. It combines vectorization and relativization. k{replacement takes a structure and returns a structure of the same universe equipped with a new k{ary relation consisting of all the possible tuples the acceptor recognizes. Multiple replacement together with k{relativization will give us immediately a big class of polysize D{reductions. For this paper, we are not interested in the minimality of the assumptions needed to de ne regular complexity classes. Our main justi cation of the axioms lies in theorems 6 and 7.

Traditional complexity classes which are closed under complement are usually regular. In particular, L NL P (Deterministic Logarithmic Space, Non{ deterministic Logarithmic Space and Polynomial Time) are regular, and so are the {levels P of the Polynomial Hierarchy. NP is only regular, if P = NP. n Veri cation of most of the properties are straight forward, if true. Only relativization and replacement need some work for the case of logarithmic space bounds. We shall be mostly interested in regular complexity classes, or oracle computations over regular classes. Oracle computations over speci c complexity classes are introduced in section 4. We denote (regular and other) complexity classes by C D. Theorem 7, below, justi es our de nition of regular relational complexity class. They are the complexity classes which can be captured by Lindstrom Logics.

2.3 Oracles and Reduction Relations


Let K be a class of {structures closed under isomorphisms, and X be a set of such classes (possibly with di erent vocabularies). Let, furthermore, D be a regular complexity class. We would like to de ne abstractly the complexity class

DX = fK : K is recognizable by an acceptor in D using oracles from X g:


We have essentially three options. 8

(Note that this relation is consistent). The following is left to the reader. Proposition8. Let T be a set of acceptors and transducers satisfying the basic
assumptions. (i) A necessary and su cient condition for the composition of M1 with M2 to be consistent is that M2 either responds to F (Fail) with F , or else responds to all inputs with either F or the same unique output. (ii) T is closed under the formation of straight line programs built using the elements of T . (iii) For every acceptor A 2 T there is a transducer MA 2 T which returns the input, if A accepts it, and returns the empty string otherwise. (iv) F Rec(T ) is closed under boolean operations (v) F Rec(T ) is closed under T {reductions. Example 1. The class of context free languages (which is not closed to intersec-

tions) does not satisfy the basic assumptions.

Notation9. Let be a vocabulary and A a {structure. For R 2 we denote by A(R) the interpretation of R in A. De nition10 (Regular Relational Complexity Class). A relational complexity class D = D(T) is regular if T obeys the basic assumptions and it is
closed under (i) (Search:) If = fcg and K is a class of {structures, K 2 D, then the class of {structures
1

fA : there is a 2 A with hA ai 2 K g 2 D: (ii) (k-Relativization:) Let = fP g be a vocabulary with a k{ary relation symbol P and each R 2 k nR {ary and K be a class of {structures in D. For every R 2 let R be an nR {ary relation symbol and = fR : R 2 g. For A in K let AP be the {structure with universe A(P) Ak and AP (R)
1

given by the set


1

fha : : : anR i 2 Ak : ha : : : anR i 2 A(R) and a : : : anR 2 A(P )nR=k g: Then there is a ; {transducer M 2 D which on input A produces AP . (iii) (k-replacement:) Let = fc : : : ck g be a vocabulary with k constants symbols not in and let = fRk g consist of one k{ary relation symbol. Let M be a {acceptor. Then there is a ; {transducer M 2 D such that for every {structure A, M(A) is the {structure B with the same universe as A and B(Rk ) = fa 2 Ak : hA ai 2 FRec(M )g:
1 1 1 1 1 1 1

(iv) For a set T of computing devices we denote by Rec(T ) (FRec(T)) the set of languages (fully) recognized by some M 2 T . Hence K 2 Rec(T) (K 2 FRec(T )) i there is an acceptor M 2 T which (fully) recognizes K. De nition4 (Relational Complexity Class). For T a set of Turing Machines (or other computing devices) a relational complexity class D(T) (or just D if T is clear from the context) is the family of all K 2 Rec(T), such that K is a class of nite ordered structures, closed under isomorphisms and renaming of basic symbols. De nition5 (D-Reductions). Let and be two vocabularies. (i) A { reduction function is a function f from {structures to {structures. As the vocabularies are arbitrary, in the following we mean by a reduction a { reduction. (ii) Let K1 be a set of {structures and K2 be a set of {structures. Let f be a reduction. We say that f reduces K1 to K2 if A 2 K1 i f(A) 2 K2 . (iii) Let T be a set of computing devices and D(T ) be a relational complexity class. We say that K1 is D{reducible to K2 , (denoted K1 /D K2 ) if there is a transducer M 2 T whose { function reduces K1 to K2 . (iv) For a relational complexity class C, D C, and K0 2 C, we say that K0 is C{complete for D{reductions if every K 2 C is D{reducible to K0 . De nition6 (Polysize Reductions). A reduction is said to be polysize if the size of the structure f(A) is polynomially bounded by the size of A. We are now ready to de ne regular relational complexity classes on ordered structures. The required properties come in two parts. First, the basic assumptions, which are readily expressed using acceptors and transducers. De nition7 Basic Assumptions. Let T be a set of Turing machines (or other computing devices). (i) T contains both acceptors and transducers. (ii) T contains the two constant acceptors returning always 1 and 0 respectively. (iii) T contains the identity transducer and the constant transducer which always returns the empty string. (iv) T is closed under consistent compositions, i.e. if M1 M2 2 T then there is M3 2 T whose input{output relation is the composition of the input{output relations of M1 and M2 , provided that composition is consistent. (v) T is closed under branching, i.e. if M1 M2 2 T and A 2 T is an acceptor, then there is M3 2 T whose input{output relation is the input{output relation of the device described by IF A returns 1 THEN M1 ELSE IF A returns 0 THEN M2 ELSE F 6

2.2 Regular Complexity Classes

De nition1 (Acceptors and transducers). Let be some alphabet and let y= F . (F 62 ).


(i) An acceptor is a Turing machine (or other computational device) which receives elements of y as inputs, and returns one of three values (0 for rejection, 1 for acceptance and F for failed computation). It is called consistent if for the same input it cannot return both 1 and 0. If, furthermore, it never returns F, it is called deterministic, (ii) A transducer is a Turing machine (or other computational device) which receives elements of y as inputs, and returns either the value F indicating a failing computation or a string (an element of ). It is called consistent if for the same input it cannot return di erent output strings. If, furthermore, it never returns F , it is deterministic. Remark. From here on we restrict our attention only to acceptors and transducers which are consistent. For acceptors this restriction is standard, less so for transducers where alternative de nitions for non-deterministic transducers exist AM77]. In this paper, we do not investigate if and how our theory extends to such alternative de nitions, hence in the sequel we drop the pre x \consistent" before acceptors and transducers. puting device and let x denote an input for M. (i) The string function computed by M, denoted M(x), is obtained by ignoring the F output for those inputs which have an alternative output. M(x) = F if M returns only F for x and M(x) = s if M can return either s or s and F. Note that for a consistent device s, if exists, is unique hence M(x) is indeed a function. (ii) Let w be a xed invertible encoding scheme such that w maps structures to strings and w;1 maps strings to structures (see MP93] for a discussion on encoding schemes). The { function computed by M (denoted by f(x) or by abuse of notation as M(x)) is obtained from the string function computed by M by ignoring all inputs to M which are not encodings of {structures and by interpreting for transducers all outputs which are not encodings of a {structure as some default {structure (say the empty structure). For a transducer f(x) is function from {structures to {structures and for an acceptor it is a function from {structures to the set f0 1 F g. De nition3 (Recognizing). Let K be a set of {structures and M be some acceptor. (i) If for all {structures M(A) = 1 i A 2 K. We say that M recognizes K. (ii) If for all {structures M(A) = 0 i A 62 K. We say that M co-recognizes K. (iii) We say that M fully recognizes K if it both recognizes and co-recognizes K. Note that an actual computation of an acceptor which fully recognizes K can fail, however for all A we have M(A) 6= F. 5

De nition2 (The function computed by a device). Let M be some com-

Speci cally the oracle model is the restriction of Buss' unbounded model, Bus88], to constant stack size. In other suggested oracle computation models for space bounded Turing machines we cannot show these results in general. The exact determination of the appropriate oracle computation model turns out to be more delicate than rst expected. The paper is organized as follows: In section 2, we develop the general framework of regular complexity classes and Lindstrom Logics, as we need it for our presentation. In section 3 we characterize logical reducibility for logics capturing regular polynomially bounded complexity classes, develop a general method of constructing stepwise logics capturing complexity classes and show the correspondence between regular complexity classes and regular Lindstrom Logics. In section 4, we discuss the oracle computation models relevant for our exposition. In section 5, we formulate our main results on logics capturing oracle complexity classes. In section 6, we show how our main theorems can be used. In section 7, we prove these theorems, and in section 8 we present our conclusions. Our main results are marked as separately numbered THEOREMS, COROLLARIES and APPLICATIONS.

Acknowledgments: We are indebted to H.D. Ebbinghaus, J. Flum, G. Gott-

lob, N. Immerman, A. Litman and I.A. Stewart for valuable remarks and suggestions on a draft version of this paper. We are grateful to B. Chor for guidance in the literature. We are also indebted to several unknown but insistent referees, who led us to reexamine the r^le of the oracle computation models, and to o the editors of this volume, who generously extended the deadline so as to allow substantial revision of this paper.

2 The General Framework


We assume the reader is familiar with the basics of complexity theory as presented in HU80, GJ79] or the excellent surveys Sto87, Joh90], and with the basics of abstract model theory as presented in EFT80, CK90] or in Ebb85] of BF85]. We start by introducing a notion of relational regular complexity classes, similar in spirit to both Lindstrom's abstract de nition of logics and the computable queries of A. Chandra and D. Harel CH80, CH82]. Independently A. Dawar in Daw94] introduced basically the same concept for unordered structures. We denote vocabularies (similarity types) by . Vocabularies are assumed to be relational and nite. If we speak of ordered structures, vocabularies contain a distinguished binary relation symbol \<" for the order relation. ( ) {structures are denoted by A B and their underlying universes by A and B respectively.

2.1 Transducers and Acceptors on Relational Structures

In the sequel we shall need very little knowledge about Turing Machines or other computing devices. We shall list here what we need. 4

1 Introduction
In the last 20 years several logics were exhibited which capture complexity classes such as L (LogSpace), NL (Non{deterministic LogSpace), P (Polynomial Time), NP (Non{deterministic Polynomial Time), PH (the polynomial hierarchy), Fag74, Imm87, Imm89, Sto87, Ste91]. In mathematical logic the theory of abstract model theory and generalized quanti ers is well established BF85]. One purpose of this paper is to show in the framework of abstract model theory how to construct, in general, logics capturing complexity classes. Much of the abstract framework was already presented, in outline, in MP93]. Intuitively, logics over ordered nite structures can be viewed as high level descriptive programming languages, whereas resource bounded machine models can be viewed as low level procedural assembly languages. In this spirit, a generalized quanti er can be viewed as a logical subroutine call, whereas access to an oracle (of strings) as a low level subroutine call. From this point of view it is natural to seek the exact correspondence between logics capturing classes de ned by resource bounded machine models and various oracle mechanisms for these complexity classes. The rst part of this paper gives the general framework needed for such a task. We rephrase and improve upon the framework presented in MP93]. But our main interest lies in exploring the analogy between the extension of a logic L by a (or a family of) generalized quanti er(s) and the passage from a complexity class D to the class DK for some oracle K (or a set of oracles). To clarify what we mean let us consider the following situation: Stewart Ste93a, Ste93b] found that if L is F OL ( rst order logic), then its extension FOL HAM] by the quanti er HAM, which expresses Hamiltonicity of a graph, captures LNP. His result uses heavily the particular de nition of HAM. We would like to replace HAM by any problem which is NP{complete via D{reductions, where D can be L NL or P. In our context, Stewart's results are viewed as follows: As deterministic transitive closure DTC, transitive closure T C and alternating transitive closure ATC are all in LNP , it follows that the logics FOL HAM], F OL DTC HAM], FOL TC HAM] and FOL ATC HAM] have all the same expressive power (over ordered structures). As by Immerman Imm87], FOL DTC], FOL TC], FOL AT C] capture L NL P respectively, we would like to conclude that, in an appropriate oracle computation model (a) FOL DTC HAM], FOL TC HAM], F OL AT C HAM] capture LNP, NLNP, PNP respectively. In particular this would entail that in this oracle computation model LNP = NLNP = PNP (b) More generally, if L captures a complexity class D, and QK is a generalized quanti er, whose meaning is de ned by a class of nite ordered structures K, then L QK ] captures DK , where K is viewed as an oracle. It turns out that such conclusions hold under certain reasonable assumptions about the logics, complexity classes and oracle computation model involved. 3

Table of Contents
1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 The General Framework : : : : : : : : : : : : : : : : : : : : : : : :
2.1 2.2 2.3 2.4 2.5 2.6 Transducers and Acceptors on Relational Structures Regular Complexity Classes : : : : : : : : : : : : : : Oracles and Reduction Relations : : : : : : : : : : : L{Reductions and Lindstrom Logics : : : : : : : : : Second Order and Gurevich Logics : : : : : : : : : : Logics Capturing Complexity Classes : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3 4 4 6 8 10 14 14 14 15 16 16 18 18 19 20 21 23 24 24 27 27 28 32

3 Regular Logics Capture Regular Complexity Classes 3.1 L{Reductions and D{Reductions : : : : : : : : : : : : 4
3.2 Building Logics in Steps : : : : : : : : : : : : : : : 3.3 Regular Complexity Classes and Lindstrom Logics Models for Oracle Computations : : : : : : : : : : : 4.1 Problems with Oracle Computation Models : : : : 4.2 Oracle Computations with a Stack of Query Tapes 4.3 Inclusions Between Oracle Models : : : : : : : : : 4.4 Oracles from Regular Complexity Classes : : : : : 4.5 Logics Capturing Oracles : : : : : : : : : : : : : : Capturing Oracle Classes over L NL and P : : : : Applications : : : : : : : : : : : : : : : : : : : : : : : : Proofs of Theorems 9 and 10 : : : : : : : : : : : : : 7.1 Model Checking (Theorem 9) : : : : : : : : : : : : 7.2 Expressibility (Theorem 10) : : : : : : : : : : : : : Conclusions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

5 6 7 8

: : : : : : : : : : : : : :

Oracles and Quanti ers


J.A. Makowsky1? and Y.B. Pnueli2??
1

Department of Computer Science, Technion{Israel Institute of Technology Haifa, Israel (janos@cs.technion.ac.il) 2 Institut fur Informatik, Freie Universitat Berlin Berlin, Germany (yachin@inf.fu-berlin.de)

To appear in Selected Papers from CSL'93, E. Borger, Y. Gurevich and K. Meinke Springer, eds., Lecture Notes of Computer Science, 1994. And he shall stand before Eleazar the priest, who shall ask counsel for him after the judgment of Urim ...]. (Numbers 27.21)
quanti ers, which capture regular complexity classes on ordered structures with polysize reductions. We then extend this method so as to accommodate complexity classes based on oracle Turing machines. Our main result shows an equivalence between enhancing a logic with a Lindstrom quanti er and enhancing a complexity class with an oracle such that, if K is a set of structures, QK the associated Lindstrom quanti er and L a logic that captures a complexity class D, then the enhanced logic L K ] captures DK - the complexity class of machines in D using oracles for K . Our results are sensitive to the oracle computation model and hold in a natural modi cation of the unbounded model introduced by Buss Bus88]. They do not hold in the, so called, space bounded oracle models or those that violate the `relativization thesis' of Buss. Our results generalize and extend previous results of Stewart Ste93a, Ste93b] and Makowsky and Pnueli MP93].

Abstract. We describe a general way of building logics with Lindstrom

Partially supported by a Grant of the French-Israeli Binational Foundation and by the Fund for Promotion of Research of the Technion{Israeli Institute of Technology. ?? Since Fall 1993 Minerva Fellow.
?

S-ar putea să vă placă și