Algebraic classifications for fragments of first-order logic and beyond
aa r X i v : . [ m a t h . L O ] M a y Algebraic classifications for fragments of first-order logicand beyond
Reijo Jaakkola * and Antti Kuusisto *** Tampere University, Finland ** University of Helsinki and Tampere University, Finland
Abstract
Complexity and decidability of logical systems is a major research area cur-rently involving a huge range of different systems from fragments of first-orderlogic to modal logic, description logics, et cetera. Due to the sheer numberof different frameworks investigated, a systematic approach could be benefi-cial. We introduce a research program based on an algebraic approach tosystematic complexity classifications of fragments of first-order logic and be-yond. Our base system GRA, or general relation algebra, is equiexpressivewith FO. The system GRA resembles cylindric algebra and Codd’s relationalalgebra, but employs a finite signature with seven different operators. We pro-vide a comprehensive classification of the decidability and complexity of thesystems obtained by limiting the allowed sets of operators. Furthermore, wealso investigate algebras with sets of operators not included in the list of theseven basic ones and use such operator sets to give algebraic characterizationsto some of the best known decidable first-order fragments. To lift the relatedstudies beyond FO, we also define a notion of a generalized relation operator.These operators can be seen to slightly generalize the notion of a generalizedquantifier due to Mostowski and Lindstr¨om.
The failure of Hilbert’s program and the realization of the undecidability of first-order logic FO put an end to the most prestigious plans of automating mathematicalreasoning. However, research with more modest aims continued right away. Per-haps the most direct descendant of Hilbert’s program was the work on the classicaldecision problem , i.e., the initiative to classify the quantifier prefix classes of FO ac-cording to whether they are decidable or not. This major program was successfullycompleted in the 1980’s, see [7] for an overview.Subsequent work has been more scattered but highly active. Currently, thestate of the art on decidability and complexity of fragments of FO divides roughlyinto two branches: research on variants of two-variable logic FO and the guardedfragment GF. Two-variable logic FO is the fragment of FO where only two variablesymbols x, y are allowed. It was proved decidable in [30] and NexpTime -completein [13]. The extension of FO with counting quantifiers, known as C , was proveddecidable in [14, 32] and NexpTime -complete in [33]. Research on variants of1O is currently very active. Recent work has focused on the complexity issuesin restriction to particular structure classes and also questions related to built-inrelations, see, e.g., [5, 19, 9, 26] for a selection of recent contributions. See also[15, 18] where the uniform one-dimensional fragment U is defined. This systemextends FO to a logic that allows an arbitrary number of variables but preservesmost of the relevant metalogical properties, including the NexpTime -completenessof the satisfiability problem.The guarded fragment GF was initially conceived as an extension of modallogic, being a system where quantification is similarly localized as in the Kripkesemantics for modal logic. After its introduction in [1], it was soon proved -complete in [12]. The guarded fragment has proved successful in relationto applications, and it has been extended in several ways. The loosely guarded [6], clique guarded [11] and packed [27] fragments impose somewhat more liberal condi-tions than GF for keeping quantification localized, but the basic idea is the same.All these logics have the same -complete complexity as GF (see, e.g.,[4]). The more recently introduced guarded negation fragment
GNFO [4] is a veryexpressive extension of GF based on restricting the use of negation in the same wayGF restricts quantification. The logic GNFO also extends the unary negation frag-ment
UNFO [39], which is orthogonal to GF in expressive power. Despite indeedbeing quite expressive, GNFO shares the -completeness of GF, and sodoes UNFO.Decidability and complexity of fragments of first-order logic plays a central rolealso in the somewhat more applied realm of knowledge representation, especially inrelation to description logics [2]. In this field, complexities of fragments are classifiedin great detail, operator by operator. The
Description Logic Complexity Navigator website provides an overview of the rather extensive and detailed taxonomy ofthe best known relatively recent results: .Most description logics limit to vocabularies with at most binary relations—beingextensions of standard modal logic—but there are notable extensions such as theExpTime-complete description logic
DLR [8].Somewhat less studied decidable fragments of FO include the
Maslov class [28];the fluted logic [35], [34]; the binding form systems [29] and the generalizations ofprefix classes in, e.g., [40]. Also, the monadic fragment of FO, being probably thefirst non-trivial fragment of FO to have been shown decidable (see [25]), deserves amention here. Out of these frameworks, research relating to [40] and also work onfluted logic has recently been active. The systems studied in [40] are largely basedon limiting how the variables of different atomic symbols can overlap, while flutedlogic restricts how variables can be permuted.While the completion of the classical decision problem in the 1980s was a majorachievement, that project concentrated only on a very limited picture of first-orderlogic, namely, prefix classes only. The restriction to prefix classes can be seenas a rather strong limitation , both from the theoretical as well as applied pointof view. The subsequent research trends—e.g., the work on the guarded fragment,two-variable logic, and description logics—of course lifted this limitation, leading toa more liberal theory with a wide range of applications from verification to databasetheory and knowledge representation. Indeed, as we have seen above, the currentstate of the art studies a huge number of different logical frameworks, tailored for2ifferent purposes. However, consequently the related research is scattered , andcould surely benefit from a more systematic approach . Our contributions.
We introduce a research program for classifying complexityand decidability of fragments of FO (and beyond) within an algebraic framework .To this end, we define an algebraic system designed to enable a systematic andfine-grained approach to classifying first-order fragments. A key idea is to identifya finite collection of operators to capture the expressive power of FO, so our algebrahas a finite signature. In FO, there are essentially infinitely many quantifiers ∃ x i due to the different variable symbols x i , and this issue gives rise to the infinitesignature of cylindric set algebras , which are the principal algebraic formulationof FO. Basing our investigations on finite signatures leads to a highly controlledsetting that directly elucidates how the expressive power of FO arises.Our main system is built on the algebraic signature ( u, p, s, I, ¬ , J, ∃ ). Atomicterms are relation symbols of different arities, and complex terms are built fromatoms by applying the operators in the signature. This defines an algebra overevery relational structure M . The atomic terms R are interpreted as the relations R M ; ¬ is the complementation operator; J the join operator; ∃ the existentialquantification (or projection) operator; p a cyclic permutation operator; s a swapoperator (swapping the first two elements of tuples); I an identity operator (deletingtuples whose first two members are not identical); and u the constant operatordenoting the unary universal relation, i.e., the domain of M .We let GRA( u, p, s, I, ¬ , J, ∃ ) refer to the system based on these operators,with GRA standing for general relation algebra . To simplify notation, we alsolet GRA stand for GRA( u, p, s, I, ¬ , J, ∃ ) in the current article. Furthermore, byGRA \ f , . . . , f k we refer to GRA with the operators f , . . . , f k ∈ { u, p, s, I, ¬ , J, ∃} removed.We first prove that GRA and FO are equiexpressive. The next aim is to classifythe decidability and complexity properties of the principal subsystems of GRA.Firstly, GRA \ ¬ is trivially decidable. Nevertheless, GRA \ ¬ is interesting as itcan define precisely all conjunctive queries with equality. Then we establish thatGRA \ ∃ is NP -complete. The upper bound follows from an obvious translationto quantifier-free FO, but the lower bound requires some—relatively light—work,mainly since we do not have all the standard Boolean connectives in the system. Wethen also show that satisfiability of GRA \ J can be checked by a finite automaton,and futhermore, we prove GRA \ I to be NP -complete (in fact already GRA( ¬ , J, ∃ )turns out NP -hard). We note that, interestingly, it turns out that GRA \ I does not correspond to equality-free FO.On the negative side, we show that GRA( p, I, ¬ , J, ∃ ) is Π -complete, so remov-ing either u or s (or both) from GRA does not lead to decidability. Thus we havethe following close to complete first classification: removing any of the operators ¬ , ∃ , I, J gives a decidable system, while dropping u or s (or both) keeps the systemundecidable. We leave the study of the complexity and decidability of subsystemsof GRA there in this introductory article. It would be particularly interesting toinvestigate the open case whether GRA \ p is decidable.To push our program further, we define a general notion of a relation operator .The definition can be seen as a slight generalization of the notion of a generalizedquantifier due to Mostowski [31] and Lindstr¨om [24]; we regard the the definition3s one of the key contributions of this work. We then study variants of GRAwith different sets of relation operators. In particular, we characterize the guardedfragment, two-variable logic and fluted logic by different algebras. The guardedfragment corresponds to GRA( e, p, s, \ , ˙ ∩ , ∃ ) where the first new symbol e denotesa constant corresponding to the identity (or equality) relation, the symbol \ denotesthe relative complementation operator and ˙ ∩ is a special intersection that can op-erate on relations of different arities. Two-variable logic—over vocabularies withat most binary relation symbols—corresponds to GRA( e, s, ¬ , ˙ ∩ , ∃ ). Fluted logicturns out to be GRA( ¬ , ˙ ∩ , ´ ∃ ) where ´ ∃ is the variant of ∃ that projects away the last member of each input tuple rather than the first one like ∃ . All the other systemswe have mentioned so far have exactly the same expressive power if we replace ∃ by ´ ∃ , while in GRA( ¬ , ˙ ∩ , ´ ∃ ), switching ´ ∃ to ∃ affects the expressivity.The systems for fluted logic and two-variable logic (using ´ ∃ ) are intimatelyrelated (note that we do not impose restrictions on relation symbol arities for flutedlogic). Also, since the guarded fragment is characterized by GRA( e, p, s, \ , ˙ ∩ , ∃ ), andsince GRA( e, s, ¬ , ˙ ∩ , ∃ ) and GRA( e, p, s, ¬ , ˙ ∩ , ∃ ) can be shown equiexpressive overvocabularies with at most binary relations, we observe that also two-variable logicand the guarded fragment are nicely linked. These kinds of results demonstrate theexplanatory power and potential usefulness of the idea of comparing FO-fragments under the same umbrella framework based on different kinds of finite signaturealgebras . A natural future research direction involves also pushing these studiesbeyond first-order logic by using the notion of relation operator defined here.The contributions of this article can be summarized as follows.1. The main objective is to introduce the program of classifying complexity anddecidability properties of logics with different finite signature algebras . Theadditional technical results are an important but not the primary focus of thisarticle.2. Nevertheless, we provide a comprehensive classification of the principal sub-systems of GRA( u, p, s, I, ¬ , J, ∃ ), the principal open case being GRA \ p .3. We provide algebraic characterizations of the guarded fragment, two-variablefragment and fluted fragment in our framework.4. We define the notion of a generalized operator. This relates also to furtherdirections in our study summarized in the concluding section. Further notes on related work.
We already extensively described the relatedwork concerning our program above. Nevertheless, we provide here some furtherrelated information, emphasizing especially the algebraic side of the story.There are various algebraic approaches to FO, e.g., Tarski’s cylindric algebras ,their semantic counterparts cylindric set algebras and the polyadic algebras of Hal-mos. The book [17] gives a comprehensive and relatively recent account of the thesesystems. Also, variants of Codd’s relational algebra [10] must be mentioned here,although the main systems studied within the related database-theory oriented set-ting are not equivalent to standard FO but instead relate to domain independentfirst-order logic. The closest approach to our system is Quine’s predicate functor ogic [36], [37], [38]. This system comes in several variants, with different sets ofoperators used. But the spirit of the approach bears a similarity to the main alge-braic system we study in this article, the signature in predicate functor logic beingfinite. Variants of predicate functor logic can be naturally considered to be withinthe scope of our research program. Predicate functor logic has been studied verylittle, and we are not aware of any work relating to complexity theory. The notableworks within this framework include the complete axiomatizations given in [20]and [3]. Concerning further algebraic settings, Tarski’s relation algebra (see [17])is also related to our work, but focuses on binary relations. Finally, the systemGRA( u, p, s, I, ¬ , J, ∃ ) was briefly presented in the preprint [22], but here we takethe first steps to begin developing the related theory. Let A be an arbitrary set. As usual, a k -tuple over A is an element of A k . When k = 0, we let ǫ denote the unique 0 -tuple in A k = A . Note that A = B = ∅ = { ǫ } for all sets A and B . Note also that ∅ k = ∅ for all positive integers k . If k is anon-negative integer, then a k -ary AD-relation over a set A is a pair ( R, k ) where R ⊆ A k is a k -ary relation in the usual sense, i.e., simply a set of k -tuples. Here‘AD’ stands for arity definite . We call ( ∅ , k ) the empty k -ary AD-relation . Fora non-negative integer k , we let ⊤ k (respectively, ⊥ k ) denote an operator that mapsany set A to the AD-relation ⊤ k ( A ) := ( A k , k ) (respectively, ⊥ k ( A ) := ( ∅ , k )). Wemay write ⊤ Ak for ⊤ k ( A ) and simply ⊤ for ⊤ ( A ), and we may write ⊥ Ak or ⊥ k for ⊥ k ( A ). We note that the operators ⊤ k and ⊥ k are proper classes, and we also notethat ⊥ ∅ k = ⊤ ∅ k iff k = 0. When T = ( R, k ) is a k -ary AD-relation, we let rel ( T )denote R and write ar ( T ) = k to refer to the arity of T . It is important to recallbelow that when T is an AD-relation, then t ∈ T means that t ∈ rel ( T ).The notion of a model is defined as usual in model theory, assuming modeldomains are never empty. For simplicity, we restrict attention to relational models,i.e., vocabularies of models do not contain function or constant symbols. We usethe convention where the domain of a model A is denoted by A , the domain of B by B et cetera. We let ˆ τ denote the full relational vocabulary containing countablyinfinitely many relation symbols of each arity k ≥
0. We let VAR = { v , v , . . . } denote the countably infinite set of exactly all variables used in first-order logic FO.We also use metavariables (e.g., x, y, z, x , x . . . ) to refer to symbols in VAR. Byan FO-formula ϕ ( x , . . . , x k ) we refer to a formula whose free variables are exactly x , . . . , x k . An FO-formula ϕ (without a list of variables) may or may not havefree variables. The set of free variables of ϕ is denoted by F ree ( ϕ ). Now, let k ≥ ϕ ( v i , . . . , v i k ) where i < · · · < i k . The formula ϕ ( v i , . . . , v i k ) defines the AD-relation (cid:0) { ( a , . . . , a k ) ∈ A k | A | = ϕ ( a , . . . , a k ) } , k (cid:1) in the model A . Notice that we make crucial use of the linear ordering of thesubindices of the variables v i , . . . , v i k . We let ϕ A denote the AD-relation definedby ϕ in A . Notice—to give an example—that ϕ ( v , v , v ) and ϕ ( v , v , v ) define thesame AD-relation over any model. It is important to recall this phenomenon below.When using the six metavariables x, y, z, u, v, w , we always assume ( x, y, z, u, v, w ) =( v i , v i , v i , v i , v i , v i ) for some i < i < i < i < i < i .Consider the formulas ϕ := v = v and ψ := v = v ∧ v = v . Now ϕ A is the5mpty unary AD-relation and ψ A the empty binary AD-relation. The negatedformulas ¬ ϕ and ¬ ψ then define the universal unary and binary AD-relations( ¬ ϕ ) A = ( A,
1) and ( ¬ ψ ) A = ( A × A, ϕ and ψ both defined theordinary empty relation ∅ in A , then the action of ¬ in A on the input ∅ wouldappear ambiguous. Ordinary relations suffice for most purposes of studying FO,but we need to be more careful.A conjunctive query (CQ) is a formula ∃ x . . . ∃ x k ψ where ψ is a conjunctionof atoms of the form R ( y , . . . , y k ); for example ∃ y ∃ z ( Rxyz ∧ Syzuv ) is a CQ withthe free variables x, u, v . Conjunctive queries are a first-class citizen in databasetheory. A conjunctive query with equality (CQE) is otherwise similar but alsoallows equality atoms in addition to atoms R ( y , . . . , y k ). The CQE x = y , whichdefines the identity relation, demonstrates that CQEs can define relations that CQscannot. In this section we define an algebra equiexpressive with FO. To this end, considerthe algebraic signature (cid:0) u, p, s, I, ¬ , J, ∃ (cid:1) where u is an algebraically nullary symbol(i.e., a constant symbol), p, s, I, ¬ , ∃ have arity one and J arity two. Let τ be avocabulary, i.e., a set of relation symbols. The vocabulary τ defines a set of terms (or τ -terms ) built by starting from the the symbols u and R ∈ τ and composingterms by using the symbols p, s, I, ¬ , J, ∃ in the usual way. So u and each R ∈ τ are terms, and if T and T ′ are terms, then so are p ( T ), s ( T ), I ( T ), ¬ ( T ), J ( T , T ′ ), ∃ ( T ). We often leave out brackets when using unary operators and write,for example, IpR instead of I ( p ( R )). Each term T is associated with an arity ar ( T ) (which, as we will see later on, equals the arity of the AD-relation that T defines on a model). We define that ar ( R ) is the arity of the relation symbol R ; ar ( u ) = 1; ar ( p T ) = ar ( T ); ar ( s T ) = ar ( T ); ar ( I T ) = ar ( T ); ar ( ¬T ) = ar ( T ); ar ( J ( T , T ′ )) = ar ( T )+ ar ( T ′ ); and ar ( ∃T ) = ar ( T ) − ar ( T ) ≥ ar ( ∃T ) =0 when ar ( T ) = 0.Given a model A of vocabulary τ , each τ -term T defines some AD-relation T A over A . The arity of T A will indeed be equal to the arity of T . Consider terms T and S and assume we have defined AD-relations T A and S A . Then the belowconditions hold. R ) Here R is a k -ary relation symbol in τ , so R is a constant term in the algebra.We define R A = (cid:0) { ( a , . . . , a k ) | A | = R ( a , . . . , a k ) } , k (cid:1) .u ) We define u A = ( A, u can be called the universe constantor the universal unary relation constant. p ) If ar ( T ) = k ≥
2, we define( p ( T )) A = (cid:0) { ( a , . . . , a k , a ) | ( a , . . . , a k ) ∈ T A } , k (cid:1) , where ( a , . . . , a k , a ) is the k -tuple obtained from the k -tuple ( a , . . . , a k )by moving the first element a to the end of the tuple. If ar ( T ) is 1 or 0,6e define ( p ( T )) A = T A . We call p the permutation operator, or cyclicpermutation operator. s ) If ar ( T ) = k ≥
2, we define (cid:0) s ( T )) A = (cid:0) { ( a , a , a , . . . , a k ) | ( a , . . . , a k ) ∈ T A } , k (cid:1) , where ( a , a , a , . . . , a k ) is the k -tuple obtained from the k -tuple ( a , . . . , a k )by swapping the first two elements a and a but keeping the other elementsas they are. If ar ( T ) is 1 or 0, we define ( s ( T )) A = T A . We refer to s as the swap operator. I ) If ar ( T ) = k ≥
2, we let( I ( T )) A = (cid:0) { ( a , . . . , a k ) | ( a , . . . , a k ) ∈ T A and a = a } , k (cid:1) . If ar ( T ) is 1 or 0, we define ( I ( T )) A = T A . We refer to I as the identity operator, or equality operator. ¬ ) Let ar ( T ) = k . We define( ¬ ( T )) A = (cid:0) { ( a , . . . , a k ) | ( a , . . . , a k ) ∈ A k \ rel ( T A ) } , k (cid:1) . Note in particular that if T A = ( ∅ ,
0) = ⊥ A , then ( ¬ ( T )) A = ( { ǫ } ,
0) = ⊤ A ,and vice versa, if T A = ⊤ A , then ( ¬ ( T )) A = ⊥ A . We refer to ¬ as the negation or complementation operator. J ) Let ar ( T ) = k and ar ( S ) = ℓ . We define( J ( T , S )) A = (cid:0) { ( a , . . . , a k , b , . . . , b ℓ ) | ( a , . . . , a k ) ∈ T A and ( b , . . . , b ℓ ) ∈ S A } , k + ℓ (cid:1) . Here we note that ǫ is interpreted as the identity of concatenation, so if rel ( T A ) = { ǫ } , then ( J ( T , S )) A = ( J ( S , T )) A = S A and ( J ( T , T )) A =( { ǫ } , J as the join operator. ∃ ) If ar ( T ) = k ≥
1, we let( ∃ ( T )) A = (cid:0) { ( a , ... , a k ) | ( a , ... , a k ) ∈ T A for some a ∈ A } , k (cid:1) where ( a , ... , a k ) is the ( k − a , ... , a k ). When ar ( T ) = 0, then ( ∃ ( T )) A = T A . We call ∃ the existence operator, or projection operator.We denote our algebra by GRA( u, p, s, I, ¬ , J, ∃ ) where GRA stands for gen-eral relation algebra . Each collection { f , . . . , f k } of operators defines simi-larly the general relation algebra GRA( f , . . . , f k ); we shall define such systemslater on. In this paper—only to simplify notation—we simply write GRA forGRA( u, p, s, I, ¬ , J, ∃ ). We identify GRA( f , . . . , f k ) with the set of ˆ τ -terms of thisalgebra, where ˆ τ is the full relational vocabulary. Similarly, we identify FO withthe set of ˆ τ -formulas for the full relational vocabulary ˆ τ .An FO-formula ϕ and term T are equivalent if ϕ A = T A for every τ -model A (where τ is an arbitrary vocabulary that is large enough so that ϕ is a τ -formulaand T a τ -term). For example, R ( v , v ) is equivalent to R , while the formula R ( v , v ) ∧ ( P ( v ) ∨ ¬ P ( v )) is equivalent to sR . Note that under our definition,7 ( v , v ) and R ( v , v ) are both equivalent to the term R while the formulas arenot equivalent to each other. This causes no ambiguities as long as we use theterminology carefully. Also, R ( v , v ) ∧ v = v is not equivalent to the term R as itdefines a ternary rather than binary relation. Furthermore, note that T ( v , v , v )defines a binary relation and v = v a unary relation. Generally, in the belowinvestigations, it is important to remember how the use of the operator p is reflectedto corresponding FO-formulas: if rel (cid:0) R A (cid:1) = { ( a, b, c, d ) } = rel (cid:0) ( Rxyzu ) A (cid:1) , then rel (cid:0) ( pR ) A (cid:1) = { ( b, c, d, a ) } = rel (cid:0) ( Ruxyz ) A (cid:1) , so the tuple ( a, b, c, d ) has its firstelement moved to the end of the tuple, while Rxyzu has the last variable u movedto the beginning of the tuple of variables.Let S be a set of terms of our algebra and S a set of FO-formulas. We saythat S and S are equiexpressive if each T ∈ S has an equivalent formula in S and every ϕ ∈ S an equivalent term in S . The sets S and S are sententiallyequiexpressive if every sentence ϕ ∈ S has an equivalent term in S and everyterm of arity 0 in T ∈ S has an equivalent sentence in S . Theorem 3.1. FO and GRA are equiexpressive.Proof.
Let us find an equivalent term for an FO-formula ϕ . Consider first thecases where ϕ is one of the four atomic formulas ⊤ , ⊥ , x = x , x = y . Then thecorresponding terms are, respectively, ∃ u , ¬∃ u , u , I ( J ( u, u )).Assume then that ϕ is R ( v i , . . . , v i k ) for k ≥
0. Suppose first that no variablesymbol gets repeated in the tuple ( v i , . . . , v i k ) and that i < · · · < i k . Then theterm R is equivalent to ϕ . We then consider the cases where ( v i , . . . , v i k ) mayhave repetitions and the variables may not be linearly ordered (i.e., i < · · · < i k does not necessarily hold). We first observe that we can permute any relation inevery possible way by using the operators p and s ; for the sake of completeness, wepresent here the following steps that prove this claim: • Consider an arbitrary tuple ( a , . . . , a i , . . . , a ℓ ) of the relation R in a model A .Now, we can move the arbitrary element a i an arbitrary number n of steps tothe right (while keeping the rest of the tuple otherwise in the same order) bydoing the following:1. Repeatedly apply p to the term R , making a i the leftmost element of thetuple.2. Apply then the composed function ps (so s first and then p ) precisely n times.3. Apply p repeatedly, putting the tuple into the ultimate desired order. • We can similarly move a i to the left. Intuitively, this is achieved simply bymoving a i to the right and even past the rightmost end of the tuple. Formally,we move a i by n steps to the left by performing the above steps so that instep 2, we apply the composed function ps precisely ℓ − n − p and s we can permute a relation in all possible ways.Since we can permute tuples in every way, we can also deal with the possiblerepetitions of variables in R ( v i , . . . , v i k ). Indeed, we can bring any two elements to8he beginning of a tuple and then use I . For example, consider R ( v , v , v ) (whichdefines a binary relation). We observe that R ( v , v , v ) is equivalent to the term p ∃ Ipp ( R ). Note that ∃ is used to indeed make this a binary rather than ternaryrelation. Now, it is easy to see that using p, s, I, ∃ , we find an equivalent term forevery quantifier-free formula R ( v i , . . . , v i k ).Now suppose we have equivalent terms S and T for formulas ϕ and ψ , respec-tively. We will discuss how to translate ¬ ϕ , ϕ ∧ ψ and ∃ v i ϕ . Firstly, clearly ¬ ϕ canbe translated to ¬S . Translating ϕ ∧ ψ is done in two steps. Suppose ϕ and ψ have,respectively, the free variables v i , . . . , v i k and v j , . . . , v j ℓ . We first write the term J ( S , T ) which is equivalent to χ ( v , . . . , v k + ℓ ) := ϕ ( v , . . . , v k ) ∧ ψ ( v k +1 , . . . , v k + ℓ );note here the new lists of variables. We then deal with the possible overlap in theoriginal sets { v i l , . . . , v i k } and { v j l , . . . , v j ℓ } of variables of ϕ and ψ . This is doneby repeatedly applying p , s , I and ∃ to J ( S , T ) in the very same way as usedabove when dealing with atomic formulas. Indeed, we above observed that we canarbitrarily permute relations and identify variables by using p, s, I, ∃ .Finally, translating ∃ v i ϕ is easy. We first repeatedly apply p to the term S corresponding to ϕ to bring the element to be projected away to the left end of thetuple. Then we use ∃ . After this we again use p repeatedly to put the term intothe final wanted form.Translating terms to equivalent FO-formulas is straightforward.Analyzing the above proof, we can also identify an algebra that is equiexpressivewith the equality-free fragment of FO. We assume here that ⊥ and ⊤ are not partof the logic, even though this makes a difference only if we limit attention to emptyvocabularies. Let ˆ I denote the composed operator ∃ I obtained by first applying I and then ∃ . We have the following equivalence. Theorem 3.2.
Equality-free FO is equiexpressive with GRA( p, s, ˆ I, ¬ , J, ∃ ) .Proof. For the direction from the equality-free FO to GRA( p, s, ˆ I, ¬ , J, ∃ ), we ob-serve that the only place in the proof of Theorem 3.1 where we used I withoutusing ∃ immediately afterwards, was when we were translating atomic formulas ofthe form x = y . Also, u was used only to deal with equality atoms and the constants ⊥ , ⊤ which we here assume not to be part of the logic.For the converse direction we observe that ˆ I can be thought of as a substitutionoperation in the following sense. Suppose that we have translated a term T of arity k to a formula ψ ( v , . . . , v k ). If k = 1, then ˆ I ( T ) is equivalent to ∃ v ψ ( v ), and if k = 0, then ˆ I ( T ) is equivalent to ψ . On the other hand, if k ≥
2, then the termˆ I ( T ) is equivalent to ∃ v ( v = v ∧ ψ ( v , . . . , v k )) which is in turn equivalent to ψ ∗ ( v , . . . , v k ) obtained from ψ ( v , . . . , v k ) by replacing free occurrences of v by v . The FO-equivalent algebra GRA = GRA( u, p, s, I, ¬ , J, ∃ ) is only one of manyinteresting related systems. Defining alternative algebras equiexpressive with FOis one option, but it is also interesting to consider weaker, stronger as well as or-thogonal systems. The equality-free logic discussed above was only the first relatedexample. We next provide a definition that gives a general way to work with dif-ferent general relation algebras. In the definition, we let AD A denote the set of allAD-relations (of every arity) over A . If T , . . . , T k are AD-relations over a set A ,9hen ( A, T , . . . , T k ) is called an AD-structure . A bijection g : A → B is an isomor-phism between AD-structures ( A, T , . . . , T k ) and ( B, S , . . . , S k ) if ar ( T i ) = ar ( S i )for each i and g is an ordinary isomorphism between ( A, rel ( T ) , . . . , rel ( T k )) and( B, rel ( S ) , . . . , rel ( S k )). Definition 3.3. A k -ary relation operator f is a map that outputs, given an arbi-trary set A , a k -ary function f A : (AD A ) k → AD A . The operator f is isomorphisminvariant in the sense that if the AD-structures ( A, T , . . . , T k ) and ( B, S , . . . , S k )are isomorphic via g : A → B , then ( A, f A ( T , . . . , T k )) and ( B, f B ( S , . . . , S k ))are, likewise, isomorphic via g .We define an arity-regular relation operator to be a relation operator thatsatisfies the further constraint that the arity of the output AD-relation is alwaysdetermined fully by the sequence of arities of the input AD-relations.Let us define some natural relation operators for illustration. Suppose T and S are both of arity k . We define ( T ∪ S ) A = ( rel ( T A ) ∪ rel ( S A ) , k ) and ( T ∩ S ) A =( rel ( T A ) ∩ rel ( S A ) , k ). We also define ( T \ S ) A = ( rel ( T A ) \ rel ( S A ) , k ). If T and S have different arities, ∩ and ∪ return ( ∅ ,
0) and \ returns T A . Suppose then that T and S have arities k and ℓ , respectively. Calling m := max { k, ℓ } , we let( T ˙ ∩ S ) A = (cid:0) { ( a , . . . , a m ) | ( a m − k +1 , . . . , a m ) ∈ T A and ( a m − ℓ +1 , . . . , a m ) ∈ S A } , m (cid:1) , so intuitively, the tuples overlap on some suffix of ( a , . . . , a m ); note here that when k or ℓ is zero, then ( a m +1 , a m ) denotes the empty tuple ǫ . For example R ( x, y ) ∧ P ( y )is equivalent to R ˙ ∩ P and R ( x, y ) ∧ P ( x ) to s ( sR ˙ ∩ P ). The operator ˙ ∩ can becalled the suffix intersection . Finally, define the (equality or identity) constantoperator e such that e A = (cid:0) { ( a, a ) | a ∈ A } , (cid:1) . Appendix A (on GF) and AppendixB (on FO ) prove the following. Theorem 3.4. GF and GRA( e, p, s, \ , ˙ ∩ , ∃ ) are sententially equiexpressive. FO and GRA( e, s, ¬ , ˙ ∩ , ∃ ) are sententially equiexpressive over vocabularies with at mostbinary relation symbols. Characterizations not limiting to sentential equiexpressivity will be discussed inthe full version. We note that [16] defines a Codd-style relational algebra (with aninfinite signature) for sentences of GF.Now, let GRA ( e, s, ¬ , ˙ ∩ , ∃ ) denote the terms of GRA( e, s, ¬ , ˙ ∩ , ∃ ) that use atmost binary relation symbols; there are no restrictions on term arity, although it iseasy to see that at most binary terms arise. The proof of Theorem 3.4 gives a trans-lation from FO -sentences (with at most binary symbols) to GRA ( e, s, ¬ , ˙ ∩ , ∃ ).However, that translation is not polynomial, and thus it is not immediately clearif we get a NexpTime lower bound for the the satisfiability problem of the systemGRA ( e, s, ¬ , ˙ ∩ , ∃ ). Nevertheless, it is established in Appendix B that the satisfia-bility problem of GRA ( e, s, ¬ , ˙ ∩ , ∃ ) is NexpTime -complete.For further charaterizations of expressive power, consider the operator ´ ∃ that isotherwise as ∃ , but while ∃ always projects away the first element of each tuple, ´ ∃ projects the last element away. Now, as observed in the proof of Theorem 3.1, theoperators p and s suffice for permuting relations in every way. Furthermore, it isobvious that s alone suffices for at most binary relations. Therefore it is easy to see10hat we can replace ∃ by ´ ∃ in the characterizations of Theorems 3.1, 3.2 and 3.4. Inparticular FO and GRA( e, s, ¬ , ˙ ∩ , ´ ∃ ) are sententially equiexpressive over vocabu-laries with at most binary relation symbols. Now, it is easy to show (see AppendixC) that fluted logic—as defined in [34]—is equiexpressive with GRA( ¬ , ˙ ∩ , ´ ∃ ). Thusthe algebras of FO and fluted logic are quite interestingly related, and the fullsystem GRA( e, s, ¬ , ˙ ∩ , ´ ∃ ) obviously contains both fluted logic and FO .Going beyond first-order expressivity is an obvious future research direction.Many interesting operators can be investigated. For brevity, we very briefly men-tion only one out of numerous different interesting possibilities. So, consider theequicardinality operator H such that ( H ( T , S )) A = ⊤ if the relations rel ( T A ) and rel ( S A ) have the same (possibly infinite cardinal) number of tuples, and else theoutput is ⊥ . No restrictions on the input relation arities are imposed. Addingrelated quantifiers (e.g., the H¨artig quantifier) to quite weak fragments of FO iswell known to lead to undecidability. Neverthelss, it is likely that interesting andnatural decidable systems can be found with suitable restrictions. Let G be some set of terms of some general relation algebra GRA( f , . . . , f n ). For-mally, the satisfiability problem for G takes as input a term T ∈ G and returns‘ yes ’ iff there exists a model A such that T A is not the empty AD-relation of arity ar ( T ). In this section we identify subsystems of GRA = GRA( u, p, s, I, ¬ , J, ∃ ) witha decidable satisfiability problem. We concentrate on systems obtained by limitingto a subset of the operators involved. We show that removing any of the operators ¬ , ∃ , J, I leads to decidability, and we also pinpoint the exact complexity of eachsystem. As a by-product of the work, we make observations about conjunctivequeries (CQs) and show NP -completeness of GRA( ¬ , J, ∃ ) and GRA( p, I, ¬ , J ).Our first result concerns GRA with the complementation operation ¬ removed.All negation-free fragments of FO without the atom ⊥ are trivially decidable—every formula being satisfiable—and thus so is GRA( u, p, s, I, J, ∃ ). Nevertheless,this system has the following interesting property concerning conjunctive querieswith equality, or CQEs. Proposition 4.1.
GRA( u, p, s, I, J, ∃ ) is equiexpressive with the set of CQEs. Thesystem GRA( p, s, ˆ I, J, ∃ ) is equiexpressive with the set of conjunctive queries.Proof. Analyzing the proof that GRA( u, p, s, I, ¬ , J, ∃ ) and FO are equiexpres-sive, we see that GRA( u, p, s, I, J, ∃ ) can express every formula built from rela-tional atoms and equality atoms with conjunctions and existential quantification.Conversely, an easy induction on term structure establishes that every term ofGRA( u, p, s, I, J, ∃ ) is expressible by a CQE. The claim for GRA( p, s, ˆ I, J, ∃ ) fol-lows in a similar way; see the equivalence proof of equality-free FO and the systemGRA( p, s, ˆ I, ¬ , J, ∃ ) for the related key points.Conjunctive queries are well studied, so many interesting issues follow fromthere. Now, the next result concerns GRA without ∃ . It is easy to see that thissystem translates in polynomial time into quantifier-free FO. (The converse fails:11or example R ( v , v , v ) can clearly not be expressed in GRA without ∃ as it givesa binary relation and ∃ is the only operator reducing relation arity.) Theorem 4.2.
The satisfiability problem for
GRA( u, p, s, I, ¬ , J ) is NP-complete.Proof. The satisfiability problem for quantifier-free FO is well known to be NP -complete, whence we get the upper bound. For the lower bound, we give a reductionto SAT. In fact, we will show that the satisfiability problem is already NP-hard forGRA( p, I, ¬ , J ). Let ϕ be a propositional logic formula and { p , . . . , p n } the setof proposition symbols of ϕ . Let { P , . . . , P n } be a set of unary relation symbols.We translate ϕ to an equisatisfiable term T of GRA( p, I, ¬ , J ) as follows. Every p i translates to P i . If ψ is translated to T , then ¬ ψ is translated to ¬T . If ψ translates to T and θ to P , then ψ ∧ θ is translated to J ( T , P ). Let T ( ϕ ) be theresulting formula. Note that T ( ϕ ) is not yet equisatisfiable with ϕ , as for example p ∧ ¬ p translates to a term equivalent to P ( v ) ∧ ¬ P ( v ). Thus we still need toexpress that all variables v i are equal. This is easy to do with I and p .We then consider the join-free fragment of GRA which turns out to be quitetame. Theorem 4.3.
Satisfiability of
GRA( u, p, s, I, ¬ , ∃ ) can be checked by a finite au-tomaton.Proof. Consider first terms that are built up starting from u and using p, s, I, ¬ and ∃ . By induction on the structure of such terms, we see that in every model A , theinterpretation of such a term is always one of ⊤ A , ⊥ A , ⊤ A , ⊥ A . We obtain ⊥ A or ⊥ A if and only if the term has an odd number of negations, giving a simple criterionfor deciding satisfiability.Let R be a k -ary relation symbol. Define two { R } -models A and B , bothhaving the same singleton domain A = { a } but with R A = ⊤ Ak and R B = ⊥ Ak . Inany model M with a singleton domain, every n -ary term T of GRA can receiveonly two interpretations, ⊥ Mn or ⊤ Mn . Using this observation and induction over thestructure of terms T formed from R with p, s, I, ¬ , ∃ , we can show that T A = ⊥ An iff ( ¬T ) B = ⊥ An . This implies in particular that every such term T is satisfiable,since if T A = ⊥ An , then ( ¬T ) B = ⊥ An , and thus T B = ⊤ An .We will next show that GRA without I is decidable and NP -complete. Thus thissystem is very different from equality-free FO. We first define a certain equality-freefragment F of FO as follows:1. R ( x , . . . , x n ) ∈ F for all relation symbols R and all variables x , . . . , x n .2. If ϕ, ψ ∈ F and F ree ( ϕ ) ∩ F ree ( ψ ) = ∅ , then ( ϕ ∧ ψ ) ∈ F .3. If ϕ ∈ F , then ¬ ϕ ∈ F and also ∃ xϕ ∈ F for any variable x .We then give a series of lemmas ultimately showing NP -completeness of the systemGRA( u, p, s, ¬ , J, ∃ ). Lemma 4.4.
The satisfiability problem of F is in NP . roof. Let χ ∈ F be a formula. Start by transforming χ into negation normalform, thus obtaining a formula χ ′ . Now note that in F , the formula ∀ x ( ϕ ∨ ψ ) isequivalent to either ( ϕ ∨ ψ ), ( ∀ xϕ ∨ ψ ) or ( ϕ ∨ ∀ xψ ) since F ree ( ϕ ) ∩ F ree ( ψ ) = ∅ .Similarly, ∃ x ( ϕ ∧ ψ ) is equivalent to ( ϕ ∧ ψ ), ( ∃ xϕ ∧ ψ ) or ( ϕ ∧ ∃ xψ ). Thus wecan push all quantifiers past all binary connectives in the formula χ ′ in polynomialtime, getting a formula χ ′′ .Consider then the following standard trick. Firstly, let C denote the set ofall conjunctions obtained from χ ′′ as follows: we begin from the syntax tree of χ ′′ and keep eliminating disjunctions ∨ by always keeping exactly one of the twodisjuncts. Clearly χ ′′ is satisfiable iff some β ∈ C is satisfiable. Starting from χ ′′ ,we nondeterministically guess some β ∈ C (without constucting C ).Now, β is a conjunction of formulas Q x . . . Q k x k η where Q i ∈ {∀ , ∃} for each i and η is a literal. Putting β in prenex normal form, we get a Herbrand fragment formula; thus it can be checked in polytime whether it is satisfiable, see Theorem8.2.6 in [7].
Lemma 4.5.
GRA( u, p, s, ¬ , J, ∃ ) -terms translate to equisatisfiable formulas of F in polytime.Proof. Let U be a unary predicate. We will translate each term T of the systemGRA( u, p, s, ¬ , J, ∃ ) to a formula ϕ T that is equivalent to T in all models that thatsatisfy ∀ xU ( x ). The desired equisatisfiable formula for T will then be ϕ T ∧ ∀ xU ( x ).(Note that we assume, without loss of generality, that T does not contain U .)We use induction on the structure of terms T of GRA( u, p, s, ¬ , J, ∃ ). We trans-late every k -ary term to a formula χ ( v , . . . , v k ), so the free variables are precisely v , . . . , v k . For the base case we note that u is equivalent to U ( v ) and R to R ( v , . . . , v k ). If T is equivalent to ϕ , then ¬T is equivalent to ¬ ϕ and ∃T to ∃ v ϕ . Suppose then that T is equivalent to ϕ ( v , . . . , v k ). We translate s T to thevariant of ϕ ( v , . . . , v k ) that swaps v and v and p T to ϕ ( v k , v , , . . . , v k − ). Finally,suppose that T translates to ϕ ( v , . . . , v k ) and P to ψ ( v , . . . , v ℓ ). Now J ( T , P ) istranslated to ϕ ( v , . . . , v k ) ∧ ψ ( v k +1 , . . . , v k + ℓ ). Lemma 4.6.
The satisfiability problem of
GRA( ¬ , J, ∃ ) is NP -hard.Proof. We give a reduction from SAT. Let ϕ be a formula of propositional logic.Let { p , . . . , p n } be the set of propositional symbols in ϕ , and let { P , . . . , P n } be aset of unary relation symbols. Let ϕ ∗ be the formula obtained from ϕ by replacingeach symbol p i with ∀ xP i ( x ). It is easy to see that ϕ and ϕ ∗ are equisatisfiable.Finally, since ∀ xP i ( x ) is equivalent to ¬∃¬ P i , we see that the sentence ϕ ∗ can beexpressed in GRA( ¬ , J, ∃ ). Corollary 4.7.
The satisfiability problem of
GRA( u, p, s, ¬ , J, ∃ ) is NP -complete. In this section we identify undecidable subsystems of GRA. We begin with GRAwithout u . Proposition 5.1.
The satisfiability problem of
GRA( p, s, I, ¬ , J, ∃ ) is Π -complete. roof. Analyzing the proof that GRA is equivalent to FO, we see that the systemGRA( p, s, I, ¬ , J, ∃ ) contains the identity-free fragment of FO (we can assume theatoms ⊤ and ⊥ are not included in the logic, as they cannot be expressed in theGRA( p, s, I, ¬ , J, ∃ ) if we limit to empty vocabularies). This gives the lower bound.The upper bound follows from GRA( p, s, I, ¬ , J, ∃ ) being contained in FO.Our next aim is to consider GRA without s . To this end, we will establish thatthe satisfiability problem of GRA( p, I, ¬ , J, ∃ ) is Π -complete (giving an alternativelower bound proof for Proposition 5.1). Let us first recall the tiling problem of N × N . A tile is a function t : { R, L, T, B } → C where C is a countably infinite setof colours. We let t X denote t ( X ). Intuitively, t R , t L , t T and t B correspond to thecolours of the right, left, top and bottom edges of a tile. Now, let T be a finite setof tiles. A T -tiling of N × N is a function f : N × N → T such that for all i, j ∈ N ,we have t R = t ′ L when f ( i, j ) = t and f ( i + 1 , j ) = t ′ , and similarly, t T = t ′ B when f ( i, j ) = t and f ( i, j + 1) = t ′ . Intuitively, the right colour of each tile equals theleft colour of its right neighbour, and analogously for top and bottom colours. Thetiling problem for the grid N × N asks, with the input of a finite set T of tiles, ifthere exists a T -tiling of N × N . It is well known that this problem is Π -complete.We will show that the satisfiability problem for GRA( p, I, ¬ , J, ∃ ) is undecidable byreducing the tiling problem to it.Define the standard grid G N := ( N × N , R, U ) where R = { (( i, j ) , ( i + 1 , j )) | i, j ∈ N } and U = { (( i, j ) , ( i, j + 1)) | i, j ∈ N } . If G is a structure of the vocabulary { R, U } with binary relation symbols R and U , then G is grid-like if there exists a homomorphism τ : G N → G . Consider thenthe extended vocabulary { R, U, L, D } where also L and D are binary. Define thesentences ϕ inverses := ∀ x ∀ y ( R ( x, y ) ↔ L ( y, x )) ∧ ∀ x ∀ y ( U ( x, y ) ↔ D ( y, x )) ,ϕ successor := ∀ x ( ∃ yR ( x, y ) ∧ ∃ yU ( x, y )) ,ϕ cycle := ∀ x ∀ y ∀ z ∀ u [( L ( y, x ) ∧ U ( x, z ) ∧ R ( z, u )) → D ( u, y )] . Define Γ := ϕ inverses ∧ ϕ successor ∧ ϕ cycle . The intended model of Γ is the stan-dard grid G N extended with two additional binary relations, L pointing left and D pointing down. Lemma 5.2.
Let G be a structure of the vocabulary. { R, U, L, D } . Suppose G satisfies Γ . Then there exists a homomorphism from G N to G ↾ { R, U } , i.e,. to therestriction of G to the vocabulary { R, U } .Proof. As G satisfies ϕ inverses and ϕ cycle , it is easy to see that G satisfies thesentence ϕ grid − like := ∀ x ∀ y ∀ z ∀ u [( R ( x, y ) ∧ U ( x, z ) ∧ R ( z, u )) → U ( y, u )] . Usingthis sentence and ϕ successor , it is easy to inductively construct a homomorphismfrom G N to G ↾ { R, U } .The sentence ϕ grid − like in the above proof reveals the key trick in our argu-ment towards proving undecidability of GRA( p, I, ¬ , J, ∃ ). The sentence ϕ grid − like would be the natural and canonical choice for our argument rather than ϕ cycle .14ndeed, we could replace Γ = ϕ inverses ∧ ϕ successor ∧ ϕ cycle in the statement ofLemma 5.2 by ϕ successor ∧ ϕ grid − like , as the proof of the lemma establishes. How-ever, translating ϕ grid − like to GRA( p, I, ¬ , J, ∃ ) becomes a challenge. We solve thisby using the formula ϕ cycle instead of ϕ grid − like . By extending the vocabulary, wecan suitably formulate ϕ cycle so that the variables in it occur in a cyclic order. Theproof of Theorem 5.4 establishes that using this cyclicity, we can express ϕ cycle inGRA( p, I, ¬ , J, ∃ ) even though it lacks the swap operator s .Now fix a set of tiles T . We simulate the tiles by unary relation symbols P t foreach t ∈ T . Let ϕ T be the conjunction of the following four sentences: ∀ x _ t ∈ T P t ( x ) , ^ t = t ′ ∀ x ¬ ( P t ( x ) ∧ P t ′ ( x )) , ^ t R = t ′ L ∀ x ∀ y ¬ ( P t ( x ) ∧ R ( x, y ) ∧ P t ′ ( y )) , ^ t T = t ′ B ∀ x ∀ y ¬ ( P t ( x ) ∧ U ( x, y ) ∧ P t ′ ( y )) . Now ϕ T expresses that N × N is T -tilable: Lemma 5.3. N × N is T -tilable iff ϕ T ∧ Γ is satisfiable.Proof. Suppose first that there is a model G so that G | = ϕ T ∧ Γ. By Lemma 2.4,there exists a homomorphism τ : G N → G ↾ { R, U } . Define a tiling T of N × N bysetting that T (( i, j )) = t if τ (( i, j )) ∈ P t . Since G | = ϕ T and τ is homomorphism,the tiling is well-defined and correct.Now suppose that there exists a tiling T of N × N using T . Thus we can expand G N = ( N × N , R, U ) to G ′ N = ( N × N , R, U, L, D, ( P t ) t ∈ T ) in the obvious way. Clearly G ′ N | = ϕ T ∧ Γ.We are now ready to prove the following theorem.
Theorem 5.4.
The satisfiability problem of
GRA( p, I, ¬ , J, ∃ ) is Π -complete.Proof. The upper bound follows by GRA( p, I, ¬ , J, ∃ ) being contained in FO. Forthe lower bound, we will establish that ϕ T and each sentence in Γ can be expressedin GRA( p, I, ¬ , J, ∃ ).Now, note that ϕ inverses is equivalent to the conjunction of the sentences ∀ x ∀ y ( R ( x, y ) → L ( y, x )) ∧ ∀ x ∀ y ( L ( y, x ) → R ( x, y )) , ∀ x ∀ y ( U ( x, y ) → D ( y, x )) ∧ ∀ x ∀ y ( D ( y, x ) → U ( x, y )) . Let us express the first sentence in GRA( p, I, ¬ , J, ∃ ). To that end, consider theformula R ( x, y ) → L ( y, x ) . To express this, we consider first the formula ψ := R ( x, y ) → L ( z, u ) which can be expressed by the term T = ¬ J ( R, ¬ L ). Now, tomake ψ equivalent to R ( x, y ) → L ( y, x ), we could first write x = u ∧ y = z ∧ ψ and then existentially quantify u and z away. On the algebraic side, an essentiallycorresponding trick is done by transitioning from T first to ∃ Ip ( T ) and then to ∃ Ip ∃ Ip ( T ). This term is equivalent to R ( x, y ) → L ( y, x ). Therefore the sentence ∀ x ∀ y ( R ( x, y ) → L ( y, x )) is equivalent to ¬∃¬¬∃¬∃ Ip ∃ Ip T .Consider then the formula Including the second sentence would not strictly speaking be necessary for our argument. cycle = ∀ x ∀ y ∀ z ∀ u [( L ( y, x ) ∧ U ( x, z ) ∧ R ( z, u )) → D ( u, y )] . In the quantifier-free part, the variables occur in a cyclic fashion, but withrepetitions. We first translate the repetition-free variant( L ( v , v ) ∧ U ( v , v ) ∧ R ( v , v )) → D ( v , v )by using ¬ and J , letting T be the resulting term. Now we would need to modify T so that the repetitions are taken into account. To introduce one repetition, firstuse p on T repeatedly to bring the involved coordinates to the left end of tuples,then use I and after that ∃ . Here p suffices (and s is not needed) because ϕ cycle wasdesigned so that the repeated variable occurrences are cyclically adjacent to eachother in the variable ordering. Thus it is now easy to see that we can form a term T ′ equivalent to ( L ( v , v ) ∧ U ( v , v ) ∧ R ( v , v )) → D ( v , v ), and the term T ′ caneasily be modified to give a term for ϕ cycle .From subformulas of ϕ T , consider the formula ¬ ( P t ( x ) ∧ R ( x, y ) ∧ P t ′ ( y )). Here ψ ( x, y ) := P t ( x ) ∧ R ( x, y ) is equivalent to T := ∃ IJ ( P t , R ) and ψ ( x, y ) ∧ P t ′ ( y ) thusto p ∃ IpJ ( T , P t ′ ). The rest of ϕ T and the other remaining formulas are now easy totranslate. Corollary 5.5.
The satisfiability problem of
GRA( u, p, I, ¬ , J, ∃ ) is Π -complete. The main point of the article has been to introduce our program that facilitates asystematic study of logics via an algebraic approach based on finite signatures. Thetechnical results obtained demonstrate how the setting works, but they are not theprimary focus of the above study.After presenting GRA, we proved it equivalent to FO. We also provided al-gebraic characterizations for FO , GF and fluted logic and introduced a generalnotion of a relation operator . We then provided a comprehensive classification ofthe decidability of subsystems of GRA. Out of the cases obtained by removing oneoperator, only the case for GRA without p was left open. In each solved case wealso identified the related complexity.Our work can be continued into several directions; the key is to identify rele-vant collections of relation operators —as defined above—and provide classificationsfor the thereby generated systems. This work can naturally involve systems thatcapture FO, but also stronger, weaker and orthogonal systems. In addition to decid-ability, complexity and expressive power, also completeness for equational theories(including the one for GRA) is an interesting research direction. Furthermore,model checking for different particular systems and model comparison games forgeneral as well as particular sets of relation operators are interesting research top-ics. Also, it is natural to combine the approach in [21] to n -ary description logicswith the algebras presented above. The algebras (e.g., GRA) provide natural andwell-justified collections of operators on relations that can be used in order to define n -ary roles for related n -ary description logics. Different collections of operators ofcourse give logics with different kinds of properties. Furthermore, developing a16oinductive semantics for the algebras presented here is easy and surely on theagenda.Finally, from the studies above it is easy to see that GRA( e, p, s, ˆ I ) can expressexactly all first-order atoms (excluding ⊤ and ⊥ ). Thus the systemGRA( e, p, s, ˆ I , ¬ , J, ∃ ) , which we can now easily see to be equivalent to FO, seems particularly ‘FO-like’system. Furthermore, perhaps the likewise clearly FO-complete variantGRA( e, ´ p, ´ s, ˆ I, ¬ , J, ´ ∃ )is even closer to the typical use of standard FO. Here ´ p is like p but puts the lastelement to the beginning of tuples and ´ s swaps the last two elements. Note alsothat GRA( e, ´ p, ´ s, ˆ I, \ , J, ´ ∃ ) is equiexpressive with GRA( e, ´ p, ´ s, ˆ I, ¬ , J, ´ ∃ ). Now, wecan easily see, e.g., that GRA( e, ´ p, ´ s, ˆ I, \ , ˙ ∩ , ´ ∃ ) is sententially equiexpressive withGF, and simply changing ˙ ∩ to J gives us an FO-equivalent system. Also, FO on vocabularies with at most binary relations is sententially equiexpressive withGRA( e, ´ p, ´ s, ¬ , ˙ ∩ , ´ ∃ ), so it is also nicely related. Now, let U denote the constantoperator that outputs the universal binary relation A × A in every model A . Now,FO is sententially equiexpressive also with GRA( U, e, ´ p, ´ s, \ , ˙ ∩ , ´ ∃ ) over vocabularieswith at most binary relations.Now, we can of course also add U to GRA( e, ´ p, ´ s, ˆ I, \ , J, ´ ∃ ), getting the equiex-pressive GRA( U, e, ´ p, ´ s, ˆ I, \ , J, ´ ∃ ). From here we get an algebra sententially equiex-pressive with FO over vocabularies with at most binary symbols by replacing J with ˙ ∩ (dropping ˆ I is not necessary). We get an algebra sententially equiexpres-sive with GF from GRA( U, e, ´ p, ´ s, ˆ I, \ , J, ´ ∃ ) now by dropping U (dropping ˆ I is notnecessary) and changing J to ˙ ∩ . Acknowledgements.
Antti Kuusisto was supported by the Academy of Finlandgrants 438874 and 209365.
References [1] Hajnal Andr´eka, Istv´an N´emeti, and Johan van Benthem. Modal languagesand bounded fragments of predicate logic.
Journal of Philosophical Logic ,27(3):217–274, 1998.[2] Franz Baader, Ralf K¨usters, and Frank Wolter. Extensions to description log-ics. In Franz Baader, Diego Calvanese, Deborah L. McGuinness, Daniele Nardi,and Peter F. Patel-Schneider, editors,
The Description Logic Handbook: The-ory, Implementation, and Applications , pages 219–261. Cambridge UniversityPress, 2003.[3] John Bacon. The completeness of a predicate-functor logic.
Journal of SymbolicLogic , 50:903–921, 1985.[4] Vince B´ar´any, Balder ten Cate, and Luc Segoufin. Guarded negation.
Journalof the ACM , 62(3):22:1–22:26, 2015. Even without ˆ I . ACM Transactions on Computational Logic ,17(4):32:1–32:38, 2016.[6] Johan Van Benthem. Dynamic bits and pieces. ILLC research report, Univer-sity of Amsterdam, 1997.[7] Egon B¨orger, Erich Gr¨adel, and Yuri Gurevich.
The Classical Decision Prob-lem . Perspectives in Mathematical Logic. Springer, 1997.[8] Diego Calvanese, Giuseppe De Giacomo, and Maurizio Lenzerini. On the de-cidability of query containment under constraints. In Alberto O. Mendelzonand Jan Paredaens, editors,
Proceedings of the Seventeenth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems , pages 149–158. ACM Press, 1998.[9] Witold Charatonik and Piotr Witkowski. Two-variable logic with counting andtrees.
ACM Transactions on Computational Logic , 17(4):31:1–31:27, 2016.[10] Edgar F. Codd. Relational completeness of data base sublanguages.
ResearchReport / RJ / IBM / San Jose, California , RJ987, 1972.[11] Erich Gr¨adel. Invited talk: Decision procedures for guarded logics. In HaraldGanzinger, editor,
Automated Deduction - CADE-16, 16th International Con-ference on Automated Deduction, Proceedings , volume 1632 of
Lecture Notesin Computer Science , pages 31–51. Springer, 1999.[12] Erich Gr¨adel. On the restraining power of guards.
Journal of Symbolic Logic ,64(4):1719–1742, 1999.[13] Erich Gr¨adel, Phokion Kolaitis, and Moshe Vardi. On the decision problemfor two-variable first-order logic.
Bulletin of Symbolic Logic , 3(1):53–69, 1997.[14] Erich Gr¨adel, Martin Otto, and Eric Rosen. Two-variable logic with counting isdecidable. In
Proceedings, 12th Annual IEEE Symposium on Logic in ComputerScience LICS , pages 306–317. IEEE, 1997.[15] Lauri Hella and Antti Kuusisto. One-dimensional fragment of first-order logic.In Rajeev Gor´e, Barteld P. Kooi, and Agi Kurucz, editors,
Advances in ModalLogic 10 AiML, invited and contributed papers from the tenth conference on”Advances in Modal Logic” , pages 274–293. College Publications, 2014.[16] Colin Hirsch.
Guarded logics: algorithms and bisimulation.
PhD thesis, RWTHAachen, 2002.[17] Robin Hirsch and Ian Hodkinson.
Relation algebras by games . North Holland,2002.[18] Emanuel Kieronski and Antti Kuusisto. Complexity and expressivity of uni-form one-dimensional fragment with equality. In Erzs´ebet Csuhaj-Varj´u, Mar-tin Dietzfelbinger, and Zolt´an ´Esik, editors,
Mathematical Foundations of Com-puter Science 2014 - 39th International Symposium, MFCS, Proceedings, Part , volume 8634 of Lecture Notes in Computer Science , pages 365–376. Springer,2014.[19] Emanuel Kieronski, Jakub Michaliszyn, Ian Pratt-Hartmann, and Lidia Ten-dera. Two-variable first-order logic with equivalence closure.
SIAM Journalon Computing , 43(3):1012–1063, 2014.[20] Steven T. Kuhn. An axiomatization of predicate functor logic.
Notre DameJournal of Formal Logic , 24:233–241, 1983.[21] Antti Kuusisto. On the uniform one-dimensional fragment. In Maurizio Lenz-erini and Rafael Pe˜naloza, editors,
Proceedings of the 29th International Work-shop on Description Logics , volume 1577 of
CEUR Workshop Proceedings .CEUR-WS.org, 2016.[22] Antti Kuusisto. On games and computation.
CoRR , abs/1910.14603, 2019.[23] Dirk Leinders, , Maarten Marx, Jerzy Tyszkiewicz, and Jan Van den Bussche.The semijoin algebra and the guarded fragment.
Journal of Logic, Languageand Information , 14(3):331–343, 2005.[24] Per Lindstr¨om. First order predicate logic with generalized quantifiers.
Theo-ria , 32(3):186–195, 1966.[25] Leopold L¨owenheim. ¨Uber m¨oglichkeiten im relativkalk¨ul.
Matematische An-nalen , 76(4):447–470, 1915.[26] Amaldev Manuel and Thomas Zeume. Two-variable logic on 2-dimensionalstructures. In Simona Ronchi Della Rocca, editor,
Computer Science Logic2013 (CSL 2013) , volume 23 of
LIPIcs , pages 484–499. Schloss Dagstuhl -Leibniz-Zentrum f¨ur Informatik, 2013.[27] Maarten Marx. Tolerance logic.
Journal of Logic, Language and Information ,10(3):353–374, 2001.[28] S. Ju. Maslov. The inverse method for establishing deducibility for logicalcalculi. In V. P. Orevkov, editor,
Logical and logical-mathematical calculus.Part I, Trudy Mat. Inst. Steklov , volume 98, pages 26–87. Public, 1968.[29] Fabio Mogavero and Giuseppe Perelli. Binding forms in first-order logic. InStephan Kreutzer, editor, , volume 41 of
LIPIcs , pages 648–665, 2015.[30] Michael Mortimer. Reasoning about strategies: On the model-checking prob-lem.
Mathematical Logic Quarterly , 21(1), 1975.[31] Andrdzej Mostowski. On a generalization of quantifiers.
Fundamenta Mathe-maticae , 44(1):12–36, 1957.[32] Leszek Pacholski, Wieszlaw Szwast, and Lidia Tendera. Complexity of two-variable logic with counting. In
Proceedings, 12th Annual IEEE Symposiumon Logic in Computer Science LICS , pages 318–327. IEEE, 1997.1933] Ian Pratt-Hartmann. Complexity of the two-variable fragment with countingquantifiers.
Journal of Logic, Language and Information , 14(3):369–395, 2005.[34] Ian Pratt-Hartmann, Wieslaw Szwast, and Lidia Tendera. The fluted fragmentrevisited.
Journal of Symbolic Logic , 84(3):1020–1048, 2019.[35] Willard V. Quine. On the limits of decision. In
Proceedings of the 14th Interna-tional Congress of Philosophy , volume III, pages 57–62. University of Vienna,1969.[36] Willard Van Quine. Toward a calculus of concepts.
The Journal of SymbolicLogic , I:2–25, 1936.[37] Willard Van Quine. Variables explained away. In
Proceedings of the AmericanPhilosophical Society , 1960.[38] Willard Van Quine. Algebraic logic and predicate functors. In
Logic and Art ,pages 214–238. Bobbs-Merrill, Indianapolis, Indiana, 1972.[39] Luc Segoufin and Balder ten Cate. Unary negation.
Logical Methods in Com-puter Science , 9(3), 2013.[40] Marco Voigt. A fine-grained hierarchy of hard problems in the separated frag-ment. In , pages 1–12. IEEE, 2017.
A Algebra for the guarded fragment
In this section we consider GRA( e, p, s, \ , ˙ ∩ , ∃ ) and show that it is sententiallyequiexpressive with GF. Recall that GF is the logic that has all atoms R ( x , . . . , x k ), x = y and x = x , is closed under ¬ and ∧ , but existential quantification is restrictedto patterns ∃ x . . . ∃ x k ( α ∧ ψ ) where α is an atomic formula (a guard) having (atleast) all the free variables of ψ ∈ GF.In [16], the author considered a Codd-style relational algebra that was intendedto capture the expressive power of the guarded fragment GF. This system uses aninfinite signature and differs in its operators also in other respects from ours. It wasshown in [16] that GF contains the guarded relational algebra defined there. Theconverse direction does not hold in general, because in GF, one can form arbitraryBoolean combinations of atomic formulas that cannot be simulated in the settingof the guarded relational algebra of [16]. However, it was shown that on the levelof sentences , the expressive power of the guarded relational algebra coincides withthe guarded fragment. We now provide a similar result in our setting, showing thatGRA( e, p, s, \ , ˙ ∩ , ∃ )is sententially equiexpressive with GF. We start by defining that a term guard ofa term T of arity at least one is a term S with the following properties. A similar result was obtained in [23], where it was proved that a relational algebra with semijoin corresponds in a similar fashion to GF. S is either the term e or a relation symbol in T .2. The arity of S is at least the arity of T .3. For every model A and ( a , . . . , a k ) ∈ T A , there exists a tuple ( b , . . . , b m ) ∈S A and a permutation (i.e., bijection) f : { , . . . , m } → { , . . . , m } so that( a , . . . , a k ) is a subtuple of ( b f (1) , . . . , b f ( m ) ). (By a subtuple we mean a tupleobtainable simply by deleting some of the coordinate values.)The following lemma will be used below when translating algebraic terms toformulas of the guarded fragment. Lemma A.1.
Every term
T ∈
GRA( e, p, s, \ , ˙ ∩ , ∃ ) of arity at least one has a termguard.Proof. Straightforward induction on the structure of terms.We will also make use of the following lemma which implies that we can use I in GRA( e, p, s, \ , ˙ ∩ , ∃ ). Lemma A.2.
The operator I can be expressed with e , p and ˙ ∩ , i.e., any term I ( T ) has an equivalent term built from T by using e , p and ˙ ∩ .Proof. Consider the term I ( T ). If ar ( T ) >
1, then I ( T ) is expressed as follows:first write the term ( pp T ˙ ∩ e ) and then use p repeatedly to bring this term into thethe right order. If ar ( T ) is 1 or 0, then I ( T ) is equivalent to T .We can now prove the following. Theorem A.3.
GRA( e, p, s, \ , ˙ ∩ , ∃ ) and GF are sententially equiexpressive.Proof. We will first show that for every formula ∃ x . . . ∃ x k ψ of GF, there existsan equivalent term T of GRA( e, p, s, \ , ˙ ∩ , ∃ ). Let us begin by showing this for aformula ϕ := ∃ x . . . ∃ x k ψ where ψ is quantifier-free. We assume ϕ = ∃ x . . . ∃ x k ( α ( y , . . . , y n ) ∧ β ( z , . . . , z m ))where α ( y , . . . , y n ) is an atom and we have both { z , . . . , z m } ⊆ { y , . . . , y n } and { x , . . . , x k } ⊆ { y , . . . , y n } .Now consider a conjunction α ∧ ρ where α = α ( y , . . . , y n ) is our guard atomand ρ an arbitrary atom whose set of variables is a subset of { y , . . . , y n } . We callsuch a conjunction an α -guarded atom . For each α -guarded atom, we can find anequivalent term as follows. First, recall from the proof of Theorem 3.1 that we canwrite a term equivalent to any atom T ( u , . . . , u q ) by applying p, s, I, ∃ in a suitableway to the involved relation symbol; note that we can use I in GRA( e, p, s, \ , ˙ ∩ , ∃ )by Lemma A.2. Note also that x = y is equivalent to the term e and x = x to ∃ e . These remarks show that we can find terms T α and T ρ equivalent to α and ρ , respectively. Now, the term T ˙ ∩ S is not likely to be equivalent to α ∧ ρ , asthe variables in α ∧ ρ can be unfavourably ordered instead of matching each othernicely. However—recalling that p and s can be composed to produce arbitrarypermutations—we first permute T α to match T ρ at the last coordinates of tuples,then we combine the terms with ˙ ∩ , and finally we permute the obtained term to21he final desired form. In this fashion we obtain a term for an arbitrary α -guardedatom.Now recall the formula α ( y , . . . , y n ) ∧ β ( z , . . . , z m ) from above. For each atom γ in β , let T αγ denote the term equivalent to the α -guarded atom formed from γ .The formula β is a Boolean combination composed from atoms by using ¬ and ∧ .We let T β denote the term obtained from β by replacing each atom γ by the term T αγ , each ∧ by ˙ ∩ and each ¬ by relative complementation with respect to T α (i.e.,formulas ¬ η become replaced by T α \ η ∗ where η ∗ is the translation of η ). It is easyto show that T β is equivalent to α ( y , . . . , y n ) ∧ β ( z , . . . , z m ). Thus we can clearlyuse p and ∃ in a suitable way to the term T β to get a term equivalent to the formula ϕ = ∃ x . . . ∃ x k ( α ( y , . . . , y n ) ∧ β ( z , . . . , z m )).Thus we managed to translate ϕ . To get the full translation, we mainly justkeep repeating the procedure just described. The only difference is that above theformula β ( z , . . . , z m ) was a Boolean combination of atoms, while now β will alsocontain formulas of the form ∃ x . . . ∃ x r ( δ ∧ η ) in addition to atoms. Proceeding byinduction, we get a term equivalent to ∃ x . . . ∃ x r ( δ ∧ η ) by the induction hypothesis,and otherwise we proceed exactly as described above. This concludes the argumentfor translating formulas to terms.Let us then consider how to translate terms into equivalent formulas of GF. Theproof proceeds by induction. Since GF is closed under Boolean operators, the onlynon-trivial case is the translation of the projection operator ∃ . The hard part inthis case is to indeed ensure that we can translate ∃ so that the resulting formulahas the right guarding pattern and thereby belongs to GF.So suppose that we have translated T to ψ ( v , . . . , v k ), so ar ( T ) = k . Now, if k = 0 (and hence ψ is a sentence), we translate ∃T to ψ . Let us then consider thecase k ≥
1. Recall that by Lemma A.1, every term of arity at least one has a termguard. Let τ be the set that contains1. all the relation symbols that occur in T and have arity at least k and,2. if k ≤
2, then also the equality symbol ‘=’.Thus τ corresponds to the set of potential term guards for T . Let R ∈ τ (if R isthe equality symbol, then below R ( x, y ) and R ( x, x ) denote the atoms x = y and x = x , respectively). Let n denote the arity of R (with n = 2 if R is the equalitysymbol). Define the ‘ R -guard atom set’ G R = { R ( v i , . . . , v i n ) | { v i , . . . , v i n } = { v , . . . , v n } } which contains all atomic formulas that have R and exactly the set { v , . . . , v n } ofvariables. Note that G R lists all permutations of the tuple ( v , . . . , v n ). Therefore,by Lemma A.1, if R is a term guard for T , then every tuple in T A will be asubtuple of the set ( W G R ) A defined by the formula W G R . Furthermore, we havedefined G R so that if we existentially quantify away any n − k coordinates of the the n -ary relation ( W G R ) A , then the obtained relation will contain T A as a subrelation.Now, for each n ≥ k , define G n := _ R ∈ τ ar ( R ) = nα ∈ G R ∃ v ∃ v k +1 . . . ∃ v n ( α ∧ ψ ( v , . . . , v k )) . G n is a GF-formula. Let m ′ denote the maximum arity of the relationsymbols in T and define m := max { , m ′ } . The disjunction of the formulas G n foreach n ∈ { k, . . . , m } is equivalent to ∃T and in GF. B An algebra for two-variable logic
Here we establish that GRA( e, s, ¬ , ˙ ∩ , ∃ ) is sententially equivalent to the two-variable fragment of first order logic FO when we restrict attention to vocabulariesthat consist of relation symbols of arity at most two. By GRA ( e, s, ¬ , ˙ ∩ , ∃ ) we de-note the set of terms of GRA( e, s, ¬ , ˙ ∩ , ∃ ) that use at most binary relation symbols,but the arity of the terms themselves is not restricted. However it is easy to seethat the terms of GRA ( e, s, ¬ , ˙ ∩ , ∃ ) have arity at most two. Theorem B.1.
GRA( e, s, ¬ , ˙ ∩ , ∃ ) and FO are sententially equivalent over vocab-ularies with at most binary relation symbols.Proof. As GRA ( e, s, ¬ , ˙ ∩ , ∃ ) contains only terms of arity at most two, it is easy totranslate GRA ( e, s, ¬ , ˙ ∩ , ∃ ) into FO . We then consider the converse translation.We assume that FO is built using ¬ , ∧ and ∃ and treat other connectives and ∀ asabbreviations in the usual way.Now, let ϕ ∈ FO be a sentence with at most binary relations and let x and y be the two variables that occur in ϕ . Note indeed that ϕ is a sentence, notan open formula. We first convert ϕ into a sentence that does not contain anysubformulas of type ψ ( x ) ∧ χ ( y ) (or of type ψ ( x ) ∨ χ ( y )) as follows. Consider anysubformula ∃ x η ( x, y ) where η ( x, y ) is quantifier-free. Put η into disjunctive normalform and distribute ∃ x over the disjunctions. Then distribute ∃ x also over the overconjunctions as follows. Consider a conjunction α i ( x, y ) ∧ β i ( y ) ∧ γ i where each of α i , β i , γ i are conjunctions of literals; the formula γ i contains the nullary relationsymbols and α i ( x, y ) contains the literals of type π ( x, y ) and π ′ ( x ). We distributed ∃ x into α i ( x, y ) ∧ β i ( y ) ∧ γ i so that we obtain the formula ∃ xα i ( x, y ) ∧ β i ( y ) ∧ γ i .Thereby the formula ∃ η ( x, y ) gets modified into the formula W ni =1 ( ∃ xα i ( x, y ) ∧ β i ( y ) ∧ γ i ) which is of the right form and does not have x as a free variable. Nextwe can repeat this process for other existential quantifiers in the formula (by treatingthe subformulas with one free variable in the way that atoms with one free variablewere treated in the translation step for η ( x, y ) described above). Having startedfrom the sentence ϕ , we ultimately get a sentence that does not have subformulasof the form ψ ( x ) ∧ χ ( y ) or of the form ψ ( x ) ∨ χ ( y ) but is nevertheless equivalent to ϕ . Next we translate an arbitrary sentence ϕ ∈ FO that satisfies the above condi-tion to an equivalent term. We let v ∈ { x, y } denote a generic variable.Atoms of the form P ( v ) (respectively v = v ) translate to P (respectively ∃ e ).Relation symbols of arity 0 translate to themselves and1. R ( x, y ) translates to R ,2. R ( y, x ) translates to sR ,3. R ( v, v ) translates to ∃ ( R ˙ ∩ e ), 23. x = y and y = x translate to the term e .Now suppose we have translated ψ to T . Then ¬ ψ translates to ¬T . If ψ hasone free variable v , then ∃ vψ translates to ∃T . If ψ has two free variables, then weeither translate ∃ vψ into ∃T when v is x and into ∃ s T when v is y .Consider now a formula ψ ∧ χ and suppose that we have translated ψ to T and χ to S . If at least one of ψ and χ is a sentence, we translate ψ ∧ χ to ( T ˙ ∩ S ).Otherwise, due to the form of the sentence ϕ to be translated, we have that Free( ψ ) ∩ Free( χ ) = ∅ . Now ψ ( x, y ) ∧ χ ( x, y ), ψ ( y ) ∧ χ ( x, y ) and ψ ( x, y ) ∧ χ ( y ) are all translatedto T ˙ ∩ S , while ψ ( x, y ) ∧ χ ( x ) and ψ ( x ) ∧ χ ( x, y ) are translated to s ( s T ˙ ∩ S ) and s ( T ˙ ∩ s S ) respectively.Our above translation of FO -sentences to GRA ( e, s, ¬ , ˙ ∩ , ∃ ) is clearly not poly-nomial, and thus it is not immediately clear if we get a NexpTime lower bound forthe complexity of the satisfiability problem of GRA ( e, s, ¬ , ˙ ∩ , ∃ ). However, we canprove the following theorem. Theorem B.2.
The satisfiability problem of
GRA ( e, s, ¬ , ˙ ∩ , ∃ ) is NexpTime -complete.Proof.
The upper bound follows from the fact that GRA ( e, s, ¬ , ˙ ∩ , ∃ ) translateseasily into FO in polytime, and FO is well known to have NexpTime -completesatisfiability problem.The arguments in Appendix C show that the two-variable fragment of fluted logic over vocabularies with at most binary relation symbols translates in polynomial timeinto GRA ( e, s, ¬ , ˙ ∩ , ´ ∃ ) (where we now have ´ ∃ instead of ∃ ). In [34], it is establishedthat this fragment of fluted logic is NexpTime -complete. Thus we only need totranslate GRA ( e, s, ¬ , ˙ ∩ , ´ ∃ ) into GRA ( e, s, ¬ , ˙ ∩ , ∃ ) in polytime. This is easy, as ∃ and ´ ∃ are equivalent on terms of arity at most one, while on terms of arity two, ´ ∃ is equivalent to the composed operation ∃ s , i.e., first s and then ∃ . C An algebra for fluted logic
The fluted logic FL is a fragment of FO that was originally considered by Quine inrelation to his work on the predicate functor logic [35], but it has also received someattention recently. For the (somewhat complicated) history of FL, we recommendthe introduction of the article [34].We first give the definition of FL as given in [34]. Fix the infinite sequence v ω = ( v , v , ... ) of variables. For every k ∈ N , we define sets FL k as follows.1. Let R be an n -ary relation symbol and consider the subsequence( v k − n +1 , . . . , v k )of v ω containing precisely n variables. Then R ( v k − n +1 , . . . , v k ) ∈ FL k .2. For every ϕ, ψ ∈ FL k , we have that ¬ ϕ, ( ϕ ∧ ψ ) ∈ FL k .3. If ϕ ∈ FL k +1 , then ∃ v k +1 ϕ ∈ FL k . 24inally, we define the set of fluted formulas to be FL := S k FL k .The logic FL can also be described with the natural algebraic operators ¬ , ˙ ∩ , ´ ∃ .The equivalence of the two representations is already implicit in the fact that themore traditional syntax for FL was building on such algebraic syntax. For the sakeof completeness, we give an explicit translation below. Theorem C.1. FL and GRA( ¬ , ˙ ∩ , ´ ∃ ) are equiexpressive.Proof. We first translate formulas to algebraic terms. Formulas which have theform R ( v k − n +1 , . . . , v k ) are translated to R . Note that when if R has arity 0, then R ( v k − , v k ) of course denotes the formula R (which translates to the term R ).Suppose then that ¬ ϕ, ( ϕ ∧ ψ ) ∈ FL k and that we have translated ϕ to T and ψ to S . We translate ¬ ϕ to ¬T . Now, observe that if α ∈ FL k , then the free variablesof α form some suffix of the sequence ( v , . . . , v k ). Thus we can translate ( ϕ ∧ ψ )to ( T ˙ ∩ S ). Finally, if ∃ v k +1 ϕ ∈ FL k and ϕ translates to T , then we can translate ∃ v k +1 ϕ to ´ ∃T .We then translate algebraic terms into fluted logic. An easy way to describethe translation is by giving a family of translations f v m ,...,v k where ( v m , . . . , v k ) isa suffix of ( v , . . . , v k ). (It is also possible that f v m ,...,v k = f v k +1 ,v k which happensprecisely when translating a term of arity zero.) The translations are as follows.1. f v m ,...,v k ( R ) := R ( v m , . . . , v k ) for ar ( R ) = k − m + 1. (When ar ( R ) = 0, then R translates to R .)2. f v m ,...,v k ( ¬T ) = ¬ f v m ,...,v k ( T ) for ar ( T ) = k − m + 1.3. f v m ,...,v k ( T ˙ ∩ S ) = f v n ,...,v k ( T ) ∧ f v ℓ ,...,v k ( S ) for ar ( T ˙ ∩ S ) = k − m + 1; ar ( T ) = k − n + 1; and ar ( S ) = k − ℓ + 1.4. f v m ,...,v k (´ ∃T ) = ∃ v k +1 f v m ,...,v k +1 ( T ) for ar (´ ∃T ) = k − mm