pub trait SolverInterface {
Show 18 methods fn num_vars(&self) -> u32; fn num_clauses(&self) -> u32; fn num_conflicts(&self) -> u32; fn is_ok(&self) -> bool; fn print_stats(&self); fn new_var(&mut self, upol: lbool, dvar: bool) -> Var; fn new_var_default(&mut self) -> Var; fn add_clause_reuse(&mut self, clause: &mut Vec<Lit>) -> bool; fn simplify(&mut self) -> bool; fn solve_limited(&mut self, assumps: &[Lit]) -> lbool; fn proved_at_lvl_0(&self) -> &[Lit]; fn get_model(&self) -> &[lbool]; fn value_var(&self, _: Var) -> lbool; fn value_lit(&self, _: Lit) -> lbool; fn value_lvl_0(&self, _: Lit) -> lbool; fn unsat_core(&self) -> &[Lit]; fn unsat_core_contains_lit(&self, lit: Lit) -> bool; fn unsat_core_contains_var(&self, v: Var) -> bool;
}
Expand description

Main interface for a solver: it makes it possible to add clauses, allocate variables, and check for satisfiability

Required Methods

Print some current statistics to standard output.

Creates a new SAT variable in the solver. If ‘decision’ is cleared, variable will not be used as a decision variable (NOTE! This has effects on the meaning of a SATISFIABLE result).

Create a new variable with the default polarity

Add a clause to the solver. Returns false if the solver is in an UNSAT state.

Simplify the clause database according to the current top-level assigment. Currently, the only thing done here is the removal of satisfied clauses, but more things can be put here.

Search for a model that respects a given set of assumptions (With resource constraints).

Obtain the slice of literals that are proved at level 0.

These literals will keep this value from now on.

Query whole model

Precondition: last result was Sat (ie lbool::TRUE)

Query model for var

Precondition: last result was Sat (ie lbool::TRUE)

Query model for lit

Value of this literal if it’s assigned at level 0, or UNDEF otherwise

Return unsat core (as a subset of assumptions).

Precondition: last result was Unsat

Does this literal occur in the unsat-core?

Precondition: last result was Unsat

Does this variable occur in the unsat-core?

Precondition: last result was Unsat

Implementors