• Keine Ergebnisse gefunden

5 Computational Properties

6.1 Answer-Set Programming Encodings

We consider ASP as a reduction-based approach for the implementation of AFs. First we introduce the necessary background on ASP, then we formalize how argumentation

frame-works are represented in ASP and we give the encodings forstage2 semantics. In particular we distinguish between the standard saturation encodings and the optimizedmetasp encod-ings forstage2 semantics. All our encodings are fixed where the instance of an AF is given as input, and they are incorporated in the system ASPARTIX7(see [39, 40] for more details).

The encodings from the system ASPARTIX are written in the general datalog syntax. It may be the case that one needs to adapt the encodings for some ASP solvers. Themetasp encod-ings can only be performed withgringo/claspD. Furthermore we point out that we give an informal description of the ASP encodings. For a more formal investigation of the system ASPARTIX we refer to [40].

6.1.1 Background Answer-Set Programming

We give a brief overview of the syntax and semantics of disjunctive logic programs under the answer-sets semantics [50]; for further background, see [52].

We fix a countable setU of(domain) elements, also calledconstants; and suppose a total order<over the domain elements. Anatomis an expressionp(t1, . . . , tn), where pis a predicateof arityn ≥0and eachti is either a variable or an element fromU. An atom is groundif it is free of variables.BUdenotes the set of all ground atoms overU.

A(disjunctive) rulerwithn≥0, m≥k≥0,n+m >0is of the form a1 ∨ · · · ∨ an ←b1, . . . , bk, notbk+1, . . . , notbm

wherea1, . . . , an, b1, . . . , bmare atoms, and “not” stands fordefault negation. An atoma is a positive literal, whilenotais a default negated literal. Theheadofris the setH(r)= {a1, . . . , an}and thebodyofrisB(r) =B+(r)∪B(r)withB+(r)={b1, . . . , bk}and B(r)={bk+1, . . . , bm}. A rulerisnormalifn≤1and aconstraintifn= 0. A ruleris safeif each variable inroccurs inB+(r). A rulerisgroundif no variable occurs inr. A factis a ground rule without disjunction and with an empty body. An(input) databaseis a set of facts. A program is a finite set of disjunctive rules. For a programπand an input database D, we often writeπ(D)instead ofD∪π. If each rule in a program is normal (resp. ground), we call the program normal (resp. ground).

Besides disjunctive and normal program, we consider here the class of optimization pro-grams, i.e. normal programs which additionally contain#minimizestatements

#minimize[l1=w1@J1, . . . , lk=wk@Jk] (6.1) whereliis a literal,wian integer weight andJian integer priority level.

For any programπ, let Uπ be the set of all constants appearing inπ. Gr(π)is the set of rulesrτ obtained by applying, to each ruler ∈ π, all possible substitutionsτ from the variables inrto elements of Uπ. Aninterpretation I ⊆ BU satisfies a ground ruler iff H(r)∩I 6=∅wheneverB+(r)⊆I andB(r)∩I =∅. Isatisfies a ground programπ, if eachr ∈ πis satisfied byI. A non-ground ruler(resp., a programπ) is satisfied by an interpretationIiffIsatisfies all groundings ofr(resp.,Gr(π)).I⊆BUis ananswer setof πiff it is a subset-minimal set satisfying theGelfond-Lifschitz reduct

πI ={H(r)←B+(r)|I∩B(r) =∅, r∈Gr(π)}.

For a programπ, we denote the set of its answer sets byAS(π). For semantics of optimiza-tion programs, we interpret the#minimizestatement w.r.t. subset-inclusion: For any setsX

7The encodings are available athttp://www.dbai.tuwien.ac.at/research/project/argumentation/systempage/.

e normal programs disjunctive program optimization programs

|=c NP ΣP2 ΣP2

|=s coNP ΠP2 ΠP2

TABLE5. Data Complexity for logic programs (all results are completeness results).

