Skip to content

Logic Cookbook

This page contains syntax for propositional logic and definitions of commonly used terms 🍜 📔

General Logic

  • Disjunction == or ==

  • Conjunction == and ==

  • Negation == not == ¬

  • logical connectives:

    • and
    • or
    • if
    • if and only if
  • Modus ponens: the rule of logic which states that if a conditional statement (pq) is accepted, and the antecedent (p) holds, then the consequent (q) may be inferred.

Propositional Logic

Composed Of:

  • atomic sentences (atoms): p, q, juice
  • complex sentence: constructed from atomic sentences + logical connectives.
  • proposition == sentence.
  • compound proposition == complex sentence.
  • logical connectives.
  • literals: p,q,¬q (positive and negative atoms).

Equivalence

  • (αβ)(βα) commutativity
  • " " same for .
  • ((αβ)ι)(βαι) associativity
  • " " same for
  • ¬(¬α)α double-negation elimination
  • αβ¬β¬α contraposition.
  • αβ¬αβ implication elimination.
  • αβ(αβ)(βα) biconditional elimination.
  • ¬(αβ)¬α¬β de morgan's law
  • ¬(αβ)¬α¬β de morgan's law

CNF

Conjunctive Normal Form

A sentence is in CNF iff it is of the form:

S1S2Sn

In which each Si is of the form:

(l1l2lk)

With each l_i a literal.

Every correct (syntax) sentence in propositional logic can be written in CNF

Predicate Logic

Composed Of:

  • Constants: People, objects
    • e.g: John, Mary, 2, UT, AI
  • Predicates: Describe relations.
    • e.g: Parent, Daughter, Neighbor, >, Student, Takes, Smart
  • Functions: Takes input, Returns a value
    • e.g: Sqrt, Mother, Father, Teacher
  • Variables:
    • e.g x, y, z
  • Logical Connectives
    • ,,¬,,
  • Equality
    • =
  • Quantifiers
    • for all
    • exists

Predicate Logic Atomic Sentence:

  • predicate(term1,...,termn) or
  • term1=term2

A Term can be:

  • function(term, ..., term)
  • constant
  • variable.

Quantifier Equivalence

  • x¬P¬xP
  • ¬xP¬P
  • xP¬x¬P
  • xP¬x¬P