tensorlogic_compiler/dead_code/mod.rs
1//! Dead-code elimination pass.
2//!
3//! Submodules:
4//! - `types` — public config, stats, and the main [`DeadCodeEliminator`] type.
5//! - `consts` — helpers to detect constant truth/falsity.
6//! - `fold` — constant folding for Boolean connectives and `if` branches.
7//! - `free_vars` — free-variable analysis for `let`-binding elimination.
8//! - `node_count` — AST node counting plus generic unary/binary recursion helpers.
9//! - `eliminate_flow` — elimination arms for control-flow-shaped nodes.
10//! - `eliminate_ops` — elimination arms for arithmetic / comparison / modal ops.
11//! - `eliminate_ext` — elimination arms for fuzzy / set / aggregate / leaf nodes.
12//! - `eliminate` — the core recursive dispatcher that delegates to the above.
13
14mod consts;
15mod eliminate;
16mod eliminate_ext;
17mod eliminate_flow;
18mod eliminate_ops;
19mod fold;
20mod free_vars;
21mod node_count;
22mod types;
23
24#[cfg(test)]
25mod tests;
26
27pub use types::{DceConfig, DceStats, DeadCodeEliminator};