• Aucun résultat trouvé

∃-ASP

N/A
N/A
Protected

Academic year: 2022

Partager "∃-ASP"

Copied!
7
0
0

Texte intégral

(1)

∃-ASP

Fabien Garreau, Laurent Garcia, Claire Lef`evre and Igor St´ephan

LERIA University of Angers

{fgarreau,garcia,claire,stephan}@info.univ-angers.fr

Abstract

Answer set programming (ASP) is an appropriate for- malism to represent various problems issued from arti- ficial intelligence and arising when available informa- tion is incomplete. When dealing with information ex- pressed in terms of ontologies in some tractable descrip- tion logic language, ASP must be extended to handle existential variables. We present the syntax and seman- tics of an ASP language with existential variables us- ing Skolemization. We formalize its links with standard ASP. This work has led to an implementation.

Introduction

This paper deals with the treatment of ontologies in Answer Set Programming (ASP) (Gelfond and Lifschitz 1988). We are interested in using ASP technologies for querying large scale multisource heterogeneous web information. ASP is considered to handle, by using default negation, inconsis- tencies emerging by the fusion of the sources expressed by scalable description logics. Moreover, ASP can enrich the language of ontologies by allowing the expression of de- fault information (for instance, when expressing inclusion of concepts with exceptions). When dealing with ontologies in ASP, the problem stems from the presence of existential variables in description logics which are not expressible in normal logic programs. The present work proposes a defini- tion of ASP with existential variables in order to express, in a unique formalism, ontologies enriched by default negation and rules. Processing existential variables is done in terms of Skolemization.

The study of the combination of ontologies and rules is not new (Rosati 2006; Eiter et al. 2008; de Bruijn et al. 2010;

Motik and Rosati 2010; Ferraris, Lee, and Lifschitz 2011;

Lee and Palla 2011; Magka, Kr¨otzsch, and Horrocks 2013).

In most of these models, the knowledge base is viewed as a hybrid knowledge base composed of two parts (T,P):T is a knowledge base describing the ontological information expressed with a fragment of first-order logic, using for ex- ample description logic, andP describes the rules in terms of a logic program.

The miscellaneous attempts to integrate the two for- malisms can be distributed into three classes (Eiter et al.

2008; Lee and Palla 2011).

In the first class (like in (Eiter et al. 2008)), the two for- malisms are handled separately. T is seen as an external source of information which can be used by the logic pro- gram through special predicates querying the DL base. The two bases are then independent with their own semantics and the link between the two bases is performed using these special predicates. (Eiter et al. 2013) uses their extension of ASP with external atoms to simulate rules with existential variables in the head (external atoms in the body serve to introduce new null values).

The second case (like in (Rosati 2006; Motik and Rosati 2010)) corresponds to an hybrid formalism which integrates DLs and rules in a consistent semantic framework. Predi- cates ofT can be used in the rules of the program. Never- theless, there are some restrictions: for instance, these pred- icates can not be used in the negative part of the body of a rule.

The last case integrates DLs and rules in a unique for- malism. For instance, (de Bruijn et al. 2010) uses quantified equilibrium logic (QEL). In this work, several hybrid knowl- edge bases are defined (withsafe restriction,safe restriction without unique name assumption or with guarded restric- tion) and it is proved that each category and their models can be expressed in terms of QEL.

A large part of these works concerns the questions of complexity and decidability. In these frameworks, existen- tial variables are allowed in the part of the ontological infor- mation but are not allowed in the head of the rules.

Next to these models, (Ferraris, Lee, and Lifschitz 2011) proposes a model allowing to cover both stable models se- mantics and first-order logic by means of a second-order for- mula issued from the initial information. Its links with the previously cited works have been established in (Lee and Palla 2011). (You, Zhang, and Zhang 2013) proposes an ex- tension of ASP with existential variables in rule heads whose semantics corresponds to that of (Ferraris, Lee, and Lifschitz 2011).

Other works in logic programming take their origin in Datalog and extend the language for specifying ontologies.

Datalog+/- is a family of such extensions with syntactical re- strictions so that decidability is ensured. Several approaches with existential quantified variables based on Datalog+/- have been proposed in the literature but some have no non monotonic negation (Alviano et al. 2012) and other have

(2)

only stratified negation (Cali et al. 2010). Nevertheless, one important and interesting point of these works is that they focus on queries which is an important issue when dealing with ontologies.

In (Magka, Kr¨otzsch, and Horrocks 2013), the knowledge base is a single one allowing existential variables and default negation in the same rule. This work studies some conditions of acyclicity and stratification that must be verified by the base ensuring the existence of a unique finite stable model.

The work is both theoretical and practical but it is concerned with a limited extension of ASP.

As far as we know, the only works leading to an imple- mentation are those of (Ianni et al. 2005; Eiter et al. 2005), based on (Eiter et al. 2008), and of (Magka, Kr¨otzsch, and Horrocks 2013) which has been applied to information about biochemistry.

The aim of our present work is to describe knowledge in a single framework which can lead to useful implementation.

We focus on ASP because it is a powerful framework for knowledge representation and provides efficient solvers. The work consists in enriching the ASP framework to take into account existential variables. It can be seen as the other side of the work consisting in introducing nonmonotonicity in existential rules (Baget et al. 2014b; 2014a).

Next section gives the preliminary notions and definitions useful for the paper. Then, we define programs expressed in

∃-ASP, an extension of ASP allowing existential variables, and answer sets on this kind of programs. Last, we give the links between ∃-ASP and standard ASP with a method to translate a program expressed in∃-ASP into a program ex- pressed in (standard) ASP and proofs about the transforma- tion.

Preliminaries

In this section, we give the formal definitions of the language and some notions useful in the following of the paper.

The setVdenotes the infinite countable set ofvariables.

Alanguage Lis defined as a triplet (CS,F S,PS)which denotes respectively the set ofconstant symbols, the set of function symbolsand the set ofpredicate symbolsof the lan- guage. It is assumed that the setsV,CS,F SandPSof any language are disjoint. Functionardenotes the arity function fromF StoNand fromPStoNwhich associates to each function or predicate symbol its arity.

The setT(L)denotes the set oftermsof a languageL= (CS,F S,PS)defined by induction as follows:

• ifv∈ Vthenv∈T(L),

• ifc∈ CSthenc∈T(L),

• iff ∈ F Swithar(f) = n >0andt1, . . . , tn ∈ T(L) thenf(t1, . . . , tn)∈T(L).

The setGT(L)denotes the set ofground termsof a lan- guageL= (CS,F S,PS)defined by induction as follows:

• ifc∈ CSthenc∈GT(L),

• iff ∈ F Swithar(f) =n >0andt1, . . . , tn∈GT(L) thenf(t1, . . . , tn)∈GT(L).

The setA(L)denotes the set ofatomsof a languageL= (CS,F S,PS)defined as follows:

• ifa∈ PSwithar(a) = 0thena∈A(L),

• ifp∈ PS withar(p) = n > 0andt1, . . . , tn ∈ T(L) thenp(t1, . . . , tn)∈A(L).

The setGA(L)denotes the set ofground atomsof a lan- guageL= (CS,F S,PS)defined as follows:

• ifa∈ PSwithar(a) = 0thena∈GA(L),

• ifp∈ PS withar(p) =n >0andt1, . . . , tn ∈GT(L) thenp(t1, . . . , tn)∈GA(L).

Asubstitutionover a languageLis a mapping from the set of variables to the set of the termsT(L). Lettbe a term (resp.aan atom) and σa substitution,σ(t)(resp.σ(a)) is aninstanceoft(resp.a).

A ground substitution over a language L is a mapping from the set of variables to the set of the ground terms GT(L). Lettbe a term (resp.aan atom) andσa ground substitution,σ(t)(resp.σ(a)) is aground instanceoft(resp.

a).

Apartial ground substitutionfor a set of variablesV over a languageLis a mapping fromV to the set of ground terms GT(L). Lettbe a term (resp. aan atom) andσa partial ground substitution for a set of variablesV,σ(t)(resp.σ(a)) is a partial ground instance of t (resp.a) w.r.t. the set of variablesV.

Syntax and semantics of ∃-ASP

In this section, we define a variant of ASP allowing the use of existentially quantified variables (calledexistential vari- ablesin the sequel). The rules proposed here extend classical safe rules (without disjunction) of the form:

H ←B1, . . . , Bm, not N1, . . . , not Ns.

where H, B1, . . . , Bm, N1, . . . , Ns are atoms. Safety im- poses that all variables that appear in a rule also appear in the positive part of its body. In such a rule, all variables are interpreted as universally quantified. In the sequel, univer- sally quantified variables will be calleduniversal variables.

These classical rules are extended in two ways. First, the head of the rule, atom H, is replaced by a conjunction of atoms and each negated atomNi is also replaced by a con- junction of atoms. These conjunctions allow multiple atoms to refer to the same existential variable. Second, the safety condition is relaxed by allowing these new conjunctions of atoms to contain variables that do not appear in the positive part of the rule. These variables are interpreted as existential ones.

For example, in the rule (p(X, Y) ←

q(X), not r(X, Z).), variable X is interpreted as uni- versal, andY andZ are interpreted as existential. The rule can be read as: “for allX, ifq(X)is true and there does not existZsuch thatr(X, Z)is true, then one can conclude that there existsY such thatp(X, Y)is true”.

Definition 1 (∃-rule and∃-program) An∃-program P of languageL= (CS,F S,PS)is a set of∃-rulesrdefined as follows (m, s≥0,n, u1, . . . , us≥1):

H1, . . . , Hn

B1, . . . , Bm, not(N11, . . . , Nu11), . . . , not(N1s, . . . , Nuss).

(3)

with H1, . . . , Hn, B1, . . . , Bm, N11, . . . , Nu11, . . . , N1s, . . . , Nuss ∈A(L).

We use the following notations:

• head(r) ={H1, . . . , Hn}.

• body+(r) ={B1, . . . , Bm}.

• body(r) ={{N11, . . . , Nu11}, . . . ,{N1s, . . . , Nuss}}.

• V(r)the variables,

• VH∃(r)the variables which are inH1, . . . , Hnbut which are not in B1, . . . , Bm (i.e. existential variables of the head ofr),

• V(r)(N1i, . . . , Nuii)variables which are inN1i, . . . , Nuii but not inB1, . . . , Bm,1 ≤i ≤ s(i.e. existential vari- ables ofN1i, . . . , Nuii).

• VN(r) =S

1≤i≤sV(r)(N1i, . . . , Nui

i),

• VN(r) =V(r)\ VN(r),

• V(r) =VH∃(r)SVN(r)

• VH∀(r)the variables which are at least in H1, . . . , Hn and inB1, . . . , Bm(i.e. universal variables of the head of r, the frontier variables).

• V(r)(N1i, . . . , Nui

i)the variables which are at least in N1i, . . . , Nui

iand inB1, . . . , Bm(i.e. universal variables ofN1i, . . . , Nui

i).

Moreover, the setsV(r)(N1i, . . . , Nui

i)for every1≤i≤s must be disjoint and the sets VH∃(r) and VN(r) must also be disjoint. (If a variable appears in several of the N1i, . . . , Nui

ior if it appears inH1, . . . , Hnand in one of the N1i, . . . , Nui

i,1≤i≤s, then it must appear inB1, . . . , Bm and it is a universal variable.)

For all rulesrof a programP,V(r)must be disjoint (i.e.

all the names of the existential variables of the program are different).

A ruleris adefinite ruleifbody(r) =∅and a program is adefinite programif all the rules are definite.

Let us note that in such a ruler, several atoms are allowed inhead(r)and in each set ofbody(r). In this case, a list of atoms must be seen as the conjunction of each atom of the list.

Concerning the variables involved in the rule, they can be quantified universally or existentially. The quantifiers are not explicitly expressed in the rule but they depend on the posi- tion in the rule: the variables appearing inbody+(r)are uni- versally quantified while the ones not appearing inbody+(r) are existentially quantified. Let us note that the existential variables, in the head or in each negative part of the body, are locally quantified.

Example 1 Let PU be an ∃-program of language LU = ({a},∅,{p, phdS, d, l, gC})withar(p) =ar(d) =ar(l) = 1andar(phdS) =ar(gC) = 2.pstands for person,phdS for phDStudent, d for director, l for lecturer and gC for givesCourses.

PU ={ r0:p(a)., r1:l(a).,

r2:phdS(X, D), d(D)← p(X), not(l(X), gC(X, Y)).}

The ruler2means that for a person X there exists a direc- tor D and X is a phD student of D, unless X is a lecturer and it exists a course given by X.

We have VH∀(r) = {X}, VH∃(r) = {D}, V(r)(l(X), gC(X, Y)) ={Y},VN∃(r) ={X, D}.

For each programP, we consider that its languageLP = (CS,F S,PS) consists of exactly the constant symbols, function symbols and predicate symbols appearing inP.

Proposition 1 Any (first-order classical) ASP program is an

∃-program.

Proof 1 This is a direct consequence of Definition 1.

The semantics of∃-programs uses Skolemization of exis- tential variables appearing in the heads of the rules. We now define this Skolemization.

Definition 2 (Skolem symbols) Let r be an ∃-rule, n the cardinality ofVH∀(r)andY ∈ VH∃(r)an existential vari- able ofrthenskYn is a Skolem function symbol of arityn(if n= 0thenskY is a Skolem constant symbol).

Example 2 (Example 1 continued) Symbol skD1 is a Skolem function symbol of arity 1 for the existential variableDof the head of the ruler2.

Definition 3 (Skolem Program) LetP be an∃-program of languageLP.

Letsbe an ordered sequence of the variablesVH∀(r)of an∃-rulerofP. sk(r) denotes aSkolem ruleobtained from ras follows: every existential variablev ∈ VH∃(r)is sub- stituted by the term skvn(s)with sknv the Skolem function (constant) symbol associated tovandn=ar(skvn)the size ofs(zero ifVH∀(r) =∅). TheSkolem programsk(P) of an

∃-programPis defined bysk(P) ={sk(r)|r∈P}.

Example 3 (Example 1 continued) The Skolem rule ofr2 is the rule:

sk(r2) = (phdS(X, sk1D(X)), d(skD1(X))← p(X), not(l(X), gC(X, Y)).) Hence sk(PU) = {r0, r1, sk(r2)} and Lsk(PU) = ({a},{sk1D},{p, phdS, d, l, gC}).

Skolem rules are still not safe: existential variables re- main in the negative bodies. The grounding of such a rule is a partial grounding restricted to the universal variables of the rule, the existential ones remaining not ground. In- deed, a non-ground rule (p(X) ← q(X), not r(X, Z).) could be fired for some constantaifq(a)is true and, for all z,r(a, z)is not true. Suppose two constantsaandb. Then (p(a)←q(a), not r(a, a).)and(p(a)←q(a), not r(a, b).) are not equivalent to the non-ground rule for X = a be- cause the first instance could be fired ifr(a, b)is true (but not r(a, a)) and the second could be fired ifr(a, a)is true (but notr(a, b)). Yet neitherr(a, b)norr(a, a)should be true for the initial rule to be fired. We thus define a partial ground- ing, only concerning universal variables. For instance, a par- tial ground instance of the above non-ground rule would be:

(p(a)←q(a), not r(a, Z).).

Definition 4 (Partial Ground Program) Set PG(r) for a ruler of an∃-programP of languageLP denotes the set

(4)

of all partial ground instances ofr over the languageLP

forVN∃(r). The partial ground programPG(P)of an∃- programPis defined byPG(P) =S

r∈PPG(r).

Example 4 (Example 1 continued) The language of the Skolem programsk(PU)contains only one constant,a, and only one function symbol,skD1. The set of ground terms is infinite and the partial grounding leads then to the following infinite program:

PG(sk(PU)) ={ p(a).,

l(a).,

phdS(a, sk1D(a)), d(sk1D(a))← p(a), not(l(a), gC(a, Y)).,

phdS(skD1(a), sk1D(skD1(a))), d(skD1(sk1D(a)))← p(skD1(a)), not(l(skD1(a)), gC(skD1(a), Y))., . . .}

Proposition 2 The partial ground program of an∃-program with no multiple head, no multiple default negation and no existential variable is a ground (classical) ASP program.

Proof 2 This is a direct consequence of Definitions 1 and 4.

Definition 5 (Reduct) LetP be an∃-program of language LPandX ⊆GA(Lsk(P)). The reduct of the partial ground programPG(sk(P))w.r.t.Xis the definite partial ground program

PG(sk(P))X=

{ head(r)←body+(r).|r∈PG(sk(P)), for allN∈body(r)and

for all ground substitutionσoverLsk(P), σ(N)6⊆X} Example 5 (Example 1 continued) Let

X1={p(a), l(a), phdS(a, skD1(a)), d(sk1D(a))}.

Then, for the rule

phdS(a, sk1D(a)), d(skD1(a))← p(a), not(l(a), gC(a, Y)).

there is no ground instance ofl(a),gC(a, Y)that is included inX1(sinceX1does not contain any atom withgC) and the positive part of the rule is kept. Other rules are kept for the same reason. The obtained program is then:

PG(sk(PU))X1 ={ p(a).,

l(a).,

phdS(a, sk1D(a)), d(sk1D(a))←p(a).,

phdS(skD1(a), sk1D(skD1(a))), d(skD1(sk1D(a)))← p(skD1(a)).,

. . .}

Now, let X2=X1 ∪ {gC(a, m)} and PU2=PU ∪ {gC(a, m).}.

Here,l(a),gC(a, m)is a ground instance of the negative body of the rule

phdS(a, sk1D(a)), d(skD1(a))← p(a), not(l(a), gC(a, Y)).

that is included in X2. Thus, the rule is excluded from the reduct. Other rules are kept. The obtained program is then:

PG(sk(PU∪ {gC(a, m).}))X∪{gC(a,m)}={ gC(a, m).,

p(a)., l(a).,

phdS(skD1(a), skD1(sk1D(a))), d(sk1D(skD1(a)))← p(skD1(a)).,

. . .}

Note that the reduct of a program that is Skolemized and partially grounded is a definite ground program: it no longer contains variables. The consequence operator can then be defined as usual, the only difference is that rules can have a conjunction of atoms as head.

Definition 6 (TP consequence operator andCnits closure) LetPbe a definite partial ground program of an∃-program of languageLP. The operatorTP : 2GA(LP)→ 2GA(LP) is defined by

TP(X) ={a|r∈P, a∈head(r), body+(r)⊆X}.

Cn(P) =Sn=+∞

n=0 TPn(∅)is the least fix-point of the conse- quence operatorTP.

Example 6 (Example 1 continued)

Cn(PG(sk(PU))X) = X but Cn(PG(sk(PU ∪ {gC(a, m).}))X∪{gC(a,m)}) ={p(a), l(a), gC(a, m)}.

Definition 7 (∃-answer set) LetPbe an∃-program of lan- guageLP andX ⊆GA(Lsk(P)).X is an∃-answer set of P if and only ifX =Cn(PG(sk(P))X).

Example 7 (Example 1 continued) X is an∃-answer set ofPUand{p(a), l(a), gC(a, m)}is an∃-answer set ofPU∪ {gC(a, m).}.

Proposition 3 LetP be a (classical) ASP program of lan- guage LP and X ⊆ GA(LP).X is an answer set of P if and only ifX is an∃-answer set ofP considered as an

∃-program.

Proof 3 Since P is a classical ASP program,sk(P) = P and its (classical) ground ASP program corresponds ex- actly toPG(P) =PG(sk(P)). HenceX ∈GA(LP) = GA(Lsk(P))is an answer set of groundP, by Definition 7, if and only if it is an ∃-answer set of P considered as an

∃-program.

From ∃-ASP to ASP

In this section, we give the translation of an∃-ASP program into a standard ASP program and we show that the∃-answer sets of the initial program correspond to the answer sets of the new program.

The first step of the translation is the normalization whose goal is twofold: to remove the conjunctions of atoms from negative parts of the rules and to remove existential variables from these negative parts. The obtained program is equiva- lent in terms of answer sets.

(5)

Definition 8 LetPbe an∃-program of languageLP. Letr be an∃-rule ofP(m, s≥0,n, u1, . . . , us≥1):

H1, . . . , Hn

B1, . . . , Bm, not(N11, . . . , Nu11), . . . , not(N1s, . . . , Nuss).

with H1, . . . , Hn, B1, . . . , Bm, N11, . . . , Nu11, . . . , N1s, . . . , Nus

s ∈ A(LP). LetN be a set of new predicate symbols (i.e.N ∩ PS=∅).

Thenormalizationof such an∃-rule is the set of∃-rules N(r) =

{ H1, . . . , Hn←B1, . . . , Bm, not N1, . . . , not Ns., N1←N11, . . . , Nu11.,

. . .

Ns←N1s, . . . , Nuss.}

withNi the new atom pNi(X1, . . . , Xv),pNi ∈ N a new predicate symbol for everyNi andV(r)(N1i, . . . , Nui

i) = {X1, . . . , Xv}.

The normalization of P is defined as N(P) = S

r∈PN(r).

SetGAN(Lsk(P))is the set of Skolem ground atoms for the new predicate symbols defined as follows:

• ifa∈ N withar(a) = 0thena∈GAN(Lsk(P)),

• ifp∈ N withar(p)>0andt1, . . . , tn ∈GT(Lsk(P)) thenp(t1, . . . , tn)∈GAN(Lsk(P)).

Example 8 (Example 1 continued) Let pN be a new predicate symbol. The negative part of the rule r2: not(l(X), gC(X, Y))has only one universal variable,X. It is replaced bynot pN(X)(ruler2). And a new ruler2 is added whereY that was an existential variable inr2be- comes a universal one inr2.

N(r2) ={

r2:phdS(X, D), d(D)←p(X), not pN(X).

r2:pN(X)←l(X), gC(X, Y).}

andN(PU) ={r0, r1, r2, r2}.

The following proposition shows that normalization pre- serves answer sets of an∃-program: it only adds some atoms formed with the new predicate symbols fromN.

Proposition 4 LetP be an∃-program of languageLP and X ⊆GA(Lsk(P)). IfX is an∃-answer set ofP then there existsY ⊆GAN(Lsk(P))such thatX∪Y is an∃-answer set of N(P). If X is an∃-answer set ofN(P) thenX \ GAN(Lsk(P))is an∃-answer set ofP.

The lemma used in the following proof shows that if the normalization is applied on only one rulerand only one part of the negative body of this rule, then the answer sets of the original program are preserved up to the added atom. If r has the following form:

H1, . . . , Hn

B1, . . . , Bm, not(N11, . . . , Nu11), . . . , not(N1s, . . . , Nuss).

then the ”partial normalization” of r for (N1s, . . . , Nuss) leads to the rules

r=H1, . . . , Hn← B1, . . . , Bm,

not(N11, . . . , Nu11), . . . , not(N1s−1, . . . , Nus−1s−1), not Ns.

and r=Ns ← N1s, . . . , Nuss. A program P with the rule r and the program P where the ruler is replaced by the rules r andr have the same answer sets except forNs. The proof can be constructed by induction by applying the lemma to each part of the negative body ofrand, then, to each rule of the program.

Proof 4 The proof is by induction on the following lemma:

Let P be an ∃-program of language LP, r = (H ← C, not(N1, . . . , Nu).)∈PG(sk(P)),P0=PG(sk(P))\ {r}, r = (H ← C, not N.) ∈ PG(sk(N(P))),R = PG(N ← N1, . . . , Nu.) ⊆ PG(sk(N(P))) and X ⊆ GA(Lsk(P)).

If there exists a substitution θ such that {θ(N1), . . . , θ(Nu)} ⊆ X then Cn((P0 ∪ {r})X) = X if and only ifCn((P0∪ {r} ∪R)X∪{N}) = X ∪ {N}.

If for all substitutions θ, {θ(N1), . . . , θ(Nu)} 6⊆ X then Cn((P0 ∪ {r})X) = X if and only if Cn((P0∪ {r} ∪R)X) =X.

Let us remark thatN 6∈Cn(P0X)∪X.

• If there exists a substitution θ such that {θ(N1), . . . , θ(Nu)} ⊆X then(P0 ∪ {r})X =P0X = (P0∪ {r})X∪{N}thenCn((P0∪ {r})X) =Cn(P0X) andCn((P0∪ {r} ∪R)X∪{N}) = Cn(P0X)∪ {N}.

Then Cn((P0 ∪ {r})X) = X iff Cn(P0X) = X iff Cn(P0X) ∪ {N} = X ∪ {N} iff Cn((P0 ∪ {r} ∪ R)X∪{N}) =X∪ {N}.

• If for all substitutionsθ,{θ(N1), . . . , θ(Nu)} 6⊆X then (P0∪ {r})X = (P0∪ {H ← C.})X and(P0∪ {r} ∪ R)X = (P0 ∪ {H ← C.})X ∪R. Then Cn((P0 ∪ {r})X) =Cn((P0∪ {H←C.})X) =Cn((P0∪ {H ← C.})X∪R) =Cn((P0∪ {r} ∪R)X). ThenCn((P0∪ {r})X) =XiffCn((P0∪ {r} ∪R)X) =X.

Example 9 (Example 1 continued) Program PU, after normalization, is Skolemized and grounded. After normal- ization and Skolemization, the program no longer contains existential variables. Thus, after grounding, it does not contain any more variables.

PG(sk(N(PU))) ={ p(a).,

l(a),

phdS(a, skD1(a)), d(skD1(a))←p(a), not pN(a).

pN(a)←l(a), gC(a, a)., pN(a)←l(a), gC(a, skD1(a))., . . .,

phdS(skD1(a), skD1(sk1D(a))), d(sk1D(skD1(a)))← p(skD1(a)), not pN(sk1D(a)).,

pN(skD1(a))←l(skD1(a)), gC(sk1D(a), a)., pN(skD1(a))←l(skD1(a)), gC(sk1D(a), sk1D(a))., . . .}

The following proposition shows that Skolemization and grounding preserve answer sets of a normalized∃-program.

Proposition 5 Let P be a normalized ∃-program of lan- guage LP and X ⊆ GA(Lsk(P)). X is an∃-answer set ofPif and only ifXis an∃-answer set ofPG(sk(P)).

(6)

Proof 5 Since for allr∈PG(sk(P)),VN(r) =∅(since ris normalized),VN(r) = V(r)andVH∃(r) = ∅(since r is Skolemized) then PG(sk(P)) = sk(PG(sk(P))) = PG(sk(PG(sk(P)))).

By Definition 7, X is an ∃-answer set of P iff X = Cn(PG(sk(P))X)iffX =Cn(PG(sk(PG(sk(P))))X) iffXis an∃-answer set ofPG(sk(P)).

Once an ∃-program is normalized and Skolemized, the only non-standard parts that remain are the conjunctions of atoms in rule heads. The last step of the translation is the expansion where we remove the sets of atoms in each head while keeping the link between the existential variables. It simply consists to duplicate a rule as many time as the rule contains atoms in its head, each new rule having only one of these atoms in its head. Preceding Skolemization allows to preserve the links between the existential variables of the head. The obtained program is equivalent in terms of answer sets.

Definition 9 LetPbe a ground Skolemized normalized pro- gram andr∈P(m, s≥0,n >0):

H1, . . . , Hn←B1, . . . , Bm, not N1, . . . , not Ns. withH1, . . . , Hn, B1, . . . , Bm, N1, . . . , Ns∈GA(LP).

Theexpansionof such a rule is the set defined by:

Exp(r) =

{ H1←B1, . . . , Bm, not N1, . . . , not Ns., . . .

Hn←B1, . . . , Bm, not N1, . . . , not Ns.}

The expansion of P is defined as Exp(P) = S

r∈PExp(r).

Example 10 (Example 1 continued) The following rule of the program from Example 9:

phdS(a, sk1D(a)), d(skD1(a)) ← p(a), not pN(a). is splitted into the two rules:

phdS(a, sk1D(a))←p(a), not pN(a).and d(skD1(a))←p(a), not pN(a).

The same treatment is applied to the other rules with both predicatesphdSanddin the head.

The following program is obtained:

Exp(PG(sk(N(PU)))) ={ p(a).,

l(a).,

phdS(a, sk1D(a))←p(a), not pN(a)., d(skD1(a))←p(a), not pN(a)., pN(a)←l(a), gC(a, a)., pN(a)←l(a), gC(a, sk1D(a))., . . . ,

phdS(skD1(a), skD1(skD1(a)))←

p(sk1D(a)), not pN(skD1(a))., d(skD1(sk1D(a)))←p(sk1D(a)), not pN(skD1(a))., pN(skD1(a))←l(sk1D(a)), gC(sk1D(a), a)., pN(skD1(a))←l(sk1D(a)), gC(sk1D(a), sk(a))., . . .}

Proposition 6 Let P be a ground Skolemized normalized

∃-program of languageLP andX ⊆ GA(LP).X is an

∃-answer set ofP if and only if X is an∃-answer set of Exp(P).

Proof 6 The only difference is on the computation of the fix- point of (classical)TP operator and newTP operator de- fined in Definition 6 and clearly enough fix-point are identi- cal sincePis ground.

Proposition 7 Let P be an ∃-program.

Exp(PG(sk(N(P)))) is an (ground classical) ASP program.

Proof 7 This proposition is a direct consequence of Defini- tions 3, 4, 8, 9 and Proposition 2.

The last proposition establishes equivalence, up to new atoms introduced by normalization, between∃-answer sets of an ∃-program and classical answer sets of the program after normalization, Skolemization and expansion.

Proposition 8 LetPbe an∃-program of languageLP and X ⊆ GA(Lsk(P)). If X is an ∃-answer set of P then there exists Y ⊆ GAN(Lsk(P)) such that X ∪ Y is a (classical) answer set of Exp(PG(sk(N(P)))). If X is a (classical) answer set of Exp(PG(sk(N(P)))), then X\GAN(Lsk(P))is an∃-answer set ofP.

Proof 8 LetP be an∃-program andX⊆GA(Lsk(P)).

• if X is an ∃-answer set of P then, by proposition 4, there exists Y ⊆ GAN(Lsk(P)) such that X ∪ Y is an ∃-answer set of N(P). By proposition 5, X ∪Y is an ∃-answer set of PG(sk(N(P))). By proposition 6, X ∪ Y is an ∃-answer set of Exp(PG(sk(N(P)))).

By propositions 3 and 7, X ∪Y is an answer set of Exp(PG(sk(N(P)))).

• IfXis a (classical) answer set ofExp(PG(sk(N(P)))) then, by propositions 3 and 7, X is an ∃-answer set of Exp(PG(sk(N(P)))). By proposition 6, X is an

∃-answer set of PG(sk(N(P))). By proposition 5, X is an ∃-answer set of N(P). By proposition 4, X \ GAN(Lsk(P))is an∃-answer set ofP.

Conclusion

This paper is a first step of formalisation of ASP allowing the use of existential variables. It is well suited to integrate ontologies and rules in a unique formalism.

From a practical point of view, the proposed translation from∃-ASP to ASP allows us to use any solver. But let us note that we have implemented this translation as a front- end of the solverASPeRiXwhich uses on-the-fly grounding (Lef`evre et al. 2015). This should help, in the future, for dealing with variables in a more efficient way.

