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
impl Probe
Sourcepub fn list_all() -> Vec<Result<String, Utf8Error>>
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()));Sourcepub fn describe(name: &str) -> Result<String, Utf8Error>
pub fn describe(name: &str) -> Result<String, Utf8Error>
Return a string containing a description of the probe with
the given name.
Sourcepub fn apply(&self, goal: &Goal) -> f64
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.
Sourcepub fn constant(val: f64) -> Probe
pub fn constant(val: f64) -> Probe
Return a probe that always evaluates to val.
let probe = Probe::constant(1.0);Sourcepub fn lt(&self, p: &Probe) -> Probe
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.
Sourcepub fn gt(&self, p: &Probe) -> Probe
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.
Sourcepub fn le(&self, p: &Probe) -> Probe
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.
Sourcepub fn ge(&self, p: &Probe) -> Probe
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.
Sourcepub fn eq(&self, p: &Probe) -> Probe
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.
Sourcepub fn and(&self, p: &Probe) -> Probe
pub fn and(&self, p: &Probe) -> Probe
Return a probe that evaluates to “true” when self and p evaluates to true.
Sourcepub fn or(&self, p: &Probe) -> Probe
pub fn or(&self, p: &Probe) -> Probe
Return a probe that evaluates to “true” when p1 or p2 evaluates to true.