On the power of built-in relations in certain classes of program schemes

We completely classify the relative expressibilities of the program schemes of NPS augmented with the built-in relations: linear order; addition; multiplication; and BIT. We employ pebble games allied with some number theory.


Introduction
One of the fundamental results of finite model theory is Immerman's characterization [10,11] of the complexity class NL (non-deterministic logspace) as the class of problems definable in transitive closure logic augmented with a built-in successor relation, (±TC) * [FO s ].Essentially, by "built-in successor relation" we mean that any sentence of the logic has access to a successor relation on the universe of the (finite) structure in which it is interpreted (and where this successor relation does not necessarily come as part of the structure).So that our sentences should define problems, i.e., sets of structures closed under isomorphism, we only ever consider the invariant sentences; that is, those sentences with the property that every (appropriate) structure either satisfies the sentence no matter which successor relation is chosen or it doesn't satisfy the sentence no matter which successor relation is chosen.Unfortunately, the property of being an invariant sentence is not decidable, even for first-order logic with a built-in successor relation [7], and so one should not really say that one has a truly "logical" characterization of NL.The general question of whether complexity classes such as NL and P (polynomial-time) actually possess "logical" characterizations is the subject of much research in finite model theory (see, for example, [5] and [13]).
Immerman proved yet more: he actually produced a normal form for the sentences of (±TC) * [FO s ].As observed in [14], this normal form result can be re-interpreted as a result about the expressive power of a very simple class of program schemes in the presence of a built-in successor relation.A program scheme of NPS takes a finite structure as input and is essentially a non-deterministic while-program with a constant number of variables, these variables taking values from the universe of the input structure, and where the tests in any while-instruction are quantifier-free first-order formulae (these are "poor tests", in the parlance of [12]; as opposed to "rich tests" which are first-order formulae).If we allow the program schemes of NPS to additionally have access to a built-in successor relation then we denote the resulting class of program schemes by NPS(succ).Re-interpreting Immerman's result yields a characterization of NL as the class of problems accepted by the program schemes of NPS(succ) (a similar result, though in a different context, was derived earlier in [8]).
The question arises as to whether this very simple class of program schemes NPS can be augmented with other different built-in relations so as to yield a characterization of NL; and it is this question that provides the initial motivation for this paper (other studies arising from similar motivations can be found in, for example, [6] and [15]).Our choice of other built-in relations to consider is influenced by what has been studied already in other contexts in finite model theory.In particular, in [1] it is proven that first-order logic augmented with the built-in relations ≤, a linear order, and BIT , a binary relation such that BIT (i, j) holds iff "the ith bit of the binary representation of the natural number j is 1", characterizes the complexity class AC 0 .As remarked in, for example, [2], this logic is equivalent to the extension of first-order logic with the built-in binary relation ≤ and the built-in ternary relations +, an addition, and ×, a multiplication.Hence, the four built-in relations we shall consider are succ, ≤, + and ×.In fact, we completely classify the relative expressibilities of the program schemes of NPS augmented with these built-in relations, as is depicted in Fig. 1 (a bold line joining two classes indicates that the upper class is more expressive than the lower class, and a dashed line that the classes are incomparable).
Whilst, admittedly, the scenario described above is rather esoteric, it turns out that as well as the above classification, we can actually obtain analogous classifications for both bounded-variable infinitary logic, L ω ∞ω , and its existential fragment, ∃L ω ∞ω .The logic L ω ∞ω features widely in finite model theory: for instance, transitive closure logic, least fixed point logic and partial fixed point logic are all fragments of L ω ∞ω (see, for example, [5]).The classification for extensions of ∃L ω ∞ω is exactly that in Fig. 1 with "NPS" replaced by "∃L ω ∞ω ", and "NL =" omitted.The classification for L ω ∞ω is as follows.
Our classifications follow from Proposition 5 where our basic methodology is to exhibit problems in certain program-scheme classes which are not definable in certain infinitary-logic classes, and to use the simple observation that a program-scheme class is a fragment of the analogous infinitary-logic class.
In order to prove our inexpressibility results for L ω ∞ω , we use well established pebble games.Let us remark that if we allow first-order tests in the program schemes of NPS, i.e.," rich tests", then we obtain a result identical to Theorem 1 except with "NPS" replacing "L ω ∞ω ".

