First-order concatenation theory with bounded quantifiers

We study first-order concatenation theory with bounded quantifiers. We give axiomatizations with interesting properties, and we prove some normal-form results. Finally, we prove a number of decidability and undecidability results.


Concatenation theory versus number theory
First-order concatenation theory can be compared to first-order number theory, e.g., Peano Arithmetic or Robinson Arithmetic. The universe of a standard structure for first-order number theory is the set of natural numbers. The universe of a standard structure for first-order concatenation theory is the set of finite strings over some alphabet. A first-order language for number theory normally contains two binary functions symbols. In a standard structure these symbols will be interpreted as addition and multiplication. A first-order language for concatenation theory normally contains just one binary function symbol. In a standard structure this symbol will be interpreted as the operator that concatenates two stings. A classical first-order language for concatenation theory-like e.g. the ones studied in Quine [19] and Grzegorczyk [5]-contains no other non-logical symbols apart from constant symbols.
We will stick to a version of concatenation theory where we have a binary alphabet consisting of the bits zero and one, and we will refer to this version as bit theory. It is convenient to introduce and explain some notation before we continue our discussion.

Notation and terminology
We will use 0 and 1 to denote respectively the bits zero and one, and we use pretty standard notation when we work with bit strings: {0, 1} * denotes the set of all finite bit strings; |α| denotes the length of the bit string α; (α) i denotes the ith bit of the bit string α; and 01 3 0 2 1 denotes the bit string 0111001. The set {0, 1} * contains the empty string which we will denote ε.
The language L − BT of first-order bit theory consists of the constant symbols e, 0, 1 and the binary function symbol •. We will use B − to denote the standard L − BTstructure: The universe of B − is the set {0, 1} * . The constant symbol 0 is interpreted as the string containing nothing but the bit 0, and the constant symbol 1 is interpreted as the string containing nothing but the bit 1, that is, 0 B − = 0 and 1 B − = 1. The constant symbol e is interpreted as the empty string, that is, e B − = ε. Finally, • B − is the function that concatenates two strings (e.g. 01• B − 000 = 01000 and ε • B − ε = ε).

Decidability and undecidability
At a first glance the parsimonious language of first-order bit theory does not seem very expressive, but a little bit of thought shows otherwise. Observe that we can encode a sequence a 1 , a 2 , . . . , a n of natural numbers by the bit string 00101 a 1 +1 001101 a 2 +1 001 3 01 a 3 +1 00 . . . 001 n 01 a n +1 00.
Furthermore, we can state that a string is a substring of another (the formula ∃uv [(u • x) • v = y] holds in B − iff x is a substring of y). We can state that a string contains only ones (the formula ¬∃uv[(u • 0) • v = x] holds in B − iff x contains only ones, and so does the the formula x • 1 = 1 • x). We can state that a bit string does not contain two consecutive occurrences of zeros, and so on. If we proceed along these lines, we can come up with a formula φ(x, y, z) such that φ (1 i , 1 a , α) is true in B − iff α encodes a sequence of natural numbers where the i th element is a. The reader interested in the details should consult Section 8 of Leary and Kristiansen [15].
First-order bit theory is indeed expressive enough to code and decode sequences of natural numbers, and then it should be no surprise that the following theorem holds. e.g., it is straightforward to prove the theorem by induction over a Kleene-recursive definition of f . Theorem 1 (Definability of computable functions) For any (partially) computable function f : N n → N there exists an L − BT -formula φ(x 1 , . . . , x n , y) such that f (a 1 , . . . , a n ) = b ⇔ B − | φ(1 a 1 , . . . , 1 a n , 1 b ).
Moreover, given a definition of the function, we can compute the formula.
This theorem implies that it is undecidable if an L − BT -sentence is true in the standard structure B − . It is of course also undecidable if a sentence of first-order number theory is true in its standard structure N. Indeed, due to the negative solution of Hilbert's 10th problem (the Davis-Putnam-Robinson-Matiyasevich Theorem), it is even undecidable if a sentence of the form is true in N. The bit-theoretic version of Hilbert's 10th problem turned out to have a positive solution. The next theorem is just a reformulation of a result of Makanin [16].
Hence, it is in general undecidable if a sentence is true in B − , but it is decidable if a sentence of the form ∃x 1 , . . . x n [s = t] is true in B − . This raises the question: where do we find the border between the decidable and the undecidable? For which subclasses of formulas can we, or can we not, decide truth in the standard structure? Such a question yields an obvious motivation for introducing bounded quantifiers similar to those we know from number theory. Once the bounded quantifiers are there, a number of other questions will knock at the door.

