=Paper= {{Paper |id=Vol-1672/paper_5 |storemode=property |title=Extending the DIAMOND System to work with GRAPPA |pdfUrl=https://ceur-ws.org/Vol-1672/paper_5.pdf |volume=Vol-1672 |authors=Matti Berthold |dblpUrl=https://dblp.org/rec/conf/comma/Berthold16 }} ==Extending the DIAMOND System to work with GRAPPA== https://ceur-ws.org/Vol-1672/paper_5.pdf
        Extending the diamond System
             to work with grappa
                            Matti BERTHOLD
           Computer Science Institute, Leipzig University, Germany

          Abstract The subject of this paper is to extend the diamond system,
          which analyses Abstract Dialectical Frameworks (adfs), such that it will
          be able to work with a variant of adfs called grappa (GRaph-based Ar-
          gument Processing with Patterns of Acceptance). The implementation
          uses answer set programming encodings to analyze acceptance patterns
          of grappa Systems semantically.
          Keywords. abstract argumentation, abstract dialectical frameworks,
          DIAMOND, answer set programming, clingo, potassco, implementation




1. Introduction

Argumentation is the interdisciplinary study of finding conclusions to premises by
logical reasoning. Computer scientists are concerned with automating this process
in a manner that works quickly and for a wide array of instances. Before devel-
oping an algorithm to solve a problem though, one has to come up with a fitting
representation. In 1995 Phan Minh Dung introduced Argumentation Frameworks
(afs) [1]. They constitute a milestone in the field of argumentation because they
are the first abstract argumentation formalism, very intuitive to use and – as
shown in the initial paper – they are capable to express established mathematical
problems such as the stable marriage problem. afs are graphs, whose nodes depict
arguments. Edges between arguments represent a binary attack relation (aRb :,
a attacks b). Arguments are said to be true, if none of their parents are. Since afs
were introduced, there have been many suggestions for formalisms that cover a
wider array of problem instances. Abstract Dialectical Frameworks (adfs) [2] are
one of them. They feature arbitrary acceptance conditions for nodes, which make
it possible to model support and weak attacks between arguments. Semantics of
af have successfully been generalized for adfs. The complexity of finding models
on those abstracted semantics has been examined in detail [3]. The observations
of this examination are promising, because bipolar adfs (which are special adfs)
are in the same complexity class as afs, while still o↵ering more expressiveness.

Labelled graphs are an often used model in Artificial Intelligence (for example
Bayes Nets of probabilistic reasoning). In 2014 Brewka and Woltran introduced a
variant of adfs – grappa (GRaph-based Argument Processing with Patterns of
Acceptance) [4] – to bring established argumentation semantics to labeled graphs.
                                             52
The diamond System is a collection of tools to calculate models of adfs and
variations of them [5]. The subject of this work is to extend diamond to support
grappa inputs. For this matter we will first define an input format to represent
grappa Systems that is suited to be interpreted by Answer Set Programming
(asp) and easy to use. Secondly we will introduce algorithms that process this
input. Our approach is di↵erent to grappavis [6] – the only other software system
that is able to process grappa inputs. Instead of implementing native algorithms
to find models of grappa Systems we will rely on working adf implementations
in diamond. To do this we will convert grappa Systems into adfs in a for-
mat that is accepted by diamond. As diamond is subject of active development
(as seen in [7]) this approach will vastly reduce the need for maintenance. Any
improvement a↵ecting adf-implementations will directly benefit calculations on
grappa Systems. If for example diamond is extended to be capable of finding
models of new semantics on adfs, there is no need to implement the algorithm
again for grappa Systems.

This paper features a working algorithm that functions as a proof of concept as
well as suggestions for improvements to it.


2. Preliminaries

For subsequent algorithms the background will first be set with intuitions and
some formal definitions of adfs and grappa Systems (Section 2.1), Answer Set
Programming and diamond (Section 2.2). Definitions in Section 2.1 are heavily
based on [2] and [4]. Some concepts have purposely been rephrased to o↵er an
easier overview. In particular the definitions of adfs have been brought in line
with grappa, to make their similarities more obvious. The definition of grappa
acceptance patterns has been changed to fit our implementation better. For more
formal details we direct interested readers to the original sources.

2.1. Formal Background

adfs are argumentation graphs, whose nodes depict arguments with fully arbi-
trary acceptance conditions, represented by propositional formulas.

Definition 1. An Abstract Dialectical Framework is a tuple D = (S, E, ⇡) where

   • S is a set of nodes (statements),
   • E ✓ S ⇥ S is a set of edges (dependencies),
   • ⇡ : S ! F OR assigns propositional formulas to nodes as acceptance con-
     dition. Acceptance formulas of nodes contain all parents of the respective
     node and only those parents as atoms.

Valuations on adfs are partial functions that map nodes to true or f alse. The
option to assign no truth value to a node may be used to model missing knowl-
edge. We will represent valuations conveniently as sets of literals containing ele-
                                        53
ments of S which are evaluated to true unnegated and those evaluated to f alse
negated.

Various semantics capture di↵erent intuitions of what makes a valuation sensible.
Most of them are defined on the characteristic operator , which is a function
that maps valuations to valuations. Intuitively it calculates the acceptance condi-
tion of every node in every extension of its input. A valuation e extends another
valuation v, if e is total and v ✓ e. If there is consensus about the truth value
tv of a node s between all extensions of a valuation v, (v)(s) = tv, otherwise
  (v)(s) is undefined.

Definition 2. Let D = (S, E, ⇡) be an adf and v a valuation on D. We say

   • v is admissible in D i↵ v ✓ D (v),
   • v is complete in D i↵ v = D (v),
   • v is grounded in D i↵ v is the least fixed point of D ,
   • v is preferred in D i↵ v is ✓-maximal admissible in D,
   • v is a model of D i↵ v is total and v = D (v),
   • v is a stable model of D i↵ v is a model of D and v restricted to S v (= v \ S)
     is the grounded valuation of Dv = (S v , E v , ⇡ v ), the v-reduct of D, where
     E v = E \ (S v ⇥ S v ), ⇡ v is ⇡ restricted to S v .

grappa Systems were introduced, to bring adf-semantics to labeled argumenta-
tion graphs. Their only di↵erence to adfs is that their edges have labels which
are incorporated in acceptance conditions of nodes [4].

Definition 3. A grappa is a tuple G = (S, E, L, , ⇡) where

   • S is a set of nodes (statements),
   • E is a set of edges (dependencies),
   • L is a set of labels,
   • : E ! L assigns labels to edges,
   • ⇡ : S ! P L assigns acceptance patterns over L to nodes

Definitions of valuations and semantics on grappa can be directly adopted from
adfs. We will call an edge active in a valuation if its origin is true.

The language of acceptance patterns is specifically designed to make quantita-
tive statements about labels of edges entering nodes. Such a statement may read
“There are more than 3 active ‘+’-links” or “Less than half of all ‘ ’-links are
active”. For labels that are integers we can calculate the sum or the least and
greatest element to make statements such as “The sum of all labels is greater
than 0.”. Because acceptance patterns of nodes are tied to labels, several nodes
might receive the same pattern though they have totally di↵erent parents.




                                        54
Definition 4. Let L be a set of labels.

    • A grappa term over L is of the form:
      min, mint , max, maxt , sum, sumt , count, countt or (#l), (#t l) for arbi-
      trary l 2 L
    • A term (over L) is a grappa term, a constant integer or any arithmetic
      combination of the two using the connectors +, , ⇤, div, mod, exp
    • A basic acceptance pattern1 (over L) is of the form term1 ✓ term2 with
      ✓ 2 {<, , =, 6=, , >} or one of the constants ? (false) or > (true)
    • An acceptance pattern (over L) is a basic acceptance pattern or a Boolean
      combination of acceptance patterns.

The value of grappa terms is determined as follows:

Definition 5. Let G = (S, E, L, , ⇡) be a grappa System. For m : L ! N and
s 2 S the value function valsm is defined as:

   valsm (#l) = m(l)                       valsm (#t l) = |{(e, s) 2 E | ((e, s)) = l}|
 valsm (min) = minm                      valsm (mint ) = min{ ((e, s)) | (e, s) 2 E}
 valsm (max) = maxm                      valsm (maxt ) = max{ ((e, s)) | (e, s) 2 E}
 valsm (sum) = ⌃l2L m(l)                 valsm (sumt ) = ⌃(e,s)2E ((e, s))
valsm (count) = |{l | m(l) > 0}|       valsm (countt ) = |{ ((e, s)) | (e, s) 2 E}|

Here m can assign any integer value to labels. Since we are interested in truth
values of nodes in particular valuations m is usually determined by the number
of active links of a valuation.
Values of terms and patterns are determined inductively as one might expect:

     valsm (term1 + term2 ) = valsm (term1 ) + valsm (term2 )
     valsm (term1     term2 ) = valsm (term1 )      valsm (term2 )
                                ..
                                 .
valsm (pattern1 ^ pattern2 ) = valsm (pattern1 ) ^ valsm (pattern2 )
valsm (pattern1 _ pattern2 ) = valsm (pattern1 ) _ valsm (pattern2 )
                                ..
                                 .




  1 The definition of basic acceptance patterns here has been adapted to fit the grappa repre-

sentation in our implementation better. It has to be noted that it is more general than in [4].
Previously it was not possible to connect two grappa terms directly with operators other than
+ or

                                              55
Example 1
These are an adf and a grappa System representing the same argumentation
structure.

           a            b                           a       +    b

                                                        +
                                                            +

           c            d                           c            d


⇡(a) = >            ⇡(b) = b           8s 2 S : ⇡(s) = (#+ = #t +) ^ (#      = 0)
⇡(c) = a ^ b        ⇡(d) = ¬b

2.2. Technical Background

Answer set programming (asp) is a declarative programming language designed
to represent and solve computational problems easily [8]. It uses logical implica-
tions (rules) to deduce models. Rules that contain no premises are facts. We will
use the phrase “rule” only to refer to implications with premises.
It is hard to draw a line between a program and its input, because asp makes
no di↵erence between the two. What we consider a program usually is a set of
implications that predominantly consists of rules. We will use a set of facts as a
program’s input. Models of the aggregation of a program and its input are sets
of facts as well and function as output.

This paper discusses algorithms detached from their implementation. Thus there
is no need to define the syntax and semantics of asp formally, though we strongly
suggest to read about them in [8]. However here is a quick overview of the syn-
tax of facts: Facts in asp are atoms or predicates. Atoms are strings that start
with a lowercase letter, predicates look the same, but are followed by parentheses
that contain the predicates arguments which may also be atoms. Here are some
examples:

it_is_raining.
is_mortal(socrates).

Facts are confined by dots. Predicates also take functions as arguments, which
again are lowercase strings with parentheses that contain arguments. For example:

is_mortal(father_of(socrates)).

This rudimentary introduction to the syntax of facts is sufficient to explain the
inputs of the diamond System.

The diamond system is a collection of tools that are aimed at computing models
of adfs. It is based on asp and o↵ers five di↵erent input formats to define regular
or special kinds of adfs. The two formats that define regular adfs are: propo-
                                        56
sitional formula representation, extensional representation. Both formats use the
binary predicate l/2 to depict edges of adfs.
The formula representation uses the binary predicate ac(N, ) to associate nodes
N with their acceptance formula . is any logical combination (using the connec-
tives _, ^, !, $, , ¬) of parent nodes and the constants > and ? (represented
by c(v) and c(f)).
In the extensional format the truth value of every valuation is stated explicitly
with the help of ci/1, co/1, ci/3, co/3. The predicates ci/1 or co/1 are used
to describe whether a node is true if none of its parents are. A number of ci/3 or
co/3 predicates that use the same arbitrary index as second argument describe
all the other valuations. The way they work is best seen in an example.

Example 2
These two code examples (propositional representation on the left, extensional
representation on the right) are two ways to describe the example adf of Sec-
tion 2.1 in diamond.
l(a,c). l(b,c). l(b,b). l(b,d).          l(a,c). l(b,c). l(b,b). l(b,d).
ac(a,c(v)).                              ci(a). co(b). ci(b,0,b).
ac(b,b).                                 co(c). co(c,1,a). co(c,2,b).
ac(c,and(a,b)).                          ci(c,3,a). ci(c,3,b).
ac(d,neg(b)).                            ci(d). co(d,1,b).


3. Transformations

Subsequently we will introduce the new grappa representation and processes2
that convert it to an input format of diamond. The algorithm in Section 3.2 pur-
posely includes a minimal amount of modifications that improve running times.
It is a proof of concept and sets an upper bound for complexity.
In Section 3.3 we will introduce variants of this algorithm that are aimed at re-
ducing running times. An empirical evaluation of running times and comparisons
to competing systems are subject of future work, as the implementation of these
improvements are still in development.

3.1. The Input Language

The new grappa representation closely resembles the propositional formula rep-
resentation for adfs. Its advantage is that acceptance conditions can be described
by a single formula tree that fits into a single predicate.

Nodes can explicitly be defined by node/1 which is only necessary if there is no
link entering or leaving the node. Links between nodes are defined by l/3 where
the the first argument denotes the parent node, the third argument denotes the
node the link is entering and the second argument represents the link’s label. Ac-
ceptance patterns are assigned to nodes with the help of predicate gac/2 (grappa
  2 Implementations can be viewed at:

https://sourceforge.net/p/diamond-adf/grappa/ref/master/

                                        57
acceptance condition), where the first argument denotes the node and the second
argument the respective acceptance pattern. The language of acceptance patterns
is described by a context free grammar in Figure 1.

        ::= gac(,).
         ::= and(,) | or(,) |
                 imp(,) | iff(,) |
                 xor,) | neg() |
                 c(v) | c(f)
         ::= eq(,) | neq(,) |lt(,) |
                 lte(,) | gt(,) | gte(,)
          ::= plus(,) | minus(,) | times(,) |
                 div(,) | mod(,) | exp(,) |
                 c() | 
 ::= count(