---
title: BSS Machines over Semirings
url: https://www.emergentmind.com/topics/bss-machines-over-semirings
type: topic
---

# BSS Machines over Semirings

Searching arXiv for the cited work and closely related semiring/BSS papers.
BSS machines over semirings are extensions of the Blum–Shub–Smale model in which the underlying domain of computation is not restricted to a field such as $\mathbb R$, but is taken to be a semiring $S=(S,+,\cdot,0,1)$. In the 2025 literature, this framework is formulated for arbitrary first-order structures and then specialized to semirings, with particular emphasis on commutative, positive semirings and on their interaction with semiring semantics for logic due to Grädel and Tannen [2502.17539], [2502.12939], [2509.26214]. The resulting theory supports deterministic and nondeterministic machine models, polynomial-time and nondeterministic polynomial-time classes such as $\mathrm{NP}(S)$, and descriptive-complexity analogues of Fagin’s theorem and Cook’s theorem. In this setting, satisfiability for semiring-valued propositional logic becomes the canonical complete problem for $\mathrm{NP}(S)$, while the true existential first-order theory of $S$ captures the Boolean part of $\mathrm{NP}(S)$ [2509.26214].

## 1. Semiring setting and semantic background

A semiring is given as a tuple
$$
S=(S,+,\cdot,0,1)
$$
such that $(S,+,0)$ is a commutative monoid, $(S,\cdot,1)$ is a monoid, multiplication distributes over addition, and $0\cdot x=x\cdot 0=0$ [2509.26214]. In the semiring-oriented BSS literature summarized in 2025, the standing assumptions for the main logical characterizations are that $S$ is commutative, positive, and nontrivial, with $0\neq 1$ [2509.26214], [2502.12939].

The associated semantic framework is the semiring semantics for first-order and second-order formulas introduced by Grädel and Tannen. For a finite domain $A$, a relational vocabulary $\tau$, and an $S$-interpretation
$$
\pi\colon\{R(\bar a),\neg R(\bar a)\mid R\in\tau,\bar a\in A^{\arity(R)}\}\to S,
$$
formula values are computed inductively by interpreting conjunction as multiplication, disjunction as addition, existential quantification as summation over the finite domain, and universal quantification as product over the finite domain [2509.26214]. Equality and inequality are treated in a crisp fashion, yielding either $0$ or $1$ in $S$ [2509.26214]. Existential second-order quantification is interpreted Boolean-wise: $\llbracket \exists R\,\phi\rrbracket_{\pi,s}=1$ if there is an extension $\pi'\supseteq \pi$ with $\llbracket \phi\rrbracket_{\pi',s}\neq 0$, and $0$ otherwise [2509.26214].

This semantic choice is structurally decisive. It permits the direct comparison of machine acceptance, logical truth in semiring semantics, and satisfiability phenomena over semiring-valued propositional languages. In particular, when $S=\{0,1\}$ one recovers classical first-order logic, and the semiring framework specializes to the ordinary Boolean setting [2509.26214].

## 2. Machine models and configurations

The 2025 literature presents two closely related formulations. One is a general BSS-RAM model over an arbitrary first-order structure $\mathcal A=(A,\Sigma)$; the other is a node-based BSS$_S$ model directly over a semiring [2502.17539], [2502.12939].

In the first-order-structure formulation, a deterministic BSS-RAM has data registers $Z_1,Z_2,\dots$ holding elements of $A$, index registers $I_1,\dots,I_k$ holding positive integers, and a special register $B$ storing the current instruction label [2502.17539]. A program is a finite directed graph with a unique halt node, and the allowed deterministic instruction templates include assignment by a function symbol, assignment of a constant, copying a register, relation tests with branching, integer tests with branching, resetting an index, incrementing an index, and halting [2502.17539]. Formally, the machine is presented as
$$
M=(S,\delta,\mathrm{In},\mathrm{Out}),
$$
where $S$ is the configuration space, $\mathrm{In}$ is the input procedure, $\delta$ is the step function, and $\mathrm{Out}$ reads the output at halt [2502.17539].

In the semiring specialization, the signature becomes
$$
\Sigma_S=\{0,1; +,\cdot\},
$$
and the principal arithmetic instructions are addition, multiplication, loading constants, and copying [2502.17539]. The input procedure loads $(x_1,\dots,x_n)\in S^n$ into the first registers, initializes the index registers to $1$, sets the control to the initial instruction, and fills unused data registers with $0$ [2502.17539].

