use crate::core::{
    compile_passes::{
        build_arithmetic_circuits::ArithmeticCircuitBuilder,
        build_boolean_circuits::BooleanCircuitBuilder,
        compilation_pass::CompilationPass,
        expand_complex_expr::ComplexExprExpanderTestnet,
        introduce_eda_bits::EdaBitIntroducer,
    },
    ir::IntermediateRepresentation,
};
use primitives::algebra::elliptic_curve::Curve25519Ristretto;

mod build_arithmetic_circuits;
mod build_boolean_circuits;
mod circuit_builder;
pub mod circuit_pass;
mod compilation_pass;
mod dead_code_eliminator;
mod dead_gate_eliminator;
mod expand_complex_expr;
mod introduce_eda_bits;
mod optimizer;
mod to_async_mpc_circuit;

type Gate = core_utils::circuit::Gate<Curve25519Ristretto>;

pub const BUILD_FN_SEQ: [fn(IntermediateRepresentation) -> IntermediateRepresentation; 4] = [
    // Build arithmetic circuits.
    ArithmeticCircuitBuilder::make_and_run,
    // Build boolean circuits.
    BooleanCircuitBuilder::make_and_run,
    // Introduce eda bits.
    EdaBitIntroducer::make_and_run,
    // Lincomb is not a gate on async-mpc, so we remove it.
    ComplexExprExpanderTestnet::make_and_run,
];

pub use dead_code_eliminator::DeadCodeEliminator;
pub use dead_gate_eliminator::DeadGateEliminator;
pub use introduce_eda_bits::new_eda_bit;
pub use optimizer::Optimizer;
