Skip to content

Commit 19d7146

Browse files
authored
Merge pull request #1 from nebasuke/modernize-v2
Modernize v2
2 parents 295dfab + f7455c8 commit 19d7146

File tree

19 files changed

+783
-238
lines changed

19 files changed

+783
-238
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
name: GHC ${{ matrix.ghc }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
ghc: ['9.4', '9.6', '9.8', '9.10']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: haskell-actions/setup@v2
22+
with:
23+
ghc-version: ${{ matrix.ghc }}
24+
25+
- name: Cache cabal store
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cabal/store
29+
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('Dung.cabal') }}
30+
restore-keys: |
31+
${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-
32+
33+
- name: Update cabal package list
34+
run: cabal update
35+
36+
- name: Build
37+
run: cabal build all
38+
39+
- name: Run tests
40+
run: cabal test all --test-show-details=direct

CHANGELOG

Lines changed: 0 additions & 45 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
## 1.1 → 2.0.0.0
4+
5+
### Breaking changes
6+
7+
- **Fixed `groundedF` infinite-loop bug**: `groundedF` now correctly applies
8+
the characteristic function at each step instead of recursing with unchanged
9+
arguments. Code relying on `groundedF'` as a workaround can switch back to
10+
`groundedF`.
11+
12+
- **CLI rewritten**: The `dungell` executable now uses `optparse-applicative`
13+
instead of `cmdargs`. Command-line flags have changed:
14+
- Semantics are selected via `--grounded`, `--preferred`, `--stable`,
15+
`--semi-stable`, or `--all`
16+
17+
### Improvements
18+
19+
- Upgraded to `cabal-version: 3.0` format
20+
- Relaxed `containers` upper bound to build on GHC 9.4+
21+
- Added `Language.Dung` convenience re-export module
22+
- Added test suite (tasty + QuickCheck + doctest)
23+
- Added GitHub Actions CI for GHC 9.4, 9.6, 9.8, 9.10
24+
- Fixed all `-Wall` warnings
25+
- Removed dependency on unmaintained `cmdargs` library
26+
- Converted documentation to Markdown
27+
28+
## 1.0.0.1 → 1.1
29+
30+
This package version is now compatible with the command-line application for
31+
the ICCMA competition. See: <https://github.com/nebasuke/DungICCMA> and the
32+
competition website: <http://argumentationcompetition.org/2015/index.html>
33+
34+
This package has again been significantly extended and now includes:
35+
36+
- Strict version of the grounded fixpoint semantics.
37+
- Definitions of what it means to be a preferred and stable extension.
38+
- Naive implementations of complete, preferred and stable semantics using
39+
the characteristic function. The fixpoint definitions are actually FASTER
40+
than the fancy algorithm implementation.
41+
- Included the fast implementations of `intersect`, `nub` and `(\\)` by
42+
Niklas Hambuechen.
43+
- Added some clarifying text for the "complete" labelling.
44+
45+
## 1.0 → 1.0.0.1
46+
47+
- Fixed the record declaration in Main.hs.
48+
- Added an example file.
49+
50+
## 0.9 → 1.0
51+
52+
This package version is now compatible with the translation package
53+
CarneadesIntoDung. See <http://hackage.haskell.org/package/CarneadesIntoDung/>
54+
55+
This package has furthermore been significantly extended and now includes:
56+
57+
- Preferred, stable and semi-stable semantics along with all definitions from
58+
Caminada's paper "An Algorithm for Computing Semi-Stable Semantics".
59+
- An Input module, allowing files in standard CEGARTIX/PrefSat format to be
60+
parsed.
61+
- An Output module, allowing AFs in this package to be outputted in standard
62+
CEGARTIX/PrefSat format.
63+
- A main executable, allowing input files to be read, argumentation frameworks
64+
to be outputted and evaluated.

Dung.cabal

Lines changed: 85 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,102 @@
1+
cabal-version: 3.0
12
name: Dung
2-
category: Argumentation, Embedded, AI
3-
version: 1.1
4-
license: BSD3
5-
cabal-version: >= 1.6
3+
version: 2.0.0.0
4+
license: BSD-3-Clause
65
license-file: LICENSE
76
author: Bas van Gijzel
8-
maintainer: Bas van Gijzel <bmv@cs.nott.ac.uk>
7+
maintainer: Bas van Gijzel <nenekotan+git@gmail.com>
8+
copyright: Copyright (C) 2014-2026 Bas van Gijzel
99
stability: experimental
10-
homepage: http://www.cs.nott.ac.uk/~bmv/Dung/
11-
copyright: Copyright (C) 2014 Bas van Gijzel
10+
category: Argumentation, Embedded, AI
11+
homepage: https://github.com/nebasuke/Dung
1212
synopsis: An implementation of the Dung argumentation frameworks.
13-
description: An implementation of Dung's argumentation frameworks, an abstract argumentation model used to either directly represent conflicting information, or used as
14-
a translation target for more complex (structured) argumentation models. For an introduction to Dung's frameworks see
15-
<http://en.wikipedia.org/wiki/Argumentation_framework> and Dung's paper from 1995: \"On the acceptability of arguments and its fundamental role
16-
in nonmonotonic reasoning, logic programming, and n-person games\", Artificial Intelligence 77: 321-357.
17-
For the papers accompanying this library see \"Towards a framework for the implementation and verification of translations between argumentation
18-
models\" and \"A principled approach to the implementation of argumentation models\", available at <http://www.cs.nott.ac.uk/~bmv/Dung/>.
13+
description:
14+
An implementation of Dung's argumentation frameworks, an abstract
15+
argumentation model used to either directly represent conflicting
16+
information, or used as a translation target for more complex (structured)
17+
argumentation models. For an introduction to Dung's frameworks see
18+
<http://en.wikipedia.org/wiki/Argumentation_framework> and Dung's paper
19+
from 1995: \"On the acceptability of arguments and its fundamental role
20+
in nonmonotonic reasoning, logic programming, and n-person games\",
21+
Artificial Intelligence 77: 321-357.
22+
For the papers accompanying this library see \"Towards a framework for
23+
the implementation and verification of translations between argumentation
24+
models\" and \"A principled approach to the implementation of argumentation
25+
models\", available at <https://scholar.google.com/citations?user=Xu4yjvwAAAAJ&hl>.
1926

2027
build-type: Simple
28+
tested-with: GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.4, GHC == 9.10.1
2129

22-
Extra-Source-Files:
23-
CHANGELOG
24-
exampleaf.txt
30+
extra-doc-files:
31+
README.md
32+
CHANGELOG.md
2533

26-
Library
27-
build-depends:
28-
base >= 4 && < 5,
29-
containers >= 0.3 && < 0.6,
30-
cmdargs >= 0.10.2,
31-
parsec >= 3
34+
extra-source-files:
35+
LICENSE
36+
exampleaf.txt
37+
dungex.txt
3238

33-
hs-source-dirs:
34-
src
39+
source-repository head
40+
type: git
41+
location: https://github.com/nebasuke/Dung
3542

43+
common warnings
44+
ghc-options:
45+
-Wall
46+
-Wcompat
47+
-Widentities
48+
-Wincomplete-record-updates
49+
-Wincomplete-uni-patterns
50+
-Wredundant-constraints
51+
default-language: Haskell2010
52+
53+
library
54+
import: warnings
55+
hs-source-dirs: src
56+
build-depends:
57+
base >= 4.16 && < 5,
58+
containers >= 0.6 && < 0.8,
59+
parsec >= 3.1 && < 3.2
3660
exposed-modules:
61+
Language.Dung
3762
Language.Dung.AF
3863
Language.Dung.Examples
39-
Language.Dung.Output
4064
Language.Dung.Input
65+
Language.Dung.Output
4166

42-
Executable dungell
43-
main-Is: Main.hs
44-
hs-source-dirs: src
67+
executable dungell
68+
import: warnings
69+
main-is: Main.hs
70+
hs-source-dirs: app
71+
build-depends:
72+
base >= 4.16 && < 5,
73+
Dung,
74+
optparse-applicative >= 0.17 && < 0.19
75+
ghc-options: -threaded
4576

46-
source-repository head
47-
Type: git
48-
Location: https://github.com/nebasuke/Dung
77+
test-suite dung-tests
78+
import: warnings
79+
type: exitcode-stdio-1.0
80+
main-is: Main.hs
81+
hs-source-dirs: test
82+
build-depends:
83+
base >= 4.16 && < 5,
84+
Dung,
85+
containers >= 0.6 && < 0.8,
86+
tasty >= 1.4 && < 1.6,
87+
tasty-hunit >= 0.10 && < 0.11,
88+
tasty-quickcheck >= 0.10 && < 0.11,
89+
QuickCheck >= 2.14 && < 2.16
90+
other-modules:
91+
Test.Language.Dung.AF
92+
Test.Language.Dung.Input
93+
Test.Language.Dung.Properties
94+
95+
test-suite dung-doctest
96+
import: warnings
97+
type: exitcode-stdio-1.0
98+
main-is: Doctest.hs
99+
hs-source-dirs: test
100+
build-depends:
101+
base >= 4.16 && < 5,
102+
doctest >= 0.20 && < 0.23

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c)2014, 2015, Bas van Gijzel
1+
Copyright (c) 2014-2026, Bas van Gijzel
22

