Keywords

1 Introduction

Theory combination focuses on the following problem: given procedures for determining the satisfiability of formulas over individual theories, can we find a procedure for the combined theory? One of the foundational results in this field is in Nelson and Oppen’s paper [9], where the authors show how to combine theories with disjoint signatures as long as they are both stably infinite, i.e., for every quantifier-free formula that is satisfied in the theory, there is an infinite interpretation of the theory that satisfies it.

With the introduction of stable infiniteness was born the notion of identifying model-theoretic properties that enable theory combination. It soon became clear, however, that this first step was insufficient, since some important theories with real-world applications (like the theories of bit-vectors and finite datatypes) turned out not to be stably infinite. Early attempts to find alternatives for stable infiniteness in theory combination included the introduction of gentle [5], shiny [12], and flexible [7] theories. We focus here on the notion of politeness, which forms the basis for theory combination in the state-of-the-art SMT solver cvc5 [1].

First considered in [10], polite theories were originally defined as those theories that are both smooth and finitely witnessable. Both notions are much harder to test for than stable infiniteness, but once a theory is known to be polite, it can be combined with any other theory, even non-stably-infinite ones.

A small problem in the proof of the main result of the paper was corrected in later work [6]. This paper introduces a slightly different, more strict, definition of politeness, together with a correct proof showing that polite theories can be combined with arbitrary theories. Following [4], we refer to theories satisfying the new definition as strongly polite, which is defined as being both smooth and strongly finitely witnessable; with that in mind, we call theories satisfying the earlier definition simply polite.

For some time, it was not known whether there exists a theory that is polite but not strongly polite. Then, in 2021 Sheng et al. [11] provided an example. This suggests the need for a more thorough analysis of properties such as stable infiniteness, smoothness, finite witnessability, and strong finite witnessability, as they appear to interact with each other in sometimes surprising or unforeseeable ways. We add to this list convexity, which was shown to be closely related to stable infiniteness in [2].

In this paper, we provide an exhaustive analysis, with examples whenever possible, of whether and how these properties can coexist. Some combinations are obviously impossible, such as a strongly finitely witnessable theory that is not finitely witnessable; the feasibility of other combinations is more elusive; for instance, it is initially unclear whether there can be a one-sorted, non-stably-infinite theory that is also not finitely witnessable (we show that this is also impossible). A main result is a comprehensive table describing what is known about all possible combinations of these properties.

During the course of filling the table, we were also able to improve polite combination: by making the involved proof slightly more difficult, we can simplify the main polite theory combination result: we show that in order to combine theories, it is enough for one theory to be stably infinite and strongly finitely witnessable; there is no need for smoothness. This result simplifies the process of qualifying a theory for polite combination, as showing stable infiniteness is considerably simpler than showing smoothness.

The paper is organized as follows. Section 2 defines the basic notions we will make use of throughout the paper. Section 3 proves several theorems showing the unfeasibility of certain combinations of properties. Section 4 describes the example theories that populate the feasible entries of the table. Section 5 offers a new combination theorem. And finally, Sect. 6 gives concluding remarks and directions for future work.Footnote 1

2 Preliminary Notions

2.1 First-Order Signatures and Structures

A many-sorted signature \(\varSigma \) is a triple formed by a countable set \(\mathcal {S}_{\varSigma }\) of sorts, a countable set of function symbols \(\mathcal {F}_{\varSigma }\), and a countable set of predicate symbols \(\mathcal {P}_{\varSigma }\) which contains, for every sort \(\sigma \in \mathcal {S}_{\varSigma }\), an equality symbol \(=_{\sigma }\) (often denoted by \(=\)); each function symbol has an arity \(\sigma _{1}\times \cdots \times \sigma _{n}\rightarrow \sigma \) and each predicate symbol an arity \(\sigma _{1}\times \cdots \times \sigma _{n}\), where \(\sigma _{1}, \ldots , \sigma _{n}, \sigma \in \mathcal {S}_{\varSigma }\) and \(n\in \mathbb {N}\). Each equality symbol \(=_{\sigma }\) has arity \(\sigma \times \sigma \). A signature with no function or predicate symbols other than equalities is called empty.

A many-sorted signature \(\varSigma \) is one-sorted if \(\mathcal {S}_{\varSigma }\) has one element; we may refer to many-sorted signatures simply as signatures. Two signatures are said to be disjoint if they share only sorts and equality symbols.

We assume for each sort in \(\mathcal {S}_{\varSigma }\) a distinct countably infinite set of variables, and define terms, literals, and formulas (atomic or not) in the usual way. If s is a function symbol of arity \(\sigma \rightarrow \sigma \) and x is a variable of sort \(\sigma \), we define recursively the term \(s^{k}(x)\), for \(k\in \mathbb {N}\), as follows: \(s^{0}(x)=x\), and \(s^{k+1}(x)=s(s^{k}(x))\). We denote the set of free variables of sort \(\sigma \) in a formula \(\varphi \) by \(\textit{vars}_{\sigma }(\varphi )\), and given \(S\subseteq \mathcal {S}_{\varSigma }\), \(\textit{vars}_{S}(\varphi )=\bigcup _{\sigma \in S}\textit{vars}_{\sigma }(\varphi )\) (we use \(\textit{vars}(\phi )\) as shorthand for \(\textit{vars}_{\mathcal {S}_{\varSigma }}\)).

A \(\varSigma \)-structure \(\mathcal {A}\) is composed of sets \(\sigma ^{\mathcal {A}}\) for each sort \(\sigma \in \mathcal {S}_{\varSigma }\), called the domain of \(\sigma \), equipped with interpretations \(f^{\mathcal {A}}\) and \(P^{\mathcal {A}}\) of the function and predicate symbols, in a way that respects their arities. Furthermore, \(=_{\sigma }^{\mathcal {A}}\) must be the identity on \(\sigma ^{\mathcal {A}}\).

A \(\varSigma \)-interpretation \(\mathcal {A}\) is an extension of a \(\varSigma \)-structure that also interprets variables, with the value of a variable x of sort \(\sigma \) being an element \(x^{\mathcal {A}}\) of \(\sigma ^{\mathcal {A}}\); we will sometimes say that an interpretation \(\mathcal {B}\) is an interpretation on a structure \(\mathcal {A}\) (over the same signature) to mean that \(\mathcal {B}\) has \(\mathcal {A}\) as its underlying structure. We write \(\alpha ^{\mathcal {A}}\) for the interpretation of the term \(\alpha \) under \(\mathcal {A}\); if \(\varGamma \) is a set of terms, we define \(\varGamma ^{\mathcal {A}} = \{\alpha ^{\mathcal {A}} : \alpha \in \varGamma \}\). We write \(\mathcal {A}\vDash \varphi \) if \(\mathcal {A}\) satisfies \(\varphi \). A formula \(\varphi \) is called satisfiable if it is satisfied by some interpretation \(\mathcal {A}\).

