argumentation_weighted/lib.rs
1//! # argumentation-weighted
2//!
3//! Weighted argumentation frameworks (Dunne, Hunter, McBurney, Parsons
4//! & Wooldridge 2011) built on top of the [`argumentation`] crate's
5//! Dung semantics.
6//!
7//! A weighted framework attaches an `f64` weight to each attack edge.
8//! Under the **inconsistency-budget** semantics of Dunne et al., a
9//! budget `β` permits attacks whose cumulative weight is at most `β`
10//! to be tolerated for the purposes of computing Dung extensions. The
11//! budget acts as a single knob: `β = 0` runs standard Dung semantics
12//! over every attack; increasing `β` progressively tolerates more
13//! attacks and accepts more arguments.
14//!
15//! ## Quick example
16//!
17//! ```
18//! use argumentation_weighted::framework::WeightedFramework;
19//! use argumentation_weighted::sweep::min_budget_for_credulous;
20//!
21//! let mut wf = WeightedFramework::new();
22//! wf.add_weighted_attack("attacker", "target", 0.6).unwrap();
23//!
24//! // At what budget does `target` become accepted?
25//! let min = min_budget_for_credulous(&wf, &"target").unwrap();
26//! assert_eq!(min, Some(0.6));
27//! ```
28//!
29//! ## Semantics
30//!
31//! Implements the **inconsistency-budget** semantics of Dunne et al.
32//! 2011 via exact subset enumeration: a budget `β` permits any subset
33//! `S` of attacks whose cumulative weight is at most `β` to be
34//! tolerated, and an argument is accepted at β iff it is accepted in
35//! the Dung sense on *some* (credulous) or *all* (skeptical) of the
36//! resulting residual frameworks. Enumeration is O(2^m) in the number
37//! of attacks `m`; see [`reduce::ATTACK_ENUMERATION_LIMIT`] for the
38//! guard.
39//!
40//! ## References
41//!
42//! - Dunne, P. E., Hunter, A., McBurney, P., Parsons, S., &
43//! Wooldridge, M. (2011). *Weighted argument systems: Basic
44//! definitions, algorithms, and complexity results.* Artificial
45//! Intelligence 175(2).
46//! - Bistarelli, S., Rossi, F., & Santini, F. (2018). *A collective
47//! defence against grouped attacks for weighted abstract argumentation
48//! frameworks.* IJAR 92.
49//! - Coste-Marquis, S. et al. (2012). *Weighted attacks in
50//! argumentation frameworks.* KR 2012.
51
52#![deny(missing_docs)]
53#![warn(clippy::all)]
54
55pub mod error;
56pub mod framework;
57pub mod reduce;
58pub mod semantics;
59pub mod sweep;
60pub mod types;
61pub mod weight_source;
62
63pub use error::Error;
64pub use framework::WeightedFramework;
65pub use reduce::{ATTACK_ENUMERATION_LIMIT, dunne_residuals};
66pub use semantics::{
67 complete_at_budget, grounded_at_budget, is_credulously_accepted_at, is_skeptically_accepted_at,
68 preferred_at_budget, stable_at_budget,
69};
70pub use sweep::{
71 AcceptanceMode, SweepPoint, acceptance_trajectory, flip_points, min_budget_for_credulous,
72};
73pub use types::{AttackWeight, Budget, WeightedAttack};
74pub use weight_source::{ClosureWeightSource, WeightSource, populate_from_source};