33
All rights reserved.
44

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Dung
2+
3+
An implementation of Dung's argumentation frameworks, an abstract argumentation
4+
model used to either directly represent conflicting information, or used as
5+
a translation target for more complex (structured) argumentation models.
6+
7+
For an introduction to Dung's frameworks see the
8+
[Wikipedia article on argumentation frameworks](http://en.wikipedia.org/wiki/Argumentation_framework)
9+
and Dung's paper from 1995:
10+
11+
> "On the acceptability of arguments and its fundamental role in nonmonotonic
12+
> reasoning, logic programming, and n-person games", Artificial Intelligence
13+
> 77: 321-357.
14+
15+
For the papers accompanying this library see:
16+
17+
- "Towards a framework for the implementation and verification of translations
18+
between argumentation models"
19+
- "A principled approach to the implementation of argumentation models"
20+
21+
Available at <https://scholar.google.com/citations?user=Xu4yjvwAAAAJ&hl>.
22+
23+
## Usage
24+
25+
```haskell
26+
import Language.Dung
27+
28+
-- Define an argumentation framework: A -> B -> C
29+
let af = AF ["A", "B", "C"] [("A", "B"), ("B", "C")]
30+
31+
-- Compute the grounded extension
32+
groundedExt af
33+
-- ["A", "C"]
34+
35+
-- Compute preferred extensions
36+
preferredExt af
37+
-- [["A","C"]]
38+
```
39+
40+
## Executable
41+
42+
The `dungell` executable reads argumentation frameworks from files in
43+
CEGARTIX/PrefSat format:
44+
45+
```
46+
dungell --filename exampleaf.txt --grounded
47+
dungell --filename exampleaf.txt --preferred
48+
dungell --filename exampleaf.txt --all
49+
```
50+
51+
## License
52+
53+
BSD-3-Clause. See [LICENSE](LICENSE) for details.

README.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

Setup.hs

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)