=Paper=
{{Paper
|id=Vol-3203/paper6
|storemode=property
|title=Dyadic Existential Rules
|pdfUrl=https://ceur-ws.org/Vol-3203/paper6.pdf
|volume=Vol-3203
|authors=Georg Gottlob,Marco Manna,Cinzia Marte
|dblpUrl=https://dblp.org/rec/conf/datalog/GottlobMM22
}}
==Dyadic Existential Rules==
Dyadic Existential Rules Georg Gottlob1,2,โ , Marco Manna3,โ and Cinzia Marte3,*,โ 1 Department of Computer Science, University of Oxford, United Kingdom 2 Faculty of Informatics, TU Wien, Austria 3 Department of Mathematics and Computer Science, University of Calabria, Italy Abstract In the field of ontology-based query answering, existential rules (a.k.a. tuple-generating dependencies) form an expressive Datalog-based language to specify implicit knowledge. The presence of existential quantification in rule-heads, however, makes the main reasoning tasks undecidable. To overcome this limitation, in the last two decades, a number of classes of existential rules guaranteeing the decidability of query answering have been proposed. Unfortunately, such classes are typically based on different syntactic conditions imposing the development of different ad hoc reasoners. This paper introduces a novel general condition that allows to define, systematically, from any decidable class ๐ถ of existential rules, a new class called Dyadic-๐ถ that enjoys the following properties: (๐) it is decidable; (๐๐) it generalizes ๐ถ; (๐๐๐) it keeps the same data complexity as ๐ถ; and (๐๐ฃ) it can exploit any reasoner for query answering over ๐ถ. Additionally, the paper proposes a simple and elegant syntactic condition that gives rise to the class Ward+ generalizing the well-known decidable classes Shy and Ward, and being included in Dyadic-Shy. Keywords Existential rules, Datalog, ontology-based query answering, tuple-generating dependencies, computa- tional complexity. 1. Introduction In ontology-based query answering, a conjunctive query is typically evaluated over a logical theory consisting of a relational database paired with an ontology. Description Logics [1] and Existential Rules (a.k.a. tuple generating dependencies) [2] are the main languages used to specify ontologies. In particular, the latter are essentially classical datalog rules extended with existential quantified variables in rule-heads. The presence of existential quantification in the head of rules, however, makes query answering undecidable in the general case. To overcome this limitation, in the last two decades, a number of classes of existential rules โbased on both semantic and syntactic conditionsโ that guarantee the decidability of query answering have been proposed. Concerning the semantic conditions, we recall finite expansions sets, finite treewidth sets, finite unification sets, and strongly parsimonious sets [3, 2, 4]. Each of these classes Datalog 2.0 2022: 4th International Workshop on the Resurgence of Datalog in Academia and Industry, September 05, 2022, Genova - Nervi, Italy * Corresponding author. โ These authors contributed equally. $ georg.gottlob@cs.ox.ac.uk (G. Gottlob); manna@mat.unical.it (M. Manna); marte@mat.unical.it (C. Marte) 0000-0002-2353-5230 (G. Gottlob); 0000-0003-3323-9328 (M. Manna); 0000-0003-3920-8186 (C. Marte) ยฉ 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) 83 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 Main syntactic classes Data Complexity Combined Complexity Weakly-(Fr)-Guarded [5, 6] ExpTime-complete 2ExpTime-complete (Fr)-Guarded [6] PTime-complete 2ExpTime-complete Weakly-Acyclic [7] PTime-complete 2ExpTime-complete Jointly-Acyclic [8] PTime-complete 2ExpTime-complete Datalog [9] PTime-complete ExpTime-complete Shy, Ward [4, 10] PTime-complete ExpTime-complete Protected [11] PTime-complete ExpTime-complete Sticky-(Join) [12, 13] AC0 ExpTime-complete Linear, Joinless [14, 15] AC0 PSpace-complete Inclusion-Dependencies [16] AC0 PSpace-complete Table 1 Computational complexity of query answering over the main concrete classes of existential rules. encompasses a number of concrete classes based on syntactic conditions. Table 1 summarizes them and their computational complexity with respect to query answering. Unfortunately, the fact that such classes are typically based on different syntactic conditions imposes the development of different ad hoc reasoners. This paper introduces a novel general condition that allows to define, systematically, from any class ๐ of existential rules for which conjunctive query answering is decidable, a new class called Dyadic-๐ that enjoys the following properties: (๐) it is decidable; (๐๐) it generalizes ๐; (๐๐๐) it keeps the same data complexity as ๐; and (๐๐ฃ) it can exploit any reasoner for query answering over ๐. The key idea behind this new class is the existence of a dyadic decomposition of an ontology ฮฃ consisting of a pair (ฮฃHG , ฮฃ๐ ) such that: (๐) ฮฃHG โช ฮฃ๐ is equivalent to ฮฃ with respect to query answering; (๐๐) ฮฃ๐ โ ๐; and (๐๐๐) ฮฃHG is a set of โhead-groundโ rules, which intuitively are rules generating only ground atoms when paired with ฮฃ๐ . In analogy with the existing semantic classes, the union of all Dyadic-๐ classes are called dyadic decomposable sets. Finally, the paper proposes a simple and elegant syntactic condition that gives rise to the concrete class Ward+ generalizing the well-known decidable classes Shy and Ward, and being included in Dyadic-Shy. 2. Preliminaries 2.1. Basics on Relational Structures Fix three pairwise disjoint lexicographically enumerable infinite sets ฮ๐ถ of constants, ฮ๐ of nulls (๐, ๐0 , ๐1 , ...), and ฮ๐ of variables (๐ฅ, ๐ฆ, ๐ง, and variations thereof). Their union is denoted by ฮ and its elements are called terms. For any integer ๐ โฅ 0, we may write [๐] for the set {1, ..., ๐}; in particular, as usual, if ๐ = 0, then [๐] = โ . An atom ๐ is an expression of the form ๐ (t), where ๐ = pred(๐) is a (relational) predicate, t = ๐ก1 , ..., ๐ก๐ is a tuple of terms ๐ = arity(๐) = arity(๐ ) โฅ 0 is the arity of both ๐ and ๐ , and ๐[๐] denotes the ๐-th term t[๐] = ๐ก๐ of ๐, for each ๐ โ [๐]. In particular, if ๐ = 0, then t is the empty tuple and ๐ = ๐ (). By const(๐) (resp., vars(๐)) we denote the set of constants (resp., variables) occurring in ๐. A fact is an atom that contains only constants. A (relational) schema S is a finite set of predicates, each with its own arity. The set of positions of S, denoted pos(S), is defined 84 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 as {๐ [๐] | ๐ โ S โง 1 โค ๐ โค arity(๐ )}, where each ๐ [๐] denotes the ๐-th position of ๐ . A (relational) structure over S is any (possibly infinite) set of atoms using only predicates from S. The domain of a structure ๐, denoted dom(๐), is the set of all the terms occurring in ๐. An instance over S is any structure ๐ผ over S such that dom(๐ผ) โ ฮ๐ถ โช ฮ๐ . A database over S is any finite instance over S containing only facts. Consider a map ๐ : ๐1 โ ๐2 where ๐1 โ ฮ and ๐2 โ ฮ. Given a set ๐ of terms, the restriction of ๐ with respect to ๐ is the map ๐|๐ = {๐ก โฆโ ๐(๐ก) : ๐ก โ ๐1 โฉ ๐ }. An extension of ๐ is any map ๐โฒ between terms, denoted by ๐โฒ โ ๐, such that ๐โฒ |๐1 = ๐. A homomorphism from a structure ๐1 to a structure ๐2 is any map โ : dom(๐1 ) โ dom(๐2 ) such that both the following hold: (๐) if ๐ก โ ฮ๐ถ โฉ dom(๐1 ), then โ(๐ก) = ๐ก; and (๐๐) โ(๐1 ) = {๐ (โ(t)) : ๐ (t) โ ๐1 } โ ๐2 . 2.2. Conjunctive Queries A conjunctive query (CQ) ๐ over a schema S is a (first-order) formula of the form โจxโฉ โ โ y ฮฆ(x, y), (1) where x and y are tuples (often seen as sets) of variables such that x โฉ y = โ , and ฮฆ(x, y) is a conjunction (often seen as a set) of atoms using only predicates from S. In particular, (๐) dom(ฮฆ) โ x โช y โช ฮ๐ถ , (๐๐) ๐ง โ x โช y implies that ๐ง occurs in some atom of ฮฆ, (๐๐๐) x are the output variables of ๐, and (๐๐ฃ) y are the existential variables of ๐. To highlight the output variables, we may write ๐(x) instead of ๐. The evaluation of ๐ over an instance ๐ผ is the set ๐(๐ผ) of every tuple t of constants admitting a homomorphism โt from ฮฆ(x, y) to ๐ผ such that โt (x) = t. A Boolean conjunctive query (BCQ) is a CQ with no output variable, namely an expression of the form โจโฉ โ โ y ฮฆ(y). An instance ๐ผ satisfies a BCQ ๐, denoted ๐ผ |= ๐, if ๐(๐ผ) is nonempty, namely ๐(๐ผ) contains only the empty tuple โจโฉ. 2.3. Tuple-Generating Dependencies A tuple-generating dependency (TGD) ๐ โalso known as (existential) ruleโ over a schema S is a (first-order) formula of the form ฮฆ(x, y) โ โ z ฮจ(x, z), (2) where x, y, and z are pairwise disjoint tuples of variables, and both ฮฆ(x, y) and ฮจ(x, z) are conjunctions (often seen as a sets) of atoms using only predicates from S. In particular, (๐) ฮฆ (resp., ฮจ) contains all and only the variables in x โช y (resp., x โช z), (๐๐) constants (but not nulls) may also occur in ๐, (๐๐๐) x โช y are the universal variables of ๐, (๐๐ฃ) z are the existential variables of ๐ denoted by varโ (๐), and (๐ฃ) x are the frontier variables of ๐ denoted by front(๐). In particular, if varโ (๐) = โ and |head(๐)| = 1, then ๐ is called datalog rule. We refer to body(๐) = ฮฆ and head(๐) = ฮจ as the body and head of ๐, respectively. With hp(๐) (resp., bp(๐)) we denote the set of predicates in head(๐) (resp., body(๐)). An ontology ฮฃ is a set of rules. Without loss of generality, we assume that vars(๐1 ) โฉ vars(๐2 ) = โ , for each pair ๐1 , ๐2 of rules in ฮฃ. Operators varโ , hp, and bp (defined for rules) naturally extend on ontologies. A class ๐ of ontologies is any (typically infinite) set of TGDs fulfilling some syntactic or semantic 85 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 conditions (see, for example, the classes shown in Table 1, some of which will be formally defined in the subsequent sections). In particular, Datalog is the class of ontologies containing only datalog rules. The schema of ฮฃ, denoted sch(ฮฃ), is the subset of S containing all and only the predicates occurring in ฮฃ, whereas arity(ฮฃ) = max๐ โsch(ฮฃ) arity(๐ ). For simplicity of exposition, we write pos(ฮฃ) instead of pos(sch(ฮฃ)). An instance ๐ผ satisfies a rule ๐ as in Equation 2, written ๐ผ |= ๐, if the existence of a homomorphism โ from ฮฆ to ๐ผ implies the existence of a homomorphism โโฒ โ โ|x from ฮจ to ๐ผ. An instance ๐ผ satisfies a set ฮฃ of TGDs, written ๐ผ |= ฮฃ, if ๐ผ |= ๐ for each ๐ โ ฮฃ. 2.4. Ontological Query Answering Consider a database ๐ท and a set ฮฃ of TGDs. A model of ๐ท and ฮฃ is an instance ๐ผ such that ๐ผ โ ๐ท and ๐ผ |= ฮฃ. Let mods(๐ท, ฮฃ) be the set of all models of ๐ท and ฮฃ.โ๏ธThe certain answers to a CQ ๐ w.r.t. ๐ท and ฮฃ are defined as the set of tuples cert(๐, ๐ท, ฮฃ) = ๐ โmods(๐ท,ฮฃ) ๐(๐ ). Accordingly, for any fixed schema S, two ontologies ฮฃ1 and ฮฃ2 over S are said S-equivalent (in symbols ฮฃ1 โกS ฮฃ2 ) if, for each ๐ท and ๐ over S, it holds that cert(๐, ๐ท, ฮฃ1 ) = cert(๐, ๐ท, ฮฃ2 ). The pair ๐ท and ฮฃ satisfies a BCQ ๐, written ๐ท โช ฮฃ |= ๐, if cert(๐, ๐ท, ฮฃ) = โจโฉ, namely ๐ |= ๐ for each ๐ โ mods(๐ท, ฮฃ). Fix a class ๐ of ontologies. The computational problem studied in this work โcalled CQAns(๐)โ can be schematized as follows: given a database ๐ท, a set ฮฃ โ ๐ of TGDs, a CQ ๐(x), and a tuple c โ ๐๐๐(๐ท)|x| , does c โ cert(๐, ๐ท, ฮฃ) hold? In what follows, we informally say that ๐ is decidable whenever CQAns(๐) is decidable. Note that c โ cert(๐, ๐ท, ฮฃ) if, and only if, ๐ท โช ฮฃ |= ๐(c), where ๐(c) is the BCQ obtained from ๐(x) by replacing, for each ๐ โ {1, ..., |x|}, every occurrence x[๐] with c[๐]. Actually, the former problem is AC0 reducible to the latter. Finally, while considering the computational complexity of CQAns(๐), we recall the following convention: (๐) combined complexity means that ๐ท, ฮฃ, ๐, and c are given in input; and (๐๐) data complexity means that only ๐ท and c are given in input, whereas ฮฃ and ๐ are considered fixed. 2.5. The Chase Procedure The chase procedure [17] is a tool exploited for reasoning with TGDs. Consider a database ๐ท and a set ฮฃ of TGDs. Given an instance ๐ผ โ ๐ท, a trigger for ๐ผ is any pair โจ๐, โโฉ, where ๐ โ ฮฃ is a rule as in Equation 2 and โ is a homomorphism from body(๐) to ๐ผ. Let ๐ผ โฒ = ๐ผ โช โโฒ (head(๐)), where โโฒ โ โ|x maps each ๐ง โ varโ (๐) to a โfreshโ null โโฒ (๐ง) not occurring in ๐ผ such that ๐ง1 ฬธ= ๐ง2 in varโ (๐) implies โโฒ (๐ง1 ) ฬธ= โโฒ (๐ง2 ). Such an operation which constructs ๐ผ โฒ from ๐ผ is called chase step and denoted โจ๐, โโฉ(๐ผ) = ๐ผ โฒ . The chase procedure of ๐ท โช ฮฃ is an exhaustive application of chase steps, starting from ๐ท, which produce a sequence ๐ผ0 = ๐ท โ ๐ผ1 โ ๐ผ2 โ ยท ยท ยท โ ๐ผ๐ โ . . . of instances in such a way that: (๐) for each ๐ โฅ 0, ๐ผ๐+1 = โจ๐, โโฉ(๐ผ๐ ) is a chase step obtained via some trigger โจ๐, โโฉ for ๐ผ๐ ; (๐๐) for each ๐ โฅ 0, if there exists a trigger โจ๐, โโฉ for ๐ผ๐ , then there exists some ๐ > ๐ such that ๐ผ๐ = โจ๐, โโฉ(๐ผ๐โ1 ) is a chase step; and (๐๐๐) any trigger โจ๐, โโฉ is used only once. We define chase(๐ท, ฮฃ) = โช๐โฅ0 ๐ผ๐ . It is well know that chase(๐ท, ฮฃ) is a universal model of ๐ท โช ฮฃ, that is, for each ๐ โ mods(๐ท, ฮฃ) there is a homomorphism from chase(๐ท, ฮฃ) to ๐ . Hence, given a BCQ ๐ it holds that chase(๐ท, ฮฃ) |= ๐ โ ๐ท โช ฮฃ |= ๐. Finally, we recall that chase(๐ท, ฮฃ) can be decomposed into levels [12]: each atom of ๐ท has level ๐พ = 0; an atom 86 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 of chase(๐ท, ฮฃ) has level ๐พ + 1 if, during its generation, the exploited trigger โจ๐, โโฉ maps the body of ๐ via โ to atoms whose maximum level is ๐พ. We refer to the part of the chase up to level ๐พ as chase๐พ (๐ท, ฮฃ). Clearly, chase(๐ท, ฮฃ) = โช๐พ>0 chase๐พ (๐ท โช ฮฃ). 3. Dyadic Decomposable Sets In this section we introduce a novel general condition that allows to define, from any decidable class ๐ of ontologies, a new decidable class called Dyadic-๐ enjoying desirable properties. We start with some preliminary notions. Then, we present the new notion of dyadic decomposition. Finally, we conclude with a computational analysis. 3.1. Preliminary Notions This section fixes the basics that are needed to define dyadic decomposable sets, by providing a uniform notation for key existing notions: affected/invaded positions and attacked/protect- ed/harmless/harmful/dangerous variables [4, 6, 18, 19]. Basically, these notions serve to separate positions in which the chase can introduce only constants from those where nulls might appear. Definition 1. Consider an ontology ฮฃ and a variable ๐ง โ varโ (ฮฃ). A position ๐ โ pos(ฮฃ) is said to be ๐ง-affected (or invaded by ๐ง) if one of the following two properties holds: 1. there exists ๐ โ ฮฃ such that ๐ง appears in the head of ๐ at position ๐; 2. there exist ๐ โ ฮฃ and ๐ฅ โ front(๐) such that ๐ฅ occurs both in head(๐) at position ๐ and in body(๐) at ๐ง-affected positions only. Moreover, a position ๐ โ pos(ฮฃ) is ๐-affected, where ๐ โ varโ (ฮฃ), if: 1. for each ๐ง โ ๐, ๐ is ๐ง-affected; and 2. for each ๐ง โ varโ (ฮฃ), if ๐ is ๐ง-affected, then ๐ง โ ๐. Note that for every position ๐ there exists a unique set ๐ such that ๐ is ๐-affected. We write aff(๐) for this set ๐. Moreover, aff(ฮฃ) = {๐ โ pos(ฮฃ) | aff(๐) ฬธ= โ }, and nonaff(ฮฃ) = pos(ฮฃ) โ aff(ฮฃ). We can now categorize the variables occurring in a conjunction of atoms with the following definition. Definition 2. Given a TGD ๐ โ ฮฃ and a variable ๐ฅ in body(๐): โ if ๐ฅ occurs at positions ๐1 , . . . , ๐๐ and ๐๐=1 aff(๐๐ ) = โ , then ๐ฅ is harmless, โ๏ธ โ๏ธ๐ โ if ๐ฅ is not harmless, placed ๐ = ๐=1 aff(๐๐ ), then it is ๐-harmful, โ if ๐ฅ is ๐-harmful and belongs to front(๐), then ๐ฅ is ๐-dangerous. Given a variable ๐ฅ that is ๐-dangerous, we write dang(๐ฅ) for the set ๐. Hereinafter, the prefix ๐- is omitted when it is not necessary. Consider an ontology ฮฃ. Given a rule ๐ โ ฮฃ, we denote by dang(๐) (resp., harmless(๐) and harmful(๐)) the dangerous (resp., harmless and harmful) variables in ๐. These sets of variables naturally extend to the whole ฮฃ by taking, for each of them, the union over all the rules of ฮฃ. 87 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 3.2. Dyadic TGDs In order to define the notion of Dyadic TGDs, we now introduce the concept of head-ground set of rules, being roughly โnon-recursiveโ rules in which nulls are neither created nor propagated. Definition 3. Consider a set ฮฃ of TGDs. A set ฮฃโฒ โ ฮฃ is head-ground w.r.t. ฮฃ if: 1. ฮฃโฒ โ Datalog; 2. each head atom of ฮฃโฒ contains only harmless variables w.r.t. ฮฃ; 3. hp(ฮฃโฒ ) โฉ bp(ฮฃโฒ ) = โ ; 4. hp(ฮฃโฒ ) โฉ hp(ฮฃ โ ฮฃโฒ ) = โ . The following example is given to better understand the above definition. Example 1. Consider the next set of rules: ๐1 : ๐ (๐ฅ1 , ๐ฆ1 ) โ โ ๐ง1 , ๐ค1 ๐(๐ง1 , ๐ค1 ) ๐2 : ๐ถ(๐ฆ2 ), ๐ (๐ฅ2 , ๐ง2 ) โ ๐(๐ฆ2 , ๐ง2 ) ๐3 : ๐ท(๐ฆ3 , ๐ง3 ), ๐ (๐ฅ3 , ๐ค3 ) โ ๐ (๐ฅ3 , ๐ฆ3 ) ๐4 : ๐(๐ฅ4 , ๐ฆ4 ) โ โ ๐ง4 ๐ด(๐ฅ4 , ๐ง4 ) ๐5 : ๐ด(๐ฅ5 , ๐ง5 ), ๐ท(๐ฆ5 , ๐ง5 ) โ ๐(๐ฅ5 , ๐ฆ5 ) A subset of head ground rule w.r.t. ฮฃ is given by ฮฃHG = {๐2 , ๐3 }. In fact, harmless(ฮฃ) is the set {๐ฅ1 , ๐ฆ1 , ๐ฆ2 , ๐ฅ2 , ๐ง2 , ๐ฅ3 , ๐ฆ3 , ๐ง3 , ๐ฆ5 , ๐ง5 }; hence, it is easy to check that (๐) ๐2 and ๐3 are datalog rules; (๐๐) the head atoms of ๐2 and ๐3 contain only harmless variables; (๐๐๐) both predicates that appear in head(๐2 ) and head(๐3 ) do not occur in any body of ฮฃHG , (๐๐ฃ) nor in the head of rules ๐1 , ๐4 and ๐5 . To the contrary, rules ๐1 , ๐4 and ๐5 could not be in ฮฃHG , since they violate Properties 2 and 3 of Definition 3. Hence, we observe that the set ฮฃHG is maximal. We are now ready to formally introduce the class Dyadic-๐. Definition 4. Consider a class ๐ of TGDs, and a set ฮฃ of TGDs. Let S = sch(ฮฃ). A pair (ฮฃHG , ฮฃ๐ ) of TGDs is a dyadic decomposition of ฮฃ w.r.t. ๐ if: 1. ฮฃHG โช ฮฃ๐ โกS ฮฃ; 2. ฮฃ๐ โ ๐; 3. ฮฃHG is head-ground w.r.t. ฮฃHG โช ฮฃ๐ ; and 4. the head atoms of ฮฃHG do not occur in ฮฃ. Dyadic-๐ is the class of all sets of TGDs that admit a dyadic decomposition w.r.t. ๐. The union of all Dyadic-๐, with ๐ being any decidable class of TGDs, forms what we call dyadic decomposable sets, which encompass and generalize any other existing decidable class, including those based on semantic conditions. We now provide an example of a Dyadic-Shy ontology, where Shy [4] is a known decidable class. Before that, we recall the syntactic conditions underlying this class. A set ฮฃ of TGDs is shy if, for each ๐ โ ฮฃ the following conditions both hold: (๐) if a variable ๐ฅ occurs in more than one body atom, then ๐ฅ is harmless; (๐๐) for every pair of distinct dangerous variable ๐ง and ๐ค in different atoms, dang(๐ง) โฉ dang(๐ค) = โ . The class of all shy ontologies is called Shy. 88 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 Example 2. Let consider the following set ฮฃ of TGDs: ๐1 : ๐ (๐ฅ1 , ๐ฆ1 ) โ โ ๐ง1 ๐ (๐ง1 ) ๐2 : ๐ (๐ฅ2 , ๐ฆ2 ) โ โ ๐ง2 ๐ (๐ง2 ) ๐3 : ๐(๐ฅ3 , ๐ฆ3 ) โ โ ๐ง3 ๐ (๐ง3 ) ๐4 : ๐ (๐ฅ4 ) โ ๐(๐ฅ4 ) ๐5 : ๐ (๐ฅ5 ), ๐ (๐ฆ5 ), ๐ (๐ง5 ), ๐(๐ง5 ) โ ๐ (๐ฅ5 , ๐ฆ5 ) where harmless(ฮฃ) = {๐ฅ1 , ๐ฆ1 , ๐ฅ2 , ๐ฆ2 , ๐ฅ3 , ๐ฆ3 }, harmful(ฮฃ) = {๐ฅ4 , ๐ฅ5 , ๐ฆ5 , ๐ง5 }, and dang(ฮฃ) = {๐ฅ4 , ๐ฅ5 , ๐ฆ5 }. A dyadic decomposition of ฮฃ w.r.t. Shy is given by (ฮฃHG , ฮฃ๐ฎ ), where ฮฃHG is: ๐ (๐ฅ1 , ๐ฆ1 ) โ ๐ด๐ข๐ฅ1 (๐ฅ1 , ๐ฆ1 ) ๐ (๐ฅ2 , ๐ฆ2 ) โ ๐ด๐ข๐ฅ2 (๐ฅ2 , ๐ฆ2 ) ๐(๐ฅ3 , ๐ฆ3 ) โ ๐ด๐ข๐ฅ3 (๐ฅ3 , ๐ฆ3 ) ๐ (๐ฅ4 ) โ ๐ด๐ข๐ฅ4 () ๐ (๐ฅ5 ), ๐ (๐ฆ5 ), ๐ (๐ง5 ), ๐(๐ง5 ) โ ๐ด๐ข๐ฅ5 () and ฮฃ๐ฎ is: ๐ด๐ข๐ฅ1 (๐ฅ1 , ๐ฆ1 ) โ โ ๐ง1 ๐ (๐ง1 ) ๐ด๐ข๐ฅ2 (๐ฅ2 , ๐ฆ2 ) โ โ ๐ง2 ๐ (๐ง2 ) ๐ด๐ข๐ฅ3 (๐ฅ3 , ๐ฆ3 ) โ โ ๐ง3 ๐ (๐ง3 ) ๐ (๐ฅ4 ), ๐ด๐ข๐ฅ4 () โ ๐(๐ฅ4 ) ๐ (๐ฅ5 ), ๐ (๐ฆ5 ), ๐ด๐ข๐ฅ5 () โ ๐ (๐ฅ5 , ๐ฆ5 ) According to the above decomposition, the considered set ฮฃ is Dyadic-Shy. Note that, in general, without any assumption on the specific class ๐, we do not have any concrete means to construct a dyadic decomposition for an arbitrary Dyadic-๐ ontology. Concerning Dyadic-Shy, however, in Section 4, we define a syntactic subclass โcalled Ward+ โ for which a dyadic decomposition is (easily) computable. 3.3. Decidability and Complexity To provide an algorithm for computing the answers to a query ๐ over a database ๐ท paired with a set ฮฃ โ Dyadic-๐, we are going to exploit the dyadic decomposition (ฮฃHG , ฮฃ๐ ) of ฮฃ w.r.t. ๐. Our idea is to reduce query answering over Dyadic-๐ to query answering over ๐, the latter being decidable by assumption. To this aim, we first โcomplete" ๐ท by adding all the โauxiliaryโ ground consequences of ๐ท โช ฮฃHG โช ฮฃ๐ , contained in the set ๐ทโฒ = {๐ โ chase(๐ท, ฮฃHG โช ฮฃ๐ ) | pred(๐) โ hp(ฮฃHG )}. (3) Let ๐ = ๐ท โช ๐ทโฒ be the result of this completion operation. We point out that ๐ทโฒ actually contains only ground atoms, since the atoms generated during the chase procedure that derive from the head rules of ฮฃHG cannot contain nulls by definition of head-ground rules. Accordingly, we evaluate the query ๐ over ๐ โช ฮฃ๐ . Therefore, to show that Dyadic-๐ is decidable, it suffices to prove that ๐ทโฒ is computable and also that cert(๐, ๐ท, ฮฃ) = cert(๐, ๐, ฮฃ๐ ) holds for any CQ ๐. We start by showing the correctness of our reduction. 89 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 Algorithm 1: Database Completion w.r.t. a fixed decidable class ๐ of TGDs Input: A dyadic decomposition (ฮฃHG , ฮฃ๐ ) of ฮฃ w.r.t. ๐ A database ๐ท Output: The completed database ๐ 1 ๐ := ๐ท 2 ๐ทห := โ 3 for each rule of the form ฮฆ(x, y) โ Aux ๐ (x) in ฮฃHG do 4 ๐ := โจxโฉ โ ฮฆ(x, y) 5 ห =๐ท ๐ท ห โช {Aux ๐ (t) | t โ cert(๐, ๐, ฮฃ๐ )} 6 if (๐ท โช ๐ทห โ ๐) then 7 ๐ := ๐ท โช ๐ท ห 8 go to instruction 2 9 return ๐ Lemma 1. Fix a decidable class ๐ of TGDs. Consider a database ๐ท, a set ฮฃ โ Dyadic-๐ and a conjunctive query ๐(x). Let (ฮฃHG , ฮฃ๐ ) be a dyadic decomposition of ฮฃ w.r.t. ๐ and let ๐ = ๐ท โช ๐ทโฒ , where ๐ทโฒ = {๐ โ chase(๐ท, ฮฃHG โช ฮฃ๐ ) | pred(๐) โ hp(ฮฃHG )}. Then, it holds that cert(๐, ๐ท, ฮฃ) = cert(๐, ๐, ฮฃ๐ ). Proof. Let S = sch(ฮฃ). Since, by hypothesis, (ฮฃHG , ฮฃ๐ ) is a dyadic decomposition of ฮฃ, by Definition 4, it holds that ฮฃ โกS ฮฃHG โช ฮฃ๐ . Hence, by definition of S-equivalence, we have cert(๐, ๐ท, ฮฃ) = cert(๐, ๐ท, ฮฃHG โช ฮฃ๐ ) (4) Fix any arbitrary |x|-ary tuple c of constants. From Equation 4, we immediately get that c โ cert(๐, ๐ท, ฮฃ) if, and only if, c โ cert(๐, ๐ท, ฮฃHG โช ฮฃ๐ ). Thus, let ๐ โฒ = ๐(c), we now have ๐ท โช ฮฃ |= ๐ โฒ โ ๐ท โช ฮฃHG โช ฮฃ๐ |= ๐ โฒ . (5) To show cert(๐, ๐ท, ฮฃ) โ cert(๐, ๐, ฮฃ๐ ), it suffices to prove that ๐ท โช ฮฃ |= ๐ โฒ implies ๐ โช ฮฃ๐ |= ๐ โฒ . Assume ๐ท โช ฮฃ |= ๐ โฒ holds. By Equation 5, we know that ๐ท โช ฮฃHG โช ฮฃ๐ |= ๐ โฒ holds too. Hence, chase(๐ท, ฮฃHG โช ฮฃ๐ ) |= ๐ โฒ . Since ๐ทโฒ โ chase(๐ท, ฮฃHG โช ฮฃ๐ ), it holds that chase(๐ท โช ๐ทโฒ , ฮฃHG โช ฮฃ๐ ) |= ๐ โฒ . Since ๐ทโฒ contains all the auxiliary ground consequences of ฮฃHG , the latter becomes equivalent to chase(๐ท โช ๐ทโฒ , ฮฃ๐ ) |= ๐ โฒ . Hence, ๐ท โช ๐ทโฒ โช ฮฃ๐ |= ๐ โฒ . Since, by hypothesis, ๐ = ๐ท โช ๐ทโฒ , we finally get that ๐ โช ฮฃ๐ |= ๐ โฒ . To show that cert(๐, ๐ท, ฮฃ) โ cert(๐, ๐, ฮฃ๐ ) it suffices to prove that if ๐ โช ฮฃ๐ |= ๐ โฒ , then ๐ท โช ฮฃ |= ๐ โฒ . Assume that ๐ โช ฮฃ๐ |= ๐ โฒ , hence chase(๐, ฮฃ๐ ) |= ๐ โฒ . Since ฮฃ๐ โ ฮฃHG โช ฮฃ๐ , it holds that chase(๐, ฮฃHG โช ฮฃ๐ ) |= ๐ โฒ . By hypothesis, ๐ทโฒ โ chase(๐ท, ฮฃHG โช ฮฃ๐ ); hence chase(๐ท, ฮฃHG โช ฮฃ๐ ) |= ๐ โฒ , that is ๐ท โช ฮฃHG โช ฮฃ๐ |= ๐ โฒ . Applying Equation 5, it holds that ๐ท โช ฮฃ |= ๐ โฒ , and hence the thesis. With Lemma 1 in place, we now design Algorithm 1 in order to iteratively construct the set ๐ = ๐ท โช ๐ทโฒ , with ๐ทโฒ being the set defined by Equation 3. Roughly speaking, the first 90 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 two instructions are required, respectively, to add ๐ท to ๐ and to initialize a temporary set ๐ทห used to store ground consequences derived from ฮฃHG . The rest of the algorithm is an iterative procedure that computes the answers (instruction 5) to the queries constructed from the rules of ฮฃHG (instruction 4) and completes the initial database ๐ท (instruction 7) until no more auxiliary ground atoms can be produced (instruction 6). We point out that, in general, ๐ทห โ ๐ทโฒ holds; in particular, ๐ท ห = ๐ทโฒ holds in the last execution of instruction 7 or, equivalently, when the condition ๐ท โช ๐ท ห โ ๐ examined at instruction 6 is false, since all the auxiliary ground atoms have been added to ๐. We now prove that Algorithm 1 always terminates and correctly constructs ๐. Lemma 2. Fix a decidable class ๐ of TGDs. Consider a database ๐ท and a set ฮฃ of Dyadic-๐ TGDs. Let (ฮฃHG , ฮฃ๐ ) be a dyadic decomposition of ฮฃ, and ๐ทโฒ be the set of ground auxiliary atoms defined as {๐ โ chase(๐ท, ฮฃHG โช ฮฃ๐ ) | pred(๐) โ hp(ฮฃHG )}. Then, Algorithm 1 both terminates and computes ๐ท โช ๐ทโฒ . Proof sketch. We split the proof in two parts. Termination. To prove the termination of Algorithm 1, it suffices to show that each instruction alone always terminates and that the overall procedure never falls into an infinite loop. First, observe that |๐ทโฒ | โค |hp(ฮฃHG )| ยท ๐๐ , where ๐ = |const(๐ท)| and ๐ = max๐ โhp(ฮฃHG ) arity(๐ ). ห โ ๐ทโฒ Instructions 1, 2, 4, 8 and 9 trivially terminates. Instructions 6 and 7 both terminate, since ๐ท always holds (see correctness below). Each time instruction 3 is reached, the for-loop simply scans the set ฮฃHG , which is finite by definition. Concerning instruction 5, it suffices to observe that its termination relies on the termination of CQAns(๐) โwhich is true by hypothesisโ and on the fact that, for each query ๐, to construct the set {Aux ๐ (t) | t โ cert(๐, ๐, ฮฃ๐ )}, the problem CQAns(๐) must be solved at most ๐๐ times, being the maximum number of tuples t for which the check t โ cert(๐, ๐, ฮฃ๐ ) has to be performed. Since each instruction alone terminates, it remains to analyze the overall procedure. It contains two loops. The first, namely the for-loop at instruction 3, is not problematic; indeed, we shown that it locally terminates. The second one, namely the go to-loop, depends on the evaluation of the if-instruction, which can be executed at most |๐ทโฒ | times. Thus, also the go to-loop does the same. Correctness. We now claim that Algorithm 1 correctly completes the database. Let ๐ be the output of Algorithm 1. Our claim is that ๐ = ๐ท โช ๐ทโฒ . Inclusion 1 (๐ท โช ๐ทโฒ โ ๐). Assume, by contradiction, that ๐ท โช ๐ทโฒ contains some atom that does not belong to ๐. This means that there exists some ๐ > 0 such that both ๐ท ยฏ = โฒ ๐โ1 โฒ ๐ ((๐ท โช ๐ท ) โฉ chase (๐ท, ฮฃHG โช ฮฃ๐ )) โ ๐ and ((๐ท โช ๐ท ) โฉ chase (๐ท, ฮฃHG โช ฮฃ๐ )) โ ๐ = ฬธ โ ๐ hold. Thus, there exists some ๐ผ โ chase (๐ท, ฮฃHG โช ฮฃ๐ ) whose level is exactly ๐ and that does not belong to ๐. Let โจ๐, โโฉ be the trigger used by the chase to generate ๐ผ, where ๐ is of the form ฮฆ(x, y) โ Aux (x). Clearly, โ maps ฮฆ(x, y) to chase๐โ1 (๐ท, ฮฃHG โช ฮฃ๐ ), and we also have that ๐ผ = Aux (โ(x)). Consider now the query ๐ = โจxโฉ โ ฮฆ(x, y) constructed from ๐ by ยฏ โ ๐, we Algorithm 1 at instruction 4. Thus, chase๐โ1 (๐ท, ฮฃHG โช ฮฃ๐ ) |= ๐(โ(x)) holds. Since ๐ท ๐โ1 ยฏ have that chase (๐ท, ฮฃHG โช ฮฃ๐ ) โ chase(๐ท, ฮฃ๐ ) โ chase(๐, ฮฃ๐ ). Hence, chase(๐, ฮฃ๐ ) |= ๐(โ(x)), namely โ(x) โ cert(๐, ๐, ฮฃ๐ ) and, thus, ๐ผ โ ๐, which is a contradiction. Inclusion 2 (๐ โ ๐ท โช ๐ทโฒ ). An argument analogous for the fist inclusion can be provided also for this second case. Here we assume, by contradiction, that ๐ contains some atom that does 91 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 not belong to ๐ท โช ๐ทโฒ . Let โ be the number of time instruction 7 of Algorithm 1 is executed. Let ๐ทห 0 = ๐ท and, for each ๐ โ [โ], ๐ท ห ๐ denote the specific ๐ท ห appearing at instruction 7 the ๐-th time ห ห it is executed. Let ๐ผ๐ = ๐ท๐ โ ๐ท๐โ1 , for each ๐ โ [โ]. It can be shown that there exists a sequence of chase applications leading to chase(๐ท, ฮฃHG โช ฮฃ๐ ) such that, for each ๐ โ [โ] and for each atom ๐ผ โ ๐ผ๐ , ๐ผ is generated via such a chase sequence at a certain level (in general, different from ๐) being strictly greater than the level of every other atom contained in ๐ท ห ๐โ1 . This is a contradiction since ๐ = ๐ท โช ๐ทโ .ห It remains to show that Dyadic-๐ is decidable. We rely on Algorithm 1 together with Lemma 2 and Lemma 1 to state the following: Theorem 1. Let ๐ be a decidable class of TGDs. Then, Dyadic-๐ is decidable. We point out that Algorithm 1 does not depend on the technique exploited for performing query answering over the class ๐; hence, such external techniques can be used like a โblack boxโ. We can now study the complexity of CQAns(๐) for an arbitrary decidable class ๐. Theorem 2. Consider a decidable class ๐ of TGDs. Assume that CQAns(๐) is complete in data complexity for a certain complexity class C. The following are true: 1. If C โ PTime, then CQAns(Dyadic-๐) is in PTime in data complexity; 2. If C โ PTime, then CQAns(Dyadic-๐) is in PTimeC in data complexity; 3. If C โ PTime is deterministic, then CQAns(Dyadic-๐) is C-complete in data complexity. Proof sketch. To prove the memberships of point 1 and 2, we rely on the complexity of Al- gorithm 1. In particular, let ๐ท be a database, ฮฃ โ ๐ an ontology, (ฮฃHG , ฮฃ๐ ) a dyadic de- composition of ฮฃ, and ๐ทโฒ the set defined in Equation 3. Moreover, let ๐ = |const(๐ท)| and ๐ = max๐ โhp(ฮฃHG ) arity(๐ ). Via Lemma 2, we shown that Algorithm 1 always terminates and it correctly constructs the completed database ๐ = ๐ท โช ๐ทโฒ . In particular, by neglecting the computational cost of the โtrivialโ instructions (i.e., 1โ4 and 6โ9), Algorithm 1 overall calls |ฮฃHG | ยท |hp(ฮฃHG )| ยท ๐2๐ times the problem CQAns(๐). To reach the claimed bounds, first, we observe that ๐ is polynomial in ๐ท. Moreover, since we are in data complexity, the following parameters are bounded: the maximum arity ๐, the size of both ฮฃHG and ฮฃ๐ , as well as the size and the number of each query ๐ constructed at instruction 4. Hence, Algorithm 1 calls polynomially many times CQAns(๐). Finally, hardnesses of point 3 follow from the fact that for any deterministic class C โ PTime, we know that PTimeC = C, and from the fact that Dyadic-๐ includes the class ๐. A similar analysis can be performed in combined complexity. Here, however, we need further assumptions on: (๐) the size of dyadic decompositions being equivalent to the ontologies of Dyadic-๐; and (๐๐) both the data and combined complexity of the class ๐ under consideration. 4. Ward+ We start this section recalling the syntactic condition of the class Ward [10, 19], useful for the comprehension of the new class Ward+ that we will introduce below. We point out that 92 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 (a) (b) Figure 1: (a)Structure of a ward+ rule. (b)Syntactical relation among classes. we state the wardedness condition according to Definition 2; hence, the class Ward presented here is actually larger than the original one. A set ฮฃ of TGDs is warded if, for each ๐ โ ฮฃ, there are no dangerous variables in body(๐), or there exists an atom ๐ผ โ body(๐), called a ward, such that:(๐) all the dangerous variables in body(๐) occur in ๐ผ, and (๐๐) each variable of vars(๐ผ) โฉ vars(body(๐) โ {๐ผ}) is harmless. The class of all warded ontologies is called Ward. We now formally introduce the syntactic condition that gives rise to the class Ward+ gen- eralizing the well-known decidable classes Shy and Ward, and being included in Dyadic-Shy. Intuitively, the condition can be explained as follows. If ๐ is a ward+ rule, then body(๐) can be partitioned into two sets of atoms, ๐ต1 and ๐ต2 , that share only harmless variables (see Figure 1(a)). Having in mind the notion of wardedness, the set ๐ต1 can be seen as a โmulti-ward" that contains all the dangerous variables and that, at the same time, satisfies the shyness conditions. The set ๐ต2 , instead, is any atoms conjunction that can share with ๐ต1 only harmless variables. More formally, a set of ward+ TGDs is defined as follows. Definition 5. A set ฮฃ of TGDs is ward+ if, for each TGD ๐ โ ฮฃ, there are no dangerous variables in body(๐), or there exists a partition {๐ต1 , ๐ต2 } of body(๐) such that: 1. ๐ต1 contains all the dangerous variables 2. vars(๐ต1 ) โฉ vars(๐ต2 ) are harmless variables 3. for every pair of distinct dangerous variable ๐ง and ๐ค in different atoms, dang(๐ง) โฉ dang(๐ค) = โ 4. for every pair of distinct atoms ๐, ๐ โ ๐ต1 , vars(๐) โฉ vars(๐) are harmless variables. We write Ward+ for the class of all finite ward+ sets of TGDs. Below we propose an example of an ontology that is in Ward+ and an example of one that does not belong to Ward+ , respectively. Example 3. Consider the ontology ฮฃ of Example 2. It easy to see that ๐1 , ๐2 , ๐3 and ๐4 are trivially ward+ rules w.r.t. ฮฃ, since they are rules with one single body atom, which cannot violate any conditions of Definition 5. Let us focus on rule ๐5 . Since dang(๐5 ) = {๐ฅ5 , ๐ฆ5 }, harmful(๐5 ) = {๐ง5 } and harmless(๐5 ) = โ , there exists a partition of body(๐5 ) into two set ๐ต1 , ๐ต2 , that satisfies Definition 5, where, ๐ต1 = {๐ (๐ฅ5 ), ๐ (๐ฆ5 )} and ๐ต2 = {๐ (๐ง5 ), ๐(๐ง5 )}. Hence, ฮฃ โ Ward+ . 93 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 Example 4. Let ฮฃ be the following set of TGDs: ๐1 : ๐ (๐ฅ1 ) โ โ ๐ฆ1 ๐(๐ฆ1 ) ๐2 : ๐(๐ฅ2 ) โ โ ๐ฆ2 , ๐ง2 ๐ (๐ฆ2 , ๐ฅ2 , ๐ง2 ) ๐3 : ๐ (๐ฅ3 , ๐ฆ3 , ๐ง3 ), ๐(๐ฆ3 ) โ ๐ (๐ฅ3 , ๐ฆ3 , ๐ง3 ) We pay particular attention to rule ๐3 , since as previously explained, rules ๐1 and ๐2 , that have only one body atom, do not go against the definition of ward+ rule. Here, Condition 4 of Definition 5 is violated, since there is a join on variable ๐ฆ3 that appears at positions ๐ [2] and ๐[1], both ๐ฆ1 -affected. Now we show that Ward+ strictly includes both Shy and Ward. According to Definition 5, the class Ward trivially coincides with the class Ward+ if |๐ต1 | = 1; thus, Ward โ Ward+ . On the other hand, if |๐ต2 | = โ , we have that Shy โ Ward+ , since the โmulti-ward" satisfies the shyness conditions. We show that the latter relations are strict inclusions presenting a set of TGDs that belongs to Ward+ , but it is not both in Shy and Ward. Example 5. Let ฮฃ be the ontology introduced in Example 2. It is easy to see that ๐1 , ๐2 , ๐3 and ๐4 are both shy and warded rules w.r.t. ฮฃ, since they are rules with one single body atom, which cannot violate any condition of the classes under consideration. However, rule ๐5 โ / Ward, since the dangerous variables ๐ฅ5 and ๐ฆ5 are not contained in a single ward, and ๐5 โ / Shy, since there is a join on the variable ๐ง5 that is ๐ง2 -harmful. Hence, ฮฃ โ Ward+ (see Example 3), but ฮฃ ฬธโ Shy and ฮฃ ฬธโ Ward. Accordingly, it follows the next result. Theorem 3. Ward+ โ Shy โช Ward. To show that Ward+ โ Dyadic-Shy, we have to prove the existence of a dyadic decomposition (ฮฃHG , ฮฃ๐ฎ ) for every set ฮฃ of ward+ TGDs. Intuitively, the construction of a dyadic decompo- sition for a ward+ set of TGDs takes advantage of the structure of a ward+ rule. Indeed, by definition, a ward+ rule can be always partitioned into two sets ๐ต1 and ๐ต2 of atoms, where ๐ต1 is a conjunction of atoms that satisfies the shyness conditions, and ๐ต2 is any atom conjunction. Roughly speaking, starting from a rule ๐ โ Ward+ , a rule in ฮฃHG has the same body of ๐, while the head contains a โfresh" atom in which are propagated only harmless variables; this last atom, with the set ๐ต1 , is used to construct the body of a rule in ฮฃ๐ฎ , while the head contains the same atoms of head(๐) (see Example 2). Now, we formally prove the existence of a dyadic decomposition for a ward+ set ฮฃ of TGDs with respect to Shy. Theorem 4. For every ฮฃ โ Ward+ , there is a dyadic decomposition (ฮฃHG , ฮฃ๐ฎ ) of ฮฃ w.r.t. Shy. Proof. Let ฮฃ be a set of ward+ TGDs. To show the existence of a dyadic decomposition (ฮฃHG , ฮฃ๐ฎ ) of ฮฃ w.r.t. Shy, we propose the following procedure. Consider a ward+ rule ๐ : ฮฆ(x, y, z), ฮจ(z, u) โ โ w ฮ(x, w, z), where x, y, z, u are pairwise disjoint, ฮฆ(x, y, z), ฮจ(z, u) and ฮ(x, w, z) are conjunctions of atoms such that ฮฆ(x, y, z) = ๐ต1 and ฮจ(z, u) = ๐ต2 (according to Definition 5). Moreover, dang(๐) = {x}, harmless(๐) = {z} and harmful(๐) = {x, u, y}. Let ๐๐ = |head(๐)|, then we produce ๐๐ + 2 rules ๐โฒ (๐), ๐โฒโฒ0 (๐), . . . , ๐โฒโฒ๐๐ (๐) such that: 94 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 ๐โฒ (๐) : ฮฆ(x, y, z), ฮจ(z, u) โ ๐ด๐ข๐ฅโฒ๐ (z) ๐โฒโฒ0 (๐) : ฮฆ(x, y, z), ๐ด๐ข๐ฅโฒ๐ (z) โ โ w ๐ด๐ข๐ฅโฒโฒ๐ (x, w, z) ๐โฒโฒ1 (๐) : ๐ด๐ข๐ฅโฒโฒ๐ (x, w, z) โ ๐1 (v1 ) .. . ๐โฒโฒ๐๐ (๐) : ๐ด๐ข๐ฅโฒโฒ๐ (x, w, z) โ ๐๐๐ (v๐๐ ) where v๐ โ {x, w, z} for each ๐ โ {1, . . . , ๐๐ }, {๐1 (v1 ), . . . , ๐๐๐ (v๐๐ )} = ฮ(x, w, z) and ๐ด๐ข๐ฅโฒ๐ , ๐ด๐ข๐ฅโฒโฒ๐ are fresh auxiliary predicates. Now, we prove that (ฮฃHG , ฮฃ๐ฎ ) is a dyadic decomposition for any ward+ set of TGDs w.r.t. Shy, where โ๏ธ โ๏ธ ฮฃHG = ๐โฒ (๐) and ฮฃ๐ฎ = ๐โฒโฒ๐ (๐). ๐โฮฃ ๐โฮฃ โง 0โค๐โค๐๐ According to Definition 4, the pair (ฮฃHG , ฮฃ๐ฎ ) has to satisfies four properties. Property 4 is trivially fulfilled: head predicates of ฮฃHG do not occur in ฮฃ, since, by construction, ๐ด๐ข๐ฅโฒ๐ is a fresh auxiliary predicate introduced for each ๐ โ ฮฃ. Property 3 states that the set ฮฃHG is head-ground w.r.t. ฮฃHG โช ฮฃ๐ฎ . This is true since, by construction, we have that: for each ๐ โ ฮฃ, ๐โฒ (๐) is a datalog rule; hp(ฮฃHG ) = {๐ด๐ข๐ฅโฒ๐ : ๐ โ ฮฃ}, where each ๐ด๐ข๐ฅโฒ๐ is a predicate that does not occur neither in any body of ฮฃHG nor in any head of ฮฃ๐ฎ (i.e., hp(ฮฃโฒ ) โฉ bp(ฮฃโฒ ) = โ , and hp(ฮฃโฒ ) โฉ hp(ฮฃ โ ฮฃโฒ ) = โ ), and it contains only harmless variable. Now, we have to prove that Property 2 holds, i.e., ฮฃ๐ฎ โ Shy. This is ensured by the fact that rule ๐โฒโฒ0 (๐) is made by joining the set ๐ต1 of ๐ (that has to satisfy the shyness conditions by definition), and the atom ๐ด๐ข๐ฅโฒ๐ , which contains only harmless variables, and hence, cannot violate any of the shyness conditions; moreover, each rule ๐โฒโฒ๐ (๐), for ๐ = 1, . . . , ๐, is linear, and therefore is a shy rule. Finally, Property 1, that is ฮฃHG โช ฮฃ๐ฎ โกsch(ฮฃ) ฮฃ, follows by construction. Finally โby combining Theorem 2, Theorem 4, the fact that CQAns is PTime-complete (resp., ExpTime-complete) for both Shy and Ward in data (resp., combined) complexity, and the fact that Ward+ admits dyidic decompositions of polynomial sizeโ we can state the following result. Theorem 5. The following are true: 1. Ward+ โ Dyadic-Shy; 2. CQAns is PTime-complete in data complexity over Ward+ , Dyadic-Shy and Dyadic-Ward; 3. CQAns is ExpTime-complete in combined complexity over Ward+ . 5. Conclusion Dyadic decomposable sets form a novel decidable class of TGDs that encompasses and general- izes all the existing (syntactic and semantic) decidable classes of TGDs. In the near feature, it would be interesting to identify more syntactic Dyadic-๐ fragments โsuch as Ward+ with re- spect to Dyadic-Shyโ for which a dyadic decomposition can be easily computed. Moreover, our plan is to implement Algorithm 1 to perform query answering by exploiting existing reasoners. 95 Georg Gottlob et al. CEUR Workshop Proceedings 83โ96 References [1] F. Baader, D. Calvanese, D. L. McGuinness, D. Nardi, P. F. Patel-Schneider (Eds.), The Description Logic Handbook: Theory, Implementation, and Applications, Cambridge University Press, 2003. [2] J. Baget, M. Leclรจre, M. Mugnier, E. Salvat, On rules with existential variables: Walking the decidability line, Artif. Intell. 175 (2011) 1620โ1654. [3] J. Baget, M. Leclรจre, M. Mugnier, E. Salvat, Extending decidable cases for rules with existential variables, in: IJCAI, 2009, pp. 677โ682. [4] N. Leone, M. Manna, G. Terracina, P. Veltri, Fast query answering over existential rules, ACM Trans. Comput. Log. 20 (2019) 12:1โ12:48. [5] J.-F. Baget, M. Leclรจre, M.-L. Mugnier, Walking the decidability line for rules with existential variables., KR 10 (2010) 466โ476. [6] A. Calรฌ, G. Gottlob, M. Kifer, Taming the infinite chase: Query answering under expressive relational constraints, J. Artif. Intell. Res. 48 (2013) 115โ174. [7] R. Fagin, P. G. Kolaitis, R. J. Miller, L. Popa, Data exchange: semantics and query answering, Theoretical Computer Science 336 (2005) 89โ124. [8] M. Krรถtzsch, S. Rudolph, Extending decidable existential rules by joining acyclicity and guardedness, in: IJCAI, IJCAI/AAAI, 2011, pp. 963โ968. [9] S. Ceri, G. Gottlob, L. Tanca, What you always wanted to know about datalog (and never dared to ask), IEEE Trans. Knowl. Data Eng. 1 (1989) 146โ166. [10] G. Gottlob, A. Pieris, Beyond SPARQL under OWL 2 QL entailment regime: Rules to the rescue, in: IJCAI, AAAI Press, 2015, pp. 2999โ3007. [11] T. Baldazzi, L. Bellomarini, M. Favorito, E. Sallinger, On the relationship between shy and warded datalog+/-, CoRR abs/2202.06285 (2022). [12] A. Calรฌ, G. Gottlob, A. Pieris, Advanced processing for ontological queries, Proceedings of the VLDB Endowment 3 (2010) 554โ565. [13] A. Calรฌ, G. Gottlob, A. Pieris, Query answering under non-guarded rules in datalog+/-, in: RR, volume 6333 of LNCS, Springer, 2010, pp. 1โ17. [14] A. Calรฌ, G. Gottlob, T. Lukasiewicz, A general datalog-based framework for tractable query answering over ontologies, J. Web Semant. 14 (2012) 57โ83. [15] T. Gogacz, J. Marcinkowski, Converging to the chase - A tool for finite controllability, volume 83, 2017, pp. 180โ206. [16] D. S. Johnson, A. C. Klug, Testing containment of conjunctive queries under functional and inclusion dependencies, J. Comput. Syst. Sci. 28 (1984) 167โ189. [17] A. Deutsch, A. Nash, J. B. Remmel, The chase revisited, in: PODS, ACM, 2008, pp. 149โ158. [18] M. Krรถtzsch, S. Rudolph, Extending decidable existential rules by joining acyclicity and guardedness, in: IJCAI, IJCAI/AAAI, 2011, pp. 963โ968. [19] G. Berger, G. Gottlob, A. Pieris, E. Sallinger, The space-efficient core of vadalog, volume 47, 2022, pp. 1:1โ1:46. 96