Jean-Franc ¸ois Baget

Fabien Garreau

Marie-Laure Mugnier

Swan Rocher

Revisiting Chase Termination for Existential Rules and their Extension to Nonmonotonic Negation

Existential rules have been proposed for representing ontological knowledge, specifically in the context of Ontology-Based Data Access. Entailment with existential rules is undecidable. We focus in this paper on conditions that ensure the termination of a breadth-first forward chaining algorithm known as the chase. Several variants of the chase have been proposed. In the first part of this paper, we propose a new tool that allows to extend existing acyclicity conditions ensuring chase termination, while keeping good complexity properties. In the second part, we study the extension to existential rules with nonmonotonic negation under stable model semantics, discuss the relevancy of the chase variants for these rules and further extend acyclicity results obtained in the positive case.

Introduction

Existential rules (also called Datalog+/-) have been proposed for representing ontological knowledge, specifically in the context of Ontology-Based Data Access, that aims to exploit ontological knowledge when accessing data (Calì, Gottlob, and Lukasiewicz 2009a;[START_REF] Baget | Extending decidable cases for rules with existential variables[END_REF]). These rules allow to assert the existence of unknown individuals, a feature recognized as crucial for representing knowledge in an open domain perspective. Existential rules generalize lightweight description logics, such as DL-Lite and EL [START_REF] Calvanese | Tractable reasoning and efficient query answering in description logics : The DL-Lite family[END_REF]Baader, Brandt, and Lutz 2005) and overcome some of their limitations by allowing any predicate arity as well as cyclic structures.

Entailment with existential rules is known to be undecidable [START_REF] Beeri | The implication problem for data dependencies[END_REF]Chandra, Lewis, and Makowsky 1981). Many sufficient conditions for decidability, obtained by syntactic restrictions, have been exhibited in knowledge representation and database theory (see e.g., the overview in (Mugnier 2011)). We focus in this paper on conditions that ensure the termination of a breadth-first forward chaining algorithm, known as the chase in the database literature. Given a knowledge base composed of data and existential rules, the chase saturates the data by application of the rules. When it is ensured to terminate, inferences enabled by the rules can be materialized in the data, which can then be queried like a classical database, thus allowing to benefit from any database optimizations technique. Several variants of the chase have been proposed, which differ in the way they deal with redundant information [START_REF] Fagin | Data exchange : semantics and query answering[END_REF]Deutsch, Nash, and Remmel 2008;Marnette 2009). It follows that they do not behave in the same way with respect to termination. In the following, when we write the chase, we mean one of these variants. Various acyclicity notions have been proposed to ensure the halting of some chase variants. Nonmonotonic extensions to existential rules were recently considered in (Calı, Gottlob, and Lukasiewicz 2009b) with stratified negation, [START_REF] Gottlob | Equality-friendly well-founded semantics and applications to description logics[END_REF]) with well-founded semantics and [START_REF] Magka | Computing stable models for nonmonotonic existential rules[END_REF] with stable model semantics. This latter work studies skolemized existential rules and focuses on cases where a finite unique model exists.

In this paper, we tackle the following issues : Can we still extend known acyclicity notions ? Would any chase variant be applicable to existential rules provided with nonmonotonic negation, a useful feature for ontological modeling ?

1. Extending acyclicity notions. Acyclicity conditions can be classified into two main families : the first one constrains the way existential variables are propagated during the chase (e.g. [START_REF] Fagin | Data exchange : Semantics and query answering[END_REF][START_REF] Fagin | Data exchange : semantics and query answering[END_REF]Marnette 2009; [START_REF] Krötzsch | Extending decidable existential rules by joining acyclicity and guardedness[END_REF]) and the second one encodes dependencies between rules, i.e., the fact that a rule may lead to trigger another rule (e.g. (Baget 2004;Deutsch, Nash, and Remmel 2008;[START_REF] Baget | On rules with existential variables : Walking the decidability line[END_REF]). These conditions are based on different graphs, but all of them can be seen as can as forbidding "dangerous" cycles in the considered graph. We define a new family of graphs that allows to extend these acyclicity notions, while keeping good complexity properties.

2. Processing rules with nonmonotonic negation. We define a notion of stable models on nonmonotonic existential rules and provide a derivation algorithm that instantiate rules "on the fly" [START_REF] Lefèvre | A first order forward chaining approach for answer set computing[END_REF][START_REF] Dao-Tran | Omiga : an open minded grounding on-the-fly answer set solver[END_REF]. This algorithm is parametrized by a chase variant. We point out that, differently to the positive case, not all variants of the chase lead to sound procedures in presence of nonmonotonic negation ; furthermore, skolemizing existential variables or not makes a semantic difference, even when both computations terminate. Finally, we further extend acyclicity results obtained on positive rules by exploiting negative information as well.

A technical report with the proofs omit-ted for space restriction reasons is available http://www2.lirmm.fr/ ˜baget/publications/nmr2014-long.pdf.

Preliminaries

Atomsets We consider first-order vocabularies with constants but no other function symbols. An atom is of the form p(t 1 , . . . , t k ) where p is a predicate of arity k and the t i are terms, i.e., variables or constants (in the paper we denote constants by a, b, c, ... and variables by x, y, z, ...). An atomset is a set of atoms. Unless indicated otherwise, we will always consider finite atomsets. If F is an atom or an atomset, we write terms(F) (resp. vars(F), resp. csts(F)) the set of terms (resp. variables, resp. constants) that occur in F.

If F is an atomset, we write φ(F) the formula obtained by the conjunction of all atoms in F, and Φ(F) the existential closure of φ(F). We say that an atomset F entails an atomset

Q (notation F | = Q) if Φ(F) | = Φ(Q). It is well-known that F | = Q iff there exists a homomorphism from Q to F, i.e., a substitution σ : vars(F) → terms(Q) such that σ(Q) ⊆ F.
Two atomsets F and F ′ are said to be equivalent if

F | = F ′ and F ′ | = F.
If there is a homomorphism σ from an atomset F to itself (i.e., an endomorphism of F) then F and σ(F) are equivalent. An atomset F is a core if there is no homomorphism from F to one of its strict subsets. Among all atomsets equivalent to an atomset F, there exists a unique core (up to isomorphism). We call this atomset the core of F. A knowledge base is a pair K = (F, R) where F is an atomset (the set of facts) and R is a finite set of existential rules. We say that K = (F, {R 1 , . . . , R k }) entails an atomset

Existential Rules

Q (notation K | = Q) if Φ(F), Φ(R 1 ), . . . , Φ(R k ) | = Φ(Q).
The fundamental problem we consider, denoted by entailment, is the following : given a knowledge base K and an atomset Q, is it true that K | = Q ? When Φ(Q) is seen as a Boolean conjunctive query, this problem is exactly the problem of determining if K yields a positive answer to this query.

A rule R : B → H is applicable to an atomset F if there is a homomorphism π from B to F. Then the application of R to F according to π produces an atomset α(F, R, π) = F ∪ π(safe(H)), where safe(H) is obtained from H by replacing existential variables with fresh ones. An R-derivation from F is a (possibly infinite) sequence F 0 = σ 0 (F), . . . , σ k (F k ), . . . of atomsets such that ∀0 ≤ i, σ i is an endomorphism of F i (that will be used to remove redundancy in F i ) and ∀0 < i, there is a rule (R :

B → H) ∈ R and a homomorphism π i from B to σ i (F i-1 ) such that F i = α(σ i (F i-1 ), R, π i ).
Example 1 Consider the existential rule R = human(x) → hasParent(x, y), human(y) ; and the atomset F = {human(a)}. The application of R to F produces an atomset F ′ = F ∪ {hasParent(x, y 0 ), human(y 0 )} where y 0 is a fresh variable denoting an unknown individual. Note that R could be applied again to F ′ (mapping x to y 0 ), which would create another existential variable and so on. et al. 2011).

