chomsky-rules
Optimization rules collection for the Chomsky framework.
Overview
chomsky-rules is a library of predefined rewrite rules for the Chomsky framework. It contains common algebraic simplifications, constant folding logic, and architectural transformations that can be plugged into the chomsky-rule-engine.
Features
- Constant Folding: Pre-calculates constant expressions (e.g.,
1 + 2 => 3). - Algebraic Simplification: Implements common identities (e.g.,
x + 0 => x,x * 1 => x,x - x => 0). - Boolean Logic: Simplifies boolean expressions and conditional branches.
- Architectural Rules: Provides rules for mapping generic operations to optimized hardware-specific forms.
Core Rules
- ConstantFolding: Handles basic arithmetic operations on constant values.
- AlgebraicSimplification: Applies mathematical identities to reduce program complexity.
Usage
use ;
use ;
use EGraph;
let mut registry = new;
registry.register;
registry.register;