andY of atoms, we haveY ⊆wJ X, if for any weighted literall=w@J occurring in (6.1), Y |= l impliesX |= l. Then, M is a collection of relations of the form⊆wJ for priority levelsJ and weightsw. A standard answer set (i.e. not taking the minimize statements into account)Y ofπdominatesa standard answer setXofπw.r.t.M if there are a priority level Jand a weightwsuch thatX ⊆wJ Y does not hold for⊆wJ∈M, whileY ⊆wJ00 Xholds for all

wJ00∈M whereJ0≥J. Finally a standard answer setXis an answer set of an optimization programπw.r.t.M if there is no standard answer setY ofπthat dominatesX w.r.t.M.

Credulous and skeptical reasoning in terms of programs is defined as follows. Given a programπ and a set of ground atomsA. Then, we write π |=c A(credulous reasoning), ifAis contained in some answer set ofπ; we writeπ |=s A(skeptical reasoning), ifAis contained in each answer set ofπ.

We briefly recall some complexity results for disjunctive logic programs. In fact, since we will deal with fixed programs we focus on results for data complexity. Depending on the concrete definition of|=, we give the complexity results in Table 6.1.1 (cf. [19] and the references therein). We note here, that even normal programs together with the optimization technique have a worst case complexity ofΣP2 (resp. ΠP2). Inspecting Table 2 one can see which kind of encoding is appropriate for an argumentation semantics.

6.1.2 Representing AFs in ASP

Here we first show how to represent AFs in ASP, and we give two programs which we need later on in this section. The first oneπcf opens the search space for our solutions via two guessing rules and eliminates all guesses which are not conflict-free. The second program π<defines an order over the domain elements.

All our programs are fixed which means that the only translation required, is to give an AF Fas input databaseFˆto the programπσ for a semanticsσ. In fact, for an AFF = (A, R), we defineFˆas

Fˆ={arg(a)|a∈A} ∪ {att(a, b)|(a, b)∈R}.

In what follows, we use unary predicatesin/1 andout/1to perform a guess for a setS ⊆ A, wherein(a)represents thata ∈ S (resp.out(a)fora 6∈ S). The following notion of correspondence is relevant for our purposes.

DEFINITION6.1

LetS ⊆ 2Ube a collection of sets of domain elements and letI ⊆ 2BU be a collection of sets of ground atoms. We say thatSandIcorrespond to each other, in symbolsS ∼=I, iff

(i) for eachS ∈ S, there exists anI∈ I, such that{a|in(a)∈I}=S; (ii) for eachI∈ I, it holds that{a|in(a)∈I} ∈ S; and

(iii)|S|=|I|.

LetF = (A, R)be an AF. The following program fragment guesses, when augmented byFˆ, any subsetS⊆Aand then checks whether the guess is conflict-free inF:

πcf ={in(X)←notout(X),arg(X);

out(X)←notin(X),arg(X);

←in(X),in(Y),att(X, Y)}.

PROPOSITION6.2 ([40])

For any AFF,cf(F)∼=AS(πcf( ˆF)).

For ASP encodings, it is sometimes required or desired to avoid the use of negation. This might either be the case for the saturation technique or if a simple program can be solved without a Guess&Check approach. Then, encodings typically rely on a form of loops where all domain elements are visited and it is checked whether a desired property holds for all elements visited so far. We will use this technique for saturation-based encoding but also for the computation of the instance[[F−∆F,S]]forstage2 semantics.

For this purpose, an order<over the domain elements (usually provided by common ASP solvers) is used together with helper predicates defined in programπ< below; in fact, predi-catesinf/1,succ/2andsup/1denote infimum, successor and supremum of the order<.

π<={lt(X, Y)←arg(X),arg(Y), X < Y; nsucc(X, Z)←lt(X, Y),lt(Y, Z);

succ(X, Y)←lt(X, Y),notnsucc(X, Y);

ninf(Y)←lt(X, Y);

inf(X)←arg(X),notninf(X);

nsup(X)←lt(X, Y);

sup(X)←arg(X),notnsup(X)}.