argumentation_schemes/types.rs
1//! Foundational types for argumentation schemes.
2
3/// Unique identifier for a scheme in a catalog.
4///
5/// IDs are assigned per category via the offset constants in
6/// [`crate::catalog`]. Within a category, IDs are sequential.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8pub struct SchemeId(pub u32);
9
10/// Category of argumentation scheme. Used for catalog filtering.
11#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
12pub enum SchemeCategory {
13 /// Knowledge-based: expert opinion, witness testimony, position to know.
14 Epistemic,
15 /// Cause and effect: cause to effect, correlation, sign.
16 Causal,
17 /// Action-oriented: consequences, values, goals, waste.
18 Practical,
19 /// Attacking the source: ad hominem, bias, credibility.
20 SourceBased,
21 /// Social proof: popularity, tradition, precedent.
22 Popular,
23 /// Structural reasoning: analogy, classification, commitment.
24 Analogical,
25}
26
27/// What role a premise slot plays in the scheme.
28#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
29pub enum SlotRole {
30 /// A person or character (the expert, the witness, the attacker).
31 Agent,
32 /// A proposition being argued for or against.
33 Proposition,
34 /// A property or trait being attributed to someone.
35 Property,
36 /// An action being proposed, evaluated, or warned about.
37 Action,
38 /// A domain, field, or context constraining the argument.
39 Domain,
40 /// A consequence or outcome.
41 Consequence,
42}
43
44/// How strong a scheme's inference typically is.
45#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
46pub enum SchemeStrength {
47 /// Strong presumption (e.g., argument from established rule).
48 Strong,
49 /// Moderate presumption (e.g., argument from expert opinion).
50 Moderate,
51 /// Weak presumption (e.g., argument from popularity).
52 Weak,
53}
54
55/// What aspect of a scheme a critical question challenges.
56#[derive(Debug, Clone, PartialEq, Eq, Hash)]
57pub enum Challenge {
58 /// Challenges the truth of a specific premise (by slot name).
59 PremiseTruth(String),
60 /// Challenges the credibility or reliability of the source agent.
61 SourceCredibility,
62 /// Challenges the validity of the inference rule itself.
63 RuleValidity,
64 /// Raises a conflicting authority or counter-expert.
65 ConflictingAuthority,
66 /// Raises an alternative cause or explanation.
67 AlternativeCause,
68 /// Raises unconsidered consequences.
69 UnseenConsequences,
70 /// Challenges the relevance or proportionality of the attack.
71 Proportionality,
72 /// Challenges the analogy's structural similarity.
73 DisanalogyClaim,
74}
75
76#[cfg(test)]
77mod tests {
78 use super::*;
79
80 #[test]
81 fn scheme_id_equality_is_value_based() {
82 assert_eq!(SchemeId(1), SchemeId(1));
83 assert_ne!(SchemeId(1), SchemeId(2));
84 }
85
86 #[test]
87 fn challenge_distinguishes_premise_slots() {
88 let c1 = Challenge::PremiseTruth("expert".into());
89 let c2 = Challenge::PremiseTruth("domain".into());
90 assert_ne!(c1, c2);
91 }
92}