0% found this document useful (0 votes)
41 views45 pages

L4 - PredicateLogic My Lecture

This document discusses predicate logic and knowledge representation. It begins by defining different types of knowledge including declarative, procedural, task-based, behavioral, episodic, explanatory, and inferred knowledge. It then discusses predicate logic, noting that it extends propositional logic by allowing reasoning about classes of entities using predicates. Key aspects of predicate logic covered include subjects and predicates, propositional functions, the universe of discourse, and quantifier expressions like universal ("for all") and existential ("there exists"). The document provides examples to illustrate these concepts of predicate logic.

Uploaded by

Format Factory
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views45 pages

L4 - PredicateLogic My Lecture

This document discusses predicate logic and knowledge representation. It begins by defining different types of knowledge including declarative, procedural, task-based, behavioral, episodic, explanatory, and inferred knowledge. It then discusses predicate logic, noting that it extends propositional logic by allowing reasoning about classes of entities using predicates. Key aspects of predicate logic covered include subjects and predicates, propositional functions, the universe of discourse, and quantifier expressions like universal ("for all") and existential ("there exists"). The document provides examples to illustrate these concepts of predicate logic.

Uploaded by

Format Factory
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 45

Predicate Logic

Rupa Mehta

1
knowledge representation in AI
Knowledge Representation Categories:
•Declarative Knowledge
•Procedural Knowledge
•Task knowledge
•Behavioural knowledge
• episodic knowledge
•explanatory knowledge
•inferred knowledge

2
Declarative Knowledge
• It is s about statements that describe a particular object and
its attributes , including some behavior in relation with it
° To determine whether specific knowledge is declarative
or not, an agent can ask the following question: “Can
this knowledge be true or false?”
° or “Is it true or false that X?” where X is the statement
in question.
° E.g. Weather Man is Mortal (True or False) : True

3
Procedural Knowledge
• Gives information/ knowledge about how to achieve
something
• An AI agent without prior knowledge (Declarative
knowledge) of whether a declaration is true or false, to
find the answer it must
• first consult with another agent, or
• explore or make observations of the environment to find out
what is true or false.
• Agent as having procedural knowledge if it knows how
to perform a sequence of actions in order to ensure that
a declaration X will become true.
4
Procedural Knowledge (Cont..)

° To determine whether specific knowledge is procedural


or not, an agent can ask the following question:
• “What actions do I need to perform in order that I can declare
that X is true? ”
• If the question makes sense, then it can be deemed to be
procedural knowledge.
° E.g. “What actions do I need to perform in order that I
can declare that I am riding a bicycle is true”.

5
Other types of Knowledge
• Task knowledge is sometimes distinguished from
procedural knowledge. Task knowledge can be considered
to be a specialized form of procedural knowledge where
the purpose of the actions is to solve a task (e.g. find
answers to a specific question).
• Behavioural knowledge is knowledge that an agent has
about the likely outcomes of behaviours (of itself and
other agents).

6
Other types of Knowledge (cont)
• Episodic knowledge :
° knowledge of “when a statement X became true”. (Time stamped
set of information )
• explanatory knowledge :
° can explain what caused the sequence of actions that led to the
statement X becoming true.
• inferred knowledge :
° can use existing knowledge to determine new knowledge that was
not available by any other means.

7
Types of Knowledge (cont..)
• different types of knowledge can be distinguished by the
types of questions an agent can answer correctly using
their knowledge:
° Declarative knowledge (can Answer) : “What is …?” and “Where
is …?”
° episodic knowledge : “When did … occur?”questions
° procedural and task knowledge : “How can I/you …?”
° behavioural knowledge : “What if I/you …?”
° inferred knowledge: “If … is true, then is … true?” and “What if
… were true?”

8
Knowledge categorization based on
information representation
• Meta Knowledge - knowledge about a knowledge and how to gain
them
• Heuristic Knowledge - Representing knowledge of some expert in a
field or subject
° are rules of thumb or tricks.
° is used to make judgments and also to simplify solution of
problems.
° is acquired through experience.
• Structural Knowledge - Describes what relationship exists
between concepts/ objects

9
properties of knowledge representation
system
• Representational Adequacy :
° the ability to represent the required knowledge
• Inferential Adequacy :
° the ability to manipulate the knowledge represented to produce
new knowledge corresponding to that inferred from the original
° It must be able to derive knowledge representation structures such
as symbols when new knowledge is inferred from old knowledge
° Must be able to incorporate the new information

