[][src]Struct screwsat::solver::Solver

pub struct Solver {
    pub models: Vec<LitBool>,
    pub status: Option<Status>,
    // some fields omitted
}

Fields

models: Vec<LitBool>status: Option<Status>

Implementations

impl Solver[src]

pub fn new(n: usize, clauses: &[Vec<Lit>]) -> Solver[src]

Create a new Solver struct

Arguments

  • n - The number of variable
  • clauses - All clauses that solver solves

pub fn new_var(&mut self)[src]

pub fn add_clause(&mut self, clause: &[Lit])[src]

Add a new clause to clauses and watch a clause. If a variable is greater than the size of array, grow it.

Arguments

  • clause - a clause has one or some literal variables

pub fn reserve_clause(&mut self, cla_num: usize)[src]

Reserve the space of a clause database

Arguments

  • cla_num - The number of clause

pub fn reserve_variable(&mut self, var_num: usize)[src]

Arguments

  • var_num - The number of variable

pub fn solve(&mut self, time_limit: Option<Duration>) -> Status[src]

Solve a problem and return a enum Status.

Arguments

  • time_limit - The time limitation for searching. Exceeding the time limit returns Indeterminate

Trait Implementations

impl Debug for Solver[src]

impl Default for Solver[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.