eenn β Enlightened Equation Neural Network
A hybrid neural-symbolic constraint solver with cognitive reasoning capabilities.
β οΈ Status: Experimental / Research Prototype
This project is not yet ready for production use. It's a research platform exploring hybrid neural-symbolic constraint solving.
Overview
eenn is an experimental constraint solver that combines neural network guidance with symbolic reasoning to solve mathematical constraint problems. It features:
- π§ Hybrid Architecture: Neural hints guide symbolic SMT solving
- β‘ Lightning Strike: Cognitive reasoning engine with dynamic strategy selection
- π’ Advanced Constraint Solving: Handles linear systems, non-linear equations, and inequality ranges
- π― Smart Features: Parentheses support, inequality ranges, multi-variable systems
Quick Start
Installation
Add to your Cargo.toml:
[]
= "0.1"
Or install the CLI tool:
Basic Usage
# Solve a simple equation
# Output: x = 7, y = 3
# Non-linear systems
# Output: x = 3, y = 4
# Parentheses support
# Output: (solution found)
# Inequality ranges
# Output: 5 < x < 10
Features
1. Parentheses-Aware Expression Parsing
Handles nested expressions with proper operator precedence:
// Correctly parses: 3 * (2 + 5) = 21
// Evaluates inner expression first
2. Non-Linear System Solving
Uses intelligent brute-force search for small integer domains:
# Finds: x = 3, y = 4 (or x = 4, y = 3)
3. Inequality Range Solutions
Shows solution ranges instead of arbitrary single values:
# Output: 0 <= x <= 100
# Output: 5 < x <= 15
4. Lightning Strike Cognitive Engine
Dynamic reasoning strategy selection based on problem characteristics:
- Linear Algebra for systems of linear equations
- Symbolic SMT for complex constraints
- Neural Guidance for pattern recognition
- Brute Force for small non-linear systems
Architecture
Hybrid Reasoning Pipeline
βββββββββββββββββββ
β User Constraintβ
β Parser β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Lightning β
β Strike βββββ Cognitive branch selection
β Reasoning β
ββββββββββ¬βββββββββ
β
βββΊ Neural Surrogate (pattern hints)
β
βββΊ SMT Backend (symbolic solving)
β βββΊ Linear System Solver
β βββΊ Non-Linear Brute Force
β βββΊ Inequality Range Detector
β
βββΊ Hybrid Verification
Key Components
theory_core: Core constraint solving logic, SMT backend, Lightning Strike engineconstraint_parser: Expression parsing with parentheses supportsmt_stub: Linear, non-linear, and inequality solverslightning_strike: Cognitive reasoning and strategy selectionsurrogate: Neural network guidance (demo implementation)
Library Usage
As a Constraint Solver
use parse_constraints;
use ;
// Parse constraints
let = parse_constraints?;
// Solve
let backend = new;
let solution = backend.solve?;
// Access results
if solution.satisfiable
As a Neural Network Library
eenn also provides basic neural network building blocks:
use ;
// Create a function registry
let mut registry = empty;
registry.register_fn;
// Build a simple neuron
let neuron = new;
// Evaluate
let output = neuron.eval; // = relu(6.0) = 6.0
Command-Line Interface
eenn-solve
The eenn-solve binary provides an interactive constraint solving interface:
# Basic solving
# Verbose mode (shows strategy and timing)
# Interactive mode
Examples
# Linear systems
# Non-linear
# Inequalities
# Complex expressions with parentheses
Advanced Features
Zero-Copy Serialization (Optional)
eenn uses rkyv for optional zero-copy serialization of neural network architectures:
[]
= { = "0.1", = ["rkyv"] }
# Run tests with rkyv
# Unsafe fast path (trusted inputs only)
Note: The rkyv feature provides zero-copy deserialization for optimal performance. Neural network weights use standard serde serialization.
GPU Acceleration (Experimental)
[]
= { = "0.1", = ["gpu"] }
GPU support is experimental and requires WGPU-compatible hardware.
Known Limitations
-
Reversed Comparisons:
5 < xmust be written asx > 5- Parser currently expects variable on the left side
- Workaround: Rewrite constraints in standard form
-
Non-Linear Complexity: Brute-force search limited to small domains
- Default range: -20 to 20
- Maximum combinations: 1,000,000
- Use for small integer problems only
-
Inequality Mixing: Mixed equality/inequality constraints may not optimize ranges
- Pure inequality constraints β range output
- Mixed constraints β single value from equality solver
Benchmarking
The repository includes benchmarks comparing different solving strategies and serialization performance.
Running Benchmarks
# Run all benchmarks
# Run specific benchmark
# Compare rehydration performance
The benchmarks compare:
- Solving Strategies: Linear vs. brute-force vs. symbolic SMT
- Serialization: Standard serde vs. rkyv zero-copy
- Rehydration: Validated vs. unchecked deserialization paths
Note: For reproducible results, pin dependencies and use consistent CPU frequency/power settings.
Development
Building from Source
# Clone the repository
# Build
# Run tests
# Run with specific features
Project Structure
eenn/
βββ src/
β βββ lib.rs # Main library
β βββ constraint_parser.rs # Expression parsing
β βββ models.rs # Neural network serialization
β βββ nn.rs # Neural network training
β βββ bin/
β βββ eenn-solve.rs # CLI application
βββ crates/
β βββ theory_core/ # Core constraint solving
β β βββ src/
β β β βββ smt_stub.rs # SMT backend
β β β βββ lightning_strike.rs # Cognitive reasoning
β β β βββ surrogate.rs # Neural guidance
β β β βββ ir.rs # Constraint IR
β β βββ Cargo.toml
β βββ lightning_strike/ # Standalone reasoning crate
βββ tests/ # Integration tests
βββ examples/ # Example programs
βββ benches/ # Benchmarks
Running Benchmarks
Future Directions
eenn v2 is planned as a complete rewrite built on:
- Candle: Modern Rust tensor library
- llama.cpp: Efficient LLM inference
- vLLM: Production-grade serving
This will enable true neural constraint solving with real language models.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE-2.0 or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Citation
If you use eenn in your research, please cite:
Acknowledgments
eenn builds on research in:
- Hybrid neural-symbolic reasoning
- SMT solving and constraint satisfaction
- Cognitive architectures for AI
Contact
Status: Experimental / Research Prototype
This is a research project exploring hybrid neural-symbolic constraint solving. While functional, it is not recommended for production use without thorough testing for your specific use case.