An in-depth comparison with other formalisms remains to be done. One of the closest work is (Baget et al. 2014b) dealing with existential rules extended with non monotonic negation. In this work, existential variables are only allowed in the rule heads, not in the negative bodies.ASPeRiXse- mantics (defined via a notion of computation inspired from (Liu et al. 2010)) is adapted for defining different chases

(7)

(forward chaining algorithms) for non monotonic existen- tial rules. Our present work should be linked to one of these chases, the Skolem-chase.

Another ongoing work is to deal efficiently with queries in this framework. This is not obvious due to the nonmonotonic aspect of ASP and the potential inconsistency of an ASP program. It seems that very little work has been done on these aspects.

Acknowledgements

This work received support from ANR (French National Re- search Agency), ASPIQ project reference ANR-12-BS02- 0003.

References

Alviano, M.; Faber, W.; Leone, N.; and Manna, M. 2012.

Disjunctive datalog with existential quantifiers: Semantics, decidability, and complexity issues.Theory Pract. Log. Pro- gram.12(4-5):701–718.

Baget, J.-F.; Garreau, F.; Mugnier, M.-L.; and Rocher, S.

2014a. Extending acyclicity notions for existential rules. In ECAI 2014 - 21st European Conference on Artificial Intelli- gence, 18-22 August 2014, Prague, Czech Republic, 39–44.

