#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(super) enum PlanRuleId {
    Pattern6,
    Pattern7,
    Pattern5,
    Pattern8,
    Pattern3,
    Pattern4,
    Pattern9,
    Pattern2,
    Pattern1,
}

pub(super) const PLAN_RULE_ORDER: &[PlanRuleId] = &[
    PlanRuleId::Pattern6,
    PlanRuleId::Pattern7,
    PlanRuleId::Pattern5,
    PlanRuleId::Pattern8,
    PlanRuleId::Pattern3,
    PlanRuleId::Pattern4,
    PlanRuleId::Pattern9,
    PlanRuleId::Pattern2,
    PlanRuleId::Pattern1,
];

pub(super) fn rule_name(id: PlanRuleId) -> &'static str {
    match id {
        PlanRuleId::Pattern6 => "Pattern6_ScanWithInit (Phase 273)",
        PlanRuleId::Pattern7 => "Pattern7_SplitScan (Phase 273)",
        PlanRuleId::Pattern5 => "Pattern5_InfiniteEarlyExit (Phase 286 P3.2)",
        PlanRuleId::Pattern8 => "Pattern8_BoolPredicateScan (Phase 286 P2.4)",
        PlanRuleId::Pattern3 => "Pattern3_IfPhi (Phase 286 P2.6)",
        PlanRuleId::Pattern4 => "Pattern4_Continue (Phase 286 P2)",
        PlanRuleId::Pattern9 => "Pattern9_AccumConstLoop (Phase 286 P2.3)",
        PlanRuleId::Pattern2 => "Pattern2_Break (Phase 286 P3.1)",
        PlanRuleId::Pattern1 => "Pattern1_SimpleWhile (Phase 286 P2.1)",
    }
}
