We consider the decidability problem of verifying formulas in SL. We show that when there are several function symbols \(b_j\) to sum over, the satisfiability problem for SL becomes undecidableFootnote 2. We first present, however, a useful decidable fragment of SL.
4.1 A Decidable Fragment of SL
We prove decidability for a fragment of SL, which we call the \( \left( l,1,d \right) \)-FRAG fragment of SL (Theorem 4). For doing so, we reduce the fragment to Presburger arithmetic, by using regular Presburger constructs to encode SL extensions, that is the uninterpreted functions and sum constants of SL.
The first step of our reduction proof is to consider distinct models, which are models where the
constants \(a_i\) represent distinct elements in the domain
. While this restriction is somewhat unnatural, we show that for each vocabulary and formula that has a model, there exists an equisatisfiable formula over a different vocabulary that has a distinct model (Theorem 1). The crux of our decidability proof is then proving that \( \left( l,1,d \right) \)-FRAG has small
space: given a formula \(\varphi \), if it is satisfiable, then there exists a model where
, \( \left| \varphi \right| \) is the length of \(\varphi \), and \(\kappa (.)\) is some computable function (Theorem 3)Footnote 3.
Distinct Models. An SL structure \(\mathcal {A}\) is considered distinct when the l
constants represent l distinct elements in
. I.e.,
$$ \left| \left\{ \mathcal {I}(a_1), \dots , \mathcal {I}(a_l) \right\} \right| = l\,. $$
Since each SL model induces an equivalence relation over the
constants, we consider partitions P over \( \left\{ a_1, \dots , a_l \right\} \). For each possible partition P we define a transformation of terms and formulas \(\mathcal {T}_P\) that substitutes equivalent
constants with a single
constant. The resulting formulas are defined over a vocabulary that has \( \left| P\right| \)
constants. We show that given an SL formula \(\varphi \), if \(\varphi \) has a model, we can always find a partition P such that each of its classes corresponds to an equivalence class induced by that model.
Theorem 1
(Distinct Models). Let \(\varphi \) be an SL formula over \(\varSigma \), then \(\varphi \) has a model iff there exists a partition P of \( \left\{ a_1,\dots ,a_l \right\} \) such that \(\mathcal {T}_P(\varphi )\) has a distinct model. \(\square \)
Small
Space. In order to construct a reduction to Presburger arithmetic, we bound the size of the
sort. For a fragment of SL to be decidable, we therefore need a way to bound its models upfront. We formalize this requirement as follows.
Definition 2
(Small
Space). Let FRAG be some fragment of SL over vocabulary \(\varSigma = \varSigma ^{l,m,d}_{+,\le }\). FRAG is said to have small
space if there exists a computable function \(\kappa _\varSigma (.)\), such that for any SL formula \(\varphi \in \textsc {FRAG}\), \(\varphi \) has a distinct model iff \(\varphi \) has a distinct model \(\mathcal {A}= (\mathcal {D}, \mathcal {I})\) with small
space, where
.
We call \(\kappa _\varSigma (.)\) the bound function of FRAG; when the vocabulary is clear from context we simply write \(\kappa (.)\).
One instance of a fragment (or rather, family of fragments) that satisfies this property is the \( \left( l,1,d \right) \)-FRAG fragment: the simple case of a single uninterpreted “balance” function (and its associated sum constant), further restricted by removing the binary function \(+\) and the binary relation \(\le \). Therefore, we derive the following theorem:
Theorem 2
(Small
Space of \( \left( l,1,d \right) \)-FRAG).
For any l, d, it holds \( \left( l,1,d \right) \)-FRAG, the fragment of SL formulas over the SL vocabulary
has small
space with bound function \(\kappa (x) = l + x + 1\). \(\square \)
An attempt to trivially extend Theorem 2 for a fragment of SL with two balance functions falls apart in a few places, but most importantly when comparing balances to the sum of a different balance function. In Sect. 4.2 we show that these comparisons are essential for proving our undecidability result in SL.
Presburger Reduction. For showing decidability of some FRAG fragment of SL, we describe a Turing reduction to pure Presburger arithmetic. We introduce a transformation \(\tau (.)\) of formulas in SL into formulas in Presburger arithmetic. It maps universal quantifiers to disjunctions, and sums to explicit addition of all balances. In addition, we define an auxiliary formula \(\eta (\varphi )\), which ensures only valid addresses are considered, and that invalid addresses have zero balances. The formal definitions of \(\tau (.)\) and \(\eta (\varphi )\) can be found in [10].
By relying on the properties of distinctness and small
space we get the following results.
Theorem 3
(Presburger Reduction). An SL formula \(\varphi \) has a distinct, SL model with small
space iff \(\tau (\varphi ) \wedge \eta (\varphi )\) has a Standard Model of Arithmetic. \(\square \)
Theorem 4
(SL Decidability). Let FRAG be a fragment of SL that has small
space, as defined in Definition 2. Then, FRAG is decidable.
Proof
(Theorem 4). Let \(\varphi \) be a formula in FRAG. Then \(\varphi \) has an SL model iff for some partition P of \( \left\{ a_1,\dots ,a_l \right\} \), \(\mathcal {T}_P(\varphi )\) has a distinct SL model. For any P, the formula \(\mathcal {T}_P(\varphi )\) is in FRAG, therefore \(\mathcal {T}_P(\varphi )\) has a distinct SL model iff it has a distinct SL model with small
space.
From Theorem 3, we get that for any P, \(\varphi _P \triangleq \mathcal {T}_P(\varphi )\) has a distinct SL model iff \(\tau (\varphi _P) \wedge \eta (\varphi _P)\) has a Standard Model of Arithmetic. By using the PA decision procedure as an oracle, we obtain the following decision procedure for a FRAG formula \(\varphi \):
-
For each possible partition P of \( \left\{ a_1,\dots ,a_l \right\} \), let \(\varphi _P = \mathcal {T}_P(\varphi )\);
-
Using a PA decision procedure, check whether \(\tau (\varphi _P) \wedge \eta (\varphi _P)\) has a model, for each P;
-
If a model for some partition P was found, the formula \(\varphi _P\) has a distinct SL model, and therefore \(\varphi \) has SL model;
-
Otherwise, there is no distinct SL model for any partition P, and therefore there is no SL model for \(\varphi \).
Remark 1
Our decision procedure for Theorem 4 requires \(B_l\) Presburger queries, where \(B_l\) is Bell’s number for all possible partitions of a set of size l.
Using Theorem 4 and Theorem 2, we then obtain the following result.
Corollary 1
\( \left( l,1,d \right) \)-FRAG is decidable. \(\square \)
4.2 SL Undecidability
We now show that simple extensions of our decidable \( \left( l,1,d \right) \)-FRAG fragment lose its decidability (Theorem 5). For doing so, we encode the halting problem of a two-counter machine using SL with 3 balance functions, thereby proving that the resulting SL fragment is undecidable.
Consider a two-counter machine, whose transitions are encoded by the Presburger formula \(\pi (c_1, c_2, p, c'_1, c'_2, p')\) with 6 free variables: 2 for each of the three registers, one of which being the program counter (pc). We assume w.l.o.g. that all three registers are within \(\mathbb {N}^+\), allowing us to use addresses with a zero balance as a special “separator”. In addition, we assume that the program counter is 1 at the start of the execution, and that there exists a single halting statement at line H. That is, the two-counter machine halts iff the pc is equal to H.
Table 2. Transition system of a 2-counter machine, array view.
Reduction Setting. We have 4
elements for each time-step, 3 of them hold one register each, and one is used to separate between each group of
elements (see Table 2). We have 3 uninterpreted functions from
to
(“balances”). For readability we denote these functions as c, l, g (instead of \(b_1,b_2,b_3\)) and their respective sums as \(s_c,s_l,s_g\):
-
1.
Function \(c\,\): Cardinality function, used to force size constraints. We set its value for all addresses to be 1, and therefore the number of addresses is \(s_c\).
-
2.
Function \(l\,\): Labeling function, to order the time-steps. We choose one element to have a maximal value of \(s_c - 1\) and ensure that l is injective. This means that the values of l are distinctly \([0, s_c - 1]\).
-
3.
Function \(g\,\): General purpose function, which holds either one of the registers or 0 to mark the
element as a separating one.
Each group representing a time-step is a 4
element, ordered as follows:
-
1.
First, a separating
element x (where g(x) is 0).
-
2.
Then, the two general-purpose counters.
-
3.
Lastly, the program counter.
In addition we have 2
constants, \(a_0\) and \(a_1\) which represent the pc value at the start and at the end of the execution. The element \(a_1\) also holds the maximal value of l, that is, \(l(a_1) + 1\approx s_c\). Further, \(a_0\) holds the fourth-minimal value, since its the last element of the first group, and each group has four elements.
Formalization Using a Two-Counter Machine. We now formalize our reduction, proving undecidability of SL.
(i) We impose an injective labeling
$$ \varphi _1 = \forall x,y. \left( l(x) \approx l(y) \right) \rightarrow \left( x \approx y \right) $$
(ii) We next formalize properties over the program counter pc. The
constant that represents the program counter pc value of the last time-step is set to have the maximal labeling, that is
$$ \varphi _2 = \forall x. l(x) \le l(a_1) $$
Further, the
constant that represents the pc value of the first time-step has the fourth labeling, hence
$$ \varphi _3 = l(a_0) \approx 3 $$
Finally, the first and last values of the program counter are respectively 1 and H, that is
$$ \varphi _4 = g(a_0) \approx 1 \wedge g(a_1) \approx H $$
(iii) We express cardinality constraints ensuring that there are as many
elements as the labeling of the last
constant (\(a_1\)) + 1. We assert
$$ \varphi _5 = \left( s_c \approx l(a_1) + 1 \right) \wedge \forall x. \left( c(x) \approx 1 \right) $$
(iv) We encode the transitions of the two-counter machine, as follows. For every 8
elements, if they represent two sequential time-steps, then the formula for the transitions of the two-counter machine is valid for the registers it holds. As such, we have
$$\begin{aligned} \varphi _6 = \forall&x_1,\dots ,x_8. \left( F1 \wedge F2 \wedge F3 \right) \\&\rightarrow \pi \left( g(x_2), g(x_3), g(x_4), g(x_6), g(x_7), g(x_8) \right) \end{aligned}$$
where the conjunction \(F1 \wedge F2 \wedge F3\) expresses that \(x_1, \dots , x_8\) are two sequential time-steps, with F1, F2 and F3 defined as below. In particular, F1, F2 and F3 formalize that \(x_1, \dots , x_8\) have sequential labeling, starting with one zero-valued
element (“separator”) and continuing with 3 non-zero elements, as follows:
Based on the above formalization, the formula \(\varphi = \varphi _1 \wedge \dots \wedge \varphi _6\) is satisfiable iff the two-counter machine halts within a finite amount of time-steps (and the exact amount would be given by \(\frac{s_c}{4}\)). Since the halting problem for two-counter machines is undecidable, our SL, already with 3 uninterpreted functions and their associated sums, is also undecidable.
Theorem 5
For any \(l \ge 2, m \ge 3\) and d, any fragment of SL over \(\varSigma ^{l,m,d}_{+,\le }\) is undecidable. \(\square \)
Remark 2
Note that in the above formalization the only use of associated sums comes from expressing the size of the set of
elements. As for our uninterpreted function c(.) we have \(\forall x. c(x) \approx 1\), its sum \(s_c\) is thus the amount of addresses. Hence, we can encode the halting problem for two-counter machines in an almost identical way to the encoding presented here, using a generalization of PA with two uninterpreted functions for l(.) and g(.), and a size operation replacing c(.) and its associated sum.