pub mod fusion;
pub mod identity;
pub mod simplify;

use crate::opt::OptConfig;
use crate::opt::lang::MathLang;
use egg::Rewrite;

pub fn all_rules(config: &OptConfig) -> Vec<Rewrite<MathLang, ()>> {
    let mut rules = Vec::new();
    rules.extend(simplify::rules());
    if config.const_chain_fold_enabled() {
        rules.extend(simplify::aggressive_rules());
    }
    rules.extend(identity::rules());
    rules.extend(fusion::rules());
    rules
}