Bounded quantifiers and 6-formulas
The first-order language L BT is L − BT extended by a binary relation symbol . We introduce the bounded existential quantifier (∃x t)φ and bounded universal quantifier (∀x t)φ as shorthand notations for respectively Next we define the Σ-formulas inductively by φ and ¬φ are Σ-formulas if φ is of the form s t, or of the form s = t, where s and t are terms -(φ ∨ ψ) and (φ ∧ ψ) are Σ-formulas if φ and ψ are Σ-formulas -(∃x t)φ and (∀x t)φ and (∃x)φ are Σ-formulas if φ is a Σ-formula, t is a term and x is a variable not occurring in t. A purely existential formula is a Σ-formula that does not contain bounded universal quantifiers.
We assume that the reader notes the similarities with first-order number theory. The formulas that correspond to Σ-formulas in number theory are often called Σ 1formulas or Σ 0 1 -formulas. Now, in contrast to in number theory, it is not clear how the relation symbol that defines the bounded quantifiers should be interpreted. In the standard model for number theory the relation symbol should obviously be interpreted as the standard ordering relation of the natural numbers. There do not seem to be any other natural options. We can chose between the less-than or less-than-or-equal-to relation over the natural numbers, and that is it. In bit theory a number of essentially different interpretations will make sense. We might interpret x y as x is a substring y, x is a prefix of y, x is shorter than y.
The three interpretations listed above are the ones that will be investigated in the current paper, but there are definitely other interesting options. We might, e.g., interpret as the subword relation investigated in Halfon et. al. [8], or as a lexicographical ordering relation.

More on notation and terminology
We reserve the letter B for the structure where is the substring relation, that is, The L BT -structure D is the same structure as B with one exception: the relation α D β holds iff α is a prefix of β, that is, iff there exists γ ∈ {0, 1} * such that αγ = β.
The L BT -structure F is the same structure as B with one exception: the relation α F β holds iff the number of bits in α is less than or equal to the number of bits in β, that is, iff |α| ≤ |β|.
To improve the readability we will use the symbol in place of the symbol in formulas that are meant to be interpreted in the structure D. Thus, x y should be read as "x is a prefix of y". Similarly, we will use in formulas that are meant to be interpreted in F, and x y should be read as "x is shorter than y". We will continue to use the symbol in formulas that are meant to be interpreted in B. Thus, x y should be read as "x is a substring of y".
We may skip the operator • in first-order formulas and simply write st in place of s • t, and we will of course also skip parentheses in terms whenever this is not likely to cause confusion. Furthermore, we will occasionally contract quantifiers and write, e.g., (∀x y z) [φ] in place of (∀x z)(∀y z)φ, and for ∼ ∈ { , , , =}, we will normally write s t in place of ¬s ∼ t.
Recall that a sentence is a formula with no free variables.

References and related research
Formal concatenation theory can be traced back to Tarski [23] and Hermes [9] (see [20] for an English review). Quine [19] and Corcoran et al. [2] are also papers on the subject which may have some historical interest. A rather recent line of research in concatenation theory has focused on interpretablity between weak first-order theories and essential undecidability. Grzegorczyk [5], Grzegorczyk and Zdanowski [6], Svejdar [22], Visser [24], Horihata [11] and Higuchi and Horihata [10] belong to this line. Another recent line of research has focused on word equations and formal languages. Papers in this line, like e.g., Karhumäki et al. [12], Ganesh et al. [4], Halfon et al. [8] and Day et al. [3], are in general oriented towards theoretical computer science. Both lines are related to our research: the former to the first-order theories we present in Sect. 2, the latter to the results we present in last two sections. More on the history of concatenation theory can be found in Visser [24]. The present paper is a significantly extended and improved version of the conference paper Kristiansen and Murwanashyaka [13]. We assume that the reader is familiar with the basics of mathematical logic and computability theory. An introduction can be found in Leary and Kristiansen [15] (Chapter 8 contains some material on concatenation theory). Some familiarity with first-order arithmetic will probably also be beneficial to the reader. An introduction can be found in Hajek and Pudlak [7].

