Sec 1 Group 4
Sec 1 Group 4
Sec 1 Group 4
Group member
Atomic sentences
Complex sentences
• An atomic sentence predicate (term1,...,termn) is true iff the objects referred to by it.
• term1,...,termn are in the relation referred to by predicate.
Universal quantification
• <variables> <sentence>
X At(x,NUS) Smart(x)
At (Kingohn,NUS) Smart(KingJohn)
At(Richard,NUS) Smart(Richard)
Existential quantification
• <variables> <sentence>
• Someone at NUS is smart:
• x At(x,NUS) Smart(x)
• x P is true in a model m if P is true with x being some possible object in the
model.
• Roughly speaking, equivalent to the disjunction of instantiations of P.
At (Richard,NUS) Smart(Richard)
Properties of quantifiers
x y is the same as y x
x y is the same as y x
x y Loves(x,y)
“There is a person who loves everyone in the world”.
y x Loves(x,y)
“Everyone in the world is loved by at least one person” .
Quantifier duality: each can be expressed using the other
x Likes(x, Ice Cream) x Likes(x, Ice Cream)
x Likes(x, Ice Cream) x Likes(x, Ice Cream)
Equality
term1 = term2 is true under a given interpretation if and only if term1 and
term2 refer to the same object.
E.g. definition of Sibling in terms of Parent:
x,y Sibling(x,y) [(x = y) m,f (m = f) Parent(m,x)
Parent(f,x) Parent(x,y) Parent(f,y)].
Existential Substitution
For any sentence α, variable v and constant symbol k that does not appear
elsewhere in the knowledge base:
∃ V α/SUBST ({v /k}, α)
E.g., ∃ x Crown(x) ∧ On Head(x, John) yields
Crown (C1) ∧ On Head (C1, John) provided C1is a new constant symbol, called a
Skolem constant.
Substitution
Z={X/Sara}
Pz=teacher (Sara)
Unification
We can get the inference immediately if we can find a substitution θ such that King(x)
and Greedy(x) match King (John) and Greedy(y)
θ = {x/John,y/John} works
o Unification finds substitutions that make different logical expressions look
identical.
o Standardizing apart eliminates overlap of variables.
o To unify Knows(John,x) and Knows(y,z)
Examples
Conclude
Likes(John, Jane)
Likes(John, yared)
Likes(John, Mother(John))
Generalized Modus Ponens(GMP)
p1', p2’, pn’, ( p1 p2 … pnq)/qθwhere pi'θ = piθ for all i
p1' is King (John) p1 is King(x)
p2' is Greedy(y) p2 is Greedy(x)
θ is {x/John,y/John} q is Evil(x)
q θ is Evil (John)
Example
p1’=Faster (Bob, pat)
P2’=Faster (pat, Steve)
P1’n p2=>q=Faster(X, Y) n faster(Y, Z)=>Faster(X, Z)
A={X/Bob, Y/pat/Steve}
Pa=Faster (Bob, Steve)
Forward chaining
o Start with the data (facts) and draw conclusions
o If the other premises are known, then add the conclusion to the KB
and continue chaining.
Backward chaining
Start with the query, and try to find facts to support it
Attempt to prove each premise of the rule by backward chaining
Resolution
Resolution allows a complete inference mechanism (search-based) using only one
rule of inference.
There is a resolution here below
There is a pit at 2,1 or 2,3 or 1,2 or 3,2
o P21 P23 P12 P32
There is no pit at 2,1
o P21
Therefore (by resolution) the pit must be at 2,3 or 1,2 or 3,2
o P23 P12 P32
Proof using Resolution
CNF Example
(B22 P21 P23 P12 P32 )((P21 P23 P12 P32 ) B22)
5 Distributive Law
(B22 P21 P23 P12 P32 ) (P21 B22) (P23 B22) (P12 B22) (P32 B22)
Resolution Example
Given B22 and P21 and P23 and P32 , prove P12
(B22 P21 P23 P12 P32 ) ; P12
(B22 P21 P23 P32 ) ; P21
(B22 P23 P32 ) ; P23
(B22 P32 ) ; P32
(B22) ; B22
[Empty clause]
Conclusion
First-order logic:
– Objects and relations are semantic primitives.
– Syntax: constants, functions, predicates, equality, quantifiers.
Reference:
We have referred some webs and others to make or do this assignment from those we refer are:
some web site like www.tutorialpoint.com
www.scholar.google.com
Google like Wikipedia
Some peoples who are member of our class