Skip to content

Not

Logical NOT operation.

$ wo 'Not[True]'
False
$ wo 'Not[False]'
True
$ wo 'Not[True, True]'

Not::argx: Not called with 2 arguments; 1 argument is expected.
.* (regex*)
Not[True, True]

An unevaluated negation is written with the operator, and bracketed wherever the operator would otherwise reach past what it negates — arithmetic, comparison and application all bind tighter than !:

$ wo 'ToString[Hold[Not[a]^2], InputForm]'
Hold[( !a)^2]
$ wo 'ToString[Hold[Not[a] && b], InputForm]'
Hold[ !a && b]

A function body is written the same way:

$ wo 'ToString[!#1 || !#2 &, InputForm]'
 !#1 ||  !#2 &