Struct puzzle_solver::constraint::Unify
[−]
[src]
pub struct Unify { /* fields omitted */ }Methods
impl Unify[src]
fn new(var1: VarToken, var2: VarToken) -> Self
Allocate a new Unify constraint.
Examples
let mut send_more_money = puzzle_solver::Puzzle::new(); let carry = send_more_money.new_vars_with_candidates_1d(4, &[0,1]); let vars = send_more_money.new_vars_with_candidates_1d(8, &[0,1,2,3,4,5,6,7,8,9]); let m = vars[4]; puzzle_solver::constraint::Unify::new(m, carry[3]);
Trait Implementations
impl Constraint for Unify[src]
fn vars<'a>(&'a self) -> Box<Iterator<Item=&'a VarToken> + 'a>
An iterator over the variables that are involved in the constraint.
fn on_updated(&self, search: &mut PuzzleSearch) -> PsResult<()>
Applied after a variable's candidates has been modified.
fn substitute(&self, from: VarToken, to: VarToken) -> PsResult<Rc<Constraint>>
Substitute the "from" variable with the "to" variable. Read more
fn on_assigned(&self,
_search: &mut PuzzleSearch,
_var: VarToken,
_val: Val)
-> PsResult<()>
_search: &mut PuzzleSearch,
_var: VarToken,
_val: Val)
-> PsResult<()>
Applied after a variable has been assigned.