Descriptive complexity of real computation and probabilistic independence logic
Abstract.
We introduce a novel variant of BSS machines called Separate Branching BSS machines (S-BSS in short) and develop a Fagin-type logical characterisation for languages decidable in nondeterministic polynomial time by S-BSS machines. We show that NP on S-BSS machines is strictly included in NP on BSS machines and that every NP language on S-BSS machines is a countable disjoint union of closed sets in the usual topology of . Moreover, we establish that on Boolean inputs NP on S-BSS machines without real constants characterises a natural fragment of the complexity class (a class of problems polynomial time reducible to the true existential theory of the reals) and hence lies between and . Finally we apply our results to determine the data complexity of probabilistic independence logic.
1. Introduction
The existential theory of the reals consists of all first-order sentences that are true about the reals and are of the form
where is a quantifier-free arithmetic formula containing inequalities and equalities. Known to be -hard on the one hand, and in on the other hand (Canny, 1988), the exact complexity of this theory is a major open question. The existential theory of the reals is today attracting considerable interest due to its central role in geometric graph theory. First isolated as a complexity class in its own right in (Schaefer, 2009), is defined as the closure of the existential theory of the reals under polynomial-time reductions. In the past decade several algebraic and geometric problems have been classified as complete for ; a recent example is the art gallery problem of deciding whether a polygon can be guarded by a given number of guards (Abrahamsen et al., 2018).
The existential theory of the reals is closely connected to Blum-Shub-Smale machines (BSS machine for short) which are essentially random access machines with registers that can store arbitrary real numbers and which can compute rational functions over reals in a single time step. Many complexity classes from classical complexity theory transfer to the realm of BSS machines, such as nondeterministic polynomial time () over languages consisting of finite strings of reals. While the focus is primarily on languages over some numerical domain (e.g., reals or complex numbers), also Boolean inputs (strings over ) can be considered. In this context corresponds to the Boolean part of (), obtained by restricting to Boolean inputs and limiting the use of machine constants to and , as feasibility of Boolean combinations of polynomial equations is complete for both of these classes (Bürgisser and Cucker, 2006; Schaefer and Stefankovic, 2017).
BSS computations can also be described logically. This research orientation was initiated by Grädel and Meer who showed that is captured by a variant of existential second-order logic () over metafinite structures (Grädel and Meer, 1995). Metafinite structures are two-sorted structures that consist of a finite structure, an infinite domain with some arithmetics (such as the reals with multiplication and addition), and weight functions bridging the two sorts (Grädel and Gurevich, 1998). Since the work by Grädel and Meer, others (see, e.g., (Cucker and Meer, 1999; Hansen and Meer, 2006; Meer, 2000)) have shed more light upon the descriptive complexity over the reals mirroring the development of classical descriptive complexity. In addition to metafinite structures, the connection between logical definability encompassing numerical structures and computational complexity has received attention in constraint databases (Benedikt et al., 2003; Grädel and Kreutzer, 1999; Kreutzer, 2000). A constraint database models, e.g., geometric data by combining a numerical context structure, such as the real arithmetic, with a finite set of quantifier-free formulae defining infinite database relations (Kanellakis et al., 1995).
In this paper we investigate the descriptive complexity of so-called probabilistic independence logic in terms of the BSS model of computation and the existential theory of the reals. Probabilistic independence logic is a recent addition to the vast family of new logics in team semantics. In team semantics (Väänänen, 2007) formulae are evaluated with respect to sets of assignments which are called teams. During the past decade research on team semantics has flourished with interesting connections to fields such as database theory (Hannula and Kontinen, 2016), statistics (Corander et al., 2019), hyperproperties (Krebs et al., 2018), and quantum information theory (Hyttinen et al., 2017), just to mention a few examples. The focus of this article is probabilistic team semantics that extends team based logics with probabilistic dependency notions. While the first ideas of probabilistic teams trace back to (Galliani, 2008; Hyttinen et al., 2017), the systematic study of the topic was initiated by the works (Durand et al., 2018a, b).
At the core of probabilistic independence logic is the concept of conditional independence. The models of this logic are finite first-order structures but the notion of a team is replaced by a probabilistic team, i.e., a discrete probability distribution over a finite set of assignments. In (Durand et al., 2018b) it was observed that probabilistic independence logic is equivalent to a restriction of in which the weight functions are distributions. The exact complexity and relationship of to and was left as an open question; in this paper we present a (strict) sublogic of and a (strict) subclass of that both capture .
Our contribution. In this paper we introduce a novel variant of BSS machines called Separate Branching BSS machines (S-BSS machines for short) and characterise its languages (denoted by ) with that is a natural sublogic of . Likewise, we isolate a fragment of the complexity class and show that it coincides with the class of Boolean languages in . Moreover we establish a topological characterisation of the languages decidable by S-BSS machines; we show that, under certain natural restrictions, languages decidable by S-BSS machines are countable disjoint unions of closed sets in the usual topology of . The topological characterisation separates the languages decidable by BSS machines and S-BSS machines, respectively. Moreover it enables us to separate the complexity classes and . Finally we show the equivalence of the logics and , implying that . Table 1 summarises the main results of the paper.
Structure of the paper. Section 2 gives the basic definitions on descriptive complexity, BSS machines, and logics on -structures required for this paper. Section 3 focuses in giving logical characterisations of variants of on S-BSS machines. In Section 4 we establish the aforementioned topological characterisation of S-BSS decidable languages. In Section 5 we prove a hierarchy of the related complexity classes; in particular we separate and . Section 6 deals with probabilistic team semantics and establishes that . Section 7 concludes the paper.
|
|
|||||
|
|
||||
---|---|---|---|---|---|
|
|||||
2. Preliminaries
A vocabulary is relational (resp., functional) if it consists of only relation (resp., function) symbols. A structure is relational if it is defined over a relational vocabulary. We let and denote disjoint countable sets of first-order and function variables (with prescribed arities), respectively. We write to denote a tuple of first-order variables and to denote the length of that tuple. The arities of function variables and relation symbols are denoted by and , respectively. If is a function with domain and a set, we define to be the function with domain that agrees with for each element in its domain. Given a finite set , a function that maps elements of to elements of the closed interval of real numbers such that is called a (probability) distribution.
2.1. -structures
Let be a relational vocabulary. A -structure is a tuple , where is a nonempty set and each an -ary relation on . The structure is a finite structure if and are finite sets. In this paper, we consider structures that enrich finite relational -structures by adding real numbers () as a second domain sort and functions that map tuples over to .
Definition 2.1.
Let and be respectively a finite relational and a finite functional vocabulary, and let . An -structure of vocabulary is a tuple
where the reduct of to is a finite relational structure, and each is a weight function from to . Additionally, an -structure is defined analogously, with the exception that the weight functions are distributions.
An assignment is a total function that assigns a value for each first-order variable. The modified assignment is an assignment that maps to and agrees with for all other variables.
Next, we define a variant of functional existential second-order logic with numerical terms () that is designed to describe properties of -structures. As first-order terms we have only first-order variables. For a set of function symbols, the set of numerical -terms is generated by the following grammar:
where is a real constant denoting itself, , and and are tuples of first-order variables from such that the length of is . The value of a numerical term in a structure under an assignment is denoted by . In addition to the natural semantics for the real constants, we have the following rules for the numerical terms:
where are the addition, multiplication, and summation of real numbers, respectively.
Definition 2.2 (Syntax of ).
Let be a finite relational vocabulary and a finite functional vocabulary. Let , , and . The set of -formulae of is defined via the grammar:
where and are numerical -terms constructed using operations from and constants from , and , is a relation symbol, is a function variable, and are first-order variables and a tuple of first-order variables, and is a -formula of .
Note that the syntax of allows first-order subformulae to appear only in negation normal form. This restriction however does not restrict the expressiveness of the language.
The semantics of is defined via -structures and assignments analogous to first-order logic; note that first-order variables are always assigned to a value in whereas functions map tuples over to . In addition to the clauses of first-order logic, we have the following semantical clauses:
(1) |
where is the expansion of that interprets as .
Given , we define as the variant of in which (1) is modified such that , and as the variant in which (1) is modified such that is a distribution, that is, . Note that in the setting of the value of a -ary function symbol is always .
Loose fragment.
For both and , define as the loose fragment of in which negated numerical atoms are disallowed. We want to point out that as long as and , the logic subsumes existential second-order logic over finite structures (a precise formulation is given later by Proposition 3.1).
Expressivity comparisons.
Fix a relational vocabulary and a functional vocabulary . Let and be some logics over defined above, and let or . For a formula , define to be the class of -structures of vocabulary such that . We write if for all sentences there is a sentence such that . As usual, the shorthand stands for in both directions. For , we write simply and .
In plain words, the subscript in constitutes the class of functions available for quantification, whereas the superscript in constitutes the class of functions available for function symbols in the vocabulary. Thus, defines a class , even if and are different.
2.2. Blum-Shub-Smale Model
We will next give a definition of BSS machines (see e.g. (Blum et al., 1997)). We define . The size of is defined as . The space can be seen as the real analogue of for a finite set . We also define as the set of all sequences where . The members of are thus of the form . Given an element we write for the th coordinate of . The space has natural shift operations. We define shift left and shift right as and .
Definition 2.3 (BSS machines).
A BSS machine consists of an input space , a state space , and an output space , together with a connected directed graph whose nodes are labelled by . The nodes are of five different types.
-
(1)
Input node. The node labeled by is the only input node. The node is associated with a next node and the input mapping .
-
(2)
Output node. The node labeled by is the only output node. This node is not associated with any next node. Once this node is reached, the computation halts, and the result of the computation is placed on the output space by the output mapping .
-
(3)
Computation nodes. A computation node is associated with a next node and a mapping such that for some and the mapping is identity on coordinates and on coordinate one of the following holds:
-
•
(addition),
-
•
(subtraction),
-
•
(multiplication),
-
•
(constant assignment).
-
•
-
(4)
Branch nodes. A branch node is associated with nodes and . Given the next node is if , and otherwise.
-
(5)
Shift nodes. A shift node is associated either with shift left or shift right , and a next node .
The input mapping places an input in the state
where the size of the input is located at the zeroth coordinate. The output mapping maps a state to the string consisting of its first positive coordinates, where is the number of consecutive ones stored in the negative coordinates starting from the first negative coordinate. For instance, maps
to . A configuration at any moment of computation consists of a node and a current state . The (sometimes partial) input-output function of a machine is now defined in the obvious manner. A function is computable if for some machine . A language is decided by a BSS machine if its characteristic function is .
Deterministic complexity classes.
A machine runs in (deterministic) time , if reaches the output in steps for each input . The machine runs in polynomial time if is a polynomial function. The complexity class is defined as the set of all subsets of that are decided by some machine running in polynomial time.
Nondeterministic complexity classes.
A language is decided nondeterministically by a BSS machine , if
when a slightly different input mapping , which places an input in the state
where the sizes of and are respectively placed on the first two coordinates, is used. When we consider languages that a machine decides nondeterministically, we call nondeterministic. Sometimes when we wish to emphasize that this is not the case, we call deterministic. Moreover, we say that is [0,1]-nondeterministic, if the guessed strings are required to be from . L is decided in time , if, for every , reaches the output in steps for some . The machine runs in polynomial time if is a polynomial function. The class consists of those languages for which there exists a machine that nondeterministically decides in polynomial time. Note that, in this case, the size of above can be bounded by a polynomial (e.g., the running time of ) without altering the definition. The complexity class has many natural complete problems such as 4-FEAS, i.e., the problem of determining whether a polynomial of degree four has a real root (Blum et al., 1989).
Complexity classes with Boolean restrictions.
If we restrict attention to machines that may use only in constant assignment nodes, then the corresponding complexity classes are denoted using an additional superscript (e.g., as in ). Complexity classes over real computation can also be related to standard complexity classes. For a complexity class over the reals, the Boolean part of , written , is defined as .
Descriptive complexity.
Similar to Turing machines, also BSS machines can be studied from the vantage point of descriptive complexity. To this end, finite -structures are encoded as finite strings of reals using so-called rankings that stipulate an ordering on the finite domain. Let be an -structure over where and are relational and functional vocabularies, respectively. A ranking of is any bijection . A ranking and the lexicographic ordering on induce a -ranking for . Furthermore, induces the following encoding . First we define and for and :
-
•
Let be a -ary relation symbol. The encoding is a binary string of length such that the th symbol in is if and only if , where .
-
•
Let be a -ary function symbol. The encoding is string of real numbers of length such that the th symbol in is , where .
The encoding is then the concatenation of the string of length and the encodings of the interpretations of the relation and function symbols in . We denote by any encoding of .
Let be a complexity class and a logic, where , , , and or . Let or , and let be an arbitrary class of -structures over that is closed under isomorphisms. We write for the set of encodings of structures in . Consider the following two conditions:
-
(i)
for some ,
-
(ii)
.
If implies , we write , and if the vice versa holds, we write . If both directions hold, then we write . We omit the subscript in the notation if .
The following results due to Grädel and Meer extend Fagin’s theorem to the context of real computation.111Only the first equivalence is explicitly stated in (Grädel and Meer, 1995). The second, however, is a simple corollary, using the fact that and can be identified in ; these two are the only idempotent reals for multiplication, and is the only idempotent real for addition.
Theorem 2.4 ((Grädel and Meer, 1995)).
and
.
2.3. Separate Branching BSS
We now define a restricted version of the BSS model which branches with respect to two separated intervals and . We will later relate these BSS machines to certain fragments of and the existential theory of the reals.
Definition 2.5 (Separate Branching BSS Machine).
Separate branching BSS machines (S-BSS machines for short) are otherwise identical to the BSS machines of Definition 2.3, except that the branch nodes are replaced with the following separate branch nodes.
-
•
Separate branch nodes. A separate branch node is associated with , , and nodes and . Given the next node is if , if , and otherwise the input is rejected.
Note that for a given S-BSS machine it is easy to write an equivalent BSS machine. A priori it is not clear whether the converse is possible; in fact, we will later show that in some cases the converse is not possible.
We can now define the variants of the complexity classes , , , and that are obtained by replacing BSS machines with S-BSS machines in the definitions of the complexity classes. Furthermore, we define , and as the variants of , and in which the input may be any element from but the guessed element must be taken from . Let be one of the aforementioned complexity classes. We define to be the variant of , where, instead of BSS machines, S-BSS machines are used. If includes the superscript , this means that not only the parameter in constant assignment, but also and in separate branching are from .
3. Descriptive complexity of nondeterministic polynomial time in S-BSS
We now show that corresponds to a numerical variant of in which quantified functions take values from the unit interval and numerical inequality atoms only appear positively. Later we show that both of these restrictions are necessary in the sense that removing either one lifts expressiveness to the level of which captures . On the other hand, we give a logical proof, based on topological arguments, that . The proof of Theorem 3.3 is a nontrivial adaptation of the proof of Theorem 2.4 (see (Grädel and Meer, 1995, Theorem 4.2)). In the proof we apply Lemma 3.2 and, by Proposition 3.1, assume without loss of generality built-in definable predicates on the finite part.
Let and be distinct constants, a -ary distribution, and a -ary relation on a finite domain of size . We say that is the characteristic distribution of (w.r.t. and ) if implies , and implies . The next proposition implies that it is possible to simulate existential quantification of definable predicates on the finite domain using function (or distribution) quantification; in particular, we may assume without loss of generality built-in predicates such as a linear ordering and its induced successor relation on the finite domain. Clearly, any predicate that is -definable over finite structures is also -definable (w.r.t. the finite domain) over -structures.
Below, we write - to denote the extension of - by existential quantification of relations over the finite domain with the usual semantics.
Proposition 3.1.
Let and be arbitrary. For every formula - there exist formulas - and - such that, for every -structure and assignment ,
Proof.
The sentence (, resp.) is obtained from by a translation that is the identity function, except that, for second-order variables of arity , we rewrite the quantifications as , where is a -ary (()-ary, resp.) function variable, and the atoms and by and ( and , resp.), respectively. Here, is the -ary uniform distribution which is definable in - by . ∎
Lemma 3.2.
If , we have .
Proof.
Left-to-right direction is straightforward; the quantification in can be simulated in by the formula
The converse direction is nontrivial. Let be an arbitrary -formula. We will show how to construct an equivalent -formula . By the standard Skolemization argument we may assume that is in the prenex normal form. Moreover, we assume that every atomic formula of the form is written such that and are multivariate polynomials where function terms play the role of variables; this normal form is obtained by using the distributive laws of addition and multiplication. Let be the smallest set that includes every term of polynomials and such that is a subformula of , and is closed under taking subterms. Clearly is a finite set, for its cardinality is bounded by the length of . For each with variables, we introduce an -ary function that will be interpreted as the sign function for the term . Let be the related tuple of variables. The idea is that () if ().
We are now ready to define the translation , where
is in the normal form mentioned above. We define
where the recursively defined translation ∘ is homomorphic for the Boolean connectives and identity for first-order literals.
For atomic formulae of the form the translation is defined as follows. The translation makes certain that every term (of polynomial) of the inequation after the translation has a non-negative value; this is done by moving terms to the other side of the inequation. Denote and , and define as
Finally the subformula makes sure that the signs of the terms in propagate correctly from subterms to terms. Define as
Note that the sign function maps terms of value to either or , since for the purpose of the construction the sign of valued terms does not matter. ∎
Theorem 3.3.
.
Proof.
Right-to-left direction. Suppose is a class of -structures that is closed under isomorphisms. By Lemma 3.2 it suffices to construct an sentence such that iff for all -structures . Let be an S-BSS machine such that consists of nodes, and for each input it accepts for some in time iff for some , where is some fixed natural number. We may assume that is of size . Let be a fixed natural number such that ; such a always exists since is polynomial in . The computation of on a given input can be represented using functions , , and such that
-
(a)
is the content of register at time ;
-
(b)
is 1 if is the node label at time , and 0 otherwise.
Note that is -ary because we need to store positive and negative register contents. We may assume such that registers with index greater than do not contribute to the final outcome, i.e., their contents are never shifted to registers associated with the nodes of . Construct a formula
of such that iff accepts . By Proposition 3.1 we may assume a built-in ordering and its induced successor relation and constants on the finite domain. Likewise, we may extend to order also -tuples from the finite domain. Under such ordering we then write () for the element succeeding (preceding) a -tuple , and for the -th -tuple. First, is the conjunction of a formula stating that the ranges of and are as stated, and another formula
(2) |
where is a shorthand for . Observe that (2) implies
Also, is a bijection from to . That the range of is will follow from the remaining conjuncts of , described below.
Initial configuration. We give a description of such that
(3) |
For clause (b) it suffices to add to
Consider then clause (a). We denote by the th -tuple with respect to . The sequence , which is clearly definable in , now represents the zeroth coordinate of . To encode that is placed on zeroth coordinate we add to
(4) | ||||
where is a nullary function variable (i.e., a real from ), is a polynomial such that , and the last conjunct of (4) is a shorthand for
where is the degree of the polynomial , and is the polynomial obtained by multiplying by (that is ). It follows from (2) and (4) that and . To encode that is placed on the first coordinate we also add to a formula stipulating that .
Let be a function symbol and let be a natural number that indicates the starting position of the encoding of in . Clearly is a definable real number as it is the value of a fixed univariate polynomial. We use the shorthand to denote that in the ordering of -tuples (induced from ) the ordinal number of is the sum of the ordinal number of and . Clearly is expressible in our logic. We then add the following to :
(5) |
Note that (2) and (5) imply that ; for, by (2), leads to which contradicts (5). The interpretations of relations in are treated analogously. For all the remaining positions we stipulate that , and for all positions we stipulate that . In the first case is some value guessed from the unit interval and in the second case it is . We conclude that (3) holds by this construction.
Computation configurations. Then we define such that
(6) |
We let
where each describes the instruction of node . Suppose is a computation node associated with a mapping that is the identity on coordinates and on coordinate defined as . Let us write and for and , and for the tuples that correspond to the th, th, and th input coordinates. Clearly, these tuples are definable. We define
The other computation nodes are described analogously. For a shift left node we define
and the case for shift right node is analogous. For a separate branch node we define
Our formulae now imply that (6) follows by the construction. In particular, keeping the values of in ensures that the arithmetical operations are encoded correctly.
Finally, to express that the value of the characteristic function is we may stipulate without loss of generality that coordinates respectively contain ; we also need to state that the machine is in node at the last step:
We conclude that iff accepts .
Left-to-right direction. Let be a sentence over some vocabulary . As in the previous lemma, we may assume that is of the form
where is quantifier-free. We may further may transform to an equivalent form
(7) |
where are Skolem functions on the finite domain and is obtained from by replacing each occurrence of , , with . Note that (7) is an intermediate expression which is not anymore in . We may assume is in disjunctive normal form , where is a finite set of indices.
Suppose the relational and function symbols in are of arity at most . First, a fixed initial segment of negative coordinates is allocated with the following intention:
-
•
one coordinate for separate branching,
-
•
three coordinates for numerical identity atoms,
-
•
two sequences of coordinates and for elements of the finite domain.
We construct a machine which runs in polynomial time and accepts iff
-
(1)
where is a model over , and
-
(2)
is a concatenation of and indices such that for each .
We may suppose that and are respectively encoded as strings of reals and integers.
Let be a polynomial such that for each over we have . The machine first checks whether there is a natural number such that . For this, it first sets and , where initially . If , then , and if , then and the process is repeated. Otherwise, if , the input is rejected. This type of branching can be implemented repeating separate branching twice. Provided that the input is not rejected, this process terminates with where . The machine then checks whether item 1 holds; given this is straightforward. Checking that is a concatenation of , for some functions , and some indices is analogous.
It remains to be checked that the last claim of item 2 holds. We go through all tuples , calculate the values of the Skolem functions, and check that the disjunct holds for the calculated value of the variables. For each , placed on the coordinates , the machine uses and for retrieving and placing on the coordinates . The machine then retrieves the index and checks whether holds true with respect to the values on coordinates . Once this process is completed for all value combinations the computation halts with accept.
The contents of the input are accessed using shifts which fix the contents of the allocated coordinates. That is, we use operations , where is a finite set of coordinates, such that if , and otherwise where . For instance, is obtained by first swapping and and then shifting left.
Also, if contains a numerical atom , then the values of its constituent function terms with respect to are placed on coordinates . The machine then sets , and if , then it continues to the next atom in , and else it rejects. If contains a relational atom , then the value of its characteristic function with respect to is placed on coordinate . If , then the machine moves to the next atom in , and else it rejects. Negated relational atoms are treated analogously, and the stated branching is straightforward to implement with separate branch nodes.
It follows from our construction that runs in polynomial time and accepts iff items 1 and 2 hold. Hence, we conclude that . ∎
Suppose we above consider (i) guesses from instead of , or (ii) BSS instead of S-BSS machines. Then slightly modified proofs yield (i) , and (ii) . Furthermore, logical constants are only needed to capture in constant assignment and in separate branching, and for the converse direction only those machine constants which explicitly occur in the logical expression are needed. Thus we obtain the following corollary.
Corollary 3.4.
-
(1)
,
-
(2)
,
-
(3)
,
-
(4)
,
-
(5)
.
In the following two sections we investigate how S-BSS computability relates to BSS computability, and in particular how relates to . On the one hand it turns out that is strictly weaker than . On the other hand both obvious strengthenings of , namely and , collapse to .
4. Characterisation of S-BSS decidable languages
We give a characterisation of languages decidable by S-BSS machines using the ideas from the previous section. The goal of this section is to establish the following theorem:
Theorem 4.1.
Every language that can be decided by a) a deterministic S-BSS machine, or b) a -nondeterministic S-BSS machine in time , for some function , is a countable disjoint union of closed sets in the usual topology of .
The result complements an analogous characterisation of BSS-decidable languages thus giving insight on the difference of the computational powers of BSS machines and S-BSS machines.
Theorem 4.2 ((Blum et al., 1997, Theorem 1)).
Every language decidable by a (deterministic) BSS machine is a countable disjoint union of semi-algebraic sets.
These characterisations are based on the fact that the computation of BSS and S-BSS machines can be encoded by formulae of first-order real arithmetic.
Existential theory of the real arithmetic.
Formulae of the existential real arithmetic are given by the grammar
(8) |
where stands for numerical terms given by the grammar
where is a first-order variable. The semantics is defined over a fixed structure of real arithmetic in the usual way. Relations definable by such formulae with additional real constants are called semi-algebraic.
Let be an S-BSS machine and positive natural numbers. We denote by (, resp.) the set of strings accepted by in time exactly (at most, resp.) , and define . The following restricted fragment of is enough to encode S-BSS computations.
Existential theory of the loose -guarded real arithmetic.
Formulae of the existential loose -guarded real arithmetic are defined as in (8), but without and replacing with .
Lemma 4.3.
Given a deterministic or -nondeterminis-tic S-BSS machine and positive it is possible to construct, in polynomial time, formulas and of loose -guarded real arithmetic, with free variables , that may use real constants used in such that
Proof.
For a given input of length , the computation of consists of many configurations of , where and are the initial configuration and a terminal configuration, respectively, and, for , is a successor configuration of . Each configuration is a string of real numbers of length . We can use a similar technique as in the right-to-left direction of Theorem 3.3 and encode the contents of registers by pairs of real numbers from the unit interval . In order to encode the computation, it suffices to encode the values of registers; thus variables suffice. We then construct a formula of existential loose -guarded real arithmetic of size that first existentially quantifies -many variables in order to guess the whole computation of on the given input and then expresses, using perhaps at most polynomially many extra variables, that the computation is correct and accepting. We omit further details, for the encoding is done in a similar manner as in the right-to-left direction of Theorem 3.3. ∎
Given a deterministic S-BSS machine , it is easy to see that the sets , for , are disjoint. However, the same does not need to hold for nondeterministic machines, for the time it takes to accept an input string might depend on the guessed value for the string (and there may be multiple accepting runs with different values for ). This problem can be evaded for languages that can be decided by a -nondeterministic S-BSS machine in time , for some function . In this case , for each . Now since and where the unions are disjoint, we obtain the following characterisation.
Theorem 4.4.
Every language decidable by a) a deterministic S-BSS machine or b) a -nondeterministic S-BSS machine in time , for some , is a countable disjoint union of relations defined by existential loose -guarded real arithmetic formulae that may use real constants from some finite set.
The rest of this section is dedicated on proving the following theorem, which together with Theorem 4.4 implies Theorem 4.1.
Theorem 4.5.
Every relation defined by some existential loose -guarded real arithmetic formula with real constants is closed in .
Point-set topology.
The proof of the theorem relies on some rudimentary notions and knowledge from point-set topology summarised in the following two lemmas (for basics of point-set topology see, e.g., the monograph (Willard, 2004)). In order to simplify the notation, for a topological space , we use to denote also the underlying set of the space. Likewise, in this section, we let [0, 1] denote the topological space that has domain [0, 1] and the metric of Euclidean distance.
Lemma 4.6.
Let and be topological spaces, a continuous function, and closed sets in , and a closed set in . Then
-
•
, , , and are closed in ,
-
•
the product is closed in the product space ,
-
•
if is a subspace of then is closed in .
Lemma 4.7.
Let be a topological space, a compact topological space, a closed set in the product space , and the projection function . Then the image of is closed in .
Proof of Theorem 4.5.
We prove the following claim by induction on the structure of the formulae: Let be a -tuple of distinct variables and an existential loose -guarded real arithmetic formula with real constants, and its free variables in . The relation defined by is closed in .
-
•
Assume . Recall that and are multivariate polynomials. Define as the multivariate polynomial and consider the preimage . Since is closed in and is a continuous function, it follows that is closed. Clearly is the relation defined by .
-
•
The cases of disjunctions and conjunctions are clear, for the union and intersection of closed sets is closed.
-
•
Assume . Let be the relation defined by , which by induction hypothesis is closed in . Define . Since is closed in , it follows from Lemma 4.6 that is closed both in and . Let be the projection of to its first columns. Since is closed in , and is a compact topological space, it follows from Lemma 4.7 that is closed in . Clearly is the relation defined by .∎
5. Hierarchy of the complexity classes
The main result of this section is the separation of the complexity classes and . We have already done most of the work required for the separation as the result follows directly from the topological argument of Section 4.5 that more generally separates S-BSS computations from BSS computations. The characterisations of Section 3 then yield the separation of the related logics on -structures. We also give logical proofs implying that the obvious strengthenings of coincide with . Finally we study the restriction of on Boolean inputs and establish that it coincides with a natural fragment of .
5.1. Separation of and
We can now use Theorem 4.5 to prove the following:
Theorem 5.1.
The following separations hold:
-
(1)
and ,
-
(2)
,
-
(3)
.
Proof.
We prove 1. by showing that there are languages in that are not in . The claims 2. and 3. then follow from the logical characterisations of Corollary 3.4.
Let be a language in and an S-BSS machine such that . Let be a polynomial function that bounds the running time of . Fix . Now . By Lemma 4.3 , and hence , is definable by an existential loose -guarded real arithmetic formula that uses real constants from . By Theorem 4.5 is a closed set in the product space , which is not true for all languages in ; for instance, a language consisting of all finite strings of positive reals can be decided in (using branching), but is not closed in . ∎
5.2. Robustness of
We have just seen that is a complexity class strictly below . We now give purely logical proofs implying that the obvious strengthenings of collapse to . The proofs are based on the logical characterisations established in Corollary 3.4.
The first obvious question is: Are and strictly below and ? In logical terms this boils down to the expressivity of the logic . We answer to this question in the negative.
Proposition 5.2.
and .
Proof.
The left-to-right direction is immediate as the constants and are definable in . For the converse direction, note that the numerical atom is equivalent to the statement . We show that is definable in . First note that every strictly positive real number can be expressed by a ratio of two real numbers such that . Moreover note that, for every such and , the ratio . It is easy to see that the following -formula
where , , and are 0-ary function variables, expresses that . ∎
Corollary 5.3.
and .
The second natural question is: Are and strictly below and ? Again, the answer is no. The proof of the following proposition follows directly from the observation that arbitrary real numbers can be encoded as ratios , where , using an additional marker for sign. It is crucial to note that with negated numerical atoms one can express that the denominators of such encodings are positive; in the loose fragment this is not possible. The encodings needed can be clearly expressed in . We omit the proof.
Proposition 5.4.
and .
Hence Corollary 3.4 yields the following:
Corollary 5.5.
and .
Finally we consider a weakening of by removing the constant from the language. It turns out that this small weakening has profound implications to the expressivity of the logic when restricted to function-free vocabularies.
Proposition 5.6.
Let . Then with respect to -structures on function-free vocabularies.
Proof.
The direction is self-evident. We give a proof for the converse. Let be an -structure of a function-free vocabulary , a formula, and an assignment for the first-order variables. Note that can be regarded also as a formula of ; we write to denote this interpretation. Let denote the -formula obtained from by removing the function quantifications in and replacing every numerical atom in with the formula . Now note that there is a homomorphism from the first-order structure to , and consequently, Here we note that implies since the second structure is a substructure of the first, and truth of existential formulae is preserved to extensions. Conversely, implies because atoms appear only positively, and the truth of formulae with only positive literals are preserved to homomorphic images. Since in the evaluation of every numerical term is evaluated to it follows that ∎
5.3. Separate branching on Boolean inputs and the existential theory of the reals
It is known that on Boolean inputs coincides with the complexity class (i.e., the class of problems polynomially reducible to the existential theory of the reals) (Bürgisser and Cucker, 2006; Schaefer and Stefankovic, 2017). In this section we show an analogous result for .
Definition 5.7.
Define to be the set of all languages for which there is a polynomial-time reduction from into sentences of existential loose -guarded real arithmetic such that iff .
We show the following theorem:
Theorem 5.8.
.
Proof.
Note that the right-to-left direction of this theorem follows immediately from Lemma 4.3 by noting that the only real constants used by S-BSS machines are and , and that the Boolean inputs to can be defined in by using the constants and .
Left-to-right. There exists a deterministic polynomial time Turing machine that given an input string computes the corresponding sentence of existential loose -guarded real arithmetic. Let be the polynomial that bounds the running time of . Without loss of generality we may assume that, for any given input of length , the formula computed by from input uses only variables . Let be a nondeterministic S-BSS machine that, for a given input of length , first guesses many real numbers from the unit interval (these will correspond to the values of the variables ). Then simulates the run of the deterministic polynomial time Turing machine on input . Let be the formula computed this way. Finally we can use to check the matrix of using the values guessed for the variables . We omit further details, for the evaluation of the matrix can done essentially in the same way as in the left-to-right direction of Theorem 3.3. ∎
6. Probabilistic team semantics
The purpose of this section is to characterise the descriptive complexity of probabilistic independence logic (Durand et al., 2018b). The formulae of this logic, and other logics that make use of dependency concepts involving quantities, are interpreted in probabilistic team semantics which generalises team semantics by adding weights on variable assignments. A finite model together with a probabilistic team can then be seen as a particular metafinite structure, and thus a natural approach to computational complexity comes from BSS machines.
Let be a finite set of first-order variables, a finite set, and a finite set of assignments (i.e., a team) from to . A probabilistic team is then defined as a function
such that . Also the empty function is considered a probabilistic team. We call and the variable domain and value domain of , respectively.
Probabilistic independence logic () is defined as the extension of first-order logic with probabilistic independence atoms whose semantics is the standard semantics of conditional independence in probability distributions. Another probabilistic logic, , is obtained by extending first-order logic with marginal identity atoms which state that the marginal distributions on and are identically distributed. The semantics for complex formulae are defined compositionally by generalising the team semantics of dependence logic to probabilistic teams. For details, not necessary in this paper, we refer the reader to (Durand et al., 2018b). In principle, the point is that formulae of probabilistic independence logic define properties of where is a finite model and a probabilistic team with value domain .
Example 6.1.
Suppose we flip a coin. If we get heads, we roll two dice and . If we get tails, we roll only and copy the same value for . Repeating this procedure infinitely many times yields at the limit a probabilistic team (i.e., a joint probability distribution) over variables and satisfying
By definition is true for a probabilistic team if is a mixture of two teams with respective properties and (here independence and (row-wise) identity between and ). By definition is true for a probabilistic team if the extension of with a uniform distribution for has the property (here identity between marginal distributions on and ).
We will now show that the descriptive complexity of probabilistic independence logic is exactly . For this we need some background definitions and results.
Expressivity comparisons wrt. probabilistic team semantics
Fix a relational vocabulary . For a probabilistic team with variable domain and value domain , the function is defined as the probability distribution such that for all . For a formula of vocabulary and with free variables , the class is defined as the class of -structures over such that , where and is the finite -structure underlying .
Let be any of the logics defined in Section 2. We write if for every formula of vocabulary there is a sentence of vocabulary such that . Vice versa, we write if for every sentence of vocabulary there is a formula of vocabulary such that .
Complexity characterisations wrt. probabilistic team semantics.
Let be a logic with vocabulary and a complexity class. Let be an arbitrary class of -structures over that is closed under isomorphisms and where the interpretations of are distributions. We write for the set of encodings of structures in . Consider the following two conditions:
-
(i)
for some .
-
(ii)
.
If implies , we write , and if the vice versa holds, we write .
It is already known that probabilistic independence logic captures a variant of loose existential second-order logic in which function quantification ranges over distributions. This result was shown in two stages. First, it was proven in (Durand et al., 2018b) that the logic is expressively equivalent to .222In (Durand et al., 2018b) equi-expressivity with is erroneously stated; the results in the paper actually entail equi-expressivity with . Later, it was proven in (Hannula et al., 2019) that marginal identity can be expressed using independence, that is, is expressively equivalent to .333In fact, is expressively equivalent to which is the extension of first-order logic with marginal independence atoms , the semantics of which is the standard semantics of marginal independence in probability distributions (Hannula et al., 2019).
We will now improve this result by removing the condition that restricts function quantification to distributions. For this we utilize a normal form lemma from (Durand et al., 2018b). Observe that we restrict attention to -structures, that is, all function symbols from the underlying vocabulary are interpreted as distributions.
Lemma 6.3 ((Durand et al., 2018b)).
For every -formula there is an -formula such that , where is of the form , where is quantifier-free and such that its second sort identity atoms are of the form or for distinct such that at most one of them is not quantified.
Lemma 6.4.
.
Proof.
We prove the claim in three steps, without relying on multiplication at any step. By Proposition 3.1 we may assume that the finite domain is enriched with a successor function for tuples, its transitive derivatives , and its minimal and maximal tuples and (of an appropriate arity), obtained by the lexicographic ordering induced from some linear ordering . Additionally, we may assume a constant on the finite domain.
Step 1: . We may assume that any formula is of the form stated in Lemma 6.3. Thus it suffices to express in each numerical identity of the form . First, we quantify a -ary distribution variable upon which we impose:
(9) | ||||
The point is to calculate partial sums and store sufficiently small fractions of them in . Suppose is the th tuple. Then
and for ,
Consequently, the sum of all where is at most . By allocating the remaining weights to such that , it follows that is a distribution.
Furthermore, we quantify a -ary distribution variable satisfying:
It follows that . Consequently, if and only if . Note that is not a distribution since the weights do not add up to . However, we may increment the arity of by one and replace above with . Then is a distribution if the remaining weights are pushed to , where . This concludes the proof of Step 1.
Step 2: We show a stronger claim: . For this, it suffices to show how to express in that a function is a distribution. The following formula expresses just that:
Step 3: We show a stronger claim: . Suppose is some formula in . Let be the maximal arity of any function variable/symbol appearing in , and suppose is the size of the finite domain; the total sum of the weights of a function is thus at most . We now show how to obtain from an equivalent formula in ; the idea is to scale all function weights by . We have two cases:
Function variables. If is an -ary quantified function variable, we replace it with an -ary quantified distribution variable satisfying
where is a -ary distribution variable. Now because is a distribution, and thus .
Function symbols. Suppose is a function term which appears as a term or subterm in , and is a function symbol from the underlying vocabulary. We quantify a -ary distribution variable satisfying
It follows that . Since , we may define as a distribution.
Observe now that each numerical atom appearing in is an identity between two multivariate polynomials over function terms. Without loss of generality all the constituent monomials in these atoms are of a fixed degree and have coefficient one; note that each monomial with degree less than can be appended in with a quantified nullary function taking value . We now replace in each numerical atom function terms with or , depending on whether is a function variable or a function symbol. Thus we represent in as , wherefore not only its truth value, but also that of , is preserved in the transformation. ∎
Theorem 6.5.
.
7. Concluding remarks
Applications of logic in AI and advanced data management require probabilistic interpretations, a role that is well fulfilled by probabilistic team semantics. On the other hand, in the theory of computation and automated reasoning, computation and logics over the reals are well established with solid foundations. In this paper we have provided bridges between the two worlds. We introduced a novel variant of BSS machines and provided a logical and topological characterisation of its computational power. In addition, we determined the expressivity of probabilistic independence logic with respect to the BSS model of computation.
There are many interesting directions of future research. One is to consider the additive fragment of BSS computation. Restricted to Boolean inputs it is known that, if unrestricted use of machine constants is allowed, the additive branching on equality collapses to and branching on inequality captures (Koiran, 1994). What can we say about the additive fragment of S-BSS computation? Another direction is to devise logics that characterise other important complexity classes over S-BSS machines. Grädel and Meer (Grädel and Meer, 1995) established a characterisation of polynomial time on ranked -structures using a variant of least fixed point logic. In the setting of team semantics and classical computation, Galliani and Hella (Galliani and Hella, 2013) showed that the so-called inclusion logic characterises polynomial time on ordered structures. Can we extend the applicability of these results to the realms of S-BSS computation and probabilistic team semantics? Finally, we would like to devise natural complete problems for the complexity classes defined by S-BSS machines. In particular, we would like to obtain a natural complete problem for ; a weakening of the art gallery problem is one promising candidate. We conclude with a few open problems:
-
•
Is strictly included in ? A positive answer would be a major breakthrough, as it would separate from .
-
•
We know that . Can we establish a better upper bound for ? In particular, is contained in the polynomial hierarchy?
-
•
We established that S-BSS computable languages are included in the class of BSS computable languages that are countable disjoint unions of closed sets. Does the converse hold?
Acknowledgements.
The first and the second author were supported by the Academy of Finland grant 308712. The third and the fourth author were supported by the Research Foundation Flanders grant G0G6516N. The third author was partially supported by the National Natural Science Foundation of China under grant 61972455, and the fourth author was an international research fellow of the Japan Society for the Promotion of Science, Postdoctoral Fellowships for Research in Japan (Standard).References
- (1)
- Abrahamsen et al. (2018) Mikkel Abrahamsen, Anna Adamaszek, and Tillmann Miltzow. 2018. The art gallery problem is -complete. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29, 2018. 65–73. https://doi.org/10.1145/3188745.3188868
- Benedikt et al. (2003) Michael Benedikt, Martin Grohe, Leonid Libkin, and Luc Segoufin. 2003. Reachability and connectivity queries in constraint databases. J. Comput. System Sci. 66, 1 (2003), 169 – 206. https://doi.org/10.1016/S0022-0000(02)00034-X Special Issue on PODS 2000.
- Blum et al. (1997) Lenore Blum, Felipe Cucker, Michael Shub, and Steve Smale. 1997. Complexity and Real Computation. Springer-Verlag, Berlin, Heidelberg.
- Blum et al. (1989) Lenore Blum, Mike Shub, and Steve Smale. 1989. On a theory of computation and complexity over the real numbers: - completeness, recursive functions and universal machines. Bull. Amer. Math. Soc. (N.S.) 21, 1 (07 1989), 1–46. https://projecteuclid.org:443/euclid.bams/1183555121
- Bürgisser and Cucker (2006) Peter Bürgisser and Felipe Cucker. 2006. Counting complexity classes for numeric computations II: Algebraic and semialgebraic sets. J. Complexity 22, 2 (2006), 147–191. https://doi.org/10.1016/j.jco.2005.11.001
- Canny (1988) John F. Canny. 1988. Some Algebraic and Geometric Computations in PSPACE. In Proceedings of the 20th Annual ACM Symposium on Theory of Computing, May 2-4, 1988, Chicago, Illinois, USA. 460–467. https://doi.org/10.1145/62212.62257
- Corander et al. (2019) Jukka Corander, Antti Hyttinen, Juha Kontinen, Johan Pensar, and Jouko Väänänen. 2019. A logical approach to context-specific independence. Ann. Pure Appl. Logic 170, 9 (2019), 975–992. https://doi.org/10.1016/j.apal.2019.04.004
- Cucker and Meer (1999) Felipe Cucker and Klaus Meer. 1999. Logics Which Capture Complexity Classes Over The Reals. J. Symb. Log. 64, 1 (1999), 363–390. https://doi.org/10.2307/2586770
- Durand et al. (2018a) Arnaud Durand, Miika Hannula, Juha Kontinen, Arne Meier, and Jonni Virtema. 2018a. Approximation and dependence via multiteam semantics. Ann. Math. Artif. Intell. 83, 3-4 (2018), 297–320. https://doi.org/10.1007/s10472-017-9568-4
- Durand et al. (2018b) Arnaud Durand, Miika Hannula, Juha Kontinen, Arne Meier, and Jonni Virtema. 2018b. Probabilistic Team Semantics. In Foundations of Information and Knowledge Systems - 10th International Symposium, FoIKS 2018, Budapest, Hungary, May 14-18, 2018, Proceedings. 186–206. https://doi.org/10.1007/978-3-319-90050-6_11
- Galliani (2008) Pietro Galliani. 2008. Game Values and Equilibria for Undetermined Sentences of Dependence Logic. (2008). MSc Thesis. ILLC Publications, MoL–2008–08.
- Galliani and Hella (2013) Pietro Galliani and Lauri Hella. 2013. Inclusion Logic and Fixed Point Logic. In Computer Science Logic 2013 (CSL 2013) (Leibniz International Proceedings in Informatics (LIPIcs)), Simona Ronchi Della Rocca (Ed.), Vol. 23. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 281–295. https://doi.org/10.4230/LIPIcs.CSL.2013.281
- Grädel and Gurevich (1998) Erich Grädel and Yuri Gurevich. 1998. Metafinite Model Theory. Inf. Comput. 140, 1 (1998), 26–81. https://doi.org/10.1006/inco.1997.2675
- Grädel and Kreutzer (1999) Erich Grädel and Stephan Kreutzer. 1999. Descriptive Complexity Theory for Constraint Databases. In Computer Science Logic, 13th International Workshop, CSL ’99, 8th Annual Conference of the EACSL, Madrid, Spain, September 20-25, 1999, Proceedings. 67–81. https://doi.org/10.1007/3-540-48168-0_6
- Grädel and Meer (1995) Erich Grädel and Klaus Meer. 1995. Descriptive complexity theory over the real numbers. In Proceedings of the Twenty-Seventh Annual ACM Symposium on Theory of Computing, 29 May-1 June 1995, Las Vegas, Nevada, USA. 315–324. https://doi.org/10.1145/225058.225151
- Hannula et al. (2019) Miika Hannula, Åsa Hirvonen, Juha Kontinen, Vadim Kulikov, and Jonni Virtema. 2019. Facets of Distribution Identities in Probabilistic Team Semantics. In JELIA (Lecture Notes in Computer Science), Vol. 11468. Springer, 304–320.
- Hannula and Kontinen (2016) Miika Hannula and Juha Kontinen. 2016. A finite axiomatization of conditional independence and inclusion dependencies. Inf. Comput. 249 (2016), 121–137. https://doi.org/10.1016/j.ic.2016.04.001
- Hansen and Meer (2006) Uffe Flarup Hansen and Klaus Meer. 2006. Two logical hierarchies of optimization problems over the real numbers. Math. Log. Q. 52, 1 (2006), 37–50. https://doi.org/10.1002/malq.200510021
- Hyttinen et al. (2017) Tapani Hyttinen, Gianluca Paolini, and Jouko Väänänen. 2017. A Logic for Arguing About Probabilities in Measure Teams. Arch. Math. Logic 56, 5-6 (2017), 475–489. https://doi.org/10.1007/s00153-017-0535-x
- Kanellakis et al. (1995) Paris C. Kanellakis, Gabriel M. Kuper, and Peter Z. Revesz. 1995. Constraint Query Languages. J. Comput. Syst. Sci. 51, 1 (1995), 26–52. https://doi.org/10.1006/jcss.1995.1051
- Koiran (1994) Pascal Koiran. 1994. Computing over the Reals with Addition and Order. Theor. Comput. Sci. 133, 1 (1994), 35–47. https://doi.org/10.1016/0304-3975(93)00063-B
- Krebs et al. (2018) Andreas Krebs, Arne Meier, Jonni Virtema, and Martin Zimmermann. 2018. Team Semantics for the Specification and Verification of Hyperproperties. In MFCS (LIPIcs), Vol. 117. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 10:1–10:16.
- Kreutzer (2000) Stephan Kreutzer. 2000. Fixed-Point Query Languages for Linear Constraint Databases. In Proceedings of the Nineteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, May 15-17, 2000, Dallas, Texas, USA. 116–125. https://doi.org/10.1145/335168.335214
- Meer (2000) Klaus Meer. 2000. Counting problems over the reals. Theor. Comput. Sci. 242, 1-2 (2000), 41–58. https://doi.org/10.1016/S0304-3975(98)00190-X
- Schaefer (2009) Marcus Schaefer. 2009. Complexity of Some Geometric and Topological Problems. In Graph Drawing, 17th International Symposium, GD 2009, Chicago, IL, USA, September 22-25, 2009. Revised Papers. 334–344. https://doi.org/10.1007/978-3-642-11805-0_32
- Schaefer and Stefankovic (2017) Marcus Schaefer and Daniel Stefankovic. 2017. Fixed Points, Nash Equilibria, and the Existential Theory of the Reals. Theory Comput. Syst. 60, 2 (2017), 172–193. https://doi.org/10.1007/s00224-015-9662-0
- Väänänen (2007) Jouko Väänänen. 2007. Dependence Logic. Cambridge University Press.
- Willard (2004) S. Willard. 2004. General Topology. Dover Publications. https://books.google.co.jp/books?id=-o8xJQ7Ag2cC