10
properties of knowledge representation
system (cont…)
• Inferential Efficiency
° the ability to direct the inferential mechanisms into the most
productive directions by storing appropriate guides
° It must be able to incorporate additional information into
knowledge structures which may help inference process to move in
promising direction
• Acquisition Efficiency
° the ability to acquire new knowledge using automatic methods
wherever possible rather than reliance on human intervention
° Must be able to incorporate the new information

11
Propositional calculus

12
Propositional Logic can’t…
• If X is married to Y, then Y is married to X.
• If X is west of Y, and Y is west of Z, then X is
west of Z.
• How to Fix this issues?
° extend representation: add predicates
° Extend operator(resolution): add unification

13
Predicate Logic
• Predicate logic is an extension of
propositional logic that permits concisely
reasoning about whole classes of entities.
E.g., “x>1”, “x+y=10”
• Such statements are neither true or false
when the values of the variables are not
specified.

14
Predicate Logic (cont…)

• It is the formal notation for writing perfectly


° Clear, Concise and unambiguous
° mathematical definitions, axioms, and theorems for any branch of
mathematics
• Supported by some of the more sophisticated
database query engines.
• Basis for automatic theorem provers and many
other Artificial Intelligence systems

15
Predicate Calculus …..

16
Predicate Calculus
• Syntax
• Symentics

17
Syntax
• Statements called Formulas
° Logical Symbols
• All connectors, (.), ∀, ∃, , =>, <-->, variables, =
° Non Logical Symbols
• Predicates (Capital letters)
• Functions (Small letters)

18
Semantic
• Validity = true in every model and every
interpretation.
• Interpretation = mapping of constants, predicates,
functions into objects, relations, and functions.

19
Subjects and Predicates
• The proposition : “The dog is sleeping”
has two parts:
° “the dog” denotes the subject - the object or entity that
the sentence is about.
° “is sleeping” denotes the predicate- a property that the
subject can have.

20
Example

21
Propositional Functions
• A predicate is modeled as a function P(·) from
objects to propositions.
° P(x) = “x is sleeping” (where x is any object)
• The result of applying a predicate P to an object
x=a is the proposition P(a).
° e.g. if P(x) = “x > 1”,
then P(3) is the proposition “3 is greater than 1.”
• Note: The predicate P itself (e.g. P=“is sleeping”)
is not a proposition (not a complete sentence).
22
Propositional Functions (cont..)
• Predicate logic includes propositional functions of
any number of arguments.
e.g. let P(x,y,z) = “x gave y the grade z”,
x=“Mike”, y=“Mary”, z=“A”,
Propositional Function:
P(x,y,z)
= P(Miken Mary, A)
= “Mike gave Mary the grade A.”

23
Universe of Discourse
• The collection of values that a variable x
can take is called x’s universe of discourse.
e.g., let P(x)=“x+1>x”.
UD is set of integers.

24
Quantifier Expressions
• Quantifiers allow us to quantify (count) how many
objects in the universe of discourse satisfy a given
predicate:

- “” : FORLL (universal quantifier)


x P(x) means for all x in the u.d., P holds.

- “” : XISTS (existential quantifier)


x P(x) means there exists an x in the u.d. (that
is, one or more) such that P(x) is true.
25
Universal Quantifier : Example
• Let P(x) be the predicate “x is full.”
• Let the u.d. of x be parking spaces at UNR .
• The universal quantification of P(x),
x P(x), is the proposition:
° “All parking spaces at UNR are full.” or
° “Every parking space at UNR is full.” or
° “For each parking space at UNR, that space is full.”

26
Universal Quantifier : Example

27
The Universal Quantifier 
• To prove that a statement of the form
x P(x) is false,
° it is sufficient to find a single counter example
° e.g. one value of x in the UD such that
P(x) is false
° e.g., P(x) is the predicate “x>0”

28
Existential Quantifier  Example
• Let P(x) be the predicate “x is full.”
• Let the u.d. of x be parking spaces at UNR.
• The universal quantification of P(x),
x P(x), is the proposition:
° “Some parking space at UNR is full.” or
° “There is a parking space at UNR that is full.” or
° “At least one parking space at UNR is full.”

29
Well Formed Formula in First Order Predicate
Calculus

30
Example FOPC

31
First Order Predicate Logic

