Skip to main content

StructuredSystem

Struct StructuredSystem 

Source
pub struct StructuredSystem { /* private fields */ }
Expand description

An ASPIC+ structured argumentation system.

Implementations§

Source§

impl StructuredSystem

Source

pub fn new() -> Self

Create a new empty system.

Source

pub fn with_ordering(ordering: DefeatOrdering) -> Self

Create a new system with a specific defeat ordering.

Source

pub fn ordering(&self) -> DefeatOrdering

Return the currently active defeat ordering.

Source

pub fn kb_mut(&mut self) -> &mut KnowledgeBase

Mutable access to the knowledge base.

Source

pub fn add_necessary(&mut self, l: Literal)

Convenience forwarder for KnowledgeBase::add_necessary.

Source

pub fn add_ordinary(&mut self, l: Literal)

Convenience forwarder for KnowledgeBase::add_ordinary.

Source

pub fn add_strict_rule( &mut self, premises: Vec<Literal>, conclusion: Literal, ) -> RuleId

Add a strict rule, returning its id.

Source

pub fn add_defeasible_rule( &mut self, premises: Vec<Literal>, conclusion: Literal, ) -> RuleId

Add a defeasible rule, returning its id.

Source

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.

Source

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.

Source

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).

Source

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.

Source

pub fn premise_preferences(&self) -> &[(Literal, Literal)]

Read-side accessor for the direct premise preference pairs.

Source

pub fn kb(&self) -> &KnowledgeBase

Read-side accessor for the knowledge base (for debugging/visualization).

Source

pub fn rules(&self) -> &[Rule]

Read-side accessor for the rule set.

Source

pub fn preferences(&self) -> &[(RuleId, RuleId)]

Read-side accessor for the direct preference pairs (not transitively closed).

Source

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.

Source

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.

Source

pub fn arguments(&self) -> Result<Vec<Argument>, Error>

Expose constructed arguments. Convenience wrapper over Self::build_framework; see its docs for performance notes.

Trait Implementations§

Source§

impl Debug for StructuredSystem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StructuredSystem

Source§

fn default() -> StructuredSystem

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.