Logic2 CNF Fol
Logic2 CNF Fol
Inference rules: given f , what new formulas g can be added that are
guaranteed to follow ( fg )?
formula
models
Inference
rules
First-order logic
¬A ∨ B ∨ ¬C ∨ D ∨ ¬E ∨ F
Rain, Traffic
Rain, Traffic
0,1 0,1 0,1
1,0 1,0 1,0
1,1 1,1 1,1
Sound!
KB |= f KB ∪ {¬f } is unsatisfiable
KB |= ¬f KB ∪ {f } is unsatisfiable
C ¬C
B∨C ¬B
¬A ∨ B ∨ C A
First-order logic
AliceKnowsArithmetic ∧ BobKnowsArithmetic
AliceIsStudent → AliceKnowsArithmetic
BobIsStudent → BobKnowsArithmetic
...
???
AliceIsStudent → AliceKnowsArithmetic
BobIsStudent → BobKnowsArithmetic
...
Syntax Semantics
formula
models
Inference
rules
Some properties:
• ¬∀x P (x) equivalent to ∃x ¬P (x)
• ∀x ∃y Knows(x, y) different from ∃y ∀x Knows(x, y)
∀x Student(x)→Knows(x, arithmetic)
∃x Student(x)∧Knows(x, arithmetic)
If a student takes a course and the course covers a concept, then the
student knows that concept.
Syntax Semantics
formula
models
Inference
rules
w = {AliceKnowsArithmetic : 1, BobKnowsArithmetic : 0}
First-order logic: ?
alice o1 o2 robert
Knows Knows
o3
arithmetic
formula
models
Inference
rules
Note: if propositionalize, get one formula for each value to (x, y, z), e.g.,
(alice, cs221, mdp)
Setup:
Problem:
Definition: Substitution
Definition: Unification
Premises:
Takes(alice, cs221)
Covers(cs221, mdp)
(num-constant-symbols)(maximum-predicate-arity)
Theorem: completeness
Theorem: semi-decidability
∀x Student(x) → ∃y Knows(x, y)
Output:
Example: resolution
Animal(Y (x)) ∨ Loves(Z(x), x), ¬Loves(u, v) ∨ Feeds(u, v)
Animal(Y (x)) ∨ Feeds(Z(x), x)
Substitution: θ = {u/Z(x), v/x}.