1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

use crate::*;

macro_rules! makeeq {
    ($x:ident) => {
        impl PartialEq for $x {
            fn eq(&self, other: &$x) -> bool {
                true
            }
        }
        impl Eq for $x {}
        impl PartialOrd for $x {
            fn partial_cmp(&self, other: &$x) -> Option<Ordering> {
                Some(Ordering::Equal)
            }
        }
        impl Ord for $x {
            fn cmp(&self, other: &$x) -> Ordering {
                Ordering::Equal
            }
        }
    };
}

makeeq!(CG);

#[derive(Debug, Clone, Copy)]
pub struct CG(pub usize);


pub type Pre = Box<Re>;
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Re {
    Set(Bset),
    Not(Pre),
    Kle(Pre),
    Pls(Pre),
    Cap(Pre, CG),
    Cat(Pre, Pre),
    Alt(Pre, Pre),
}