Implement handling of conflicts with learned rules
parent
b0c685176b
commit
52565a5935
|
@ -1187,7 +1187,7 @@ class Solver
|
||||||
assert($newRule != null);
|
assert($newRule != null);
|
||||||
$this->addRule(RuleSet::TYPE_LEARNED, $newRule);
|
$this->addRule(RuleSet::TYPE_LEARNED, $newRule);
|
||||||
|
|
||||||
$this->learnedWhy[] = $why;
|
$this->learnedWhy[$newRule->getId()] = $why;
|
||||||
|
|
||||||
$this->watch2OnHighest($newRule);
|
$this->watch2OnHighest($newRule);
|
||||||
$this->addWatchesToRule($newRule);
|
$this->addWatchesToRule($newRule);
|
||||||
|
@ -1304,7 +1304,7 @@ class Solver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$why = $this->learnedPool[count($this->learnedPool) - 1];
|
$why = count($this->learnedPool) - 1;
|
||||||
|
|
||||||
$newRule = new Rule($learnedLiterals, self::RULE_LEARNED, $why);
|
$newRule = new Rule($learnedLiterals, self::RULE_LEARNED, $why);
|
||||||
|
|
||||||
|
@ -1316,13 +1316,14 @@ class Solver
|
||||||
$why = $conflictRule->getId();
|
$why = $conflictRule->getId();
|
||||||
|
|
||||||
if ($conflictRule->getType() == RuleSet::TYPE_LEARNED) {
|
if ($conflictRule->getType() == RuleSet::TYPE_LEARNED) {
|
||||||
throw new \RuntimeException("handling conflicts with learned rules unimplemented");
|
|
||||||
/** TODO:
|
$learnedWhy = $this->learnedWhy[$why];
|
||||||
for (i = solv->learnt_why.elements[why - solv->learntrules]; solv->learnt_pool.elements[i]; i++)
|
$problem = $this->learnedPool[$learnedWhy];
|
||||||
if (solv->learnt_pool.elements[i] > 0)
|
|
||||||
analyze_unsolvable_rule(solv, solv->rules + solv->learnt_pool.elements[i], lastweakp);
|
foreach ($problem as $problemRule) {
|
||||||
return;
|
$this->analyzeUnsolvableRule($problemRule, $lastWeakWhy);
|
||||||
*/
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conflictRule->getType() == RuleSet::TYPE_PACKAGE) {
|
if ($conflictRule->getType() == RuleSet::TYPE_PACKAGE) {
|
||||||
|
|
Loading…
Reference in New Issue