pub fn solve(source: &str) -> Result<Result<Solution, SolverError>>Expand description
Solve a MiniZinc model and return the solution
This is a convenience function that combines parse, translate, and solve.
§Arguments
source- MiniZinc source code as a string
§Returns
Returns a nested Result:
- Outer
Result: Parsing/translation errors - Inner
Result: Solver errors (satisfiability, resource limits, etc.)
§Example
match zelen::solve("var 1..10: x; solve satisfy;") {
Ok(Ok(solution)) => assert!(true), // Solution found
Ok(Err(_)) => assert!(true), // Unsatisfiable
Err(e) => panic!("Parse error: {}", e),
}