pub struct BipolarFramework<A: Clone + Eq + Hash> { /* private fields */ }Expand description
A bipolar argumentation framework over argument type A.
The type is generic over A to match the core crate’s convention —
A can be String, &'static str, a custom ArgumentId newtype, etc.
Implementations§
Source§impl<A: Clone + Eq + Hash> BipolarFramework<A>
impl<A: Clone + Eq + Hash> BipolarFramework<A>
Sourcepub fn add_argument(&mut self, a: A)
pub fn add_argument(&mut self, a: A)
Add an argument. Adding an argument that already exists is a no-op.
Sourcepub fn add_attack(&mut self, attacker: A, target: A)
pub fn add_attack(&mut self, attacker: A, target: A)
Add an attack attacker → target. Both arguments are implicitly
added to the framework if not already present. Adding the same
attack twice is a no-op.
Sourcepub fn add_support(&mut self, supporter: A, supported: A) -> Result<(), Error>where
A: Debug,
pub fn add_support(&mut self, supporter: A, supported: A) -> Result<(), Error>where
A: Debug,
Add a support supporter → supported. Both arguments are
implicitly added. Adding the same support twice is a no-op.
Returns Error::IllegalSelfSupport if supporter == supported
— an argument cannot be its own necessary supporter.
Sourcepub fn remove_support(&mut self, supporter: &A, supported: &A) -> bool
pub fn remove_support(&mut self, supporter: &A, supported: &A) -> bool
Remove a support edge. Returns true if the edge was present. Used by consumers modelling betrayal (a support edge is retracted). Does NOT remove the endpoint arguments from the framework.
Sourcepub fn remove_attack(&mut self, attacker: &A, target: &A) -> bool
pub fn remove_attack(&mut self, attacker: &A, target: &A) -> bool
Remove an attack edge. Returns true if the edge was present.
Sourcepub fn arguments(&self) -> impl Iterator<Item = &A>
pub fn arguments(&self) -> impl Iterator<Item = &A>
Iterate over all arguments in the framework.
Sourcepub fn supports(&self) -> impl Iterator<Item = (&A, &A)>
pub fn supports(&self) -> impl Iterator<Item = (&A, &A)>
Iterate over all direct support edges.
Sourcepub fn direct_attackers(&self, a: &A) -> Vec<&A>
pub fn direct_attackers(&self, a: &A) -> Vec<&A>
Direct attackers of a (arguments X such that X → a in the
attack edge set). Does NOT include derived attackers — see
crate::derived for the closure.
Sourcepub fn direct_supporters(&self, a: &A) -> Vec<&A>
pub fn direct_supporters(&self, a: &A) -> Vec<&A>
Direct supporters of a (arguments X such that X → a in the
support edge set).
Sourcepub fn supporter_map(&self) -> HashMap<&A, HashSet<&A>>
pub fn supporter_map(&self) -> HashMap<&A, HashSet<&A>>
Map of each argument to its direct necessary supporters.
Used by the support-closure filter in crate::semantics and
by crate::queries for transitive queries.
Trait Implementations§
Source§impl<A: Clone + Clone + Eq + Hash> Clone for BipolarFramework<A>
impl<A: Clone + Clone + Eq + Hash> Clone for BipolarFramework<A>
Source§fn clone(&self) -> BipolarFramework<A>
fn clone(&self) -> BipolarFramework<A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more