Logic is the study of reasoning. In Computer Science, formal logic is used to verify properties of programs, circuits, and protocols.


Propositions & Connectives

A Proposition is a statement that is either True () or False (). We combine simple propositions using logical connectives.

ConnectiveSymbolNameMeaning
NegationNOTTrue iff is False.
ConjunctionANDTrue iff both and are True.
DisjunctionORTrue iff is True or is True (or both).
ImplicationIMPLIESFalse iff is True and is False.
XORExclusive ORTrue iff exactly one of is True.

The Implication Trap ()

  • If the Hypothesis () is False, the implication is vacuously true, regardless of .

Quantifiers

Predicate logic extends propositional logic by introducing variables and quantifiers. Let be a predicate (a function returning a boolean).

  1. Universal Quantifier ()

    • : “For all in set , is true.”
    • Disproof: Find one counterexample.
  2. Existential Quantifier ()

    • : “There exists an element in such that is true.”
    • Proof: Find one example.

Negating Quantifiers

    • To say “Not everyone likes pizza” is to say “There is someone who does not like pizza”.

Logical Equivalence

Two statements are logically equivalent () if they have the same truth value in every possible scenario (same Truth Table).

Crucial Equivalences:

  1. Contrapositive:
    • Note: The Converse () is NOT equivalent.
  2. Implication as OR: