• No results found

The tractability frontier of graph like first order query sets

N/A
N/A
Protected

Academic year: 2020

Share "The tractability frontier of graph like first order query sets"

Copied!
14
0
0

Loading.... (view fulltext now)

Full text

(1)

BIROn - Birkbeck Institutional Research Online

Chen, Hubie (2014) The tractability frontier of graph-like first-order query

sets.

In: UNSPECIFIED (ed.)

CSL-LICS ’14 Proceedings of the Joint

Meeting of the Twenty-Third EACSL Annual Conference on Computer

Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium

on Logic in Computer Science (LICS). New York, U.S.: ACM Publications.

ISBN 9781450328869.

Downloaded from:

Usage Guidelines:

Please refer to usage guidelines at

or alternatively

(2)

The Tractability Frontier of

Graph-Like First-Order Query Sets

Hubie Chen

Departamento LSI, Universidad del Pa´ıs Vasco andIKERBASQUE, Basque Foundation for Science

E-20018 San Sebasti´an, Spain

[email protected]

Abstract

We study first-order model checking, by which we refer to the problem of deciding whether or not a given first-order sentence is satisfied by a given finite structure. In particular, we aim to understand on which sets of sentences this problem is tractable, in the sense of parameterized complexity theory. To this end, we define the notion of a graph-like sentence set, which definition is inspired by previous work on first-order model checking wherein the permitted connectives and quantifiers were restricted. Our main theorem is the complete tractability classification of such graph-like sentence sets, which is (to our knowledge) the first complexity classification theorem concerning a class of sentences that has no restriction on the connectives and quantifiers. To present and prove our classification, we introduce and develop a novel complexity-theoretic framework which is built on parameterized complexity and includes new notions of reduction.

Categories and Subject Descriptors F.4.1 [Mathematical logic and formal languages]: Mathematical logic—Computational logic; H.2.3 [Database management]: Languages—Query languages

General Terms Theory

Keywords first-order queries, query evaluation, parameterized complexity, treewidth

1.

Introduction

Model checking, the problem of deciding if a logical sentence holds on a structure, is a fundamental computational task that appears in many guises throughout computer science. In this article, we studyfirst-order model checking, by which we refer to the case of this problem where one wishes to evaluate a first-order sentence on a finite structure. This case is of principal interest in database theory, where first-order sentences form a basic, heavily studied class ofdatabase queries, and where it is well-recognized that the problem of evaluating such a query on a database can be taken as a formulation of first-order model checking. Indeed, the investigation of model checking in first-order logic entails an examination of one of the simplest, most basic logics, and it can be expected that understanding of the first-order case should provide a well-founded basis for studying model checking in other logics, such as those typically considered in verification and database theory. First-order model checking is well-known to be intractable in general: it is PSPACE-complete.

As has been articulated [11, 16], the typical model-checking sit-uation in the database and verification settings is the evalsit-uation of a relatively short sentence on a relatively large structure. Conse-quently, it has been argued that, in measuring the time complex-ity of model checking, one could reasonably allow a slow

(non-polynomial-time) preprocessing of the sentence, so long as the de-sired evaluation can be performed in polynomial time following the preprocessing. Relaxing polynomitime computation to al-low arbitrary preprocessing of aparameterof a problem instance yields, in essence, the notion offixed-parameter tractability. This notion of tractability is the base ofparameterized complexity the-ory, which provides a taxonomy for reasoning about and classi-fying problems where each instance has an associated parameter. We utilize this paradigm, and focus the discussion on this form of tractability (here, the sentence is the parameter).

A typical way to understand which types of sentences are well-behaved and exhibit desirable, tractable behavior is to simply con-sider model checking relative to a setΦof sentences, and to attempt to understand on which sets one has tractable model checking. We restrict attention to sets of sentences having bounded arity.1 Here,

there have been successes in understanding which sets of sentences are tractable (and which are not) in fragments of first-order logic described by restricting the connectives and quantifiers that may be used: there are systematic classification results for so-called con-junctive queries [8, 12, 13] (formed using the connectives and quan-tifiers int^,Du) existential positive queries [4] (t^,_,Du), and quantified conjunctive queries [5, 7] (t^,D,@u). However, to the best of our knowledge, there has been no classification theorem for general first-order logic, without any restriction on the connectives and quantifiers. In this article, we present the first such classifica-tion.

Our approach. In the fragments of first-order logic where the only connective permitted is one of the binary connectives (t^,_u)—such as those of conjunctive queries and quantified con-junctive queries—a heavily studied approach to describing setsΦ

of sentences is agraphical approach. In this graphical approach, one studies a sentence setΦif it isgraphicalin the following sense: if one prenex sentenceφis contained inΦand a second prenex sen-tenceψhas the same prefix asφand also has the same graph as

φ, thenψis also inΦ. (By the graph of a prenex sentenceφ, we mean the graph whose vertices are the variables ofφand where two vertices are adjacent if they occur together in an atomic formula.) In the fragments where it was considered, this approach of study-ing graphical sentence sets is not only a natural way to coarsen the project of classifying all setsΦof sentences, but in fact, can be used cleanly as a key module in obtaining general classifications of sentence sets: such general classifications have recently been proved by using the respective graphical classifications as black boxes [7, 8].

1Note that in the case of unbounded arity, complexity may depend on the

(3)

In this article, we adapt this graphical approach to the full first-order setting. To explain how this is done, consider that a graphical setΦof sentences satisfies certain syntactic closure properties. For instance, if one takes a sentence from such a graphical setΦand replaces the relation symbol of an atomic formula, the resulting sentence will have the same graph, and will hence continue to be in

Φ; we refer to this property ofΦasreplacement closure. As another example, if one rewrites a sentence inΦby invoking associativity or commutativity of the connective^, the resulting sentence will likewise still have the same graph and will hence be contained in

Φalso. Inspired by these observations, we define a sentence setΦ

to begraph-likeif it is replacement closed and also closed under certain well-known syntactic transformations, such as associativity and commutativity of the binary connectives (see Section 2 for the full definition).

Our principal result is the complete tractability characteriza-tion of graph-like sentence sets (see Theorem 6.2 and the corol-laries that follow). In particular, we introduce a measure on first-order formulas which we callthickness, and show that a set of graph-like sentences is tractable if and only if it has bounded thick-ness (under standard complexity-theoretic assumptions). In study-ing unrestricted first-order logic, we believe that our buildstudy-ing on the syntactic, graphical approach—which has an established, fruitful tradition—will facilitate the formulation and obtention of future, more general results.

As evidence of our result’s generality and of its faithfulness to the graphical approach, we note that the graphical classification of quantified conjunctive queries [5] can be readily derived from our main classification result (this will be discussed in the full version of this paper); it follows readily that the dual graphical classifica-tion of quantified disjunctive queries (also previously derived [5]) can be dually derived from our main classification result. We there-fore give a single classification theorem that naturally unifies to-gether these two previous classifications. Indeed, we believe that the technology that we introduce to derive our classification yields a cleaner, deeper and more general understanding of these previous classifications. Observe that, for each of those classifications, since only one binary connective is present, the two quantifiers behave asymmetrically; this is in contrast to the present situation, where in building formulas, wherever a formula may be constructed, its dual may be as well.

Parameterized complexity. An increasing literature investi-gates the following general situation:

Given a parameterized problemP

whose instances consist of two parts, and a setS, definePJSKto be the restricted version ofP where

px, yqis admitted as an instance iffxPS. Then, attempt to classify and understand, over all setsS,

the complexity of the problemPJSK.

Examples of such classifications and studies include [5, 6, 8–10, 12–14]. It is our view that this literature suffers from the defect that there is no complexity-theoretic framework for discussing the families of problems obtained thusly. As a consequence, different authors and different articles used divergent language and notions to present hardness results on and reductions between such prob-lems, and applied different computability assumptions on the setsS

considered. We attempt to make a foundational contribution and to ameliorate this state of affairs by presenting a complexity-theoretic framework for handling and classifying problems of the described form. In particular, we introduce notions such as reductions and complexity classes for problems of the above type, which we for-malize ascase problems(Section 4). Although we do not carry out this exercise here, we believe that most of the results in the

men-tioned literature can be shown to be naturally and transparently ex-pressible within our framework.

In order to derive our classification, we present (within our complexity-theoretic framework) a new notion of reduction which we callaccordion reductionand which is crucial for the proof of our hardness result. (See Sections 7 and 8 for further discussion.) We believe that this notion of reduction may play a basic role in future classification projects of the form undertaken here.

Let us emphasize that, while the establishment of our main clas-sification theorem makes use of the complexity-theoretic frame-work and accompanying machinery that was just discussed (and is presented in Sections 4 and 7), this framework and machinery is fully generic in that it does not make any reference to and is not specialized to the model checking problem. We believe and hope that the future will find this framework to be a suitable basis for presenting, developing and discussing complexity classification re-sults.

2.

Preliminaries

Wheng:AÑBandh:BÑCare mappings, we will typically usehpgqto denote their composition. Whenfis a partial mapping, we usedompfqto denote its domain, and we usefæSto denote its restriction to the setS. We will useπito denote theith projection,

that is, the mapping that, given a tuple, returns the value in the tuple’sith coordinate. For a natural numberk, we usekto denote the sett1, . . . , ku.

2.1 First-order logic

We use the syntax and semantics of first-order logic as given by a standard treatment of the subject. In this article, we restrict to relational first-order logic, so the only symbols in signatures are relation symbols. We use letters such asA,Bto denote structures and A, B to denote their respective universes. The reader may assume for concreteness that relations of structures are represented using lists of tuples, although in general, we will deal with the setting of bounded arity, and natural representations of relations will be (for the complexity questions at hand) equivalent to this one. We assume that equality is not built-in to first-order logic, so a formulais created fromatoms, the usual connectives ( ,^,_) and quantification (D,@); by anatom, we mean a formulaRpv1, . . . , vkq

where a relation symbol is applied to a tuple of variables (of the arity of the symbol). A formula ispositiveif it does not contain negation ( ). We usefreepφq to denote the set of free variables of a formulaφ. Thewidthof a formulaφ, denoted bywidthpφq, is defined as the maximum of|freepψq|over all subformulasψof

φ. Thearityof a formula is the maximum arity over all relation symbols that occur in the formula.

We useφ1^ ¨ ¨ ¨ ^φnas notation forp¨ ¨ ¨ ppφ1^φ2q ^φ3q ¨ ¨ ¨ q,

andφ1_ ¨ ¨ ¨ _φnis defined dually. We refer to a formula of the

shapeφ1^ ¨ ¨ ¨ ^φnas aconjunction, and respectively refer to a

formula of the shapeφ1_¨ ¨ ¨_φnas adisjunction. LetΦbe a set of

formulas. Apositive combinationof formulas fromΦis a formula in the closure ofΦunder conjunction and disjunction. ACNFof formulas fromΦis a conjunction of disjunctions of formulas from

Φ, and aDNFof formulas fromΦis a disjunction of conjunctions of formulas fromΦ.

(4)

We say that a formula is loose if it is both variable-loose and symbol-loose.

We now present a number of syntactic transformations; that each preserves logical equivalence is well-known.2

(α) Associativity and commutativity of^and_

(β)DxpŽni“1φiq ” Žn

i“1pDxφiq,

@ypŹni“1φiq ”Źni“1p@yφiq

(γ)Dxpφ^ψq ” pDxφq ^ψifxRfreepψq,

@ypφ_ψq ” p@yφq _ψifyRfreepψq

(δ) (Distributivity for^and_)

φ^ pψ_ψ1q ” pφ^ψq _ pφ^ψ1q,

φ_ pψ^ψ1q ” pφ_ψq ^ pφ_ψ1q

() (DeMorgan’s laws)

Dvφ” @v φ, @vφ” Dv φ

pφ^ψq ” φ_ ψ, pφ_ψq ” φ^ ψ

We say that a setΦof formulas issyntactically closedif, for each

φ P Φ, when a formulaφ1 can be obtained fromφby applying

one of the syntactic transformations pαq, pβq, pγq,pδq,pq to a subformula ofφ, it holds thatφ1 P Φ. Thesyntactic closureof

a formulaφis the intersection of all syntactically closed sets that containφ.

Let us say that a formulaφ1on signatureσ1is obtainable from a

formulaφon signatureσbyreplacementifφ1can be obtained from

φby replacing instances of relation symbols inφwith instances of relation symbols fromσ1(without making any other changes toφ).

Example 2.1. Letφbe the formula@yDxDx1pEpy, xq ^Epx, x1qq.

Letτbe the signaturetE, FuwhereEandFare relation symbols of binary arity. Each of the four formulasφ,@yDxDx1pFpy, xq ^

Epx, x1qq,@yDxDx1pEpy, xq ^Fpx, x1qq, and@yDxDx1pFpy, xq ^

Fpx, x1qqis obtainable fromφby replacement; moreover, these are

the only four formulas over signatureτthat are obtainable fromφ

by replacement.

Let us say that a set of formulasΦisreplacement closedif, for eachφPΦ, whenφ1is obtainable fromφby replacement, it holds

thatφ1PΦ.

Definition 2.2. A set of formulasΦisgraph-likeif it is syntacti-cally closed and replacement closed.

2.2 Graphs and hypergraphs

WhenSis a set, we useKpSqto denote the set containing all size

2subsets ofS, that is,KpSq “ tts, s1u |s, s1 PS, ss1u. For

us, agraphis a pairpV, EqwhereV is a set andEĎKpVq. Here, ahypergraphHis a pairpVpHq, EpHqqconsisting of a vertex setVpHqand an edge set EpHqwhich is a subset of the power set℘pVpHqq. We will sometimes specify a hypergraph just by specifying the edge setE, in which case the vertex set is un-derstood to beŤ

ePEe. We associate a hypergraphpVpHq, EpHqq

with the graphpVpHq,Ť

ePEpHqKpeqq, and thereby refer to (for

example) the treewidth of or an elimination ordering of a hyper-graph.

Anelimination orderingof a graphpV, Eqis a pair

ppv1, . . . , vnq, E1q

that consists of a supersetE1 ofE and an ordering v 1, . . . , vn

of the elements ofV such that the following property holds: for each vertexvk, any two distinct lower neighborsv, v1 of vk are

adjacent inE1, that is, tv, v1u P E1; here, alower neighbor of

2Note that in the transformationpγq, we permit thatφis not present.

a vertexvk is a vertex vi such thati ă k and tvi, vku P E1.

Relative to an elimination orderinge, we define thelower degreeof a vertexv, denoted bylower-degpe, vq, to be the number of lower neighbors that it has; we definelower-degpeqto be the maximum oflower-degpe, vqover all verticesv. We assume basic familiarity with the theory of treewidth [2]. The following is a key property of treewidth that we will utilize; here, we usetwpHqto denote the treewidth ofH.

Proposition 2.3. For eachkě2, there exists a polynomial-time algorithm that, given as input a hypergraphHwith a distinguished edgef, will return the following whenevertwpHq ăk: an elimina-tion orderinge“ ppv1, . . . , vmq, Eqwithlower-degpeq “twpHq

and wheretv1, . . . , v|f|u “f.

The treewidth of (for example) a set of graphs G is the set

ttwpGq |GPGu; it is said to beunboundedif this set is infinite, andboundedotherwise. We employ similar terminology, in gen-eral, when dealing with a complexity measure defined on a class of objects.

3.

Parameterized complexity

In this section, we specify the framework of parameterized com-plexity to be used in this article.

Throughout, we useΣto denote an alphabet over which lan-guages are defined. As is standard, we will sometimes view el-ements ofΣ˚ ˆΣ˚ as elements of Σ˚. Aparameterization is

a mapping fromΣ˚ to Σ˚. A parameterized problem is a pair

pQ, κqconsisting of a languageQ ĎΣ˚ and a parameterization

κ : Σ˚ Ñ Σ˚. Aparameterized classis a set of parameterized problems.

Assumption 3.1. We assume that each parameterized problem

pQ, κqhas a non-trivial languageQ, that is, that neitherQ“Σ˚

norQ“ H.

Remark 3.2. Let us remark on a difference between our setup and that of other treatments. Elsewhere, a parameterization is often defined to be a mapping from Σ˚ to

N, and in the context of

