Logic

Propositions are statements that are either true or false.

are propositions.

Conjunction

Conjunction is the && operator in C++. We write it as .

TTT
TFF
FTF
FFF

Or

Conjunction is the || operator in C++. We write it as .

TTT
TFT
FTT
FFF

Not

!= in C++.

TF
FT

Conditional Proposition

Pretty much the if statement in C++

Code

if (p) 
	do q;

Truth Table

TTT
TFF
FTT
FFT

Creating New Propositions

Based on , we can make 3 new propositions:

  1. Converse:
  2. Inverse:
  3. Contrapositive

The contrapositive is the only statement necessarily logically equivalent to the .

Biconditional Proposition

P happens if and only if q.

TTT
TFF
FTF
FFT

Logical Equivalence

Two propositions produce the same ouput.

Example

Is logically equivalent to ?

pq
TTTF
TFFF
FTFF
FFFT

Nope.

DeMorgan’s Law

Rules

Addition

Given is true, must be true.

Modus Ponens

Given and is true, must be true.

Negating Quantifiers

Examples

: x is an accountant : x owns a Porsche

All accountants own Porches:

To negate,

is not true.