Upper Bounds for a Theory of Queues

We prove an upper bound result for the first-order theory of a structure W of queues, i.e. words with two relations: addition of a letter on the left and on the right of a word. Using complexity-tailored Ehrenfeucht games we show that the witnesses for quantified variables in this theory can be bound by words of an exponential length. This result, together with a lower bound result for the first-order theory of two successors [6], proves that the first-order theory of W is complete in LATIME(2O(n)): the class of problems solvable by alternating Turing machines running in exponential time but only with a linear number of alternations.