Upload Tizen:Main source
[external/libsatsolver.git] / doc / autoinclude / Policies.doc
1 /** \page policies Policies in sat-solver
2
3 \section policiesdef Definition
4
5 Policies are assumptions (decisions) in the code not reasoned by
6 the dependency semantics.
7
8
9 \section policies-motivation Motivation
10
11 There are local policies, looking at a small set of packages during
12 solving.
13 Examples:
14 - Prefer better architecture (i586/i686) over better version ?
15
16
17 There are global policies, looking at the complete transaction after
18 solving is complete.
19
20 Examples:
21 - Choose 'best' transaction.
22   - The smallest one - looking at the number of package changes ?
23   - The smallest one - looking at the download size ?
24   - The biggest one - looking at package versions ?
25
26 Global policies are currently not supported at all.
27
28
29 Generally, policies help the solver to choose from multiple
30 possibilities. In most cases, this can be represented as a filter
31 operation working on a list of candidates and filtering out unwanted
32 ones - ideally resulting in a single candidate.
33
34
35 \section policiesrecog Recognized policies
36
37 These are the policies we currently know of (which should be exposed
38 via the policy layer)
39
40 - Version downgrade
41   Is a version downgrade allowed ?
42   - explicit, by user request
43   - implicit, by dependencies
44   
45 - Uninstall
46   Should the solver try to uninstall packages in order to
47   satisfy dependencies ?
48   
49 - Vendor change
50   Can the package vendor change during an update
51   (i.e. replace an OpenSUSE package with a 'packman' one or vice versa)
52
53 - Architecture change
54   Can the architecture change during an update
55   (i586 <-> i686, to/from noarch)
56
57 - Repository priority
58
59 - Order for solving open dependencies
60   Look at requires before conflicts ?
61   
62
63 \section policiesgenfilter Generic filter
64
65 The generic function is 'choose among multiple candidates' by
66 - architecture
67 - repository
68 - vendor
69 - version
70 - download size
71 - install size
72 - transaction size (-> global policy)
73   - number of installed/updated/removed packages
74   - number of bytes downloaded
75   - best overall versions
76
77
78 \section policiesengineimpl Policy engine implementation
79
80 The policy engine should support policies in a generic way.
81
82 Some policies might be quite complex, it should be possible to build up
83 a policy chain - passing a result back to the default engine after
84 applying a specific filter.
85
86 Helper functions can help implementing policies, e.g.
87 - filter list
88 - order list
89
90
91 \section policiesapi Policy engine API
92
93 - to be defined -
94
95 */