betaFeedback

WorksComputer Science

Finite-on-Top-of-Temporal CSPs in Fixed-Point Logic

Abstract

We study definability in fixed-point logic with counting (FPC) for a class of constraint satisfaction problems (CSPs) that simultaneously generalises finite-domain CSPs and temporal CSPs. The templates for the CSPs are first-order expansions of the structure ([k]×Q;<1,…,<k,∼)([k] \times {\mathbb Q};<_1,\dots,<_k,\sim) where <i :={((i,x),(i,x′))∣x<x′}<_i \, := \{((i,x),(i,x')) \mid x<x'\} and ∼ :={((i,x),(i,x′))∣i∈[k],x,x′∈Q}\sim \, := \{((i,x),(i,x')) \mid i \in [k], x,x' \in {\mathbb Q}\}, i.e., kk copies of (Q;<)({\mathbb Q};<). Such a CSP is definable in FPC precisely when the template pp-constructs neither the ternary temporal relation XX, which holds on three elements if the minimum is attained exactly twice, nor a nontrivial finite affine structure. Equivalently, the template has global polymorphisms that witness the tractability of the temporal CSPs on the copies, and that provide 3-4 weak near-unanimity operations on the set of copies of Q{\mathbb Q}. In this case, we prove that the CSP is even expressible in the less expressive logic FP∗^*, which is the restriction of FPC without counting terms (i.e., the extension of first-order logic by a fixed point operator and an ordered auxiliary number sort). Our algorithm samples finitely many values in each copy and then performs nested constraint-singleton consistency tests (which is a uniform polynomial-time algorithm for finite-domain CSPs). The correctness proof uses finite-domain CSP theory to combine consistency certificates by a single polymorphism term, fixing each variable to one copy without destroying the certificates needed for the temporal algorithm. We then use a known normal form for algebraic products to control the remaining interactions between different copies.

2012 ACM Subject Classification Theory of computation →\to Constraint and logic programming; Theory of computation →\to Finite Model Theory

Keywords and phrases Constraint satisfaction, temporal constraints, fixed-point logic, counting, polymorphisms, bounded width, sampling

Funding Both authors have been funded by the European Research Council (Project POCOCOP, ERC Synergy Grant 101071674). Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.

Acknowledgements The authors would like to thank Antoine Mottet for the discussions on the topic of this paper.

AI Disclosure. OpenAI’s ChatGPT was used for initial algorithm and proof development, as well as drafting an initial LaTeX file. It contributed the ideas of the outer colour-pair testing in the algorithm, and using the syntactical normal forms for algebraic products of (Q;<)(\mathbb{Q}; <). Many of the other ideas, e.g., using the combination of sampling and consistency algorithms, determining the colours via cycle-consistency of the induced finite CSP, and using palette polymorphisms came from the authors, and some others emerged during discussions with ChatGPT. The authors reviewed and revised all arguments produced by LLMs; the proofs have been streamlined and rewritten. In particular, the entire text of the paper has been written by the authors. The authors verified the mathematical content, claims and citations and take full responsibility for the paper.

Introduction

A constraint satisfaction problem (CSP) is a computational problem where we are given a finite set of variables and a finite set of constraints, and the question is whether variables can be assigned values in a fixed relational structure so that all the constraints are satisfied. One of the central research topics about CSPs is their descriptive complexity depending on the type of constraints that is allowed in the input (see, e.g., the survey article [16]). A prominent formalism in descriptive complexity is fixed-point logic (FP), a powerful extension of first-order logic [23]. Every problem that can be expressed in fixed-point logic is in P, i.e., can be solved in polynomial time. And indeed, many of the important polynomial-time algorithms for CSPs that are based on establishing some form of local consistency can be formulated in fixed-point logic. However, it is known that some CSPs in P cannot be expressed in fixed-point logic: this is for instance the case for the problem of deciding whether a given system of linear equations has a solution over the two-element field [1] (which can be solved in polynomial time by Gaussian elimination).

To discuss the current state of the art, it will be convenient to formulate CSPs as homomorphism problems: for a fixed relational structure B\mathcal{B}, called the template, we view CSP(B\mathcal{B}) as the class of all finite structures A\mathcal{A} that have a homomorphism to B\mathcal{B}. We may now ask: for which structures B\mathcal{B} is there a sentence Φ\Phi in FP such that a finite structure A\mathcal{A} has a homomorphism to B\mathcal{B} if and only if A\mathcal{A} satisfies Φ\Phi? If this is the case, we say that CSP(B\mathcal{B}) is in FP (and use analogous conventions for other logics discussed below).

If B\mathcal{B} is a finite structure, it turns out that CSP(B\mathcal{B}) is in FP if and only if it is in Datalog (an extremely restricted fragment of FP) if and only if it is in FPC (an extremely powerful extension of FP by a counting mechanism) [1, 2]. In general, these logics are known to have different expressive power: for instance, Parity, which is the class of all structures whose domain has even cardinality, is expressible in FPC, but not in FP. This stunning gap in the descriptive complexity of finite-domain CSPs coincides with a fundamental border in universal algebra, which can be characterized in numerous different ways. To state one of these characterisations, which will be of fundamental importance for our results, we need the concept of a polymorphism of B\mathcal{B}; this is an operation Bs→BB^{s} \to B preserving every relation from the signature of B\mathcal{B} coordinatewise. Focussing on formulations that will be important later, we mention that the following are equivalent:

  • CSP(B\mathcal{B}) is in FP;

  • CSP(B\mathcal{B}) is in Datalog;

  • for every prime pp, the structure B\mathcal{B} cannot pp-construct (Zp;+,1)(\mathbb{Z}_p; +, 1);

  • B\mathcal{B} has polymorphisms g1:B3→Bg_1 : B^3 \to B and g2:B4→Bg_2 : B^4 \to B that are 3-4 weak near-unanimity operations, i.e., they satisfy, for all x,y∈Bx, y \in B,

g1(x,x,y)=g1(x,y,x)=g1(y,x,x)=g2(x,x,x,y)=g2(x,x,y,x)=g2(x,y,x,x)=g2(y,x,x,x).g_1(x,x,y) = g_1(x,y,x) = g_1(y,x,x) = g_2(x,x,x,y) = g_2(x,x,y,x) = g_2(x,y,x,x) = g_2(y,x,x,x).

If B\mathcal{B} is an arbitrary structure over an infinite domain, all of the mentioned equivalences fail [12]. They even fail if we focus on a model-theoretically very tame class of templates, namely on temporal structures, which are structures with domain Q\mathbb{Q} whose relations are (parameter-free) first-order definable in (Q;<)(\mathbb{Q}; <). We give two concrete examples of temporal structures, because their CSPs, which are called temporal CSPs, exhibit different descriptive complexities.

Example 1. Let Rmin⁡:={(x,y,z)∈Q3∣x>y∨x>z}R_{\min} := \{(x,y,z) \in\mathbb{Q}^3 \mid x > y \lor x > z\}. Then CSP(Q;Rmin⁡)(\mathbb{Q}; R_{\min}) is in FP [12], but not in Datalog [4].

Example 2. Let X={(x,y,z)∈Q3∣(x=y∧y<z)∨(y=z∧z<x)∨(z=x∧x<y)}X = \{(x,y,z) \in\mathbb{Q}^3 \mid(x = y \land y < z) \lor(y = z \land z < x) \lor(z = x \land x < y)\}. Then CSP(Q;X)(\mathbb{Q}; X) is in P [8], but not in FPC [12].

Also none of the algebraic characterisations mentioned above capture containment in Datalog, FP, or FPC (and are also inequivalent). Nonetheless, the descriptive complexity of temporal CSPs has been classified. Also for temporal CSPs, there is a gap in the descriptive complexity landscape: they are either in FP, or not even in FPC [12]. For arbitrary CSPs, it is an open problem whether containment in FPC implies containment in FP [12].

Finite on Top of Temporal

In this paper, we address a class of CSPs which is of fundamental importance for advancing our understanding of the descriptive complexity of CSPs in general. The class naturally generalises both the class of temporal CSPs and the class of finite-domain CSPs.

Definition 3. Fix k≥1k \ge1 and let B=[k]×QB = [k] \times\mathbb{Q}, where [k]={1,…,k}[k] = \{1,\ldots,k\}. Then Ci:={i}×QC_i := \{i\} \times\mathbb{Q} carries a strict rational order <i<_{i}; the relation ∼\sim says that two elements belong to the same part. Formally,

Dk=(B;<1,…,<k,∼),(i,a)<j(i′,b)⟺i=i′=j and a<b\mathcal{D}_k = (B; <_1,\ldots,<_{k},\sim), \qquad (i,a) <_j (i',b) \Longleftrightarrow i = i' = j \text{ and } a < b
(i,a)∼(i′,b)⟺i=i′.(i,a) \sim(i',b) \Longleftrightarrow i = i'.

A structure is called finite-on-top-of-temporal if it is a first-order expansion of Dk\mathcal{D}_k with a finite relational signature.

In the context of this definition, we call [k][k] the colour set, and if (i,a)∈B(i,a) \in B, then we call ii the colour of (i,a)∈Ci(i,a) \in C_i. We may thus view Dk\mathcal{D}_k as kk distinguished copies of (Q;<)(\mathbb{Q}; <), and additionally an equivalence relation that relates elements that have the same colour.

The class of CSPs for templates that are finite-on-top-of-temporal is contained in a larger class of CSPs from the literature, and in fact is quite prototypical in this class, which will be discussed in the following.

Restricted Orbit Growth

A fruitful way of obtaining classification results in model theory, and consequently of restricting the class of templates for CSPs, is to focus on structures B\mathfrak{B} such that for every number of variables nn, there is a restricted number of essentially different solutions. Formally, let fB(n)f_{\mathfrak{B}}(n) be the number of orbits of Aut⁡(B)\operatorname{Aut}(\mathfrak{B}) in its natural action on the set of nn-element subsets of BB.

Example 4. A structure B\mathfrak{B} is finite if and only if fB(n)f_{\mathfrak{B}}(n) is eventually 0.

Example 5. A famous result of Cameron [17] states that for any countably infinite structure B\mathfrak{B}, we have fB(n)=1f_{\mathfrak{B}}(n)=1 for all n∈Nn\in\mathbb{N} if and only if B\mathfrak{B} is isomorphic to a temporal structure.

Example 6. By the theorem of Ryll-Nardzewski, Engeler, and Svenonius (see, e.g., [20]) a countable structure B\mathfrak{B} is ω\omega-categorical1 if and only if fB(n)f_{\mathfrak{B}}(n) is finite for all n∈Nn\in\mathbb{N}.

It is easy to see that if B\mathfrak{B} is finite-on-top-of-temporal, then fB(n)f_{\mathfrak{B}}(n) is polynomial: if B\mathfrak{B} is a first-order expansion of Dk\mathcal{D}_k for some k≥1k\geq1, then fB(n)=fDk(n)=(n+k−1k−1)f_{\mathfrak{B}}(n)=f_{\mathcal{D}_k}(n)=\binom{n+k-1}{k-1} is the number of ways how to write nn as a sum n1+⋯+nkn_1+\cdots+n_k of non-negative integers n1,…,nkn_1,\ldots,n_k. Another example of structures B\mathfrak{B} where fBf_{\mathfrak{B}} is polynomial are cellular structures: this is the smallest class C\mathcal{C} of structures that contains countable disjoint unions of a finite structure and is closed under finite disjoint unions and finite-index first-order reducts [13].

Countable structures where fB(n)f_{\mathfrak{B}}(n) is bounded by a polynomial have been classified by Thiery and Falque [18]. It turns out that besides the structures mentioned above these are precisely the structures that have an expansion by finitely many constants which is bidefinable with a disjoint union of a finite-on-top-of-temporal structure and a cellular structure [14 Theorem 1.6].

This programme sits within a broader hierarchy of orbit growth. For countable homogeneous ω\omega-categorical relational structures, growth bounded by 2O(n)2^{O(n)} is conjectured to be equivalent to monadic NIP, meaning that NIP persists under arbitrary expansions by unary predicates [15 Conjecture 1]. The implication from this growth bound to monadic NIP is already known [15 Theorem 1.2]. Further up the hierarchy, every first-order reduct of a homogeneous structure in a finite relational signature has subset-orbit growth bounded by 2O(nr)2^{O(n^r)}: if the maximum relation arity is r≥1r\geq1, there are at most 2O(nr)2^{O(n^r)} labelled induced structures on nn elements, and homogeneity identifies isomorphism types with subset orbits. The polynomial-growth case is thus a natural starting point for a systematic classification within this much larger class.

The Classification

Let X=(Q;X)\mathfrak{X}=(\mathbb{Q};X), where X(x,y,z)⟺x=y<z∨y=z<x∨z=x<yX(x,y,z)\Longleftrightarrow x=y<z\lor y=z<x\lor z=x<y. For a nontrivial abelian group MM, let AM=(M;RM,{a}a∈M)\mathfrak{A}_M=(M;R_M,\{a\}_{a\in M}), where RM(x,y,z,t)R_M(x,y,z,t) means x+y=z+tx+y=z+t; we call these structures affine. To formulate our result, we also need the concept of pp-constructions, defined in § 2. Such constructions transfer CSP definability in FPC [12].

Theorem 7. Let B\mathfrak{B} be finite-on-top-of-temporal. Then the following are equivalent.

  1. CSP(B)(\mathfrak{B}) is definable in FPC;

  1. B\mathcal{B} pp-constructs neither F\mathbb{F} nor any finite affine structure.

  1. CSP⁡(B)\operatorname{CSP}(\mathcal{B}) is definable in FP⁡∗\operatorname{FP}^{*}, i.e., in fixed-point logic with an ordered auxiliary number sort and without counting terms (see, e.g., [19], [25]).

Note that in general, FP⁡⊊FP⁡∗⊊FPC⁡\operatorname{FP} \subsetneq\operatorname{FP}^{*} \subsetneq\operatorname{FPC}. While FP⁡∗\operatorname{FP}^{*} can express for example parity of the domain of a structure, it cannot express parity of a unary predicate interpreted in a structure, which FPC⁡\operatorname{FPC} can express.

We also give an algebraic characterization in terms of polymorphisms. Preservation of the relation ∼\sim from Definition 3 gives an induced operation f~:[k]s→[k]\tilde{f} : [k]^s \to[k], with

f~(π(a1),…,π(as)):=π(f(a1,…,as)),\tilde{f}(\pi(a_1),\ldots,\pi(a_s)) := \pi(f(a_1,\ldots,a_s)),

where π((i,a)):=i\pi((i,a)) := i. Since ff preserves the colours, the operation f~\tilde{f} is idempotent, i.e., satisfies f~(c,…,c)=c\tilde{f}(c,\ldots,c)=c for all c∈[k]c \in[k]. Let TT consist of the temporal operations min⁡\min, mi⁡\operatorname{mi}, ll⁡\operatorname{ll}, and their duals (defined in Section 2).

Theorem 8. Let B\mathcal{B} be finite-on-top-of-temporal. Then the equivalent items from Theorem 7 are also equivalent to

  1. both of the following conditions hold:

(a) for each i∈[k]i \in[k], some binary fi∈Pol⁡(B)f_i \in\operatorname{Pol}(\mathcal{B}) restricts on Ci2C_i^2 to ei∘tie_i \circ t_i, where ti∈Tt_i \in T and ei:Ci↪Cie_i : C_i \hookrightarrow C_i is order-preserving;

(b) Pol⁡(B)\operatorname{Pol}(\mathcal{B}) contains g1,g2g_1,g_2 such that g~1\tilde{g}_1 and g~2\tilde{g}_2 are 3-4 weak near-unanimity operations.

Algorithm and Proof Idea

References

  1. [1]Albert Atserias, Andrei A. Bulatov, and Anuj Dawar. Affine systems of equations and counting infinitary logic. Theoretical Computer Science, 410(18):1666–1683, 2009.
  2. [2]Libor Barto and Marcin Kozik. Constraint satisfaction problems solvable by local consistency methods. Journal of the ACM, 61(1), 2014. Article 3. doi:10.1145/2556646.DOI
  3. [3]Libor Barto, Jakub Opršal, and Michael Pinsker. The wonderland of reflections. Israel Journal of Mathematics, 223(1):363–398, 2018. URL: https://arxiv.org/abs/1510.04521, arXiv:1510.04521, doi:10.1007/s11856-017-1621-9.
  4. [4]Manuel Bodirsky. Complexity of Infinite-Domain Constraint Satisfaction, volume 52 of Lecture Notes in Logic. Cambridge University Press, 2021. Relation names and theorem numbers refer to the author’s postprint of 31 January 2026. URL: https://wwwpub.zih.tu-dresden.de/~bodirsky/Book.pdf, doi:10.1017/9781107337534.DOI
  5. [5]Manuel Bodirsky. Graph homomorphisms and universal algebra, 2026. URL: https://arxiv.org/abs/2602.14243, arXiv:2602.14243.
  6. [6]Manuel Bodirsky and Johannes Greiner. Tractable combinations of theories via sampling. In Proceedings of IJELIA 2021, volume 12678 of Lecture Notes in Computer Science, pages 133–146. Springer, 2021. doi:10.1007/978-3-030-75775-5_10.DOI
  7. [7]Manuel Bodirsky, Peter Jonsson, Barnaby Martin, Antoine Mottet, and Žaneta Semanišinová. Complexity classification transfer for CSPs via algebraic products. SIAM Journal on Computing, 53(5):1293–1353, 2024. doi:10.1137/22M1534304.DOI
  8. [8]Manuel Bodirsky and Jan Kára. The complexity of temporal constraint satisfaction problems. Journal of the ACM, 57(2):1–41, 2009. An extended abstract appeared in the Proceedings of the Symposium on Theory of Computing (STOC). doi:10.1145/1667053.1667058.DOI
  9. [9]Manuel Bodirsky, Dugald Macpherson, and Johan Thapper. Constraint satisfaction tractability from semi-lattice operations on infinite sets. ACM Transactions on Computational Logic, 14(4):1–19, 2013. Article 30. doi:10.1145/2528933.
  10. [10]Manuel Bodirsky and Jaroslav Nešetřil. Constraint satisfaction with countable homogeneous templates. In Computer science logic, volume 2803 of Lecture Notes in Comput. Sci., pages 44–57. Springer, Berlin, 2003. URL: https://doi.org/10.1007/978-3-540-45220-1_5, doi: 10.1007/978-3-540-45220-1\_5.
  11. [11]Manuel Bodirsky, Michael Pinsker, and Todor Tsankov. Decidability of definability. Journal of Symbolic Logic, 78(4):1036–1054, 2013. A conference version appeared in the Proceedings of the Twenty-Sixth Annual IEEE Symposium on. Logic in Computer Science (LICS 2011), pages 321–328.
  12. [12]Manuel Bodirsky and Jakub Rydval. On the descriptive complexity of temporal constraint satisfaction problems. J. ACM, 70(1):2:1–2:58, 2023. A conference version of this article appear under the title “Temporal Constraint Satisfaction Problems in Fixed-Point Logic” in LICS’20.arxiv.org/abs/2002.09451
  13. [13]Bertalan Bodor. Classification of ω-categorical monadically stable structures. J. Symb. Log., 89(2):460–495, 2024. URL: https://doi.org/10.1017/jsl.2023.66, doi:10.1017/JSL.2023.66.
  14. [14]Bertalan Bodor. Structures with not too fast unlabelled growth. The Journal of Symbolic Logic, page 1–49, 2026. doi:10.1017/jsl.2026.10239.DOI
  15. [15]Samuel Braunfeld and Michael C. Laskowski. Characterizations of monadic NIP. Transactions of the American Mathematical Society, Series B, 8:948–970, 2021. Corrected author version: arXiv:2104.12989v3. URL: https://arxiv.org/abs/2104.12989v3, arXiv:2104.12989v3, doi:10.1090/btran/94.
  16. [16]Andrei A. Bulatov, Andrei Krokhin, and Benoit Larose. Dualities for Constraint Satisfaction Problems, page 93–124. Springer-Verlag, Berlin, Heidelberg, 2008. URL: https://doi.org/10.1007/978-3-540-92800-3_5.
  17. [17]Peter J. Cameron. Transitivity of permutation groups on unordered sets. Mathematische Zeitschrift, 148:127–139, 1976.DOI
  18. [18]Justine Falque and Nicolas M. Thiéry. Classification of P-oligomorphic groups, conjectures of Cameron and Macpherson, 2020. Preprint, version 2. URL: https://arxiv.org/abs/2005.05296v2, arXiv:2005.05296v2.
  19. [19]Erich Grädel. Finite model theory and descriptive complexity. In Finite Model Theory and Its Applications, pages 125–230. Springer, 2007. doi:10.1007/3-540-68804-8_3.DOI
  20. [20]Wilfrid Hodges. A shorter model theory. Cambridge University Press, Cambridge, 1997.
  21. [21]Marcin Kozik. Solving CSPs using weak local consistency. SIAM Journal on Computing, 50(4):1263–1286, 2021. doi:10.1137/18M117577X.DOI
  22. [22]Marcin Kozik, Andrei Krokhin, Matt Valeriote, and Ross Willard. Characterizations of several maltsev conditions. Algebra Universalis, 73(3):205–224, 2015. doi:10.1007/s00012-015-0327-2.DOI
  23. [23]Leonid Libkin. Elements of Finite Model Theory. Springer, 2004.DOI
  24. [24]Antoine Mottet. Algebraic and algorithmic synergies between promise and infinite-domain CSPs. In Proceedings of LICS 2025, pages 357–371. IEEE, 2025. doi:10.1109/LICS65433.2025.00034.DOI
  25. [25]Martin Otto. Bounded variable logics and counting, volume 9 of Lecture Notes in Logic. Springer-Verlag, Berlin, 1997. A study in finite models. doi:10.1007/978-3-662-21676-7.DOI
  26. [26]Reinhard Pöschel and Lev A. Kalužnin. Funktionen- und Relationenalgebren, volume 15 of Mathematische Monographien [Mathematical Monographs]. VEB Deutscher Verlag der Wissenschaften, Berlin, 1979. Ein Kapitel der diskreten Mathematik. [A chapter in discrete mathematics].
  27. [27]Ágnes Szendrei. Clones in universal algebra, volume 99 of Séminaire de Mathématiques Supérieures [Seminar on Higher Mathematics]. Presses de l’Université de Montréal, Montreal, QC, 1986.
  28. [28]Dmitriy Zhuk. Singleton algorithms for the constraint satisfaction problem, 2026. Accepted for FOCS 2026; proceedings forthcoming. The detailed results cited are in the full version, version 3, March 2026. URL: https://arxiv.org/abs/2509.18434v3, arXiv:2509.18434v3.

Paper details

vlnc:W_7ry68nqf
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY-SA 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

OpenAI’s ChatGPT

View statement
Looking for related papers…
Contents