6-complete axiomatizations
Once the bounded quantifiers are present, it is natural to ask if we can find neat and natural Σ-complete axiomatizations of bit theory. Corresponding axiomatizations of number theory, e.g. Robinson Arithmetic, have been of great importance in logic. In this section we will give finite sets of axioms that are Σ-complete with respect to our different structures (B, D and F). These axiomatizations might serve as base theories which can be extended with, e.g., collection principles or induction schemes of the form

The theory B −
B − is an L − BT -theory. All the first-order theories we will present contain the axioms of B − .

Definition 1
The first-order theory B − contains the following four non-logical axioms: We will use B − i to refer to the ith axiom of B − .
Proof We prove the lemma by induction on the length of β, and we consider the following cases: β ≡ ε, β ≡ γ 0 and β ≡ γ 1.
Proof We will use induction on the structure of t. Assume t ≡ e. Obviously, B − e = e. Thus, we have Proof We prove the lemma by induction on the natural number min(|α|, |β|). Assume min(|α|, |β|) = 0. Then, either α or β will be the empty string ε. Furthermore, it cannot be the case that both α or β are the empty string as α = β. By Lemma 3, we We leave the proof of the next theorem to the reader (see the proof of Theorem 4).

The structure B
Definition 2 The first-order theory B contains the following eleven non-logical axioms: -the first four axioms are the axioms of We will use B i to refer to the ith axiom of B.
In the cases when β is empty or just contains a single bit, the lemma holds by B 5 , Assume β ≡ 0γ 0. The proof splits into the cases In case (i), we have B α = β by logical axioms. By B 8 , we have B α β. In case (ii), the induction hypothesis yields B α 0γ . By B 8 , we have B α β. In case (iii), the induction hypothesis yields B α γ 0. By B 8 , we have B α β.
Proof The proof of this lemma is symmetric to the proof of Lemma 5, and we omit the details.

Proof
We proceed by induction on the length of α. We will consider the cases α ≡ ε, By (*) and the induction hypothesis, we have .
The case α ≡ 0β1, the case α ≡ 1β0 and the case α ≡ 1β1 are handled similarly using B 9 , B 10 and B 11 , respectively, in place of B 8 .

Theorem 4 (Σ-completeness of B) For any Σ-sentence φ, we have
Proof We prove the theorem by induction on the structure of the Σ-sentence φ. The base cases are φ ≡ s = t, φ ≡ s = t, φ ≡ s t and φ ≡ s t (where s and t are variable free). We attend to the case φ ≡ s t. So assume φ ≡ s t. Furthermore, assume B | s t. By Lemma 2, we have α, β ∈ {0, 1} * such that By the Soundness Theorem for first-order logic, we have α B β. By Lemma 5, we have B α β. By (*), we have B s t. This proves that the theorem holds We turn to the inductive cases. Let φ ≡ (ψ ∧ ξ). Assume B | ψ ∧ ξ . Then we have B | ψ and B | ξ . By the induction hypothesis, we have B ψ and B ξ .
By the Soundness Theorem of first-order logic, we have Our induction hypothesis yields . This completes the case where φ is of the form (∀x t)ψ(x). We leave the case φ ≡ (∃x t)ψ(x) to the reader.

Definition 3
The first-order theory D contains the following seven non-logical axioms: -the first four axioms are the axioms of We will use D i to refer to the ith axiom of D.
Proof This proof is symmetric to the proof of the next lemma. We omit the details.
Proof We prove the lemma by induction on the length of β, and we consider the cases β ≡ ε, β ≡ γ 0 and β ≡ γ 1.
Assume β is empty. Then α is not empty. By Lemma 4, we have D α = e. By axiom D 5 , we have D α e. Thus, D α β. Assume β ≡ γ 0. Then we have α = γ 0 and α D γ . By our induction hypothesis, we have D α γ . By Lemma 4, we have D α = γ 0. By axiom D 6 , we have D α γ 0. The case where β is of the form γ 1 is similar. Apply axiom D 7 in place of D 6 .
Proof We prove the lemma by induction on the length of α, and we consider the cases α ≡ ε, α ≡ β0 and α ≡ β1.
The case α ≡ β1 is similar to the preceding case. Use D 7 in place of D 6 .
Proof Given the lemmas above, we can more or less just repeat the proof of Theorem 4. Use Lemma 8 in place of Lemma 5, Lemma 9 in place of Lemma 6 and Lemma 10 in place of Lemma 7.