Baget, J.-F.; Garreau, F.; Mugnier, M.-L.; and Rocher, S. 2014b. Revisiting Chase Termination for Existential Rules and their Extension to Nonmonotonic Negation. In Konieczny, S., and Tompits, H., eds.,NMR’2014: 15th Inter- national Workshop on Non-Monotonic Reasoning, volume INFSYS Research Report Series.

Cali, A.; Gottlob, G.; Lukasiewicz, T.; Marnette, B.; and Pieris, A. 2010. Datalog+/-: A family of logical knowledge representation and query languages for new applications. In 25th Annual IEEE Symposium on Logic in Computer Sci- ence (LICS), 2010, 228–242.

de Bruijn, J.; Pearce, D.; Polleres, A.; and Valverde, A.

2010. A semantical framework for hybrid knowledge bases.

Knowl. Inf. Syst.25(1):81–104.

Eiter, T.; Ianni, G.; Schindlauer, R.; and Tompits, H. 2005.

Dlv-hex: Dealing with semantic web under answer-set pro- gramming. In4th International Semantic Web Conference (ISWC 2005) - Posters Track, Galway, Ireland, November 2005. System poster.

Eiter, T.; Ianni, G.; Lukasiewicz, T.; Schindlauer, R.; and Tompits, H. 2008. Combining answer set programming with description logics for the semantic web.Artif. Intell.172(12- 13):1495–1539.

