Skip to main content

Probe

Struct Probe 

Source
pub struct Probe { /* 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 Probe

Source

pub fn list_all() -> Vec<Result<String, Utf8Error>>

Iterate through the valid probe names.

§Example
let probes: Vec<_> = Probe::list_all().into_iter().filter_map(|r| r.ok()).collect();
assert!(probes.contains(&"is-quasi-pb".to_string()));
Source

pub fn describe(name: &str) -> Result<String, Utf8Error>

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

Source

pub fn new(name: &str) -> Probe

Return a probe associated with the given name.

§Example

let probe = Probe::new("is-qfbv");
Source

pub fn apply(&self, goal: &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(val: f64) -> Probe

Return a probe that always evaluates to val.

let probe = Probe::constant(1.0);
Source

pub fn lt(&self, p: &Probe) -> Probe

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

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

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

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

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

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

Source

pub fn or(&self, p: &Probe) -> Probe

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

Source

pub fn not(&self) -> Probe

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

Source

pub fn ne(&self, p: &Probe) -> Probe

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 Clone for Probe

Source§

fn clone(&self) -> Self

Returns a duplicate 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 Debug for Probe

Source§

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

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

impl Display for Probe

Source§

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

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

impl Drop for Probe

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Probe

§

impl RefUnwindSafe for Probe

§

impl !Send for Probe

§

impl !Sync for Probe

§

impl Unpin for Probe

§

impl UnsafeUnpin for Probe

§

impl UnwindSafe for Probe

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

Source§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.