| Crates.io | eenn |
| lib.rs | eenn |
| version | 0.1.0 |
| created_at | 2025-10-06 19:08:52.506591+00 |
| updated_at | 2025-10-06 19:08:52.506591+00 |
| description | A hybrid neural-symbolic constraint solver with cognitive reasoning capabilities |
| homepage | |
| repository | https://github.com/ciresnave/eenn.git |
| max_upload_size | |
| id | 1870664 |
| size | 782,355 |
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.
eenn is an experimental constraint solver that combines neural network guidance with symbolic reasoning to solve mathematical constraint problems. It features:
Add to your Cargo.toml:
[dependencies]
eenn = "0.1"
Or install the CLI tool:
cargo install eenn
# Solve a simple equation
eenn-solve solve -p "x + y = 10 and x - y = 4"
# Output: x = 7, y = 3
# Non-linear systems
eenn-solve solve -p "x * y = 12 and x + y = 7"
# Output: x = 3, y = 4
# Parentheses support
eenn-solve solve -p "3 * (2 + 5) = 21"
# Output: (solution found)
# Inequality ranges
eenn-solve solve -p "x > 5 and x < 10"
# Output: 5 < x < 10
Handles nested expressions with proper operator precedence:
// Correctly parses: 3 * (2 + 5) = 21
// Evaluates inner expression first
Uses intelligent brute-force search for small integer domains:
eenn-solve solve -p "x * y = 12 and x + y = 7"
# Finds: x = 3, y = 4 (or x = 4, y = 3)
Shows solution ranges instead of arbitrary single values:
eenn-solve solve -p "x >= 0 and x <= 100"
# Output: 0 <= x <= 100
eenn-solve solve -p "x > 5 and x <= 15"
# Output: 5 < x <= 15
Dynamic reasoning strategy selection based on problem characteristics:
βββββββββββββββββββ
β 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
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)use eenn::constraint_parser::parse_constraints;
use theory_core::{SmtBackend, ConstraintSolver};
// Parse constraints
let (constraints, var_map) = parse_constraints("x + y = 10 and x > 5")?;
// Solve
let backend = SmtBackend::new();
let solution = backend.solve(&constraints)?;
// Access results
if solution.satisfiable {
for (var, value) in &solution.assignment {
println!("{} = {}", var, value);
}
// Check for ranges (inequalities)
if let Some(ranges) = &solution.variable_ranges {
for (var, range) in ranges {
println!("{}", range); // e.g., "5 < x"
}
}
}
eenn also provides basic neural network building blocks:
use eenn::{FunctionRegistry, Neuron, Stage, relu, scale};
// Create a function registry
let mut registry = FunctionRegistry::empty();
registry.register_fn("relu", relu, "ReLU activation");
// Build a simple neuron
let neuron = Neuron::new(
vec![Stage::new(scale(2.0))],
Stage::new(relu)
);
// Evaluate
let output = neuron.eval(3.0); // = relu(6.0) = 6.0
The eenn-solve binary provides an interactive constraint solving interface:
# Basic solving
eenn-solve solve -p "equation"
# Verbose mode (shows strategy and timing)
eenn-solve solve -p "equation" -v
# Interactive mode
eenn-solve solve
# Linear systems
eenn-solve solve -p "2*x + 3*y = 13 and x - y = 1"
# Non-linear
eenn-solve solve -p "x^2 = 16"
# Inequalities
eenn-solve solve -p "x >= 10 and x <= 20"
# Complex expressions with parentheses
eenn-solve solve -p "2 * (x + 3) = 10"
eenn uses rkyv for optional zero-copy serialization of neural network architectures:
[dependencies]
eenn = { version = "0.1", features = ["rkyv"] }
# Run tests with rkyv
cargo test --features rkyv
# Unsafe fast path (trusted inputs only)
cargo test --features "rkyv rkyv_unchecked"
Note: The rkyv feature provides zero-copy deserialization for optimal performance. Neural network weights use standard serde serialization.
[dependencies]
eenn = { version = "0.1", features = ["gpu"] }
GPU support is experimental and requires WGPU-compatible hardware.
Reversed Comparisons: 5 < x must be written as x > 5
Non-Linear Complexity: Brute-force search limited to small domains
Inequality Mixing: Mixed equality/inequality constraints may not optimize ranges
The repository includes benchmarks comparing different solving strategies and serialization performance.
# Run all benchmarks
cargo bench --all-features
# Run specific benchmark
cargo bench --bench simple_bench
# Compare rehydration performance
cargo bench --bench rehydration_bench
The benchmarks compare:
Note: For reproducible results, pin dependencies and use consistent CPU frequency/power settings.
# Clone the repository
git clone https://github.com/ciresnave/eenn.git
cd eenn
# Build
cargo build --release
# Run tests
cargo test
# Run with specific features
cargo test --features rkyv
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
cargo bench
eenn v2 is planned as a complete rewrite built on:
This will enable true neural constraint solving with real language models.
Contributions are welcome! Please:
Licensed under either of:
at your option.
If you use eenn in your research, please cite:
@software{eenn2025,
author = {Evans, Eric},
title = {eenn: Enlightened Equation Neural Network},
year = {2025},
url = {https://github.com/ciresnave/eenn}
}
eenn builds on research in:
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.