A finite R-derivation F 0 , . . . , F k from F is said to be from F to F k . Given a knowledge base K = (F, R), K | = Q iff there exists a finite R-derivation from F to F ′ such that F ′ | = Q (Baget
Let R i and R j be rules, and F be an atomset such that R i is applicable to F by a homomorphism π ; a homomorphism π ′ from B j to

F ′ = α(F, R i , π) is said to be new if π ′ (B j ) F. Given a rule R = B → H, a homomorphism π from B to F is said to be useful if it cannot be extended to a homomorphism from B ∪ H to F ; if π is not useful then α(F, R, π) is equiva- lent to F, but this is not a necessary condition for α(F, R, π) to be equivalent to F.

Chase Termination

An algorithm that computes an R-derivation by exploring all possible rule applications in a breadth-first manner is called a chase. In the following, we will also call chase the derivation it computes. Different kinds of chase can be defined by using different properties to compute F ′ i = σ i (F i ) in the derivation (hereafter we write F ′ i for σ i (F i ) when there is no ambiguity). All these algorithms are sound and complete w.r.t. the entailment problem in the sense that (

F, R) | = Q iff they provide in finite (but unbounded) time a finite R- derivation from F to F k such that F k | = Q.

Different kinds of chase

In the oblivious chase (also called naive chase), e.g., (Calì, Gottlob, and Kifer 2008), a rule R is applied according to a homomorphism π only if it has not already been applied according to the same homomorphism. Let

F i = α(F ′ i-1 , R, π), then F ′ i = F ′ i-1 if R was previously applied according to π, otherwise F ′ i = F i .
This can be slightly improved. Two applications π and π ′ of the same rule add the same atoms if they map frontier variables identically (for any frontier variable x of R, π(x) = π ′ (x)) ; we say that they are frontier-equal. In the frontier chase, let

F i = α(F ′ i-1 , R, π), we take F ′ i = F ′ i-1 if R was previously applied according to some π ′ frontier-equal to π, otherwise F ′ i = F i .
The skolem chase (Marnette 2009) relies on a skolemisation of the rules : a rule R is transformed into a rule skolem(R) by replacing each occurrence of an existential variable y with a functional term f R y ( x), where x are the frontier variables of R. Then the oblivious chase is run on skolemized rules. It can easily be checked that frontier chase and skolem chase yield isomorphic results, in the sense that they generate exactly the same atomsets, up to a bijective renaming of variables by skolem terms.

The restricted chase (also called standard chase) [START_REF] Fagin | Data exchange : semantics and query answering[END_REF]) detects a kind of local redundancy. Let

F i = α(F ′ i-1 , R, π), then F ′ i = F i if π is useful, otherwise F ′ i = F ′ i-1 .
The core chase (Deutsch, Nash, and Remmel 2008) considers the strongest possible form of redundancy : for any F i , F ′ i is the core of F i .

A chase is said to be local if ∀i ≤ j, F ′ i ⊆ F ′ j . All chase variants presented above are local, except for the core chase. This property will be critical for nonmonotonic existential rules.

Chase termination Since entailment is undecidable, the chase may not halt. We call C-chase a chase relying on some criterion C to generate σ(F i ) = F ′ i . So C can be oblivious, skolem, restricted, core or any other criterion that ensures the equivalence between F i and F ′ i . A C-chase generates a possibly infinite R-derivation σ 0 (F), σ 1 (F 1 ), . . . , σ k (F k ), . . . We say that this derivation produces the (possibly infinite) atomset (F, R)

C = ∪ 0≤i≤∞ σ i (F i )\∪ 0≤i≤∞ (σ i (F i )), where (σ i (F i )) = F i \ σ(F i ).
Note that this produced atomset is usually defined as the infinite union of the σ i (F i ). Both definitions are equivalent when the criterion C is local. But the usual definition would produce too big an atomset with a non-local chase such as the core chase : an atom generated at step i and removed at step j would still be present in the infinite union. We say that a (possibly infinite) derivation obtained by the C-chase is complete when any further rule application on that derivation would produce the same atomset. A complete derivation obtained by any C-chase produces a universal model (i.e., most general) of (F, R) : for any atomset Q, we have

F, R | = Q iff (F, R) C | = Q.
We say that the C-chase halts on (F, R) when the C-chase generates a finite complete R-derivation from F to F k . Then (F, R) C = σ k (F k ) is a finite universal model. We say that R is universally C-terminating when the C-chase halts on (F, R) for any atomset F. We call C-finite the class of universally C-terminating sets of rules. It is well known that the chase variants do not behave in the same way w.r.t. termination.

The following examples highlight these different behaviors.

Example 2 (Oblivious / Skolem chase) Let R = p(x, y) → p(x, z) and F = {p(a, b)}. The oblivious chase does not halt : it adds p(a, z 0 ), p(a, z 1 ), etc. The skolem chase considers the rule p(x, y) → p(x, f R z (x)) ; it adds p(a, f R y (a)) then halts. Example 3 (Skolem / Restricted chase) Let R : p(x) → r(x, y), r(y, y), p(y) and F = {p(a)}. The skolem chase does not halt : at Step 1, it maps x to a and adds r(a, f R y (a)), r( f R y (a), f R y (a)) and p( f R y (a)) ; at step 2, it maps x to f R y (a) and adds r( f R y (a), f R y ( f R y (a))), etc. The restricted chase performs a single rule application, which adds r(a, y 0 ), r(y 0 , y 0 ) and p(y 0 ) ; indeed, the rule application that maps x to y 0 yields only redundant atoms w.r.t. r(y 0 , y 0 ) and p(y 0 ).

Example 4 (Restricted

/ Core chase) Let F = s(a), R 1 = s(x) → p(x, x 1 ), p(x, x 2 ), r(x 2 , x 2 ), R 2 = p(x,
y) → q(y) and R 3 = q(x) → r(x, y), q(y). Note that R 1 creates redundancy and R 3 could be applied indefinitely if it were the only rule. R 1 is the first applied rule, which creates new variables, called x 1 and x 2 for simplicity. The restricted chase does not halt : R 3 is not applied on x 2 because it is already satisfied at this point, but it is applied on x 1 , which creates an infinite chain. The core chase applies R 1 , computes the core of the result, which removes p(a, x 1 ), then halts.

It is natural to consider the oblivious chase as the weakest form of chase and necessary to consider the core chase as the strongest form of chase (since the core is the minimal representative of its equivalence class). We say that a criterion C is stronger than C ′ and write C ≥ C ′ when C ′ -finite ⊆ C-finite. We say that C is strictly stronger than C ′ (and write

C > C ′ ) when C ≥ C ′ and C ′ C.
It is well-known that core > restricted > skolem > oblivious. An immediate remark is that core-finite corresponds to finite expansion sets (fes) defined in [START_REF] Baget | The Complexity of Rules and Constraints[END_REF]. To sum up, the following inclusions hold between C-finite classes : oblivious-finite ⊂ skolem-finite = frontier-finite ⊂ restricted-finite ⊂ core-finite = fes.