We shall make use of standard cardinality formulas, given in Fig. 1. \(\psi ^{\sigma }_{\ge n}\) is only satisfied by a structure \(\mathcal {A}\) if \(|\sigma ^{\mathcal {A}}|\) is at least n, \(\psi ^{\sigma }_{\le n}\) is only satisfied by \(\mathcal {A}\) if \(|\sigma ^{\mathcal {A}}|\) is at most n, and \(\psi ^{\sigma }_{= n}\) is only satisfied by \(\mathcal {A}\) if \(|\sigma ^{\mathcal {A}}|\) is exactly n. In one-sorted signatures, we may drop \(\sigma \) from the formulas, giving us \(\psi _{\ge n}\), \(\psi _{\le n}\) and \(\psi _{= n}\).

Fig. 1.
figure 1

Cardinality Formulas. \(\overrightarrow{x}\) stands for \(x_{1},\ldots ,x_{n}\).

The following lemmas are generalizations of the standard compactness and downward Skolem-Löwenheim theorems of first-order logic to the many-sorted case. They are proved in [8].

Lemma 1

([8]). A set of formulas is satisfiable iff each of its finite subsets is satisfiable.

Lemma 2

([8]). If a set of formulas is satisfiable, there exists an interpretation \(\mathcal {A}\) which satisfies it and where \(\sigma ^{\mathcal {A}}\) is countable whenever it is infinite, for every sort \(\sigma \).

A theory \(\mathcal {T}\) is a class of all \(\varSigma \)-structures that satisfy some set of closed formulas (formulas without free variables), called the axiomatization of \(\mathcal {T}\) which we denote as \(\textit{Ax}(\mathcal {T})\); such structures will be called the models of \(\mathcal {T}\), a model being called trivial when \(\sigma ^{\mathcal {A}}\) is a singleton for some sort \(\sigma \) in \(\mathcal {S}_{\varSigma }\). A \(\varSigma \)-interpretation \(\mathcal {A}\) whose underlying structure is in \(\mathcal {T}\) is called a \(\mathcal {T}\)-interpretation. A formula is said to be \(\mathcal {T}\)-satisfiable if there is a \(\mathcal {T}\)-interpretation that satisfies it; a set of formulas is \(\mathcal {T}\)-satisfiable if there is a \(\mathcal {T}\)-interpretation that satisfies each of its elements. Two formulas are \(\mathcal {T}\)-equivalent when every \(\mathcal {T}\)-interpretation satisfies one if and only if it satisfies the other. We write \(\vdash _{\mathcal {T}}\varphi \) and say that \(\varphi \) is \(\mathcal {T}\)-valid if \(\mathcal {A}\vDash \varphi \) for every \(\mathcal {T}\)-interpretation \(\mathcal {A}\). Let \(\varSigma _{1}\) and \(\varSigma _{2}\) be disjoint signatures; by \(\varSigma =\varSigma _{1}\cup \varSigma _{2}\), we mean the signature with the union of the sorts, function symbols, and predicate symbols of \(\varSigma _{1}\) and \(\varSigma _{2}\), all arities preserved. Given a \(\varSigma _{1}\)-theory \(\mathcal {T}_{1}\) and a \(\varSigma _{2}\)-theory \(\mathcal {T}_{2}\), the \(\varSigma _{1}\cup \varSigma _{2}\)-theory \(\mathcal {T}=\mathcal {T}_{1}\oplus \mathcal {T}_{2}\) is the theory axiomatized by the union of the axiomatizations of \(\mathcal {T}_{1}\) and \(\mathcal {T}_{2}\).

2.2 Model-Theoretic Properties

Let \(\varSigma \) be a signature. A \(\varSigma \)-theory \(\mathcal {T}\) is said to be stably infinite w.r.t. \(S\subseteq \mathcal {S}_{\varSigma }\) if, for every \(\mathcal {T}\)-satisfiable quantifier-free formula \(\phi \), there exists a \(\mathcal {T}\)-interpretation \(\mathcal {A}\) satisfying \(\phi \) such that, for each \(\sigma \in S\), \(\sigma ^{\mathcal {A}}\) is infinite. \(\mathcal {T}\) is smooth w.r.t. \(S\subseteq \mathcal {S}_{\varSigma }\) when, for every quantifier-free formula \(\phi \), \(\mathcal {T}\)-interpretation \(\mathcal {A}\) satisfying \(\phi \), and function \(\kappa \) from S to the class of cardinals such that \(\kappa (\sigma )\ge |\sigma ^{\mathcal {A}}|\) for every \(\sigma \in S\), there exists a \(\mathcal {T}\)-interpretation \(\mathcal {B}\) satisfying \(\phi \) with \(|\sigma ^{\mathcal {B}}|=\kappa (\sigma )\), for every \(\sigma \in S\).

Theorem 1

Let \(\varSigma \) be a signature, \(S\subseteq \mathcal {S}_{\varSigma }\), and \(\mathcal {T}\) a \(\varSigma \)-theory. If \(\mathcal {T}\) is smooth w.r.t. S, then it is also stably infinite w.r.t. S.

For a finite set of sorts S, finite sets of variables \(V_{\sigma }\) of sort \(\sigma \) for each \(\sigma \in S\), and equivalence relations \(E_{\sigma }\) on \(V_{\sigma }\), the arrangement on \(V=\bigcup _{\sigma \in S}V_{\sigma }\) induced by \(E=\bigcup _{\sigma \in S}E_{\sigma }\), denoted by \(\delta _{V}\) or \(\delta _{V}^{E}\), is the quantifier-free formula given by \(\delta _{V}=\bigwedge _{\sigma \in S}\big [\bigwedge _{xE_{\sigma }y}(x=y)\wedge \bigwedge _{x\overline{E_{\sigma }}y}\lnot (x=y)\big ]\), where \(\overline{E_{\sigma }}\) denotes the complement of the equivalence relation \(E_{\sigma }\).