query evaluation, the parameterization studied is typically the size of the query. In contrast, this article takes the parameterization to be the query itself. Since there are finitely many queries of any fixed size, model checking on a set of queries will be fixed-parameter tractable (that is, in the classFPT, defined below) under one of these parameterizations if and only if it is under the other. However, we find that—as concerns the theory in this article—taking the query itself to be the parameter allows for a significantly cleaner presentation. One example reason is that the reductions we present will generally be “slice-to-slice”, that is, they will send all instances with the same query to instances that share another query. Indeed, to understand the complexity of a set of queries, we will apply a closure operator to pass to a larger set of queries having the same complexity, using the notion of accordion reduction (see Sections 7 and 8); we believe that the theory justifying this passage is most cleanly expressed under the used parameterization.l

We now define what it means for a partial mappingrto be FPT-computable; we actually first define a non-uniform version of this notion. This definition coincides with typical definitions in the case thatris a total mapping; in the case thatris a partial mapping, we use a “promise” convention, that is, we do not impose any mandate on the behavior of the respective algorithm in the case that the input

xis not in the domain ofr.

Definition 3.3. Letκ: Σ˚

ÑΣ˚be a parameterization.

A partial mappingr : Σ˚

Ñ Σ˚isnu-FPT-computable with

respect toκif there exist a functionf: Σ˚Ñ

(5)

Aksatisfying the following condition: on each stringxPdomprq

such thatκpxq “k, the algorithmAkcomputesrpxqwithin time

fpκpxqqpp|x|q.

A partial mappingr : Σ˚

Ñ Σ˚

is FPT-computable with respect toκif there exists a single algorithmAthat can play the role of each algorithmAkin the just-given definition; formally, if

there exist a functionf: Σ˚

ÑN, a polynomialp:NÑN, and an algorithmAsuch that for eachk PΣ˚, the above condition is

satisfied whenAkis set equal toA.l

Definition 3.4. We defineFPTto be the class that contains a pa-rameterized problempQ, κqif and only if the characteristic func-tion ofQis FPT-computable with respect toκ.

Let us remark that we do not put in effect some of the com-putability assumptions that are often present in other treatments, for instance, we do not require a computable upper bound on the func-tionfin our definition ofFPT-computable. This is for simplicity; it can be verified that the theory that we present and carry out can also be done so in the case when such assumptions are present.

We now introduce the notion of a reduction between parameter-ized problems.

Definition 3.5. Let pQ, κq and pQ1, κ1q be parameterized

prob-lems. A FPT-reduction (respectively, nu-FPT-reduction) from

pQ, κq to pQ1, κ1q is a total mapping g that is FPT-computable

(respectively, nu-FPT-computable) with respect toκsuch that: (1) for eachxPΣ˚, it holds thatxPQif and only ifgpxq PQ1; and

(2) for eachkPΣ˚, the setκ1pgptxPΣ˚|κpxq “kuqqis finite. Assumption 3.6. We assume that each parameterized classC is closed under FPT-reductions, that is, ifpQ1, κ1qis inCandpQ, κq

FPT-reduces topQ1, κ1q, thenpQ, κqis inC. Proposition 3.7. LetpQ, κq,pQ1, κ1

q, andpQ2, κ2

qbe parameter-ized problems.

•Ifgis a FPT-reduction frompQ, κqtopQ1, κ1qandhis a

FPT-reduction from pQ1, κ1q to pQ2, κ2q, then their composition

hpgqis a FPT-reduction frompQ, κqtopQ2, κ2q.

•Similarly, ifgis a nu-FPT-reduction from pQ, κq topQ1, κ1q

and his a nu-FPT-reduction frompQ1, κ1q topQ2, κ2q, then

their composition hpgqis a nu-FPT-reduction frompQ, κqto

pQ2, κ2q.

Also, each FPT-reduction frompQ, κqto pQ1, κ1

qis an nu-FPT-reduction frompQ, κqtopQ1, κ1

q.

We may now define, for each parameterized classC, a non-uniform version of the class, denoted bynu-C.

Definition 3.8. (non-uniform classes) WhenCis a parameterized class, we definenu-Cto be the set that contains each parameterized problem that has a nu-FPT-reduction to a problem inC.

Remark 3.9. It is straightforwardly verified that a parameterized problempQ, κqis in the classnu-FPT(under the above definitions) if and only if the characteristic function ofQis nu-FPT-computable with respect toκ.

We next present two notions of hardness for parameterized classes.

Definition 3.10. (hardness) LetCbe a parameterized class. We say that a problempQ, κqisC-hard if every problem inChas a FPT-reduction topQ, κq. We say that a problempQ, κqis non-uniformly

C-hard if every problem inChas a nu-FPT-reduction topQ, κq. We end this section by observing some basic closure prop-erties of what we calldegree-bounded functions, which, roughly speaking, are the functions which can serve as the running time of algorithms in the definition ofFPT-computable (Definition 3.3).

Letκ : Σ˚ Ñ Σ˚ be a parameterization. A partial function

T : Σ˚ Ñ Nisdegree-bounded with respect toκif there exist

a functionf: Σ˚ÑNand a polynomialp:NÑNsuch that, for

eachx P dompTq, it holds thatTpxq ď fpκpxqqpp|x|q. We will make use of the observation that a partial mappingh: Σ˚

ÑΣ˚

is FPT-computable with respect toκif and only if there is a degree-bounded functionT (withdompTq Ědomphq) and an algorithm that, for allxPdomphq, computeshpxqwithin timeTpxq.

The following proposition will be of use in establishing that functions are degree-bounded.

Proposition 3.11.Letκbe a parameterization, and letT1, . . . , Tm: Σ˚Ñ

Nbe partial functions sharing the same domain.

1. If each ofT1, . . . , Tmis degree-bounded with respect toκ, then

T1` ¨ ¨ ¨ `Tmis as well.

2. If each ofT1, . . . , Tmis degree-bounded with respect toκ, then

the productT1¨ ¨ ¨Tmis as well.

3. Letq:NÑNbe a polynomial; if a partial functionT : Σ˚Ñ

Nis degree-bounded with respect toκ, thenqpTqis as well.

4.

Case complexity

A number of previous works focus on a decision problemQwhere each instance consists of two parts, and obtain restricted versions of the problem by taking setsS Ď Σ˚ and, for each such set,

considering the restricted version where one allows only instances where (say) the first of the parts falls intoS. This is precisely the type of restriction that we will consider here. We are interested in first-order model checking, which we view as the problem of deciding, given a first-order sentence and a structure, whether or not the sentence holds on the structure; our particular interest is to study restricted versions of this problem where the allowed sentences come from a setS.

It has been useful (see for instance the articles [5, 8]) and is useful in the present article to present reductions between such re-stricted versions of problems. In order to facilitate our doing this, we present a framework wherein we formalize this type of re-stricted version of problem as acase problem, and then present a notion of reduction for comparing case problems. We believe that our notion of reduction, calledslice reduction, faithfully abstracts out precisely the key useful properties that are typically present in such reductions in the literature. Note that, in the existing literature, different articles imposed different computability assumptions on the setsSconsidered (assumptions used include that of computable enumerability, of computability, and of no computability assump-tion). One feature of our framework is that such reductions can be carried out and discussed independently of whether or not any such computability assumption is placed on the setsS; a general theo-rem (Theotheo-rem 4.5) allows one to derive normal parameterized re-ductions from slice rere-ductions, where the exact computability of the reduction derivable depends on the computability assumption placed on the setsS.

We now introduce our framework. Suppose thatQĎΣ˚

ˆΣ˚

is a language of pairs; for a setT ĎΣ˚, we useQ

Tto denote the

languageQX pTˆΣ˚

qand for a single stringtPΣ˚, we useQ t

to denote the languageQX pttu ˆΣ˚q.

Definition 4.1. Acase problemconsists of a language of pairs

Q Ď Σ˚ ˆΣ˚ and a subset S Ď Σ˚, and is denotedQrSs.

WhenQrSsis a case problem, we useparam-QrSsto denote the parameterized problempQS, π1q.

Ultimately, our purpose in discussing a case problem QrSs

(6)

Remark 4.2. LetpQ, κqbe a parameterized problem. Under the assumption that κ is FPT-computable with respect to itself, the parameterized problempQ, κqis straightforwardly verified to be equivalent, under FPT-reduction, to the parameterized problem

pQ1, π

1qwhereQ1“ tpκpxq, xq |xPΣ˚u. Hence, any such given

parameterized problem pQ, κq may be canonically associated to the case problemQ1

rΣ˚

s, as one hasparam-Q1

rΣ˚

s “ pQ1, π 1q.

We definecase-CLIQUEto be the case problemQrΣ˚swhere

