Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark downstream incompatibilities on backtracking
Consider this situation: * Candidate Ax depends on B * Candidate B1 depends on C==1, D==1, E==1 * Candidate B2 depends on C==2, D==1, E==1 * Candidate C1 depends on D==1 * Candidate C2 depends on D==1 * Candidate D1 depends on E!=1 In the previous implementation, the conflict on E is discovered after we resolved Ax-B1-C1-D1. D1 is marked as an incompatibility, we backtrack the C1 pin. But now we don't have an available C, and need to also backtrack the B1 pin. At this point, however, the previous implemen- tation would fail to "remember" that D1 is also marked as incompatible, and proceed to try B2. That would eventually fail, and we are stuck trying B1 and B2 repeatedly. This fix uses a list to remember all the candidates marked as incompatible along the whole backtrack process, and "re-mark" them in parent states. This makes the resolver aware, when it backtracks B1, that B2 is also not viable, and avoid hitting it.
- Loading branch information