A theory \(\mathcal {T}\) is said to be finitely witnessable w.r.t. the set of sorts \(S\subseteq \mathcal {S}_{\varSigma }\) when there exists a function \(\textit{wit}\), called a witness, from the quantifier-free formulas into themselves that is computable and satisfies for every quantifier-free formula \(\phi \): (i\(\phi \) and \(\exists \, \overrightarrow{w}.\,\textit{wit}(\phi )\) are \(\mathcal {T}\)-equivalent, where \(\overrightarrow{w}=\textit{vars}(\textit{wit}(\phi ))\setminus \textit{vars}(\phi )\); and (ii) if \(\textit{wit}(\phi )\) is \(\mathcal {T}\)-satisfiable, then there exists a \(\mathcal {T}\)-interpretation \(\mathcal {A}\) satisfying \(\textit{wit}(\phi )\) such that \(\sigma ^{\mathcal {A}}=\textit{vars}_{\sigma }(\textit{wit}(\phi ))^{\mathcal {A}}\) for each \(\sigma \in S\). \(\mathcal {T}\) is said to be strongly finitely witnessable if it has a strong witness \(\textit{wit}\), which has the properties of a witness with the exception of (ii), satisfying instead: \((ii')\) given a finite set of variables V and an arrangement \(\delta _{V}\) on V, if \(\textit{wit}(\phi )\wedge \delta _{V}\) is \(\mathcal {T}\)-satisfiable, then there exists a \(\mathcal {T}\)-interpretation \(\mathcal {A}\) satisfying \(\textit{wit}(\phi )\wedge \delta _{V}\) such that \(\sigma ^{\mathcal {A}}=\textit{vars}_{\sigma }(\textit{wit}(\phi )\wedge \delta _{V}\big )^{\mathcal {A}}\) for all \(\sigma \in S\).

From the definitions, the following theorem directly follows:

Theorem 2

Let \(\varSigma \) be a signature, \(S\subseteq \mathcal {S}_{\varSigma }\), and \(\mathcal {T}\) a \(\varSigma \)-theory. If \(\mathcal {T}\) is strongly finitely witnessable w.r.t. S then it is also finitely witnessable w.r.t. S.

A theory that is both smooth and finitely witnessable w.r.t. (a set of sorts) \(\mathcal {S}\) is said to be polite w.r.t. \(\mathcal {S}\); a theory that is both smooth and strongly finitely witnessable w.r.t. \(\mathcal {S}\) is called strongly polite w.r.t. \(\mathcal {S}\). For theories over one-sorted empty signatures, we have the following theorem from [11]:

Theorem 3

([11]). Every one-sorted theory over the empty signature that is polite w.r.t. its only sort is strongly polite w.r.t. that sort.

A one-sorted theory \(\mathcal {T}\) is said to be convex if, for any conjunction of literals \(\phi \) and any finite set of variables \(\{u_{1}, v_{1}, ... , u_{n}, v_{n}\}\), \(\vdash _{\mathcal {T}}\phi \rightarrow \bigvee _{i=1}^{n}u_{i}=v_{i}\) implies \(\vdash _{\mathcal {T}}\phi \rightarrow u_{i}=v_{i}\), for some \(i\in [1,n]\).

Given a one-sorted theory \(\mathcal {T}\), its \(\textit{mincard}\) function takes a quantifier-free formula \(\phi \) and returns the countable cardinal \(\min \{|\sigma ^{\mathcal {A}}| : \mathcal {A}\) is a \(\mathcal {T}\)-interpretation that satisfies \(\phi \}\).Footnote 2

Throughout this paper, we will use \({\textbf {SI}}\) for stably infinite, \({\textbf {SM}}\) for smooth, \({\textbf {FW}}\) for finitely witnessable, \({\textbf {SW}}\) for strongly finitely witnessable, and \({\textbf {CV}}\) for convex.

3 Negative Results

If it were possible, we would present examples of every combination of properties using only the one-sorted empty signature, which is the simplest signature imaginable.

Of course, this is not always possible: smooth theories are necessarily stably infinite, and strongly finitely witnessable theories are obligatorily finitely witnessable. But there are several other connections we now proceed to show, which further restrict the combinations of properties that are possible.

In Sect. 3.1, we show that, under reasonable conditions, a convex theory must be stably infinite, while the reciprocal is also true over the empty signature. In Sect. 3.2, we show that over the empty one-sorted signature, theories that are not stably infinite are necessarily finitely witnessable (a somewhat counter-intuitive result, since we usually look for theories that are, simultaneously, smooth and strongly finitely witnessable) and, more importantly, that stably-infinite and strongly finitely witnessable one-sorted theories are also strongly polite.

3.1 Stable-Infiniteness and Convexity

Convexity is typically defined over one-sorted signatures. Here we offer the following generalization to arbitrary signatures.

Definition 1

A theory \(\mathcal {T}\) is said to be convex w.r.t. a set of sorts \(S\subseteq \mathcal {S}_{\varSigma }\) if, for any conjunction of literals \(\phi \) and any finite set of variables \(\{u_{1}, v_{1}, ... , u_{n}, v_{n}\}\) with sorts in S, if \(\vdash _{\mathcal {T}}\phi \rightarrow \bigvee _{i=1}^{n}u_{i}=v_{i}\) then \( \vdash _{\mathcal {T}}\phi \rightarrow u_{i}=v_{i}\), for some \(i\in [1,n]\).

If we assume, as it is often natural to, that our theories have no trivial models, then convexity implies stable infiniteness. This is true for the one-sorted case, as proved in [2], but also for the many-sorted case as we show here. The proof is similar, though here we need to account for several sorts at once. In particular, the proof relies on Lemma 1.

Theorem 4

If a \(\varSigma \)-theory \(\mathcal {T}\) is convex w.r.t. some set S of sorts and, for each \(\sigma \in \mathcal {S}\), \(\vdash _{\mathcal {T}}\psi ^{\sigma }_{\ge 2}\), then \(\mathcal {T}\) is stably infinite w.r.t. S.

Reciprocally, we may also obtain convexity from stable infiniteness, but only over empty signatures.

Theorem 5

Any theory over an empty signature that is stably infinite w.r.t. the set of all of its sorts is convex w.r.t. any set of sorts.

As we shall see in Sect. 4, this result is tight: there are theories over non-empty signatures that are stably infinite but not convex.

3.2 More Connections

We next present more connections between the properties. First, over the one-sorted empty signature, a theory must be either stably infinite or finitely witnessable.

Theorem 6

Every one-sorted, non-stably-infinite theory \(\mathcal {T}\) with an empty signature is finitely witnessable w.r.t. its only sort.

The following theorem shows that for one-sorted theories, strong politeness is a corollary of strong finite witnessability and stable infiniteness (rather than smoothness).

Theorem 7

Every one-sorted theory that is stably infinite and strongly finitely witnessable w.r.t. its only sort is smooth, and therefore strongly polite w.r.t. that sort.

Generalizing this theorem to the case of many-sorted signatures is left for future work.

Finally, by combining previous results, we can also get the following theorem, which relates stable infiniteness, strong finite witnessability, and convexity.

Theorem 8

A one-sorted theory \(\mathcal {T}\) with an empty signature that is neither strongly finitely witnessable nor stably infinite w.r.t. its only sort cannot be convex.

Fig. 2.
figure 2

A diagram of combinations over a one-sorted, empty signature: gray regions are empty.

To summarize, while Theorem 4 is restricted to structures with no domains of cardinality 1, the remaining theorems of this section are not restricted to such structures. Theorem 5 applies to empty signatures, Theorem 7 applies to one-sorted signatures, and Theorems 6 and 8 apply to signatures that are both empty and one-sorted. Put together, we see that many combinations of properties for theories over a one-sorted empty signature are actually impossible. This is depicted in Fig. 2, in which all areas but the white ones are empty. For example, Theorem 6 shows that the area outside the SI and FW circles (representing theories that are neither stably infinite nor finitely witnessable) is empty, as every theory (over an empty one-sorted signature) must have one of these properties. Similarly, Theorem 8 further shows that within the CV (convex) circle, even more is empty, namely anything outside the SI and SW circles.

4 Positive Results

We now proceed to systematically address all possible combinations of stable-infiniteness, smoothness, finite witnessability, strong finite witnessability, and convexity.

The results are summarized in Table 1. Each row corresponds to a possible combination of properties, as determined by the truth values in the first five columns. For example, in the first row, the entries in the first five columns are all true, indicating that in this row, all theory examples must be stably-infinite, smooth, finitely witnessable, strongly finitely witnessable, and convex. The rest of the columns correspond to different possibilities for the theory signatures: either empty or non-empty, and either one-sorted or many-sorted. Again, looking at the first row, we see four different theories listed, one for each of the signature possibilities.

Some entries in the table list theorems instead of providing example theories. The listed theorems tell us that there do not exist any example theories for these entries. For example, lines 3 and 4 cannot provide examples over a one-sorted empty signature because of Theorem 3.

When an example is available, its name is given in corresponding cell of the table. The theories themselves are defined in Sect. 4.1 to 4.4. The examples on lines 25, 27 and 31 must have at least one structure with a trivial domain (i.e., a domain with exactly one element) because of Theorem 4.

Lines 9, 10, 13, and 14 cover theories that are stably infinite and strongly finitely witnessable but not smooth. We call these unicorn theories because we could not find any such theories, nor do we believe they exist, but (ignoring the obvious cases ruled out by Theorems 2, 5 and 7) we have no proof that they do not exist.

Definition 2

A unicorn theory is stably infinite and strongly finitely witnessable but not smooth.

Theorem 7 shows that there are no one-sorted unicorn theories. We believe it may be possible to provide a generalization of the upwards Löwenheim-Skolem theorem to many-sorted logic in such a way that it would prove the non-existence of unicorn theories, which leads to the following conjecture:

Conjecture 1

There are no unicorn theories.

Table 1. Summary of all possible combinations of theory properties. Shaded cells represent impossible combinations. In line 26: \(n>1\); in line 28: \(m>1\), \(n>1\) and \(|m-n|>1\).

Before defining the theories of Table 1, we introduce the following signatures.

Definition 3

\(\varSigma _{1}\) is the empty one-sorted signature with sort \(\sigma \), \(\varSigma _{2}\) is the empty two-sorted signature with sorts \(\sigma \) and \(\sigma _{2}\), and \(\varSigma _{s}\) is the one-sorted signature with a single unary function symbol s.

We now describe the theories: Sect. 4.1 describes the theories that are over the empty one-sorted signature; Sect. 4.2 then continues to the next column, describing theories over many-sorted empty signatures. Some build on the theories of the previous column, but some are also new. Section 4.3 describes the next column, one-sorted theories over a non-empty signature. Here, we use two constructions to generate new theories from previously introduced ones. One construction adds a function symbol to an empty signature (in a way that preserves all properties), and the second preserves all properties but convexity, making it possible to construct non-convex examples in a uniform way. We also present new theories when the constructions are not sufficient. Finally, Sect. 4.4 describes theories over non-empty many-sorted signatures.Footnote 3

4.1 Theories over the One-Sorted Empty Signature

Table 2. \(\varSigma _{1}\)-theories
Table 3. \(\varSigma _2\)-theories

The axiomatizations for theories over the one-sorted empty signature \(\varSigma _{1}\) are given in Table 2. We briefly describe them here.

For each \(n>0\), \(\mathcal {T}_{\ge n}\) includes all structures with domains of cardinality at least n; \(\mathcal {T}_{\infty }\) is the theory including all structures whose domains are infinite; \(\mathcal {T}_{ even }^{\infty }\) has structures with either an even or an infinite number of elements in their domains and was defined in [11], where it was proved to be finitely witnessable, but neither smooth nor strongly finitely witnessable. The proofs justifying Table 1 show additionally that it is stably infinite and convex. \(\mathcal {T}_{n, \infty }\) contains those structures whose domains have either exactly n or an infinite number of elements; \(\mathcal {T}_{\le n}\) includes all structures with at most n elements in their domains; and for positive integers m and n, \(\mathcal {T}_{\langle m,n\rangle }\) has structures whose domains have either precisely m elements, or precisely n elements. This completes the first column of theory examples.

Example 1

The theory \(\mathcal {T}_{\ge n}\) admits all considered properties, while \(\mathcal {T}_{\langle m,n\rangle }\) admits only finite witnessability.

4.2 Theories over the Two-Sorted Empty Signature

We next introduce the theories over empty two-sorted signatures. For many cases, we can simply add a trivial sort to one of the theories defined in Sect. 4.1. When this is not possible, we introduce new theories.

Adding a Sort to a Theory. Any \(\varSigma _{1}\)-theory can be used to generate a \(\varSigma _2\)-theory simply by adding the sort \(\sigma _2\) to the signature (without changing the axiomatization). This is formalized as follows:

Definition 4

Let \(\mathcal {T}\) be a \(\varSigma _{1}\)-theory. \((\mathcal {T})^{2}\) is the \(\varSigma _{2}\)-theory axiomatized by \(\textit{Ax}(\mathcal {T})\).

Lemma 3

A \(\varSigma _{1}\)-theory \(\mathcal {T}\) is stably infinite, smooth, finitely witnessable, strongly finitely witnessable, or convex w.r.t. \(\{\sigma \}\) if and only if \((\mathcal {T})^{2}\) is, respectively, stably infinite, smooth, finitely witnessable, strongly finitely witnessable, or convex w.r.t. \(\{\sigma , \sigma _{2}\}\).

Using Definition 4 and Lemma 3, we can populate many lines in the second column of examples by extending the corresponding theory from the previous column.

Example 2

\((\mathcal {T}_{\ge n})^{2}\) is a theory over two sorts, \(\sigma \) and \(\sigma _2\), whose structures must have at least n elements in the domain of \(\sigma \) (but have no restrictions on the size of the domain of \(\sigma _2\)). As seen in the first line of Table 1, \(\mathcal {T}_{\ge n}\) admits all the considered properties. By Lemma 3, so does \((\mathcal {T}_{\ge n})^{2}\).

Additional Theories over \({\boldsymbol{\varSigma }}_{\textbf{2}}\). On some lines, e.g., line 3, there is no \(\varSigma _{1}\)-theory to extend. In such cases, we cannot use Definition 4 to construct a many-sorted variant.

We introduce the theories shown in Table 3 to cover these cases. The theory \(\mathcal {T}_{2,3}\) contains two kinds of structures: (i) structures whose domains both have at least 3 elements; and (ii) structures with exactly two elements in the domain of \(\sigma \) and an infinite number of elements in the domain of \(\sigma _{2}\). The theory \({\mathcal {T}_{1}^{odd}}\) has structures with exactly one element in the domain of \(\sigma \) and either an odd or an infinite number of elements in the domain of \(\sigma _2\). The theory \(\mathcal {T}_{1}^{\infty }\) is similar: it has structures with exactly one element in the domain of \(\sigma \) and an infinite number of elements in the domain of \(\sigma _2\). Finally, \(\mathcal {T}_{2}^{\infty }\) is similar to \(\mathcal {T}_{1}^{\infty }\) except that its structures have exactly 2 elements in the domain of \(\sigma \).

Example 3

The theory \(\mathcal {T}_{2,3}\) was first defined in [4] and later used in [11], where it was proved to be polite (and therefore smooth, stably infinite, and finitely witnessable) without being strongly polite (and therefore not strongly finitely witnessable). The justification proofs for Table 1 show that \(\mathcal {T}_{2,3}\) is convex as well.Footnote 4

4.3 Theories over a One-Sorted Non-empty Signature

We continue to the next column, with one-sorted non-empty signatures. Section 4.3 shows how to construct non-empty theories from one-sorted theories over the empty signature, while preserving all their properties. In Sect. 4.3, we provide a similar construction which generates non-convex theories from the theories in the first column of examples. And in Sect. 4.3, we introduce additional theories not captured by the above constructions. Two of these theories are described in more detail in Sect. 4.3.

Extending a Theory with a Unary Function Symbol While Preserving Properties. Whenever we have a theory over an empty signature, we can construct a variant of it over a non-empty signature by introducing a function symbol and interpreting it as the identity function. This extension preserves all the properties that we consider. This is formalized as follows.

Definition 5

Let \(\varSigma _{n}\) be an empty signature with sorts \(S=\{\sigma _{1}, \ldots , \sigma _{n}\}\), and let \(\mathcal {T}\) be a \(\varSigma _{n}\)-theory. The signature \(\varSigma ^{n}_{s}\) has sorts S and a single unary function symbol s of arity \(\sigma _{1}\rightarrow \sigma _{1}\), and \((\mathcal {T})_{s}\) is the \(\varSigma ^{n}_{s}\)-theory axiomatized by \(\textit{Ax}(\mathcal {T})\cup \{\forall \, x.\,[s(x)=x]\}\), where x is a variable of sort \(\sigma _{1}\).

Lemma 4

For every theory \(\mathcal {T}\) over an empty signature \(\varSigma _{n}\) with sorts \(S=\{\sigma _{1}, \ldots , \sigma _{n}\}\): \(\mathcal {T}\) is stably infinite, smooth, finitely witnessable, strongly finitely witnessable, or convex w.r.t. S if and only if \((\mathcal {T})_{s}\) is, respectively, stably infinite, smooth, finitely witnessable, strongly finitely witnessable, or convex w.r.t. S.

We use the operator \((\cdot )_{s}\) in various places in Table 1 in order to obtain examples in non-empty signatures from existing examples over \(\varSigma _{1}\) and \(\varSigma _{2}\).

Example 4

\((\mathcal {T}_{\ge n})_{s}\) is a one-sorted theory, whose structures have at least n elements and interpret the function symbol s as the identity. As seen above, \(\mathcal {T}_{\ge n}\) admits all the considered properties. By Lemma 4, so does \((\mathcal {T}_{\ge n})_{s}\).

Making a Theory Non-convex. The last general construction that we present aims at taking a theory and creating a non-convex variant of it while preserving the other properties we consider. This can be done with the addition of a single unary function symbol s. To define such a theory, we make use of the formula \(\psi _{\vee }\) from Fig. 3. Intuitively, \(\psi _{\vee }\) states that in an interpretation \(\mathcal {A}\) in which it holds, \(s^{\mathcal {A}}(s^{\mathcal {A}}(a))\) must equal either \(s^{\mathcal {A}}(a)\) or a itself; in other words, either \(a=s^{\mathcal {A}}(a)=s^{\mathcal {A}}(s^{\mathcal {A}}(a))\), \(a=s^{\mathcal {A}}(s^{\mathcal {A}}(a))\ne s^{\mathcal {A}}(a)\), or \(a\ne s^{\mathcal {A}}(a)=s^{\mathcal {A}}(s^{\mathcal {A}}(a))\), as shown in Fig. 4.

Fig. 3.
figure 3

The formula \(\psi _{\vee }\) for non-convex theories.

This is especially useful for defining non-convex theories, since \((s^{2}(x)=x)\vee (s^{2}(x)=s(x))\) is valid in the theory, but neither \(s^{2}(x)=x\) nor \(s^{2}(x)=s(x)\) is. Notice, of course, that non-convexity is only possible when there are at least two elements available in the domain – otherwise, all equalities are satisfied.

Fig. 4.
figure 4

Possible scenarios when \(\psi _{\vee }\) holds.

Definition 6

Let \(\mathcal {T}\) be a theory over an empty signature with sorts \(S=\{\sigma _{1}, \ldots , \sigma _{n}\}\). Then \((\mathcal {T})_{\vee }\) is the \(\varSigma ^{n}_{s}\)-theory axiomatized by \(\textit{Ax}(\mathcal {T})\cup \{\psi _{\vee }\}\).

Lemma 5

Let \(\mathcal {T}\) be a theory over an empty signature \(\varSigma _{n}\) with sorts \(S=\{\sigma _{1}, \ldots , \sigma _{n}\}\). Then: \((\mathcal {T})_{\vee }\) is stably infinite, smooth, finitely witnessable, or strongly finitely witnessable w.r.t. S if and only if \(\mathcal {T}\) is, respectively, stably infinite, smooth, finitely witnessable, or strongly finitely witnessable w.r.t. S. In addition, if \(\mathcal {T}\) has a model \(\mathcal {A}\) with \(|\sigma _{1}^{\mathcal {A}}|\ge 2\), \((\mathcal {T})_{\vee }\) is not convex with respect to S.

Example 5

The theory \((\mathcal {T}_{\ge n})_{\vee }\) is one-sorted, and its structures have at least n elements. they interpret the symbol s in a way that satisfies \(\psi _{\vee }\). In particular, for each element a of the domain, one of the scenarios from Fig. 4 holds. According to Lemma 5, since \(\mathcal {T}_{\ge n}\) admits all properties, \((\mathcal {T}_{\ge n})_{\vee }\) admits all properties but convexity.

Additional Theories over \({\boldsymbol{\varSigma }}_{\boldsymbol{s}}\). Whenever there is a \(\varSigma _{1}\)-theory with some properties, we can obtain a \(\varSigma _s\) theory with the same properties using one of the techniques above. To cover cases for which there is no corresponding \(\varSigma _{1}\)-theory, we use the theories presented in Table 4 and described below.

Table 4. \(\varSigma _s\)-theories

We start with \(\mathcal {T}^{\ne }_{ odd }\), \(\mathcal {T}^{\ne }_{1,\infty }\), and \(\mathcal {T}^{\ne }_{2,\infty }\), deferring the discussion on \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\) to Sect. 4.3. The theory \(\mathcal {T}^{\ne }_{ odd }\) has structures \(\mathcal {A}\) with either an infinite or an odd number of elements and with the property that if \(\mathcal {A}\) is not trivial, then \(s^{\mathcal {A}}(a)\ne a\) for all \(a\in \sigma ^{\mathcal {A}}\). The theory \(\mathcal {T}^{\ne }_{1,\infty }\) has all structures \(\mathcal {A}\) that either: (i) are trivial; or (ii) have infinitely many elements and for which \(s^{\mathcal {A}}(a)\ne a\) for each \(a\in \sigma ^{\mathcal {A}}\). Similarly, \(\mathcal {T}^{\ne }_{2,\infty }\) has structures \(\mathcal {A}\) that either: (i) have exactly two elements and interpret s as the identity; or (ii) have infinitely many elements and interpret s in such a way that \(s^{\mathcal {A}}(a)\ne a\) for all \(a\in \sigma ^{\mathcal {A}}\).

On the Theories \({\boldsymbol{\mathcal {T}}_{\boldsymbol{f}}}\) and \({\boldsymbol{\mathcal {T}}_{\boldsymbol{f}}^{\boldsymbol{s}}}\). We now introduce the theories \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\). The importance of these theories is that both of them are one-sorted theories that are polite but not strongly polite (the first is also convex and the second is not). Their existence improves on the result of [11], which introduced a two-sorted theory that is polite but not strongly polite (namely \(\mathcal {T}_{2,3}\)).

For their axiomatizations, we use the formulas from Fig. 5, in which s is a unary function symbol. ( ) states that a structure \(\mathcal {A}\) has at least (exactly) n elements a satisfying \(s^{\mathcal {A}}(a)=a\); similarly, ( ) states that a structure \(\mathcal {A}\) has at least (exactly) n elements a satisfying \(s^{\mathcal {A}}(a)\ne a\).

Fig. 5.
figure 5

Cardinality formulas for signatures with a unary function symbol s. \(\overrightarrow{x}\) stands for \(x_{1},\ldots ,x_{n}\), p(x) for \(s(x)=x\), and \(\delta _{{n}}\) for \(\bigwedge _{1\le i<j\le n}\lnot (x_{i}=x_{j})\).

Further, the axiomatization requires a function f from positive integers to \(\{0,1\}\) that is not computable with the property that for \(k>0\), f maps half of the numbers in the interval \([1,2^{k}]\) to 1 and the other half to 0. The existence of such a function is formalized below. We start by defining counting functions \(f_0\) and \(f_1\).

Definition 7

Let \(f:\mathbb {N}\setminus \{0\}\rightarrow \{0,1\}\). For \(i\in \{0,1\}\) and \(n\in \mathbb {N}\), \(f_{i}(n)\) is defined by: \(f_{i}(n)=|f^{-1}(i)\cap [1,n]|\).

Intuitively, \(f_0(n)\) counts how many numbers between 1 and n (inclusive) are mapped by f to 0 and \(f_{1}(n)\) counts how many are mapped to 1. Because f(n) always equals 0 or 1, it is easy to see that for every \(n>0\), \(n=f_{1}(n)+f_{0}(n)\).

Lemma 6

There exists a function \(f:\mathbb {N}\setminus \{0\}\rightarrow \{0,1\}\) such that \(f(1)=1\) with the properties that: f is not computable; and, for every \(k\in \mathbb {N}\setminus \{0\}\), \(f_{0}(2^{k})=f_{1}(2^{k})\).

Example 6

The constant function that assigns 0 to all positive integers satisfies neither the first nor the second condition of Lemma 6. The function that assigns 0 to even numbers and 1 to odd numbers satisfies the second condition, but not the first. Of course, any non-computable function satisfies the first condition. An example could be found by a function that returns 1 if the Turing machine that is encoded by the given number halts and 0 otherwise, under some encoding. Finding a function that admits both conditions is more challenging.

Let f be some function with the properties listed in Lemma 6. We can now define \(\mathcal {T}_{f}\) over \(\varSigma _s\) (note that f itself is not a part of the signature, but is rather used to help define the axioms of \(\mathcal {T}_{f}\)). \(\mathcal {T}_{f}\) consists of those structures \(\mathcal {A}\) that either (i) have a finite cardinality n, with \(f_{1}(n)\) elements satisfying \(s^{\mathcal {A}}(a)=a\), and \(f_{0}(n)\) elements satisfying \(s^{\mathcal {A}}(a)\ne a\) (and thus \(\mathcal {A}\) satisfies \(\psi ^{=}_{\ge f_{1}(k)}\wedge \psi ^{\ne }_{\ge f_{0}(k)}\) for \(k\le n\), and \(\psi ^{=}_{= f_{1}(n)}\wedge \psi ^{\ne }_{= f_{0}(n)}\) and hence \(\bigvee _{i=1}^{k}[\psi ^{=}_{=f_{1}(i)}\wedge \psi ^{\ne }_{=f_{0}(i)}]\) for all \(k\ge n\)); or (ii) have infinitely many elements, with infinitely many elements satisfying each condition, \(s^{\mathcal {A}}(a)=a\) and \(s^{\mathcal {A}}(a)\ne a\) (and thus \(\mathcal {A}\) satisfies \(\psi ^{=}_{\ge f_{1}(k)}\wedge \psi ^{\ne }_{\ge f_{0}(k)}\) for all \(k\in \mathbb {N}\)). Note that the description is well-defined because an element must always satisfy either \(s^{\mathcal {A}}(a)=a\) or \(s^{\mathcal {A}}(a)\ne a\), but never both or neither of these. The theory \(\mathcal {T}^{s}_{f}\) is similar to \(\mathcal {T}_{f}\), but in addition to \(\textit{Ax}(\mathcal {T}_{f})\) its structures must also satisfy \(\psi _{\vee }\).

Remark 1

The construction of \(\mathcal {T}^{s}_{f}\) from \(\mathcal {T}_{f}\) is very similar to the general construction of Definition 6. However, the corresponding result, Lemma 5, according to which all properties but convexity are preserved by this operation, is only shown in Lemma 5 for cases where the original signature is empty, which is not the case for \(\mathcal {T}_{f}\). Obtaining \(\mathcal {T}^{s}_{f}\) from \(\mathcal {T}_{f}\) is not done by adding a function symbol, but rather by changing the axiomatization of the already existing function symbol. While we do prove that \(\mathcal {T}^{s}_{f}\) has the required properties, a general result in the style of Lemma 5 for arbitrary signatures, with the ability to preserve an existing function symbol instead of adding a new one, is left for future work.

Example 7

Let \(\mathcal {A}_{n}\) be a \(\varSigma _s\)-model with domain \(\{a_{1}, \ldots , a_{n}\}\) such that: \(s^{\mathcal {A}_{n}}(a_{i})\) equals \(a_{i}\) if \(1\le i\le f_{1}(n)\), and \(a_{1}\) if \(f_{1}(n)<i\le n\) (the second condition may be void if \(n=1\)). Then \(\mathcal {A}_{n}\) is a model of both \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\).

