use crate::opt::lang::MathLang;
use egg::{Rewrite, rewrite as rw};

pub fn rules() -> Vec<Rewrite<MathLang, ()>> {
    let mut out = Vec::new();
    out.extend(rw!("comm-add"; "(+ ?a ?b)" <=> "(+ ?b ?a)"));
    out.extend(rw!("comm-mul"; "(* ?a ?b)" <=> "(* ?b ?a)"));
    out.extend(rw!("assoc-add"; "(+ (+ ?a ?b) ?c)" <=> "(+ ?a (+ ?b ?c))"));
    out.extend(rw!("assoc-mul"; "(* (* ?a ?b) ?c)" <=> "(* ?a (* ?b ?c))"));
    out
}
