You can use Wolfram|Alpha to simplify logical expressions, which is particularly handy if you’re a programmer.
Take the following contrived expression, in Ruby:
if (not ((a < s) or (b > t))) ...
This can be converted to the following query in Conjunctive Normal Form for Wolfram|Alpha:
CNF (~((a < s) || (b > t)))
The result of which shows that it simplifies to:
a >= s ∧ b <= t
Which makes our Ruby a little nicer:
if (a >= s and b <= t) ...
Here’s the actual query on Wolfram|Alpha: CNF (~((a < s) || (b > t)))
Symbols
Because Wolfram|Alpha is a web site that has to accept typed text, it uses the programming symbols, but it shows its results using the maths symbols.
Operation | Maths | Programming |
---|---|---|
not | ¬ | ! |
and | ∧ | && |
or | ∨ | || |