Random Models and Guarded Logic
Abstract
Building on ideas of Gurevich and Shelah for the Gödel Class, we present a new probabilistic proof of the finite model property for the Guarded Fragment of First-Order Logic. Our proof is conceptually simple and yields the optimal doubly-exponential upper bound on the size of minimal models. We precisely analyse the obtained bound, up to constant factors in the exponents, and construct sentences that enforce models of tightly matching size. The probabilistic approach adapts naturally to the Triguarded Fragment, an extension of the Guarded Fragment that also subsumes the Two-Variable Fragment. Finally, we derandomise the probabilistic proof by providing an explicit model construction which replaces randomness with deterministic hash functions.
Keywords and phrases:
guarded fragment, finite model property, probabilistic method2012 ACM Subject Classification:
Theory of computation Finite Model TheoryAcknowledgements:
I am deeply grateful to Prof. Emanuel Kieroński for his guidance and supervision throughout this work. I also thank the third reviewer of ICALP 2025 for providing detailed and valuable feedback on an earlier version of this paper.Funding:
Polish National Science Center, grant No. 2021/41/B/ST6/00996.Editors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim ThắngSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
In this work we consider First-Order Logic (FO) without function symbols of positive arity. The Guarded Fragment (GF) is a fragment of FO in which quantifiers are relativised by atomic formulas. Syntactically, it is obtained by restricting quantification to the forms:
where is an atomic formula, called a guard, mentioning all variables in and .
For example, the following sentence, describing a professor–student scenario, is in GF:
| (1) |
where and serve as guards. In contrast, the following sentence is not in GF, since the quantifier is not guarded by a single atomic formula:
| (2) |
Andréka, van Benthem, and Németi [2] introduced the Guarded Fragment as a generalisation of modal logic, aiming to transfer its key properties into the richer framework of First-Order Logic. They established the decidability of satisfiability, and Grädel [18] later proved the complexity to be -ExpTime-complete; under bounded number of variables or bounded arity of relation symbols, the complexity drops to ExpTime-complete.
The decidability of GF is impressively robust: it is preserved under numerous extensions, including fixed points [19], transitive or equivalence guards [25, 24], and (negated) conjunctive queries [5]. Further decidable fragments have been obtained by relaxing the notion of a guard. They include the Loosely, Packed, and Clique-Guarded Fragments [30, 26, 17], the Guarded Negation Fragment [6], and the Triguarded Fragment [29].
Motivations.
In addition to decidability, a central question in the study of logical fragments is the finite model property: namely, whether every satisfiable sentence admits a finite model. For the Guarded Fragment, the finite model property is known to hold, with a doubly exponential upper bound (in the length of the sentence) on the size of minimal models.
The first proof of the finite model property for GF was given by Grädel [18], relying on a deep combinatorial theorem by Herwig [21]. While Grädel’s approach was elegant in its logical formulation – using Herwig’s result as a black box – the underlying construction is technically involved. Moreover, this proof yields only a triply-exponential upper bound on the size of minimal models, which is far from being optimal. A significant improvement came from Bárány, Gottlob, and Otto [4], who established an optimal doubly-exponential bound. Their approach involves analysing finite guarded bisimilar covers of hypergraphs and relational structures, substantially generalising Rosati’s finite chase [28]. In fact, their result extends beyond GF, covering the richer setting where (negations of) conjunctive queries are also allowed. A simplified version tailored specifically to GF appears in Pratt-Hartmann’s book [27], though we believe that even this version remains challenging to follow.
As the existing proofs of the finite model property for GF are unexpectedly difficult, it is natural to ask: Can we find simpler proofs of this fundamental result?
A perspective that connects abstract model theory with applied computer science arises in knowledge representation and reasoning, a subfield of artificial intelligence. In this context, the Guarded Fragment can serve as a logical foundation for decidable reasoning frameworks, subsuming and extending the basic description logics (DLs) of the family (for an introduction to DLs, see, e.g., [3]). Here, objects from applications such as databases, knowledge bases, or computer programs are represented as logical structures, while formulas act as a declarative specification language describing their properties. Algorithms for satisfiability then become reasoning engines: given a formula, they decide whether an object satisfying the imposed logical constraints exists.
Over the years, a variety of algorithms solving satisfiability for the Guarded Fragment have been developed, ranging from purely theoretical decision procedures (e.g., [18]) to practically implementable methods based on resolution, saturation, or tableau (e.g., [9, 23, 22]). A key aspect is that many of these algorithms not only decide satisfiability but also produce a finite combinatorial object: a certificate of formula consistency.
Our interest lies in the subsequent step: How to turn such certificates into explicit finite models? Since smaller models are typically more useful – both for computational efficiency and for practical interpretability – the central challenge is to generate finite models as small as possible: not only close to the theoretical doubly exponential bounds, typically considered up to polynomial slack in the second-level exponent, but actually sharpened to within constant factors and detailed structural parameters of sentences.
Main Contribution.
In this work, we give a new proof of the finite model property for GF, yielding the optimal doubly exponential bound on the size of minimal models. To the best of our knowledge, no earlier proof exhibits comparable simplicity and self-containment.
We employ a probabilistic approach inspired by Gurevich and Shelah’s proof of the finite model property for the Gödel Class [20]. The central idea is the following: given a formula and a (possibly infinite) model with , we define a random procedure that generates a finite structure with domain of size . We then prove that, once exceeds a certain threshold depending only on , the probability that becomes strictly positive. Consequently, some finite must be a model of , yielding the finite model property with an upper bound on the minimal model size that matches this threshold.
Applying this probabilistic method to the Guarded Fragment, we establish our main result: every satisfiable GF-sentence has a finite model whose domain size is
In this work, we assume that measures the uniform length of : formulas are viewed as words over an infinite alphabet consisting of parentheses, logical connectives, quantifiers, variables, relation symbols, and constants, with each symbol contributing to the length.111The uniform length differs from the bit-length of formulas (finite alphabet), in which distinct variables or symbols requires bits.
To witness the tightness of our upper bound, we construct a family of sentences whose minimal models have domains of size at least It is an improvement upon earlier approaches for enforcing large models in GF, as they only achieved domain sizes of (cf. [18]). Consequently, our probabilistic model construction yields an essentially optimal upper bound, up to constant factors in the second-level exponent.
Theorem 1.
There exist universal constants such that the following holds.
-
1.
Every satisfiable GF-sentence has a finite model whose domain size is at most
-
2.
For every , there exists a satisfiable GF-sentence with such that any model of must have domain size at least
The upper bound of Theorem 1 is clean and elegant, but it is stated solely in terms of the length of and an unspecified constant in the second-level exponent. We complement this result by deriving a more precise bound on the size of minimal models. For a concise formulation, we express it in terms of the number of (atomic) -types – that is, maximal consistent configurations of literals over variables (see Section 2 for a formal definition).
Given a sentence , its induced signature is the set of all relation and constant symbols occurring in . The width of , denoted , is the maximum arity of any relation symbol in . We define the expanded normal-form signature from as follows: for every subformula of that begins with a maximal block of quantifiers and which is not a sentence (i.e., has free variables), we introduce a fresh relation symbol whose arity equals the number of free variables of (which is at most , since is required to be guarded).
Note that the construction of preserves width, i.e., , does not introduce new constants, and keeps the overall size of linear in .
Theorem 2.
There exist sequences and with , , and such that the following holds for every .
Let be any satisfiable GF-sentence, and let be its expanded normal-form signature. Denote . If , then has a finite model whose domain size is at most
where is the set of all -types over .
The exponent in Theorem 2 converges to as . Informally, Theorem 2 can thus be read as stating that every satisfiable GF-sentence admits a finite model of domain size proportional to provided that the width is sufficiently large.
At first sight, working with the expanded normal-form signature rather than the induced one may seem unintuitive. However, this choice is in fact a consequence of the semantics of guarded sentences: a quantified subformula with free variables naturally defines a relation in a structure , namely To simplify the quantifier structure of a sentence, a standard technique is to transform it into a suitable normal form (see Section 3 for a definition). The normal-form reduction makes such implicitly defined relations explicit by introducing corresponding relation symbols. As a result, it distinguishes elements that are locally – i.e., at the level of atomic types – indistinguishable in the induced signature, but differ in their satisfaction of quantified subformulas.
Example 3.
To illustrate, consider the following (slightly abstract) GF-sentence:
This sentence is satisfied in a model with domain , where and . The variables , , are witnessed by the elements , , ; and the variable by element . Notice, however, that in the induced signature , elements and are indistinguishable at the level of -types: both satisfy only the unary predicate .
Let and denote the subformulas that begin with quantifiers and , respectively. The expanded normal-form signature introduces two additional predicates and , which record the different roles of and in the model: and .
Finally, note that the subformulas starting with or are subsentences; and those with or do not begin with a maximal block of quantifiers. Hence we do not introduce fresh relation symbols for them. Thus the resulting signature is .
Triguarded Fragment.
The Guarded Fragment (GF) and the Two-Variable Fragment () are among the most prominent fragments of First-Order Logic. Both capture a wide range of modal and description logics and are decidable, yet they differ substantially and are incomparable in expressive power. In particular, GF cannot express certain basic properties, expressible in , such as
To unify these two perspectives, Rudolph and Šimkus [29] introduced the Triguarded Fragment (TGF), building on related ideas developed earlier in [23, 8].
The key idea of TGF is to relax the quantification restrictions of GF: formulas with at most two free variables may be quantified freely, while the guardedness requirement is retained for formulas with three or more free variables (hence the name “tri-guarded”). This way, TGF subsumes both and GF, while also capturing properties beyond their reach. For instance, in formula (2), the quantifier is admissible in TGF because the quantified subformula has only two free variables, and , whereas the quantifier is required to be guarded, and indeed is by the atom . Hence (2) belongs to TGF.
An important distinction concerns the role of equality. While both and GF remain decidable in the presence of equality, the satisfiability problem for TGF with equality is undecidable. The reason is that TGF is expressive enough to encode the Gödel Class (i.e., the prefix class ), which was shown to be undecidable in the presence of equality by Goldfarb [13]. Excluding equality suffices to restore decidability of satisfiability, with complexity -ExpTime without constants and -NExpTime when constants are allowed [29].
Returning to the finite model property, Kieroński and Rudolph [24] proved that the equality-free fragment of TGF has the finite model property, with an optimal doubly exponential bound on minimal model size. Their proof, however, is technically intricate: it uses the finite model property for GF as a black box and adds a further combinatorial construction that carefully glues several structures into a single model.
In contrast, our probabilistic approach to GF extends seamlessly to TGF, yielding a considerably simpler proof of the finite model property for this broader fragment. Moreover, it also achieves the optimal doubly-exponential upper bound on minimal model size.
Theorem 4.
There exists a universal constant such that the following holds. Let be a satisfiable equality-free sentence of TGF. Then has a finite model whose domain size is at most
Derandomisation.
As mentioned earlier, the satisfiability problem for the Guarded Fragment is -ExpTime-complete [18]. Yet, although the probabilistic construction shows that every satisfiable sentence has a model of doubly exponential size, this alone does not imply that such a model can be constructed in time matching the decision complexity. Indeed, the number of structures of doubly exponential size is triply exponential.
From a practical point of view, this gap is minor: our randomised construction succeeds with probability at least while sampling structures over a domain of doubly exponential size. Nevertheless, from a theoretical standpoint it leaves a conceptual separation between reasoning and model building: deterministic vs. randomised time complexity.
We close this gap by providing a constructive, fully deterministic version of Theorem 1. The central idea is to replace the random choices by carefully selected deterministic ones, using families of hash functions that mimic the statistical properties of true randomness. We then prove that these deterministic choices always produce a valid model.
In our formulation, we rely on the notion of a witness of satisfiability: a finite combinatorial object – namely, a set of -types satisfying specific closure and consistency properties – that certifies the satisfiability of a sentence. Its definition is deferred to Section 3; for the present discussion it suffices to know that such a witness can be computed from a satisfiable sentence in -ExpTime [18, 27]. On this basis we obtain the following constructive guarantee:
Proposition 5.
There exists a deterministic algorithm with the following property: given a witness of satisfiability for a GF-sentence , the algorithm constructs a structure with domain of size such that , where the parameter satisfies . The algorithm runs in doubly exponential time in the length of .
Related Work.
Beyond Gurevich and Shelah’s approach for the Gödel class [20], the probabilistic method has been employed in several other proofs of the finite model property.
One of the earliest and most influential applications of probabilistic techniques in logic is Fagin’s proof of the – law for First-Order Logic [10]. A notable consequence of Fagin’s argument is that any finite subset of the theory of the Rado graph admits a finite model.
Goldfarb, Gurevich, and Shelah subsequently extended the approach of the latter two authors to the so-called subminimal Gödel class with identity [16]. Goldfarb later developed probabilistic proofs for additional decidable fragments, namely a solvable Skolem class [15] and the Maslov class [14]. For recent applications of the probabilistic method, see [11, 12].
Technical Overview.
We begin in Section 2 by introducing the basic notation and conventions used throughout the paper. Section 3 provides the necessary background on GF, including its syntax, the normal form, and a satisfiability criterion. Building on this, Section 4 develops probabilistic constructions of finite models for GF. In Section 5, we construct sentences enforcing models that tightly match the upper bound established in Section 4. Section 6 demonstrates that our methods extend naturally to TGF. In Section 7, we give a deterministic procedure for constructing finite models. Finally, Section 8 concludes the paper and discusses directions for future research.
The missing material is provided in the full version of the paper. Beyond the technical details omitted here, the full version also contains additional results, remarks, and examples.
2 Preliminaries and Notation
We denote the set of natural numbers including by . For , the notation stands for the set , with the convention that . More generally, we use interval notation to denote the set whenever , and the empty set whenever . For a set , we denote by the powerset of , and by the set of all -subsets of . If , we also use for the set .
First-Order Logic.
We assume general familiarity with First-Order Logic (FO). The logical symbols are , and the quantifiers . Formulas may also use non-logical symbols: relation symbols of arbitrary arity (from a countably infinite set), constant symbols (also from a countably infinite set), and variables (again countably many). We do not allow function symbols. The length of a formula , denoted , is defined as the total number of symbols it contains, where each occurrence of a symbol – be it a variable, relation symbol, or constant – contributes . We use to denote the set of free variables of .
A signature is a finite set of symbols, partitioned as , where is the set of relation symbols and is the set of constant symbols. We require . Every relation symbol comes with associated arity, denoted . We require . The width of , denoted , is the maximum arity of any symbol in . The signature of a formula is the finite set of relation and constant symbols that appear in the formula.
We use Fraktur letters such as to denote structures, and the corresponding Roman letters for their domains. A -structure is a structure that interprets the symbols in : a relation symbol as a relation with denoting the arity of ; and a constant symbol as an element . If , we write for the restriction of to the subdomain . Note that must include all interpretations of constant symbols to remain a -structure. The structure is empty if it contains no facts, i.e., for all relation symbols ; however, we do not insist (and even forbid) that the domain is the empty set . The size of a structure is the cardinality of its domain.
With respect to satisfiability, equality between constants can be eliminated by a straightforward reduction: if a formula has a model satisfying , then can be replaced by throughout the formula, without affecting satisfiability. Thus we work under the standard name assumption requiring that constants are interpreted in structures by themselves. Given a -structure , we partition its domain as , where and are disjoint sets of unnamed and, respectively, named elements.
Types.
Fix a signature . For , let denote the set of all non-equality literals over relation and constant symbols from and variables .
For , a -type over is a maximal consistent subset of . A type is simply a -type for some . We write for the set of all -types over , and .
Claim 6.
For every , we have
We denote by the type consisting exclusively of negative literals (the value of will be clear from the context).
If , we write to indicate that a -type is contained in an -type .
For , we define: and , that is, the boundary and interior of . The set of all boundary -types is .
A -type is called guarded if either or contains a positive literal with i.e., . Note that necessarily .
Given a -tuple of distinct unnamed elements of a -structure , we write for the unique -type realised by in . Formally, is the set of literals such that , where is the assignment that sends for every . The collection of all -types realised in is denoted
It is convenient to view -types themselves as -structures over the canonical domain . This allows us to use structure-like notation; for instance, if , we may write for the -type induced by on the variables and .
3 Technical Background on Guarded Fragment
In this section we formally introduce the syntax of the Guarded Fragment, together with the normal form and a satisfiability criterion. The material presented here is mostly a direct adaptation of Grädel’s work [18] and is included primarily for the reader’s convenience. In particular, no claims of novelty are made here. For a comprehensive introduction to the Guarded Fragment, see also Chapter 4 in Pratt-Hartmann’s monograph [27].
Syntax of GF.
We formalise the syntax of the Guarded Fragment in Definition 7.
Definition 7.
The Guarded Fragment (GF) is the set of formulas in First-Order Logic generated by the following rules:
-
(i)
Every atomic formula belongs to GF.
-
(ii)
GF is closed under Boolean connectives.
-
(iii)
Let be a tuple of variables, let be a formula in GF, and let be an atomic formula. If and , then both and belong to GF.
The atom in rule (iii) is called a guard.
Note that equality may serve as a guard: the formula is in GF whenever and . This allows for free quantification over individual elements.
Normal Form.
Let be a sentence in GF. Then is in normal form if it is a conjunction of a finite number of guarded existential, guarded universal, and guarded Skolem sentences:
where and are disjoint tuples of distinct variables, and are guards, and are quantifier-free formulas. The notation only highlights that the set of free variables of is contained in the tuple . However, it does not imply that all of them are actually used by . In particular, when is an atom, the variables can occur in any order and with repetitions. Also the actual sets of free variables of , , and can vary with . Nevertheless, we require that each conjunct is properly guarded. For every relevant index , the following must hold: if corresponds to an existential or universal conjunct, then ; if corresponds to a Skolem conjunct, then and , where in both cases the tuples and may depend on .
Lemma 8 reduces the finite model property for GF to the normal-form case. Moreover, any upper bound on minimal model size that depends only on the length and signature, and is proved for normal-form sentences, naturally carries over to arbitrary GF-sentences.
Lemma 8.
Let be a GF-sentence over a signature . Then there exists a normal-form GF-sentence over an expanded signature such that the following conditions hold.
-
1.
The sentences and are equisatisfiable.
-
2.
If is a -structure with , then the -reduct of is a model of .
-
3.
for some fixed constant .
-
4.
The expanded signature is obtained from as follows: for every subformula of that begins with a maximal block of quantifiers and is not a sentence (i.e., has free variables), introduce a fresh relation symbol whose arity equals the number of free variables of (which is at most , since is required to be guarded).
Satisfiability Criterion.
We now formulate a sufficient criterion for the satisfiability of sentences in GF. This allows us to modularise the argument and clearly separate the general properties of guarded logic from the new components of our proof.
Let be a signature. A set of types is said to be closed (under reductions) if the following holds: for every which is a -type for some , and for every and choice of distinct indices , the type also belongs to . Further, the set is said to be consistent if it contains a unique -type.
Definition 9.
Let be a signature, and let be a family of sets of -types over , where for each . Let be a -structure with domain , and let .
-
(i)
We say that is -guarded if, for every and every , whenever the -type is guarded, it holds that .
-
(ii)
We say that has the -extension property if, for every and every pair such that , the following holds: whenever satisfies , there exists an element such that .
Lemma 10.
Let be a normal-form GF-sentence over a signature . Suppose is satisfiable. Then there exists a closed and consistent family of sets of -types , where for each , such that the following holds: whenever a -structure is -guarded and satisfies the -extension property, then .
Let be a GF-sentence in normal form. If a family of sets of -types satisfies the conditions of Lemma 10, then we call it a satisfiability witness for . Assuming that is satisfiable, one may obtain a satisfiability witness for by taking the collection of all -types, with , that are realised in some (possibly infinite) model of . This argument is inherently non-constructive; see [27] for a procedure that decides satisfiability and, if so, computes a corresponding satisfiability witness in -ExpTime.
W.l.o.g. we will always assume for all . By Claim 6, we have that
| (3) |
provided that is the induced signature of .
4 Probabilistic Model Constructions
In this section we establish Theorems 1 and 2. We begin with an informal overview of the probabilistic approach (Subsection 4.1), and then develop the technical details in two stages. First, in Subsection 4.2, we present the baseline method of Independent Sampling, which already yields a doubly-exponential upper bound, sufficient for proving Theorem 1. Next, in Subsection 4.3, we refine the construction via Markovian Sampling, achieving a sharper bound that is necessary for proving Theorem 2.
4.1 Informal Overview
To gain intuition, let us start with Gurevich and Shelah’s probabilistic proof of the finite model property for the Gödel Class [20]. Consider a sentence in the shape of , where is quantifier-free and uses only predicates of arity and . Assuming that has a model , we generate a finite random structure as follows. First prepare a domain of size and assign to its elements the -types realised in , so that each -type is assigned roughly to the same number of elements. Then we set the -types: for each pair of distinct elements choose a -type randomly from those -types realised in whose endpoints agree with the already defined -types of and . When is large enough, the structure becomes a finite model of . To see this, consider any two elements of . Let be a pair in realising the same -type as . With probability at least , for a certain fixed independent of number , some element of extends the -type of to a -type in the same way as a correct witness in extends the -type of . By the union bound over all such pairs , we get .
Imagine now a hypothetical generalisation of this method to sentences in the shape of , where uses symbols of arbitrary arity. We first assign -types, then randomly choose -types, …and when trying to assign -types, we get stuck. Indeed, the independent random choices could generate a configuration of -types on pairs , , and which is not induced by any -type realised in .
Suppose now that is a guarded sentence in normal form. If we decide not to put any facts speaking about or any of its supersets, then a guarded sentence cannot notice that this unintended pattern has occured. Therefore, the following strategy appears natural. We first assign the -types, then proceed by randomly choosing the -types, and for the -types we act as follows. For each triple , we randomly select a -type . However, before assigning to , we first check whether is compatible with the pattern induced by the previously defined -types on . (We make the notion of compatibility precise in a moment.) If it is indeed compatible, then we set the -type of to ; otherwise, we simply omit this triple and continue with the remaining ones. In a similar manner, we can then specify the -types also for .
Assuming an appropriate choice of the parameter and relying on careful probability estimates, we show that, although many tuples are omitted due to conflicts between -types, there is still a significant chance that all required witnesses exist for all tuples. Consequently, we conclude that there is a sequence of random choices that produces a finite model for .
4.2 Baseline: Independent Sampling
In this subsection we prove Proposition 11. Combined with Lemmas 8 and 10, it yields the upper bound of Theorem 1: every satisfiable GF-sentence admits a finite model whose domain has cardinality . (The lower bound of Theorem 1 is proven in Section 5.)
Proposition 11.
There exists a constant such that the following holds. Let be a normal-form GF-sentence with signature . If is a satisfiability witness for , then has a finite model with unnamed domain of size at most
To prove Proposition 11, we describe a procedure that generates a -structure from a witness of satisfiability . The procedure is given in Algorithm 1. In addition to , the algorithm takes as input a parameter , specifying the size of the unnamed part of the domain of . The analysis of the algorithm is carried out in Lemma 12.
In Algorithm 1, we rely on the following notion to determine a set of -types to which a given configuration of atoms can be extended. Let and let be -types. We say that and are compatible if these -types agree on every literal that mentions a strict subset of the variables , i.e., the interiors of and are the same: . For instance, -types are compatible if they agree on the -types corresponding to their endpoints and but possibly differ on some literals that use both and ; similarly -types are compatible if they agree on the -types induced on , , and but possibly differ on some literals that use simultaneously , , and ; and so on for larger . In particular, -types are compatible if they agree on constants.
Lemma 12.
There exists a fixed constant such that the following holds: if is the signature of , is a satisfiability witness for , and the parameter is chosen so that
then the structure generated by Algorithm 1 satisfies with probability at least .
Proof of Lemma 12.
W.l.o.g. assume .222If with the unique -type, then is satisfiable already in the domain . If where is a -type and a -type, then is satisfiable in the domain . Set .
For the analysis, we introduce a family of random variables . For each and each -tuple , the variable records the -type chosen by Algorithm 1 at Line 1 when processing . Thus, is uniformly distributed over , and the variables in are mutually independent.
Note that each -tuple is assumed to be ordered increasingly. For a permutation , we will naturally write i.e., is the -type reindexed according to . This convention is adopted mainly for convenience in later proofs. As the witness of satisfiability is closed under reductions (and hence under permutations of -types), this convention will not be problematic.
Claim 13.
For every and every -tuple , the following holds:
-
1.
For any -type , we have whenever
for every and every . -
2.
If , then .
Proof.
Observe first that Algorithm 1 initialises with facts only on the constants, and subsequently proceeds by monotonically adding new facts in each iteration. More precisely, when processing a tuple , there are two possibilities: either remains unchanged, or the -type on is set to . Crucially, the latter occurs only if is compatible with the atoms already defined in , i.e., Thus, only the boundary of – that is, the facts whose scope satisfies – may be modified: is set to . Moreover, boundaries corresponding to distinct tuples are disjoint, and therefore never interfere with each other. Consequently, for every , we have either
or else remains equal to throughout.
The claim follows easily from the above explanation. Item 1 can be proven by induction over the subtuples of . Assume that every proper subtuple has already been assigned the -type . Since , the compatibility test at Line 1 succeeds, and the algorithm assigns the type to . Item 2 is immediate.
The proof of Lemma 12 rests on three auxiliary claims. Claim 14 establishes that is -guarded with certainty. Claims 15 and 16 establish that satisfies the -extension property with probability at least . By Lemma 10, these two properties imply .
Claim 14.
The structure is -guarded in every realisation, i.e., deterministically.
Proof.
It is readily verified that the -type of is the unique element of . Likewise, every -type realised in comes from : for every , its -type is given by .
For , we fix a -tuple such that its -type is guarded, i.e., it contains a positive literal with . As belongs to the boundary of , we have that . From Claim 13, it follows that .
Claim 15.
Let and let . Fix a -type and a -type satisfying that . Define to be the probabilistic event that
Then .
Proof.
Assume that , as otherwise and the claim holds trivially. We condition on the probabilistic event .
Enumerate the elements of as . Let us fix . We argue that, with probability at least , it happens that . From Claim 13, it follows that whenever, for every and every , we have that . Since and is fixed, we can restrict our attention to subsequences having . Consequently, the random event , under the condition , can be expanded as
| (4) |
Using the independence of variables in , the probability can be lower bounded by as follows:
| (5) |
We keep the -tuple , the -type , and the -type fixed as before, as well as the condition . We now bound the probability that no candidate for makes . Since is fixed, the events , where ranges the set , are mutually independent. Indeed, by (4), they are generated by disjoint subsets of . Hence the event happens with probability at most
| (6) |
In the last inequality, we use that , for any , to move to the exponent.
We conclude that , as claimed.
Claim 16.
Let . If then the structure satisfies the -extension property with probability at least .
Proof.
The structure satisfies the -extension property precisely when none of the events occur. Applying the union bound, we estimate the probability of the complementary event – that at least one of the events occurs – as follows:
| (7) |
where the summation ranges over the set
| (8) |
The notation implicitly assumes that is sorted in increasing order. Since is closed, it suffices to consider the events only for such tuples.
By Claim 15, we have the estimate on probability: Since determines and for all , we have the estimate on size: . Combining these estimates yields (7).
Let denote the right side of (7). We require . Taking natural logarithms on both sides of yields
| (9) |
Rearranging (9) to isolate gives
| (10) |
By collecting the terms in (10) into two groups and , we can rewrite the inequality as
The inequality holds whenever Since
it follows that choosing ensures , thereby establishing the claim.
4.3 Alternative: Markovian Sampling
It is important to note that Proposition 11, proved in Section 4.2, is not strong enough to yield Theorem 2. To achieve the sharper bound stated in Theorem 2, we refine the method of Section 4.2 and establish Proposition 17. Theorem 2 then follows from the observation that , where as the width .
Proposition 17.
There exists a constant such that the following holds. Let be a normal-form GF-sentence with signature . If is satisfiable, then it has a finite model with unnamed domain of size at most
Let us first see where the bottleneck of Algorithm 1 occurs. When processing a tuple , Algorithm 1 samples a -type uniformly at random, independently of all previous choices. Only a posteriori it verifies whether the chosen is compatible with the already defined structure on . This leads to a loss of probability, as many samples are rejected.
To improve this, we incorporate information from previous decisions directly into the sampling process. The key idea is to replace independent sampling with a Markovian scheme: when considering a tuple , we first determine whether the pattern induced by the already fixed structure on can be extended to a -type in . If so, we choose uniformly at random among the -types that are compatible with this pattern; if not, we simply omit the tuple , forcing all atoms involving precisely those unnamed elements to be false. In this way, every random choice has a higher chance of being accepted, boosting the overall success probability of the procedure.
We formalise this idea in Algorithm 2. Its analysis follows the same general scheme as that of Algorithm 1 (Lemma 12). In particular, Claims 13 and 14 remain valid without modification. The analogue of Claim 15 requires exploiting the Markov property in place of full independence. The details are deferred to the full version.
5 Tightness Analysis: Enforcing Large Models
Setting , Proposition 11 provides an upper bound of on the size of minimal finite models for sentences in GF. In this section we show that this bound is essentially tight: we explicitly construct a family of GF-sentences whose minimal models match this doubly exponential upper bound, up to constant factors in the second-level exponent. Hence we establish the lower bound of Theorem 1: for specific sentences , models of size are necessary.
Proposition 18.
There exists a family of GF-sentences such that each contains neither constants nor equality, is over a signature with , satisfies for some fixed constant , and is satisfiable, but only in domains of size at least .
The general strategy for enforcing large models is to encode within them a combinatorial object of the desired size. A well-known technique for enforcing models of size is to encode -bit numbers from the range . However, let us highlight that the standard constructions appearing in the literature (e.g., [18, 27]) yield formulas of size . Consequently, they enforce models of size only which is asymptotically much smaller than the upper bound from Proposition 11; even when compared at the doubly logarithmic scale, since . That said, it should be noted that these lower bounds were developed primarily to establish complexity lower bounds, rather than to enforce large domain sizes.
The bottleneck arises from the way these encodings represent -bit numbers: fix two distinct elements . A pair is used to encode a -bit number . The -th bit of is set to precisely when the atom holds, where the tuple corresponds to the binary representation of . Otherwise the -th bit of is set to .
Yet, specifying that some two sequences and correspond to respectively the -th and -st bits of requires examining different cases to account for potential carries, which forces formulas of size .
To reach the optimal lower bound of a different construction is required. Our approach is to encode the powerset of the set of all permutations of elements, which has cardinality We use a certain decomposition of permutations from [12] to achieve this with formulas of length , thereby ensuring the desired growth rate.
Proof of Proposition 18.
Fix an integer . We shall construct a GF-sentence designed to encode the powerset of (the set of permutations of ). The signature of contains the following relation symbols:
| (13) |
where the arity of and is ; of is ; of , , and is ; of is ; and the symbols and are all unary. We write and for the short-hand tuples that occur repeatedly below. Let denote the cyclic permutation , and let denote the transposition swapping and .
The construction relies on encoding subsets of the symmetric group . We begin with a fixed “ground set” of size , represented by some -tuple of elements, denoted .
For every subset we postulate the existence of a witness element . The witness is linked uniformly to all permutations of the ground set: for each we require . The actual membership of a permutation in is then expressed via the predicate : if and only if . This forces distinct subsets to be represented by distinct witnesses . Thus, if we succeed in enforcing the existence of witnesses for all subsets of , the model will contain at least distinct elements.
To navigate between different subsets, observe that one can transform any subset into any other by toggling permutations one by one. We capture this stepwise modification using the relation : the atom is intended to hold precisely when the symmetric difference of and is the singleton .
To axiomatise the relation , we employ a certain decomposition of permutations, which will be implemented using the remaining auxiliary predicates. Details of this decomposition and its encoding will be presented below.
We first postulate the existence of the ground set and an initial witness:
| (14) |
In what follows, we denote the tuple witnessing for by . We require the components of to be pairwise distinct. For this we axiomatise that holds for distinct . However, the obvious sentence would be of size . To keep the formula of size linear in , we use the auxiliary predicates :
| (15) |
Next, we ensure that witnesses respect the intended invariant: for every witness and every permutation we must have . Since is generated by and , it suffices to enforce closure under these two transformations:
| (16) |
We now enforce that every set can be extended to a set differing precisely on a single permutation . Formally, we require that for each permutation tuple and each witness , there exists another witness that differs exactly on the membership of :
| (17) |
To axiomatise that the witnesses and agree on every other permutation , i.e., , we employ the following combinatorial lemma.
Lemma 19 (Lemma 7.2 in [12]).
Let be permutations. Then if and only if for some and some fixing (i.e., ).
We implement the decomposition of Lemma 19 using the auxiliary predicates , , , and . Intuitively: increases the counter along powers of ; introduces the action of restricted to , generated by and : ; decreases the counter via powers of ; and provides the successor relation on the counter elements. The counter itself is represented by the last argument, where an element marked by with indicates the difference (, as in Lemma 19). This ensures that we never reach or , thereby avoiding the trivial case .
We axiomatise as:
| (18) |
Next, we generate permutations of the form for :
| (19) | |||
| (20) |
Then, we generate permutations of the form , where fixes . The subgroup is induced by and : . We enforce:
| (21) | |||
| (22) |
Finally, we generate permutations of the form with :
| (23) | |||
| (24) |
By Lemma 19, every admits a representation such that holds. We then enforce membership agreement between and on all such permutations:
| (25) |
We define to be the conjunction of the sentences (14)–(25). Since each conjunct has length , the resulting sentence satisfies . Moreover, the signature of has width , as required. Finally, by the discussion above, guarantees the existence of a distinguished tuple and, for every subset , a corresponding witness . Since the elements and are distinct whenever , every model of contains at least distinct elements. This completes the proof of Proposition 18.
6 Extension to a Stronger Fragment: Triguarded Fragment
The Triguarded Fragment (TGF) extends the Guarded Fragment by admitting one additional rule in the syntax of GF (Definition 7):
-
(iv)
Let be variables and let be a formula in TGF. If , then both and belong to TGF.
Rule (iv) relaxes the guarding requirement of GF in the case of formulas with at most two free variables. Thus, TGF permits unguarded quantification over pairs of elements. To compare, recall that GF allows for free quantification only over individual elements.
In this section we establish Theorem 4, showing that the equality-free subfragment of TGF enjoys the finite model property with a doubly exponential upper bound on model size.
Proof of Theorem 4.
To unify the syntax of GF and TGF, it is convenient (following [29]) to introduce an auxiliary fragment, denoted GFU. This is simply GF over signatures extended by a distinguished binary symbol , interpreted as the full binary relation on the domain. In the terminology of description logics, is referred to as a universal role. With this convention, rule (iv) can be viewed as a special case of the guarded quantifier rule (iii), with acting as a dummy guard for formulas with at most two free variables. In particular, Theorem 4 is obtained as a corollary of Theorem 1, in combination with the following lemma.
Lemma 20.
Let be a satisfiability witness, and let be arbitrary. Assume that satisfies the following condition:
| for every pair of -types , there exists a -type such that | ||
| its endpoints are and , that is, and . |
Then Algorithm 2 given and generates the structure with the property that between every pair of elements the -type is defined, i.e., for all distinct .
The constraint on the satisfiability witness in Lemma 20 guarantees that the symbol is interpreted as a universal relation: it ensures that Algorithm 2 always has at least one compatible -type to assign to every pair of elements.333Note that this property does not hold for Algorithm 1, since it selects -types from the entire space rather than restricting to those compatible with the already assigned -types.
The model construction for GFU is clearly sound: given a witness satisfying the constraint of Lemma 20, the algorithm produces a valid model . A natural question is whether this condition is also complete – i.e., whether for every satisfiable GFU-sentence we can always find a model of and extract a witness from that satisfies this constraint.
The sufficient condition for completeness is straightforward: the only problematic case arises when both -types are identical. Hence the requirement reduces to ensuring that, for every -type realised in a model, there exist at least two distinct unnamed elements realising it.444Recall that, by our (non-standard) convention, -types are defined only for unnamed elements. A standard argument shows that such models always exist for equality-free sentences: given a structure , we define to be a structure with domain , where each constant is identified with . For every relation symbol and every sequence , we put whenever . Then and satisfy the same equality-free sentences (see Lemma 6.2.26 in [7]).
Consequently, by the reduction to the equality-free GFU, this establishes Theorem 4.
7 Derandomisation: Explicit Model Construction
In Section 4 using probabilistic arguments we established Theorem 1: every satisfiable sentence of GF admits a finite model of doubly exponential size. However, the probabilistic proof is inherently non-constructive: it does not produce a concrete model of , but instead shows only that models of constitute a non-zero fraction of all structures of the given size.
We now turn to a constructive variant of Theorem 1. Our strategy is to derandomise the probabilistic proof by giving explicit values for the random choices in Algorithm 1. The resulting deterministic procedure (Algorithm 3) relies on algebraic hash functions to simulate randomness, and we prove that with appropriate parameters, it always produces a valid model (Lemma 21).
Lemma 21.
Let be the signature of , and let be a satisfiability witness for . Suppose the hash parameters are chosen so that
-
1.
are all prime, and
-
2.
.
Then the structure generated by Algorithm 3 satisfies .
Proof of Lemma 21.
Let us assume that every type in is guarded.
Set . For each , let denote the set of -tuples processed in the inner loop at Line 3, during the th iteration of the outer loop at Line 3:
For technical reasons, we also declare as the set with the unique zero-length tuple.
For each and each -tuple , let denote the -type chosen by Algorithm 3 at Line 3 when processing . For a permutation , we naturally write that is, the -type reindexed according to .
The values can be viewed as a particular instantiation of the random variables in Algorithm 1. Hence by the same reasoning as in Claim 14 the structure is -guarded. If we show that also satisfies the -extension property, then Lemma 10 will imply that . The main technical step is Claim 22, being a deterministic replacement for Claim 15.
Claim 22.
Let , and let be a -type. Consider a tuple together with an index . Then there exists some such that the following holds: for every and every sequence ,
Proof.
To prove the claim, we need to find such that for every subset with the following holds.
Let , and let enumerate so that . The hash value computed at Line 3 when processing shall satisfy:
| (26) |
where for the index as computed at Line 3, i.e., and is the position of the -type in the enumeration of as specified at Line 3, i.e., . Note that occurs in (26), as .
Since , the solvability of (26) reduces to
| (27) |
Now, observe a natural correspondence: the subset is encoded in the binary digits of the index .
In consequence, the moduli of (27) are distinct primes for distinct subsets . By the Chinese remainder theorem the set of congruences specified by (27) admits a solution , thereby proving the claim.
Note that Claim 22 applies only to tuples from the sets . Since all types in are guarded, the -extension property therefore needs to be verified only for such tuples.
Let . Consider a tuple , a -type , and a -type with . Assume that . Choose arbitrarily Let be the element obtained from Claim 22. One then verifies that for
Hash Parameters.
To constructively derive Theorem 1 from Lemma 21, it remains to show that suitable hash parameters can indeed be chosen. A simple approach is to invoke the classical Bertrand’s postulate (see: Chapter 2 in [1]): for every integer , there exists a prime with .
We start from and apply Bertrand’s postulate iteratively times. This yields distinct primes such that for all . This is sufficient to obtain the upper bound stated in Theorem 1:
| (28) |
8 Conclusions
In this work, we presented a new probabilistic proof of the finite model property for the Guarded Fragment. Our methods yield tight bounds on the size of minimal models and extend naturally to the Triguarded Fragment. To the best of our knowledge, no previous work on the Guarded Fragment has employed a similar probabilistic technique.
Several natural directions remain open. A particularly appealing challenge is to extend the applicability of probabilistic methods to stronger fragments. One candidate is the Clique Guarded Fragment (CGF), which is known to enjoy the finite model property [4]. Here, however, a direct probabilistic approach seems out of reach. For instance, in a graph-theoretic setting with a single relation , CGF can express the absence of triangles via the sentence
Yet if edges were placed obliviously at random, a triangle would appear almost with certainty. This suggests that some additional underlying structure is needed, and that future work may profit from combining probabilistic reasoning with classical model constructions.
References
- [1] Martin Aigner and Günter M. Ziegler. Proofs from THE BOOK (3. ed.). Springer, 2004. doi:10.1007/978-3-662-57265-8.
- [2] Hajnal Andréka, István Németi, and Johan van Benthem. Modal languages and bounded fragments of predicate logic. J. Philos. Log., 27(3):217–274, 1998. doi:10.1023/A:1004275029985.
- [3] Franz Baader, Ian Horrocks, Carsten Lutz, and Uli Sattler. An Introduction to Description Logic. Cambridge University Press, 2017. doi:10.1017/9781139025355.
- [4] Vince Bárány, Georg Gottlob, and Martin Otto. Querying the guarded fragment. Log. Methods Comput. Sci., 10(2), 2014. doi:10.2168/LMCS-10(2:3)2014.
- [5] Vince Bárány, Balder ten Cate, and Martin Otto. Queries with guarded negation. Proc. VLDB Endow., 5(11):1328–1339, 2012. doi:10.14778/2350229.2350250.
- [6] Vince Bárány, Balder ten Cate, and Luc Segoufin. Guarded negation. J. ACM, 62(3):22:1–22:26, 2015. doi:10.1145/2701414.
- [7] Egon Börger, Erich Grädel, and Yuri Gurevich. The Classical Decision Problem. Perspectives in Mathematical Logic. Springer, 1997.
- [8] Pierre Bourhis, Michael Morak, and Andreas Pieris. Making cross products and guarded ontology languages compatible. In Carles Sierra, editor, Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, pages 880–886. ijcai.org, 2017. doi:10.24963/ijcai.2017/122.
- [9] Hans de Nivelle and Maarten de Rijke. Deciding the guarded fragments by resolution. J. Symb. Comput., 35(1):21–58, 2003. doi:10.1016/S0747-7171(02)00092-5.
- [10] Ronald Fagin. Probabilities on finite models. J. Symb. Log., 41(1):50–58, 1976. doi:10.1017/S0022481200051756.
- [11] Oskar Fiuk and Emanuel Kieronski. Alternating quantifiers in uniform one-dimensional fragments with an excursion into three-variable logic. Log. Methods Comput. Sci., 21(1), March 2025. doi:10.46298/lmcs-21(1:25)2025.
- [12] Oskar Fiuk, Emanuel Kieronski, and Vincent Michielini. On the complexity of maslov’s class K. In Pawel Sobocinski, Ugo Dal Lago, and Javier Esparza, editors, Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2024, Tallinn, Estonia, July 8-11, 2024, pages 35:1–35:14. ACM, 2024. doi:10.1145/3661814.3662097.
- [13] Warren D. Goldfarb. The unsolvability of the godel class with identity. J. Symb. Log., 49(4):1237–1252, 1984. doi:10.2307/2274274.
- [14] Warren D. Goldfarb. Random models and the maslov class. J. Symb. Log., 54(2):460–466, 1989. doi:10.2307/2274860.
- [15] Warren D. Goldfarb. Random models and solvable skolem classes. J. Symb. Log., 58(3):908–914, 1993. doi:10.2307/2275103.
- [16] Warren D. Goldfarb, Yuri Gurevich, and Saharon Shelah. A decidable subclass of the minimal godel class with identity. J. Symb. Log., 49(4):1253–1261, 1984. doi:10.2307/2274275.
- [17] Erich Grädel. Invited talk: Decision procedures for guarded logics. In Harald Ganzinger, editor, Automated Deduction - CADE-16, 16th International Conference on Automated Deduction, Trento, Italy, July 7-10, 1999, Proceedings, volume 1632 of Lecture Notes in Computer Science, pages 31–51. Springer, 1999. doi:10.1007/3-540-48660-7_3.
- [18] Erich Grädel. On the restraining power of guards. J. Symb. Log., 64(4):1719–1742, 1999. doi:10.2307/2586808.
- [19] Erich Grädel and Igor Walukiewicz. Guarded fixed point logic. In 14th Annual IEEE Symposium on Logic in Computer Science, Trento, Italy, July 2-5, 1999, pages 45–54. IEEE Computer Society, 1999. doi:10.1109/LICS.1999.782585.
- [20] Yuri Gurevich and Saharon Shelah. Random models and the godel case of the decision problem. J. Symb. Log., 48(4):1120–1124, 1983. doi:10.2307/2273674.
- [21] Bernhard Herwig. Extending partial isomorphisms on finite structures. Comb., 15(3):365–371, 1995. doi:10.1007/BF01299742.
- [22] Colin Hirsch. Guarded logics: algorithms and bisimulation. Doctoral dissertation, RWTH Aachen University, Germany, 2002. URL: http://sylvester.bth.rwth-aachen.de/dissertationen/2002/195/index.htm.
- [23] Yevgeny Kazakov. Saturation-based decision procedures for extensions of the guarded fragment. PhD thesis, Universität des Saarlandes, Saarbrücken, Germany, 2006.
- [24] Emanuel Kieronski and Sebastian Rudolph. Finite model theory of the triguarded fragment and related logics. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021, pages 1–13. IEEE, 2021. doi:10.1109/LICS52264.2021.9470734.
- [25] Emanuel Kieronski and Lidia Tendera. Finite satisfiability of the two-variable guarded fragment with transitive guards and related variants. ACM Trans. Comput. Log., 19(2):8:1–8:34, 2018. doi:10.1145/3174805.
- [26] Maarten Marx. Tolerance logic. J. Log. Lang. Inf., 10(3):353–374, 2001. doi:10.1023/A:1011207512025.
- [27] Ian Pratt-Hartmann. Fragments of First-Order Logic. Oxford University Press, 2023. doi:10.1093/oso/9780192867964.001.0001.
- [28] Riccardo Rosati. On the decidability and finite controllability of query processing in databases with incomplete information. In Stijn Vansummeren, editor, Proceedings of the Twenty-Fifth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, June 26-28, 2006, Chicago, Illinois, USA, PODS ’06, pages 356–365, New York, NY, USA, 2006. ACM. doi:10.1145/1142351.1142404.
- [29] Sebastian Rudolph and Mantas Simkus. The triguarded fragment of first-order logic. In Gilles Barthe, Geoff Sutcliffe, and Margus Veanes, editors, LPAR-22. 22nd International Conference on Logic for Programming, Artificial Intelligence and Reasoning, Awassa, Ethiopia, 16-21 November 2018, volume 57 of EPiC Series in Computing, pages 604–619. EasyChair, 2018. doi:10.29007/m8ts.
- [30] Johan van Benthem. Dynamic bits and pieces. Technical report, ILLC, 1997. URL: https://eprints.illc.uva.nl/id/eprint/1251/.