Program schemes and logics
The reader is referred to [5] for details of any finite model theoretic concepts and notions not covered here.Any program scheme is defined to be over some fixed signature, with a signature τ being a finite tuple R 1 , . . ., R r , C 1 , . . ., C c , where each R i is a relation symbol, of some fixed positive arity d i , and where each C j is a constant symbol (function symbols are not allowed in our signatures).A program scheme ρ ∈ NPS(τ ) is a finite sequence of instructions of one of the following types): • atoms consist of: the variables {x i : i = 1, 2, . ..}; the constant symbols of τ ; and the constant symbols 0 and max (which we ensure do not occur in any signature) • assignment instructions are of the form: • var := atom, where var denotes some variable and atom some atom • guess(var), where var denotes some variable We denote the class of all structures over some signature τ by STRUCT(τ ).The interpretation of some program scheme ρ over τ in a τ -structure S of size n should be obvious except that we require: that the initial values (from |S|) of the input/output variables are given; that the constant symbols 0 and max are interpreted arbitrarily but differently in S (we assume all structures have size at least 2); and that any instruction guess(x i ) nondeterministically assigns some value of |S| to the variable x i .We say that ρ accepts S, and write S |= ρ if, and only if, with the input/output variables initially all set at 0, there exists a computation of ρ on input S such that ρ halts with the input/output variables all set at max.
As things stand, acceptance of a structure by a program scheme depends upon the interpretation of 0 and max, and as such is clearly unacceptable.We could remedy this situation by insisting that every structure S always comes with its own constants 0 and max; but this would force us to consider natural objects like graphs unnaturally, i.e., by supplying two additional distinguished vertices.We remedy this discrepancy by only ever considering certain program schemes.Henceforth, we only consider program schemes ρ for which the following is true: for every τ -structure S (where τ is the underlying signature of ρ) and for every 0, 0 , max, max ∈ |S| for which 0 = max and 0 = max , (S, 0, max) |= ρ iff (S, 0 , max ) |= ρ.That is, we only ever consider program schemes with 2 built-in constants.Consequently, the set of structures accepted by a program scheme ρ constitute a problem; that is, a set of finite structures, over some fixed signature, which is closed under isomorphism.We write NPS to denote the class of program schemes {ρ ∈ NPS(τ ) : τ some signature} (with the above proviso on each ρ), and also write NPS to denote those problems accepted by some program scheme of NPS (the same goes for other classes of program schemes defined later).
Just as we augmented program schemes with two built-in constants, so we can augment them with built-in relations.For example, to say that a program scheme has a built-in successor relation is to say that a program scheme has available: a binary relation succ that is always interpreted as a successor relation on the universe of an input structure, i.e., as a relation of the form {(u 0 , u 1 ), (u 1 , u 2 ), . . ., (u n−2 , u n−1 )}, where the input structure has size n; and also two constant symbols 0 and max that are always interpreted as the least and greatest elements of the successor relation, i.e., as u 0 and u n−1 , respectively.Just as before, we only ever consider those program schemes with a built-in successor relation which define problems, i..e, those program schemes ρ, over the signature τ , such that for every τ -structure S and for every pair of successor relations succ and succ (with associated "least" and "greatest constants"), (S, succ, 0, max) |= ρ iff (S, succ , 0 , max ) |= ρ.We denote the class of problems accepted by program schemes with a built-in successor relation as NPS(succ).
A built-in linear-order ≤ is defined as was a built-in successor, and we write ≤ (u, v) as u ≤ v; a built-in addition is defined by allowing a program scheme access to a ternary relation + that is always interpreted as an "addition" on the universe of some input structure, and we write +(u, v, w) as u + v = w; and a built-in multiplication is defined by allowing a program scheme access to a ternary relation × that is always interpreted as a "multiplication" on the universe of some input structure, and we write ×(u, v, w) as u × v = w.The built-in constants 0 and max are the least and greatest elements of the linear order ≤, addition + and multiplication ×, respectively.
We use pebble games to prove our separation results.Let τ be some signature.The k-pebble infinitary game on the τ -structures S and T is played by two players, Spoiler and Duplicator, as follows.The board consists of the two structures S and T , and there are k pairs of pebbles {p 1 , q 1 }, {p 2 , q 2 }, . . ., {p k , q k }.A move of the game consists of Spoiler picking up some pebble p i (resp.q i ), which may or may not have previously been played, and placing it on some element of |S| (resp.|T |): then Duplicator picks up pebble q i (resp.p i ) and places it on some element of |T | (resp.|S|).Spoiler wins after a move has been made if the substructure of S induced by the elements upon which pebbles are currently placed (and any constants) is not isomorphic to the substructure of T induced by the elements upon which pebbles are currently placed, where the isomorphism is that given by mapping the element of |S| upon which pebble p i is currently placed (if indeed it has been so placed) to that of |T | upon which pebble q i is currently placed and mapping a constant of S to the correspond-ing constant of T (also, if this mapping is not well-defined then Spoiler wins).The game may be infinite.We say that Duplicator has a winning strategy in the k-pebble infinitary game on S and T if no matter how Spoiler moves, Duplicator can prolong the game indefinitely (we prefer to leave the notion of a "winning strategy" intuitive rather than define it rigorously).
The k-pebble infinitary game classifies definability in the logic L k ∞ω , which is defined as follows: L k ∞ω is the fragment of the logic L ∞ω with at most k variables, where the logic L ∞ω is first-order logic where infinite conjunctions and disjunctions may be formed.Bounded-variable infinitary logic is defined as The existential fragment, ∃L ω ∞ω , of L ω ∞ω consists of all those formulae not involving the universal quantifier ∀.It is easy to see that NPS ⊆ ∃L ω ∞ω (and also in the presence of built-in relations).
Theorem 2 [3,9] Let τ be some signature and let S and T be τ -structures.The Duplicator has a winning strategy in the k-pebble infinitary game on S and T iff S and T agree on all sentences of L k ∞ω .Moreover, the Duplicator has a winning strategy in the restricted k-pebble infinitary game on S and T where Spoiler only ever plays in S iff S and T agree on all sentences of ∃L k ∞ω .
We close this section with some historical remarks.Program schemes were extensively studied in the seventies, without much regard being paid to resources, before a closer complexity analysis was undertaken in, mainly, the eighties (see [12] and the references therein).In the late eighties, program schemes were developed to work on finite structures [14], mindful of advances in descriptive complexity theory.We feel that the links between program schemes, logics for programs, dynamic logic, etc., and the logics studies in finite model theory, particularly those involving generalized quantifiers, have not been considered in the past as fully as they might have been, and that this is an interesting prospective area of research.PROOF.The following program scheme ρ ∈ NPS(≤) accepts BP:

