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
- and
Modus ponens: the rule of logic which states that if a conditional statement (
) is accepted, and the antecedent ( ) holds, then the consequent ( ) 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:
(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:
In which each
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
- for all
Predicate Logic Atomic Sentence:
or
A Term
can be:
- function(term, ..., term)
- constant
- variable.