conjure_cp_core/ast/
categories.rs1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, Hash)]
10pub enum Category {
11 Bottom = 0,
13 Constant = 1,
15 Parameter = 2,
17 Quantified = 3,
19 Decision = 4,
21}
22
23impl Display for Category {
24 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25 match self {
26 Category::Bottom => write!(f, "_|_"),
27 Category::Constant => write!(f, "constant"),
28 Category::Parameter => write!(f, "parameter"),
29 Category::Quantified => write!(f, "quantified"),
30 Category::Decision => write!(f, "decision"),
31 }
32 }
33}
34
35pub trait CategoryOf {
37 fn category_of(&self) -> Category;
39}