pub struct StructuredSystem { /* private fields */ }Expand description
An ASPIC+ structured argumentation system.
Implementations§
Source§impl StructuredSystem
impl StructuredSystem
Sourcepub fn with_ordering(ordering: DefeatOrdering) -> Self
pub fn with_ordering(ordering: DefeatOrdering) -> Self
Create a new system with a specific defeat ordering.
Sourcepub fn ordering(&self) -> DefeatOrdering
pub fn ordering(&self) -> DefeatOrdering
Return the currently active defeat ordering.
Sourcepub fn kb_mut(&mut self) -> &mut KnowledgeBase
pub fn kb_mut(&mut self) -> &mut KnowledgeBase
Mutable access to the knowledge base.
Sourcepub fn add_necessary(&mut self, l: Literal)
pub fn add_necessary(&mut self, l: Literal)
Convenience forwarder for KnowledgeBase::add_necessary.
Sourcepub fn add_ordinary(&mut self, l: Literal)
pub fn add_ordinary(&mut self, l: Literal)
Convenience forwarder for KnowledgeBase::add_ordinary.
Sourcepub fn add_strict_rule(
&mut self,
premises: Vec<Literal>,
conclusion: Literal,
) -> RuleId
pub fn add_strict_rule( &mut self, premises: Vec<Literal>, conclusion: Literal, ) -> RuleId
Add a strict rule, returning its id.
Sourcepub fn add_defeasible_rule(
&mut self,
premises: Vec<Literal>,
conclusion: Literal,
) -> RuleId
pub fn add_defeasible_rule( &mut self, premises: Vec<Literal>, conclusion: Literal, ) -> RuleId
Add a defeasible rule, returning its id.
Sourcepub fn add_undercut_rule(
&mut self,
target: RuleId,
premises: Vec<Literal>,
) -> RuleId
pub fn add_undercut_rule( &mut self, target: RuleId, premises: Vec<Literal>, ) -> RuleId
Add an undercut rule targeting the defeasible rule target.
This is the safe way to construct an undercut: it encodes the
conclusion as the reserved literal ¬__applicable_<target>, which
super::attacks::compute_attacks recognises.
Consumers should never build this literal by hand — the __applicable_
prefix is reserved and must not be used in user atom names.
Sourcepub fn prefer_rule(
&mut self,
preferred: RuleId,
less_preferred: RuleId,
) -> Result<(), Error>
pub fn prefer_rule( &mut self, preferred: RuleId, less_preferred: RuleId, ) -> Result<(), Error>
Record that rule preferred is (directly) preferred to rule less_preferred.
The effective preference ordering is the transitive closure of these
pairs, computed on demand in is_preferred: a chain of direct
preferences r3 > r2 > r1 implies r3 > r1.
§Errors
Returns crate::Error::Aspic if the preference would be reflexive
(a > a) or would create a cycle in the transitive closure (e.g.
adding r2 > r1 when r1 > r2 is already implied). Both cases
violate strict-partial-order semantics and would silently produce
contradictory is_preferred results.
Sourcepub fn prefer_premise(
&mut self,
preferred: Literal,
less_preferred: Literal,
) -> Result<(), Error>
pub fn prefer_premise( &mut self, preferred: Literal, less_preferred: Literal, ) -> Result<(), Error>
Record that ordinary premise preferred is (directly) preferred to
ordinary premise less_preferred.
Per M&P 2014 Definition 3.21, premise preferences are compared under the last-link ordering only when both arguments have empty last-defeasible-rule frontiers (i.e. they are pure-premise arguments or strict-rule chains grounded in premises).
Rejects reflexive (x, x) preferences and cyclic preferences
(where less_preferred is already transitively preferred to
preferred).
Sourcepub fn is_premise_preferred(&self, a: &Literal, b: &Literal) -> bool
pub fn is_premise_preferred(&self, a: &Literal, b: &Literal) -> bool
Whether ordinary premise a is strictly preferred to b under
the transitive closure of recorded premise preferences.
Sourcepub fn premise_preferences(&self) -> &[(Literal, Literal)]
pub fn premise_preferences(&self) -> &[(Literal, Literal)]
Read-side accessor for the direct premise preference pairs.
Sourcepub fn kb(&self) -> &KnowledgeBase
pub fn kb(&self) -> &KnowledgeBase
Read-side accessor for the knowledge base (for debugging/visualization).
Sourcepub fn preferences(&self) -> &[(RuleId, RuleId)]
pub fn preferences(&self) -> &[(RuleId, RuleId)]
Read-side accessor for the direct preference pairs (not transitively closed).
Sourcepub fn build_framework(&self) -> Result<BuildOutput, Error>
pub fn build_framework(&self) -> Result<BuildOutput, Error>
Single-pass construction: build all arguments, compute all attacks,
resolve defeats, and emit a framework. Prefer this over calling
Self::to_framework and Self::arguments separately — each of
those does its own forward-chaining pass.
Sourcepub fn to_framework(&self) -> Result<ArgumentationFramework<ArgumentId>, Error>
pub fn to_framework(&self) -> Result<ArgumentationFramework<ArgumentId>, Error>
Construct arguments, compute attacks, resolve defeats, and emit an AF.
Convenience wrapper over Self::build_framework that discards the
constructed arguments and attacks. Consumers that need those should
call build_framework directly.