Negation

[citation needed] It is interpreted intuitively as being true when

An operand of a negation is called a negand or negatum.

In intuitionistic logic, according to the Brouwer–Heyting–Kolmogorov interpretation, the negation of a proposition

is as follows: Negation can be defined in terms of other logical operations.

The idea here is that any contradiction is false, and while these ideas work in both classical and intuitionistic logic, they do not work in paraconsistent logic, where contradictions are not necessarily false.

These algebras provide a semantics for classical and intuitionistic logic.

The negation of a proposition p is notated in different ways, in various contexts of discussion and fields of application.

Here is a table that shows a commonly used precedence of logical operators.

In intuitionistic logic, a proposition implies its double negation, but not conversely.

This marks one important difference between classical and intuitionistic negation.

Algebraically, classical negation is called an involution of period two.

De Morgan's laws provide a way of distributing negation over disjunction and conjunction: Let

In Boolean algebra, a linear function is one such that: If there exists

For example, with the predicate P as "x is mortal" and the domain of x as the collection of all humans,

There are a number of equivalent ways to formulate rules for negation.

One usual way to formulate classical negation in a natural deduction setting is to take as primitive rules of inference negation introduction (from a derivation of

; this rule also being called reductio ad absurdum), negation elimination (from

; this rule also being called ex falso quodlibet), and double negation elimination (from

Negation introduction states that if an absurdity can be drawn as conclusion from

Sometimes negation elimination is formulated using a primitive absurdity sign

Together with double negation elimination one may infer our originally formulated rule, namely that anything follows from an absurdity.

Then negation introduction and elimination are just special cases of implication introduction (conditional proof) and elimination (modus ponens).

In this case one must also add as a primitive rule ex falso quodlibet.

As in mathematics, negation is used in computer science to construct logical statements.

signifies logical NOT in B, C, and languages with a C-inspired syntax such as C++, Java, JavaScript, Perl, and PHP.

"NOT" is the operator used in ALGOL 60, BASIC, and languages with an ALGOL- or BASIC-inspired syntax such as Pascal, Ada, Eiffel and Seed7.

To get the absolute (positive equivalent) value of a given integer the following would work as the "-" changes it from negative to positive (it is negative because "x < 0" yields true) To demonstrate logical negation: Inverting the condition and reversing the outcomes produces code that is logically equivalent to the original code, i.e. will have identical results for any input (depending on the compiler used, the actual instructions performed by the computer may differ).

Although any integer other than 0 is logically true in C and 1 is not special in this regard, it is sometimes important to ensure that a canonical value is used, for example for printing or if the number is subsequently used for arithmetic operations.

to signify negation occasionally surfaces in ordinary written speech, as computer-related slang for not.

Another example is the phrase !clue which is used as a synonym for "no-clue" or "clueless".