If \(\kappa \) is an infinite cardinal, let \(\mathcal {A}_{\kappa }\) be a \(\varSigma _s\)-model with domain \(A\cup \{a_{n} : n\in \mathbb {N}\setminus \{0\}\}\) (where A is a set of cardinality \(\kappa \) disjoint from \(\{a_{n} : n\in \mathbb {N}\setminus \{0\}\}\)) such that \(s^{\mathcal {A}_{\kappa }}(a_{i})=a_{i}\) for each \(i\in \mathbb {N}\setminus \{0\}\), and \(s^{\mathcal {A}_{\kappa }}(a)=a_{1}\) for each \(a\in A\). Then \(\mathcal {A}_{\kappa }\) is a model of both \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\).

To show that \(\mathcal {T}_{f}\) is smooth and finitely witnessable, we construct, given a \(\mathcal {T}_{f}\)-interpretation. another \(\mathcal {T}_{f}\)-interpretation by (possibly) adding two disjoint sets of elements to the interpretation, one whose elements will satisfy \(s(a)=a\), and one whose elements will satisfy \(s(a)\ne a\).

To show that it is not strongly finitely witnessable, we use the following lemmas, which are interesting in their own right. According to the first, the \(\textit{mincard}\) function of \(\mathcal {T}_{f}\) is not computable.