Known Acyclicity Notions

We can only give a brief overview of known acylicity notions, which should however allow to place our contribution within the existing landscape. A comprehensive taxonomy can be found in (Cuenca [START_REF] Grau | Acyclicity notions for existential rules and their application to query answering in ontologies[END_REF].

Acyclicity notions ensuring that some chase variant terminates can be divided into two main families, each of them relying on a different graph : a "position-based" approach which basically relies on a graph encoding variable sharing between positions in predicates and a "rule dependency approach" which relies on a graph encoding dependencies between rules, i.e., the fact that a rule may lead to trigger another rule (or itself).

Position-based approach

In the position-based approach, cycles identified as dangerous are those passing through positions that may contain existential variables ; intuitively, such a cycle means that the creation of an existential variable in a given position may lead to create another existential variable in the same position, hence an infinite number of existential variables. Acyclicity is then defined by the absence of dangerous cycles. The simplest notion of acyclicity in this family is that of weak acyclicity (wa) [START_REF] Fagin | Data exchange : Semantics and query answering[END_REF]) [START_REF] Fagin | Data exchange : semantics and query answering[END_REF], which has been widely used in databases. It relies on a directed graph whose nodes are the positions in predicates (we denote by (p, i) the position i in predicate p). Then, for each rule R : B → H and each variable x in B occurring in position (p, i), edges with origin (p, i) are built as follows : if x is a frontier variable, there is an edge from (p, i) to each position of x in H ; furthermore, for each existential variable y in H occurring in position (q, j), there is a special edge from (p, i) to (q, j). A set of rules is weakly acyclic if its associated graph has no cycle passing through a special edge.

Example 5 (Weak-acyclicity)

Let R 1 = h(x) → p(x, y),
where y is an existential variable, and

R 2 = p(u, v), q(v) → h(v). The position graph of {R 1 , R 2 } contains a special edge from (h, 1) to (p, 2) due to R 1 and an edge from (p, 2) to (h, 1) due to R 2 , thus {R 1 , R 2 } is not wa.
Weak-acyclicity has been generalized, mainly by shifting the focus from positions to existential variables (jointacyclicity (ja) [START_REF] Krötzsch | Extending decidable existential rules by joining acyclicity and guardedness[END_REF] or to positions in atoms instead of predicates (super-weak-acyclicity (swa) (Marnette 2009)). Other related notions can be imported from logic programming, e.g., finite domain (fd) [START_REF] Calimeri | Computable functions in asp : Theory and implementation[END_REF]) and argument-restricted (ar) [START_REF] Lierler | One more decidable class of finitely ground programs[END_REF]. See the first column in Figure 1, which shows the inclusions between the corresponding classes of rules (all these inclusions are known to be strict).

Rule Dependency

In the second approach, the aim is to avoid cyclic triggering of rules (Baget 2004;[START_REF] Baget | Extending decidable cases for rules with existential variables[END_REF]Deutsch, Nash, and Remmel 2008;Cuenca Grau et al. 2012). We say that a rule R 2 depends on a rule R 1 if there exists an atomset F such that R 1 is applicable to F according to a homomorphism π and R 2 is applicable to F ′ = α(F, R 1 , π) according to a new useful homomorphism. This abstract dependency relation can be effectively computed with a unification operation known as piece-unifier [START_REF] Baget | Extending decidable cases for rules with existential variables[END_REF]). Piece-unification takes existential variables into account, hence is more complex than the usual unification between atoms. A piece-unifier of a rule body B 2 with a rule head H 1 is a substitution

µ of vars(B ′ 2 ) ∪ vars(H ′ 1 ), where B ′ 2 ⊆ B 2 and H ′ 1 ⊆ H 1 , such that (1) µ(B ′ 2 ) = µ(H ′ 1 )
µ = {(u, x), (v, y)}, with B ′ 2 = p(u, v
) and H ′ 1 = H 1 , is not a piece-unifier because v is unified with an existential variable, whereas it is a separating variable of B ′ 2 (thus, q(v) should be included in B ′ 2 , which is impossible). Thus R 2 does not depend on R 1 .

The graph of rule dependencies of a set of rules R, denoted by GRD(R), encodes the dependencies between rules in R. It is a directed graph with set of nodes R and an edge (R i , R j ) if R j depends on R i (intuition : "R i may lead to trigger R j in a new way"). E.g., considering the rules in Example 6, the only edge is (R 2 , R 1 ).

When the GRD is acyclic (aGRD, (Baget 2004)), any derivation sequence is necessarily finite. This notion is incomparable with those based on positions.

We point out here that the oblivious chase may not stop on wa rules. Thus, the only acyclicity notion in Figure 1 that ensures the termination of the oblivious chase is aGRD since all other notions generalize wa.

Combining both approches Both approaches have their weaknesses : there may be a dangerous cycle on positions but no cycle w.r.t. rule dependencies (see the preceeding examples), and there may be a cycle w.r.t. rule dependencies whereas rules contain no existential variables (e.g. p(x, y) → p(y, x), q(x)). Attempts to combine both notions only succeded to combine them in a "modular way" : if the rules in each strongly connected component (s.c.c.) of the GRD belong to a fes class, then the set of rules is fes (Baget 2004;Deutsch, Nash, and Remmel 2008). More specifically, it is Figure 1 -Relations between recognizable acyclicity properties. All inclusions are strict and complete (i.e., if there is no path between two properties then they are incomparable).

easy to check that if for a given C-chase, each s.c.c. is Cfinite, then the C-chase stops.

In this paper, we propose an "integrated" way of combining both approaches, which relies on a single graph. This allows to unify preceding results and to generalize them without complexity increasing (the new acyclicity notions are those with a gray background in Figure 1).

