Aidan Delaney
Boolean logic (a.k.a. Propositional logic) is restrictive in what it can express.
It is useful because
if(a < b || (a >= b && c == d)) ...
can be simplified to
if(a < b || c == d)
\(\top\) and \(\bot\) | Denote true and false |
\(P\) and \(Q\) | Denote propositions |
\(P\wedge Q\) | Denoting conjunction |
\(P\vee Q\) | Denoting disjunction |
\(\neg P\) | Denoting negation |
Other people define different syntax
\(1\) and \(0\) | Denote true and false |
\(P\) and \(Q\) | Denote propositions |
\(P.Q\) | Denoting conjunction |
\(P + Q\) | Denoting disjunction |
\(\overline{P}\) | Denoting negation |
let's call these terms.
All terms are sentences.
If \(\alpha\) and \(\beta\) are sentences then \((\alpha \wedge \beta)\) is a sentence.
Similarly \((\alpha \vee \beta)\) is a sentence.
A sentence in Boolean logic evaluates to either true or false.
Mostly stem from applying linguistic interpretation of a sentence rather than an logical interpretation.
Aidan bought a motorbike and went to work.
The English sentence has issues
Which is why we formalise in the first place.
Eat your carrots or your peas.
or
versus inclusive or
.Logical or is inclusive. Exclusive or more precisely translates as
Either eat your carrots or your peas.
Some people add implication to their set of Boolean connectives.
\(P\rightarrow Q\) read as "if P then Q"
This shorthand for \((\neg P \vee Q)\), it causes significant confusion.