0% found this document useful (0 votes)
113 views38 pages

FOPL

Uploaded by

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

FOPL

Uploaded by

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

First Order Predicate Logic(FOPL)

•First-order logic is another way of knowledge representation


in artificial intelligence. It is an extension to propositional
logic.
•FOL is sufficiently expressive to represent the natural
language statements in a concise way.
•First-order logic is also known as Predicate logic or First-
order predicate logic. First-order logic is a powerful
language that develops information about the objects in a
more easy way and can also express the relationship between
those objects.
•First-order logic (like natural language) does not only assume that the world
contains facts like propositional logic but also assumes the following things in the
world:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pits, ......
• Relations: It can be unary relation such as: red, round, is adjacent, or
n-any relation such as: the sister of, brother of, has color, comes between
• Function: Father of, best friend, third inning of, end of, ......
•As a natural language, first-order logic also has two main parts:
• Syntax
• Semantic
Basic Elements of First-order logic:
Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai, cat,....


Variables x, y, z, a, b,....
Predicates Brother, Father, >,....
Function sqrt, LeftLegOf, ....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
•Atomic sentences are the most basic sentences of first-order logic. These sentences
are formed from a predicate symbol followed by a parenthesis with a sequence of
terms.
•We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
Sherry is a cat: => cat (Sherry).
Complex Sentences:
•Complex sentences are made by combining atomic sentences using connectives.
First-order logic statements can be divided into two parts:
•Subject: Subject is the main part of the statement.
•Predicate: A predicate can be defined as a relation, which binds two atoms together in
a statement.
Consider the statement: "x is an integer.", it consists of two parts, the first part x is
the subject of the statement and second part "is an integer," is known as a predicate.
Quantifiers in First-order logic:
•A quantifier is a language element which generates quantification, and quantification
specifies the quantity of specimen in the universe of discourse.
•These are the symbols that permit to determine or identify the range and scope of the
variable in the logical expression. There are two types of quantifier:
• Universal Quantifier, (for all, everyone, everything)
• Existential quantifier, (for some, at least one).

Universal Quantifier:
Universal quantifier is a symbol of logical representation, which specifies that the
statement within its range is true for everything or every instance of a particular thing.
The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.

f x is a variable, then ∀x is read as:


•For all x
•For each x
•For every x.
Example:
All man drink coffee.
∀x man(x) → drink (x, coffee).
It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement within
its scope is true for at least one instance of something.
It is denoted by the logical operator ∃, which resembles as inverted E. When it is used with
a predicate variable then it is called as an existential quantifier.
If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
•There exists a 'x.'
•For some 'x.'
•For at least one 'x.'
Example:
Some boys are intelligent.

∃x: boys(x) ∧ intelligent(x)


It will be read as: There are some x where x is a boy who is intelligent.
Points to remember:
•The main connective for universal quantifier ∀ is implication →.
•The main connective for existential quantifier ∃ is and ∧.
Properties of Quantifiers:
•In universal quantifier, ∀x∀y is similar to ∀y∀x.
•In Existential quantifier, ∃x∃y is similar to ∃y∃x.
•∃x∀y is not similar to ∀y∃x.
Some Examples of FOL using quantifier:
1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).
2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).
3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since
there are some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).
4. Not all students like both Mathematics and Science.
In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
1. All
employees earning $ 1400 or more per year pay taxes
2.Some Employees are sick today
3.No employees earn more than President

Represent in FOPL format


E(x) for x is an employee
P(x) for x is President
i(x) for income of x
GE(u,v) for u is greater than equal to v
S(x) for x is sick today
T(x) for x pays taxes

