Propositions and Connectives

Propositions and Connectives

Propositions #

A proposition is a statement that is either true or false. For example, the statement “The sky is blue” is a proposition. “True” or “false” is considered the truth value of the proposition. In the case of “The sky is blue”, the truth value is “true”. In the case of “The sky is green”, the truth value is “false”.

The truth value “true” is represented by true in Java, True in Python, and \(\top\) in formal logic. The truth value “false” is represented by false in Java, False in Python, and \(\bot\) in formal logic.

Connectives #

A connective is a symbol that connects two propositions. For example, the connective “and” connects two propositions. Examples include:

ConnectiveJavaPythonFormal logic
and&&and\(\land\)
or||or\(\lor\)
xor^xor\(\oplus\)
not!not\(\lnot\)
implies->->\(\rightarrow\)
if and only if<-><->\(\leftrightarrow\)

Truth Tables #

A truth table is a table that shows the truth values of a proposition and its connectives.

Truth tables for different connectives are shown below.

And #

\(P\)\(Q\)\(P\land Q\)
falsefalsefalse
falsetruefalse
truefalsefalse
truetruetrue

Or #

\(P\)\(Q\)\(P\lor Q\)
falsefalsefalse
falsetruetrue
truefalsetrue
truetruetrue

Xor #

\(P\)\(Q\)\(P\oplus Q\)
falsefalsetrue
falsetruetrue
truefalsetrue
truetruetrue

Not #

\(P\)\(\lnot P\)
falsetrue
truefalse

Implies #

\(P\)\(Q\)\(P\rightarrow Q\)
falsefalsetrue
falsetruetrue
truefalsefalse
truetruetrue

If and Only If #

\(P\)\(Q\)\(P\leftrightarrow Q\)
falsefalsetrue
falsetruefalse
truefalsefalse
truetruetrue