Dependency Resolution with SAT [Symfony Live 2011 Paris]

2,978 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,978
On SlideShare
0
From Embeds
0
Number of Embeds
137
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Dependency Resolution with SAT [Symfony Live 2011 Paris]

  1. 1. Dependency Resolution with a SAT Solver Nils Adermann March 4th 2011
  2. 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)|CC(onjunctive)NF: (A|B)&(C|D|A)&(B|D)&C
  3. 3. NP?“ hard” problems“ nondeterministic polynomial time” no known algorithm which: - can solve all instances of the problem - does not need to try all combinationsSAT is NP-complete (Cooks theorem)
  4. 4. Package ManagementPoolRepositoriesPackage Name & Version requires, conflicts, provides
  5. 5. Dependency ResolutionUser wants to:- install some packages- update some packages- remove some packages- keep some packages
  6. 6. Dependency ResolutionEDOS Project Workpackage 2 Team. Report on formal management of software dependencies. EDOSProject Deliverable Work Package 2, Deliverable 2, March 2006. http://www.edos-project.org/xwiki/bin/Main/Deliverables.
  7. 7. Dependency ResolutionIdeal:
  8. 8. Dependency ResolutionAcceptable:
  9. 9. Dependency ResolutionNo solution: APT PortagePoor solution: smart Urpmi
  10. 10. Dependency Resolution with SAT SUSEs libzypper (Michael Schroeder) Goals: Fast Complete & Reliable Understandable messages & explanations Based on ideas from minisat
  11. 11. Rule GenerationJob Rules: Install A: (A) Remove A: (-A)
  12. 12. Rule GenerationDependency Rules: A requires B: (-A|B1|B2) A conflicts with B: (-A|-B1), (-A|-B2) C and D provide A: A requires C or DPolicy Rules: B1 can be updated to B2: (B1|B2)
  13. 13. Solving RulesUnit Propagation: (A|B|C), (-C), (-A|C) (-C) C: false (-A|C) A: false (-A: true) (A|B|C) B: true
  14. 14. Rule Solving AlgorithmUnit Propagation Contradiction? Add Rule -X or unsolvable Backtrack to previous assignmentAssign undecided variable X (free choice)Repeat until solved
  15. 15. Free ChoicesKeep installed packages installedDo not install unecessary packagesPick newest version
  16. 16. Thank you! and Michael Schröder at Novell for his slideshttp://files.opensuse.org/opensuse/en/b/b9/Fosdem2008-solver.pdf http://www.mancoosi.org/edos/manager/ http://en.opensuse.org/openSUSE:Libzypp_satsolver

×