1
1
# Incompatibilities
2
2
3
-
4
3
## Definition
5
4
6
- Incompatibilities are called "nogoods" in [ CDNL-ASP] [ ass ] terminology.
7
- ** An incompatibility is a [ conjunction] [ conjunction ] of package terms that must
8
- be evaluated false** , meaning at least one package term must be evaluated false.
9
- Otherwise we say that the incompatibility has been "satisfied".
10
- Satisfied incompatibilities represent conflicts and thus
11
- the goal of the PubGrub algorithm is to build a solution
12
- such that none of the produced incompatibilities are ever satisfied.
13
- If one incompatibility becomes satisfied at some point,
14
- the algorithm finds the root cause of it and backtracks the partial solution
15
- before the decision at the origin of that root cause.
16
-
17
- > Remark: incompatibilities (nogoods) are the opposite of clauses
18
- > in traditional conflict-driven clause learning ([ CDCL] [ cdcl ] )
19
- > which are disjunctions of literals that must be evaluated true,
20
- > so have at least one literal evaluated true.
5
+ Incompatibilities are called "nogoods" in [ CDNL-ASP] [ ass ] terminology. ** An
6
+ incompatibility is a [ conjunction] [ conjunction ] of package terms that must be
7
+ evaluated false** , meaning at least one package term must be evaluated false.
8
+ Otherwise we say that the incompatibility has been "satisfied". Satisfied
9
+ incompatibilities represent conflicts and thus the goal of the PubGrub algorithm
10
+ is to build a solution such that none of the produced incompatibilities are ever
11
+ satisfied. If one incompatibility becomes satisfied at some point, the algorithm
12
+ finds the root cause of it and backtracks the partial solution before the
13
+ decision at the origin of that root cause.
14
+
15
+ > Remark: incompatibilities (nogoods) are the opposite of clauses in traditional
16
+ > conflict-driven clause learning ([ CDCL] [ cdcl ] ) which are disjunctions of
17
+ > literals that must be evaluated true, so have at least one literal evaluated
18
+ > true.
21
19
>
22
- > The gist of CDCL is that it builds a solution to satisfy a
23
- > [ conjunctive normal form] [ cnf ] (conjunction of clauses) while
24
- > CDNL builds a solution to unsatisfy a [ disjunctive normal form] [ dnf ]
25
- > (disjunction of nogoods).
20
+ > The gist of CDCL is that it builds a solution to satisfy a [ conjunctive normal
21
+ > form] [ cnf ] (conjunction of clauses) while CDNL builds a solution to unsatisfy
22
+ > a [ disjunctive normal form] [ dnf ] (disjunction of nogoods).
26
23
>
27
24
> In addition, PubGrub is a lazy CDNL algorithm since the disjunction of nogoods
28
25
> (incompatibilities) is built on the fly with the solution.
@@ -33,84 +30,77 @@ before the decision at the origin of that root cause.
33
30
[ cnf ] : https://en.wikipedia.org/wiki/Conjunctive_normal_form
34
31
[ dnf ] : https://en.wikipedia.org/wiki/Disjunctive_normal_form
35
32
36
- In this guide, we will note incompatibilities with curly braces.
37
- An incompatibility containing one term \\ (T_a\\ ) for package \\ (a\\ )
38
- and one term \\ (T_b\\ ) for package \\ (b\\ ) will be noted
33
+ In this guide, we will note incompatibilities with curly braces. An
34
+ incompatibility containing one term \\ (T_a\\ ) for package \\ (a\\ ) and one term
35
+ \\ (T_b\\ ) for package \\ (b\\ ) will be noted
39
36
40
37
\\ [ \\ { a: T_a, b: T_b \\ }. \\ ]
41
38
42
- > Remark: in a more "mathematical" setting, we would probably have noted
43
- > \\ ( T_a \land T_b \\ ), but the chosen notation maps well
44
- > with the representation of incompatibilities as hash maps.
45
-
39
+ > Remark: in a more "mathematical" setting, we would probably have noted \\ ( T_a
40
+ > \land T_b \\ ), but the chosen notation maps well with the representation of
41
+ > incompatibilities as hash maps.
46
42
47
43
## Properties
48
44
49
- ** Packages only appear once in an incompatibility** .
50
- Since an incompatibility is a conjunction,
51
- multiple terms for the same package are merged with the intersection of those terms.
45
+ ** Packages only appear once in an incompatibility** . Since an incompatibility is
46
+ a conjunction, multiple terms for the same package are merged with the
47
+ intersection of those terms.
52
48
53
- ** Terms that are always satisfied can be removed from an incompatibility** .
54
- We previously explained that the term \\ ( \neg [ \varnothing] \\ ) is always evaluated true.
55
- As a consequence, it can safely be removed from the conjunction of terms that is the incompatibility.
49
+ ** Terms that are always satisfied can be removed from an incompatibility** . We
50
+ previously explained that the term \\ ( \neg [ \varnothing] \\ ) is always
51
+ evaluated true. As a consequence, it can safely be removed from the conjunction
52
+ of terms that is the incompatibility.
56
53
57
54
\\ [ \\ { a: T_a, b: T_b, c: \neg [ \varnothing] \\ } = \\ { a: T_a, b: T_b \\ } \\ ]
58
55
59
- ** Dependencies can be expressed as incompatibilities** .
60
- Saying that versions in range \\ ( r_a \\ ) of package \\ ( a \\ )
61
- depend on versions in range \\ ( r_b \\ ) of package \\ ( b \\ )
62
- can be expressed by the incompatibility
56
+ ** Dependencies can be expressed as incompatibilities** . Saying that versions in
57
+ range \\ ( r_a \\ ) of package \\ ( a \\ ) depend on versions in range \\ ( r_b \\ )
58
+ of package \\ ( b \\ ) can be expressed by the incompatibility
63
59
64
60
\\ [ \\ { a: [ r_a] , b: \neg [ r_b] \\ }. \\ ]
65
61
66
-
67
62
## Unit propagation
68
63
69
64
If all terms but one of an incompatibility are satisfied by a partial solution,
70
- we can deduce that the remaining unsatisfied term must be evaluated false.
71
- We can thus derive a new unit term for the partial solution
72
- which is the negation of the remaining unsatisfied term of the incompatibility.
73
- For example, if we have the incompatibility
74
- \\ ( \\ { a: T_a, b: T_b, c: T_c \\ } \\ )
75
- and if \\ ( T_a \\ ) and \\ ( T_b \\ ) are satisfied by terms in the partial solution
76
- then we can derive that the term \\ ( \overline{T_c} \\ ) can be added for package \\ ( c \\ )
65
+ we can deduce that the remaining unsatisfied term must be evaluated false. We
66
+ can thus derive a new unit term for the partial solution which is the negation
67
+ of the remaining unsatisfied term of the incompatibility. For example, if we
68
+ have the incompatibility \\ ( \\ { a: T_a, b: T_b, c: T_c \\ } \\ ) and if \\ ( T_a
69
+ \\ ) and \\ ( T_b \\ ) are satisfied by terms in the partial solution then we can
70
+ derive that the term \\ ( \overline{T_c} \\ ) can be added for package \\ ( c \\ )
77
71
in the partial solution.
78
72
79
-
80
73
## Rule of resolution
81
74
82
- Intuitively, we are able to deduce things such as if package \\ ( a \\ )
83
- depends and package \\ ( b \\ ) which depends on package \\ ( c \\ ),
84
- then \\ ( a \\ ) depends on \\ ( c \\ ).
85
- With incompatibilities, we would note
75
+ Intuitively, we are able to deduce things such as if package \\ ( a \\ ) depends
76
+ and package \\ ( b \\ ) which depends on package \\ ( c \\ ), then \\ ( a \\ ) depends
77
+ on \\ ( c \\ ). With incompatibilities, we would note
86
78
87
- \\ [ \\ { a: T_a, b: \overline{T_b} \\ }, \quad
88
- \\ { b: T_b, c: \overline{T_c} \\ } \quad
89
- \Rightarrow \quad \\ { a: T_a, c: \overline{T_c} \\ }. \\ ]
79
+ \\ [ \\ { a: T_a, b: \overline{T_b} \\ }, \quad \\ { b: T_b, c: \overline{T_c} \\ }
80
+ \quad \Rightarrow \quad \\ { a: T_a, c: \overline{T_c} \\ }. \\ ]
90
81
91
- This is the simplified version of the rule of resolution.
92
- For the generalization, let's reuse the "more mathematical" notation of conjunctions
93
- for incompatibilities \\ ( T_a \land T_b \\ ) and the above rule would be
82
+ This is the simplified version of the rule of resolution. For the
83
+ generalization, let's reuse the "more mathematical" notation of conjunctions for
84
+ incompatibilities \\ ( T_a \land T_b \\ ) and the above rule would be
94
85
95
- \\ [ T_a \land \overline{T_b}, \quad
96
- T_b \land \overline{T_c} \quad
97
- \Rightarrow \quad T_a \land \overline{T_c}. \\ ]
86
+ \\ [ T_a \land \overline{T_b}, \quad T_b \land \overline{T_c} \quad \Rightarrow
87
+ \quad T_a \land \overline{T_c}. \\ ]
98
88
99
89
In fact, the above rule can also be expressed as follows
100
90
101
- \\ [ T_a \land \overline{T_b}, \quad
102
- T_b \land \overline{T_c} \quad
103
- \Rightarrow \quad T_a \land (\overline{T_b} \lor T_b) \land \overline{T_c} \\ ]
91
+ \\ [ T_a \land \overline{T_b}, \quad T_b \land \overline{T_c} \quad \Rightarrow
92
+ \quad T_a \land (\overline{T_b} \lor T_b) \land \overline{T_c} \\ ]
104
93
105
- since for any term \\ ( T \\ ), the disjunction \\ ( T \lor \overline{T} \\ ) is always true.
106
- In general, for any two incompatibilities \\ ( T_a^1 \land T_b^1 \land \cdots \land T_z^1 \\ )
107
- and \\ ( T_a^2 \land T_b^2 \land \cdots \land T_z^2 \\ ) we can deduce a third,
108
- called the resolvent whose expression is
94
+ since for any term \\ ( T \\ ), the disjunction \\ ( T \lor \overline{T} \\ ) is
95
+ always true. In general, for any two incompatibilities \\ ( T_a^1 \land T_b^1
96
+ \land \cdots \land T_z^1 \\ ) and \\ ( T_a^2 \land T_b^2 \land \cdots \land T_z^2
97
+ \\ ) we can deduce a third, called the resolvent whose expression is
109
98
110
- \\ [ (T_a^1 \lor T_a^2) \land (T_b^1 \land T_b^2) \land \cdots \land (T_z^1 \land T_z^2). \\ ]
99
+ \\ [ (T_a^1 \lor T_a^2) \land (T_b^1 \land T_b^2) \land \cdots \land (T_z^1 \land
100
+ T_z^2). \\ ]
111
101
112
- In that expression, only one pair of package terms is regrouped as a union (a disjunction),
113
- the others are all intersected (conjunction).
114
- If a term for a package does not exist in one incompatibility,
115
- it can safely be replaced by the term \\ ( \neg [ \varnothing] \\ ) in the expression above
116
- as we have already explained before.
102
+ In that expression, only one pair of package terms is regrouped as a union (a
103
+ disjunction), the others are all intersected (conjunction). If a term for a
104
+ package does not exist in one incompatibility, it can safely be replaced by the
105
+ term \\ ( \neg [ \varnothing] \\ ) in the expression above as we have already
106
+ explained before.
0 commit comments