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-valueis known to crash some versions of CVC4. - [yices 2][yices 2]: full support in theory, but only partially tested. Command
get-modelwill only work on Yices 2 >2.6.1, and needs to be activated in SmtConf withconf.models(). To understand why, see https://github.com/SRI-CSL/yices2/issues/162.
Implementations§
Source§impl SmtConf
impl SmtConf
Sourcepub fn z3() -> Self
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"
}Sourcepub fn cvc4() -> Self
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"
}Sourcepub fn yices_2() -> Self
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"
}Sourcepub fn get_models(&self) -> bool
pub fn get_models(&self) -> bool
Model production flag.
Sourcepub fn get_incremental(&self) -> bool
pub fn get_incremental(&self) -> bool
Incrementality.
Sourcepub fn incremental(&mut self)
pub fn incremental(&mut self)
Activates incrementality (push/pop, check-sat-assuming).
Sourcepub fn get_cmd(&self) -> &str
pub fn get_cmd(&self) -> &str
Solver command.
§Examples
let conf = SmtConf::z3() ;
assert! {
conf.get_cmd() == "z3" || conf.get_cmd() == "z3.exe"
}Sourcepub fn get_options(&self) -> &[String]
pub fn get_options(&self) -> &[String]
Options of the configuration.
§Examples
assert_eq! {
SmtConf::z3().get_options(), & [ "-in", "-smt2" ]
}Sourcepub fn get_print_success(&self) -> bool
pub fn get_print_success(&self) -> bool
Sourcepub fn get_unsat_cores(&self) -> bool
pub fn get_unsat_cores(&self) -> bool
Sourcepub fn get_check_sat_assuming(&self) -> Option<&'static str>
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")
}Sourcepub fn option<S: Into<String>>(&mut self, o: S) -> &mut Self
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" ]
}Sourcepub fn cmd<S: Into<String>>(&mut self, cmd: S) -> &mut Self
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" }Sourcepub fn print_success(&mut self)
pub fn print_success(&mut self)
Activates parse sucess.
§Examples
let mut conf = SmtConf::z3() ;
conf.print_success() ;
assert! { conf.get_print_success() }Sourcepub fn unsat_cores(&mut self)
pub fn unsat_cores(&mut self)
Activates unsat-core production.
§Examples
let mut conf = SmtConf::z3() ;
conf.unsat_cores() ;
assert! { conf.get_unsat_cores() }Trait Implementations§
Auto Trait Implementations§
impl Freeze for SmtConf
impl RefUnwindSafe for SmtConf
impl Send for SmtConf
impl Sync for SmtConf
impl Unpin for SmtConf
impl UnwindSafe for SmtConf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more