Eiter, T.; Fink, M.; Krennwallner, T.; and Redl, C. 2013.

hex-programs with existential quantification. In Hanus, M., and Rocha, R., eds.,Declarative Programming and Knowl- edge Management, KDPD 2013, volume 8439 of Lecture Notes in Computer Science, 99–117.

Ferraris, P.; Lee, J.; and Lifschitz, V. 2011. Stable models and circumscription.Artificial Intelligence175:236–263.

Gelfond, M., and Lifschitz, V. 1988. The stable model se- mantics for logic programming. In Kowalski, R. A., and

Bowen, K., eds.,Proceedings of the Fifth International Con- ference and Symposium on Logic Programming (ICLP’88), 1070–1080. Cambridge, Massachusetts: The MIT Press.

Ianni, G.; Eiter, T.; Tompits, H.; and Schindlauer, R. 2005.

Nlp-dl: A kr system for coupling nonmonotonic logic pro- grams with description logics. In The Forth International Semantic Web Conference (ISWC2005).

Lee, J., and Palla, R. 2011. Integrating rules and ontolo- gies in the first-order stable model semantics (preliminary report). InLogic Programming and Nonmonotonic Reason- ing - 11th International Conference, LPNMR 2011, Vancou- ver, Canada, May 16-19, 2011. Proceedings, 248–253.