The node-based BSS$_S$ model instead uses a tape-like state space
$$
S_*=\{\,x=(\dots,x_{-2},x_{-1},x_0.x_1,x_2,\dots)\mid x_i\in S,\;x_i=0\text{ for }|i|\gg 0\},
$$
or equivalently $S^{\mathbb Z}$ with finite support, together with distinguished input, output, computation, branch, and shift nodes [2502.12939], [2509.26214]. The input map writes the word $(x_1,\dots,x_n)$ into the positive coordinates and records the length $n$ in unary on the negative side:
$$
(\dots,0,\underbrace{1,\dots,1}_{n},0.\,x_1,\dots,x_n,0,\dots).
$$
The output map reads the first $n$ positive cells, where $n$ is recovered from the run-length of $1$’s in the negative coordinates [2502.12939], [2509.26214].

Computation nodes perform one primitive operation at one coordinate, namely $x_i\mapsto x_j+x_k$, $x_i\mapsto x_j\cdot x_k$, or $x_i\mapsto c$ for a fixed semiring constant; branch nodes test either $x_1=x_2$ or, when an order is available, $x_1\le x_2$; shift nodes move the tape left or right [2502.12939], [2509.26214]. A configuration in the node formalism is $(m,x)\in\{1,\dots,N\}\times S_*$, while an equivalent register-style account writes
$$
M=(Q,\Sigma,S^k,\delta,q_0,Q_{\rm acc},Q_{\rm rej}),
\qquad
\delta:Q\times S^k\to Q\times S^k\times\{L,R,N\}^k
$$
[2502.12939].

A worked semiring example is given by a program computing the product of two inputs. With input $(x,y)$ loaded into $Z_1,Z_2$, a single instruction
$$
Z_3:=Z_1\cdot Z_2
$$
followed by a jump to halt yields output $(x\cdot y)$ in $Z_3$ [2502.17539]. The example is elementary, but it illustrates the unit-cost arithmetic abstraction characteristic of the model.

## 3. Determinism, nondeterminism, and complexity measures

Nondeterminism is introduced in two equivalent ways in the abstract BSS-RAM framework. One can replace the input procedure by a multi-valued map $\mathrm{In}\subseteq A^n\times S$, so that a run may begin in any of several start configurations, or one can add explicit nondeterministic instructions such as
$$
\mathbf{goto}\;p\;\text{or}\;q
$$
and a multi-valued “$v$-oracle” choice instruction [2502.17539]. In either formulation, the transition map becomes multi-valued, and acceptance is defined by the existence of some run reaching halt [2502.17539].

For semiring BSS machines in the logical characterizations of $\mathrm{NP}(S)$, nondeterminism is described as certificate guessing. A language $L\subseteq S^*$ lies in $\mathrm{NP}(S)$ if there is a nondeterministic BSS-machine $M$ and a polynomial $p$ such that on input $\bar x\in S^n$, the machine first guesses a certificate $\bar y\in S^{p(n)}$, then runs deterministically in $\mathrm{poly}(n)$ steps, and accepts exactly when the final output, an element of $S$, is $\neq 0$ [2509.26214].

Time is measured as in the classical BSS model: one counts the number of node visits, transitions, or register updates until halting [2502.17539], [2502.12939]. If the running time on inputs of length $n$ is bounded by a polynomial, one obtains the analogue of $\mathrm P$ over $S$ [2502.12939]. Space is measured by the maximal number of distinct tape cells or registers that ever become non-zero [2502.12939].

The 2025 papers emphasize that the unit-cost interpretation depends on the signature. In the semiring setting, addition and multiplication can each be treated as cost $1$, whereas a Turing-style simulation would instead charge according to the size of the representations of semiring elements [2502.17539]. This distinction is standard in algebraic computation and affects how semiring complexity classes relate to representation-sensitive models.

Several transfer results are stated. One lemma asserts that if $f:S^*\to S^*$ is computed by an $S$-Turing machine in time $t(n)$ and space $s(n)$, then there is a BSS$_S$ machine computing $f$ in time
$$
O\bigl(t(n)+n^2+|f(x)|^2+1\bigr)
$$
and space $O(s(n))$ [2502.12939]. The same source states that every poly-time register machine over $S$ can be simulated by a polytime BSS$_S$ machine and vice versa [2502.12939].

