Struct z3::Probe

source ·
pub struct Probe<'ctx> { /* private fields */ }
Expand description

Function/predicate used to inspect a goal and collect information that may be used to decide which solver and/or preprocessing step will be used.

Z3 provides a variety of probes, which can be queried via Probe::list_all().

Implementations§

source§

impl<'ctx> Probe<'ctx>

source

pub fn list_all( ctx: &'ctx Context ) -> impl Iterator<Item = Result<&'ctx str, Utf8Error>>

Iterate through the valid probe names.

Example
use z3::{Config, Context, Probe};

let cfg = Config::new();
let ctx = Context::new(&cfg);
let probes: Vec<_> = Probe::list_all(&ctx).filter_map(|r| r.ok()).collect();
assert!(probes.contains(&"is-quasi-pb"));
source

pub fn describe(ctx: &'ctx Context, name: &str) -> Result<&'ctx str, Utf8Error>

Return a string containing a description of the probe with the given name.

source

pub fn new(ctx: &'ctx Context, name: &str) -> Probe<'ctx>

Return a probe associated with the given name.

Example
use z3::{Config, Context, Probe};

let cfg = Config::new();
let ctx = Context::new(&cfg);
let probe = Probe::new(&ctx, "is-qfbv");
source

pub fn apply(&self, goal: &'ctx Goal<'_>) -> f64

Execute the probe over the goal.

The probe always produce a double value. “Boolean” probes return 0.0 for false, and a value different from 0.0 for true.

source

pub fn constant(ctx: &'ctx Context, val: f64) -> Probe<'ctx>

Return a probe that always evaluates to val.

use z3::{Config, Context, Probe};

let cfg = Config::new();
let ctx = Context::new(&cfg);
let probe = Probe::constant(&ctx, 1.0);
source

pub fn lt(&self, p: Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is less than the value returned by p.

NOTE: For probes, “true” is any value different from 0.0.

source

pub fn gt(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is greater than the value returned by p.

source

pub fn le(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is less than or equal to the value returned by p.

source

pub fn ge(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is greater than or equal to the value returned by p.

source

pub fn eq(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is equal to the value returned by p.

source

pub fn and(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when self and p evaluates to true.

source

pub fn or(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when p1 or p2 evaluates to true.

source

pub fn not(&self) -> Probe<'ctx>

Return a probe that evaluates to “true” when p does not evaluate to true.

source

pub fn ne(&self, p: &Probe<'_>) -> Probe<'ctx>

Return a probe that evaluates to “true” when the value returned by self is not equal to the value returned by p.

Trait Implementations§

source§

impl<'ctx> Clone for Probe<'ctx>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'ctx> Debug for Probe<'ctx>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'ctx> Display for Probe<'ctx>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'ctx> Drop for Probe<'ctx>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'ctx> RefUnwindSafe for Probe<'ctx>

§

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

§

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

§

impl<'ctx> Unpin for Probe<'ctx>

§

impl<'ctx> UnwindSafe for Probe<'ctx>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.