Lemma 7

The \(\textit{mincard}\) function of \(\mathcal {T}_{f}\) is not computable.

The second lemma that is needed in order to prove that \(\mathcal {T}_{f}\) is not strongly finitely witnessable, is quite surprising. As it turns out, for quantifier-free formulas, the set of \(\mathcal {T}_{f}\)-satisfiable formulas coincides with the set of satisfiable formulas. That is, even though the definition of \(\mathcal {T}_{f}\) is very complex, it induces the same satisfiability relation, over quantifier-free formulas, as the simplest theory possible – the theory axiomatized by the empty set (or, equivalently, all valid first-order sentences).

Lemma 8

Every quantifier-free \(\varSigma _{s}\)-formula that is satisfiable is \(\mathcal {T}_{f}\)-satisfiable.

Note that Lemma 8 does not hold for quantified formulas in general. For example, the formula \(\forall \, x. \, s(x) \ne x\) is satisfiable but not \(\mathcal {T}_{f}\)-satisfiable: because \(f(1)=1\), every \(\mathcal {T}_{f}\)-interpretation \(\mathcal {A}\) must have at least one element a with \(s^{\mathcal {A}}(a)=a\).

Using Lemma 7 and 8, it is possible to show that \(\mathcal {T}_{f}\) is not strongly finitely witnessable:

