On the k-Boundedness for Existential Rules
Stathis Delivorias, Michel Leclere, Marie-Laure Mugnier, Federico Ulliana
aa r X i v : . [ c s . A I] O c t On the k -Boundedness for Existential Rules Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana
University of Montpellier, LIRMM, CNRS, InriaMontpellier, France
Abstract.
The chase is a fundamental tool for existential rules. Several chasevariants are known, which differ on how they handle redundancies possibly causedby the introduction of nulls. Given a chase variant, the halting problem takes asinput a set of existential rules and asks if this set of rules ensures the terminationof the chase for any factbase. It is well-known that this problem is undecidable forall known chase variants. The related problem of boundedness asks if a given setof existential rules is bounded, i.e., whether there is a predefined upper bound onthe number of (breadth-first) steps of the chase, independently from any factbase.This problem is already undecidable in the specific case of datalog rules. How-ever, knowing that a set of rules is bounded for some chase variant does not helpmuch in practice if the bound is unknown. Hence, in this paper, we investigatethe decidability of the k -boundedness problem, which asks whether a given set ofrules is bounded by an integer k . We prove that k -boundedness is decidable forthree chase variants, namely the oblivious, semi-oblivious and restricted chase. This report is a revised version of the paper published at
RuleML+RR 2018.
Existential rules (see [CGK08,BLMS09,CGL09] for the first papers and[GOPS12,MT14] for introductory courses) are a positive fragment of first-order logic that generalizes the deductive database query language Datalog andknowledge representation formalisms such as Horn description logics (see e.g.[CGL + ∃ or Datalog + , they have raised significant interest in the lastyears as ontological languages, especially for the ontology-mediated query-answeringand data-integration issues.A knowledge base (KB) is composed of a set of existential rules, which typically en-codes ontological knowledge, and a factbase, which contains factual data. The forwardchaining, also known as the chase in databases, is a fundamental tool for reasoning onrule-based knowledge bases and a considerable literature has been devoted to its anal-ysis. Its ubiquity in different domains comes from the fact it allows one to compute a Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana universal model of the knowledge base, i.e., a model that maps by homomorphism toany other model of the knowledge base. This has a major implication in problems likeanswering queries with ontologies since it follows that a (Boolean) conjunctive queryis entailed by a KB if and only if it maps by homomorphism to a universal model.Several variants of the chase have been defined: oblivious or naive chase (e.g.[CGK08]), skolem chase [Mar09], semi-oblivious chase [Mar09], restricted or standardchase [FKMP05], core chase [DNR08] (and its variant, the equivalent chase [Roc16]).All these chase variants compute logically equivalent results. Nevertheless, they differon their ability to detect the redundancies that are possibly caused by the introductionof unknown individuals (often called nulls ). Note that, since redundancies can only bedue to nulls, all chase variants output exactly the same results on rules without exis-tential variables (i.e., Datalog rules, also called range-restricted rules [AHV95]). Then,for rules with existential variables the chase produces iteratively new information untilno new rule application is possible. The (re-)applicability of rules is depending on theability of each chase variant to detect redundancies. Evidently this has a direct impacton the termination. Of course, if a KB has no finite universal model then none of thechase variants will terminate. This is illustrated by Example 1.
Example 1.
Take the KB K = ( F, R ) , where R contains the rule R = ∀ x (cid:0) Human ( x ) →∃ y ( parentOf ( y, x ) ∧ Human ( y )) (cid:1) and F = { Human ( Alice ) } . The application of therule R on the initial factbase F , entails the existence of a new (unknown) individual y (a null ) generated by the existential variable y in the rule. This yields the factbase { Human ( Alice ) , parentOf ( y , Alice ) , Human ( y ) } , which is logically translated into anexistentially closed formula: ∃ y (cid:0) Human ( Alice ) ∧ parentOf ( y , Alice ) ∧ Human ( y ) (cid:1) .Then, R can be applied again by mapping x to y thereby creating a new individual y .It is easy to see that in this case the forward chaining does not halt, as the generation ofeach new individual enables a novel rule application. This follows from the fact that theuniversal model of the knowledge base is infinite. △ However, for the case of KBs which have a finite universal model, all chase variants canbe totally ordered with respect to the inclusion of the sets of factbases on which theyhalt: oblivious < semi-oblivious = skolem < restricted < core. Here, X < X meansthat when X halts on a KB, so does X , and there are KBs for which the reciprocalis false. The oblivious chase is the most redundant kind of the chase as it performs allpossible rule applications, without checking for redundancies. The core chase is theless redundant chase as it computes a minimal universal model by reducing every inter-mediate factbase to its core. In between, we find the semi-oblivious chase (equivalentto the skolem-chase) and the restricted chase. The first one does not consider isomor-phic facts that would be generated by consecutive applications of a rule according tothe same mapping of its frontier variables (i.e, variables shared by the rule body andhead). The second one discards all rule applications that produce “locally redundant”facts. The chase variants are illustrated by Example 2 (for better presentation, universalquantifiers of rules will be omitted in the examples): In addition, the parsimonious chase was introduced in [LMTV12]. However, this chase vari-ant, aimed towards responding at atomic queries, does not compute a universal model of theKB, hence it is outside the family of chase variants studied here.n the k -Boundedness for Existential Rules 3 Example 2.
Consider the knowledge bases K = ( F, { R } ) , K = ( F, { R } ) , and K = ( F ′ , { R } ) built from the facts F = { p ( a , a ) } and F ′ = {∃ w p ( a , w ) } and the rules R = p ( x, y ) →∃ z p ( x, z ) , R = p ( x, y ) →∃ z p ( y, z ) and R = p ( x, y ) →∃ z ( p ( x, x ) ∧ p ( y, z )) . Then, the oblivious chase does not halt on K while thesemi-oblivious chase does. Indeed, there are infinitely many different rule applicationson the atoms p ( a , z ) , p ( a , z ) , . . . that can be generated with R ; yet, all rule appli-cations map the frontier variable x to the same constant a , and are therefore filtered bythe semi-oblivious chase. In turn, the semi-oblivious chase does not halt on K whilethe restricted chase does. Here again, there are infinitely many rule applications on theatoms p ( a , z ) , p ( z , z ) , . . . that can be generated with R ; since each of them mapsthe frontier variables to new existentials, they are all performed by the semi-obliviouschase. However, all generated atoms are redundant with the initial atom p ( a , a ) and therestricted chase deems the first (and then all successive) rule applications as redundant.On the other hand, the restricted chase does not halt on K while the core chase does.In this case, the first rule application yields ∃ w ∃ z ( p ( a , w ) ∧ p ( a , a ) ∧ p ( w, z )) . Thisis logically equivalent to p ( a , a ) i.e., its core, which leads to the core-chase terminationat the next step. However, the restricted chase checks only for redundancy of the newlyadded atoms with respect to the previous factbase, and does not take into account thatthe addition of new atoms can cause redundancies elsewhere in the factbase (in thisexample, the previous atom p ( a, w ) together with the new atom p ( w, z ) are redundantwith respect to the new atom p ( a, a ) ). So with the restricted chase, R will be alwaysapplicable. Finally, note that p ( a , a ) is a (finite) universal model for all knowledge bases K , K , and K . △ The termination problem, which asks whether for a given set of rules the chase will ter-minate on any factbase, is undecidable for all chase variants [DNR08,BLM10,GM14].Following previous work on Datalog, we study the related problem of boundedness in a breadth-first setting, i.e., the chase performs rule applications that correspond toa certain breadth-first level before any rule application that corresponds to a higherbreadth-first level. Then, given a chase variant X , we call a set of rules X -bounded ifthere is k (called the bound) such that, for any factbase, the X -chase stops after at most k breadth-first steps. Of course, since chase variants differ with respect to termination,they also differ with respect to boundedness.Boundedness ensures several semantic properties. Indeed, if a set of rules is X -bounded with k the bound, then, for any factbase F , the saturation of F at rank k (i.e.,the factbase obtained from F after k X -chase breadth-first steps) is a universal model ofthe KB; the reciprocal also holds true for the core chase. Moreover, boundedness alsoensures the UCQ-rewritability property (also called the finite unification set property[BLMS11]): any (Boolean) conjunctive query q can be rewritten using the set of rules R into a (Boolean) union of conjunctive queries Q such that for any factbase F , q isentailed by ( F, R ) if and only if Q is entailed by F . It follows that many interestingstatic analysis problems such as query containment under existential rules become de-cidable when a ruleset is bounded. Note that the conjunctive query rewriting procedurecan be designed in a such a way that it terminates within k breadth-first steps with k thebound for the core chase [LMU16]. Finally, from a practical viewpoint, the degree ofboundedness can be seen as a measure of the recursivity of a ruleset, and most likely, Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana this is reflected in the actual number of breadth-first steps required by the chase for agiven factbase or the query rewriting process for a given query, which is expected to bemuch smaller than the theoretical bound.As illustrated by Example 1, the presence of existential variables in the rules canmake the universal model of a knowledge base infinite and so the ruleset unbounded,even for the core chase. However, the importance of the boundedness problem hasbeen recognized already for rules without existential variables. Indeed, the problemhas been first posed and studied for Datalog, where it has been shown to be undecid-able [HKMV95,Mar99]. Example 3 illustrates some cases of bounded and unboundedrulesets in this setting.
Example 3.
Consider the rulesets R = { R } and R = { R, R ′ } where R = p ( x, y ) ∧ p ( y, z ) → p ( x, z ) and R ′ = p ( x, y ) ∧ p ( u, z ) → p ( x, z ) . The set R contains a singletransitivity rule for the predicate p . This set is clearly unbounded as for any integer k there exists a factbase F = { p ( a i , a i +1 ) | ≤ i < k } that requires k chase steps. Onthe other hand, R also contains a rule that joins individuals on disconnected atoms. Inthis case, we have that i ) if R generates some facts then R ′ generates these same factsas well and ii ) R ′ needs to be applied only at the first step, for any F , as it does notproduce any new atom at a later step. Therefore, R is bounded with the bound k = 1 .Note that since these examples are in Datalog, the specificities of the chase variants donot play any role. △ Finally, the next example illustrates boundedness for non-Datalog rules.
Example 4.
Consider the ruleset R = { p ( x, y ) → ∃ z ( p ( y, z ) ∧ p ( z, y )) } andthe fact F = { p(a,b) } . With all variants, the first chase step yields F = { p ( a, b ) , p ( b, z ) , p ( z , b ) } . Then, two new rule applications are possible, which map p ( x, y ) to p ( b, z ) and p ( z , b ) , respectively. The oblivious and semi-oblivious chaseswill perform these rule applications and go on forever. Hence, the chase on R is notbounded for these two variants. On the other hand, the restricted chase does terminate.It will not perform any of these rule applications on F . Indeed, the first applicationwould add the facts { p ( z , z ) , p ( z , z ) } , which can “folded” into F by a homomor-phism that maps z to b (while leaving z fixed), and this is similar for the second ruleapplication. We can check that actually the restricted chase will stop on any factbase,and is bounded with k = 1 . The same holds here for the core chase. △ Despite the relatively negative results on boundedness, knowing that a set of rules isbounded for some chase variant does not help much in practice anyway, if the boundis unknown or even very large. Hence, the goal of this paper is to investigate the k -boundedness problem, which asks, for a given chase variant, whether for any factbase,the chase stops after at most k breadth-first steps.Our main contribution is to show that k -boundedness is indeed decidable for theoblivious, semi-oblivious and restricted chases. Actually, we obtain a stronger result byexhibiting a property that a chase variant may fulfill, namely consistent heredity, andprove that k -boundedness is decidable as soon as this property is satisfied. We show n the k -Boundedness for Existential Rules 5 that it is the case for all the known chase variants except for the core chase. Hence, thedecidability of k -boundedness for the core chase remains an open question. We consider a first-order setting with constants but no other function symbols. A termis either a constant or a variable. An atom is of the form r ( t , . . . , t n ) where r is apredicate of arity n and the t i are terms. Given a set of atoms A , we denote by vars ( A ) and terms ( A ) the set of its variables and terms. A factbase is a set of atoms, logicallyinterpreted as the existentially closed conjunction of these atoms. A homomorphism from a set of atoms A to a set of atoms B (notation: π : A → B ), is a substitution π : vars ( A ) → terms ( B ) such that π ( A ) ⊆ B . In this case, we also say that A mapsto B (by π ). A homomorphism from A to B is an isomorphism if its inverse is alsoa homomorphism. A set of atoms A is a core if there is no homomorphism from A to one of its strict subsets. We denote by | = the classical logical consequence and by ≡ the logical equivalence. It is well-known that, given sets of atoms A and B seen asexistentially closed conjunctions, there is a homomorphism from A to B if and only if B | = A . When A and B are cores, A ≡ B if and only if there is an isomorphism from A to B .An existential rule (or simply rule), denoted by R , is a formula ∀ ¯ x ∀ ¯ y (cid:0) B (¯ x, ¯ y ) →∃ ¯ z H (¯ x, ¯ z ) (cid:1) where B and H , called the body and the head of the rule, are conjunctionsof atoms, ¯ x and ¯ y are sets of universally quantified variables, and ¯ z is a set of existen-tially quantified variables. We call frontier the variables shared by the body and head ofthe rule, that is frontier ( R ) = ¯ x . In the following we will refer to a rule as a pair of setsof atoms ( B, H ) by interpreting their common variables as the frontier. A knowledgebase (KB) K = ( F, R ) is a pair where F is a factbase and R is a set of existential rules.We implicitly assume that all the rules as well as the factbase employ disjoint sets ofvariables, even if, for convenience, we reuse variable names in examples.Let F be a factbase and R = ( B, H ) be an existential rule. We say that R is ap-plicable on F via π if there exists a homomorphism π from its body B to F . We callthe pair ( R, π ) a trigger . We denote by π s a safe extension of π which maps all ex-istentially quantified variables in H to fresh variables as follows : for each existentialvariable z we have that π s ( z ) = z ( R,π ) . The factbase F ∪ π s ( H ) is called an imme-diate derivation from F through ( R, π ) . Given a factbase F and a ruleset R we definea derivation from F and R , denoted by D , as a (possibly infinite) sequence of triples D = ( ∅ , ∅ , F ) , D = ( R , π , F ) , D = ( R , π , F ) , . . . where F = F and every F i ( i > is an immediate derivation from F i − through a new trigger ( R i , π i ) , thatis, ( R i , π i ) = ( R j , π j ) for all i = j . The sequence of rule applications associated witha derivation is simply the sequence of its triggers ( R , π ) , ( R , π ) , . . . A subderiva- This fixed way to choose a new fresh variable allows us to always produce the same atoms fora given trigger and that is without loss of generality since each trigger appears at most once ona derivation. Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana tion of a derivation D is any derivation D ′ whose sequence of rule applications is asubsequence of the sequence of rule applications associated with D .We will introduce four chase variants, namely oblivious ( O ), semi-oblivous ( SO ),restricted ( R ), equivalent chase ( E ). As explained later, some pairs of chase variantsintroduced in the literature have similar behavior, in which case we chose to focus onone of the two. All the chase variants are derivations that comply with some conditionof applicability of the triggers. Definition 1.
Let D be a derivation of length n from a factbase F and a ruleset R , and F n the factbase obtained after the n rule applications of D . A trigger ( R, π ) is called: O - applicable on D if R is applicable on F n via π . SO - applicable on D if R is applicable on F n via π and for every trigger ( R, π ′ ) in the sequence of triggers associated with D , the restrictions of π and π ′ to thefrontier of R are not equal. R - applicable on D if R = ( B, H ) is applicable on F n via π and π cannot beextended to a homomorphism π ′ : B ∪ H → F n . E - applicable on D if R = ( B, H ) is applicable on F n via π and it does not holdthat F n ≡ F n ∪ π s ( H ) . ⊣ Note that for X ∈ { O , R , E } , the applicability of the trigger only depends on F n (hencewe can also say the trigger is X - applicable on F n ), while for the SO -chase we have totake into account the previous triggers. Note also that the definitions of O - and SO -trigger applicability allow one to extend a derivation with a rule application that doesnot add any atom, i.e., F n +1 = F n ; however, this is not troublesome since no derivationcan contain twice the same triggers.Given a derivation D , we define the rank of an atom as follows: rank ( A ) = 0 if A ∈ F , otherwise let R = ( B, H ) and ( R, π ) be the first trigger in the sequence D suchthat A ∈ π s ( H ) , then rank ( A ) = 1 + max A ′ ∈ π ( B ) { rank ( A ′ ) } . When we consider abreadth-first chase, the rank of an atom intuitively corresponds to the chase step at whichit has been generated. This notion is naturally extended to triggers: rank (( R, π )) =1 + max A ′ ∈ π ( B ) { rank ( A ′ ) } .The depth of a finite derivation is the maximal rank of one of its atoms. Finally, aderivation D is X - breadth-first (where X ∈ { O , SO , R , E } ) if it satisfies the followingtwo properties: – (1) rank compatibility: for all elements D i and D j in D with i < j , the rank of thetrigger of D i is smaller or equal to the rank of the trigger of D j , and – (2) rank exhaustiveness: for every rank k of a trigger in D , let D i = ( R i , π i , F i ) bethe last element in D such that rank (( R i , π i )) = k . Then, every trigger which is X -applicable on the subderivation D , ..., D i is of rank k + 1 . Definition 2 (Chase variants).
Let F be a factbase and R be a ruleset. We define four variants of the chase: A sequence S is a subsequence of a sequence S ′ if S ′ can be obtained from S by insertingsome (or no) elements in S .n the k -Boundedness for Existential Rules 7 An oblivious chase is any derivation D from F and R . A semi-oblivious chase is any derivation D from F and R such that for everyelement D i = ( R i , π i , F i ) of D , the trigger ( R i , π i ) is SO -applicable on the sub-derivation D , D , ..., D i − of D . A restricted chase is any derivation D from F and R such that for every element D i = ( R i , π i , F i ) of D , the trigger ( R i , π i ) is R -applicable to on the subderivation D , D , ..., D i − of D . An equivalent chase is any E -breadth-first derivation D from F and R such thatfor every element D i = ( R i , π i , F i ) of D , the trigger ( R i , π i ) is E -applicable onthe subderivation D , D , ..., D i − of D . ⊣ We will abbreviate the above chase variants with O -chase, SO -chase, R -chase, and E -chase, respectively. Unless otherwise specified, when we use the term X -chase deriva-tion, we will be referring to any of the four chase variants. Furthermore, with breadth-first X-chase derivation we will always imply X-breadth-first X-chase derivation.An X-chase derivation D from F and R is exhaustive if for all i ≥ , if a trigger ( R, π ) is X-applicable on the subderivation D , ..., D i , then there is a k ≥ i such thatone of the two following holds:1. D k = ( R, π, F k ) or2. ( R, π ) is not X-applicable on D , ..., D k .Exhaustivity is also known as fairness . An X-chase derivation is terminating if it is bothexhaustive and finite.It is well-known that for X ∈ { O , SO , E } , if there exists a terminating derivationfor a given KB, then all exhaustive derivations on this KB are terminating. This doesnot hold for the restricted chase, because the order in which rules are applied matters,as illustrated by the next example: Example 5.
We assume two rules R = p ( x, y ) → ∃ z p ( y, z ) and R = p ( x, y ) → p ( y, y ) and F = { p ( a, b ) } . Let π = { x a, y b } . Then ( R , π ) and ( R , π ) are both R -applicable. If ( R , π ) is applied first, then the derivation is terminating.However if we apply ( R , π ) first, and ( R , π ) second we produce the factbase F = { p ( a, b ) , p ( b, z ( R ,π ) ) , p ( b, b ) } and with π ′ = { x b, y z ( R ,π ) } we have that ( R , π ′ ) as well as ( R , π ′ ) are again both R -applicable. Consequently, if we alwayschoose to apply R before R then the corresponding derivation will be infinite. △ Let us now link the four previous chase variants to some other known chase variants.The semi-oblivious and skolem chases, both defined in [Mar09], lead to similar deriva-tions. Briefly, the skolem chase consists of first skolemizing the rules (by replacingexistentially quantified variables with skolem functions whose arguments are the fron-tier variables) then running the oblivious chase. Both chase variants yield isomorphicresults, in the sense that they generate exactly the same sets of atoms, up to a bijectiverenaming of nulls by skolem terms. Therefore, we chose to focus on one of the two,namely the semi-oblivious chase. The core chase [DNR08] and the equivalent chase
Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana [Roc16] have similar behaviors as well. We remind that a core of a set of atoms is oneof its minimal equivalent subsets, and that two equivalent sets of atoms have isomorphiccores. The core chase proceeds in a breadth-first manner and, at each step, performs inparallel all rule applications according to the restricted chase criterion, then computesa core of the resulting factbase. Hence, the core chase may remove at some step atomsthat were introduced at a former step. After i breadth-first steps, the equivalent chaseand the core chase yield logically equivalent factbases, and they terminate on the sameinputs. This follows from the facts that computing the core after each rule applicationor after a sequence of rule applications gives isomomorphic results, and that F i ≡ F i +1 if and only if core ( F i ) is isomorphic to core ( F i +1 ) . However, it is sometimes moreconvenient to handle the equivalent chase from a formal point of view because of itsmonotonicity (in the sense that within a derivation F i ⊆ F i +1 ).We now introduce some notions that will be central for establishing our results on k -boundedness for the different chase variants. Definition 3 (Restriction of a derivation).
Let D be a derivation from F and R .For any G ⊆ F , the restriction of D induced by G denoted by D | G , is the maximalderivation from G and R obtained by a subsequence of the trigger sequence of D . ⊣ The following example serves to demonstrate how a subset of the initial factbase in-duces the restriction of a derivation:
Example 6.
Take F = { p ( a , a ) , p ( b , b ) } , R = p ( x, y ) → ∃ z p ( y, z ) and D = ( ∅ , ∅ , F ) , ( R, π , F ) , ( R, π , F ) , ( R, π , F ) , ( R, π , F ) with π = { x/y a } , π = { x/y b } , π = { x a, y z ( R,π ) } , and π = { x z ( R,π ) , y z ( R,π ) } .The derivation D produces the factbase F = F ∪ { p ( a , z ( R,π ) ) , p ( b , z ( R,π ) ) , p ( z ( R,π ) , z ( R,π ) ) , p ( z ( R,π ) , z ( R,π ) ) } Then, if G = { p ( a, a ) } , we have D | G = ( ∅ , ∅ , G ) , ( R, π , G ) , ( R, π , G ) , ( R, π , G ) is the restriction of D induced by G where G = G ∪ { p ( a , z ( R,π ) ) , p ( z ( R,π ) , z ( R,π ) ) , p ( z ( R,π ) , z ( R,π ) ) } △ Definition 4 (Ancestors).
Let D i = ( R i , π i , F i ) be an element of a derivation D .Then every atom in π i ( B i ) is called a direct ancestor of every atom in ( F i \ F i − ) .The (indirect) ancestor relation between atoms is defined as the transitive closure ofthe direct ancestor relation. The direct and indirect ancestor relations between atomsare extended to triggers: let D j = ( R j , π j , F j ) where j < i . Then ( R j , π j ) is a directancestor of ( R i , π i ) if there is an atom in ( F j \ F j − ) which is a direct ancestor ofthe atoms in ( F i \ F i − ) . We will denote the ancestors of sets of atoms and triggersas Anc ( F, D ) and Anc (( R, π ) , D ) , respectively. The inverse of the ancestor relation iscalled the descendant relation. ⊣ n the k -Boundedness for Existential Rules 9 There is an evident correspondence between the notion of ancestors and the notionsof rank and depth. Suppose a ruleset with at most b atoms in the rules’ bodies. Thefollowing lemma results from the fact that each atom has at most b direct ancestors andthe length of a chain of ancestors cannot exceed the depth of a derivation. Lemma 1 (The ancestor clue).
Let D be an X -chase derivation from F and R . Thenfor any atom A of rank k in D , | F ∩ Anc (cid:0) A, D (cid:1) | ≤ b k ; also for any trigger ( R, π ) ofrank k in D , | F ∩ Anc (cid:0) ( R, π ) , D (cid:1) | ≤ b k .This lemma will be instrumental for proving our results on k -boundedness as it allowsone to characterize the maximal number of atoms that are needed to produce a newatom at a given chase step.In the next section, we turn our attention to the properties of the derivations that arekey to study k -boundedness. As already mentioned, the concept of boundedness was first introduced for Datalogprograms. A Datalog program is said to be bounded if the number of breadth-first stepsof a bottom-up evaluation of the program is bounded independently from any database(this notion being more precisely called uniform boundedness to distinguish it fromthe notion of program boundedness that restricts the set of predicates that may occurin the database) [GMSV93,Abi89,GP94]. Applying this concept to the more generallanguage of existential rules, and parametrizing it by the considered chase variant, X -boundedness can be specified as follows: Definition 5.
Let X ∈ { O , SO , R , E } . A ruleset R is X -bounded if there is k ∈ N such that for every factbase F , every breadth-first X -chase derivation is of depth atmost k . ⊣ This definition may seem natural, however it deserves some comments. First note thatin Datalog all exhaustive derivations have the same length but not necessarily the samedepth, as illustrated by the following example.
Example 7.
Let F = { p ( a ) } and R = { R , R , R } where R = p ( x ) → q ( x ) , R = q ( x ) → r ( x ) , R = p ( x ) → r ( x ) . Here are two exhaustive derivations: D = ( ∅ , ∅ , F ) , ( R , π, F ) , ( R , π, F ) , ( R , π, F ) D = ( ∅ , ∅ , F ) , ( R , π, F ) , ( R , π, F ) , ( R , π, F ) where π = { x a } . We can see that both derivations are exhaustive, however thedepth of D is 2 whereas the depth of D is 1. △ However, among all exhaustive derivations with Datalog rules, the class of breadth-firstderivations are of minimal depth. This remains true for the oblivious and semi-obliviouschase derivations with existential rules:
Proposition 1.
For each terminating O -chase derivation (resp. SO -chase derivation)from F and R there exists a breadth-first terminating O -chase derivation (resp. SO -chase derivation) from F and R of smaller or equal depth. Proof: If D is a terminating O -chase derivation, we can reorder the sequence of triggersassociated with D in such a way as to create a rank compatible O -chase derivation D ′ (we know that the applicability condition is not affected if we perform some ruleapplications earlier). Then D ′ is also exhaustive since the resulting factbase is the same.Moreover D ′ has to be rank exhaustive, since if a trigger is O -applicable on a factbaseat some step of the derivation, it is always O -applicable (unless it has already beenapplied). So D ′ is breadth-first.Let us now consider SO -chase derivations. For convenience in the following proof,given a trigger ( R, π ) , we slightly modify the definition of the safe extension π s : foreach existential variable z in H (the head of R ), we define π s ( z ) = z f R ( π ( x ) ,...π ( x n ) ) where f R is a fresh symbol assigned to R , and ( x , ..., x n ) is a fixed ordering of thefrontier variables in R . For brevity, we say that two triggers ( R, π ) and ( R, π ′ ) suchthat π and π ′ have the same restriction to the frontier of R are “frontier-equal”. With thenew definition, two frontier-equal triggers produce exactly the same set of atoms, i.e., π s ( H ) = π ′ s ( H ) . Since a SO -chase derivation does not have frontier-equal triggers,this modification of the names of fresh variables can be done without loss of generality.Let D be a terminating SO -chase derivation from a factbase F . We build a deriva-tion D bf from D by increasing rank as follows. Let D = D\ ( ∅ , ∅ , F ) , D bf = ( ∅ , ∅ , F ) .Starting from i = 1 , we iteratively perform the following steps:1) Let T be the set of all triggers ( R, π ) from D i − such that there is a frontier-equaltrigger ( R, π ′ ) applicable on D i − bf , and let T ′ be the set composed of one trigger ( R, π ′ ) for each ( R, π ) in T .2) If T = ∅ , D bf = D i − bf .3) Otherwise, D ibf is obtained by extending D i − bf with the triples corresponding to thetriggers in T ′ (in any order), and D i is obtained from D i − by removing the triplescorresponding to the triggers in T .We can easily check that the following conditions are fulfilled at each step of thealgorithm: (a) D ibf . D i is a well-formed derivation (b) there is a bijection between thetriggers in D and those in D ibf . D i , such that corresponding triggers are frontier-equal;(c) the depth of D ibf is less or equal to the depth of D ; (d) D ibf is a breadth-first deriva-tion. For Point (a), note that replacing ( R, π ) by ( R, π ′ ) has no impact on the name ofthe obtained fresh variables, hence no impact on triggers that use atoms produced by ( R, π ) . For Point (d), note that D ibf is rank-compatible by construction, and that it isrank-exhaustive: otherwise, there would be a trigger ( R, π ) still SO -applicable on D ,which is not possible since D is terminating.The algorithm terminates since the number of steps is upper bounded by the depthof D . Let i = d be the last step. Then, D d − = ∅ , hence, from (b), there is a bijectionbetween the triggers in D and those in D bf = D d − bf , such that corresponding triggersare frontier-equal. It follows that D bf is terminating. (cid:3) The equivalent chase, which is inspired from the core chase, is breadth-first by defi-nition. The case of the restricted chase is more complex, since, for a given factbase, n the k -Boundedness for Existential Rules 11 some exhaustive derivations may terminate, while others may not. It may happen thatall breadth-first derivations terminate (with depth less than a predefined number k ), butthere is an exhaustive non-breadth-first derivation that does not terminate. It may alsobe the case that no breadth-first derivation terminates, but there is a non-breadth-firstderivation that terminates (with predefined depth less than k ), as illustrated by the nextexample. Example 8.
Let F = { p ( a, b ) } and R = { R , R , R } with R = p ( x, y ) → ∃ z p ( y, z ) , R = p ( x, y ) → ∃ z q ( y, z ) and R = q ( y, z ) → p ( y, y ) . It is easy to see that a breadth-first R -chase derivation in this knowledge base cannot be terminating. However by ap-plying only R on F and then R on the new atom, we obtain a terminating R -chasederivation. Note also that, for any factbase, there is a terminating R -chase derivation ofdepth at most 2. △ Hence, in the case of the restricted chase, breadth-first derivations may not be deriva-tions of minimal depth. More generally, one cannot exclude that other classes of deriva-tions behave better with respect to depth. Moreover, it would be interesting to parametrizeboundedness with respect to a specific kind of derivation that would be computed bysome restricted chase algorithm. Therefore, a more general definition of boundednesscould be based on the maximal depth of a class of derivations of interest. Then, bound-edness based on breadth-first settings, as studied in this paper, could be seen as depth-based boundedness applied to breadth-first X-chase variants.Finally, the following property gives more insight on the relationships between R -chase derivations and rank-compatible R -chase derivations (we recall that breadth-firstderivations are rank-compatible derivations that are moreover rank-exhaustive). Proposition 2.
For each terminating R -chase derivation from F and R there existsa terminating rank-compatible R -chase derivation from F and R of smaller or equaldepth. Proof:
Let D be a terminating R -chase derivation from F and R . Let T D be its se-quence of associated triggers and let T be a sorting of T D such that the rank of eachelement is greater or equal to the rank of its predecessors. Note that T contains exactlythe same triggers as T D , only the order has changed. Let D ′ be the derivation definedby applying, when R -applicable, the triggers using the order of T . Because of the re-ordering, some of the triggers in T may no longer be R -applicable in D ′ . However, D ′ respects the rank compatibility property. We will show that it is a terminating R -chase derivation. Suppose that there is a new trigger ( R, π ) (not present in T ) whichis R -applicable on D ′ (with R = ( B, H ) ). Let ˆ F be the resulting factbase from D ′ .So we can say that ( R, π ) is R -applicable on ˆ F . Let ˜ F be the resulting factbase from D . Then, since ˆ F ⊆ ˜ F , we have that ( R, π ) is O -applicable on ˜ F . But because D isa terminating R -chase derivation, we know that ( R, π ) in not R -applicable on ˜ F . Let ( R , π ) , ..., ( R m , π m ) be the triggers of T D that do not appear in D ′ (i.e., were not R -applicable when constructing D ′ ). So ˜ F = ˆ F ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (1) where H , ..., H m are the heads of the rules R , ..., R m respectively. Since ( R, π ) isnot R -applicable on ˜ F we conclude that there is a homomorphism from π s ( H ) to ˜ F ,i.e., a substitution σ : vars ( π s ( H )) → terms ( ˜ F ) such that σ ( π s ( H )) ⊆ ˜ F , while σ is the identity on π ( B ) . Since ( R , π ) , ..., ( R m , π m ) are not R -applicable in D ′ we know that there are substitutions σ , ..., σ m such that for every i ∈ { , ..., m } wehave σ i : vars ( π si ( H i )) → terms ( ˆ F ) and σ i ( π si ( H i )) ⊆ ˆ F (i.e., homomorphismsfrom π si ( H i ) to F ), where σ i is the identity on π i ( B i ) . Since with σ , ..., σ m , onlynew variables are mapped to different terms (and all other variables are mapped tothemselves), we can define the substitution ˙ σ = m [ i =1 σ i which has the property that ˙ σ (cid:0) ˆ F ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (cid:1) = ˆ F (2)Moreover, the set of variables that are not identically mapped from ˙ σ is disjoint withthe variable set vars ( ˆ F ) , because the new variables created from ( R , π ) , ..., ( R m , π m ) are not present in ˆ F . Therefore the composition ˙ σ ◦ σ retains the set of new variablesin π s ( H ) as its set of variables mapped to different terms. So by 1 and σ ( π s ( H )) ⊆ ˜ F we can write ˙ σ ◦ σ (cid:0) π s ( H ) (cid:1) ⊆ ˙ σ (cid:0) ˆ F ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (cid:1) which with 2 becomes ˙ σ ◦ σ (cid:0) π s ( H ) (cid:1) ⊆ ˜ F which implies that ( R, π ) is not R -applicable on D ′ . That is a contradiction, whichleads us to conclude that no such ( R, π ) exists, therefore D ′ is a terminating R -chasederivation. (cid:3) As already mentioned, boundedness is shown to be undecidable for classes of existentialrules like Datalog. However, the practical interest of this notion lies more on whetherwe can find the particular bound k , rather than knowing that there exists one and thusthe ruleset is bounded. Because even if we cannot know whether a ruleset is boundedor not, it can be useful to be able to check a particular bound k . To this aim, we definethe notion of k -boundedness where the bound is known, and we prove its decidabilityfor three of the four chase variants. k -boundedness for some chase variants Definition 6 ( k -boundedness). Given a chase variant X , a ruleset R is X - k -bounded if for every factbase F , every breadth-first X -chase derivation is terminating with depthat most k . ⊣ Note that a ruleset which is k -bounded is also bounded, but the converse is not true. Ourapproach for testing k -boundedness is to construct a finite set of factbases whose sizedepends solely on k and R , that acts as representative of all factbases for the bound-edness problem. From this one could obtain the decidability of k -boundedness. Indeed, n the k -Boundedness for Existential Rules 13 for each representative factbase one can compute all breadth-first derivations of depth k and check if they are terminating.For analogy, it is well-known that the oblivious chase terminates on all factbases ifand only if it terminates on the so-called critical instance (i.e., the instance that containsall possible atoms on the constants occurring in rule bodies, with a special constantbeing chosen if the rule bodies have only variables) [Mar09]. However, it can be eas-ily checked that the critical instance does not provide oblivious chase derivations ofmaximal depth, hence is not suitable for our purpose of testing k -boundedness. Also,to the best of our knowledge, no representative sets of all factbases are known for thetermination of the other chase variants.In this section, we prove that k -boundedness is decidable for the oblivious, semi-oblivious (skolem) and restricted chase variants by exhibiting such representative fact-bases. A common property of these three chase variants is that redundancies can bechecked “locally” within the scope of a rank, while in the equivalent chase, redundan-cies may be “global”, in the sense by adding an atom we can suddenly make redundantatoms added by previous ranks.Following this intuition, we define the notion of hereditary chase. Definition 7.
The X -chase is said to be hereditary if, for any X -chase derivation D from F and R , the restriction of D induced by F ′ ⊆ F is an X -chase derivation. ⊣ A chase is hereditary if by restricting a derivation on a subset of a factbase we still get aderivation with no redundancies. This captures the fact that redundancies can be tested“locally”. This property is fulfilled by the oblivious, semi-oblivious and restricted chasevariants; a counter-example for the equivalent chase is given as the end of this section.
Proposition 3.
The X -chase is hereditary for X ∈ { O , SO , R } . Proof:
We assume that D is an X -chase derivation from F and R , and D | F ′ is therestriction of D induced by F ′ ⊆ F . Case O
By definition, an O -chase derivation is any sequence of immediate derivationswith distinct triggers, so the restriction of a derivation from a subfact of F is an O -chasederivation. Case SO
The condition for SO -applicability is that we do not have two triggers whichmap frontier variables in the same way. As D fulfills this condition its subsequence D | F ′ also fulfills it. Case R
The condition for R -applicability imposes that for a trigger ( R, π ) there is noextension of π that maps the head of R to F . Since D | F ′ generates a factbase includedin the factbase generated by D we conclude that R -applicability is preserved. (cid:3) Note however that when D is breadth-first, it not ensured that its restriction inducedby F ′ is still breadth-first (because the rank exhaustivness might not be satisfied). It isactually the case for the oblivious chase (since all triggers are always applied), but notfor the other variants since some rule applications that would be possible from F ′ havenot been performed in D because they were redundant in D given the whole F . Thenext examples illustrate these cases. Example 9 (Semi-oblivious chase).
Let F = { p ( a, b ) , r ( a, c ) } and R = { R = p ( x, y ) → r ( x, y ); R = r ( x, y ) →∃ z q ( x, z ); R = r ( x, y ) → t ( y ) } . Let D be the (non terminating) breadth-first deriva-tion of depth from F whose sequence of associated triggers is ( R , π ) , ( R , π ) , ( R , π ) , ( R , π ) with π = { x a, y b } and π = { x a, y c } which pro-duces r ( a, b ) , t ( c ) , q ( a, z ( R ,π ) ) , t ( b ) ; the trigger ( R , π ) is then O-applicable but notSO-applicable, as it maps equally the frontier variables as ( R , π ) . Let F ′ = { p ( a, b ) } .The restriction of D induced by F ′ includes only ( R , π ) , ( R , π ) and is a SO-chasederivation of depth , however it is not breadth-first since now ( R , π ) is SO-applicableat rank (thus the rank exhaustiveness is not satisfied). △ Example 10 (Restricted chase).
Let F = { p ( a, b ) , q ( a, c ) } and R = { R = p ( x, y ) → r ( x, y ); R = r ( x, y ) →∃ z q ( x, z ); R = r ( x, y ) → t ( x ) } . Let D be the (terminating) breadth-first derivationof depth from F whose sequence of associated triggers is ( R , π ) , ( R , π ) with π = { x a, y b } which produces { p ( a, b ) , q ( a, c ) , r ( a, b ) , t ( a ) } ; note that the trigger ( R , π ) is SO-applicable but not R-applicable because of the presence of q ( a, c ) in F .Let F ′ = { p ( a, b ) } . The restriction of D induced by F ′ is a restricted chase derivationof depth , however it is not breadth-first since now ( R , π ) is R-applicable at rank andthus has to be applied (to ensure the rank exhaustiveness of a breadth-first derivation). △ Previous examples illustrate the need for a more appropriate property focusing onbreadth-first derivations. Hence, we define another property, namely consistent hered-ity , which ensures that the restriction of a breadth-first derivation D induced by F ′ canbe extended to a breadth-first derivation (still from F ′ ). When we consider breadth-firstX-chases, heredity implies consistent heredity. Definition 8.
The X -chase is said to be consistently hereditary if for any factbase F and any breadth-first X -chase derivation D from F and R , the restriction of D inducedby F ′ ⊆ F is a subderivation of a breadth-first X -chase derivation D ′ from F ′ and R . ⊣ Proposition 4.
The X -chase is consistently hereditary for X ∈ { O , SO , R } . Proof:
Let D be a breadth-first X -chase derivation from F and R and D | F ′ the restric-tion of D induced by F ′ ⊆ F . Case O
Since D is breadth-first, it is rank compatible, and since the ordering of triggersis preserved in D | F ′ we get that D | F ′ is rank compatible. Similarly by the rank exhaus-tiveness of D , all triggers which are descendants of F ′ appear in D , so D | F ′ is also rankexhaustive. Hence D | F ′ is breadth-first. Case SO
As in the O case, we can easily see that triggers in D | F ′ are ordered byrank. Now, suppose that D | F ′ is not rank exhaustive, i.e., there are rule applications(descendants of F ′ ) that were skipped in D because they mapped the frontier variablesof a rule R in the same way that earlier rule applications (using atoms from F \ F ′ ) did.Then new triggers will be applicable in D | F ′ .Let D ′ be a derivation, called the breadth first completion of D | F ′ , constructed asfollows: for every breadth-first level κ , after sequentially applying all triggers of D | F ′ of n the k -Boundedness for Existential Rules 15 rank κ that are still SO -applicable, we complete this rank by applying all other possible SO -applicable triggers of rank κ (in any order).By construction, D ′ is a breadth-first SO -chase derivation. We will now show thatit is actually a completion of D | F ′ , in the sense that D | F ′ is a subderivation of D ′ .Indeed, suppose that the addition of a new trigger ( R, π ) at rank κ in D ′ cancels the SO -applicability of a trigger ( R, π ′ ) at rank κ ′ > κ in D | F ′ . So ( R, π ) is “frontier-equal” with ( R, π ′ ) . Then, since ( R, π ) is not in D , and D is rank-exhaustive, thereis a “frontier-equal” trigger ( R, π D ) in D at rank κ D ≤ κ ; this is not possible since ( R, π D ) would also be frontier-equal to ( R, π ′ ) , which would both belong to D , whichcontradicts the fact that D is a SO -chase derivation. Case R
Let D ′ be the breadth first completion of D | F ′ constructed similarly as in theprevious case: for every breadth-first level κ , after sequentially applying all triggersof D | F ′ of rank κ that are still R -applicable, we complete this rank by applying allother possible R -applicable triggers of rank κ (in any order). By construction, D ′ is abreadth-first R -chase derivation.We will also show that D | F ′ is a subderivation of D ′ . We do so by contradiction.Let ( R, π ) be the first trigger of D | F ′ that does not appear in D ′ .We denote by ˆ F ′ the resulting factbase after applying all the triggers that precede ( R, π ) in D | F ′ and by G the resulting factbase after applying all triggers of D ′ up to ( R, π ) (excluding ( R, π ) ). Let ( R , π ) , ..., ( R m , π m ) be the triggers that were not R -applicable in D but were R -applicable in D ′ and added before ( R, π ) . It holds that G = ˆ F ′ ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) .Now, we have assumed that ( R, π ) is not R -applicable on G , hence not present in D ′ . So, by the condition of R -applicability, there exists a homomorphism σ : π s ( H ) → G (so also σ ( π s ( H )) ⊆ G ), which behaves as the identity on π ( B ) . We denote with F i the factbase produced just before applying ( R, π ) on D . We have that ˆ F ′ ⊆ F i , hencewe get that G ⊆ F i ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) and therefore we also have σ ( π s ( H )) ⊆ F i ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (3)Now, because ( R , π ) , ..., ( R m , π m ) were not R -applicable in D we know that thereexist respective homomorphisms σ j : π sj ( H j ) → F i (so also σ j ( π sj ( H j )) ⊆ F i ), thatbehave as the identity on π j ( B j ) , for all j ∈ { , ..., m } . As the domains of all σ j restricted to existential variables are disjoint, and σ j are the identity on non-existentialvariables, we can define the substitution ˙ σ := m [ i =1 σ i . By applying ˙ σ to both sides of (3)we get ˙ σ ◦ σ ( π s ( H )) ⊆ ˙ σ (cid:0) F i ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (cid:1) (4)which, considering that ˙ σ (cid:0) F i ∪ π s ( H ) ∪ · · · ∪ π sm ( H m ) (cid:1) ⊆ F i , yields ˙ σ ◦ σ ( π s ( H )) ⊆ F i (5)The homomorphism ˙ σ ◦ σ can only substitute the set of newly created variables in π s ( H ) , hence qualifies as an extension of π , and from (5) we conclude that ( R, π ) is not R -applicable in D . That is a contradiction, hence it must be the case that ( R, π ) isindeed R -applicable in D ′ . Therefore we have shown that all triggers of D | F ′ appear in D ′ , so indeed D | F ′ is a subderivation of a breadth-first R -chase derivation from F ′ . (cid:3) The next property exploits the notion of consistent heredity to bound the size of thefactbases that have to be considered.
Proposition 5.
Let b be the maximum number of atoms in the bodies of the rules of aruleset R . Let X be any consistently hereditary chase. If there exist an F and a breadth-first X-chase R -derivation from F that is of depth at least k , then there exist an F ′ ofsize | F ′ | ≤ b k and a breadth-first X-chase R -derivation from F ′ with depth at least k . Proof:
Let D be a breadth-first X-chase derivation from F and R of depth k . Let ( R, π ) be a trigger of D of depth k . Let F ′ be the set of ancestors of ( R, π ) in F , and byLemma 1 we know that | F ′ | ≤ b k . Since the X-chase is consistently hereditary, therestriction D | F ′ (which trivially includes ( R, π ) ) is a subderivation of a breadth-firstX-chase derivation D ′ from F ′ and R . According to the proof of proposition 4, forall three consistently hereditary chase variants, D ′ was constructed as a breadth-firstcompletion of D , therefore the ranks of common triggers are preserved from D to D | F ′ and D ′ . And since D ′ includes ( R, π ) in its sequence of associated rule applications,we have that ( R, π ) has also rank k in D ′ , hence D ′ is of depth at least k . (cid:3) We are now ready to prove the main result.
Theorem 1.
Determining if a set of rules is X- k -bounded is decidable for any con-sistently hereditary chase variant X. This is in particular the case for the oblivious,semi-oblivious and restricted chase variants. Proof:
By Proposition 5, to check if all breadth-first X-chase derivations from R (withany factbase) are of depth at most k , it suffices to verify this property on all factbasesof size less or equal to b k . For a given factbase F , there is a finite number of (breadth-first) X-chase derivations from F and R of depth at most k , hence we can effectivelycompute these derivations, and check if one of them can be extended to a derivation ofdepth k + 1 . (cid:3) Finally, the following example shows that the E -chase (hence the core chase as well) isnot consistently hereditary (hence not hereditary, as it the E -chase is breadth-first). Example 11 (Equivalent chase).
Let F = { s ( b ) , p ( a, a ) , p ( a, b ) , p ( b, c ) } and R thefollowing set of rules: R = s ( y ) ∧ p ( y, z ) ∧ p ( w, z ) ∧ r ( w ) → q ( w ) R = p ( x, y ) ∧ p ( y, z ) → t ( y ) R = p ( x, x ) ∧ p ( x, y ) ∧ p ( y, z ) → ∃ w (cid:0) p ( w, z ) ∧ r ( w ) (cid:1) R = t ( y ) → r ( y ) R = p ( x, y ) → ∃ u p ( u, x ) Here we can verify that any exhaustive E-chase derivation from F and R is of depth3. Consider such a derivation D that adds atoms in the following specific order at eachbreadth-first level (for clarity, we do not use standardized names for the nulls): n the k -Boundedness for Existential Rules 17 s ( b ) , p ( a, a ) , p ( a, b ) , p ( b, c ) t ( a ) , t ( b ) , p ( w , c ) , r ( w ) , p ( w , b ) , r ( w ) , p ( w , a ) , r ( w ) q ( w ) , r ( a ) , r ( b ) , p ( u , w ) q ( b ) Below is a graphical representation of this derivation, where nodes are atoms and edgesare colored according to different triggers: p ( a, b ) p ( b, c ) p ( a, a ) s ( b ) r ( a ) r ( b ) q ( w ) p ( u , w ) q ( b ) t ( a ) t ( b ) p ( w , c ) r ( w ) r ( w ) p ( w , b ) p ( w , a ) r ( w ) ( R , π )( R , π )( R , π )( R , π )( R , π ) ( R , π )( R , π )( R , π )( R , π )( R , π ) At step 1, R is applied twice, producing t ( a ) and t ( b ) , and R is applied three times,producing p ( w , c ) , r ( w ) , p ( w , b ) , r ( w ) , p ( w , a ) and r ( w ) . Note that R and R are not applicable, and R is not E -applicable because it would produce redundantatoms. At step 2, R is applied once (producing q ( w ) ), R and R are not E -applicable, R is applied twice, and R is applied once (producing p ( u , w ) ). Finally, at step 3, R is applied, which makes all further triggers redundant, hence no other rule is E -applicable.Let F ′ = F \ { s ( b ) } . Let D F ′ be the restriction of D induced by F ′ . Here is agraphical representation of D F ′ : p ( a, b ) p ( b, c ) p ( a, a ) s ( b ) r ( a ) r ( b ) q ( w ) p ( u , w ) q ( b ) t ( a ) t ( b ) p ( w , c ) r ( w ) r ( w ) p ( w , b ) p ( w , a ) r ( w ) ( R , π )( R , π )( R , π )( R , π )( R , π ) ( R , π )( R , π )( R , π )( R , π )( R , π ) At level 2, D F ′ still produces r ( a ) , r ( b ) and p ( u , w ) but not q ( w ) , and there is nostep 3 because R is not applicable. We can see that D F ′ is not an E -chase derivationbecause the application of R at step 2 (which produces p ( u , w ) ) is now redundant(this is due to the absence of q ( w ) ). This already shows that the E -chase is not hered-itary. Moreover, we can check on D F ′ that no rule application before the application of R is able to add information on w that would make R E -applicable at step 2. Hence, D F ′ is not contained in any E -chase derivation from F ′ , which shows that the E -chaseis not consistently hereditary. Note also that any exhaustive E -chase derivation from F ′ is of depth 2 and not 3 as from F . △ In this paper, we investigated the problem of determining whether a ruleset is k -bounded, that is when the chase always halts within a predefined number of steps inde-pendently of the factbase. After discussing the concept of boundedness in breadth-firstderivations, we have shown that k -boundedness is decidable for some important chasevariants by establishing a common property that ensures decidability, namely “consis-tent heredity”. The complexity of the problem is independent from any data since thesize of the factbases to be checked depends only on k and the size of the rule bodies.Our results indicate an EXPTIME upper bound for checking k -boundedness for boththe O -chase and the SO -chase. For the R -chase, as the order of the rule applicationsmatters, one needs to check all possible derivations. This leads to a 2-EXPTIME upperbound for the R -chase. We leave for further work the study of the precise lower com-plexity bound according to each kind of chase. Finally, we leave open the question ofthe decidability of the k -boundedness for the core (or equivalent) chase. n the k -Boundedness for Existential Rules 19 References .Abi89 Serge Abiteboul. Boundedness is undecidable for datalog programs with a singlerecursive rule.
Inf. Process. Lett. , 32(6):281–287, 1989..AHV95 Serge Abiteboul, Richard Hull, and Victor Vianu, editors.
Foundations of Databases:The Logical Level . Addison-Wesley Longman Publishing Co., Inc., Boston, MA,USA, 1st edition, 1995..BLM10 Jean-Franc¸ois Baget, Michel Lecl`ere, and Marie-Laure Mugnier. Walking the decid-ability line for rules with existential variables. In
KR 2010 , 2010..BLMS09 Jean-Franc¸ois Baget, Michel Lecl`ere, Marie-Laure Mugnier, and Eric Salvat. Ex-tending decidable cases for rules with existential variables. In
IJCAI 2009 , pages677–682, 2009..BLMS11 J.-F. Baget, M. Lecl`ere, M.-L. Mugnier, and E. Salvat. On Rules with ExistentialVariables: Walking the Decidability Line.
Artificial Intelligence , 175(9-10):1620–1654, 2011..CGK08 A. Cal`ı, G. Gottlob, and M. Kifer. Taming the infinite chase: Query answering underexpressive relational constraints. In
KR’08 , pages 70–80, 2008..CGL +
05 D. Calvanese, G. De Giacomo, D. Lembo, M. Lenzerini, and R. Rosati. DL-Lite:Tractable description logics for ontologies. In
AAAI , pages 602–607, 2005..CGL09 Andrea Cal`ı, Georg Gottlob, and Thomas Lukasiewicz. A general datalog-basedframework for tractable query answering over ontologies. In
PODS 2009 , pages77–86, 2009..DNR08 A. Deutsch, A. Nash, and J. B. Remmel. The chase revisited. In
PODS , pages 149–158, 2008..FKMP05 R. Fagin, P. G. Kolaitis, R. J. Miller, and L. Popa. Data Exchange: Semantics andQuery Answering.
Theor. Comput. Sci. , 336(1):89–124, 2005..GM14 Tomasz Gogacz and Jerzy Marcinkowski. All-instances termination of chase is un-decidable. In
ICALP 2014 Proceedings, Part II , pages 293–304, 2014..GMSV93 Haim Gaifman, Harry G. Mairson, Yehoshua Sagiv, and Moshe Y. Vardi. Undecid-able optimization problems for database logic programs.
J. ACM , 40(3):683–713,1993..GOPS12 Georg Gottlob, Giorgio Orsi, Andreas Pieris, and Mantas Simkus. Datalog and itsextensions for semantic web databases. In
Reasoning Web , pages 54–77, 2012..GP94 Ir`ene Guessarian and Marcos Veloso Peixoto. About boundedness for some datalogand datalogneg programs.
J. Log. Comput. , 4(4):375–403, 1994..HKMV95 Gerd G. Hillebrand, Paris C. Kanellakis, Harry G. Mairson, and Moshe Y. Vardi. Un-decidable boundedness problems for datalog programs.
J. Log. Program. , 25(2):163–190, 1995..KRH07 M. Kr¨otzsch, S. Rudolph, and P. Hitzler. Complexity boundaries for Horn descriptionlogics. In
Proc. of AAAI , pages 452–457. AAAI Press, 2007..LMTV12 Nicola Leone, Marco Manna, Giorgio Terracina, and Pierfrancesco Veltri. Efficientlycomputable Datalog ∃ programs. In Proceedings of the Thirteenth International Con-ference on Principles of Knowledge Representation and Reasoning , KR’12, pages13–23. AAAI Press, 2012..LMU16 Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana. On bounded positiveexistential rules. In
Proceedings of the 29th International Workshop on DescriptionLogics , 2016..LTW09 C. Lutz, D. Toman, and F. Wolter. Conjunctive query answering in the descriptionlogic EL using a relational database system. In Proc. of IJCAI , pages 2070–2075,2009.0 Stathis Delivorias, Michel Lecl`ere, Marie-Laure Mugnier, and Federico Ulliana.Mar99 Jerzy Marcinkowski. Achilles, turtle, and undecidable boundedness problems forsmall datalog programs.
SIAM J. Comput. , 29(1):231–257, September 1999..Mar09 B. Marnette. Generalized schema-mappings: from termination to tractability. In
PODS , pages 13–22, 2009..MT14 Marie-Laure Mugnier and Micha¨el Thomazo. An introduction to ontology-basedquery answering with existential rules. In
Reasoning Web 2014 , pages 245–278,2014..Roc16 Swan Rocher.