The structure F
Definition 4 The first-order theory F contains the following eleven non-logical axioms: -the first four axioms are the axioms of We will use F i to refer to the ith axiom of F.
Proof We prove this lemma by induction on the length of α, and we consider the cases α ≡ ε, α ≡ α 0 and α ≡ α 1.
This proves the case α ≡ α 0. The proof when α ≡ α 1 is similar. Use F 9 and F 10 , respectively, in place of F 7 and F 8 .
Proof We prove this lemma by induction on the length of β, and we consider the cases β ≡ ε, β ≡ β 0 and β ≡ β 1.
First we deal with case α ≡ ε. The axiom F 6 says that Thus, we have We will now turn to the inductive case α ≡ γ 0. In this case it is sufficient to prove as it follows from (1), (2), (3) and the axiom F 11 that Our induction hypothesis yields It is trivial that (1) holds. This is a logical truth which holds in any model. We do not need any of our non-logical axioms to prove (1). Let us turn to the proof of (2). We reason in an arbitrary model for F. Assume x = y0 and x γ 0. We need to argue that Finally, we observe that ( ‡) implies ( †). This proves (2). The proof of (3) is symmetric to the proof of (2). Use the axiom F 9 in place of F 7 . This completes the proof for the case α ≡ γ 0. The case α ≡ γ 1 is symmetric. Use the axioms F 8 and F 10 , respectively, in place of F 7 and F 9 .
Proof Given the lemmas above, we can more or less just repeat the proof of Theorem 4. Use Lemma 11 in place of Lemma 5, Lemma 12 in place of Lemma 6 and Lemma 14 in place of Lemma 7.
Both B and D are open theories (all the axioms are purely universal statements) whereas F is not. The axiom F 11 contains an existential quantifier. Can we find a purely universal set of axioms that is Σ-complete with respect to the model F? Yes, we can. We can regard Lemma 13 as an axiom scheme. Then we do not need F 11 to achieve Σ-completeness.
Definition 5 Let F be the first-order theory F where the axiom F 11 is replaced by the scheme Proof Proceed as in the proof of Theorem 6. Since the axiom scheme is present, F 11 will not be needed anymore.

Normal form theorems
After we have endowed bit theory with bounded quantifiers, it becomes natural to search for normal forms and see if we can prove normal form theorems similar to the ones we know from number theory. Some lemmas (15,17,18) in this section can be found elsewhere, e.g., in Büchi and Senger [1], Senger [21] and Karhumäki et al. [12]. We have given complete proofs below in order to make our paper self-contained (the proofs we give do not differ essentially from those given in Büchi and Senger [1]).
The next lemma shows that conjunctions of equations can be replaced by a single equation.
The next two lemmas show that disjunctions of equations can be replaced by a single equation at the price of some more existential quantifiers.

Lemma 16
Let s 1 , s 2 , t 1 , t 2 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof Let x 1 , . . . , x 6 be variables that do not occur in any of the terms s 1 , s 2 , t 1 , t 2 . It is not very hard to see that the formula s 1 t 1 ∨ s 2 t 2 is D-equivalent to the formula We will show that the disjunction in (*), that is x 2 = e ∨ x 5 = e, can be replaced by a formula where v 1 , v 2 , v 3 , v 1 , v 2 , v 3 are terms. Thus, by Lemma 15 which allow us to merge conjunctions of equations, (*) will be equivalent to a formula of the form and our proof will be complete. Let ψ(u, w) be the formula ∃y 1 y 2 y 3 y 4 [ y 1 y 2 = 0 ∧ y 3 y 4 = 1 ∧ uy 1 wy 2 = wy 2 uy 1 ∧ uy 3 wy 4 = wy 4 uy 3 ].
We claim that We prove (**). Assume that u = e ∨ w = e (we reason in B − ). Let us say that u = e (the case when w = e is symmetric). It is obvious that we have uw = wu. Moreover, ψ(u, w) holds with y 1 = y 3 = e, y 2 = 0 and y 4 = 1. This prove the left-right implication of (**).
To see that the converse implication holds, assume that ¬(u = e ∨ w = e), that is, both u and w are different from the empty string. Furthermore, assume that uw = wu. We will argue that ψ(u, w) does not hold: Since uw = wu and both u and w contain at least one bit, it is either the case that 0 is the last bit of both strings, or it is that case that 1 is the last bit of both strings. If 0 is the last bit of both, the two equations uy 3 wy 4 = wy 4 uy 3 and y 3 y 4 = 1 cannot be satisfied simultaneously. If 1 is the last bit of both, the two equations uy 1 wy 2 = wy 2 uy 1 and y 1 y 2 = 0 cannot be satisfied simultaneously. Hence we conclude that ψ(u, w) does not hold. This completes the proof of (**).
Karhumäki et al. [12] prove that the next lemma indeed holds with k = 2.