Qcontains a pairpk, Gqif and only ifGis a graph that contains a clique of sizek(we assume that bothGandkare encoded as strings overΣ); we definecase-co-CLIQUEto be the problemQrΣ˚

s. We now present the notion ofslice reduction, which allows us to compare case problems.

Definition 4.3. A case problemQrSsslice reducesto a second case problemQ1rS1sif there exist:

•a computably enumerable languageUĎΣ˚ˆΣ˚and

a partial functionr: Σ˚

ˆΣ˚

ˆΣ˚

ÑΣ˚

that hasdomprq “

UˆΣ˚

and is FPT-computable with respect to the parameteri-zationpπ1, π2q

such that the following conditions hold:

•(coverage) for each s P S, there existss1 P S1 such that

ps, s1q PU, and

(correctness)for eachpt, t1

q P U, it holds (for eachy P Σ˚

) that

pt, yq PQô pt1, rpt, t1, yqq PQ1.

We call the pairpU, rqaslice reductionfromQrSstoQ1

rS1

s. In this definition, we understand the parameterizationpπ1, π2q

to be the mapping that, for allps, s1q PU andyPΣ˚, returns the pairps, s1qgiven the tripleps, s1, yq.

Theorem 4.4. (Transitivity of slice reducibility) Suppose that

Q1rS1sslice reduces to Q2rS2sand that Q2rS2s slice reduces

toQ3rS3s. ThenQ1rS1sslice reduces toQ3rS3s.

The following theorem allows one to derive an FPT-reduction or an nu-FPT-reduction from a slice reduction.

Theorem 4.5. Suppose that a case problem QrSsslice reduces to another case problemQ1rS1s. Then, it holds thatparam-QrSs

nu-FPT-reduces toparam-Q1rS1s; if in additionSandS1are com-putable, thenparam-QrSsFPT-reduces toparam-Q1

rS1

s. For each parameterized classC, we definecase-Cto be the set of case problems that contains a case problemQrSsif and only if there exists a case problemQ1rS1ssuch that

•param-Q1

rS1

sis inC, •QrSsslice reduces toQ1

rS1

s, and •S1is computable.

Proposition 4.6. Suppose thatCis a parameterized class, and that

QrSsis a case problem incase-C. Then, the problemparam-QrSs

is innu-C; if it is assumed additionally thatSis computable, then the problemparam-QrSsis inC.

LetQrSsbe a case problem and letCbe a parameterized class. We say that QrSsiscase-C-hard if there exists a case problem

rS´

ssuch that •param-Q´

rS´

sisC-hard, •Q´rS´sslice reduces toQrSs, and •S´is computable.

Proposition 4.7. Suppose thatCis a parameterized class, and that

QrSs is a case problem that iscase-C-hard. Then, the problem

param-QrSsis non-uniformlyC-hard; if it is assumed additionally thatSis computable, then the problemparam-QrSsisC-hard.

5.

Thickness

In this section, we define a measure of first-order formulas that we callthickness, which we will show is the crucial measure that de-termines whether or not a graph-like set of sentences is tractable. From a high-level viewpoint, the measure is defined in the follow-ing way. We first define a notion oforganized formulaand show that each formula is logically equivalent to a positive combination of organized formulas; we then define a notion oflayered formula and show that each organized formula is logically equivalent to a layered formula. We then, for each layered formulaφ, define its thickness (denoted bythicklpφq), and then naturally extend this

definition to positive combinations of layered formulas, and hence to all formulas. A key property of thickness, which we prove (The-orem 5.9), is that there exists an algorithm that, given a formula

φ, outputs an equivalent formula that uses at mostthickpφqmany variables.

Definition 5.1. We define the set of organized formulas induc-tively, as follows.

• Each atom and each negated atom is an organized formula. • If each ofφ1, . . . , φnis an organized formula andvPfreepφ1qX

¨ ¨ ¨ Xfreepφnq, thenDvp Źn

i“1φiqand@vp Žn

i“1φiqare

orga-nized formulas.

Theorem 5.2.There exists an algorithmorg`that, given a formula

φas input, outputs a positive combinationorg`pφqof organized

formulas that is logically equivalent toφand that is in the syntactic closure ofφ.

The algorithm of this theorem is defined recursively with respect to formula structure.

In what follows, whenV is a set of variables andQ P tD,@u

is a quantifier, we will useQV as shorthand for Qv1. . . Qvn,

wherev1, . . . , vnis a list of the elements ofV. Our discussion will

always be independent of the particular ordering chosen. Relative to a hypergraphH and a subsetS ĎVpHq, we consider a set of edgeste1, . . . , ekuto beS-connectedif one has connectedness of

the graph with verticeste1, . . . , ekuand having an edge betweenei

andejif and only ifSXeiXej‰ H; we say that the hypergraph

His itselfS-connectedifEpHqisS-connected.

Definition 5.3. We define the sets ofD-layered formulas and of

@-layered formulasto be the variable-loose formulas that can be constructed inductively, as follows:

• Each atom and each negated atom is both anD-layered formula and a@-layered formula.

If each ofφ1, . . . , φnis a@-layered formula, and

X Ď freepφ1q Y ¨ ¨ ¨ Yfreepφnqis such that the hypergraph

tfreepφ1q, . . . ,freepφnquisX-connected, thenDXp

Źn

i“1φiq

is anD-layered formula.

• If each ofφ1, . . . , φnis anD-layered formula, and

Y Ď freepφ1q Y ¨ ¨ ¨ Yfreepφnq is such that the hypergraph

tfreepφ1q, . . . ,freepφnquisY-connected, then@YpŽni“1φiq

is a@-layered formula.

Theorem 5.4. There exists an algorithm that, given an organized formulaφ as input, outputs a layered formula that is logically equivalent toφ.

(7)

Theorem 5.5. There exists an algorithmlay`that, given a formula

φ as input, outputs a positive combinationlay`pφq of layered

formulas that is logically equivalent toφ.

Proof. Immediate from Theorems 5.2 and 5.4.

Definition 5.6. We define the following measures on layered for-mulas.

•Whenφis an atom or a negated atom, we definethicklpφq “

|freepφq|.

Suppose thatφis a layered formula of the formDUpŹni“1φiq

or@UpŽni“1φiq.

We define thelocal thicknessofφas

local-thicklpφq “1`twptfreepφiq |iPnu Y tfreepφquq

where the object to which the treewidth is applied is a hyper-graph specified by its edge set, which hyperhyper-graph has vertex set

Yni“1freepφiq.

We define thethicknessofφinductively as

thicklpφq “maxptlocal-thicklpφqu Y tthicklpφiq |iPnuq.

We define thequantified thicknessofφas

quant-thicklpφq “1`twptfreepφiq XU|iPnuq. Definition 5.7. Thethicknessof an arbitrary formulaφis defined as follows: letΨbe the set of layered formulas that are positively combined subformulas oflay`pφqsuch thatlay`pφqis a positive

combination overΨ; then,

thickpφq “max

ψPΨthicklpψq. Proposition 5.8. The functionthickp¨qis computable.

Proof. This follows from the computability of lay`pφq from φ

(Theorem 5.5) and the definition of thickness.

We indeed now demonstrate a principal property of thickness, namely, that this measure provides an upper bound on the number of variables needed to express a formula; this upper bound is effective in that there is an algorithm that computes an equivalent formula using a bounded number of variables. Whenkě1, let us say that a formulauseskmany variablesif the set containing all variables that occur in the formula has size less than or equal tok.

Theorem 5.9. There exists an algorithm that, given as input a formulaφ, outputs an equivalent formula that usesthickpφqmany variables.

Definition 5.10. Letφbe a formula of the formDVpŹni“1φiqor

@VpŽni“1φiq. Let us say that a paire“ ppv1, . . . , vmq, Eq

con-sisting of an orderingv1, . . . , vmof the elements in Ťn

i“1freepφiq

and a subsetE ĎKptv1, . . . , vmuqis anelimination ordering of

φif:

•the variables in freepφq occur first in the ordering, that is,

tv1, . . . , v|freepφq|u “freepφq; and,

•e is an elimination ordering of the hypergraphtfreepφqu Y tfreepφiq |iPnu.

The following lemma can be taken as a variation of a lemma of Kolaitis and Vardi [15, Lemma 5.2].

Lemma 5.11. There exists a polynomial-time algorithm that, given a formulaφof the form DVpŹi“n 1φiq or@Vp

Žn

i“1φiqand an

elimination orderingeofφ, outputs a formulaφ1that is logically

equivalent toφsuch thatwidthpφ1q ďmaxpt1`lower-degpequ Y

