//! Knowledge base representation for ASPIC+ systems.
//!
//! The knowledge base K = (Kn, Kp) partitions premises into axioms (Kn) and
//! ordinary premises (Kp), per Definition 3.3 of Modgil & Prakken (2014).

use crate::language::formula::Formula;

/// The epistemic status of a premise in the knowledge base.
///
/// ASPIC+ distinguishes two kinds of premises (Modgil & Prakken 2014,
/// Definition 3.3):
/// - **Axiom** (Kn): cannot be attacked.
/// - **Ordinary** (Kp): can be attacked via undermining.
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum PremiseKind {
    /// Cannot be attacked (Kn).
    Axiom,
    /// Can be attacked via undermining (Kp).
    Ordinary,
}

/// A single premise in the knowledge base: a formula together with its
/// epistemic status ([`PremiseKind`]).
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub struct Premise {
    pub formula: Formula,
    pub kind: PremiseKind,
}

/// The knowledge base K = (Kn, Kp) of an ASPIC+ system.
///
/// Contains the set of all premises (both axioms and ordinary premises) that
/// serve as the starting points for argument construction.
#[derive(Clone, Debug, Default)]
pub struct KnowledgeBase {
    pub premises: Vec<Premise>,
}