E1 : ∀ x ((E(x) & GE (i(x),1400)🡪 T(x)


E2: ∃ x (E(x)🡪S(x)
E3: Vxy ((E(x) & P(y)🡪 ~GE(i(x),i(y)))
All students are smart.
∀ x ( Student(x) ⇒ Smart(x) )
There exists a student.
∃ x Student(x).
There exists a smart student.
∃ x ( Student(x) ∧ Smart(x) )
Every student loves some student.
∀ x ( Student(x) ⇒ ∃ y ( Student(y) ∧ Loves(x,y) ))
Every student loves some other student.
∀ x ( Student(x) ⇒ ∃ y ( Student(y) ∧ ¬ (x = y) ∧ Loves(x,y) ))
There is a student who is loved by every other student.
∃ x ( Student(x) ∧ ∀ y ( Student(y) ∧ ¬(x = y) ⇒ Loves(y,x) ))
Bill is a student.
Student(Bill)
Bill takes either Analysis or Geometry (but not both)
Takes(Bill, Analysis) ⇔ ¬ Takes(Bill, Geometry)
Bill takes Analysis or Geometry (or both).
Takes(Bill, Analysis) ∨ Takes(Bill, Geometry)
Bill takes Analysis and Geometry.
Takes(Bill, Analysis) ∧ Takes(Bill, Geometry)
Bill does not take Analysis.
¬ Takes(Bill, Analysis).
No student loves Bill.
¬ ∃ x ( Student(x) ∧ Loves(x, Bill) )
Bill has at least one sister.
∃ x SisterOf(x,Bill)
Bill has no sister.
¬ ∃ x SisterOf(x,Bill)
Bill has at most one sister.
∀ x, y ( SisterOf(x, Bill) ∧ SisterOf(y, Bill) ⇒ x = y )
Bill has exactly one sister.
∃ x ( SisterOf(x, Bill) ∧ ∀ y ( SisterOf(y, Bill) ⇒ x = y ))
Bill has at least two sisters.
∃ x, y ( SisterOf(x, Bill) ∧ SisterOf(y, Bill) ∧ ¬ (x = y) )
Every student takes at least one course.
∀ x ( Student(x) ⇒ ∃ y ( Course(y) ∧ Takes(x,y) ))
Only one student failed History.
∃ x ( Student(x) ∧ Failed(x, History) ∧ ∀ y ( Student(y) ∧ Failed(y, History) ⇒ x = y ))
No student failed Chemistry but at least one student failed History.
¬ ∃ x ( Student(x) ∧ Failed(x, Chemistry) ) ∧ ∃ x ( Student(x) ∧ Failed(x, History) )
Every student who takes Analysis also takes Geometry.
∀ x ( Student(x) ∧ Takes(x, Analysis) ⇒ Takes(x, Geometry) )
No student can fool all the other students.
¬ ∃ x ( Student(x) ∧ ∀ y ( Student(y) ∧ ¬ (x = y) ⇒ Fools(x,y) ))
1. All Students don’t like programming
.
2. A ball is both round in shape and red in colour

3. Not all birds can fly

4. Anyone can be good either in Cricket or Baseball

5. Only some can be both batsman and a bowler

6.All Romans were either loyal to Ceaser or hated him

7. If it doesn’t rain today, Ram will visit Museum

8.Anyone who is determined and intelligent will give good service


Well-Formed Formula for First Order Predicate Logic
--- Syntax Rules

Those which produce a proposition when their symbols are interpreted must follow the rules given below, and they
are called wffs(well-formed formulas) of the first order predicate logic.

Rules for constructing Wffs

A predicate name followed by a list of variables such as P(x, y), where P is a predicate name, and
x and y are variables, is called an atomic formula.

Wffs are constructed using the following rules:


1. True and False are wffs.
2.Each propositional constant (i.e. specific proposition), and each propositional
variable (i.e. a variable representing propositions) are wffs.
3.Each atomic formula (i.e. a specific predicate with variables) is a wff.
4.if A, B, are wffs, then so are
~A, (A V B), (A & B), (A 🡪 B), and (A 🡨>B).

wff, then so are ∀x A and ∃ x A


5.If x is a variable (representing objects of the universe of discourse), and A is a
For example, "The capital of Virginia is Richmond." is a specific proposition. Hence it is a wff
by Rule 2.
Let B be a predicate name representing "being blue" and let x be a variable. Then B(x) is an
atomic formula meaning "x is blue". Thus it is a wff by Rule 3. above.
By applying Rule 5. to B(x), B(x) is a wff and so is ∃x B(x). Then by applying Rule 4. to
them ∀x B(x) , ∃x B(x) is seen to be a wff. Similarly if R is a predicate name representing
"being round". Then R(x) is an atomic formula. Hence it is a wff. By applying Rule 4 to B(x)
and R(x), a wff B(x) &R(x) is obtained.
In this manner, larger and more complex wffs can be constructed following the rules given
above.

One way to check whether or not an expression is a wff is to try to state it in English. If you
can translate it into a correct English sentence, then it is a wff.

.
More examples: To express the fact that Tom is taller than John, we can use the
atomic formula taller(Tom, John), which is a wff. This wff can also be part of some
compound statement such as taller(Tom, John) &~ taller(John, Tom), which is also
a wff.

If x is a variable representing people in the world, then taller(x,Tom),


taller(x,Tom), ∃x taller(x,Tom),
∀x ∃y taller(x,y) are all wffs among others.

However, taller(∀x ,John) and taller(Tom V Mary, Jim), for example, are NOT wffs
Inference in First-Order Logic
1. Modus Ponen
2. Chain Rule
3. Substitution
4. Equivalence
FOL inference rules for quantifier:
As propositional logic we also have inference rules in first-order logic, so following are some basic inference rules in
FOL:

Universal Generalization
Universal Instantiation
Existential Instantiation
Existential introduction
1. Universal Generalization:

Universal generalization is a valid inference rule which states that if premise P(c) is true for any arbitrary element c
in the universe of discourse, then we can have a conclusion as ∀ x P(x).
It can be represented as: Inference in First-Order Logic.

Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes contain 8 bits.", it will also be true.
2. Universal Instantiation:

The UI rule state that we can infer any sentence P(c) by substituting a ground term c (a constant within domain x) from
∀ x P(x) for any object in the universe of discourse.
It can be represented as

Example:1.

IF "Every person like ice-cream"=> ∀x P(x) so we can infer that


"John likes ice-cream" => P(c)

3. Existential Instantiation:
This rule states that one can infer P(c) from the formula given in the form of ∃x P(x) for a new constant symbol c.
The restriction with this rule is that c used in the rule must be a new term for which P(c ) is true.
It can be represented as:

4. Existential introduction
This rule states that if there is some element c in the universe of discourse which has a
property P, then we can infer that there exists something in the universe which has the
property P.
Example: Let's say that,
"Priyanka got good marks in English."
"Therefore, someone got good marks in English."
Conversion to Clause Form
One method for Inferencing is Resolution. It requires that all the statements be
converted into normalized clausal form. A clause is disjunction of number of literal
PROCEDURE
1. Eliminate logical implications,->, using the fact that A -> B is equivalent to ¬A ∨ B.
2. Reduce the scope of each negation to a single term, using the following facts:
¬(¬P) = P
¬(A ∨ B) = ¬A ∧ ¬B
¬(A ∧ B) = ¬A V ¬B
¬∀xP(x) = ∃x¬P(x)
¬∃x P(x) = ∀x ¬P(x)
3.Standardize variables so that each quantifier binds a unique variable.
4. Skolemize by replacing all existentially quantified variable with skolem functions and
delete corresponding existential quantifier.
SKOLEMIZATION:
1. If the leftmost quantifier in an expression is existential quantifier ,replace all
occurrences of the variable it quantifies with a constant not appearing elsewhere in
the expression and delete the quantifier. Follow the same procedure for all
existential quantifier preceded by Universal quantifier.
2. For each existential quantifier that is preceded by one or more universal quantifier ,
replace all occurrences of existentially quantified variable by a function symbol not
appearing elsewhere in the expression

Example ∃u Vv Vx ∃y P(f(u),v ,x ,y)-> Q(u,v,y)

the skolem form is

Vv Vx P(f(a), v, x, g(v, x))-> Q(a, v, g(v,x))


5. Move all quantifiers to the left, maintaining their order and put the expression in CNF form Ex:
Expression1 & Expression2 &……

6. Eliminate all existential quantifiers, using Skolem functions (functions of the preceding
universally quantified variables) and Conjunctions. The resultant expression are clauses and
set of such expression is said to be in Clausal form

CONVERT THE FOLLOWING INTO CLAUSAL FORM


∀Y (∀X (taller(Y,X) V wise(X)) -> wise(Y))

Simplify
∀Y (~∀X (taller(Y,X) V wise(X)) V wise(Y))

Move negations in
∀Y (∃X (~taller(Y,X) & ~wise(X)) V wise(Y))

Move quantifiers out


∀Y ∃X ((~taller(Y,X) & ~wise(X)) V wise(Y)))

Skolemize
Replacing X of Existential quantifier with g(y)
Vy(~taller(Y,g(Y)) & ~wise(g(Y))) V wise(Y)
Distribute disjunctions
(P & Q) V R can be written as (P V R) & (Q V R)

Convet to CNF
(~taller(Y,g(Y)) V wise(Y) & (~wise(x(Y)) V wise(Y))

Convert to clauses by removing conjunction and Universal Quantifier


~taller(Y,x(Y)) V wise(Y) ----Clause 1
~wise(x(Y)) V wise(Y) ------Clause 2

CONVRT INTO CLAUSAL FORM

1. ∃X Vy (Vz (P(x), y, z) -> (∃u Q(x,u) & ∃v R (y, v)))


2. Vxy(∃z P(x,z) & P( y,z)) -> ∃u Q(x,y,u)
Unification
•Unification is a process of making two different logical atomic expressions
identical by finding a substitution. Unification depends on the substitution
process.
•It takes two literals as input and makes them identical using substitution.

•Example: Find the Most General Unifier for Unify{King(x), King(John)}


Let Ψ1 = King(x), Ψ2 = King(John),
Substitution θ = {John/x} is a unifier for these atoms and applying this substitution,
and both expressions will be identical

Let's say there are two different expressions, P(x, y), and P(a, f(z)).
In this example, we need to make both above statements identical to each
other. For this, we will perform the substitution.
P(x, y)......... (i)
P(a, f(z))......... (ii)
•Substitute x with a, and y with f(z) in the first expression, and it will be
represented as a/x and f(z)/y.
•With both the substitutions, the first expression will be identical to the second
expression and the substitution set will be: [a/x, f(z)/y].
Conditions for Unification:
Following are some basic conditions for unification:
•Predicate symbol must be same, atoms or expression with different predicate symbol can
never be unified.
•Number of Arguments in both expressions must be identical.
•Unification will fail if there are two similar variables present in the same expression.

Algorithm

Step.1: Initialize the substitution set to be empty.


Step.2: Recursively unify atomic sentences:
1.Check for Identical expression match.
2.If one expression is a variable vi, and the other is a term ti which
does not contain variable vi, then:
1. Substitute ti / vi in the existing substitutions
2. Add ti /vi to the substitution setlist.
3. If both the expressions are functions, then function name must
be similar, and the number of arguments must be the same in
both the expression.
Resolution
Resolution is a theorem proving technique that proceeds by building refutation
proofs, i.e., proofs by contradictions. It was invented by a Mathematician John Alan
Robinson in the year 1965.
Resolution is used, if there are various statements are given, and we need to prove
a conclusion of those statements. Unification is a key concept in proofs by
resolutions. Resolution is a single inference rule which can efficiently operate on
the conjunctive normal form or clausal form.
Example:
We can resolve two clauses which are given below:
[Animal (g(x) V Loves (f(x), x)] and [ ¬ Loves(a, b) V ¬ Kills(a, b)]
Where two complimentary literals are: Loves (f(x), x) and ¬ Loves (a, b)
These literals can be unified with unifier θ= [a/f(x), and b/x] , and it will generate a
resolvent clause:
[Animal (g(x) V ¬ Kills(f(x), x)].

Steps for Resolution:


1.Conversion of facts into first-order logic.
2.Convert FOL statements into CNF
3.Negate the statement which needs to prove (proof by contradiction)
4.Draw resolution graph (unification).
Example OF Propositional Resolution
Consider the following Knowledge Base:
1.The humidity is high or the sky is cloudy.
2.If the sky is cloudy, then it will rain.
3.If the humidity is high, then it is hot.
4.It is not hot.
Goal: It will rain.
Use propositional logic and apply resolution method to prove that the goal is
derivable from the given knowledge base.
Solution: Let’s construct propositions of the given sentences
one by one:
1.Let, P: Humidity is high.
Q: Sky is cloudy.
It will be represented as P V Q.
2) Q: Sky is cloudy. …from(1)
Let, R: It will rain.
It will be represented as Q → R.
3) P: Humidity is high. …from(1)
Let, S: It is hot.
It will be represented as P → S.
4) ¬S: It is not hot.
Applying resolution method:
In (2), Q → R will be converted as (¬Q V R)
In (3), P → S will be converted as (¬P V S)
Negation of Goal (¬R): It will not rain.
Finally, apply the rule as shown below:
1. If x is on top of y, y supports x
2. If x is above y and they are touching each other, x is on top of y
3. A cup is above a book
4. A cup is touching a book
Translate the above into clausal form
show that Predicate supports(book,cup ) is true using Resolution

5. Steve likes only easy courses


6. All Science courses are hard
7. All courses in Humanities department is easy
8. HM101 is a course in Humanities
9. Sc101 is a scienc course
Prove if Steve likes HM101?

Lkes (steve,easycourse)
Vx Sciencecourse(x)->~easy(x)
Vx Course(x, Humaniities)-> easy(x)
Course(HM101, Humanities)
~likes(steve,HM101)
(a)Marcus was a man.
(b) Marcus was a Roman.
(c) All men are people.
(d) Caesar was a ruler.
(e) All Romans were either loyal to Caesar or
hated him
(f) Everyone is loyal to someone.
(g) People only try to assassinate rulers they are
not loyal to.
(h) Marcus tried to assassinate Caesar.
PT Marcus hates Ceaser
(a)man(marcus)
(b) roman(marcus)
(c) VX. man(X) -> person(X)
(d) ruler(caesar)
(e) VX. roman(x) -> loyal(X,caesar) V hate(X,caesar)
(f) Vx∃y loyal(X,Y)
(g) VxVy person(X) & ruler(Y)&tryassasin(X,Y) ->~loyal(X,Y)
(h) tryassasin(marcus,caesar)
~Man(x) V People(x)
~Roman(x)V Loyal(x,ceaser)V Hate (x,ceaser)
~people(x) V ~ruler (y) V ~tryassasinate(x,y)V ~loyal(x,y)
man(marcus)
roman(marcus)

P T ~hate(Marcus ,Ceaser)
Example of FOPL resolution
Consider the following knowledge base:
1.Gita likes all kinds of food.
2.Mango and chapati are food.
3.Gita eats almond and is still alive.
4.Anyone alive is not killed
5. Anyone not killed is alive.
Goal: Gita likes almond.
Solution: Convert the given sentences into FOPL as:

∀x: food(x) → likes(Gita,x)


food(Mango) V food(chapati)
∀x∀y: eats(x,y) Ʌ ¬ killed(x → food(y)
eats(Gita, almonds) Ʌ alive(Gita)
∀x: ¬killed(x) → alive(x)
∀x: alive(x) → ¬killed(x)
Goal: likes(Gita, almond)

Negated goal: ¬likes(Gita, almond)


Now, rewrite in CNF form:

¬food(x) V likes(Gita, x)
food(Mango)V food(chapati)
¬eats(x,y) V killed(x) V food(y)
eats(Gita, almonds)V alive(Gita)
killed(x) V alive(x)
¬alive(x) V ¬killed(x)
An inference is a process of drawing conclusions based on the evidence

Types of Inference
There are two basic types of inference:
a. Abductive (or “deductive inference”) is an inference based on logical certainty. It usually starts
from a general principle and then infers something about specific cases.

“Grapes are poisonous to all dogs”

This allows you to infer that grapes are poisonous for your dog, too. If the premise is true then the
conclusion has to be true. There’s no other possibility. Notice, however, that this doesn’t really tell
you anything new: once you say “grapes are poisonous to all dogs,” you already know that grapes
are poisonous for your specific dog. Deduction has the advantage of certainty, but it doesn’t
generate new knowledge.

Induction (or “inductive inference”) is an inference based on probability. It usually starts from specific
information and then infers the more general principle.

“For the last two years, Amanda has woken up at 8am every day”

This allows you to infer that Amanda will probably wake up at 8am tomorrow, too. You would probably be
right, and it’s a reasonable inference but it’s not certain! Tomorrow could be the first day that Amanda
decides to sleep in. Despite this uncertainty, however, induction does offer the possibility of predicting
future events and creating new knowledge.
Analogical Inference- It is a form of experiential inference Situation or entities alike in some
respect can be similar in other respects Example if we know to solve a equation with 2 unknowns
we can extend the method to solve an equation with 3 unknowns

TYPES OF RESOLUTION
1. BINARY RESOLUTION – Two clauses having complimentary literals are combined as disjunct to
produce a single clause after deleting complementary literals
Ex ~P(x,a) V Q (x) and ~Q(b) V R(x)

is ~P(b,a) V R(b)
2. UNIT RESOLUTION - a number of clauses are resolved simultaneously to produce a unit clause
Ex: (~married (x,y) V ~ mother(x,z) V Father (y,z), married(sue,joe), ~father(joe,bill)
After substituting sue/x, joe/y, bill/z
Unit clause is ~mother(sue,bill)

3. LINEAR RESOLUTION When each resolved clause Ci is a parent to the clause Ci+1 (i=1,2,3,…n)
the process is called linear Resolution
Example:
1.John likes all kind of food.
2.Apple and vegetable are food
3.Anything anyone eats and not killed is food.
4.Anil eats peanuts and still alive
5.Harry eats everything that Anil eats.
6.Anyone not killed is alive and vice versa
Prove by resolution that:
7.John likes peanuts.
Step-1: Conversion of Facts into FOL
In the first step we will convert all the given statements into its first order logic.
Step-2: Conversion of FOL into CNF
In First order logic resolution, it is required to convert the FOL into CNF as CNF
form makes easier for resolution proofs.
•Eliminate all implication (→) and rewrite
• ∀x ¬ food(x) V likes(John, x)
• food(Apple) Λ food(vegetables)
• ∀x ∀y ¬ [eats(x, y) Λ ¬ killed(x)] V food(y)
• eats (Anil, Peanuts) Λ alive(Anil)
• ∀x ¬ eats(Anil, x) V eats(Harry, x)
• ∀x¬ [¬ killed(x) ] V alive(x)
• ∀x ¬ alive(x) V ¬ killed(x)
likes(John, Peanuts).

1.Move negation (¬)inwards and rewrite


2.∀x ¬ food(x) V likes(John, x)
3.food(Apple) Λ food(vegetables)
4.∀x ∀y ¬ eats(x, y) V killed(x) V food(y)
5.eats (Anil, Peanuts) Λ alive(Anil)
6.∀x ¬ eats(Anil, x) V eats(Harry, x)
7.∀x ¬killed(x) ] V alive(x)
8.∀x ¬ alive(x) V ¬ killed(x)
9.likes(John, Peanuts).
1.Rename variables or standardize variables
2.∀x ¬ food(x) V likes(John, x)
3.food(Apple) Λ food(vegetables)
4.∀y ∀z ¬ eats(y, z) V killed(y) V food(z)
5.eats (Anil, Peanuts) Λ alive(Anil)
6.∀w¬ eats(Anil, w) V eats(Harry, w)
7.∀g ¬killed(g) ] V alive(g)
8.∀k ¬ alive(k) V ¬ killed(k)
9.likes(John, Peanuts).
•Eliminate existential instantiation quantifier by elimination.
In this step, we will eliminate existential quantifier ∃, and this process is known
as Skolemization. But in this example problem since there is no existential quantifier so
all the statements will remain same in this step.
1.Drop Universal quantifiers.
In this step we will drop all universal quantifier
since all the statements are not implicitly
quantified so we don't need it
2..¬ food(x) V likes(John, x)
3.food(Apple)
4.food(vegetables)
5.¬ eats(y, z) V killed(y) V food(z)
1.eats (Anil, Peanuts)
2.alive(Anil)
3.¬ eats(Anil, w) V eats(Harry, w)
4.killed(g) V alive(g)
5.¬ alive(k) V ¬ killed(k)
6.likes(John, Peanuts).

•Distribute conjunction ∧ over disjunction ¬.


This step will not make any change in this problem.
Step-3: Negate the statement to be proved
In this statement, we will apply negation to the conclusion statements, which will be
written as ¬likes(John, Peanuts)
Step-4: Draw Resolution graph:
Now in this step, we will solve the problem by resolution tree using substitution. For the
above problem, it will be given as follows:

You might also like