1
use std::fmt;
2

            
3
/// Variant of variability solver to use.
4
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
6
pub enum Solver {
7
    /// Zielonka's recursive algorithm.
8
    Zielonka,
9
    /// Priority promotion algorithm.
10
    PriorityPromotion,
11
}
12

            
13
/// Variant of the parity game algorithm to use.
14
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
15
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
16
pub enum VpgSolver {
17
    /// Product-based solver.
18
    Product,
19
    /// Standard family-based Zielonka algorithm.
20
    Family,
21
    /// Left-optimised family-based Zielonka variant.
22
    FamilyOptimisedLeft,
23
}
24

            
25
impl fmt::Display for Solver {
26
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27
        match self {
28
            Self::Zielonka => write!(f, "zielonka"),
29
            Self::PriorityPromotion => write!(f, "priority-promotion"),
30
        }
31
    }
32
}
33

            
34
impl fmt::Display for VpgSolver {
35
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
36
        match self {
37
            Self::Product => write!(f, "product"),
38
            Self::Family => write!(f, "family"),
39
            Self::FamilyOptimisedLeft => write!(f, "family-optimised-left"),
40
        }
41
    }
42
}