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 (p⟹q) 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:

S1∧S2∧⋯∧Sn

In which each Si is of the form:

(l1∨l2∨⋯∨lk)

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