[][src]Struct z3::Optimize

pub struct Optimize<'ctx> { /* fields omitted */ }

Context for solving optimization queries.

Methods

impl<'ctx> Optimize<'ctx>[src]

pub fn new(ctx: &'ctx Context) -> Optimize<'ctx>[src]

Create a new optimize context.

pub fn assert(&self, ast: &impl Ast<'ctx>)[src]

Assert hard constraint to the optimization context.

See also:

pub fn maximize(&self, ast: &impl Ast<'ctx>)[src]

Add a maximization constraint.

See also:

pub fn minimize(&self, ast: &impl Ast<'ctx>)[src]

Add a minimization constraint.

See also:

pub fn push(&self)[src]

Create a backtracking point.

The optimize solver contains a set of rules, added facts and assertions. The set of rules, facts and assertions are restored upon calling Optimize::pop().

See also:

pub fn pop(&self)[src]

Backtrack one level.

Preconditions:

See also:

pub fn check(&self, assumptions: &[Bool<'ctx>]) -> SatResult[src]

Check consistency and produce optimal values.

See also:

pub fn get_model(&self) -> Model<'ctx>[src]

Retrieve the model for the last Optimize::check()

The error handler is invoked if a model is not available because the commands above were not invoked for the given optimization solver, or if the result was Z3_L_FALSE.

pub fn get_reason_unknown(&self) -> Option<String>[src]

Retrieve a string that describes the last status returned by Optimize::check().

Use this method when Optimize::check() returns SatResult::Unknown.

Trait Implementations

impl<'ctx> Drop for Optimize<'ctx>[src]

impl<'ctx> Display for Optimize<'ctx>[src]

Auto Trait Implementations

impl<'ctx> !Send for Optimize<'ctx>

impl<'ctx> Unpin for Optimize<'ctx>

impl<'ctx> !Sync for Optimize<'ctx>

impl<'ctx> UnwindSafe for Optimize<'ctx>

impl<'ctx> RefUnwindSafe for Optimize<'ctx>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]