This document discusses using a SAT solver to resolve software dependencies when installing, updating, or removing packages from a system. It explains how dependency rules can be expressed as Boolean logic statements and solved using techniques like unit propagation and backtracking. The libzypper package manager from SUSE uses a SAT solver for dependency resolution as it is fast, reliable, and can provide understandable explanations.
1 of 16
More Related Content
Dependency Resolution with SAT [Symfony Live 2011 Paris]
2. SAT?
Boolean Satisfiability Problem:
Can (A|B)&(C|D|(E&(A|D))&E be true?
D(isjunctive)NF:
(A&B)|(C&D&A)|(B&D)|C
C(onjunctive)NF:
(A|B)&(C|D|A)&(B|D)&C
3. NP?
hard problems
nondeterministic polynomial time
no known algorithm which:
- can solve all instances of the problem
- does not need to try all combinations
SAT is NP-complete (Cook's theorem)
10. Dependency Resolution with SAT
SUSE's libzypper (Michael Schroeder)
Goals:
Fast
Complete & Reliable
Understandable messages & explanations
Based on ideas from minisat
12. Rule Generation
Dependency Rules:
A requires B: (-A|B1|B2)
A conflicts with B: (-A|-B1), (-A|-B2)
C and D provide A: A requires C or D
Policy Rules:
B1 can be updated to B2: (B1|B2)
14. Rule Solving Algorithm
Unit Propagation
Contradiction?
Add Rule -X or unsolvable
Backtrack to previous assignment
Assign undecided variable X (free choice)
Repeat until solved
16. Thank you!
and Michael Schr旦der at Novell for his slides
http://files.opensuse.org/opensuse/en/b/b9/Fosdem2008-solver.pdf
http://www.mancoosi.org/edos/manager/
http://en.opensuse.org/openSUSE:Libzypp_satsolver