Lemma 17
Let s 1 , s 2 , t 1 , t 2 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof Observe that s 1 = t 1 ∨ s 2 = t 2 is D-equivalent to which again is (logically) equivalent to By Lemmas 15 and 16, we have terms s, t and variables v 1 . . . v k such that Thus, the lemma holds as we are dealing with a L − BT -formula. Next we show that negated atomic formulas can be replaced by an equations if we add existential quantifiers.
Lemma 18 Let s 1 , t 1 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof Observe that the formula s = t is B − -equivalent to the formula Thus, the lemma follows from Lemmas 17 and 15.

Lemma 19
Let s 1 , t 1 be L BT -terms. There exist L BT -terms s, t and variables v 1 , . . . , v k such that Proof The formula s 1 t 1 is D-equivalent to the formula Thus, the lemma follows from the preceding lemmas.
We are now ready to prove our normal form theorems.

Theorem 8 (Normal form theorem for D) Any Σ-formula φ is D-equivalent to an L BT -formula of the form
where t 1 , . . . , t m are L BT -terms and Q t j j v j ∈ {∃v j , ∃v j t j , ∀v j t j } for j = 1, . . . , m. Moreover, if φ is a purely existential formula, then Q t j j v j is ∃v j .
Proof We proceed by induction on the structure of the Σ-formula φ (throughout the proof we reason in the structure D). Assume φ ≡ s t. Then φ is equivalent to a formula of the form ∃x[sx = t] and the theorem holds. Assume φ ≡ s t. Then the theorem holds by Lemma 19. Assume φ ≡ s = t. Then the theorem holds by Lemma 18. The theorem holds trivially when φ is of the form s = t.
Suppose φ is of the form (ψ ∧ ξ). By our induction hypothesis, we have formulas which are equivalent to respectively ψ and ξ . Thus, φ is equivalent to a formula of the form By Lemma 15, we have a formula of the desired form which is equivalent to φ. The case when φ is of the form (ψ ∨ ξ) is similar. Use Lemma 17 in place of Lemma 15. The theorem follows trivially from the induction hypothesis when φ is of one of the forms (∃v)ψ, (∀v t)ψ and (∃v t)ψ.
If φ is a purely existential formula, there will be no bounded universal quantifiers among Thus, φ is equivalent to a formula of the form which again is equivalent to a formula of the form By Lemma 15, we can conclude that any purely existential formula is equivalent to a formula of the form ∃v 1 . . . v m [s = t].
Theorem 9 (Normal form theorem for F) Any Σ-formula φ is F-equivalent to a L BTformula of the form where Q j ∈ {∃, ∀} for j = 1, . . . , m. Moreover, if φ is a purely existential formula, then φ is equivalent to a formula of the form Proof We prove the theorem by induction on the structure of the Σ-formula φ (throughout the proof we reason in the structure F). Assume φ ≡ s t. Then φ is equivalent to a formula of the form (∃x t)[x = s], and the theorem holds. Assume φ ≡ s t.
Then φ is equivalent to t • 0 s, and thus also equivalent to a formula of the form (∃x s)[x = t • 0]. Hence the theorem holds. Furthermore, the theorem holds by Lemma 18 when φ ≡ s = t, and the theorem holds trivially when φ ≡ s = t.
The two inductive cases φ ≡ (ψ ∧ ξ) and φ ≡ (ψ ∨ ξ) are similar to the corresponding cases in the proof of Theorem 8 (normal form theorem for D).
Thus, any Σ-formula is F-equivalent to a Σ-formula that contains maximum one unbounded existential quantifier.
If φ is a purely existential formula, then Q 1 , . . . , Q m will all be existential quantifiers. Thus, any purely existential formula is equivalent to a formula of the form It is not true that any purely existential formula is F-equivalent to a formula of the form ∃x 1 . . . x n [s = t]. This follows from the results in Karhumäki et al. [12]. E.g., a formula like x y ∧ y x which states that the length of x equals the length of y, is not F-equivalent to a formula of the form ∃x 1 . . . x n [s = t]. See Example 27 in Section 6 of [12].

