Papers
Topics
Authors
Recent
Search
2000 character limit reached

FO(SUM) & IFP(SUM): Logic with Summation

Updated 21 January 2026
  • FO(SUM) is a logical framework that extends first-order logic by introducing a summation operator to aggregate numerical values based on logical conditions.
  • IFP(SUM) enhances FO(SUM) with an inflationary fixed-point operator, enabling recursive, unbounded aggregations crucial for applications like neural network evaluation on graphs.
  • The approach underpins efficient query evaluation in algebraic difference fields and recursive Datalog, balancing expressiveness with tractable computational complexity.

First-order logic with summation (FO(SUM)) and its recursive extension IFP(SUM) are foundational logics for querying weighted finite structures, notably enabling direct expression of numerical aggregation and iterative computation on graphs, difference fields, and machine learning models. FO(SUM) extends classical first-order logic by introducing a summation operator within terms, yielding aggregate values based on logical conditions. IFP(SUM) further empowers FO(SUM) with the inflationary fixed-point operator, facilitating unbounded recursion over aggregates—this is crucial for expressing computations like neural network evaluation across arbitrary depth and complex recursive summation in algebraic domains.

1. Syntax and Semantics of FO(SUM) and IFP(SUM)

FO(SUM) augments standard first-order logic over a finite weighted vocabulary with built-in numeric constants, operations +,āˆ’,ā‹…,/+,-,\cdot,/, and ordering ≤\le. Its grammar distinguishes formulas and terms. The critical extension is the term-forming operator: āˆ‘(x1,…,xk):φ(x1,…,xk,y1,…,yā„“) θ0(x1,…,xk,y1,…,yā„“)\sum_{(x_1,\dots,x_k):\varphi(x_1,\dots,x_k,y_1,\dots,y_\ell)}\,\theta_0(x_1,\dots,x_k, y_1,\dots, y_\ell) This denotes the sum over all tuples in the universe satisfying φ\varphi, aggregating Īø0\theta_0.

IFP(SUM) introduces the operator: ifp(F(x1,…,xk)←θF(x1,…,xk,y1,…,yā„“))(x1′,…,xk′)\mathrm{ifp}\left(F(x_1,\dots,x_k)\gets \theta_F(x_1,\dots,x_k, y_1,\dots,y_\ell)\right)(x_1',\dots,x_k') Here, FF is an intensional symbol updated via ĪøF\theta_F at each iteration. The inflationary semantics fix values of FF once they become non-⊄\perp. This process, monotone and terminating on finite universes, yields the least inflationary fixed-point—ensuring the definability of recursive aggregations (Grohe, 14 Jan 2026).

2. FO(SUM) and IFP(SUM) in Algebraic Difference Fields

In the context of P-recursive difference fields, FO(SUM) generalizes indefinite summation over sequences defined by linear recurrence relations. An element in the field F=C(x)(t0,…,tnāˆ’1)F=C(x)(t_0,\dots,t_{n-1}) represents rational functions in both xx and the indeterminates tit_i, which encode the recursion shifts. The summation process, formalized as finding gg such that σ(g)āˆ’g=f\sigma(g)-g=f for a given f=A/Bf=A/B, proceeds by:

  • Factoring the denominator into "normal" and "special" polynomials (special if irreducible PP divides some shift σi(P)\sigma^i(P), otherwise normal).
  • Predicting the normal denominator part via a gcd formula derived from dispersion properties.
  • Addressing the numerator via a degree-bounded polynomial ansatz, yielding a coefficient system solved by linear algebra over C(x)C(x).
  • Handling special denominator factors heuristically or by structural theorems (Galois-theoretic arguments show linearity in specific domains).

This methodology enables indefinite summation in nontrivial differences fields, closely paralleling the tower construction for parallel integration (Chen et al., 2024).

3. Recursive Aggregation and Datalog: Fixpoint Semantics

Recursive extensions of FO(SUM), notably IFP(SUM), directly relate to least-fixpoint semantics in recursive Datalog programs with aggregates. Aggregates like SUM, MIN, MAX, and COUNT are incorporated via monotonic "msum" and "mcount" constructions over set-containment lattices: (L,āŠ‘)=(2HB,āŠ†)(L, \sqsubseteq) = (2^{HB}, \subseteq) with monotonic mappings guaranteeing unique least fixpoints by Knaster–Tarski.

Optimization exploits monotonicity: partial sums are generated (via msum), and standard SUM is recovered by group-wise max. Implementation leverages semi-naĆÆve differential evaluation and aggregate-pushing, where final max constraints are enforced in recursive rules, yielding efficient computation and performance scaling—demonstrated by BigDatalog on large industrial graphs (Zaniolo et al., 2017).

4. Expressiveness and Illustrative Applications

FO(SUM) is restricted to express queries of bounded recursion depth. IFP(SUM) extends this to unbounded recursion, crucial for evaluating deep feed-forward neural networks and recursive queries on weighted graphs. Notable examples include:

  • Squaring-on-a-path: For a directed path v0→v1→⋯→vdv_0\to v_1\to \cdots\to v_d, an IFP(SUM) query generates doubly-exponential values via nested summation and squaring.
  • Neural network evaluation: IFP(SUM) succinctly expresses node-wise value computation with ReLU activation using recursive aggregation over in-neighbors, allowing precise definition of network output irrespective of depth.

However, IFP(SUM) does not capture all polynomial-time queries in the classical sense; certain model-agnostic queries on (1,1)(1,1) FNNs are not definable even with binary weights. Over ordered weighted structures, GrƤdel–Meer established that IFP(SUM) captures P in the Blum–Shub–Smale real-RAM model. The scalar fragment sIFP(SUM)—forbidding intensional symbols in products or quotients—retains polynomial-time evaluation on Turing machines (Grohe, 14 Jan 2026).

5. Computational Complexity of Query Evaluation

For closed FO(SUM) expressions on rational weighted structures, the data complexity is in uniform TC0\mathrm{TC}^0. This is formalized:

Theorem 4.10: For every closed FO(SUM) expression ξ\xi, its evaluation can be computed by a dlogtime-uniform family of threshold circuits of bounded depth and polynomial size (Grohe, 14 Jan 2026).

In contrast, unrestricted IFP(SUM) may iterate to doubly-exponential values—not feasible in polynomial time for general inputs. Restriction to sIFP(SUM) ensures data complexity in P:

Theorem 5.11: The data complexity of sIFP(SUM) is in P (Grohe, 14 Jan 2026).

A plausible implication is that sIFP(SUM) represents the tractable fragment of IFP(SUM), guiding practical query design in database and ML contexts.

The indefinite summation algorithm for P-recursive extensions is incomplete only in predicting the special denominator part; normal denominator prediction is guaranteed by a polynomial gcd formula. Special factor enumeration is generally feasible only when bounded (e.g., linear in indeterminates due to Galois structure). For recursive Datalog with SUM, monotonic aggregates and max-pushing achieve superior performance and scalability compared to naĆÆve stratified evaluation, as evidenced empirically.

FO(SUM) and IFP(SUM) are part of a broader landscape connecting descriptive complexity, algebraic summation, and fixpoint computation. Their limitations—expressiveness (bounded in classical sense), dependency on structural constraints for tractability, and incomplete handling of special factors—motivate continued investigation into recursion, aggregation, and query language power across domains (Chen et al., 2024, Zaniolo et al., 2017, Grohe, 14 Jan 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (3)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to First-Order Logic with Summation (FO(SUM)).