Expand description
§Zelen - FlatZinc Frontend for Selen
Zelen provides FlatZinc parsing and integration with the Selen constraint solver.
§Quick Start
use zelen::prelude::*;
// Define a simple FlatZinc problem
let fzn = r#"
var 1..10: x;
var 1..10: y;
constraint int_eq(x, 5);
constraint int_plus(x, y, 12);
solve satisfy;
"#;
// Create solver and solve
let mut solver = FlatZincSolver::new();
solver.load_str(fzn).unwrap();
if solver.solve().is_ok() {
// Get FlatZinc-formatted output
let output = solver.to_flatzinc();
assert!(output.contains("x = 5"));
assert!(output.contains("y = 7"));
}
§Main API
The primary way to use Zelen is through the FlatZincSolver
which provides
automatic FlatZinc parsing and spec-compliant output formatting.
For more control, you can use the lower-level FlatZincModel
trait or work
with individual modules directly.
See the prelude
module for commonly used types and traits.
Re-exports§
pub use error::FlatZincError;
pub use error::FlatZincResult;
pub use solver::FlatZincSolver;
pub use solver::FlatZincContext;
pub use solver::SolverOptions;
pub use integration::FlatZincModel;
pub use selen;
Modules§
- error
- Error types for FlatZinc parsing and integration
- integration
- FlatZinc integration methods for Model
- output
- FlatZinc Output Formatter
- prelude
- Prelude module for convenient imports.
- solver
- FlatZinc Solver Wrapper