twidthpφiq |iPnuq.

Proof.(Theorem 5.9) By definition ofthickpφqand by the com-putability oflay`

pφqfromφ(Theorem 5.5), it suffices to prove that there is an algorithm that, given a layered formulaφ, returns an equivalent formula that usesthicklpφqmany variables.

Consider the following algorithmAdefined recursively on lay-ered formulas. Whenφis an atom or a negated atom,Apφq “ φ. Whenφis of the formDVpŹni“1φiqor@VpŽni“1φiq, the

algo-rithm proceeds as follows. SetHto be the hypergraph

tfreepφiq |iPnu Y tfreepφqu.

We have1`twpHq “ local-thicklpφq ď thicklpφq. By calling

the algorithm of Proposition 2.3 on the hypergraph H and the distinguished edgefreepφq, we can obtain an elimination ordering

eofφhaving1`lower-degpeq “1`twpHq ďthicklpφq. Let

φ1be the formula obtained fromφby replacing each formulaφ i

byApφiq; for eachi P n, we havewidthpφiq ď thicklpφiq. By

applying the algorithm of Lemma 5.11 toφ1 ande, we obtain a

formulaφ2havingwidthpφ2q ďthick

lpφq. By renaming variables

in φ2, we can obtain an equivalent formula where the number

of variables used is equal towidthpφ2q. The output Apφqof the algorithm is this equivalent formula.

6.

Graph-like queries

In this section, we state our main theorem and two corollaries thereof, which describe the tractable graph-like sentence sets. In the following two sections, we prove the hardness portion of the main theorem.

Definition 6.1. DefineMCto be the language of pairs

tpφ,Bq |B|ùφu

whereφdenotes a first-order sentence, andBdenotes a relational structure.

Theorem 6.2. (Main theorem) LetΦbe a graph-like set of sen-tences having bounded arity. IfΦhas bounded thickness, then the case problemMCrΦsis incase-FPT; otherwise, the case problem

MCrΦsiscase-Wr1s-hard orcase-co-Wr1s-hard.

We give a proof of this theorem that makes a single forward reference to the main theorem of Section 8.

Proof.SupposeΦhas thickness bounded above byk. DefineS1

to be the set of sentences having thickness less than or equal to

k. The set S1 is computable by Proposition 5.8. We have that

param-MCrS1sis inFPTvia the algorithm that, given an instance

pφ,Bq, first checks ifφPS1

, and if so, invokes Theorem 5.9 to ob-tainφ1

, and then performs the natural bottom-up, polynomial-time evaluation ofφ1