Lemma 9

\(\mathcal {T}_{f}\) is not strongly finitely witnessable.

The idea of the proof of Lemma 9 goes as follows: assume for contradiction that there is a strong witness \(\textit{wit}\). The \(\textit{mincard}\) function for \(\mathcal {T}_{f}\) can then be defined as

$$\begin{aligned} \textit{mincard}(\phi )=\min \{|V/E| : E\in eq \, \text {and} \, \textit{wit}(\phi )\wedge \delta _{V}^{E}\, \text {is}\, \mathcal {T}_{f}\text {-satisfiable}\}, \end{aligned}$$
(1)

where eq is the set of all equivalence relations E on \(V=\textit{vars}(\textit{wit}(\phi ))\), being the corresponding arrangements denoted by \(\delta _{V}^{E}\). Clearly, the sets V and eq can be effectively computed. Also, by Lemma 8, testing for the \(\mathcal {T}_{f}\)-satisfiability of quantifier-free formulas is decidable. Together with our assumption that \(\textit{wit}\) is computable, we get that the \(\textit{mincard}\) function of \(\mathcal {T}_{f}\) is computable, which contradicts Lemma 7.

The arguments for \(\mathcal {T}^{s}_{f}\) are very similar, and require minor changes in the corresponding proofs for \(\mathcal {T}_{f}\).

