Skip to content

Commit 4d56dbf

Browse files
committed
Explain math symbols in rust terms
Split out of pubgrub-rs#8 for separate discussion, I tried to make it clearer what the operations means for someone who knows rust but doesn't have an academic math education otherwise.
1 parent dec5d77 commit 4d56dbf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/internals/terms.md

Lines changed: 5 additions & 1 deletion
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}
@@ -58,7 +59,10 @@ based on those ranges is defined as follows,
5859
\neg [r_1] \land \neg [r_2] &=& \neg [r_1 \cup r_2]. \nonumber \\\\
5960
\end{eqnarray}\\]
6061

61-
And for any two terms \\(T_1\\) and \\(T_2\\), their union and intersection are related by
62+
In rust terms, "\\( \neg \\)" means "not"/`!` (\\( \neg T \\),
63+
"\\( \land \\)" means "and"/, "\\( \lor \\)" means "or"/`||`.
64+
65+
And for any two terms \\(T_1\\) and \\(T_2\\), their union and intersection are related by De Morgan's laws
6266

6367
\\[ \overline{T_1 \lor T_2} = \overline{T_1} \land \overline{T_1}. \\]
6468

0 commit comments

Comments
 (0)