Struct SmtConf

Source
pub struct SmtConf { /* private fields */ }
Expand description

Configuration and solver specific info.

  • [z3][z3]: full support
  • [cvc4][cvc4]: full support in theory, but only partially tested. Note that get-value is known to crash some versions of CVC4.
  • [yices 2][yices 2]: full support in theory, but only partially tested. Command get-model will only work on Yices 2 > 2.6.1, and needs to be activated in SmtConf with conf.models(). To understand why, see https://github.com/SRI-CSL/yices2/issues/162.

Implementations§

Source§

impl SmtConf

Source

pub fn z3() -> Self

Creates a new z3-like solver configuration.

§Examples
let conf = SmtConf::z3() ;
assert! {
    conf.get_cmd() == "z3" || conf.get_cmd() == "z3.exe"
}
Source

pub fn cvc4() -> Self

Creates a new cvc4-like solver configuration.

§Examples
let conf = SmtConf::cvc4() ;
assert! {
    conf.get_cmd() == "cvc4" || conf.get_cmd() == "cvc4.exe"
}
Source

pub fn yices_2() -> Self

Creates a new yices-2-like solver configuration.

§Examples
let conf = SmtConf::yices_2() ;
assert! {
    conf.get_cmd() == "yices-smt2" || conf.get_cmd() == "yices-smt2.exe"
}
Source

pub fn spawn<Parser>(self, parser: Parser) -> SmtRes<Solver<Parser>>

Spawns the solver.

§Examples
let _solver = SmtConf::z3().spawn(()).unwrap() ;
Source

pub fn desc(&self) -> &str

Concise description of the underlying solver.

§Examples
assert_eq! { SmtConf::z3().desc(), "z3" }
Source

pub fn get_models(&self) -> bool

Model production flag.

Source

pub fn models(&mut self)

Activates model production.

Source

pub fn get_incremental(&self) -> bool

Incrementality.

Source

pub fn incremental(&mut self)

Activates incrementality (push/pop, check-sat-assuming).

Source

pub fn get_cmd(&self) -> &str

Solver command.

§Examples
let conf = SmtConf::z3() ;
assert! {
    conf.get_cmd() == "z3" || conf.get_cmd() == "z3.exe"
}
Source

pub fn get_options(&self) -> &[String]

Options of the configuration.

§Examples
assert_eq! {
    SmtConf::z3().get_options(), & [ "-in", "-smt2" ]
}
Source

pub fn get_print_success(&self) -> bool

Indicates if print success is active.

§Examples
assert! { ! SmtConf::z3().get_print_success() }
Source

pub fn get_unsat_cores(&self) -> bool

Indicates if unsat cores is active.

§Examples
assert! { ! SmtConf::z3().get_unsat_cores() }
Source

pub fn get_check_sat_assuming(&self) -> Option<&'static str>

Keyword for check-sat with assumptions.

§Examples
assert_eq! {
    SmtConf::z3().get_check_sat_assuming(), Some("check-sat-assuming")
}
Source

pub fn option<S: Into<String>>(&mut self, o: S) -> &mut Self

Adds an option to the configuration.

§Examples
let mut conf = SmtConf::z3() ;
conf.option("arith.euclidean_solver=true") ;
assert_eq! {
    conf.get_options(),
    & [ "-in", "-smt2", "arith.euclidean_solver=true" ]
}
Source

pub fn cmd<S: Into<String>>(&mut self, cmd: S) -> &mut Self

Sets the command for the solver.

§Examples
let mut conf = SmtConf::z3() ;
conf.cmd("my_custom_z3_command") ;
assert_eq! { conf.get_cmd(), "my_custom_z3_command" }
Source

pub fn print_success(&mut self)

Activates parse sucess.

§Examples
let mut conf = SmtConf::z3() ;
conf.print_success() ;
assert! { conf.get_print_success() }
Source

pub fn unsat_cores(&mut self)

Activates unsat-core production.

§Examples
let mut conf = SmtConf::z3() ;
conf.unsat_cores() ;
assert! { conf.get_unsat_cores() }
Source§

impl SmtConf

§Solver-specific error-handling
Source

pub fn enrich_get_values_error(&self, e: Error) -> Error

Adds information to a get-value error message if needed.

Trait Implementations§

Source§

impl Clone for SmtConf

Source§

fn clone(&self) -> SmtConf

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 SmtConf

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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.