Lef`evre, C.; B´eatrix, C.; St´ephan, I.; and Garcia, L. 2015.

Asperix, a first order forward chaining approach for answer set computing. CoRRabs/1503.07717:(to appear in TPLP).

Liu, L.; Pontelli, E.; Son, T. C.; and Truszczynski, M. 2010.

Logic programs with abstract constraint atoms: The role of computations. Artificial Intelligence174(3-4):295–315.

Magka, D.; Kr¨otzsch, M.; and Horrocks, I. 2013. Computing stable models for nonmonotonic existential rules. InIJCAI 2013, Proceedings of the 23rd International Joint Confer- ence on Artificial Intelligence, Beijing, China, August 3-9, 2013.

Motik, B., and Rosati, R. 2010. Reconciling description logics and rules.J. ACM57(5).

Rosati, R. 2006. Dl+log: Tight integration of description logics and disjunctive datalog. InProceedings, Tenth Inter- national Conference on Principles of Knowledge Represen- tation and Reasoning, Lake District of the United Kingdom, June 2-5, 2006, 68–78.

You, J.-H.; Zhang, H.; and Zhang, Y. 2013. Disjunctive logic programs with existential quantification in rule heads.

Theory and Practice of Logic Programming13:563–578.

Références

Documents relatifs

The first thread to detect a violation will communicate it to the host by setting a variable (Violation—Line 11) in global memory (used in Lines 9 and 11 of the general

– Resorting to splitting sets [7], the major tool for modularity in modeling and evaluat- ing answer set programs, we define split SEQ-models (Section 3), for which the program

In turn, complex PDL expressions can be built out of PDL p expres- sions by means of operators that specify how to impose and order upon answer sets of given programs based upon

The testing language has been implemented in ASPIDE, a com- prehensive IDE for ASP, which supports the entire life-cycle of ASP development with a collection of user-friendly

that, instead of removing rules where some negative literals in the body are not mod- eled in a given set of atoms (candidate stable model) I, it removes rules where the upper bound

Answering conjunctive queries (CQs) over knowledge bases (KBs) containing dis- junctive existential rules is a relevant reasoning task which can be addressed using the disjunctive

We observe that the notion of minimal canonical model introduced in [3] as a semantic characterization of the rational closure for ALC is not adequate to capture many knowledge

Namely, we present general nota- tion on HT-models, logic programs, answer sets, and on forgetting in ASP, recall existing properties of forgetting, as discussed in [17], the classes