Remark 2

We remark on the connection between the results regarding \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\), and those of [3]. What we show here is that \(\mathcal {T}_{f}\) (\(\mathcal {T}^{s}_{f}\)) is polite but not strongly polite. Figure 1 of [3] summarizes the relations between these two properties for the one-sorted case. It shows that polite theories that are axiomatized by a universal set of axioms, and whose quantifier-free satisfiability problem is decidable, are strongly polite. While \(\mathcal {T}_{f}\) is decidable for quantifier-free formulas (this is a corollary of Lemma 8), its presentation here is definitely not as a universal theory. On the other hand, [3] also shows that decidable polite theories for which checking if a finite interpretation belongs to the theory is decidable are also strongly polite. However, it is undecidable, given an interpretation, to check whether it belongs to \(\mathcal {T}_{f}\) (and \(\mathcal {T}^{s}_{f}\)): such an algorithm would lead to an algorithm to compute f as well. Thus, the theories \(\mathcal {T}_{f}\) and \(\mathcal {T}^{s}_{f}\) are polite, but do not meet the criteria for strong politeness from [3]. And indeed, they are not strongly polite.

4.4 Theories over Many-Sorted Non-empty Signatures

For the last column of Table 1, all possible theories can be obtained from theories that were already defined, using a combination of Definitions 4 to 6, and so there is no need to present additional theories specifically for many-sorted non-empty signatures.

Example 8

Line 1 includes the theory \(((\mathcal {T}_{\ge n})^{2})_{s}\), obtained from \((\mathcal {T}_{\ge n})^{2}\) using Definition 5, where the latter theory is obtained from \(\mathcal {T}_{\ge n}\) using Definition 4. This theory admits all properties, including convexity. To obtain a non-convex variant, the theory \(((\mathcal {T}_{\ge n})^{2})_{\vee }\) is constructed in a similar fashion, using Definition 6 instead of Definition 5.

With many-sorted non-empty signatures, we can always find an example for each combination of properties, except for those that are trivially impossible due to Theorems 1 and 2 (i.e., theories that are strongly finitely witnessable but not finitely witnessable and theories that are smooth but not stably infinite). This is nicely depicted by Fig. 6. Theorems 1 and 2 are represented in this figure by the location of the circles: the circle for smooth theories is entirely inside the circle for stably infinite theories, and similarly for strongly finitely witnessable and finitely witnessable theories. Then, for every region in this figure, the right-most column of Table 1 has an example, the sole exception being the region that represents unicorn theories.

Remark 3

For non-empty signatures, we chose to include functions rather than predicates. This is not essential as we can replace function symbols by predicate symbols by including the sort of the result of the function as the last component of the arity of the predicate, and then adding an axiom that forces the predicate to be a function.