Finally, let us mention model-faithful acyclicity (mfa) (Cuenca [START_REF] Grau | Acyclicity conditions and their application to query answering in description logics[END_REF], which generalizes the previous acyclicity notions and cannot be captured by our approach. Briefly, mfa involves running the skolem chase until termination or a cyclic functional term is found. The price to pay for the generality of this property is high complexity : checking if a set of rules is universally mfa (i.e., for any set of facts) is 2EXPTIME-complete. Checking modelsummarizing acyclicity (msa), which approximates mfa, remains EXPTIME-complete. In contrast, checking positionbased properties is in PTIME and checking agrd is also co-NP-complete. Sets of rules satisfying mfa are skolem-finite (Cuenca [START_REF] Grau | Acyclicity conditions and their application to query answering in description logics[END_REF], thus all properties studied in this paper ensure C-finiteness, when C ≥ skolem.

Extending Acyclicity Notions

In this section, we combine rule dependency and propagation of existential variables into a single graph. W.l.o.g. we assume that distinct rules do not share any variable. Gi-ven an atom a = p(t 1 , . . . , t k ), the i th position in a is denoted by <a, i>, with pred(<a, i>) = p and term(<a, i>) = t i . If A is an atomset such that a ∈ A, we say that <a, i> is in A. If term(<a, i>) is an existential (resp. frontier) variable, <a, i> is called an existential (resp. frontier) position. In the following, we use "position graph" as a generic name to denote a graph whose nodes are positions in atoms.

We first define the notion of a basic position graph, which takes each rule in isolation. Then, by adding edges to this graph, we define three position graphs with increasing expressivity, i.e., allowing to check termination for increasingly larger classes of rules.

Definition 1 ((Basic) Position Graph (PG))

The position graph of a rule R : B → H is the directed graph PG(R) defined as follows :

-there is a node for each <a, i> in B or in H ; -for all frontier positions <b, i>∈ B and all <h, j>∈ H, there is an edge from <b, i> to <h, j> if term(<b, i>) = term(<h, j>) or if <h, j> is existential. Given a set of rules R, the basic position graph of R, denoted by PG(R), is the disjoint union of PG(R i ), for all R i ∈ R.

An existential position <a, i> is said to be infinite if there is an atomset F such that running the chase on F produces an unbounded number of instantiations of term(<a, i>). To detect infinite positions, we encode how variables may be "propagated" among rules by adding edges to PG(R), called transition edges, which go from positions in rule heads to positions in rule bodies. The set of transition edges has to be correct : if an existential position <a, i> is infinite, there must be a cycle going through <a, i> in the graph.

We now define three position graphs by adding transition edges to PG(R), namely PG F (R), PG D (R) and PG U (R). All three graphs have correct sets of edges. Intuitively, PG F (R) corresponds to the case where all rules are supposed to depend on all rules ; its set of cycles is in bijection with the set of cycles in the predicate position graph defining weakacyclicity. PG D (R) encodes actual paths of rule dependencies. Finally, PG U (R) adds information about the pieceunifiers themselves. This provides an accurate encoding of variable propagation from an atom position to another.

Definition 2 (PG X ) Let R be a set of rules. The three following position graphs are obtained from PG(R) by adding a (transition) edge from each k th position <h, k> in a rule head H i to each k th position <b, k> in a rule body B j , with the same predicate, provided that some condition is satisfied :

-full PG, denoted by PG F (R) : no additional condition ; -dependency PG, denoted by PG D (R) : if R j depends directly or indirectly on R i , i.e., if there is a path from R i to R j in GRD(R) ; -PG with unifiers, denoted by PG U (R) : if there is a piece-unifier µ of B j with the head of an agglomerated rule R j i such that µ(term

([b, k])) = µ(term([h, k]))
, where R j i is formally defined below (Definition 3) An agglomerated rule associated with (R i , R j ) gathers information about selected piece-unifiers along (some) paths from R i to (some) predecessors of R j . Definition 3 (Agglomerated Rule) Given R i and R j rules from R, an agglomerated rule associated with (R i , R j) has the following form :

h(x) p(x, y) p(x, y) p(u, v) p(u, v) q(v) h(v)
R j i = B i ∪ t∈T ⊆terms(H i ) fr(t) → H i
where fr is a new unary predicate that does not appear in R, and the atoms fr(t) are built as follows. Let P be a non-empty set of paths from R i to direct predecessors of R j in GRD(R). Let P = (R 1 , . . . , R n ) be a path in P. One can associate a rule R P with P by building a sequence 2 pictures PG F (R) and PG D (R). The dashed edges belong to PG F (R) but not to PG D (R). Indeed, R 2 does not depend on R 1 . PG F (R) has a cycle while PG D (R) has not.

R 1 = R p 1 , . . . , R p n = R P such that ∀1 ≤ l < n,
P |P ∈ P} is R j i = P∈P R P . Proposition 1 (Inclusions between PG X ) Let R be a set of rules. PG U (R) ⊆ PG D (R) ⊆ PG F (R). Furthermore, PG D (R) = PG F (R) if the transitive closure of GRD(R) is a complete graph. Example 7 (PG F and PG D ) Let R = {R 1 , R 2 } from Example 5. Figure
Example 8 (PG D and PG U ) Let R = {R 1 , R 2 }, with R 1 = t(x, y) → p(z, y), q(y) and R 2 = p(u, v), q(u) → t(v, w). In Figure 3, the dashed edges belong to PG D (R) but not to PG U (R). Indeed, the only piece-unifier of B 2 with H 1 unifies u and y. Hence, the cycle in PG D (R) disappears in PG U (R).

We now study how acyclicity properties can be expressed on position graphs. The idea is to associate, with an acyclicity property, a function that assigns to each position a subset of positions reachable from this position, according to some propagation constraints ; then, the property is fulfilled if no existential position can be reached from itself. More precisely, a marking function Y assigns to each node <a, i> in a position graph PG X , a subset of its (direct or indirect) successors, called its marking. A marked cycle for <a, i> (w.r.t.

X and Y) is a cycle C in PG X such that <a, i>∈ C and for all <a ′ , i ′ >∈ C, <a ′ , i ′ > belongs to the marking of <a, i>. Obviously, the less situations there are in which the marking may "propagate" in a position graph, the stronger the acyclicity property is.

Definition 4 (Acyclicity property)

Let Y be a marking function and PG X be a position graph. The acyclicity property associated with Y in PG X , denoted by Y X , is satisfied if there is no marked cycle for an existential position in PG X . If Y X is satisfied, we also say that PG X (R) satisfies Y.

For instance, the marking function associated with weakacyclicity assigns to each node the set of its successors in PG F (R), without any additional constraint. The next proposition states that such marking functions can be defined for each class of rules between wa and swa (first column in Figure 1), in such a way that the associated acyclicity property in PG F characterizes this class.

Proposition 2 A set of rules R is wa (resp. f d, ar, ja, swa) iff PG F (R) satisfies the acyclicity property associated with wa-(resp. f d-, ar-, ja-, swa-) marking.

As already mentioned, all these classes can be safely extended by combining them with the GRD. To formalize this, we recall the notion Y < from (Cuenca [START_REF] Grau | Acyclicity notions for existential rules and their application to query answering in ontologies[END_REF]) : given an acyclicity property Y, a set of rules R is said to satisfy Y < if each s.c.c. of GRD(R) satisfies Y, except for those composed of a single rule with no loop. 1 Whether R satisfies Y < can be checked on PG D (R) :

Proposition 3 Let R be a set of rules, and Y be an acyclicity property

. R satisfies Y < iff PG D (R) satisfies Y, i.e., Y < = Y D .
For the sake of brevity, if Y 1 and Y 2 are two acyclicity properties, we write Y 1 ⊆ Y 2 if any set of rules satisfying Y 1 also satisfies Y 2 . The following results are straightforward.

Proposition 4 Let Y 1 , Y 2 be two acyclicity properties. If Y 1 ⊆ Y 2 , then Y D 1 ⊆ Y D 2 . Proposition 5 Let Y be an acyclicity property. If a-grd Y then Y ⊂ Y D .
Hence, any class of rules satisfying a property Y D strictly includes both a-grd and the class characterized by Y ; (e.g., 1. This particular case is to cover aGRD, in which each s.c.c. is an isolated node.

t(x, y) t(x, y)

p(z, y) p(z, y)

q(y) p(u, v) p(u, v) q(u) t(v, w) t(v, w)
R i = B i [ X, Y] → H i [ Y, Z] ∈ R, let R i,1 = B i [ X, Y] → p i ( X, Y) where p i is a fresh predicate ; and R i,2 = p i ( X, Y) → H i [ Y, Z]. Then, for each rule R i,1 , let R ′ i,1 be the rule (B ′ i,1 → H i,1 ) with B ′ i,1 = B i,1 ∪ {p ′ j,i (x j,i ) : ∀R j ∈ R}
, where p ′ j,i are fresh predicates and x j,i fresh variables. Now, for each rule R i,2 , let R ′ i,2 be the rule

(B i,2 → H ′ i,2 ) with H ′ i,2 = H i,2 ∪ {p ′ i, j (z i, j ) : ∀R j ∈ R}, where z i, j are fresh existential variables. Let R ′ = R i ∈R {R ′ i,1 , R ′ i,2 }. This construction ensures that each R ′ i,2 depends on R ′ i,1 , and each R ′ i,1 depends on each R ′ j,2 , thus, there is a transition edge from each R ′ i,1 to R ′ i,2 and from each R ′ j,2 to each R ′ i,1
. Hence, PG D (R ′ ) contains exactly one cycle for each cycle in PG F (R). Furthermore, PG D (R ′ ) contains at least one marked cycle w.r.t. Y, and then R ′ does not satisfy Y D . Now, each cycle in PG U (R ′ ) is also a cycle in PG D (R), and, since PG D (R) satisfies Y, PG U (R ′ ) also does. Hence, R ′ does not belong to Y D but to Y U .

We also check that strict inclusions in the second column in Figure 1 lead to strict inclusions in the third column.

Theorem 2 Let Y 1 and Y 2 be two acyclicity properties. If

Y D 1 ⊂ Y D 2 then Y U 1 ⊂ Y U 2 . Proof: Let R be a set of rules such that R satisfies Y D 2 but does not satisfy Y D 1 .
We rewrite R into R ′ by applying the following steps. For each pair of rules R i , R j ∈ R such that there is a dependency path from R i to R j ,for each variable x in the frontier of R j and each variable y in the head of R i , if x and y occur both in a given predicate position, we add to the body of R j a new atom p i, j,x,y (x) and to the head of R i a new atom p i, j,x,y (y), where p i, j,x,y denotes a fresh predicate. This construction allows each term from the head of R i to propagate to each term from the body of R j , if they share some predicate position in R. Thus, any cycle in PG D (R) is also in PG U (R ′ ), without any change in the behavior w.r.t. the acyclicity properties. Hence R ′ satisfies Y U 2 but does not satisfy Y U 1 . The next result states that Y U is a sufficient condition for chase termination :

Theorem 3 Let Y be an acyclicity property ensuring the halting of some chase variant C. Then, the C-chase halts for any set of rules R that satisfies Y U (hence Y D ).

Example 9 Consider again the set of rules R from Example 8. Figure 3 pictures the associated position graphs PG D (R) and PG U (R). R is not aGRD, nor wa, nor wa D since PG D (R) contains a (marked) cycle that goes through the existential position <t(v, w), 2>. However, R is obviously wa U since PG U (R) is acyclic. Hence, the skolem chase and stronger chase variants halt for R and any set of facts.

Finally, we remind that classes from wa to swa can be recognized in PTIME, and checking a-grd is coNP-complete. Hence, as stated by the next result, the expressiveness gain is without increasing worst-case complexity.

Theorem 4 (Complexity) Let Y be an acyclicity property, and R be a set of rules.

If checking that R satisfies Y is in coNP, then checking that R satisfies Y D or Y U is coNP- complete.

Further Refinements

Still without complexity increasing, we can further extend Y U into Y U + by a finer analysis of marked cycles and unifiers. We define the notion of incompatible sequence of unifiers, which ensures that a given sequence of rule applications is impossible. Briefly, a marked cycle for which all sequences of unifiers are incompatible can be ignored. Beside the gain for positive rules, this refinement will allow one to take better advantage of negation.

We first point out that the notion of piece-unifier is not appropriate to our purpose. We have to relax it, as illustrated by the next example. We call unifier, of a rule body B 2 with a rule head H 1 , a substitution µ of vars(B ′ 2 ) ∪ vars(H ′ 1 ), where

B ′ 2 ⊆ B 2 and H ′ 1 ⊆ H 1 , such that µ(B ′ 2 ) = µ(H ′ 1 )

(thus, it satisfies Condition (1) of a piece-unifier).

Example 10 Let R = {R 1 , R 2 , R 3 , R 4 } with : R 1 : p(x 1 , y 1 ) → q(y 1 , z 1 ) R 2 : q(x 2 , y 2 ) → r(x 2 , y 2 ) R 3 : r(x 3 , y 3 ) ∧ s(x 3 , y 3 ) → p(x 3 , y 3 ) R 4 : q(x 4 , y 4 ) → s(x 4 , y 4 ) There is a dependency cycle (R 1 , R 2 , R 3 , R 1 ) and a corresponding cycle in PG U . We want to know if such a sequence of rule applications is possible. We build the following new rule, which is a composition of R 1 and R 2 (formally defined later) : R 1 ⋄ µ R 2 : p(x 1 , y 1 ) → q(y 1 , z 1 ) ∧ r(y 1 , z 1 ) There is no piece-unifier of R 3 with R 1 ⋄ µ R 2 , since y 3 would be a separating variable mapped to the existential variable z 1 . This actually means that R 3 is not applicable right after R 1 ⋄ µ R 2 . However, the atom needed to apply s(x 3 , y 3 ) can be brought by a sequence of rule applications (R 1 , R 4 ). We thus relax the notion of piece-unifier to take into account arbitrary long sequences of rule applications.

Definition 5 (Compatible unifier)

Let R 1 and R 2 be rules. A unifier µ of B 2 with H 1 is compatible if, for each position <a, i> in B ′ 2 , such that µ(term(<a, i>)) is an existential variable z in H ′ 1 , PG U (R) contains a path, from a position in which z occurs, to <a, i>, that does not go through another existential position. Otherwise, µ is incompatible.

Note that a piece-unifier is necessarily compatible.

Proposition 7 Let R 1 and R 2 be rules, and let µ be a unifier of B 2 with H 1 . If µ is incompatible, then no application of R 2 can use an atom in µ(H 1 ).

We define the rule corresponding to the composition of R 1 and R 2 according to a compatible unifier, then use this notion to define a compatible sequence of unifiers.

Definition 6 (Unified rule, Compatible sequence of unifiers)

• Let R 1 and R 2 be rules such that there is a compatible unifier µ of B 2 with H 1 . The associated unified rule

R µ = R 1 ⋄ µ R 2 is defined by H µ = µ(H 1 ) ∪ µ(H 2 ), and B µ = µ(B 1 ) ∪ (µ(B 2 ) \ µ(H 1 )). • Let (R 1 , . . . , R k+1 ) be a sequence of rules. A sequence s = (R 1 µ 1 R 2 . . . µ k R k+1 ), where, for 1 ≤ i ≤ k, µ i is a unifier of B i+1 with H i , is a compatible sequence of unifiers if : (1) µ 1 is a compatible unifier of B 2 with H 1 , and (2) if k > 0, the sequence obtained from s by replacing (R 1 µ 1 R 2 ) with R 1 ⋄ µ 1 R 2 is a compatible sequence of unifiers. E.g., in Example 10, the sequence (R 1 µ 1 R 2 µ 2 R 3 µ 3 R 1 ),
with the obvious µ i , is compatible. We can now improve all previous acyclicity properties (see the fourth column in Figure 1).

Definition 7 (Compatible cycles)

Let Y be an acyclicity property, and PG U be a position graph with unifiers. The compatible cycles for <a, i> in PG U are all marked cycles C for <a, i> wrt Y, such that there is a compatible sequence of unifiers induced by C. Property Y U+ is satisfied if, for each existential position <a, i>, there is no compatible cycle for <a, i> in PG U .

Results similar to Theorem 1 and Theorem 2 are obtained for Y U + w.r.t. Y U , namely :

-For any acyclicity property Y, Y U ⊂ Y U+ .

-For any acyclicity properties Y 1 and

Y 2 , if Y U 1 ⊂ Y U 2 , then Y U+ 1 ⊂ Y U+
2 . Moreover, Theorem 3 can be extended to Y U + : let Y be an acyclicity property ensuring the halting of some chase variant C ; then the C-chase halts for any set of rules R that satisfies Y U + (hence Y U ). Finally, the complexity result from Theorem 4 still holds for this improvement.

Handling Nonmonotonic Negation

We now add nonmonotonic negation, which we denote by not. A nonmonotonic existential rule

(NME rule) R is of the form (B + , notB - 1 , . . . , notB - k → H), where B + , B - i
and H are atomsets, respectively called the positive body, the negative bodies and the head of R. Note that we generalize the usual notion of negative body by allowing to negate conjunctions of atoms. Moreover, the rule head may contain several atoms. However, we impose a safeness condition : (H). We write pos(R) the existential rule obtained from R by removing its negative bodies, and pos(R) the set of all pos(R) rules, for R ∈ R.

∀1 ≤ i ≤ k, vars(B - i ) ⊆ vars(B + ). The formula assigned to R is Φ not (R) = ∀ x∀ y(φ(B + ) ∧ notφ(B - 1 ), . . . , notφ(B - k ) → ∃ zφ

About our Stable Model Semantics

Answer Set Programming (Gelfond 2007) introduced stable model semantics for propositional logic, and was naturally extended to grounded programs (i.e., sets of NME rules without variables). In this framework, the semantics can be provided through the Gelfond-Lifschitz reduct operator that allows to compute a saturation (i.e., a chase) using only grounded NME rules. This semantics can be easily extended to rules with no existential variable in the head, or to skolemized NME rules, as done, for instance, in [START_REF] Magka | Computing stable models for nonmonotonic existential rules[END_REF]. The choice of the chase/saturation mechanism is here irrelevant, since no such mechanism can produce any redundancy.

The problem comes when considering existential variables in the head of rules. Several semantics have been proposed in that case, for instance circumscription in (Ferraris, Lee, and Lifschitz 2011), or justified stable models in [START_REF] You | Disjunctive logic programs with existential quantification in rule heads[END_REF]. We have chosen not to adopt circumscription since it translates NME rules to second-order expressions, and thus would not have allowed to build upon results obtained in the existential rule formalism. In the same way, we have not considered justified stable models, whose semantics does not correspond to stable models on grounded rules, as shown by the following example : Example 11 Let Π 1 = {∅ → p(a); p(a), not q(a) → t(a).} be a set of ground NME rules. Then {p(a); q(a)} is a justified stable model, but not a stable model. Let Π 2 = {∅ → p(a); p(a), not q(b) → t(a)} . Then {p(a); t(a)} is a stable model but not a justified stable model.

Let us now recast the Gelfond-Lifschitz reduct-based semantics in terms of the skolem-chase. Essentially (we will be more precise in the next section), a stable model M is a possibly infinite atomset produced by a skolem-chase that respects some particular conditions :

-all rule applications are sound, i.e., none of its negative bodies can be found in the stable model produced (the rule is not blocked) ; -the derivation is complete, i.e., any rule applicable and not blocked is applied in the derivation. In the next subsection, we formally define the notion of a stable model, while replacing the skolem-chase with any Cchase. We thus obtain a family of semantics parameterized by the considered chase, and define different notions of Cstable models.

On the Chase and Stable Models

We define a notion of stable model directly on nonmonotonic existential rules and provide a derivation algorithm inspired from the notion of computation in [START_REF] Liu | Logic programs with abstract constraint atoms : The role of computations[END_REF] and Answer Set Programming solvers that instantiate rules on the fly [START_REF] Lefèvre | A first order forward chaining approach for answer set computing[END_REF][START_REF] Dao-Tran | Omiga : an open minded grounding on-the-fly answer set solver[END_REF]) instead of grounding rules before applying them. The difference with our framework is that they consider normal logic programs, which are a generalization of skolemized NME rules.

A natural question is then to understand if the choice of a chase mechanism has an impact, not only on the termination, but also on the semantics. Thus, we consider the chase as a parameter. Intuitively, a C-stable set A is produced by a C-chase that, according to (Gelfond 2007), must satisfy the NME rules (we say that it is sound, i.e., that no negative body appearing in the chase is in A) and the rationality principle (the sound chase does not generate anything that cannot be believed, and it must be complete : any rule application not present in the chase would be unsound).

To define C-stable sets, we first need to introduce additional notions. A NME R-derivation from F is a pos(R)-derivation from R. This derivation D = (F 0 = σ 0 (F), . . . , σ k (F k ), . . .) produces a possibly infinite atomset A. Let R be a NME rule such that pos(R) was applied at some step i in D, i.e., F i+1 = α(σ i (F i ), pos(R), π i ). We say that this application is blocked if one of the π i (B - q ) (for any negative body B - q in R) can be found in A. This can happen in two ways. Either π i (B - q ) can already be found in σ i (F i ) or it appears later in the derivation. In both cases, there is a σ j (F j ) (with j ≥ i) that contains the atomset π i (B - q ), as transformed by the sequence of simplifications from F i to F j , i.e., there exists F j with j ≥ i s.t. the atomset σ i→ j (π i (B - q )) = σ j (. . . (σ i+1 (π i (B - q ))) . . .) is included in σ j (F j ). We say that a derivation D is sound when no rule application is blocked in A. A sound derivation is said to be complete when adding any other rule application to the derivation would either make it unsound, or would not change the produced atomset. The derivation is a C-chase when the σ i used at each step is determined by the criterion C. Definition 8 (C-stable sets) Let F be a finite atomset, and R be a set of NME rules. We say that a (possibly infinite) atomset A is C-stable for (F, R) if there is a complete sound nonmonotonic C-chase from F that produces A.

Proposition 8 If R is a set of existential rules, then there is a unique C-stable set, which is equivalent to the universal model (F, R) C . If {F} ∪ R is a set of skolemized NME rules (with F being seen as a rule with empty body), then its skolem-stable sets are in bijection with its stable models. Sketch of proof : First part of the claim stems from the fact that existential rules generate a unique branch that corresponds to a derivation. When that branch is complete, it corresponds to a chase. Second part of the claim comes from the fact that our definitions mimic the behavior of the sound and complete algorithm implemented in [START_REF] Lefèvre | A first order forward chaining approach for answer set computing[END_REF].

C-chase Tree

The problem with the fixpoint Definition 8 is that it does not provide an effective algorithm : at each step of the derivation, we need to know the set produced by that derivation. The algorithm used in the solver ASPéRIX [START_REF] Lefèvre | A first order forward chaining approach for answer set computing[END_REF] is here generalized to a procedure that generates the (possibly infinite) C-derivation tree of (F, R). All nodes of that tree are labeled by three fields. The field in contains the atomset that was inferred in the current branch. The field out contains the set of forbidden atomsets, i.e., that must not be inferred. Finally, the field mbt ("must be true") contains the atomset that has yet to be proven. A node is called unsound when a forbidden atomset has been inferred, or has to be proven, i.e., when out ∩ (in ∪ mbt) ∅. At the initial step, the root of the C-derivation tree is a positive node labeled (σ 0 (F), ∅, ∅).

Then, let us chose a node N that is not unsound and has no child. Assume there is a rule R = B + , notB - 1 , . . . , notB - k → H in R such that there is a homomorphism π from B + to in(N). Then we will (possibly) add k + 1 children under N, namely N + , N - 1 , . . . , N - k . These children are added if the rule application is not blocked, and produces new atoms. Intuitively, the positive child N + encodes the effective application of the rule, while the k negative children N - i encode the k different possibilities of blocking the rule (with each of the negative bodies). Let us consider the sequence of positive nodes from the root of the tree to N + . It encodes a pos(R)-derivation from F. On that derivation, the C-chase generates a sequence σ 0 (F), . . . , σ p (F p ), S = σ(α(σ p (F p ), pos(R), π)). S produces something new when S σ p (F p ). We now have to fill the fields of the obtained children : let (in, out, mbt) be the label of a node N.

Then label(N + ) = (S , out ∪ {π i (B - 1 ), . . . , π i (B - k )}, mbt) and label(N - i ) = (in, out, mbt ∪ π i (B - i ))
. We say that a (possibly infinite) branch in the C-derivation tree is unsound when it contains an unsound node. A sound branch is said to be complete when its associated derivation is complete. Finally, a sound and complete branch is stable when for every node N in the branch such that B -∈ mbt(N), there exists a descendant N ′ of N such that B -∈ in(N ′ ). We say that a branch is unprovable if there exists a node N in the branch and an atomset B -∈ mbt(N) such that no complete branch containing N is stable. We call a C-chase tree any C-derivation tree for which all branches are either unsound, unprovable or complete.

Proposition 9 An atomset A is a C-stable set for (F, R) iff a C-chase tree of (F, R) contains a stable branch whose associated derivation produces A.

On the applicability of the chase variants In the positive case, all chase variants produce equivalent universal models (up to skolemization). Moreover, running a chase on equivalent knowledge bases produce equivalent results. Do these semantic properties still hold with nonmonotonic existential rules ? The answer is no in general.

The next example shows that the chase variants presented in this paper, core chase excepted, may produce nonequivalent results from equivalent knowledge bases.

Example 12 Let F = {p(a, y), t(y)} and F ′ = {p(a, y ′ ), p(a, y), t(y)} be two equivalent atomsets. Let R : p(u, v), not t(v) → r(u). For any C-chase other than core chase, there is a single C-stable set for (F, {R}) which is F (or sk(F)) and a single C-stable set for (F ′ , {R}) which is F ′ ∪ {r(a)} (or sk(F ′ ) ∪ {r(a)}). These sets are not equivalent.

Of course, if we consider that the initial knowledge base is already skolemized (including F seen as a rule), this trouble does not occur with the skolem-chase since there are no redundancies in facts and no redundancy can be created by a rule application. This problem does not arise with core chase either. Thus the only two candidates for processing NME rules are the core chase and the skolem chase (if we assume a priori skolemisation, which is already a semantic shift).

The choice between both mechanisms is important since, as shown by the next example, they may produce different results even when they both produce a unique C-stable set. It follows that skolemizing existential rules is not an innocuous transformation in presence of nonmontonic negation. Example 13 We consider F = i(a), R 1 = i(x) → p(x, y), R 2 = i(x) → q(x, y), R 3 = q(x, y) → p(x, y), t(y) and R 4 = p(u, v), not t(v) → r(u). The core chase produces at first step p(a, y 0 ) and q(a, y 1 ), then p(a, y 1 ) and t(y 1 ) and removes the redundant atom p(a, y 0 ), hence R 4 is not applicable. The unique core-stable set is {i(a), q(a, y 1 ), p(a, y 1 ), t(y 1 )}. With the skolem chase, the produced atoms are p(a, f R 1 (a)) and q(a, f R 2 (a)), then p(a, f R 2 (a)) and t( f R 2 (a)). R 4 is applied with p(u, v) mapped to p(a, f R 1 (a)), which produces r(a). These atoms yield a unique skolem-stable set. These stable sets are not equivalent.

Termination of the Chase Tree

On the finiteness of C-chase trees We say that the Cchase-tree halts on (F, R) when there exists a finite C-chase tree of (F, R) (in that case, a breadth-first strategy for the rule applications will generate it). We can thus define C-stablefinite as the class of sets of nonmonotonic existential rules R for which the C-chase-tree halts on any (F, R). Our first intuition was to assert "if pos(R) ∈ C-finite, then R ∈ Cstable-finite". However, this property is not true in general, as shown by the following example : , x). See that pos(R) ∈ core-finite (as soon as R 1 is applied, R 2 is also applied and the loop p(x, x) makes any other rule application redundant) ; however the only core-stable set of ({h(a)}, R) is infinite (because all applications of R 2 are blocked).

Example 14 Let R = {R 1 , R 2 } where R 1 = h(x) → p(x, y), h(y) and R 2 = p(x, y), not h(x) → p(x
The following property shows that the desired property is true for local chases. Proposition 10 Let R be a set of NME rules and C be a local chase. If pos(R) ∈ C-finite, then R ∈ C-stable-finite.

We have previously argued that the only two interesting chase variants w.r.t. the desired semantic properties are skolem and core. However, the core-finiteness of the positive part of a set of NME rules does not ensure the corestable-finiteness of these rules. We should point out now that if C ≥ C ′ , then C ′ -stable-finiteness implies C-stablefiniteness. We can thus ensure core-stable-finiteness when C-finiteness of the positive part of rules is ensured for a local C-chase. Proposition 11 Let R be a set of NME rules and C be a local chase. If pos(R) ∈ C-finite, then R ∈ core-stable-finite.

We can rely upon all acyclicity results in this paper to ensure that the core-chase tree halts.

Improving finiteness results with negative bodies

We now explain how negation can be exploited to enhance preceding acyclicity notions. We first define the notion of self-blocking rule, which is a rule that will never be applied in any derivation. A rule B + , not B - 1 , . . . , not B - k is selfblocking if there is a negative body B - i such that B - i ⊆ (B + ∪ H). Such a rule will never be applied in a sound way, so will never produce any atom. It follows that :

Proposition 12 Let R ′ be the non-self-blocking rules of R. If pos(R ′ ) ∈ C-finite and C is local, then R ∈ C-stable-finite. This idea can be further extended. We have seen for existential rules that if R ′ depends on R, then there is a unifier µ of body(R ′ ) with head(R), and we can build a rule R ′′ = R ⋄ µ R ′ that captures the sequence of applications encoded by the unifier. We extend Def. 6 to take into account negative bodies : if B -is a negative body of R or R ′ , then µ(B -) is a negative body of R ′′ . We also extend the notion of dependency in a natural way, and say that a unifier µ of head(R) with body(R ′ ) is self-blocking when R ⋄ µ R ′ is selfblocking, and R ′ depends on R when there exists a unifier of head(R) with body(R ′ ) that is not self-blocking. This extended notion of dependency exactly corresponds to the positive reliance in [START_REF] Magka | Computing stable models for nonmonotonic existential rules[END_REF].

Example 15 Let R = q(x), not p(x) → r(x, y) and R ′ = r(x, y) → p(x), q(y). Their associated positive rules are not core-finite. There is a single unifier µ of R ′ with R, and R ⋄ µ R ′ : q(x), not p(x) → r(x, y), p(x), q(y) is self-blocking. Then the skolem-chase-tree halts on (F, {R, R ′ }) for any F.

Results obtained from positive rules can thus be generalized by considering this extended notion of dependency (for PG U we only encode non self-blocking unifiers). Note that it does not change the complexity of the acyclicity tests.

We can further generalize this and check if a unifier sequence is self-blocking, thus extend the Y U+ classes to take into account negative bodies. Let us consider a compatible cycle C going through <a, i> that has not been proven safe. Let C µ be the set of all compatible unifier sequences induced by C. We say that a sequence µ 1 . . . µ k ∈ C µ is self-blocking when the rule R 1 ⋄ µ 1 R 2 . . . R k ⋄ µ k R k+1 obtained by combining these unifiers is self-blocking. When all sequences in C µ are self-blocking, we say that C is also self-blocking. This test comes again at no additional computational cost.

Example 16

Let R 1 = q(x 1 ), notp(x 1 ) → r(x 1 , y 1 ), R 2 = r(x 2 , y 2 ) → s(x 2 , y 2 ), R 3 = s(x 3 , y 3 ) → p(x 3 ), q(y 3 ). PG U+ ({R 1 , R 2 , R 3 }) has a unique cycle, with a unique induced compatible unifier sequence. The rule R 1 ⋄ R 2 ⋄ R 3 = q(x 1 ), notp(x 1 ) → r(x 1 , y 1 ), s(x 1 , y 1 ), p(x 1 ), q(y 1 ) is selfblocking, hence R 1 ⋄ R 2 ⋄ R 3 ⋄ R 1 also is. Thus, there is no "dangerous" cycle.

Proposition 13 If, for each existential position <a, i>, all compatible cycles for <a, i> in PG U are self-blocking, then the stable computation based on the skolem chase halts.

Conclusion

We have revisited chase termination with several results. First, a new tool that allows to unify and extend most existing acyclicity conditions, while keeping good computational properties. Second, a chase-like mechanism for nonmonotonic existential rules under stable model semantics, as well the extension of acyclicity conditions to take negation into account. This latter contribution extends the notion of negative reliance of [START_REF] Magka | Computing stable models for nonmonotonic existential rules[END_REF] ; and does not rely upon stratification (and thus does not enforce the existence of a single stable model). This work will be pursued on the theoretical side by a complexity study of entailment for the new acyclic classes and by a deeper study of logical foundations for NME rules, since it remains to relate our core-stable sets to an existing first-order semantics for general NME rules.

  An existential rule (and simply a rule hereafter) is of the form B → H, where B and H are atomsets, respectively called the body and the head of the rule. To an existential rule R : B → H we assign a formulaΦ(R) = ∀ x∀ y(φ(B) → ∃ zφ(H)), where vars(B) = x ∪ y, and vars(H) = x ∪ z. Variables x, which appear in both B and H, are called frontier variables, while variables z, which appear only in H are called existential variables. E.g., Φ(b(x, y) → h(x, z)) = ∀x∀y(b(x, y) → ∃zh(x, z)). The presence of existential variables in rule heads is the distinguishing feature of existential rules.

Figure 2 -

 2 Figure 2 -PG F (R) and PG D (R) from Example 7. Position <a, i> is represented by underlining the i-th term in a. Dashed edges do not belong to PG D (R).

Figure 3 -

 3 Figure 3 -PG D (R) and PG U (R) from Example 8. Dashed edges do not belong to PG U (R).

Figure 1 ,

 1 Figure1, from Column 1 to Column 2). More generally, strict inclusion in the first column leads to strict inclusion in the second one :Proposition 6 Let Y 1 , Y 2 be two acyclicity properties such that Y 1 ⊂ Y 2 , wa ⊆ Y 1 and Y 2 Y D 1 . Then Y D 1 ⊂ Y D 2 .The next theorem states that PG U is strictly more powerful than PG D ; moreover, the "jump" from Y D to Y U is at least as large as from Y to Y D . Theorem 1 Let Y be an acyclicity property. If Y ⊂ Y D then Y D ⊂ Y U . Furthermore, there is an injective mapping from the sets of rules satisfying Y D but not Y, to the sets of rules satisfying Y U but not Y D . Proof: Assume Y ⊂ Y D and R satisfies Y D but not Y. R can be rewritten into R ′ by applying the following steps. First, for each ruleR i = B i [ X, Y] → H i [ Y, Z] ∈ R, let R i,1 = B i [ X, Y] → p i ( X, Y) where p i is a fresh predicate ; and R i,2 = p i ( X, Y) → H i [ Y, Z]. Then, for each rule R i,1 , let R ′ i,1 be the rule (B ′ i,1 → H i,1 ) with B ′ i,1 = B i,1 ∪ {p ′ j,i (x j,i ) : ∀R j ∈R}, where p ′ j,i are fresh predicates and x j,i fresh variables. Now, for each rule R i,2 , let R ′ i,2 be the rule (B i,2 → H ′ i,2 ) with H ′ i,2 = H i,2 ∪ {p ′ i, j (z i, j ) : ∀R j ∈ R}, where z i, j are fresh existential variables. Let R ′ =

  and (2) existential variables in H ′ 1 are not unified with separating variables of B ′ 2 , i.e., variables that occur both in B ′ 2 and in (B 2 \ B ′ 2 ) ; in other words, if a variable x occuring in B ′ 2 is unified with an existential variable y in H ′ 1 , then all atoms in which x occurs also belong to B ′ 2 . It holds that R 2 depends on R 1 iff there is a piece-unifier of B 2 with H 1 satisfying easy to check additional conditions (atom erasing (Baget et al. 2011) and usefulness (Cuenca Grau et al. 2013)). Consider the rules from Example 5. There is no piece-unifier of B 2 with H 1 . The substitution

	Example 6 (Rule dependency)

  there is a pieceunifier µ l of B l+1 with the head of R p l , where the body of R p

l+1 is B p l ∪ {fr(t) | t is a term of H p l unified in µ l }, and the head of R p l+1 is H 1 . Note that for all l, H p l = H 1 , however, for l 1, R p l may have less existential variables than R l due to the added atoms. The agglomerated rule R j i built from {R

Acknowledgements

We thank the reviewers for their comments. This work is part of the ASPIQ and Pagoda projects and was partly funded by the french Agence Nationale de la Recherche (ANR) grants ANR-12-BS02-0003 and ANR-12-JS02-0007.