Lemma 20 Let s 1 , t 1 be L BT -terms. There exist L BT -terms s, t and variables
If we let vs 1 t 1 abbreviate ∃x[vs 1 x = t 1 ], then α can be written as vs 1 t 1 . Thus, the lemma follows by Lemma 19.

Theorem 10 (Normal Form Theorem for B) Any Σ-formula φ is B-equivalent in to a L BT -formula of the form
where Q j ∈ {∃, ∀} for j = 1, . . . , m.
Proof Proceed by induction on the structure of the Σ-formula φ. This proof is similar to the proof of Theorem 9 (normal form theorem for F). If φ is of form s t, then φ is B-equivalent a formula of the form ∃x 1 x 2 [x 1 sx 2 = t]. If φ is of the form s t, then Lemma 20 says that φ is B-equivalent to a formula of the form (∀v 1 t 1 )∃v 2 . . . v k [s = t]. The remaining cases of the inductive proof are similar to their respective cases in the proof of Theorem 9.
We have not been able to find an interesting normal form for purely existential formulas in B which is stronger than the one for Σ-formulas. It follows form the results in Karhumäki et al. [12] that the relation x B y cannot be defined in the structure B − by a purely existential formula: By Theorem 16 in [12], it is not possible to define the language L = { α | α ∈ {0, 1} * and 101 B α } by a word equation. If we could define x B y in B − by a purely existential formula, then it would have been possible to define L by a word equation. We refer the reader to the paper itself for further details as Theorem 16 is a rather involved statement.
Since it is not possible to define x B y in B − by a purely existential formula, the normal form theorem for purely existential formulas in D (Theorem 8), will for sure be false with respect to B. So will the normal form theorem for purely existential formulas in F (Theorem 9).

Fragments
Let us start to track the border between the decidable and the undecidable. On the one hand, we have Makanin's result (Theorem 2). We know that it is decidable if a sentence of the form ∃x 1 . . . x n [s = t] holds in the standard model. We also know that any purely existential formula is D-equivalent to formula of this form. On the other hand, it is not very hard to prove a stronger version of Theorem 1: Theorem 11 (Σ-definability of computable functions) For any (partially) computable function f : N n → N there is a Σ-formula φ(x 1 , . . . , x n , y) such that f (a 1 , . . . , a n ) = b ⇔ D | φ(1 a 1 , . . . , 1 a n , 1 b ).

Moreover, given a definition of the function, we can compute the formula.
With some effort, the interested reader should be able to accomplish a proof of this theorem. The theorem implies that it is undecidable if a Σ-sentence holds in D. It is easy to define the relations D and D by Σ-formulas in the structures B and F, and the bounded quantifiers of D can be expressed by Σ-formulas in in B and F, e.g., if Thus Theorem 11 also implies that it undecidable if a Σ-sentence holds in B or F.
In order to gain further insight into what we can-and cannot-decide in bit theory, we need to keep track of the number and the type of quantifiers that appear in our Σ-formulas. We will say that a Σ-formula is a Σ n,m,k -formula if it contains n unbounded existential quantifiers, m bounded existential quantifiers and k bounded universal quantifiers. The fragment Σ A n,m,k is the set of Σ n,m,k -sentences that are true in the L BT -structure A. The (purely existential) fragment ∃ A is the set of purely existential sentences that are true in the L BT -structure A (recall that a purely existential formula is a Σ-formula with no occurrences of bounded universal quantifiers). A Δ-formula is a Σ-formula that contain no unbounded existential quantifiers, and the fragment Δ A is the set of Δ-sentences that are true in the L BT -structure A. Note that

