1use serde::Deserialize;
2use std::fmt::{Display, Error, Formatter};
3
4#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7pub enum Rewrite {
8 AsIs,
9 Instantiated,
10 HeadNormal,
11 Simplified,
12 Normalised,
13}
14
15impl Default for Rewrite {
16 fn default() -> Self {
17 Rewrite::Simplified
18 }
19}
20
21#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
24pub enum ComputeMode {
25 DefaultCompute,
26 IgnoreAbstract,
27 UseShowInstance,
28}
29
30impl Default for ComputeMode {
31 fn default() -> Self {
32 ComputeMode::DefaultCompute
33 }
34}
35
36#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
37pub enum Comparison {
38 CmpEq,
39 CmpLeq,
40}
41
42impl Display for Comparison {
43 fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
44 f.write_str(match self {
45 Comparison::CmpEq => "==",
46 Comparison::CmpLeq => "<=",
47 })
48 }
49}
50
51#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
53pub enum CompareDirection {
54 DirEq,
55 DirLeq,
56 DirGeq,
57}
58
59impl From<Comparison> for CompareDirection {
60 fn from(from: Comparison) -> Self {
61 match from {
62 Comparison::CmpEq => CompareDirection::DirEq,
63 Comparison::CmpLeq => CompareDirection::DirLeq,
64 }
65 }
66}
67
68#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
70pub enum Polarity {
71 Covariant,
73 Contravariant,
75 Invariant,
77 Nonvariant,
79}
80
81impl Display for Polarity {
82 fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
83 f.write_str(match self {
84 Polarity::Covariant => "+",
85 Polarity::Contravariant => "-",
86 Polarity::Invariant => "*",
87 Polarity::Nonvariant => "_",
88 })
89 }
90}
91
92#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
95pub enum UseForce {
96 WithForce,
98 WithoutForce,
100}
101
102#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
103pub enum Remove {
104 Remove,
105 Keep,
106}
107
108#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
111pub enum TokenBased {
112 TokenBased,
113 NotOnlyTokenBased,
114}
115
116impl Default for TokenBased {
117 fn default() -> Self {
118 TokenBased::NotOnlyTokenBased
119 }
120}
121
122#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
123pub enum Hiding {
124 YesOverlap,
125 NoOverlap,
126 Hidden,
127 NotHidden,
128}
129
130#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
133pub enum Relevance {
134 Relevant,
136 NonStrict,
140 Irrelevant,
142}
143
144#[derive(Deserialize, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
148pub enum Cohesion {
149 Flat,
151 Continuous,
153 Sharp,
155 Squash,
157}