Go backward to 2.2.1 Logical Constants Go up to 2.2 Propositional Logic Go forward to 2.2.3 Conjunctions |
~Ais a formula.
Alternative Forms Other syntactic forms of negation are
!A
;
not(A)
.
The last line denotes the input syntax of the Logic Evaluator.
Negation of infix atomic formulas is often expressed by crossing the predicate symbol, e.g.
x not < yrepresents ~(x < y).
A ~A false true true false
In other words, ~A is true if and only if A is false.
Operational Interpretation A logical formula can be given an operational interpretation by a program that computes its truth value. For instance, in the Logic Evaluator, a negation is represented by an object of Java type
public final class Not implements Formula { private Formula formula; public Not(Formula _formula) { formula = _formula; } public boolean eval() throws EvalException { if (formula.eval()) return false; else return true; } }
The Java expression (new Not(A)).eval()
thus computes the truth
value of the negation of A. The result is true only if the
truth value of A is false.
We conclude the discussion of negation by stating a simple law and proving its correctness.
~~A iff A.
Since the last column coincides with the first column, we are done.
A ~A ~~A false true false true false true