Artificial Intelligence: Example
Artificial Intelligence: Example
Lecture 11
Shyamanta M Hazarika Computer Sc & Engineering Tezpur University
Example
Consider the problem of representing the following information:
Every person is mortal. Confucius is a person. Confucius is mortal.
How can these sentences be represented so that we can infer the third sentence from the first two?
Example
In PL we have to create propositional symbols to stand for all or part of each sentence. For example, we might have:
P Q; R P; R Q
we needed an explicit symbol, R, to represent an individual, Confucius, who is a member of the classes person and mortal To represent other individuals we must introduce separate symbols for each one, with some way to represent the fact that all individuals who are people are also mortal
PL is a weak language
Hard to identify individuals
(e.g., Mary, 3) ;
PL is a weak language
First-Order Logic (abbreviated FOL or FOPC) is expressive enough to concisely represent this kind of information
x (elephant(x) gray(x))
There is a white alligator
x (alligator(X) ^ white(X))
First-order logic
First-order logic (FOL) models the world in terms of
Objects, which are things with individual identities Properties of objects that distinguish them from other objects Relations that hold among sets of objects Functions, which are a subset of relations where there is only one value for any given input
Examples:
Objects: Students, lectures, companies, cars ... Relations: Brother-of, bigger-than, outside, part-of, has-color, occurs-after, owns, visits, precedes, ... Properties: blue, oval, even, large, ... Functions: father-of, best-friend, second-half, onemore-than ...
User provides
Constant symbols, which represent individuals in the world
Mary 3 Green
Function symbols, which map individuals to individuals
FOL Provides
Variable symbols E.g., x, y, foo Connectives Same as in PL: not (), and (), or (), implies (), if and only if (biconditional ) Quantifiers Universal x or (Ax) Existential x or (Ex)
Quantifiers
Universal quantification (x)P(x) means that P holds for all values of x in the domain associated with that variable E.g., (x) dolphin(x) mammal(x) Existential quantification ( x)P(x) means that P holds for some value of x in the domain associated with that variable E.g., ( x) mammal(x) lays-eggs(x) Permits one to make a statement about some object without naming it
An atomic sentence (which has value true or false) is an nplace predicate of n terms A complex sentence is formed from atomic sentences connected by the logical connectives:
P, PQ, PQ, PQ, PQ where P and Q are sentences
A quantified sentence adds quantifiers and A well-formed formula (wff) is a sentence containing no free variables. That is, all variables are bound by universal or existential quantifiers.
(x)P(x,y) has x bound as a universally quantified variable, but y is free.
Quantifiers
Universal quantifiers are often used with implies to form rules:
(x) student(x) smart(x) means All students are smart
Universal quantification is rarely used to make blanket statements about every individual in the world:
(x)student(x)smart(x) means Everyone in the world is a student and is smart
Existential quantifiers are usually used with and to specify a list of properties about an individual:
(x) student(x) smart(x) means There is a student who is smart
Quantifier Scope
Switching the order of universal quantifiers does not change the meaning:
Everyone likes someone : (x)(y) likes(x,y) Someone is liked by everyone : (y)(x) likes(x,y)
(x) P(x) (x) P(x) (x) P (x) P(x) (x) P(x) (x) P(x) (x) P(x) (x) P(x)