## 4. Descriptive complexity: $\mathrm{NP}(S)=\exists\mathrm{SO}(S)$

A central result is the semiring analogue of Fagin’s theorem: for commutative, positive semirings,
$$
\mathrm{NP}(S)=\exists\mathrm{SO}(S)
$$
[2509.26214]. Here $\exists\mathrm{SO}(S)$ denotes existential second-order logic interpreted in the semiring semantics.

The inclusion $\exists\mathrm{SO}(S)\subseteq \mathrm{NP}(S)$ is obtained by taking an existential second-order sentence
$$
\Phi=\exists R_1\dots\exists R_k\,\psi
$$
and observing that a nondeterministic BSS-machine can guess interpretations $\pi'(R_i)$ for the second-order relation symbols and then evaluate the first-order part $\psi$ deterministically in polynomial time [2509.26214]. This relies on a known simulation of semiring-semantics first-order evaluation by BSS computation in polynomial time in the domain size [2509.26214].

For the converse inclusion, suppose $L\in\mathrm{NP}(S)$ is decided by a nondeterministic BSS-machine $M$ in time $T(n)=n^k$. The input of length $n$ is encoded as a one-unary relational structure $\langle A,I\rangle$ of size $|A|=n$ with one unary $S$-relation indexing the input word [2509.26214]. One then constructs an existential second-order sentence $\Phi_M$ whose second-order variables encode the machine tableau: a relation symbol $V(\bar t,\bar p)$ of arity $2k+1$ records tape content at time $\bar t\in A^k$ and position $\bar p\in A^k$, and predicates $Q_s(\bar t)$ record the control state at time $\bar t$ [2509.26214]. Initialization, transition constraints, and acceptance conditions are then enforced arithmetically so that the sentence is true in semiring semantics exactly when the machine accepts [2509.26214].

This tableau construction is the semiring counterpart of the classical descriptive encoding of polynomial-time nondeterministic computations. What changes is not the architecture of the proof but the interpretation of logical connectives and quantifiers: additive and multiplicative aggregation over $S$ replaces purely Boolean truth propagation, while second-order existence remains Boolean-wise through the nonzero test built into the semantics [2509.26214]. This suggests that the semiring generalization preserves the classical proof schema with minimal structural alteration.

A related result concerns first-order logic and arithmetic circuits. For a commutative, positive semiring $S$ and a set of tests $O\subseteq\{=,\neq,\le,\not\le\}$, the class of functions computed by polynomial-size, constant-depth arithmetic circuits over $S$ with $O$-test gates coincides with the class of functions definable by first-order sentences in semiring semantics with the same tests and an arbitrary built-in supply of $S$-valued relations [2502.12939]. In the notation given there,
$$
\mathrm{FAC}[O]=\{\,(O,\Arb)\text{-}EVAL_\varphi \mid \varphi\in\FO(O,\Arb)\,\}
$$
[2502.12939]. This locates semiring BSS computation within a broader descriptive-complexity landscape that also includes semiring circuits and semiring-valued first-order evaluation.

## 5. Canonical complete problems: semiring satisfiability and existential theory

The semiring version of Cook’s theorem identifies a canonical complete satisfiability problem. One defines semiring-$S$ propositional logic $PL_S$ by the grammar
$$
\varphi\;\bnf\;p\mid\neg p\mid c\mid \varphi\wedge\varphi\mid\varphi\vee\varphi\mid\varphi=\varphi\mid\varphi\le\varphi,
$$
where $p$ ranges over propositional atoms and $c\in S$ [2509.26214]. Assignments map each literal $p,\neg p$ to an element of $S$, conjunction is evaluated by multiplication, disjunction by addition, constants by their designated semiring values, and equality or order tests by crisp $0/1$ outcomes [2509.26214]. The satisfiability problem is
$$
SAT_S=\{\varphi\in PL_S\mid \exists s:\llbracket\varphi\rrbracket_s\neq 0\}.
$$

The paper proves that $SAT_S\in\mathrm{NP}(S)$: a machine guesses an assignment and evaluates the formula bottom-up on its parse tree in polynomial time using semiring additions and multiplications as primitive operations [2509.26214]. Hardness is shown by translating the existential second-order tableau encoding $\Phi_M$ of an arbitrary $\mathrm{NP}(S)$ computation into a propositional formula $\varphi_M$. Each second-order predicate value becomes a fresh propositional atom, universal quantifiers are expanded into finite conjunctions, existential quantifiers into disjunctions, and the resulting formula is satisfiable over $S$ if and only if the original machine accepts [2509.26214]. Hence $SAT_S$ is $\mathrm{NP}(S)$-complete [2509.26214].