Theorem 12
The fragments Δ D , Δ B and Δ F are decidable.
Proof We prove that Δ B is decidable. Let φ be a Δ-formula. The negation of a Δ-formula is logically equivalent to a Δ-formula (use De Morgan's laws). We can compute a Δ-formula φ which is logically equivalent to ¬φ. By Theorem 4, we have The set of formulas deducible from the axioms of B is computably enumerable. Hence it is decidable if φ is true in B.
We can prove that the fragments Δ D and Δ F are decidable in the same way as we also have Σ-complete axiomatizations for both D and F.
In some sense, we kill a fly with a hammer when we use Σ-completeness to prove the preceding theorem. It can of course be checked by brute-force algorithms if Δsentences are true in the structures D, B and F.

Theorem 13
The fragment ∃ D is decidable.
Proof Theorem 8 states that any purely existential formula φ is D-equivalent to a formula of the normal form ∃v 1 . . . v m [s = t]. Our proofs show that there is an algorithm for transforming φ into this normal form. Thus the theorem follows by Makanin's result (Theorem 2).

Problem 1 Is the fragment ∃ B decidable?
Problem 2 Is the fragment ∃ F decidable?
The authors have tried, without success, to solve these problems. We have no conjectures to offer.

The Modulo Problem
In [13] we use the Post's Correspondence Problem (Post [18]) to prove that the fragments Σ D 3,0,2 , Σ D 4,1,1 , Σ B 1,2,1 and Σ B 1,0,2 are undecidable. We will improve these results considerably in the next section. In this section we introduce an undecidable problem that is especially tailored for our needs in that respect, that is, an undecidable problem that makes the proofs in next section smooth and transparent. In lack of a better name, we dub the problem the Modulo Problem. We assume that the reader is familiar with modulo arithmetic and elementary number theory. We use f N to denote the N th iteration of an unary function f , that is, N (x)).

Definition 6 The Modulo
The undecidability of the Modulo Problem follows from the existence of a certain type of Collatz functions constructed in Kurtz and Simon [14]. We will spend the rest of this section to explain why the problem is undecidable.
We will work with the counter machines introduced by Minsky [17]. These machines are also known as register machines or Minsky machines. A counter machine consists of -a finite number of registers X 1 , . . . X n -a finite number of instructions I 1 , . . . , I m .
The registers store natural numbers. The instructions tell the machine how to manipulate these numbers. The machine starts by executing the instruction I 2 . Each resister stores 0 when the execution starts (our counter machines do not take input). The instruction I 1 is the unique halting instruction. This instruction does not modify any register, and the machine halts if and only if this instruction is executed. Each of the the remaining instructions I 2 , . . . , I m will either be an increment instruction or a decrement instruction. An increment instruction I i is of the form I i : X j , I k . The instruction tells the machine to increment the natural number stored in the register X j by one and then proceed with instruction I k . A decrement instruction I i is of the form I i : X j , I k , I . The instruction tells the machine to decrement the natural number stored in the register X j by one if this is possible, that is, if the number is strictly greater than zero. If it is possible to decrement the number, the machine will proceed with instruction I k ; if it is not possible, the machine will proceed with instruction I . We assume that we have i = k in any increment instruction and i / ∈ {k, } in any decrement instruction (this makes it easier to see that some of the arguments below indeed are correct).
It is well known that it is undecidable if a counter machine that starts with every register set to zero will terminate with every register set to zero. Kurtz and Simon [14] simulate counter machines by FracTran programs. A FracTran program f is a finite sequence q 1 , . . . , q s of non-negative rational numbers. The transition function F f for the FracTran program f maps the natural number x to q i x where i is the least i such that q i x is integral. If no such i exists, we regard F f (x) as undefined.
Following Kurtz and Simon [14], we will show how we given a counter machine M can construct a FracTran program f M such that there exists N such that F N f M (3) = 2 iff M terminates with every register set to zero. Let p i denote the ith prime ( p 1 = 2).
The execution of a counter machine can be viewed as a sequence of configurations of the form a 1 , a 2 , . . . , a n where I i is the instruction to be executed next and a 1 , a 2 , . . . , a n , respectively, are the numbers stored in the registers X 1 , . . . X n . We represent a configuration by a natural number of the form p i p a 1 m+1 p a 2 m+2 . . . p a n m+n .
where i ≤ m. Let f M be a FracTran program q 1 , . . . , q s such that (1) for each increment instruction I i : X j , I k of M's, there is t such that q t = p k p m+ j / p i (2) for each decrement instruction I i : X j , I k , I of M's, there is t such that q t = p k / p i p m+ j and q t+1 = p / p i (3) q 1 , . . . , q s is a minimal sequence that satisfies (1) and (2) (so no sequence of length s − 1 will satisfy (1) and (2)).
Let us make some observations. Let I i be the increment instruction I i : X j , I k . Then p k p m+ j / p i is the one and only q t in the sequence q 1 , . . . , q s such that q t p i p a 1 m+1 . . . p a n m+n is integral. Let I i be the decrement instruction I i : X j , I k , I and assume that X j stores a j > 0. Now there are exactly two rationals r in the sequence q 1 , . . . , q s such that r p i p a 1 m+1 . . . p a n m+n is integral. These two rationals are p k / p i p m+ j and p / p i . Since p k / p i p m+ j occur before p / p i , we have If I i is the decrement instruction I i : X j , I k , I and X j stores 0, then p / p i is the only q t in the sequence that makes q t p i p a 1 m+1 . . . p a n m+n integral, and we have F f M p i p a 1 m+1 . . . p a n m+n = p p a 1 m+1 . . . p a n m+n .
Any counter machine starts in the configuration I 2 , 0, 0, . . . , 0 (our counter machines do not take input and every register stores zero when the execution starts). This start configuration is represented by the prime p 2 , that is, 3. If a counter machine halts with every register set to 0, it halts in the configuration I 1 , 0, 0, . . . , 0. This configuration is represented by the prime p 1 , that is, 2. Given the observations above, it should be obvious that there exists N such that F N f M (3) = 2 if and only if M halts with every register set to 0. Thus, we conclude that it is undecidable if there exists N such that F N f M (3) = 2. A Collatz function is a function C : N → N that can be written of the form where a i , b i ∈ Q and M ∈ N (for more on Collatz functions and the related Collatz problem, see [14]). Following the ideas of Kurtz and Simon [14], we will now construct a Collatz function C M of the more restricted form This completes the construction of C M . Many of the rationals in the sequence a 0 , a 1 , . . . , a M−1 might still not be defined when the procedure terminates, but that is not important to us. The following claim is what matters to us: In order to see that our claim holds, assume that F f M (x) = q i x. Then, we know that q i x ∈ N and that q x / ∈ N when < i. Let x = z M + j where j < M and let c i /d i = q i where c i and d i are relatively prime. Then, we have if there exists j < M such that x = z M + j. It is easy to see that there is N such that f N (3) = 2 if and only if there exists a bit string of the form where a 0 = 3 and a N = 2 -for each i ∈ {0, . . . , N − 1} there is z ∈ N and j < M such that The challenge is to claim the existence of a bit string x of the form (*) by using as few quantifiers as possible. We will of course need one unbounded existential quantifier just to say that a string x is there. Then we will need some quantifiers to state that x is of the desired form. In the structure D, we will state that any prefix of x of the form y01 can be extended to a prefix of x of the form claims the existence of a bit string of the form (*). The formula contains two unbounded existential quantifiers and one bounded universal quantifier. If we could decide if such a formula is true in D, then we could decide the Modulo Problem. Hence, Σ D 2,0,1 is an undecidable fragment.
Similar reasoning will show that the fragments Σ B 1,0,1 and Σ F 1,3,2 are undecidable. The details can be found below. Note that ξ j (y, x) is trivially equivalent to a Σ 0,0,0 -formulaξ j (y, x). Let φ be the Then B | φ if and only if the instance has a solution. There is an algorithm for constructing φ from the instance, and thus we conclude that Σ B 1,0,1 is undecidable. We are left to prove that Σ F 1,3,2 is undecidable. The following formula does to job: Thus, (ii) and (iii) hold by Lemmas 17 and 18.
Acknowledgements Open Access funding provided by University of Oslo (incl Oslo University Hospital).
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.