class RuleWatchNode (View source)

Wrapper around a Rule which keeps track of the two literals it watches

Used by RuleWatchGraph to store rules in two RuleWatchChains.

Properties

$watch1
$watch2
protected $rule

Methods

__construct(Rule $rule)

Creates a new node watching the first and second literals of the rule.

watch2OnHighest(Decisions $decisions)

Places the second watch on the rule's literal, decided at the highest level

getRule()

Returns the rule this node wraps

int
getOtherWatch(int $literal)

Given one watched literal, this method returns the other watched literal

moveWatch(int $from, int $to)

Moves a watch from one literal to another

Details

__construct(Rule $rule)

Creates a new node watching the first and second literals of the rule.

Parameters

Rule $rule The rule to wrap

watch2OnHighest(Decisions $decisions)

Places the second watch on the rule's literal, decided at the highest level

Useful for learned rules where the literal for the highest rule is most likely to quickly lead to further decisions.

Parameters

Decisions $decisions The decisions made so far by the solver

Rule getRule()

Returns the rule this node wraps

Return Value

Rule

int getOtherWatch(int $literal)

Given one watched literal, this method returns the other watched literal

Parameters

int $literal The watched literal that should not be returned

Return Value

int A literal

moveWatch(int $from, int $to)

Moves a watch from one literal to another

Parameters

int $from The previously watched literal
int $to The literal to be watched now