A second canonical problem concerns the Boolean part of semiring nondeterminism. Define
$$
EFO(S)=\{\varphi\mid \varphi \text{ an existential FO-sentence in }(+,\cdot,0,1),\; S\models \varphi\},
$$
where truth is interpreted in classical Tarski semantics, and define
$$
BP\,\mathrm{NP}(S)=\{L\subseteq\{0,1\}^*\mid L\in \mathrm{NP}(S)\}
$$
[2509.26214]. The paper proves that $EFO(S)$ is complete, under the specified “non-arithmetic” reductions, for $BP\,\mathrm{NP}(S)$ [2509.26214].

Membership follows because for an existential first-order sentence $\exists x_1\dots x_k\,\psi(x_1,\dots,x_k)$ one can guess values in $S$ for the variables and check $\psi$ in nondeterministic polynomial time by semiring evaluation of the polynomial atoms [2509.26214]. Hardness is obtained by transforming a semiring propositional formula into a single existential first-order sentence: propositional atoms are replaced by variables, $\wedge$ by $\cdot$, $\vee$ by $+$, literals outside algebraic contexts by tests of the form “$\neq 0$,” and the whole formula is wrapped in existential quantifiers [2509.26214]. The resulting sentence is true in $S$ exactly when the original propositional formula is satisfiable [2509.26214].

These two completeness results separate two levels of generality. $SAT_S$ captures full semiring nondeterministic polynomial time, while $EFO(S)$ captures its restriction to Boolean input languages [2509.26214].

## 6. Examples, special cases, and decidability issues

Several standard semirings appear as illustrative instances. If $S=\mathbb B=\{0,1\}$ with $\lor$ and $\land$, the framework recovers the classical classes $\mathrm{NP}$ and $SAT$, together with the classical forms of Fagin’s and Cook’s theorems [2509.26214]. If $S=\mathbb R_{\ge 0}$ or $S=\mathbb R$, one obtains the BSS class $\mathrm{NP}_{\mathbb R}$ and its characterization by existential second-order logic in $\mathbb R$-semiring semantics [2509.26214]. In the Boolean part, one recovers the class $\exists\mathbb R$ of decision problems reducible to the existential theory of the reals [2509.26214].

A further example is the tropical semiring
$$
S=(\mathbb R\cup\{\infty\},\min,+,\infty,0),
$$
where “addition” is $\min$ and “multiplication” is ordinary addition [2502.12939]. In this setting, a BSS$_S$ machine performs min-plus recurrences in one step, and branch nodes compare distances [2502.12939]. The same source states that many classical shortest-path or dynamic-programming procedures can be written as BSS$_S$ programs whose running time corresponds exactly to the number of graph edges [2502.12939].

Decidability behavior depends strongly on the underlying structure. Over an arbitrary first-order structure, even the halting problem of a BSS-RAM can be undecidable [2502.17539]. Over a finite semiring, every BSS-RAM runs in bounded time and halts on every input, so every predicate is decidable [2502.17539]. Over infinite but effectively presented semirings such as the integers, polynomials, or real algebraic numbers, one can often simulate a Turing machine and obtain the usual semi-decidable but not decidable problems [2502.17539]. Over a field of characteristic $0$ with exact equality, the bounded-time hierarchy $\mathrm P_F\subseteq \mathrm{NP}_F\subseteq\cdots$ raises analogues of the classical $\mathrm P$ versus $\mathrm{NP}$ question, described there as open [2502.17539].

Taken together, these examples show that the semiring formulation is not a single complexity theory but a uniform schema. The machine primitives remain fixed—addition, multiplication, constants, equality or order tests, and control flow—while the computational interpretation varies with the algebraic properties and effective presentation of $S$ [2502.17539], [2502.12939], [2509.26214]. A plausible implication is that the semiring viewpoint is best understood as a common language connecting Boolean, numeric, tropical, and other algebraic computation models rather than as a replacement for any one of them.

Source: https://www.emergentmind.com/topics/bss-machines-over-semirings