32
Quantifier Equivalence Laws
• Definitions of quantifiers: If u.d.=a,b,c,…
x P(x)  P(a)  P(b)  P(c)  …
x P(x)  P(a)  P(b)  P(c)  …
• We can prove the following laws:
x P(x)  x P(x)
x P(x)  x P(x)
• Which propositional equivalence laws can
be used to prove this?
33
Representing World in FOL
• All kings are persons.
 x(King(x) => Person(x)) : OK.
 x (King(x) & Person(x)) : Not OK.
• this says every object is a king and a person.
• In Prolog: person(X) :- king(X).
• Everyone Likes icecream.
° (x)Likes(x, icecream)
Negating Quantifiers
• ~ there exist x, P(x) • For all x, ~P(x)
• ~ for all x, P(x) • There exists x, ~P(x)

• For all x, Likes (x,Ice • There does not exist x, not

cream) Likes (x, Ice cream)


• No one likes liver. • Not there exists x,
For all x, not Likes(x,Liver) Iikes(x,Liver).
More Equivalence Laws
 x P(x)  x  P(x)
x P(x)  x  P(x)

  x  y P( x , y )   y  x P( x , y )
x y P(x,y)  y x P(x,y)

 x (P(x)  Q(x))  (x P(x))  (x Q(x))


x (P(x)  Q(x))  (x P(x))  (x Q(x))
36
Scope of Quantifiers
• The part of a logical expression to which a
quantifier is applied is called the scope of
this quantifier.
e.g., (x P(x))  (y Q(y))
e.g., (x P(x))  (x Q(x))

37
Free and Bound Variables
• An expression like P(x) is said to have a
free variable x (meaning x is undefined).
• A quantifier (either  or ) operates on an
expression having one or more free
variables, and binds one or more of those
variables, to produce an expression having
one or more bound variables.

38
Examples of Binding
• P(x,y) has 2 free variables, x and y.
 x P(x,y) has
° 1 free variable, Y
° and one bound variable X
• “P(x), where x=3” is another way to bind x.
• An expression with zero free variables is an actual
proposition.
• An expression with one or more free variables is
still only a predicate: x P(x,y)
39
More to Know About Binding
 x x P(x) - x is not a free variable in
x P(x), therefore the x binding isn’t used.
• (x P(x))  Q(x) - The variable x is outside of the
scope of the x quantifier, and is therefore free.
Not a proposition.
• (x P(x))  (x Q(x)) - Legal because there are 2
different x’s!
• Quantifiers bind as loosely as needed:
parenthesize x (P(x)  Q(x) )
40
Nested Quantifiers
Exist within the scope of other quantifiers
• Let the u.d. of x & y be people.
• Let P(x,y)=“x likes y” (a predicate with 2 f.v.’s)
• Then y P(x,y) = “There is someone whom x
likes.” (a predicate with 1 free variable, x)
• Then x (y P(x,y)) = “Everyone has someone
whom they like.”
(A __________ with ___ free variables.)

41
Order of Quantifiers Is Important!!

If P(x,y)=“x relies upon y,” express the


following in unambiguous English:
Everyone has someone to rely on.
x(y P(x,y))=
There’s a poor overworked soul whom
y(x P(x,y))= everyone relies upon (including himself)!
x(y P(x,y))= There’s some needy person who relies
upon everybody (including himself).
y(x P(x,y))=Everyone has someone who relies upon them.
x(y P(x,y))= Everyone relies upon everybody,
(including themselves)!
42
Natural language is ambiguous!
• “Everybody likes somebody.”
° For everybody, there is somebody they like,
 x y Likes(x,y) [Probably more likely.]
° or, there is somebody (a popular person) whom
everyone likes?
 y x Likes(x,y)

43
Notational Conventions
• Consecutive quantifiers of the same type can be
combined: x y z P(x,y,z) 
x,y,z P(x,y,z) or even xyz P(x,y,z)

• Sometimes the universe of discourse is restricted


within the quantification, e.g.,
 x>0 P(x) is shorthand for
“For all x that are greater than zero, P(x).”
 x>0 P(x) is shorthand for
“There is an x greater than zero such that P(x).”

44
Some Number Theory Examples
• Let u.d. = the natural numbers 0, 1, 2, …
• “A number x is even, E(x), if and only if it is
equal to 2 times some other number.”
x (E(x)  (y x=2y))
• “A number is prime, P(x), iff it isn’t the
product of two non-unity numbers.”
x (P(x)  (y,z x=yz  y1  z1))
45

You might also like