onB(`a la Vardi [17]). The case problemMCrΦs

slice reduces toMCrS1

svia the slice reduction ptps1, s1

q |s1

P

S1

u, π3q.

Suppose thatΦhas unbounded thickness. Theorem 8.1 yields that eithercase-CLIQUEorcase-co-CLIQUEslice reduces toMCrΦs. It then follows by definition that MCrΦs is case-Wr1s-hard or case-co-Wr1s-hard, since the problems CLIQUE and co-CLIQUE areWr1s-hard andco-Wr1s-hard, respectively.

We now provide two corollaries that describe the complexity of the problemsparam-MCrΦsaddressed by the main theorem; the first corollary assumes thatΦis computable, while the second corollary makes no computability assumption onΦ. Both of these corollaries follow directly from Theorem 6.2 via use of Proposi-tions 4.6 and 4.7.

(8)

param-MCrΦsis inFPT; otherwise, the problemparam-MCrΦsis not inFPT, unlessWr1sĎFPT.

Corollary 6.4. Let Φ be a graph-like set of sentences having bounded arity. If Φ has bounded thickness, then the problem

param-MCrΦsis innu-FPT; otherwise, the problemparam-MCrΦs

is not innu-FPT, unlessWr1sĎnu-FPT.

In the full version of this article, we provide a discussion of how the main theorem of the present paper can be used to readily derive the dichotomy theorem of graphical sets of quantified conjunctive queries [5]; a dual argument yields the corresponding theorem on graphical sets of quantified disjunctive queries. Note that it follows immediately from this discussion and [5, Example 3.5] that there exists a set of graph-like sentences having bounded arity that is tractable, but not contained in one of the tractable classes identified by Adler and Weyer [1].

Let us also note here that, as pointed out by Adler and Weyer, it is undecidable, given a first-order sentenceφand a valuekě1, whether or notφis logically equivalent to ak-variable sentence, and hence one cannot expect an algorithm that takes a first-order sentence and outputs an equivalent one that minimizes the number of variables. (This undecidability result holds even for positive first-order logic [3].)

7.

Accordion reductions

In this section, we introduce a notion that we callaccordion reduc-tion. WhenC Ď Σ˚

ˆΣ˚ is a set of string pairs andS

Ď Σ˚

is a set of strings, we useclosureCpSqto denote the intersection

of all setsT containingS and having the closure property that, if

pu, u1q PCandu1PT, thenuPT. When an accordion reduction

exists for such aC(with respect to a languageQ), the theorem of this section (Theorem 7.2) yields that the problemQrclosureCpSqs

slice reduces toQrSs. Hence, an accordion reduction is not itself a slice reduction, but its existence provides a sufficient condition for the existence of a class of slice reductions.

How is this section’s theorem proved? One component of an ac-cordion reduction is an FPT-computable mappingrthat, for each

pu, u1q PC, maps aQ-instancepu, yqto aQ-instancepu1, y1q.

In-tuitively, to give a slice reduction fromQrclosureCpSqstoQrSs,

one needs to reduce, for anys P S ands1 P closureCpSq,

in-stances of the formps1,¨qto instances of the formps,¨q. The

con-tainments1 P closureCpSq implies the existence of a sequence

s1, . . . , sk “ssuch that every pairpsi, si`1qis inC. This

natu-rally suggests applying the maprrepeatedly, but note that there is no constant bound on the lengthkof the sequence. Hence,rneeds to be sufficiently well-behaved so that, when composed with itself arbitrarily many times (in the described way), the end effect is that of an FPT-computable function that may serve as the map in the definition of slice reduction. (The author is mentally reminded of the closing of an accordion in thinking that this potentially long sequence of compositions yields a single well-behaved map.) To ensure this well-behavedness, we impose a condition that we call measure-linearity.

In the context of accordion reductions, ameasureis a mapping

m: Σ˚ˆΣ˚Ñ

Nsuch that there exist a functionf: Σ˚ÑNand

a polynomialp:NÑNwhereby, for all pairsps, yq PΣ˚ˆΣ˚,

it holds thatmps, yq ď |y| ďfpsqppmps, yqq.

Definition 7.1. LetQĎΣ˚

ˆΣ˚

be a language of pairs. With respect toQ, anaccordion reductionconsists of:

•a computably enumerable languageCĎΣ˚

ˆΣ˚,

•a measurem: Σ˚ˆΣ˚Ñ

N, and

•a mapping r : Σ˚

ˆΣ˚

ˆΣ˚

Ñ Σ˚ that has dom

prq “

CˆΣ˚, that is FPT-computable with respect to the

parameteri-zationpπ1, π2q, and that ismeasure-linearin that, for each pair

pu, u1q PC, there exists a constantBpu,u1qsuch that, for each

yPΣ˚

, it holds thatmpu1, r

pu, u1, y

qq ďBpu,u1qmpu, yq, such that the following condition holds:

• (correctness)for eachpu, u1q PC, it holds (for eachyP Σ˚) that

pu, yq PQô pu1, rpu, u1, yqq PQ.

Theorem 7.2. Suppose that QrSs is a case problem, and that

pC, m, rqis an accordion reduction with respect toQ. Then, the case problemQrclosureCpSqsslice reduces to the case problem

QrSs.

8.

Hardness

In this section, we establish the main intractability result of the paper, namely, that the case problemMCrΦsis hard whenΦis graph-like and has unbounded thickness.

Theorem 8.1. Suppose that Φ is a set of graph-like sentences of bounded arity such thatthickpΦq is unbounded. Then, either case-CLIQUEorcase-co-CLIQUEslice reduces toMCrΦs.

Proof.Immediate from Lemmas 8.2 and 8.3, and Theorem 8.5.

This intractability result is obtained by composing three slice reductions. Define a formula to be friendly if it is loose, posi-tive, and layered. We first show (Lemma 8.2) that there exists a set of friendly sentencesΨ, with thicklpΨq unbounded, such

thatMCrΨsslice reduces toMCrΦs. We next show (Lemma 8.3) that a multi-sorted version fullpΨq of Ψ has the property that

MCsrfullpΨqs slice reduces to MCrΨs; here, MCs denotes the

multi-sorted generalization ofMC. Finally, we directly slice reduce eithercase-CLIQUEorcase-co-CLIQUEtoMCsrΨs(Theorem 8.5);

this third reduction is obtained via an accordion reduction.

Lemma 8.2. Suppose thatΦis a set of graph-like sentences of bounded arity such thatthickpΦqis unbounded. There exists a set of friendly sentencesΨsuch thatMCrΨsslice reduces toMCrΦs

and such thatthicklpΨqis unbounded.

In what follows, we will work with multi-sorted relational first-order logic, formalized as follows. (For differentiation, we will refer to formulas in the usual first-order logic considered thus far asone-sorted.) Asignatureis a pairpσ,SqwhereSis a set ofsorts andσis a set of relation symbols; each relation symbolR P σ

has an associated arityarpRq which is an element of S˚

. In a formula over signaturepσ,Sq, each variablevhas associated with it a sortspvqfromS; an atom is a formulaRpv1, . . . , vkqwhere

R P σandspv1q. . . spvkq “ arpRq. A structureBon signature

pσ,Sqconsists of anS-sorted familytBs|s PSuof sets called

theuniverseofB, and for each symbolR P σ, an interpretation

RBĎBarpRq, where for a wordw“w1. . . wkPS˚, we useBw

to denote the productBw1 ˆ ¨ ¨ ¨ ˆBwk. We useMCs to denote

the multi-sorted version ofMC, that is, it is the language of pairs

pφ,Bqwhereφis a sentence andBis a structure both having the same signaturepσ,Sq, andB|ùφ.

Suppose thatφis a multi-sorted friendly formula on signature

pσ,Sq, and let V be the set of variables occurring inφ; we say thatφisfully-sortedifV Ď S and for eachv P V, the sort of

visvitself (that is,spvq “v). Whenψis a one-sorted friendly formula, andV is the set of variables that occur in ψ, we use

(9)

Lemma 8.3. LetΨbe a set of one-sorted friendly sentences. The setfullpΨqof fully-sorted friendly sentences has the property that

MCsrfullpΨqsslice reduces toMCrΨs.

Proof. We give a slice reduction. DefineU to be the set that con-tains each pair of the formpfullpψq, ψq. Suppose that ψand B

are over signaturepσ,Sq. Definerpfullpψq, ψ,Bq “ B1, where

B1 is defined as follows. Let B1 be a set whose cardinality is maxsPS|Bs|. For each sortsPS, fix a mapfs:B1ÑBsthat is

surjective. For each relation symbolRPσof aritys1. . . sk, define

RB1 “ tpb1

1, . . . , b1kq P B 1k

| pfs1pb11q, . . . , fskpb 1 kqq PR

B

u. It is straightforward to prove by induction that, for all subformulasφ

ofψ, and each assignmentgfrom the set of variables toB1, that

B1, gφif and only ifB, f˝s

g|ùfullpφq. Here,f˝sgdenotes the mapping that sends each variablevtofspvqpgpvqqand we view

fullpφqas a formula over the signaturepσ,Sqofψ. The correctness of the reduction follows.

In the remainder of this section, we assume that all formulas and structures under discussion are multi-sorted.

Let us say that a friendly formula is asimple formulaif it is of the formDXpŹni“1αiqor of the form@YpŽni“1αiqwhere each

αiis an atom. Whenφis a simple formula where the variablesV

are those that are quantified initially, we say thatψisa sentence based onφifψis a simple sentence derivable fromφby replacing each atomRpw1, . . . , wkqwith an atom whose variables are the

elements intw1, . . . , wku XV.

We now present an accordion reduction that will be used to derive our hardness result. WhenΨis a set of friendly sentences, this accordion reduction will allow a simple subformula φ1

“ DV χto simulate a disjunction of atoms onfreepφ1

q, and likewise for a simple subformulaφ1

“ @V χto simulate a corresponding conjunction; this is made precise as follows. The setCis defined to contain a pair pψ, φq of friendly sentences if there exists a simple subformulaφ1

“QV χofφsuch that one of the following conditions holds:

(1)ψis a sentence based onφ1.

(2)Q“ Dandψis a friendly sentence obtained fromφby replac-ingφ1

withŽmi“1Eipvi1, vi2q, where the tuplespvi1, vi2qare

such thattv11, v12u, . . . ,tvm1, vm2uis a list of the elements in

Kpfreepφ1

qqand theEiare relation symbols (each of which is

fresh in that it does not appear elsewhere inψ).

(3)Q “ @ and ψ is a friendly sentence obtained from φ by replacingφ1withŹm

i“1Eipvi1, vi2qwhere the tuplespvi1, vi2q

and the symbolsEiare as described in the previous case.

Theorem 8.4. LetM be the measure such thatMpφ,Bqis equal to maxsPS|Bs| when B is a multi-sorted structure defined on

the signature pσ,Sq of φ, and such thatMpφ,Bq is equal to 0

otherwise. There exists a mappingr: Σ˚

ˆΣ˚

ˆΣ˚

ÑΣ˚such

that the triplepC, M, rqis an accordion reduction with respect to

MCs. (Here,Cis the set defined above.)

Proof. Supposepψ, φ,Aqis a triple withpψ, φq PCand whereA

is a structure over the signature ofψ. We definerpψ, φ,Aqto be the structureB, defined as follows.

It is straightforward to treat the case where there exists a simple subformulaφ1

ofφsuch thatψis the sentence based onφ1

(here, we omit discussion of this case).

In the remainder of this proof, we consider the case that there exist a simple subformulaφ1

“ DV χofφsuch thatψis a friendly sentence obtained from φby replacingφ1 with a disjunctionψ1

as in the definition ofC. (Dual to this case is the remaining case whereφ1“ @V χandψis obtained fromφby replacingφ1with a

conjunction.) We will denote the disjunctionψ1byE1pw11, w12q_

¨ ¨ ¨ _Empwm1, wm2q. We define the universe ofBas follows.

• For each sortuofA, we defineBu“Au.

• For each v P V, define Bv “ tpE`, u, aq | ` P m, u P

tw`1, w`2u, aPAuu

Asmď |V|2and a variableuappearing as the second coordinate in an element of a setBvmust be an element offreepφ1q, We have

Mpφ,Bq ď |V|2¨ |freepφ1

q| ¨Mpψ,Aq; this confirms measure-linearity ofM, since|V|and|freepφ1

q|are functions of the pair

pψ, φq.

For each atom Rpu1, . . . , ukq in φthat occurs outside of φ1

(equivalently, that also appears inψ), defineRB“RA.

For each atomRpu1, . . . , ukqthat occurs inφ1, defineRBto

contain a tuplepb1, . . . , bkq PBu1...ukif and only if the following

two conditions hold:

• For alli, jPk, ifuiPV andujPV, thenbi“bj.

• For all i, j P k, ifui P V, bi “ pE`, u, aq, and uj R V

(equivalently,ujPfreepφ1q), then

uj“uimpliesbj“a, and

tuj, uu “ tw`1, w`2u implies A,tpu, aq,puj, bjqu |ù

E`pw`1, w`2q. (Here, we use a set of pairs to denote a partial

map.)

To verify thatA|ùψif and only ifB|ùφ, it suffices to verify that, for any assignmentf defined onfreepφ1q “freepψ1qtaking

each variableuto an element ofAu, that

A, f|ùψ1ôB, f|ùφ1.

pñq: There exists` P m such thatA, f |ù E`pw`1, w`2q.

Pickwto be a variable intw`1, w`2u, and consider the extension

f` of f that sends each variable inV to

pE`, w, fpwqq. It is

straightforward to verify thatB, f` satisfies the conjunction of

φ1; we do so as follows. Suppose thatRpu

1, . . . , ukqis an atom

in this conjunction. We claim thatpf`pu1q, . . . , f`pukqq PRB.

This tuple clearly satisfies the first condition in the definition of

RB; to check the second condition, suppose thati, jPkare such thatui P V anduj R V. We havef`puiq “ pE`, w, fpwqq. If

uj “w, then indeedf`pujq “ fpwq. Iftuj, wu “ tw`1, w`2u,

thentpw, fpwqq,puj, f`pujqquis equal tof æ tw`1, w`2u, and

we haveA, fæ tw`1, w`2u |ùE`pw`1, w`2qby our choice of`.

pðq: Suppose thatB, f` satisfies the conjunction of φ1. By the definition ofB and since φ1 is a layered formula,f` maps

all variables inV to the same valuepE`, u, aq. There exists an

atomRpu1, . . . , ukqinφ1such that one of its variablesujhas the

property thattuj, uu “ tw`1, w`2u. It follows, from the definition

ofRB, thatA, f`æ tu, u

ju |ùE`pw`1, w`2q.

Theorem 8.5. LetΨbe a set of fully-sorted, friendly sentences such thatthicklpΨq is unbounded. Then, eithercase-CLIQUE or

case-co-CLIQUEslice reduces toMCsrΨs.

Suppose that ψis a simple friendly formula that occurs as a subformula of a formula φ. We say that ψ is an existential k -cliqueif it is of the formDXpŹni“1αiqand there exists a setV

of variables, with|V| ěk, that are existentially quantified (inφ) such that for each settv, v1

u PKpVq, there exists an atomαiwith

tv, v1u Ďfreepα

iq. We define auniversalk-cliquedually.

Proof.Let C be as defined above in the discussion. By appeal to Theorem 8.4, it suffices to prove that eithercase-CLIQUE or case-co-CLIQUEslice reduces toMCsrclosureCpΨqs. WhenΘis

(10)

quant-thicklpφq ` |freepφq| (this is since the hypergraph from

whichquant-thicklpφq is defined is the hypergraph from which

local-thicklpφq is defined, but with the vertices in freepφq

re-moved). By the definition ofthicklp¨q, the quantitylocal-thicklpφq

over Ψ-relevant subformulas φ is unbounded. Thus, over Ψ -relevant subformulasφ, either the quantityquant-thicklpφqor the

quantity|freepφq|is unbounded. We may therefore consider two cases.

Assume that|freepφq|is unbounded overΨ-relevant subformu-lasφ. By conditions (2) and (3) in the definition ofC, we obtain that|freepφq|is unbounded over simpleclosureCpΨq-relevant

sub-formulasφ. We assume that|freepφq|is unbounded over such sim-ple subformulasφthat use existential quantification (if not, then

|freepφq|is unbounded over such simple subformulasφ that use universal quantification, and the argumentation is dual). We now consider two cases. If the number of universally quantified vari-ables infreepφqis unbounded over such subformulasφ, then by condition (2) of the definition ofCapplied to each such subfor-mula (and the sentence in which it appears), we obtain that, for eachkě1, the setclosureCpΨqcontains a sentence that contains

a universalk-clique. Otherwise, the number of existentially quan-tified variables infreepφqis unbounded over such subformulasφ; in this case, by an application of condition (3) followed by an ap-plication of condition (2) (again, to each such subformulaφand the sentence in which it appears), we obtain that, for eachk ě1, the setclosureCpΨqcontains a sentence that contains an

existen-tial k-clique. In this latter case, let us explain how to exhibit a slice reduction from case-CLIQUE to MCsrclosureCpΨqs (in the

former case, one dually obtains a reduction fromcase-co-CLIQUE toMCsrclosureCpΨqs). We defineU to be the set of pairspk, θq

such thatk ě 1andθ is a sentence that contains an existential

k-clique as a subformula. Let us definerpk, θ,pV, Eqqto be the structureBdescribed as follows. LetWbe the set of variables that witnesses the existentialk-clique. For each relation symbolRof an atom inθthat does not witness the existentialk-clique, we may set

RBto either

HorBr(here,ris the arity ofR) in such a way that

B|ùθif and only ifB|ù DWp^jβjq, where theβjare the atoms

witnessing the existentialk-clique. By defining, for each remain-ing relation symbolF (that is, for each relation symbolF of an atomβj), the relationFBto beE, we obtain thatpV, Eqcontains

ak-clique if and only ifB|ùθ.

Now assume thatquant-thicklpφqis unbounded overΨ-relevant

subformulas φ. By conditions (2) and (3) in the definition of

C, we obtain that quant-thicklpφq is unbounded over simple

closureCpΨq-relevant subformulas φ. By considering the

sen-tences based on these subformulas (and by invoking condition (1) in the definition of C), we obtain that closureCpΨq

con-tains simple sentences DXpŹαiq or contains simple sentences

DYpŽαiqsuch that, over these sentences,quant-thicklp¨qis

un-bounded. In the former case, the intractability result of Grohe, Schwentick and Segoufin [13] directly yields a slice reduction fromcase-CLIQUEtoMCsrclosureCpΨqswhere the setUcontains

a pairpk, θqwhenk ě 1andθ is a sentenceDXpŹαiqwhose

corresponding graph admits ak-by-k grid as a minor. The latter case is dual (one obtains a slice reduction fromcase-co-CLIQUEto

MCsrclosureCpΨqs).

Acknowledgments

The author was supported by the Spanish Project FORMAL-ISM (TIN2007-66523), by the Basque Government Project S-PE12UN050(SAI12/219), and by the University of the Basque Country under grant UFI11/45. The author thanks Montserrat Hermo and Simone Bova for useful comments.

References

[1] I. Adler and M. Weyer. Tree-width for first order formulae. Logical Methods in Computer Science, 8(1), 2012.

[2] H. L. Bodlaender. A partial k-arboretum of graphs with bounded treewidth.Theoretical Computer Science, 209:1–45, 1998.

[3] S. Bova and H. Chen. The complexity of width minimization for existential positive queries. InICDT, pages 235–244, 2014. [4] H. Chen. On the complexity of existential positive queries. ACM

Trans. Comput. Log., 15(1), 2014.

[5] H. Chen and V. Dalmau. Decomposing quantified conjunctive (or disjunctive) formulas. InLICS, 2012.

[6] H. Chen and M. Grohe. Constraint satisfaction with succinctly speci-fied relations. Journal of Computer and System Sciences, 76(8):847– 860, 2010.

[7] H. Chen and D. Marx. Block-sorted quantified conjunctive queries. In

ICALP, 2013.

[8] H. Chen and M. M¨uller. The fine classification of conjunctive queries and parameterized logarithmic space complexity. InPODS, 2013. [9] Y. Chen, M. Thurley, and M. Weyer. Understanding the complexity

of induced subgraph isomorphisms. InICALP 2008, pages 587–596, 2008.

[10] A. Durand and S. Mengel. Structural tractability of counting of solu-tions to conjunctive queries. InProceedings of the 16th International Conference on Database Theory (ICDT 2013), 2013.

[11] J. Flum and M. Grohe.Parameterized Complexity Theory. Springer, 2006.

[12] M. Grohe. The complexity of homomorphism and constraint satisfac-tion problems seen from the other side. Journal of the ACM, 54(1), 2007.

[13] M. Grohe, T. Schwentick, and L. Segoufin. When is the evaluation of conjunctive queries tractable? InSTOC 2001, 2001.

[14] P. Jonsson, V. Lagerkvist, and G. Nordh. Blowing holes in various aspects of computational problems, with applications to constraint satisfaction. InCP, pages 398–414, 2013.

[15] P. Kolaitis and M. Vardi. Conjunctive-Query Containment and Con-straint Satisfaction. Journal of Computer and System Sciences, 61: 302–332, 2000.

[16] C. Papadimitriou and M. Yannakakis. On the Complexity of Database Queries. Journal of Computer and System Sciences, 58(3):407–427, 1999.

[17] M. Y. Vardi. On the complexity of bounded-variable queries. In

(11)

Proof of Proposition 3.11

Proof. For (1), one can use the fact that f1pkqp1pnq ` ¨ ¨ ¨ `

fmpkqpmpnqis bounded above bypf1pkq ` ¨ ¨ ¨ `fmpkqqpp1pnq `

¨ ¨ ¨ `pmpnqq.

For (2), it suffices to observe that the productpf1pkqp1pnqq ¨ ¨ ¨ pfmpkqpmpnqq

can be grouped aspf1pkq ¨ ¨ ¨fmpkqqpp1pnq ¨ ¨ ¨pmpnqq.

For (3), it suffices to observe that qpfpkqppnqq is bounded above byqpfpkqqqpppnqq; note thatqppqis the composition of two polynomials, and hence itself a polynomial.

Proof of Theorem 4.4

Proof. LetpU1, r1qbe a slice reduction fromQ1rS1stoQ2rS2s,

and letpU2, r2qbe a slice reduction fromQ2rS2stoQ3rS3s. Define

Uto be the set

tpt1, t3q | there existst2PΣ˚such that

pt1, t2q PU1andpt2, t3q PU2u.

It is straightforward to verify thatUis computably enumerable and that there exists an algorithmAU that, given a pairpt1, t3q PU,

outputs a valuet2 PΣ˚such thatpt1, t2q PU1andpt2, t3q PU2.

Definerto be a partial function such that, whenpt1, t3q PU, for

eachyPΣ˚it holds thatr

pt1, t3, yq “r2pt2, t3, r1ppt1, t2q, yqq;

here, we uset2to denoteAUpt1, t3q.

We verify that pU, rq is a slice reduction from Q1rS1s to

Q3rS3s. For each t1 P S1, there exists t2 P S2 such that

pt1, t2q P U1; and, for eacht2 P S2, there existst3 P S3 such

thatpt2, t3q P U2. Hence, for eacht1 P S1, there existst3 P S3

such thatpt1, t3q PU. This confirms the coverage condition; we

now check correctness. Suppose thatpt1, t3q PU, and letyPΣ˚.

Sety1r

1pt1, t2, yq. We have that

pt1, yq PQ1 ô pt2, y1q PQ2

and

pt2, y1q PQ2 ô pt3, r2pt2, t3, y1qq PQ3.

It follows that

pt1, yq PQ1ô pt3, rpt1, t3, yqq PQ3.

It remains to verify that the functionris FPT-computable with respect to the parameterizationpπ1, π2q. We verify this by

con-sidering the natural algorithm at this point, namely, the follow-ing algorithm: given pt1, t3, yq, invoke AU on pt1, t3q and, if

this computation halts, sett2 to the result; then, computey1 “

r1pt1, t2, yq using the algorithm witnessing FPT-computability,

and finally, computer2pt2, t3, y1qusing the algorithm witnessing

FPT-computability. On an inputx “ pt1, t3, yq P U ˆΣ˚, the

running time of this algorithm can be upper bounded by

Fpt1, t3q `f1pt1, t2qp1p|pt1, t2, yq|q `f2pt2, t3qp2p|pt2, t3, y1q|q

whereFpt1, t3qdenotes the running time ofAUon inputpt1, t3q;

andpf1, p1qandpf2, p2qwitness the FPT-computability ofr1and

r2, respectively; we here neglect additive constants. We need to

show that this running time is degree-bounded with respect to

pπ1, π2q; for the remainder of the proof, let us simply use

degree-boundedto mean degree-bounded with respect to this parameteri-zation. We view the various quantities under discussion as functions ofx“ pt1, t3, yq. Sincef1pt1, t2qandf2pt2, t3qcan be viewed as

functions ofpt1, t3q, by Proposition 3.11 (1, 2), it suffices to verify

that each ofp1p|pt1, t2, yq|q,p2p|pt2, t3, y1q|qis degree-bounded.

By appeal to Proposition 3.11(3), to verify thatp1p|pt1, t2, yq|q

is degree-bounded, it suffices to observe that each of |t1|, |t2|,

|y| is degree-bounded. Similarly, to verify that p2p|pt2, t3, y1q|q

is degree-bounded, it suffices to verify that each of|t2|,|t3|, and

|y1| are degree-bounded; this is clear for |t

2| and |t3|, and the

size |y1| is bounded above by f1pt1, t2qp1p|pt1, t2, yq|q, which

is degree-bounded since we just verified thatp1p|pt1, t2, yq|qis

degree-bounded.

Proof of Theorem 4.5

Proof.LetpU, rq be the slice reduction. First, consider the case where bothS and S1 are computable. Since S and S1 are both

computable andU is computably enumerable, there exists a com-putable functionf: Σ˚

ÑΣ˚such that, for alls

PS, it holds that

ps, fpsqq P U. We define the reductiongso thatgps, xqis equal topfpsq, rps, fpsq, xqqfor allps, xq PSˆΣ˚, and is otherwise

defined to be a fixed string outside ofQ1 (such a string exists by

Assumption 3.1). The mappingghas a natural algorithm, namely, givenps, xq, check ifsPS(via an algorithm forS); ifsRS, return a fixed string outside ofQ1, otherwise, compute the value ofgusing

an algorithm forfand an algorithm witnessing FPT-computability ofr. Suppose thatsPS; sinceris FPT-computable with respect to

pπ1, π2q, we have that the valuerps, fpsq, xq, viewed as a function

ofps, xq, is FPT-computable with respect toπ1; the valuefpsqis,

as well. Thus, the mappinggis FPT-computable with respect toπ1.

In the case that no computability assumptions are placed onS

andS1

, there exists a functionf : Σ˚

Ñ Σ˚

such that, for all

s P S, it holds thatps, fpsqq P U. The reduction gdefined as above is readily verified to be nu-FPT-computable with respect to

π1, via an ensemble of algorithms whereAscontains as hard-coded

information whether or notsPSand (if so) the value offpsq.

Proof of Proposition 4.6

Proof.There exists a case problemQ1rS1ssatisfying the conditions

given in the definition of case-C. SinceQrSs slice reduces to

Q1rS1s, by Theorem 4.5, it holds thatparam-QrSsnu-FPT-reduces

to param-Q1rS1s. Since param-Q1rS1s is in C, it follows that

param-QrSsis in nu-C. If in addition it is assumed that S is computable, by Theorem 4.5, we obtain thatparam-QrSs FPT-reduces toparam-Q1rS1s, and hence thatparam-QrSsis inC(by appeal to Assumption 3.6).

Proof of Proposition 4.7

Proof.There exists a case problemQ´rS´ssatisfying the

condi-tions given in the definition ofcase-C-hard. SinceQ´

rS´

sslice reduces toQrSs, by Theorem 4.5, it holds thatparam-Q´rS´s

nu-FPT-reduces toparam-QrSs. By theC-hardness ofparam-Q´

rS´

s, each problem inCFPT-reduces toparam-Q´rS´s, and hence, by

Proposition 3.7, each problem inCnu-FPT-reduces toparam-QrSs. If in addition it is assumed that S is computable, by Theo-rem 4.5, the problemparam-Q´rS´sFPT-reduces to the problem

param-QrSs; from the C-hardness ofparam-Q´

rS´

sand from Proposition 3.7, we obtain thatparam-QrSsisC-hard.

Proof of Theorem 5.2

Proof.To give the algorithm, we first recursively define a proce-dure that, given a formulaφwhere negations appear only in front of atoms, outputs both a CNF of organized formulas and a DNF of organized formulas, each of which is equivalent toφand in the syn-tactic closure ofφ. We will make tacit use of transformationpαq. Observe that it suffices to show that either such a CNF or such a DNF can be computed, since one can convert between such a CNF and such a DNF by use of transformationpδq. The procedure is defined as follows.

• Whenφis an atom or a negated atom, the procedure returnsφ. • Whenφhas the formψ1^ψ2, the procedure computes a CNF

References

Related documents

I therefor expect the public servants in Anglo-Saxon and Nordic countries to show higher levels of openness to experience, and lower levels of conscientiousness than in Germanic

High-frequency sampling campaigns and analyses were conducted in this study to investigate temporal variations of river water chemistry and the impacts of climate variability on CO

The purpose of this study is to investigate the approaches adopted by primary school headmasters, and their levels of ICT adoption to promote the use of ICT in learning, and how

1 Spatial planning of public charging points using multi-dimensional analysis of early adopters of electric vehicles for a city region..

SVM classifiers were trained to discriminate bacterial protective antigens (BPAs) and non-BPAs in BPAD200+N+B+AF and receiver operator characteristic (ROC) curves generated from

Sedangkan robot yang menerapkan fuzzy logic untuk wall tracking mencatatkan waktu yang lebih kecil, pada sampling jarang waktu rata-rata robot untuk memadamkan api

While the duration dependence of ice cream purchases implied by Figures 1 and 2 can be consistent with variety-seeking behaviour induced by a diminishing marginal utility, it can

The percentage of runs that find a global optimum % success, is lower the larger the number of cities for all instance types except the uniform random ‘E’ instances, where the