Skip to content

Commit d091a7c

Browse files
committed
Make terms clearer using boolean expressions
I tried to make it clear that a CDNL terms is a conjunction of negations of conjunctions by desugaring them into boolean expressions. I additionally added some notes for rust programmers who are used to rust syntax but not the mathematical notation. I'm having trouble making what's going on sufficiently clear since we need to write the negations out to apply transformation rules to them, but then they are not incompatibilities anymore but constraints that must be satisfied.
1 parent 81f3898 commit d091a7c

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/internals/incompatibilities.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,34 @@ With incompatibilities, we would note
8989
\Rightarrow \quad \\{ a: T_a, c: \overline{T_c} \\}. \\]
9090

9191
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
92+
For the generalization, let's write them as [boolean expressions][boolean_expression].
93+
In rust terms, "\\( \neg \\)" means "not"/`!` (\\( \neg T \\) and \\( \overline{T} \\) are different
94+
notations for the same thing), "\\( \land \\)" means "and"/`&&`, "\\( \lor \\)" means "or"/`||`.
9495

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}. \\]
96+
\\[ \neg (T_a \land \overline{T_b}) \quad \land \quad
97+
\neg (T_b \land \overline{T_c}) \quad
98+
\Rightarrow \quad \neg (T_a \land \overline{T_c}). \\]
9899

99100
In fact, the above rule can also be expressed as follows
100101

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} \\]
102+
\\[ \neg (T_a \land \overline{T_b}) \quad \land \quad
103+
\neg (T_b \land \overline{T_c}) \quad
104+
\Rightarrow \quad \neg (T_a \land (\overline{T_b} \lor T_b) \land \overline{T_c}) \\]
104105

105106
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
107+
In general, for any two incompatibilities \\( \\{ a: T_a^1, \cdots, z: T_z^1 \\} \\) and
108+
\\( \\{ a: T_a^2, \cdots, z: T_z^2 \\}, \\)
109+
or
109110

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). \\]
111+
\\[ \neg (T_a^1 \land T_b^1 \land \cdots \land T_z^1) \land \neg (T_a^2 \land T_b^2 \land \cdots \land T_z^2), \\]
112+
we can deduce a third, called the resolvent whose expression is
113+
114+
\\[ \neg ((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)). \\]
111115

112116
In that expression, only one pair of package terms is regrouped as a union (a disjunction),
113117
the others are all intersected (conjunction).
114118
If a term for a package does not exist in one incompatibility,
115119
it can safely be replaced by the term \\( \neg [\varnothing] \\) in the expression above
116120
as we have already explained before.
121+
122+
[boolean_expression]: https://en.wikipedia.org/wiki/Boolean_expression#Boolean_operators

src/internals/terms.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ In this guide, for any given range \\(r\\),
2424
we will note \\([r]\\) its associated positive term,
2525
and \\(\neg [r]\\) its associated negative term.
2626
And for any term \\(T\\), we will note \\(\overline{T}\\) the negation of that term.
27+
(\\( \neg A \\) and \\( \overline{A} \\) are different notations for the same thing)
2728
Therefore we have the following rules,
2829

2930
\\[\begin{eqnarray}

0 commit comments

Comments
 (0)