arXiv:2003.00644v2 [cs.LO] 8 Jul 2020 00Cprgthl yteonrato() ulcto rights Publication owner/author(s). the by held Copyright 2020 © eitoueanvlvrato S ahnscle Sepa- called machines BSS of variant novel a introduce We C SN978-1-4503-7104-9/20/07...$15.00 ISBN ACM btatn ihcei spritd ocp tews,o republis or otherwise, copy To permitted. is credit with Abstracting t,ta eatc,idpnec oi,ra arithmetic. real logic, independence semantics, team ity, Keywords: statistics and bility oACM. to Germany Saarbrücken, 2020, 8–11, July ’20, [email protected]. LICS from permissions specific Request prior fee. requires a lists, to and/or redistribute to or servers on post computation t hoyadlogic and theory ity hps://doi.org/10.1145/3373718.3394773 hono be must author(s) the fo than Copyrights others page. by first owned the work on this citation of full ponents c the f that and work and notice advantage this this commercial cop or bear of that profit provided part for fee distributed or or without made all granted not of is use copies classroom hard or or personal digital make to Permission seta hoyo h el)adhnele between lies hence ex- and true reals) the the of to theory reducible istential time polynomial problems of class ceie aua rgeto h opeiyclass complexity the of char- fragment constants natural real a without acterises machines S-BSS on NP inputs C Concepts: CCS logic. independence probabilistic of complexity PSPACE hnsi onal ijituino lsdst nthe in sets closed of union disjoint of topology ma- usual countable S-BSS a on language is NP NP every in chines that included and strictly machines is BSS machines on S-BSS on NP that show We machines. S-BSS by time polynomial nondeterministic decidabl in languages for a characterisation develop logical and short) Fagin-type in (S-BSS machines BSS Branching rate Abstract Atos22.Ti steato’ eso ftewr.I spost is It work. the of version author’s the is This 2020. ©Authors ok Y S,https://doi.org/10.1145/3373718.3394773. USA, NY, York, nPoednso h 5hAna C/EESmoimo oi nCompu in Logic on Symposium ACM/IEEE Annual 35th the of Proceedings in ecitv opeiyo elcmuainand computation real of complexity Descriptive ial eapyorrslst eemn h data the determine to results our apply we Finally . lmSu-ml ahns ecitv complex- descriptive machines, Blum-Shub-Smale • ; [email protected] • ahmtc fcomputing of Mathematics R hoyo computation of Theory [email protected] n a a e Bussche den Van Jan oevr eetbihta nBoolean on that establish we Moreover, . nvriyo Helsinki of University . ; asl University Hasselt ik Hannula Miika iieMdlTheory Model Finite rbblsi neednelogic independence probabilistic Belgium Finland → ; oesof Models Complex- → permission NP dhr o orproa s.Ntfrrdsrbto.Tedfiiiev definitive The redistribution. for Not use. personal your for here ed Proba- licensed ∃ e are ies com- r R opies ,to h, and red. (a or e e cec LC 2) uy81,22,Sabükn emn,A Germany, Saarbrücken, 2020, 8–11, July ’20), (LICS Science ter where itm.22.Dsrpiecmlxt fra computation real of complexity Descriptive 2020. Virtema. Format: Reference ACM tig fras hl h ou spiaiyo languages on primarily is focus the While reals. of strings e oteramo S ahns uha nondeterministic as ( such machines, time BSS polynomial Many of step. realm trans- the theory time to complexity fer single classical a from compute in classes can reals complexity which over and functions numbers rational real that arbitrary registers store with can machines access random essentially are machines Blum-Shub-Smale ad n in and hand, nqaiisadeulte.Kont be to Known equalities. and inequalities ypsu nLgci optrSine(IS’0,Jl 8–11 July ’20), Germany. Saarbrücken, (LICS Science Computer in Logic on Symposium In logic. independence abilistic is sltda opeiycasi t w ih n[ in right own theory. its in graph class geometric complexity in a role as considerable isolated central exis- First attracting its The today to question. is due open reals interest the major of a theory is tential theory this of plexity form the of are and reals the about true are reals that the sentences of theory existential The Introduction 1 ∃ rbe fdcdn hte oyo a egaddby [ guarded guards be of number can given polygon a a whether deciding of problem e scmlt for classi- complete been as have fied problems geometric decade and past algebraic the several In reductions. polynomial-time under reals ik anl,Jh otnn a a e ush,adJonni and Bussche, den Van Jan Kontinen, Juha Hannula, Miika R h xseta hoyo h el scoeycnetdto connected closely is reals the of theory existential The sdfie stecoueo h xseta hoyo the of theory existential the of closure the as defined is ϕ saqatfirfe rtmtcfruacontaining formula arithmetic quantifier-free a is [email protected].ac.jp PSPACE [email protected] nvriyo Helsinki of University okioUniversity Hokkaido ∃ NP asl University Hasselt x uaKontinen Juha on Virtema Jonni 1 ∃ C,NwYr,N,USA, NY, York, New ACM, . . . R R nteohrhn [ hand other the on vrlnugscnitn ffinite of consisting languages over ) Belgium Finland eeteapei h r gallery art the is example recent a ; Japan ∃ x 1 n rceig fte3t nulACM/IEEE Annual 35th the of Proceedings BSmciefrsot which short) for machine (BSS ]. ϕ ( x 1 , . . . , ossso l first-order all of consists x n NP ) , 6 rinwspublished was ersion ,teeatcom- exact the ], hr nteone the on -hard 15 pages. M New CM, n prob- and hps://doi.org/10.1145/3373718.3394773 2020, , 25 ], LICS ’20, July 8–11, 2020, Saarbrücken, Germany M. Hannula, J. Kontinen, J. Van den Bussche, and J. Virtema
0 0 over some numerical domain (e.g., reals or complex num- BP(S-NP[0,1]) BP(NPR) bers), also Boolean inputs (strings over {0, 1}) can be con- NP ⊆ = ∗ ⊆ = ⊆ PSPACE sidered. In this context ∃R corresponds to the Boolean part ∃[0, 1]≤ ∃R 0 0 of NPR (BP(NPR)), obtained by restricting NPR to Boolean inputs and limiting the use of machine constants to 0 and 1, 0 0 S-NP[0,1] NPR as feasibility of Boolean combinations of polynomial equa- ≡ ∗ ⊂∗ ≡ tions is complete for both of these classes [5, 26]. L-ESO[0,1][+, ×, ≤, 0, 1] ESOR[+, ×, ≤, 0, 1] BSS computations can also be described logically. This re- ≡ ∗ search orientation was initiated by Grädel and Meer who FO(⊥⊥c) showed that NPR is captured by a variant of existential second- Table 1. Known complexity results and logical character- order logic (ESOR) over metafinite structures [15]. Metafinite isations together with the main results of this paper. The structures are two-sorted structures that consist of a finite results of this paper are marked with an asterisk (*). The structure, an infinite domain with some arithmetics (such as top figure is with respect to Boolean inputs; on the bottom the reals with multiplication and addition), and weight func- figure, the inputs can include real numbers. tions bridging the two sorts [13]. Since the work by Grädel and Meer, others (see, e.g., [8, 18, 24]) have shed more light upon the descriptive complexity over the reals mirroring the +, , , R development of classical descriptive complexity. In addition languages (denoted by S-NP[0,1]) with L-ESO[0,1][ × ≤ (r)r ∈ ] to metafinite structures, the connection between logical de- that is a natural sublogic of ESOR. Likewise, we isolate a finability encompassing numerical structures and computa- fragment ∃[0, 1]≤ of the complexity class ∃R and show that 0 tional complexity has received attention in constraint databases it coincides with the class of Boolean languages in S-NP[0,1]. [2, 14, 23]. A constraint database models, e.g., geometric Moreover we establish a topological characterisation of the data by combining a numerical context structure, such as the languages decidable by S-BSS machines; we show that, un- real arithmetic, with a finite set of quantifier-free formulae der certain natural restrictions, languages decidable by S- defining infinite database relations [20]. BSS machines are countable disjoint unions of closed sets In this paper we investigate the descriptive complexity of in the usual topology of Rn. The topological characterisa- so-called probabilistic independence logic in terms of the BSS tion separates the languages decidable by BSS machines and model of computation and the existential theory of the re- S-BSS machines, respectively. Moreover it enables us to sep- als. Probabilistic independence logic is a recent addition to 0 0 arate the complexity classes S-NP[0,1] and NPR. Finally we the vast family of new logics in team semantics. In team se- show the equivalence of the logics L-ESO[0,1][+, ×, ≤, 0, 1] mantics [27] formulae are evaluated with respect to sets of 0 and FO(⊥⊥c), implying that FO(⊥⊥c)≡ S-NP[0,1]. Table 1 sum- assignments which are called teams. During the past decade marises the main results of the paper. research on team semantics has flourished with interesting Structure of the paper. Section 2 gives the basic defini- connections to fields such as database theory [17], statistics tions on descriptive complexity, BSS machines, and logics [7], hyperproperties [22], and quantum information theory on R-structures required for this paper. Section 3 focuses [19], just to mention a few examples. The focus of this arti- in giving logical characterisations of variants of NP on S- cle is probabilistic team semantics that extends team based BSS machines. In Section 4 we establish the aforementioned logics with probabilistic dependency notions. While the first topological characterisation of S-BSS decidable languages. ideas of probabilistic teams trace back to [11, 19], the system- In Section 5 we prove a hierarchy of the related complexity atic study of the topic was initiated by the works [9, 10]. 0 0 classes; in particular we separate S-NP and NPR. Section At the core of probabilistic independence logic FO(⊥⊥ ) [0,1] c 6 deals with probabilistic team semantics and establishes is the concept of conditional independence. The models of that FO(⊥⊥ )≡ S-NP0 . Section 7 concludes the paper. this logic are finite first-order structures but the notion of a c [0,1] team is replaced by a probabilistic team, i.e., a discrete prob- ability distribution over a finite set of assignments. In [10] it 2 Preliminaries was observed that probabilistic independence logic is equiv- A vocabulary is relational (resp., functional) if it consists of alent to a restriction of ESOR in which the weight functions only relation (resp., function) symbols. A structure is rela- are distributions. The exact complexity and relationship of tional if it is defined over a relational vocabulary. We let FO(⊥⊥c) to ESOR and NPR was left as an open question; in Var1 and Var2 denote disjoint countable sets of first-order this paper we present a (strict) sublogic of ESOR and a (strict) and function variables (with prescribed arities), respectively. subclass of NPR that both capture FO(⊥⊥c). We write xì to denote a tuple of first-order variables and |ìx | Our contribution. In this paper we introduce a novel to denote the length of that tuple. The arities of function variant of BSS machines called Separate Branching BSS ma- variables f and relation symbols R are denoted by ar(f ) and chines (S-BSS machines for short) and characterise its NP ar(R), respectively. If f is a function with domain Dom(f ) Real computation and probabilistic team semantics LICS ’20, July 8–11, 2020, Saarbrücken, Germany and A a set, we define f ↾ A to be the function with do- {+, ×, SUM}, E ⊆ {=,<, ≤}, and C ⊆ R. The set of τ ∪ σ- main Dom(f ) ∩ A that agrees with f for each element in formulae of ESOR[O, E,C] is defined via the grammar: its domain. Given a finite set D, a function f : D → [0, 1] ϕ ::= x = y | ¬x = y | iej | ¬iej | R(ìx) | ¬R(ìx) | that maps elements of D to elements of the closed interval = ∧ | ∨ | ∃ | ∀ | ∃ , [0, 1] of real numbers such that s ∈D f (s) 1 is called a ϕ ϕ ϕ ϕ xϕ xϕ f ψ Í (probability) distribution. where i and j are numerical σ-terms constructed using op- erations from O and constants from C, and e ∈ E, R ∈ τ is 2.1 R-structures a relation symbol, f is a function variable, x and y are first- Let τ be a relational vocabulary. A τ -structure is a tuple order variables and xì a tuple of first-order variables, and ψ A = A A (A, (R )R ∈τ ), where A is a nonempty set and each R an is a τ ∪(σ ∪ {f })-formula of ESOR[O, E,C]. ar(R)-ary relation on A. The structure A is a finite structure if τ and A are finite sets. In this paper, we consider struc- Note that the syntax of ESOR[O, E,C] allows first-order tures that enrich finite relational τ -structures by adding real subformulae to appear only in negation normal form. This numbers (R) as a second domain sort and functions that map restriction however does not restrict the expressiveness of tuples over A to R. the language. The semantics of ESOR[O, E,C] is defined via R-structures Definition 2.1. Let τ and σ be respectively a finite rela- and assignments analogous to first-order logic; note that tional and a finite functional vocabulary, and let X ⊆ R. An first-order variables are always assigned to a value in A whereas X -structure of vocabulary τ ∪ σ is a tuple functions map tuples over A to R. In addition to the clauses A A of first-order logic, we have the following semantical clauses: A = (A, R, (R )R ∈τ , (g )g ∈σ ), A = A A A = A = | s iej ⇔[i]s e [j]s , | s ¬iej ⇔ 6| s iej, where the reduct of A to τ is a finite relational structure, A A = ∃ A = ar(f ) R and each g is a weight function from Aar(g) to X . Addition- | s fϕ ⇔ [h/f ]| s ϕ for some h : A → , (1) A ally, an d[0, 1]-structure is defined analogously, with the where A[h/f ] is the expansion of A that interprets f as h. exception that the weight functions gA are distributions. Given S ⊆ R, we define ESOS [O, E,C] as the variant of , , ar(f ) An assignment is a total function s : Var → A that ESOR[O E C] in which (1) is modified such that h : A → 1 , , assigns a value for each first-order variable. The modified S, and ESOd[0,1][O E C] as the variant in which (1) is mod- ar(f ) assignment s[a/x] is an assignment that maps x to a and ified such that h : A → [0, 1] is a distribution, that is, Σ = aì∈Aar(f )h(ìa) 1. Note that in the setting of ESOd[0,1][O, E,C] agrees with s for all other variables. A Next, we define a variant of functional existential second- the value f of a 0-ary function symbol f is always 1. order logic with numerical terms (ESOR) that is designed Loose fragment. For both S ⊆ R and S = d[0, 1], de- to describe properties of R-structures. As first-order terms fine L-ESOS [O, E,C] as the loose fragment of ESOS [O, E,C] we have only first-order variables. For a set σ of function in which negated numerical atoms ¬iej are disallowed. We symbols, the set of numerical σ-terms i is generated by the want to point out that as long as = ∈ E and 0, 1 ∈ C, the logic following grammar: L-ESOS [O, E,C] subsumes existential second-order logic over = + finite structures (a precise formulation is given later by Propo- i :: c | f (ìx)| i × i | i i | SUMyì i, sition 3.1). where c ∈ R is a real constant denoting itself, f ∈ σ, and xì Expressivity comparisons. Fix a relational vocabulary τ and yì are tuples of first-order variables from Var such that 1 and a functional vocabulary σ. Let L and L′ be some log- the length of xì is ar(f ). The value of a numerical term i in A ics over τ ∪ σ defined above, and let X ⊆ R or X = d[0, 1]. a structure A under an assignment s is denoted by [i] . In s For a formula ϕ ∈ L, define StrucX (ϕ) to be the class of addition to the natural semantics for the real constants, we X -structures A of vocabulary τ ∪ σ such that A |= ϕ. We have the following rules for the numerical terms: ′ write L ≤X L if for all sentences ϕ ∈ L there is a sen- A A A A A ′ X = X [f (ìx)] := f (s(ìx)), [i × j] := [i] ·[j] , tenceψ ∈ L such that Struc (ϕ) Struc (ψ ). As usual, the s s s s = R A A A A A shorthand ≡X stands for ≤X in both directions. For X , [i + j] := [i] + [j] , [SUM i] := [i] , yì s Õ s[ìa/ìy] we write simply ≤ and ≡. |ìy | aì∈A In plain words, the subscript S in ESOS [O, E,C] consti- where +, ·, are the addition, multiplication, and summa- tutes the class of functions available for quantification, whereas X tion of realÍ numbers, respectively. the superscript X in Struc (ϕ) constitutes the class of func- tions available for function symbols in the vocabulary. Thus, X Definition 2.2 (Syntax of ESOR). Let τ be a finite relational ϕ ∈ ESOS [O, E,C] defines a class Struc (ϕ), even if S and X vocabulary and σ a finite functional vocabulary. Let O ⊆ are different. LICS ’20, July 8–11, 2020, Saarbrücken, Germany M. Hannula, J. Kontinen, J. Van den Bussche, and J. Virtema
∗ ∗ 2.2 Blum-Shub-Smale Model fM : R → R of a machine M is now defined in the obvious R∗ R∗ = We will next give a definition of BSS machines (see e.g. [3]). manner. A function f : → is computable if f fM R∗ We define R∗ := {Rn | n ∈ N}. The size |x | of x ∈ Rn is for some machine M. A language L ⊆ is decided by a BSS R∗ R∗ defined as n. TheÐ space R∗ can be seen as the real analogue machine M if its characteristic function χL : → is fM . Σ∗ Σ R of for a finite set . We also define ∗ as the set of all Deterministic complexity classes. A machine M runs in = R R sequences x (xi )i ∈Z where xi ∈ . The members of ∗ (deterministic) time t : N → N, if M reaches the output in are thus of the form (..., x−2, x−1, x0, x1, x2,...). Given an t(|x |) steps for each input x ∈ I. The machine M runs in R∗ R element x ∈ ∪ ∗ we write xi for the ith coordinate of polynomial time if t is a polynomial function. The complex- R ∗ x. The space ∗ has natural shift operations. We define shift ity class PR is defined as the set of all subsets of R that are R R R R = left σl : ∗ → ∗ and shift right σr : ∗ → ∗ as σl (x)i : decided by some machine M running in polynomial time. xi+1 and σr (x)i := xi−1. Nondeterministic complexity classes. A language L ⊆ Definition 2.3 (BSS machines). A BSS machine consists of R∗ is decided nondeterministically by a BSS machine M, if an input space I = R∗, a state space S = R , and an output ∗ ′ = ′ R∗ space O = R∗, together with a connected directed graph x ∈ L if and only if fM ((x, x )) 1, for some x ∈ , ,..., whose nodes are labelled by 1 N . The nodes are of five when a slightly different input mapping gI : I → S, which different types. ′ ′ places an input (x1,..., xn, x1,..., xm) in the state 1. Input node. The node labeled by 1 is the only input (..., 0, n,m, x ,..., x , x ′,..., x ′ ,...) ∈ S, node. The node is associated with a next node β(1) 1 n 1 m ′ and the input mapping gI : I → S. where the sizes of x and x are respectively placed on the 2. Output node. The nodelabeled by N is the only output first two coordinates, is used. When we consider languages node. This node is not associated with any next node. that a machine M decides nondeterministically, we call M Once this node is reached, the computation halts, and nondeterministic. Sometimes when we wish to emphasize the result of the computation is placed on the output that this is not the case, we call M deterministic. Moreover, space by the output mapping gO : S → O. we say that M is [0,1]-nondeterministic, if the guessed strings 3. Computation nodes. A computation node m is associ- x ′ are required to be from [0, 1]∗. L is decided in time t : N → N ated with a next node β(m) and a mapping gm : S → , if, for every x ∈ L, M reaches the output 1 in t(|x |) steps S such that for some c ∈ R and i, j, k ∈ Z the mapping for some x ′ ∈ R∗. Themachine runs in polynomial time if t is gm is identity on coordinates l , i and on coordinate a polynomial function. The class NPR consists of those lan- i one of the following holds: guages L ⊆ R∗ for which there exists a machine M that non- • gm (x)i = xj + xk (addition), deterministically decides L in polynomial time. Note that, in ′ • gm (x)i = xj − xk (subtraction), this case, the size of x above can be bounded by a polyno- • gm (x)i = xj × xk (multiplication), mial (e.g., the running time of M) without altering the defini- • gm (x)i = c (constant assignment). tion. The complexity class NPR has many natural complete 4. Branch nodes. A branch nodem is associated with nodes problems such as 4-FEAS, i.e., the problem of determining β−(m) and β+(m). Given x ∈ S the next node is β−(m) whether a polynomial of degree four has a real root [4]. if x ≤ 0, and β+(m) otherwise. 0 Complexity classes with Boolean restrictions. If we re- 5. Shift nodes. A shift node m is associated either with strict attention to machines M that may use only c ∈ {0, 1} shift left σ or shift right σ , and a next node β(m). l r in constant assignment nodes, then the corresponding com- The input mapping gI : I → S places an input (x1,..., xn) plexity classes are denoted using an additional superscript 0 in the state 0 (e.g., as in NPR). Complexity classes over real computa- tion can also be related to standard complexity classes. For (..., 0, n, x1,..., xn, 0,...) ∈ S, a complexity class C over the reals, the Boolean part of C, where the size of the input n is located at the zeroth coordi- written BP(C), is defined as {L ∩ {0, 1}∗ | L ∈ C}. nate. The output mapping gO : S → O maps a state to the string consisting of its first l positive coordinates, where l Descriptive complexity. Similar to Turing machines, also is the number of consecutive ones stored in the negative BSS machines can be studied from the vantage point of de- coordinates starting from the first negative coordinate. For scriptive complexity. To this end, finite R-structures are en- instance, gO maps coded as finite strings of reals using so-called rankings that stipulate an ordering on the finite domain. Let A be an R- (..., 2, 1, 1, 1, n, x , x , x , x ,...) ∈ S, 1 2 3 4 structure over τ ∪ σ where τ and σ are relational and func- to (x1, x2, x3) ∈ O. A configuration at any moment of com- tional vocabularies, respectively. A ranking of A is any bijec- putation consists of a node m ∈ {1,..., N } and a current tion π : Dom(A) → {1,..., |A|}. A ranking π and the lexico- k k state x ∈ S. The (sometimes partial) input-output function graphic ordering on N induce a k-ranking πk : Dom(A) → Real computation and probabilistic team semantics LICS ’20, July 8–11, 2020, Saarbrücken, Germany
k − {1,..., |A| } for k ∈ N. Furthermore, π induces the follow- x0 ≥ ϵ+, β (m) if x0 ≤ ϵ−, and otherwise the input is A A ing encoding encπ (A). First we define encπ (R ) and encπ (f ) rejected. for R ∈ τ and f ∈ σ: Note that for a given S-BSS machine it is easy to write an • Let R ∈ τ be a k-ary relation symbol. The encoding A k equivalent BSS machine. A priori it is not clear whether the encπ (R ) is a binary string of length |A| such that the A converse is possible; in fact, we will later show that in some jth symbol in encπ (R ) is 1 if and only if (a1,..., ak ) ∈ A cases the converse is not possible. R , where π (a ,..., a ) = j. k 1 k We can now define the variants of the complexity classes • Let f ∈ σ be a k-ary function symbol. The encod- 0 0 A k PR, PR, NPR, and NPR that are obtained by replacing BSS ing encπ (f ) is string of real numbers of length |A| A A machines with S-BSS machines in the definitions of the com- such that the jth symbol in encπ (f ) is f (ìa), where 0 plexity classes. Furthermore, we define NP[0,1], and NP , πk (ìa) = j. [0 1] as the variants of NPR, and NP0 in which the input x may The encoding enc (A) is then the concatenation of the string R π be any element from R∗ but the guessed element x ′ must (1,..., 1) of length |A| and the encodings of the interpre- be taken from [0, 1]∗. Let C be one of the aforementioned tations of the relation and function symbols in τ ∪ σ. We complexity classes. We define S-C to be the variant of C, denote by enc(A) any encoding enc (A) of A. π where, instead of BSS machines, S-BSS machines are used. Let C be a complexity class and ESO [O, E,C] a logic, S If C includes the superscript 0, this means that not only the where O ⊆ {+, ×, SUM}, E ⊆ {=,<, ≤}, C ⊆ R, and S ⊆ R parameter c in constant assignment, but also ϵ and ϵ+ in or S = d[0, 1]. Let X ⊆ R or X = d[0, 1], and let S be an ar- − separate branching are from {0, 1}. bitrary class of X -structures over τ ∪ σ that is closed under isomorphisms. We write enc(S) for the set of encodings of structures in S. Consider the following two conditions: 3 Descriptive complexity of (i) enc(S) = {enc(A) | A ∈ StrucX (ϕ)} for some ϕ ∈ nondeterministic polynomial time in ESOS [O, E,C][τ ∪ σ]}, S-BSS (ii) enc(S) ∈ C. We now show that S-NP[0,1] corresponds to a numerical vari- If (i) implies (ii), we write ESOS [O, E,C] ≤X C, and if the ant of ESO in which quantified functions take values from vice versa holds, we write C ≤X ESOS [O, E,C]. If both di- the unit interval and numerical inequality atoms only ap- rections hold, then we write ESOS [O, E,C] ≡X C. We omit pear positively. Later we show that both of these restrictions the subscript X in the notation if X = R. are necessary in the sense that removing either one lifts + The following results due to Grädel and Meer extend Fa- expressiveness to the level of ESOR[ , ×, ≤, (r)r ∈R] which gin’s theorem to the context of real computation.1 captures NPR. On the other hand, we give a logical proof, based on topological arguments, that S-NP < NPR. The + [0,1] Theorem 2.4 ([15]). ESOR[ , ×, ≤, (r)r ∈R]≡ NPR and proof of Theorem 3.3 is a nontrivial adaptation of the proof + 0 ESOR[ , ×, ≤] ≡ NPR. of Theorem 2.4 (see [15, Theorem 4.2]). In the proof we ap- ply Lemma 3.2 and, by Proposition 3.1, assume without loss 2.3 Separate Branching BSS of generality built-in ESO definable predicates on the finite We now define a restricted version of the BSS model which part. − branches with respect to two separated intervals (−∞, ϵ ] ( + ) + Let 0 and 1 be distinct constants, d a k 1 -ary distri- and [ϵ , ∞). We will later relate these BSS machines to cer- bution, and R a k-ary relation on a finite domain A of size tain fragments of ESOR and the existential theory of the re- n. We say that d is the characteristic distribution of R (w.r.t. als. 0 and 1) if aì ∈ R implies d(ìa, 1) = 1 , and aì < R implies nk (ì, ) = 1 Definition 2.5 (Separate Branching BSS Machine). Sepa- d a 0 nk . The next proposition implies that it is possi- rate branching BSS machines (S-BSS machines for short) are ble to simulate existential quantification of ESO definable otherwise identical to the BSS machines of Definition 2.3, ex- predicates on the finite domain using function (or distribu- cept that the branch nodes are replaced with the following tion) quantification; in particular, we may assume without separate branch nodes. loss of generality built-in predicates such as a linear order- ing and its induced successor relation on the finite domain. • Separate branch nodes. A separate branch node m is + Clearly, any predicate that is ESO-definable over finite struc- associated with ϵ , ϵ+ ∈ R, ϵ < ϵ+, and nodes β (m) − − tures is also ESO-definable (w.r.t. the finite domain) over R- and β−(m). Given x ∈ S the next node is β+(m) if structures. , , , ∃ 1Only the first equivalence is explicitly stated in [15]. The second, how- Below, we write L-ESOS [O E C X ] to denote the exten- ever, is a simple corollary, using the fact that 0 and 1 can be identified in sion of L-ESOS [O, E,C] by existential quantification of rela- ESOR[+, ×, ≤]; these two are the only idempotent reals for multiplication, tions over the finite domain with the usual semantics. and 0 is the only idempotent real for addition. LICS ’20, July 8–11, 2020, Saarbrücken, Germany M. Hannula, J. Kontinen, J. Van den Bussche, and J. Virtema
◦ Proposition 3.1. Let {0, 1} ⊆ S and O, E,C be arbitrary. (t1 ≤ t2) as For every formula ϕ ∈ L-ESOS [O, E,C, ∃X ] there exist for- ′ ∈ [ , ∪ {=}, ∪ { , }] ′′ ∈ g (ìx ) = 1 ∧ g (ìx ) = 1 mulas ϕ L-ESOS O E C 0 1 and ϕ L- Ü Û si si rj rj ESOd[0,1][O, E ∪ {=},C] such that, for every R-structure A I ⊆I i ∈I J ⊆J j ∈J and assignment s, ∧ gs (ìxs ) = 0 ∧ gr (ìxr ) = 0 A |= ⇔ A |= ′ ⇔ A |= ′′. Û i i j j s ϕ s ϕ s ϕ i ∈I\I j ∈J\J Proof. The sentence ϕ′ (ϕ′′, resp.) is obtained from ϕ by a ∧ + ≤ + . translation that is the identity function, except that, for second- Õ si Õ rj Õ si Õrj order variables X of arity k, we rewrite the quantifications i ∈I j ∈J\J i ∈I\I j ∈J ∃X as ∃f , where f is a k-ary ((k + 1)-ary, resp.) function X X Finally the subformula θ makes sure that the signs of the variable, and the atoms X (ìx) and ¬X (ìx) by f (ìx) = 1 and X terms in p ∈ M propagate correctly from subterms to terms. f (ìx) = 0 (f (ìx, 1) = u(ìx) and f (ìx, 0) = u(ìx), resp.), re- X X X Define θ as spectively. Here, u is the k-ary uniform distribution which ′ ′ is definable in L-ESO , [=] by ∀xìxì u(ìx) = u(ìx ). d[0 1] ∀xì gp (ìx) = 0 ∨ gp (ìx) = 1 ∧ gc = 1 ∧ gd = 0 Û + p ∈M Lemma 3.2. If {0, 1} ⊆ C, we have L-ESO[0,1][ , ×, ≤,C]≡ c ∈M∩[0,∞] , L-ESO[−1,1][+, ×, ≤,C]. d ∈M∩[−∞ 0) = = Proof. Left-to-right direction is straightforward; the quan- ∧ gq (ìxq) gr (ìxr ) ∧ gp (ìxp ) 1 Û ∃ [+, ×, ≤, ] p,q,r ∈M tification f ψ in L-ESO[0,1] C can be simulated in p=q×r L-ESO[−1,1][+, ×, ≤,C] by the formula ∃f (∀xì 0 ≤ f (ìx) ∧ψ ). ∨ gq (ìxq) = 0 ∧ gr (ìxr ) = 1 ∧ gp (ìxp ) = 0 The converse direction is nontrivial. Let ϕ be an arbitrary [+, ×, ≤, ] L-ESO[−1,1] C -formula. We will show how to con- ∨ gq (ìxq) = 1 ∧ gr (ìxr ) = 0 ∧ gp (ìxp ) = 0 . ′ struct an equivalent L-ESO[0,1][+, ×, ≤,C]-formulaϕ . By the standard Skolemization argument we may assume that ϕ is Note that the sign function maps terms of value 0 to either in the prenex normal form. Moreover, we assume that ev- 0 or 1, since for the purpose of the construction the sign of ery atomic formula of the form t1 ≤ t2 is written such that 0 valued terms does not matter. t1 and t2 are multivariate polynomials where function terms f (ìx) play the role of variables; this normal form is obtained +, , , R Theorem 3.3. L-ESO[0,1][ × ≤ (r)r ∈ ]≡ S-NP[0,1]. by using the distributive laws of addition and multiplication.
Let M be the smallest set that includes every term of poly- Proof. Right-to-le direction. Suppose L ∈ S-NP[0,1] is a nomials t1 and t2 such that t1 ≤ t2 is a subformula of ϕ, and class of R-structures that is closed under isomorphisms. By is closed under taking subterms. Clearly M is a finite set, Lemma 3.2 it suffices to construct an L-ESO[−1,1][+, ×, ≤, R] for its cardinality is bounded by the length of ϕ. For each sentence ϕ such that A |= ϕ iff A ∈ L for all R-structures A. p ∈ M with m variables, we introduce an m-ary function Let M be an S-BSS machine such that M consists of N nodes, ′ ′ ∗ gp that will be interpreted as the sign function for the term and for each input x it accepts (x, x ) for some x ∈[0, 1] in ∗ ∗ p. Let xìp be the related tuple of variables. The idea is that time |x |k iff x = enc(A) for some A ∈ L, where k is some ′ gp (ìa) = 0(gp (ìa) = 1) if p(ìa) < 0(p(ìa)≥ 0). fixed natural number. We may assume that |x | is of size ∗ ∗ We are now ready to define the translation ϕ 7→ ϕ′, where |x |k . Let k be a fixed natural number such that |x |k ≤ |A|k ; such a k always exists since |enc(A)| is polynomial in |A|. ϕ = ∃f1 ... ∃fmQ1x1 ... Qnxn ψ The computation of M on a given input enc(A) can be rep- is in the normal form mentioned above. We define resented using functions f : A2k+1 → (−1, 1), g : A2k+1 → k ′ ◦ (0, 1], and h1,...,hN : A → {0, 1} such that ϕ := ∃ gp ∃f1 ... ∃fmQ1x1 ... Qnxn(θ ∧ ψ ), p ∈M (a) f (ìs, tì)/g(ìs, tì) is the content of register sì at time tì; ◦ where the recursively defined translation is homomorphic (b) hi (tì) is 1 if i is the node label at time tì, and 0 otherwise. for the Boolean connectives and identity for first-order lit- Note that sì is (k + 1)-ary because we need to store |A|k posi- erals. tive and negative register contents. We may assume k such + + For atomic formulae t1 ≤ t2 of the form s1 ··· sl ≤ that registers with index greater than |A|k do not contribute + + r1 ··· rm the translation is defined as follows. The trans- to the final outcome, i.e., their contents are never shifted to lation makes certain that every term (of polynomial) of the registers associated with the nodes of M. Construct a for- inequation after the translation has a non-negative value; mula this is done by moving terms to the other side of the inequa- tion. Denote I = {1,...,l} and J = {1,...,m}, and define ψ (f ,g,h) := θpre ∧ θinitial ∧ θcomp ∧ θaccept Real computation and probabilistic team semantics LICS ’20, July 8–11, 2020, Saarbrücken, Germany of L-ESO[−1,1][+, ×, ≤, (r)r ∈R] such that A |= ∃f ghψ iff M sum of the ordinal number of yì and rf ∗ . Clearly sì = yì+rf ∗ is accepts enc(A). By Proposition 3.1 we may assume a built- expressible in our logic. We then add the following to θinitial: in ordering ≤ and its induced successor relation S and fin ∀ = + = ∗ , , sìyì sì yì rf ∗ → f (ìs, 0ì) f (ìy)× g(ìs, 0ì) (5) constants 0 1 max on the finite domain. Likewise, we may Û f ∗ ∈τ extend ≤fin to order also k-tuples from the finite domain. + Under such ordering we then write xì 1 (xì − 1) for the Note that (2) and (5) imply that f (ìs, 0ì) ∈ (−1, 1); for, by element succeeding (preceding) a k-tuple xì, and nì for the n- (2), |f (s, 0)| = 1 leads to g(s, 0) = 0 which contradicts (5). th k-tuple. First, θpre is the conjunction of a formula stating The interpretations of relations in σ are treated analogously. that the ranges of g and h are as stated, and another formula For all the remaining positions sì > sì0 we stipulate that 0 ≤ 2 ∀yì f (ìy) + g(ìy) = 1, (2) f (ìs, 0ì) ≤ g(ìs, 0ì), and for all positions sì < sì0 we stipulate that f (ìs, 0ì) = 0. In the first case f (ìs, 0ì)/g(ìs, 0ì) is some value where f (ìy)2 is a shorthand for f (ìy)× f (ìy). Observe that (2) guessed from the unit interval [0, 1] and in the second case implies f (ìy) f (ìy) it is 0. We conclude that (3) holds by this construction. = . Computation configurations. Then we define θ such that g(ìy) (1 − f (ìy)2) comp Also, x 7→ x/(1 − x 2) is a bijection from (−1, 1) to R. That ì (A, f ,g,h) |= θcomp the range of f is (−1, 1) will follow from the remaining con- ì juncts of ψ , described below. iff (f ,g,h) satisfies (a) and (b) at time tì > 0ì. (6) Initial configuration. We give a description of θinitial such that We let
(A, f ,g,hì)|= θ = ∀ìì (ì) = ∨ ′ (ì) = ∧ initial θcomp : s t Ü hm t 0 hm t 0 1≤m