Struct splr::assign::AssignStack

source ·
pub struct AssignStack {
    pub stage_scale: usize,
    pub eliminated: Vec<Lit>,
    pub num_vars: usize,
    pub num_asserted_vars: usize,
    pub num_eliminated_vars: usize,
    pub num_conflict: usize,
    /* private fields */
}
Expand description

A record of assignment. It’s called ‘trail’ in Glucose.

Fields§

§stage_scale: usize§eliminated: Vec<Lit>§num_vars: usize

the number of vars.

§num_asserted_vars: usize

the number of asserted vars.

§num_eliminated_vars: usize

the number of eliminated vars.

§num_conflict: usize

Implementations§

source§

impl AssignStack

source

pub fn rescale_activity(&mut self, scaling: f64)

Trait Implementations§

source§

impl ActivityIF<usize> for AssignStack

source§

fn activity(&self, vi: VarId) -> f64

return one’s activity.
source§

fn set_activity(&mut self, vi: VarId, val: f64)

set activity
source§

fn reward_at_analysis(&mut self, vi: VarId)

modify one’s activity at conflict analysis in conflict_analyze in solver.
source§

fn reward_at_assign(&mut self, _vi: VarId)

modify one’s activity at value assignment in assign.
source§

fn reward_at_propagation(&mut self, _vi: VarId)

modify one’s activity at value assignment in unit propagation.
source§

fn reward_at_unassign(&mut self, vi: VarId)

modify one’s activity at value un-assignment in cancel_until.
source§

fn update_activity_decay(&mut self, scaling: f64)

update reward decay.
source§

fn update_activity_tick(&mut self)

update internal counter.
source§

impl AssignIF for AssignStack

source§

fn root_level(&self) -> DecisionLevel

return root level.
source§

fn stack(&self, i: usize) -> Lit

return a literal in the stack.
source§

fn stack_range(&self, r: Range<usize>) -> &[Lit]

return literals in the range of stack.
source§

fn stack_len(&self) -> usize

return the number of assignments.
source§

fn len_upto(&self, n: DecisionLevel) -> usize

return the number of assignments at a given decision level u. Read more
source§

fn stack_is_empty(&self) -> bool

return true if there’s no assignment.
source§

fn stack_iter(&self) -> Iter<'_, Lit>

return an iterator over assignment stack.
source§

fn decision_level(&self) -> DecisionLevel

return the current decision level.
source§

fn decision_vi(&self, lv: DecisionLevel) -> VarId

return the decision var’s id at that level.
source§

fn remains(&self) -> bool

return true if there are un-propagated assignments.
source§

fn assign_ref(&self) -> &[Option<bool>]

return a reference to assign.
source§

fn level_ref(&self) -> &[DecisionLevel]

return a reference to level.
source§

fn best_assigned(&mut self) -> Option<usize>

source§

fn best_phases_invalid(&self) -> bool

return true if no best_phases
source§

fn extend_model(&mut self, cdb: &mut impl ClauseDBIF) -> Vec<Option<bool>>

inject assignments for eliminated vars.
source§

fn satisfies(&self, vec: &[Lit]) -> bool

return true if the set of literals is satisfiable under the current assignment.
source§

impl Clone for AssignStack

source§

fn clone(&self) -> AssignStack

Returns a copy 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 AssignStack

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for AssignStack

source§

fn default() -> AssignStack

Returns the “default value” for a type. Read more
source§

impl Display for AssignStack

source§

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

Formats the value using the given formatter. Read more
source§

impl From<&mut AssignStack> for Vec<i32>

source§

fn from(asg: &mut AssignStack) -> Vec<i32>

Converts to this type from the input type.
source§

impl Instantiate for AssignStack

source§

fn instantiate(config: &Config, cnf: &CNFDescription) -> AssignStack

make and return an object from Config and CNFDescription.
source§

fn handle(&mut self, e: SolverEvent)

update by a solver event.
source§

impl<'a> IntoIterator for &'a mut AssignStack

§

type Item = &'a Lit

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, Lit>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PropagateIF for AssignStack

source§

fn propagate(&mut self, cdb: &mut impl ClauseDBIF) -> PropagationResult

UNIT PROPAGATION. Note:

  • Precondition: no checking dead clauses. They cause crash.
  • This function assumes there’s no dead clause. So Eliminator should call garbage_collect before me.
  • The order of literals in binary clauses will be modified to hold propagation order.
source§

fn assign_at_root_level(&mut self, l: Lit) -> MaybeInconsistent

add an assignment at root level as a precondition. Read more
source§

fn assign_by_implication(&mut self, l: Lit, reason: AssignReason)

unsafe enqueue (assign by implication); doesn’t emit an exception. Read more
source§

fn assign_by_decision(&mut self, l: Lit)

unsafe assume (assign by decision); doesn’t emit an exception. Read more
source§

fn cancel_until(&mut self, lv: DecisionLevel)

execute backjump.
source§

fn backtrack_sandbox(&mut self)

execute backjump in vivification sandbox
source§

fn propagate_sandbox(&mut self, cdb: &mut impl ClauseDBIF) -> PropagationResult

propagate for vivification, which allows dead clauses.
source§

fn clear_asserted_literals( &mut self, cdb: &mut impl ClauseDBIF ) -> MaybeInconsistent

propagate then clear asserted literals
source§

impl PropertyDereference<Tf64, f64> for AssignStack

source§

fn derefer(&self, k: Tf64) -> f64

source§

impl PropertyDereference<Tusize, usize> for AssignStack

source§

fn derefer(&self, k: Tusize) -> usize

source§

impl PropertyReference<TEma, EmaView> for AssignStack

source§

fn refer(&self, k: TEma) -> &EmaView

source§

impl TrailSavingIF for AssignStack

source§

impl VarManipulateIF for AssignStack

source§

fn assigned(&self, l: Lit) -> Option<bool>

return the value of a literal.
source§

fn assign(&self, vi: VarId) -> Option<bool>

return the assignment of var.
source§

fn level(&self, vi: VarId) -> DecisionLevel

return the assign level of var.
source§

fn reason(&self, vi: VarId) -> AssignReason

return the reason of assignment.
source§

fn var(&self, vi: VarId) -> &Var

return the var.
source§

fn var_mut(&mut self, vi: VarId) -> &mut Var

return the var.
source§

fn var_iter(&self) -> Iter<'_, Var>

return an iterator over Vars.
source§

fn var_iter_mut(&mut self) -> IterMut<'_, Var>

return an mutable iterator over Vars.
source§

fn make_var_asserted(&mut self, vi: VarId)

set var status to asserted.
source§

fn make_var_eliminated(&mut self, vi: VarId)

set var status to eliminated.
source§

impl VarSelectIF for AssignStack

source§

fn best_phases_ref( &mut self, default_value: Option<bool> ) -> HashMap<VarId, bool>

return best phases
source§

fn override_rephasing_target( &mut self, assignment: &HashMap<VarId, bool> ) -> usize

force an assignment obtained by SLS
source§

fn reward_by_sls(&mut self, assignment: &HashMap<VarId, bool>) -> usize

give rewards to vars selected by SLS
source§

fn select_rephasing_target(&mut self)

select rephasing target
source§

fn check_consistency_of_best_phases(&mut self)

check the consistency
source§

fn select_decision_literal(&mut self) -> Lit

select a new decision variable.
source§

fn update_order(&mut self, v: VarId)

update the internal heap on var order.
source§

fn rebuild_order(&mut self)

rebuild the internal var_order

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

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.