Skip to content

Commit

Permalink
optimize: add parameter configuration API
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrmaxmeier authored and waywardmonkeys committed Jan 19, 2024
1 parent ab67534 commit 64cc930
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion z3/src/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use z3_sys::*;

use crate::{
ast::{Ast, Bool, Dynamic},
Context, Model, Optimize, SatResult, Statistics, Symbol,
Context, Model, Optimize, Params, SatResult, Statistics, Symbol,
};

use num::{
Expand Down Expand Up @@ -198,6 +198,11 @@ impl<'ctx> Optimize<'ctx> {
.map(|s| s.to_string())
}

/// Configure the parameters for this Optimize.
pub fn set_params(&self, params: &Params<'ctx>) {
unsafe { Z3_optimize_set_params(self.ctx.z3_ctx, self.z3_opt, params.z3_params) };
}

/// Retrieve the statistics for the last [`Optimize::check()`].
pub fn get_statistics(&self) -> Statistics<'ctx> {
unsafe {
Expand Down

0 comments on commit 64cc930

Please sign in to comment.