Let
Consider the following winning strategy for Duplicator in the k-pebble Ehrenfeucht-Fraïssé game on (S, ×, 0, max) and (T, ×, 0, max).Write V S = {p k+2 , p k+3 , . . ., p 2k+2 }, V T = {p k+1 , p k+2 , . . ., p 2k+2 }, W S = |S| \ (U S ∪ V S ) and • If Spoiler plays on an unpebbled element in U S (resp.U T , V S , V T ) then Duplicator plays on an unpebbled element in U T (resp.U S , V T , V S ).• If Spoiler plays on a pebbled element in U S (resp.U T , V S , V T ) then Duplicator plays on the corresponding pebbled element in U T (resp.U S , V T , V S ).(iii ) and (iv ) The problem ODD consisting of all those structures of odd size over the empty signature τ is in NPS(succ) and NPS(+).A simple Ehrenfeucht-Fraïssé game on two sufficiently large τ -structures S n and S n+1 , the first of odd size n and the second of even size n + 1, yields that ODD ∈ ∃L ω ∞ω (≤) (take the natural linear orders in S n and S n+1 , and let Duplicator's winning strategy be given by the function f : |S n | → |S n+1 | defined as f : i → i, for all i ∈ {0, 1, . . ., n − 2}, and f (n − 1) = n).(v ) The problem PERF1 consisting of all those structures over the signature τ whose size is 1 plus a perfect square is in NPS(×).Let p be a sufficiently large even number.A simple Ehrenfeucht-Fraïssé game on two τstructures S p 2 +1 and S 2p 2 +1 of sizes p 2 + 1 and 2p 2 + 1, respectively, yields that PERF1 ∈ ∃L ω ∞ω (+) (take the natural additions in S p 2 +1 and S 2p 2 +1 , and let Duplicator's winning strategy be given by the function f : |S p 2 +1 | → |S 2p 2 +1 | defined as f : i → 2i).(vi ) The problem ODD is in NPS(+).A simple Ehrenfeucht-Fraïssé game on two τ -structures S 3 and S 4 of sizes 3 and 4, respectively, yields that any problem in ∃L ω ∞ω (×) which contains S 3 must contain S 4 (take the natural multiplications in S 3 and S 4 and the natural linear orders in S 3 and S 4 , and let Duplicator's winning strategy be given by the function f : the signature τ = U, E, C, D , where U is a unary relation symbol, E is a binary relation symbol and C and D are constant symbols.Define the problem BP as consisting of all those τ -structures such that there is a path in the digraph described by E from vertex C to vertex D of length at most ν, where ν = |{u : U (u) holds}|.Theorem 3 BP ∈ NPS (≤) \ L ω ∞ω (×).
• test instructions are of the form WHILE t DO i 1 , i 2 , . . ., i k OD, for some k ≥ 0 and instructions i 1 , i 2 , . . ., i k , where t is a boolean combination of boolean tests, or their negations, of the form: • y 1 = y 2 , where y 1 and y 2 are atoms • R(y 1 , y 2 , . . ., y d ), where R is a d-ary relation symbol of τ and y 1 , y 2 , . . ., y d are atoms • input/output instructions are of the form input(x 1 , x 2 , . . ., x m ) and output (x 1 , x 2 , . . ., x m ), where x 1 , x 2 , . . ., x m are the input/output variables.The first (resp.last) instruction of any program scheme is the input (resp.output) instruction, and any program scheme has exactly one input and one output instruction.Also, the input/output variables are exactly those variables involved in any program scheme.Without loss of generality, we may assume that there is available an IF . . .THEN . . .(ELSE . ..)FI instruction (see [14]).A program scheme over the signature τ = R 1 , . . ., R r , C 1 , . . ., C and with each R S i ⊆ |S| d i and each C S j ∈ |S|: we also write |S| to denote the size n of S (this causes no confusion; and nor does our choice of leaving out superscripts denoting the structure in which a relation symbol, etc., is interpreted).