5 Polite Combination Without Smoothness

Polite combination of theories was introduced in [10]. There, it was claimed that in order to combine a theory \(\mathcal {T}\) with any other theory using polite combination, it suffices for \(\mathcal {T}\) to be smooth and finitely witnessable (that is, polite). Later, in [6], this condition was corrected, and it was shown that in fact a stronger requirement is needed from \(\mathcal {T}\): it has to be smooth and strongly finitely witnessable (that is, strongly polite) to be applicable for the combination method.

Given that weakening strong finite witnessability to finite witnessability results in a condition that does not suffice, it is natural to ask whether there is any other way to weaken the required conditions for polite combination. Rather than weakening strong finite witnessability to finite witnessability, here we consider another option: weakening the smoothness condition to stable infiniteness. Thus, the main result of this section is that polite combination can be done for theories that are stably infinite and strongly finitely witnessable, even if they are not smooth.

Fig. 6.
figure 6

A diagram of the various notions studied in this paper. (Color figure online)

Our contribution can be understood by viewing Fig. 6, ignoring the circle that represents convexity (a property unrelated to the current section). [6] shows that polite combination can be done for the purple region, which represents smooth and strongly finitely witnessable theories. [6] also presented an example showing that expanding the same combination method to the blue region, which represents smooth and finitely witnessable theories, results in an error. Here we instead expand polite combination to the red region, which represents stably infinite and strongly finitely witnessable theories. Now, the red region, if not empty, is only populated by unicorn theories (see Sect. 4). If such theories do not exist, the result follows immediately. Until this is settled, however, we provide a direct proof, regardless of the existence of unicorn theories.

The next theorem shows that polite theory combination can be done for theories that are not necessarily strongly polite (smooth and strongly finitely witnessable), but rather that are simply stably infinite and strongly finitely witnessable.

Theorem 9

Let \(\varSigma _{1}\) and \(\varSigma _{2}\) be disjoint signatures with sorts \(S_{1}\) and \(S_{2}\); let \(\mathcal {T}_{1}\) be a \(\varSigma _{1}\)-theory, \(\mathcal {T}_{2}\) be a \(\varSigma _{2}\)-theory, and \(\mathcal {T}=\mathcal {T}_{1}\oplus \mathcal {T}_{2}\); and let \(\phi _{1}\) be a quantifier-free \(\varSigma _{1}\)-formula and \(\phi _{2}\) a quantifier-free \(\varSigma _{2}\)-formula.

Assume that \(\mathcal {T}_{2}\) is stably-infinite and strongly finitely witnessable w.r.t. \(S=S_{1}\cap S_{2}\), with strong witness \(\textit{wit}\). Let \(\psi =\textit{wit}(\phi _{2})\), \(V_{\sigma }=\textit{vars}_{\sigma }(\psi )\) for every \(\sigma \in S\) and \(V=\bigcup _{\sigma \in S}\textit{vars}_{\sigma }(\psi )\). Then the following are equivalent:

  1. 1.

    \(\phi _{1}\wedge \phi _{2}\) is \(\mathcal {T}\)-satisfiable;

  2. 2.

    there exists an arrangement \(\delta _{V}\) over V such that \(\phi _{1}\wedge \delta _{V}\) is \(\mathcal {T}_{1}\)-satisfiable and \(\psi \wedge \delta _{V}\) is \(\mathcal {T}_{2}\)-satisfiable.

It relies heavily on the following lemma, that proves that stable infiniteness and strong finite witnessability imply a weaker notion of smoothness. In this weaker notion, uncountable domains in the original structure \(\mathcal {A}\) are reduced to countable ones, and the function \(\kappa \), that dictates the cardinalities of models, is assumed to never assign an uncountable cardinal to any of the sorts.

Lemma 10

Let \(\varSigma \) be a signature with \(S\subseteq \mathcal {S}_{\varSigma }\), and \(\mathcal {T}\) a theory over \(\varSigma \). If \(\mathcal {T}\) is a stably-infinite and strongly finitely witnessable theory, both w.r.t. the set of sorts S, then: for every quantifier-free \(\varSigma \)-formula \(\phi \); \(\mathcal {T}\)-interpretation \(\mathcal {A}\) that satisfies \(\phi \); and function \(\kappa \) from \(S_{\omega }^{\mathcal {A}}=\{\sigma \in S : |\sigma ^{\mathcal {A}}|\le \omega \}\) to the class of cardinals such that \(|\sigma ^{\mathcal {A}}|\le \kappa (\sigma )\le \omega \) for every \(\sigma \in S_{\omega }^{\mathcal {A}}\), there exists a \(\mathcal {T}\)-interpretation \(\mathcal {B}\) that satisfies \(\phi \) with \(|\sigma ^{\mathcal {B}}|=\kappa (\sigma )\) for every \(\sigma \in S_{\omega }^{\mathcal {A}}\), and \(|\sigma ^{\mathcal {B}}|=\omega \) for every \(\sigma \in S\setminus S_{\omega }^{\mathcal {A}}\).

The proof of Theorem 9 goes as follows: first, we make the infinite domains corresponding to shared sorts of a model \(\mathcal {A}\) of \(\phi _{1}\wedge \delta _{V}\) at most countable, by applying Lemma 2. We then proceed similarly to the proof of the polite combination method in [6]: decrease a model \(\mathcal {B}\) of \(\psi \wedge \delta _{B}\) by using \(\textit{wit}\) as a strong witness; and then make the cardinalities of the shared sorts in \(\mathcal {B}\) equal those of \(\mathcal {A}\) (which are at most countable), by using Lemma 10.

This result greatly improves the state-of-the-art in polite theory combination, which requires proving that one of the theories is both smooth and strongly finitely witnessable. Thanks to this theorem, proving smoothness can be replaced by proving stable infiniteness, which is typically a much easier task.

6 Conclusion

As mentioned, there are two main contributions offered in this paper, both associated with the theme of theory combination. In Sect. 4, we provide a table with examples for almost all the combinations of stable infiniteness, smoothness, convexity, finite witnessability, and strong finite witnessability known not to be impossible. Section 3 provides theorems proving the sharpness of the examples provided. The second contribution is a new combination theorem, according to which polite theory combination can be done without smoothness, provided we have instead stable infiniteness.

Many ideas for future work rise from the studies here presented. A first direction would be to settle the question of whether unicorn theories exist: if they do not, a proof would probably involve an interesting generalization of the upward Löwenheim-Skolem theorem for many-sorted logic and would imply that strongly polite theories are just simply stably-infinite and strongly finitely witnessable theories, thus greatly simplifying the proof of Theorem 9; if unicorn theories do exist, one wonders if they can be combined in some meaningful way. Another direction of future work involves considering other model-theoretic properties in our table, such as shininess, gentleness, flexibility, and so on, as well as the effect of taking proper subsets of sorts for signatures containing more than one sort.