-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An implementation of the Dung argumentation frameworks. -- -- An implementation of Dung's argumentation frameworks, an abstract -- argumentation model used to either directly represent conflicting -- information, or used as a translation target for more complex -- (structured) argumentation models. For an introduction to Dung's -- frameworks see -- http://en.wikipedia.org/wiki/Argumentation_framework and Dung's -- paper from 1995: "On the acceptability of arguments and its -- fundamental role in nonmonotonic reasoning, logic programming, and -- n-person games", Artificial Intelligence 77: 321-357. For the paper -- accompanying this library see "Towards a framework for the -- implementation and verification of translations between argumentation -- models" available at http://www.cs.nott.ac.uk/~bmv/Dung/. @package Dung @version 0.9 -- | This module implements Dung's argumentation frameworks. module Language.Dung.AF -- | An abstract argumentation framework is a set of arguments (represented -- as a list) and an attack relation on these arguments. data DungAF arg AF :: [arg] -> [(arg, arg)] -> DungAF arg -- | Given an argumentation framework, determines whether args (subset of -- the arguments in the AF), attacks an argument arg (in the AF). setAttacks :: Eq arg => DungAF arg -> [arg] -> arg -> Bool -- | Given an argumentation framework, determines whether args (subset of -- the arguments in the AF) is conflict-free. conflictFree :: Eq arg => DungAF arg -> [arg] -> Bool -- | Given an argumentation framework, determines whether an argument is -- acceptable with respect to a list of args (subset of the -- arguments in the AF). acceptable :: Eq arg => DungAF arg -> arg -> [arg] -> Bool -- | Given an argumentation framework, determines whether an argument is -- acceptable with respect to args (subset of the arguments in -- the AF). f :: Eq arg => DungAF arg -> [arg] -> [arg] -- | Given an argumentation framework, determines whether the set of -- arguments args (subset of the arguments in the AF) is -- admissible, i.e. if args is conflictFree and args is a -- subset of f af args admissible :: Eq arg => DungAF arg -> [arg] -> Bool -- | Given a list of arguments that are Out in an argumentation -- framework af, an argument arg is unattacked if the list of -- its attackers, ignoring the outs, is empty. unattacked :: Eq arg => [arg] -> DungAF arg -> arg -> Bool -- | Given a list of arguments that are In in an argumentation -- framework af, an argument arg is attacked if there exists an -- attacker that is In. attacked :: Eq arg => [arg] -> DungAF arg -> arg -> Bool -- | Given a characteristic function f, computes the grounded extension by -- iterating on the empty set (list) until it reaches a fixpoint. groundedF :: Eq arg => ([arg] -> [arg]) -> [arg] -- | Labelling of arguments. data Status In :: Status Out :: Status Undecided :: Status -- | Computes the grounded labelling for a Dung argumentation framework, -- returning a list of arguments with statuses. -- -- Based on section 4.1 of Proof Theories and Algorithms for Abstract -- Argumentation Frameworks by Modgil and Caminada grounded :: Eq arg => DungAF arg -> [(arg, Status)] -- | The grounded extension of an argumentation framework is just the -- grounded labelling, keeping only those arguments that were labelled -- In. groundedExt :: Eq arg => DungAF arg -> [arg] instance Eq arg => Eq (DungAF arg) instance Show arg => Show (DungAF arg) instance Eq Status instance Show Status -- | This is the examples module accompanying the implementation of Dung's -- argumentation frameworks. -- -- This module contains a collection of examples, showing how to define -- arguments, argumentation frameworks and how to use the standard -- definitions. -- -- To run these examples, or your own: start GHCi and do the following: -- --
--   :l Language.Dung.Examples
--   
module Language.Dung.Examples -- | The simplest abstract argument is an argument identifiable by its name type AbsArg = String -- | Example AF: A -> B -> C exampleAF :: DungAF AbsArg -- | Example AF: A <-> B -- -- Now follow a few example outputs using the above argumentation -- frameworks. -- -- -- -- [a,b] setAttacks c in the argumentation -- framework exampleAF: -- --
--   >>> setAttacks exampleAF [a,b] c
--   True
--   
-- --
--   >>> setAttacks exampleAF [b,c] a
--   False
--   
-- --
--   >>> setAttacks exampleAF2 [] b
--   False
--   
-- -- -- -- [a,c] is conflictFree in the argumentation framework -- exampleAF: -- --
--   >>> conflictFree exampleAF [a,c]
--   True
--   
-- --
--   >>> conflictFree exampleAF [a,b,c]
--   False
--   
-- --
--   >>> conflictFree exampleAF2 [a,b]
--   False
--   
-- -- -- -- c is acceptable w.r.t. [a,b] in the argumentation -- framework exampleAF: -- --
--   >>> acceptable exampleAF c [a,b]
--   True
--   
-- --
--   >>> acceptable exampleAF c []
--   False
--   
-- --
--   >>> acceptable exampleAF b [a,b,c]
--   False
--   
-- -- -- -- [a,b,c] is admissible in the argumentation framework -- exampleAF: -- --
--   >>> admissible exampleAF [a,b,c]
--   False
--   
-- --
--   >>> admissible exampleAF [a,c]
--   True
--   
-- --
--   >>> admissible exampleAF [a]
--   True
--   
-- -- -- -- The grounded labelling of the argumentation framework -- exampleAF: -- --
--   >>> grounded exampleAF
--   [("A",In),("C",In),("B",Out)]
--   
-- --
--   >>> grounded exampleAF2
--   [("A",Undecided),("B",Undecided)]
--   
-- -- -- -- The grounded extension of the argumentation framework -- exampleAF: -- --
--   >>> groundedExt exampleAF
--   ["A", "C"]
--   
--   >>> groundedExt exampleAF2
--   []
--   
exampleAF2 :: DungAF AbsArg -- | fixed point function for a specific argumentation framework, faf = -- f exampleAF. -- -- -- -- The grounded extension of the argumentation framework exampleAF -- using the fixpoint definition: -- --
--   >>> groundedF faf
--   ["A","C"]
--   
-- --
--   >>> groundedF (f exampleAF2)
--   []
--   
faf :: [AbsArg] -> [AbsArg]