arXiv:2611.08474cs.DBNov 2026

Manuscript Offprint

arXiv:2611.08474

Monus vs. Interpretations in Semiring Semantics

Phokion G. Kolaitis

Abstract

Interpretations have been widely used in the study of provenance of queries on semiring-annotated databases. Here, we consider two different interpretation-based semantics for first-order formulas in negation normal form, namely, the canonical-interpretation semantics and the compatible-interpretation semantics. We show that the resulting query languages cannot express the monus operation on semiring-annotated relations, when the annotations come from the bag semiring or the tropical semiring or the fuzzy semiring. Consequently, the semantics of SQL cannot be captured using the interpretation-based semantics considered here.

1 Introduction

During the past two decades, there has been a growing body of research on semiring-annotated databases, where the tuples in the relations of a database are annotated with values from some semiring of interest. This approach provides a unifying framework, known as semiring semantics, that contains as special cases both standard relational databases (as the databases over the Boolean semiring B=({0,1},∨,∧,0,1)\mathbb{B} = (\{0,1\}, \lor, \land, 0, 1)) and bag databases (as the databases over the bag semiring N=(N,+,×,0,1)\mathbb{N} = (N, +, \times, 0, 1)). The catalyst for this investigation was the paper by Green, Karvounarakis, and Tannen [GKT07], who used semirings of polynomials to formalize and study the provenance of database queries. The main focus of [GKT07] was on the provenance of unions of conjunctive queries for which intuitive and unambiguous semiring semantics can be given. In the same paper, semiring semantics were also given to Datalog programs (see also [DMRT14]); later on, semiring semantics were given to richer formalisms supporting recursion, such as least-fixed point logic [DGNT21].

Conceptual difficulties arise when one attempts to develop semiring semantics for formalisms that support negation, the reason being that several different approaches to the semantics of negation are possible. On the side of relational algebra, for example, the question becomes: what is the “right” semiring semantics of the difference operation on relations? To this effect, Geerts and Poggi [GP10] gave semantics to the difference operation on relations using the monus operation on semirings, while, more recently, Suciu [Suc24] considered two additional approaches to giving semiring semantics to the difference operation. On the side of first-order logic (or relational calculus), the connective ¬\neg ('but not') was used in [BKN25] to give semantics to first-order formulas. This connective encapsulates a limited form of negation and turns out to be the exact counterpart of the monus operation. Specifically, in [BKN25], it was shown that, relational algebra with the monus as the semantics of difference can express the same queries on semiring-annotated databases as first-order logic with the ¬\neg ('but not') connective does. This result not only generalizes Codd's classical theorem about relational algebra and relational calculus [Cod72], but also yields an analogous theorem for bag databases, since SQL uses the monus operation on the natural numbers to give semantics to the difference operation on bags.

Grädel and Tannen [GT17, GT25] gave semantics to first-order formulas in negation normal form using interpretations. By definition, an interpretation on a set AA is a function that assigns a semiring value to every atom or negated atom involving elements of AA. Every fixed interpretation gives rise to semiring semantics of first-order formulas in negation normal form by lifting the interpretation from

*AI Statement: No AI tools were used in the research reported here or in the writing of this paper.

atoms and negated atoms to arbitrary first-order formulas in negation normal form. While interpretations have been successful in formalizing and studying the provenance of first-order formulas in negation normal form, they have not been used to design languages for expressing queries over semiring-annotated databases so far, the main reason being that [GT17, GT25] do not give interpretation-based semantics to first-order formulas in negation normal form on semiring-annotated databases.

In this paper, we first address the following conceptual question: how can interpretation-based semantics be used to define languages for expressing queries over semiring-annotated databases? We answer this question by introducing the notions of canonical-interpretation semantics and compatible-interpretation semantics. Both these notions give semantics to first-order formulas in negation normal form on semiring-annotated databases. Canonical-interpretation semantics is a stricter notion than compatible-interpretation semantics, because a special interpretation, called the canonical interpretation is associated with every semiring-annotated database, while in compatible-interpretation semantics different interpretations can be used on different databases as long as they are “compatible” with the semiring-annotated database at hand, i.e., as long as they agree with the annotations of the relations in the database under consideration.

The main technical result reported here asserts that, in general, the monus operation on semiring-annotated databases cannot be expressed by any first-order formula in negation normal form under the interpretation-based semantics introduced here. Actually, we show that this inexpressibility result holds true for databases over each of the following three well known semirings: the bag semiring N=(N,+,⋅,0,1)\mathbb{N} = (N, +, \cdot, 0, 1), the tropical semiring T=(R∪{∞},min⁡,+,∞,0)\mathbb{T} = (\mathbb{R} \cup \{\infty\}, \min, +, \infty, 0), and the fuzzy semiring F=([0,1],max⁡,min⁡,0,1)\mathbb{F} = ([0,1], \max, \min, 0, 1). An immediate consequence of this result is that the semantics of SQL cannot be captured using canonical-interpretation semantics or compatible-interpretation semantics.