Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 132

Amity School of Engineering & Technology

Artificial Intelligent
Module 2
By- Chandan Sharma
A2305219668 , 6CSE11Y
ASET, Amity University, Noida
Amity School of Engineering & Technology

Knowledge
• Knowledge is the body of facts and principles.
• Knowledge can be language, concepts, procedures, rules, ideas,
abstractions, places, customs, and so on.
• Study of knowledge is called Epistemology.
Amity School of Engineering & Technology

Types of knowledge
• Following are the various
types of knowledge:
1. Declarative Knowledge
2. Procedural Knowledge
3. Meta-knowledge
4. Heuristic knowledge
5. Structural knowledge
Amity School of Engineering & Technology
Types of knowledge(Cont..)
Declarative knowledge
• Declarative knowledge is passive knowledge in the form of statements of facts about the
world.
• For example, mark statement of a student is declarative knowledge.
Procedural Knowledge
• It is also known as imperative knowledge.
• Procedural knowledge is a type of knowledge which is responsible for knowing how to do
something.
• It can be directly applied to any task.
• It includes rules, strategies, procedures, agendas, etc.
• Procedural knowledge depends on the task on which it can be applied.
Meta-knowledge:
• Knowledge about the other types of knowledge is called Meta-knowledge.
• Metaknowledge is knowledge about knowledge
Amity School of Engineering & Technology

Types of knowledge(Cont..)
Heuristic knowledge
• Heuristics knowledge are rules of thumb or tricks.
• Heuristic knowledge is used to make judgments and also to simplify solution of
problems. It is acquired through experience.
• An expert uses his knowledge that he has gathered due to his experience and
learning.

Structural knowledge:
• Structural knowledge is basic knowledge to problem-solving.
• It describes relationships between various concepts such as kind of, part of, and
grouping of something.
• It describes the relationship that exists between concepts or objects.
Amity School of Engineering & Technology

KNOWLEDGE REPRESENTATION
• To solve problems in artificial intelligence requires large amount of knowledge
and some mechanism that knowledge to create solutions to new problem.
• A variety of knowledge facts have been exploited in AI programs.
• Hence we are dealing with two different kinds of entities such as:
• Facts: - It is truth in some relevant world. These are the things we want to
represent.
• Representations of facts in some chosen formalism: - These are the things we
will actually be able to manipulate.
Amity School of Engineering & Technology

KNOWLEDGE REPRESENTATION
A knowledge representation is a study of ways of how knowledge is actually
represented and how effectively it resembles the representation of knowledge
inhuman brain.
• A knowledge representation system should provide ways of representing
complex
knowledge.
How to represent the knowledge in a machine?
• The Language is needed to represent the knowledge . There must be a method
to
use this knowledge.
• Syntax and semantic must be well defined in order to represent the language.
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Characteristics of Knowledge Representation


• The representation scheme should have a set of well-defined syntax
and semantic. This will help in representing various kinds of
knowledge.
• The knowledge representation scheme should have a good expressive
capacity. It will catalyze the inference mechanism in its reasoning
process.
• From the computer system point of view, the representation must be
efficient.
Amity School of Engineering & Technology

Issues that arises while KR techniques:


The fundamental goal of Knowledge Representation is to facilitate
inferencing (conclusions) from knowledge.

1. Important Attributes
2. Relationships among Attributes.
3. Choosing the granularity of Representation.
4. Representing Sets of Objects.
5. Finding the Right structures as Needed
Amity School of Engineering & Technology

Issues that arises while KR techniques:


Amity School of Engineering & Technology

Issues that arises while KR techniques:


1. Important attributes
There are two attributes shown in the diagram, instance and isa. Since these
attributes support property of inheritance, they are of prime importance.
2. Relationships among attributes
Basically, the attributes used to describe objects are nothing but the entities.
However, the attributes of an object do not depend on the encoded specific
knowledge. Information about type of constraints on the value .
Amity School of Engineering & Technology

Issues that arises while KR techniques:


3. Choosing the granularity of representation
While deciding the granularity of representation, it is necessary to know the following:
i. What are the primitives and at what level should the knowledge be represented?
ii. What should be the number (small or large) of low-level primitives or high-level facts?
High-level facts may be insufficient to draw the conclusion while Low-level primitives may
require a lot of storage.
For example: Suppose that we are interested in following facts:
John spotted Alex.
Now, this could be represented as "Spotted (agent(John), object (Alex))"
Such a representation can make it easy to answer questions such as: Who spotted Alex?
Suppose we want to know : "Did John see Sue?"
Given only one fact, user cannot discover that answer.
Hence, the user can add other facts, such as "Spotted (x, y) → saw (x, y)"
Amity School of Engineering & Technology

Issues that arises while KR techniques:


4. Representing sets of objects.
There are some properties of objects which satisfy the condition of a set together but
not as individual;
Example: Consider the assertion made in the sentences:
"There are more sheep than people in Australia", and "English speakers can be
found all over the world."
These facts can be described by including an assertion to the sets representing
people, sheep, and English.
5. Finding the right structure as needed
To describe a particular situation, it is always important to find the access of right
structure. This can be done by selecting an initial structure and then revising the
choice.
Amity School of Engineering & Technology

Requirement to knowledge Representation


A good knowledge representation enables fast and accurate access to knowledge
and understand of the content.
A knowledge representation system should have following properties.
Representational Adequacy: The ability to represent all kinds of knowledge that
are needed in that domain.
Inferential Adequacy: The ability to manipulate the representational structures to
derive new structures corresponding to new knowledge inferred from old.
Inferential Efficiency: The ability to incorporate additional information into the
knowledge structure that can be used to focus the attention of the inference
mechanisms in the most promising direction.
Acquisitional Efficiency: The ability to acquire new knowledge using automatic
methods wherever possible rather than reliance on human intervention.
Amity School of Engineering & Technology

Approaches to knowledge Representation


1. Simple relational knowledge
• It is the simplest way of storing facts which uses the relational method,
and each fact about a set of the object is set out systematically in columns.
• This approach of knowledge representation is famous in database
systems where the relationship between different entities is represented.
• Ex Player Weight Age
Player1 65 23
Player2 58 18
Player3 75 24
Amity School of Engineering & Technology

Approaches to knowledge Representation


2. Inheritable knowledge
• In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
• In this approach, we apply inheritance property.
• Elements inherit values from other members of a class.
• This approach contains inheritable knowledge which shows a relation between
instance and class, and it is called instance relation.
• Every individual frame can represent the collection of attributes and its value.
• In this approach, objects and values are represented in Boxed nodes.
• We use Arrows which point from objects to their values.
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Approaches to knowledge Representation


3. Inferential knowledge
• Inferential knowledge approach represents knowledge in the form of formal
logics.
• This approach can be used to derive more facts.
• It guaranteed correctness.
• Example: Let's suppose there are two statements:
Marcus is a man
All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
Amity School of Engineering & Technology

Approaches to knowledge Representation


4. Procedural knowledge
• Procedural knowledge approach uses small programs and codes which
describes how to do specific things, and how to proceed.
• In this approach, one important rule is used which is If-Then rule.
• In this knowledge, we can use various coding languages such as LISP
language and Prolog language.
• We can easily represent heuristic or domain-specific knowledge using
this approach.
• But it is not necessary that we can represent all cases in this approach.
Amity School of Engineering & Technology

Approaches to knowledge Representation


5. Structured Knowledge Representations
• Modeling-based representations reflect the structure of the domain,
and then reason based on the model.
• Semantic Nets
• Frames
• Scripts
• Sometimes called associative networks.
Amity School of Engineering & Technology

Propositional Logic
• Propositional Logic is one of the representation schemes.
• It is the combination of Proposition + Logic
Proposition
• Propositions are elementary atomic sentences.
• Propositions may be either true or false but may take on other value.
• There are two kinds of proposition
• Simple
• Compound
• Some examples of simple propositions are
• John has two children.
• It is raining.
• People live on earth.
• mango is yellow.
Amity School of Engineering & Technology
Propositional Logic
• Following are some basic facts about propositional logic:
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• In propositional logic, we use symbolic variables to represent the logic, and we can use any symbol
for a representing a proposition, such A, B, C, P, Q, R, etc.
• Propositions can be either true or false, but it cannot be both.
• Propositional logic consists of an object, relations or function, and logical connectives.
• These connectives are also called logical operators.
• The propositions and connectives are the basic elements of the propositional logic.
• Connectives can be said as a logical operator which connects two sentences.
• A proposition formula which is always true is called tautology, and it is also called a valid
sentence.
• A proposition formula which is always false is called Contradiction.
• A proposition formula which has both true and false values is called Contingency
• Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.
Amity School of Engineering & Technology

Propositional Logic Logic


• One of the prime activities of the human
• Compound propositions are formed intelligence is reasoning.
from atomic formulas using the logical
connectives not, or, if ………then, and, • The activity of reasoning involves
construction, organization and manipulation of
if and only if. statements to arrive at new conclusions.
• For example, the following are • Thus logic can be defined as a scientific
compound formulas. study of the process of reasoning.
• It is raining and the wind is blowing. • Logic is a formal language.
• The moon is made of green cheese or it • Logic is basically classified in two main
is not. categories
• Propositional logic
• If you study hard you will be rewarded.
• Predicate logic
• The sum of 10 and 20 is not 50.
Amity School of Engineering & Technology

Propositional Logic Connectives


• Ʌ (and): This is called conjunction and is useful for constructing a sentence like A Ʌ B.
• V (or): This is called disjunction and is useful for constructing a sentence like A V B.
• ¬ (negation): This is called not and is useful for constructing a sentence like ¬A.
• → (implication) : This is used in constructing sentences like A → B and is equivalent to ¬A V B.
• ↔ (equivalent): This is used in constructing sentences like A ↔ B which implies A is equivalent to B.
Amity School of Engineering & Technology

Propositional Logic
Connectives Truth Table
Amity School of Engineering & Technology

Precedence of connectives:
Just like arithmetic operators, there is a precedence order for propositional connectors or
logical operators. This order should be followed while evaluating a propositional
problem. Following is the list of the precedence order for operators:

Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Fourth Precedence Disjunction(OR)
Fifth Precedence Implication
Six Precedence Biconditional
Amity School of Engineering & Technology

Conditions:
Amity School of Engineering & Technology

First Order Predicate Logic (FOPL)


• FOPL was developed to extend the expressiveness of Propositional logic.
• Propositional logic works fine in situations where the result is either true or
false. However, there are many real life situations that cannot be treated this
way.
• Predicate logic is the area of logic that deals with predicates and quantifiers.
• Predicate – refers to a property that the subject of a statement can have
• Example: “x is greater than 3”
, in this x is the subject and
“is greater than 3” is the predicate
Syntax of FOPL Amity School of Engineering & Technology

• Connectives • Connectives: There are five connective symbols


• Quantifiers ¬ : not or negation
• Constants Ʌ : and or conjunction
• Variables V : or or inclusive disjunction
• Predicates → : implication
↔ : equivalence or if and only if
• Functions
• Quantifiers: There are two quantifier symbols are
Ǝ : existential quantification
Example: Ǝ x means there exist x
∀ : universal quantification
Example: ∀x means for all x
Syntax of FOPL Amity School of Engineering & Technology

• Predicates: a predicate is defined as a relation


• Constant: constants are fixed- that binds two atoms
values terms that belong to a given together. Ex: Rabbit likes carrots, is represented
domain of discourse. They are as
denoted by numbers, words and • LIKES(rabit, carrots) Here LIKES is a
small letter. predicate that links two atoms “rabbit“ and
“carrots“
• Variables: variables are terms • Functions: it is also possible to have a
that can assume different values function as an argument, e.g.
over a given domain. “Ajay’s father is Vijay’s father” is represented
as:
• FATHER(father(Ajay), Vijay)
• Here FATHER is a predicate and father(Ajay)
is a function to indicate Ajay’s father
Amity School of Engineering & Technology

Syntax of FOPL
• Constants, variables, and functions are referred to as terms.
• Predicates are referred to as atomic formulas or atoms.
• When we want to refer to an atom or its negation, we often use the
word literal.
• In addition to above symbols, left and right parentheses , square
brackets, braces, and the period are used for punctuation in symbolic
representation.
Amity School of Engineering & Technology

Predicate logic
•  A predicate logic is a formal system that uses variables and quantifiers ( ∀ , ∃ , ∃ ! ) to formulate
propositions. The first of these, predicate logic, involves using standard forms of logical symbolism which
have been familiar to philosophers and mathematicians for many decades.
• propositions that can either be false or true. Those propositions can be combined
(∧,∨,⇒,⇔,¬∧,∨,⇒,⇔,¬ and more, but all others can be represented by those logical connectives).
• A predicate logic is a formal system that uses variables and quantifiers (∀∀, ∃∃, ∃!∃!) to formulate
propositions.
• SUBJECT: - The subject is that about which something is said.
•  PREDICATE:- The predicate is the part of the preposition which denotes that what is affirmed or denied
about the subject.
•  COPULA:- The copula is that part of the preposition which denotes the relations between the subject and
the predicate.
Amity School of Engineering & Technology

Predicate logic(cont..)
• As for example:
• MAN IS CULTURED
SUBJECT -> MAN
PREDICATE-> CULTURED
COPULA-> IS
• A predicate is a
function p:X→{true,false}p:X→{true,false} where XX is any set.
Amity School of Engineering & Technology

Few examples on Translating English to FOPL


i.Alice likes helicopters. Likes (Alice, helicopters)
ii.Ajay’s father is Vijay’s father. Father(father(ajay),vijay))
iii.Sachin is a man Man(sachin)
iv.Shyam likes apple. Likes(shyam,apple)
v.Rima is a girl. Girl(Rima)
vi.Lotus is white. White(Lotus)
vii.Paul owns diamond. Owns(Paul, diamond)
viii.Shyam is taller than Ram Taller(shyam, ram)
ix.My name is Vijay Name(Vijay)
x.Mango is fruit. Fruit(mango)
Amity School of Engineering & Technology

Few examples on Translating English to FOPL


xi.Ram is male. Male(ram)
xii.Tuna is fish. Fish(tuna)
xiii.Dashrath is ram‟s father. Father(dashrath,ram)
xiv.Kush is son of ram. Son(kush,ram)
xv.Kaushaliya is wife of Dashrath. Wife(kaushaliya,dashrath)
xvi.Clinton is tall. Tall(Clinton)
xvii.There is a white alligator. White(Alligator)
xviii.All kings are person. ∀x: Kings(x) → Person(x)
xix.Nobody loves john. ∀x: ¬Loves(x,john)
xx.Every one has a father. ∀x,Ǝy: Father(y,x)
Amity School of Engineering & Technology

Translating into Predicate Logic (Solution)


i. Marcus was a man. Man(marcus)
ii. Marcus was a Pompeian. Pompeian(marcus)
iii. All Pompeians were Romans. ∀x: Pompeian (x) → Roman(x)
iv. Caesar was a ruler. Ruler(caesar)
v. All Romans were either loyal to Caesar or hated him.
∀x: Roman(x) → LoyalTo(x,Caesar) V Hate(x,Caesar)
vi. Everyone is loyal to someone. ∀x,Ǝy: LoyalTo(x,y)
vii. People only try to assassinate rulers they aren't loyal to.
∀x, ∀y: Person(x) ɅRuler(y) ɅTryAssassinate(x,y) →¬LoyalTo(x,y)
viii. Marcus tried to assassinate Caesar.
TryAssassinate(Marcus, Caesar)
ix. All men are people. ∀x: Men(x) → People(x)
Amity School of Engineering & Technology

Translating into Predicate Logic


i.Hari likes all kind of food.
∀x: Food(x) → Likes(hari, x)
ii.Bananas are food. Food(bananas)
iii.Apples are food. Food(apples)
iv.Anything anyone eats and isn’t killed by food.
∀x:Ǝy: Eats(y,x) Ʌ ¬Killedby(y,x) → Food(x)
v.Hari eats everything ram eats.
∀x: eats(ram, x) → eats(hari, x)
Amity School of Engineering & Technology

Translating English to FOPL


Every gardener likes the sun.
(x) gardener(x) => likes(x,Sun)
Not Every gardener likes the sun.
~((x) gardener(x) => likes(x,Sun))
You can fool some of the people all of the time.
(x)(t) person(x) ^ time(t) => can-be-fooled(x,t)
You can fool all of the people some of the time.
(x)(t) person(x) ^ time(t) => can-be-fooled(x,t)
(the time people are fooled may be different)
You can fool all of the people at some time.
(t)(x) person(x) ^ time(t) => can-be-fooled(x,t)
(all people are fooled at the same time)
You can not fool all of the people all of the time.
~((x)(t) person(x) ^ time(t) => can-be-fooled(x,t))
Everyone is younger than his father
(x) person(x) => younger(x, father(x))
Amity School of Engineering & Technology

Translating English to FOPL


All purple mushrooms are poisonous.
(x) (mushroom(x) ^ purple(x)) => poisonous(x)
No purple mushroom is poisonous.
~(x) purple(x) ^ mushroom(x) ^ poisonous(x)
(x) (mushroom(x) ^ purple(x)) => ~poisonous(x)
There are exactly two purple mushrooms.
(x)(Ey) mushroom(x) ^ purple(x) ^ mushroom(y) ^ purple(y) ^
~(x=y) ^
(z) (mushroom(z) ^ purple(z)) => ((x=z) v (y=z))
Clinton is not tall.
~tall(Clinton)
X is above Y if X is directly on top of Y or there is a pile of one
or more other objects directly on top of one another starting
with X and ending with Y.
(x)(y) above(x,y) <=> (on(x,y) v (z) (on(x,z) ^ above(z,y)))
Amity School of Engineering & Technology

1. All birds fly.


Example
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)].
5. Only one student failed in Mathematics.
In this question, the predicate is "failed(x, y)," where x= student, and y= subject.
Since there is only one student who failed in Mathematics, so we will use following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y) → ¬failed (x, Mathematics)].
Example Amity School of Engineering & Technology

• “Every house is a physical object” is translated as


∀x.(house(x) → physical object(x)), • there are houses: ∃x.house(x)
where house and physical object are unary predicate symbols. • there are human beings: ∃x.human(x)
• “Some physical objects are houses”’ is translated as • no house is a human being:
∃x.(physical object(x) ∧ house(x)) ∀x.(house(x) → ¬human(x))
• ”Every house has an owner” or, equivalently, • some humans own a house:
“every house is owned by ∃x.∃y.(human(x) ∧ house(y) ∧ owns(x, y))
somebody” is translated as • Sue is human: human(Sue)
∀x(house(x) → ∃y.owns(y, x)), • Sue does not own a house:
here owns is a binary predicate symbol. ¬∃x.(owns(Sue, x) ∧ house(x))
• ”Everybody owns a house” is translated as • every house has an owner:
∀x.∃y.(owns(x, y) ∧ house(y)) ∀x.(house(x) → ∃y.owns(y, x))
• “Sue owns a house” is translated as
∃x.(owns(Sue, x) ∧ house(x))
where Sue is an individual constant symbol.
• “Peter does not own a house” is translated as
¬∃x.(owns(Peter, x) ∧ house(x))
• “Somebody does not own a house” is translated as
∃x.∀y.(owns(x, y) → ¬house(y))
Amity School of Engineering & Technology

Practice
Amity School of Engineering & Technology

Translating English to FOL


Build a small genealogy knowledge base by FOL that
contains facts of immediate family relations (spouses, parents, etc.)
contains definitions of more complex relations (ancestors, relatives)
is able to answer queries about relationships between people
Predicates:
parent(x, y), child (x, y), father(x, y), daughter(x, y), etc.
spouse(x, y), husband(x, y), wife(x,y)
ancestor(x, y), descendent(x, y)
relative(x, y)
Facts:
husband(Joe, Mary), son(Fred, Joe)
spouse(John, Nancy), male(John), son(Mark, Nancy)
father(Jack, Nancy), daughter(Linda, Jack)
daughter(Liz, Linda)
etc.
Amity School of Engineering & Technology

Horn clause 
Horn clause is a logical formula of a particular rule-like form which gives it useful
properties for use in logic programming, formal specification, and model theory.
Horn clauses are named for the logician Alfred Horn, 
A Horn clause is a clause (a disjunction of literals) with at most one positive, i.e. 
unnegated, literal.
Conversely, a disjunction of literals with at most one negated literal is called a dual-Horn
clause.
A Horn clause with exactly one positive literal is a definite clause; a definite clause with
no negative literals is sometimes called a fact; and a Horn clause without a positive literal
is sometimes called a goal clause
Amity School of Engineering & Technology

Horn Clause (Cont.…)


• In a horn clause, generally one condition is followed by zero, or more conditions. It is represented as
Conclusion…
Condition-1,
Condition-2,
Condition-3,
………
Condition-n,
• The conclusion is true if and only if condition-1, condition-2……and so on until condition–n is true.
• In simple and easy terms, a Horn clause consists of a set of statements joined by logical AND’s.
Amity School of Engineering & Technology

Horn clause Cont..


A Horn clause is either a definite clause or an integrity constraint. That is, a Horn clause has
either false or a normal atom as its head.
Integrity constraints allow the system to prove that some conjunction of atoms is false in all
models of a knowledge base - that is, to prove disjunctions of negations of atoms. Recall
 that ¬p is the negation of p, which is true in an interpretation when p is false in that
interpretation, and p∨q is the disjunction of p and q, which is true in an interpretation if p is
true or q is true or both are true in the interpretation.
Clausal Form
• A formula is said to be in clausal form if it is of the form:
∀x1 ∀x2 … ∀xn[C1 ∧ C2 ∧ … ∧ Ck].
• All first-order logic formulas can be converted to clausal form
Amity School of Engineering & Technology

Horn clause Cont..


Example : Consider the knowledge base KB1:
false←a∧b.
a←c.
b←c.
The atom c is false in all models of KB1. If c were true in model I of KB1, then a and b would both
betrue in I (otherwise I would not be a model of KB1). Because false is false in I and a and b are true in I, the
first clause is false in I, a contradiction to I being a model of KB1. Thus, c is false in all models of KB1. This is
expressed as
KB1   ¬c
Example :-
{~lawyer(x),rich(x)}
Every Horn clause can be written as an implication whose premise(base) is a conjunction of positive literals
and whose conclusion is a single positive literal. E.g. lawyer(x) Þ rich(x)
Amity School of Engineering & Technology

Equivalent Logical Expressions


i. ¬(¬F) = F (Double Negation)
ii. F Ʌ G = G Ʌ F, F V G = G V F (Commutativity)
iii. (F Ʌ G) Ʌ H = F Ʌ (G Ʌ H), (F V G) V H = F V (G V H) (Associativity)
iv. F V (G Ʌ H) = (F V G) & (F V H), F & (G V H) = (F & G) V (F & H)(Distributivity)
v. ¬(F Ʌ G) = ¬F V ¬G, ¬(F V G) = ¬F Ʌ ¬G (De Morgan)
vi. F → G = ~F V G
vii. F ↔ G = (~F V G) Ʌ (~G V F)
viii. ∀ x F[x] V G = ∀ x (F[x] V G )
ix. Ǝx F[x] V G = Ǝx (F[x] V G )
x. ∀x F[x] Ʌ G = ∀x (F[x] Ʌ G )
xi. Ǝx F[x] Ʌ G = Ǝx (F[x] Ʌ G )
xii. ¬(∀x) F[x] = Ǝx (~F[x])
xiii. ~(Ǝx) F[x] = ∀x (~F[x])
xiv. ∀x F[x] Ʌ ∀x G[x] = ∀x (F[x] Ʌ G[x])
xv. Ǝ x F[x] Ʌ Ǝ x G[x] = Ǝx (F[x] Ʌ G[x]
Amity School of Engineering & Technology

Resolution
Resolution is a rule of inference leading to a refutation theorem-proving technique for sentences in 
propositional logic and first-order logic. In other words, iteratively applying the resolution rule in a
suitable way allows for telling whether a propositional formula is satisfiable and for proving that a
first-order formula is unsatisfiable. Attempting to prove a satisfiable first-order formula as
unsatisfiable may result in a nonterminating computation; this problem doesn't occur in
propositional logic.
The resolution rule for first-order logic is simply a lifted version of the propositional rule.
Resolution can resolve two clauses if they contain complementary literals, which are assumed to be
standardized apart so that they share no variables.

Where li and mj are complementary literals.


Amity School of Engineering & Technology

Resolution Principle
• Given two clauses C1and C2 with no variables in common, if there is
aliteral l1, in C1
and which is a complement of a literal l2 in C2 , both l1 and l2 are deleted
and a disjuncted C is formed the remaining reduced clauses. The new
clauses C is called the resolve of C1
and C2
• Resolution is the process of generating these resolvents from the set of
clauses.
• Example: (¬AVB) and (AVC)
We can write
BV
Amity School of Engineering & Technology

Example of Resolution
• Consider the following clauses:-
P:AV B V D
Q: ¬A V B V D
R: ¬B V D
Solution
P : A V B V D (Given in the problem)
Q : ~A V B V D (Given in the problem)
S : B V D (Resolvent of P and Q)
R : ~B V D (Given in the problem)
T : D (Resolvent of R and S)
Amity School of Engineering & Technology

Example :
Amity School of Engineering & Technology
Solution:
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Steps for Resolution


• Conversion of facts into first-order logic.
• Convert FOL statements into Conjunctive Normal Form
(CNF)
• Negate the statement which needs to prove (proof by
contradiction)
• Draw resolution graph (unification).
Amity School of Engineering & Technology

Algorithm to convert to clausal form/CNF


Amity School of Engineering & Technology

Algorithm to convert to clausal form/CNF


Amity School of Engineering & Technology

Algorithm to convert to clausal form/CNF


Amity School of Engineering & Technology

Example for resolution of Predicate logic.


Amity School of Engineering & Technology

Example:
• To better understand all the above steps, we will take an example
in which we will apply resolution.
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.

Prove by resolution that:


6.John likes peanuts.
Amity School of Engineering & Technology

Step-1: Conversion of Facts into FOL


In the first step we will convert all the given statements into its first order logic.
Amity School of Engineering & Technology
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 •Move negation (¬)inwards and rewrite
• ∀x ¬ food(x) V likes(John, x) • ∀x ¬ food(x) V likes(John, x)
• food(Apple) Λ food(vegetables) • food(Apple) Λ food(vegetables)
• ∀x ∀y ¬ [eats(x, y) Λ ¬ killed(x)] V food(y) • ∀x ∀y ¬ eats(x, y) V killed(x) V
• eats (Anil, Peanuts) Λ alive(Anil) food(y)
• ∀x ¬ eats(Anil, x) V eats(Harry, x) • eats (Anil, Peanuts) Λ alive(Anil)
• ∀x¬ [¬ killed(x) ] V alive(x) • ∀x ¬ eats(Anil, x) V eats(Harry, x)
• ∀x ¬ alive(x) V ¬ killed(x) • ∀x ¬killed(x) ] V alive(x)
• likes(John, Peanuts). • ∀x ¬ alive(x) V ¬ killed(x)
• likes(John, Peanuts).
Amity School of Engineering & Technology
Step-2: Conversion of FOL into CNF(Cont..)
•Rename variables or standardize variables
• ∀x ¬ food(x) V likes(John, x)
• food(Apple) Λ food(vegetables)
• ∀y ∀z ¬ eats(y, z) V killed(y) V food(z)
• eats (Anil, Peanuts) Λ alive(Anil)
• ∀w¬ eats(Anil, w) V eats(Harry, w)
• ∀g ¬killed(g) ] V alive(g)
• ∀k ¬ alive(k) V ¬ killed(k)
• 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.
Amity School of Engineering & Technology

Step-2: Conversion of FOL into CNF(Cont..)


•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.
• ¬ food(x) V likes(John, x)
• food(Apple)
• food(vegetables)
• ¬ eats(y, z) V killed(y) V food(z)
• eats (Anil, Peanuts)
• alive(Anil)
• ¬ eats(Anil, w) V eats(Harry, w)
• killed(g) V alive(g)
• ¬ alive(k) V ¬ killed(k)
• likes(John, Peanuts).
Note: Statements "food(Apple) Λ food(vegetables)" and "eats (Anil, Peanuts) Λ alive(Anil)"
can be written in two separate statements.
•Distribute conjunction ∧ over disjunction ¬.
This step will not make any change in this problem.
Amity School of Engineering & Technology

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: Hence the negation of the
conclusion has been proved as a
complete contradiction with the
given set of statements.
Amity School of Engineering & Technology

Explanation of Resolution graph:


•In the first step of resolution graph, ¬likes(John, Peanuts) , and likes(John, x) get resolved(canceled)
by substitution of {Peanuts/x}, and we are left with ¬ food(Peanuts)

•In the second step of the resolution graph, ¬ food(Peanuts) , and food(z) get resolved (canceled) by
substitution of { Peanuts/z}, and we are left with ¬ eats(y, Peanuts) V killed(y) .

•In the third step of the resolution graph, ¬ eats(y, Peanuts) and eats (Anil, Peanuts) get resolved by
substitution {Anil/y}, and we are left with Killed(Anil) .

•In the fourth step of the resolution graph, Killed(Anil) and ¬ killed(k) get resolve by


substitution {Anil/k}, and we are left with ¬ alive(Anil) .

•In the last step of the resolution graph ¬ alive(Anil) and alive(Anil) get resolved.


Amity School of Engineering & Technology

Questions
Amity School of Engineering & Technology
Example for resolution of Predicate logic.
Amity School of Engineering & Technology
Solution
Amity School of Engineering & Technology
Solution(Cont..)
Amity School of Engineering & Technology

Practice
Question: What do you understand by instance and is a relationship . Solve the
problem using predicate logic.
• Marcus was a man.
• Marcus was a pompean.
• Marcus was born in 40 A.D
• All men are mortal.
• All pompean died when the volcano erupted in 79 A.D
• No mortal lives longer than 50 years
• It is now 2004
• Alive means not dead
• If someone dies, then he is dead at all latter times and prove that Marcus is
died.
Amity School of Engineering & Technology
Functions and Predicates

Soln:
(1) man(Marcus
(2) Pompeian(Marcus)
(3) born(Marcus, 40)
(4) x man(x)  mortal(x)
(5) erupted(volcano, 79)
(6) x Pompeian(x)  died(x,79)
(7) x t1 t2 mortal(x)  born(x, t1)  gt(t2-t1, 150)  dead(x,t2)
(8) now = 2007
 alive(Marcus, now)
Amity School of Engineering & Technology
Functions and Predicates - Filling in the Blanks
(1) man(Marcus)
(2) Pompeian(Marcus)
(3) born(Marcus, 40)
(4) x man(x)  mortal(x)
(5) erupted(volcano, 79)
(6) x Pompeian(x)  died(x,79)
(7) x t2 t2 mortal(x)  born(x, t1)  gt(t2-t1, 150)  dead(x,t2)
(8) now = 2007
(9a) x t alive(x, t)  dead(x, t)
(9b) x t dead(x,t)  alive(x, t)
(10) x t2 t2 died(x, t1)  gt(t2, t1)  dead(x, t2)
 alive(Marcus, now)
Amity School of Engineering & Technology
Showing that Marcus is Not Alive
 alive(Marcus, now)
(9a) (Marcus/x) (now/t)
dead(Marcus, now)
(10)(Marcus/x)(now/t2) (7) (Marcus/x)(now/t2)

died(Marcus, t1) gt(now, t1) mortal(Marcus) born(Marcus, t1) gt(now-t1,150)

(5) (Marcus/x) (4) (Marcus/x) (3) (40/t1) subst


(79/t1)
Pompeian(Marcus) gt(now, 79) man(Marcus) born(Marcus, 40) gt(now-40,150)

(2) subst (1) subst

T gt(2004, 79) T T gt(2007-40,150)


eval eval

T T
Amity School of Engineering & Technology

Another Example of Resolution


Assume the following facts:
• i. Raman only likes easy courses.
• ii. Computer Science courses are hard.
• iii. All the courses in Arts Department are easy.
• iv. ART101 is a course in Arts”.
• Convert the above statements into appropriate wffs so that the
resolution can be performed to answer the question:
• “ what course would Raman like?”
Amity School of Engineering & Technology

Solution:
First we will convert it into FOPL (First order predicate logic)
i. Raman only likes easy courses.
∀ x: easy(x) → likes(raman,x)
ii. Computer Science courses are hard.
∀ x: computer science(x) → ¬easy(x)
iii. All the courses in Arts Department are easy.
∀ x: arts(x) → easy(x)
iv. ART101 is a course in Arts”.
arts(ART101)
The conclusion is encoded as likes(raman , x).
Amity School of Engineering & Technology

Solution conti...
First we put our premises in the clause form and the negation of
conclusion
to our set of clauses (we use numbers in parentheses to number the
clauses):
i. ¬easy(x) V likes(raman,x)
ii.¬computer science(x) V ¬easy(x)
iii.¬arts(x) V easy(x)
iv.arts(AR101)
v.¬likes(raman, x)
Amity School of Engineering & Technology

Solution conti... • A resolution proof may be obtained by the following


sequence of
Sno Clauses Note resolutions
1 ¬easy(x) V likes(raman,x) P • (6) 1&5 yields resolvent ¬easy(x).
• (7) 3&6 yields resolvent ¬humanities (x).
2 ¬computer science(x) V ¬easy(x) P• (8) 4&7 yields empty clause;
3 ¬arts(x) V easy(x) P the substitution x/ART101 is produced by the unification
algorithm whichsays that the only wff of the form
4 arts(AR101) P likes(raman,x) which follows from thepremises is
likes(raman, ART101).
5 ¬ likes(raman, x) P Thus, resolution gives
6 ¬easy(x) 1, 5 us a way tofind additional assumptions

7 ¬arts(x) 3, 6
8 NIL 4, 7; x=ART101
Amity School of Engineering & Technology

Exercise for Practice


• https://www.cs.utexas.edu/users/novak/reso.html
Amity School of Engineering & Technology

Semantic
Semantic Network Representation
networks are alternative of predicate logic for
knowledge representation.
In Semantic networks, we can represent our knowledge in the
form of graphical networks.
This network consists of nodes representing objects and arcs
which describe the relationship between those objects.
Semantic networks can categorize the object in different
forms and can also link those objects.
Semantic networks are easy to understand and can be easily
extended.
This representation consist of mainly two types of relations:
IS-A relation (Inheritance)
Kind-of-relation
Statements:
Jerry is a cat.
Jerry is a mammal
Jerry is owned by Priya.
Jerry is brown colored.
Amity School of Engineering & Technology

Semantic Network(Cont..)
• A semantic net (or semantic network) is a knowledge representation technique
 used for propositional information.
• So it is also called a propositional net. Semantic nets convey meaning. They are
two dimensional representations of knowledge.
• Mathematically a semantic net can be defined as a labelled directed graph.
• Semantic nets consist of nodes, links (edges) and link labels.
• In the semantic network diagram, nodes appear as circles or ellipses or
rectangles to represent objects such as physical objects, concepts or
situations.
• Links appear as arrows to express the relationships between objects, and link
labels specify particular relations.
• Relationships provide the basic structure for organizing knowledge. The objects
and relations involved need not be so concrete. As nodes are associated with other
nodes semantic nets are also referred to as associative nets.
Semantic Net Cont..
Amity School of Engineering & Technology

Semantic Network(Cont..)
• In this figure all the objects are within ovals and
connected using labelled arcs.
• Note that there is a link
between Jill and FemalePersons with
label MemberOf.
• Simlarly there is a MemberOf link
between Jack and MalePersons and SisterOf link
between Jill and Jack.
• The MemberOf link between Jill and
FemalePersons indicates that Jill belongs to the
category of female persons.
Amity School of Engineering & Technology
ADVANTAGES OF SEMANTIC NETS
• Semantic nets have the ability to represent default values for categories.
• In the above figure Jack has one leg while he is a person and all persons have two legs.
So persons have two legs has only default status which can be overridden by a specific
value.
• Semantic networks are a natural representation of knowledge.
• Semantic networks convey meaning in a transparent manner.
• These networks are simple and easily understandable.
Amity School of Engineering & Technology

DISADVANTAGE OF SEMANTIC NETS


• These types of representations are inadequate as they do not have any
equivalent quantifier, e.g., for all, for some, none, etc.
• Semantic networks do not have any standard definition for the link names.
• These networks are not intelligent and depend on the creator of the system.
• One of the drawbacks of semantic network is that the links between the
objects represent only binary relations. For example, the sentence
Run(ChennaiExpress, Chennai,Bangalore,Today) cannot be asserted directly.
Amity School of Engineering & Technology

EXAMPLE:
Amity School of Engineering & Technology

Standardisation of Network Relationships


• Semantic network
developed by Collins and
Quillian in their research on
human information storage
and response times (Harmon
and King, 1985)
Amity School of Engineering & Technology
Standardisation of Network Relationships
Semantic Network representation of
properties of snow and ice

E.g. What is common about ice and snow?


Amity School of Engineering & Technology

Exercises
• Try to represent the following two sentences into the appropriate semantic
network diagram:

• Isa (person, mammal)


• instance(Mike-Hall, person) all in one graph
• team(Mike-Hall, Cardiff

• John gave Mary the book


Amity School of Engineering & Technology

Solution 1
• isa(person, mammal), instance(Mike-Hall, person), team(Mike-Hall, Cardiff)

mammal

is_a

person has_part head

is_a

Mike Hall team Cardiff


Amity School of Engineering & Technology

Solution 2
• John gave Mary the book
Gave Book

Action Instance

John Event 1 Object Book_69


Agent

Patient

Mary
Amity School of Engineering & Technology

Limitations of Semantic Networks


John who cause where party

• The limitations of conventional semantic networks what


were studied extensively by a number of workers in AI.
• Many believe that the basic notion is a powerful one
trouble
and has to be complemented by, for example, logic to
improve the notion’s expressive power and robustness.
• Others believe that the notion of semantic networks
can be improved by incorporating reasoning used to
describe events.
• Binary relations are usually easy to represent, but some
times is difficult.
• E.g. try to represent the sentence:
• "John caused trouble to the party".
Amity School of Engineering & Technology

Limitations of Semantic Networks(Cont..)


• Other problematic statements. . .
• negation "John does not go fishing";
• disjunction "John eats pizza or fish and chips";

• Quantified statements are very hard for semantic nets. E.g.:


• "Every dog has bitten a postman"
• "Every dog has bitten every postman"
• Solution: Partitioned semantic networks can represent quantified statements.
Amity School of Engineering & Technology

Example of Semantic Nets:


• Tom is a cat.
• Tom caught a bird.
• Tom is owned by John.
• Tom is ginger in colour.
• Cats like cream.
• The cat sat on the mat.
• A cat is a mammal.
• A bird is an animal.
• All mammals are animals.
• Mammals have fur.
Amity School of Engineering & Technology

Example of Semantic Nets:


• Scooter is a two wheeler.
• Motor-bike is a two wheeler.
• Motor-bike is a moving-vehicle.
• Moving –vehicle has engine.
• Moving-vehicle has
electricalsystem.
• Moving-vehicle has fuel system
Amity School of Engineering & Technology

Example of Semantic Nets:


• Tweety and Sweety are birds
• Tweety has a red beak
• Sweety is Tweety‟s child
• A crow is a bird
• Birds can fly
• Sparrow is a bird.
• Sparrow has a wing.
Amity School of Engineering & Technology

Partitioned Semantic Networks


• Hendrix (1976 : 21-49, 1979 : 51-91) developed the so-called partitioned semantic network to
represent the difference between the description of an individual object or process and the
description of a set of objects.
• The set description involves quantification.
• Hendrix partitioned a semantic network whereby a semantic network, loosely speaking, can be
divided into one or more networks for the description of an individual.
• The central idea of partitioning is to allow groups, nodes and arcs to be bundled together into
units called spaces – fundamental entities in partitioned networks, on the same level as nodes and
arcs (Hendrix 1979:59).
• Every node and every arc of a network belongs to (or lies in/on) one or more spaces.
• Some spaces are used to encode 'background information' or generic relations; others are
used to deal with specifics called 'scratch' space.
Amity School of Engineering & Technology

Partitioned Nets
• A partitioned semantic net is a semantic net
which can be divided into one or more
networks for the description of an individual
network.
• The main idea of partitioning is to allow
groups, nodes, and arcs to be bundled
together into units called spaces, spaces are
the fundamental entities in partitioned
network on the same level as nodes and arcs.
• Every node and every arc of the network
belongs to one or more spaces.
• Some spaces are used to encode background
information or generic relations.
Amity School of Engineering & Technology

Partitioned Semantic Networks(Cont..)


• Suppose that we wish to make a specific statement about a dog,
Danny, who has bitten a postman, Peter:
• " Danny the dog bit Peter the postman“
• Hendrix’s Partitioned network would express this statement as an
ordinary semantic network:

S1

dog bite postman


is_a is_a is_a
agent patient
Danny B Peter
Amity School of Engineering & Technology

Partitioned Semantic Networks(Cont..)


• Suppose that we now want to look at the statement:
• "Every dog has bitten a postman"
• Hendrix partitioned semantic network now comprises two
partitions SA and S1. Node G is an instance of the special class
of general statements about the world comprising link statement,
form, and one universal quantifier

SA
General
Statement dog bite postman

is_a S1
is_a is_a is_a
form
G agent patient
 D B P
Amity School of Engineering & Technology

Partitioned Semantic Networks(Cont..)


• Suppose that we now want to look at the statement:
• "Every dog has bitten every postman"

SA
General
Statement dog bite postman

is_a S1
is_a is_a is_a
form
G agent patient
 D B P

Amity School of Engineering & Technology
Partitioned Semantic Networks(Cont..)
• Suppose that we now want to look at the statement:
• "Every dog in town has bitten the postman"

SA
dog
ako
General
Statement town dog bite postman
is_a S1
is_a is_a is_a
form
G agent patient
 D B P

NB: 'ako' = 'A Kind Of'


Amity School of Engineering & Technology

Partitioned Semantic Networks(Cont..)


• The partitioning of a semantic network renders them more
• logically adequate, in that one can distinguish between individuals and
sets of individuals,
• and indirectly more heuristically adequate by way of controlling the
search space by delineating semantic networks.
• Hendrix's partitioned semantic networks-oriented formalism has
been used in building natural language front-ends for data bases
and for programs to deduct information from databases.
Amity School of Engineering & Technology

Exercises
• Try to represent the following two sentences into the
appropriate semantic network diagram:

• "John believes that pizza is tasty"

• "Every student loves to party"


Amity School of Engineering & Technology

Solution 1: "John believes that pizza is tasty"


believes
is_a
John agent event

object
space
pizza tasty

is_a is_a
object has property
Amity School of Engineering & Technology

Solution 2: "Every student loves to party"


General
Statemen
t
is_a is_a
GS1 student party love

form
S1 is_a
form S2 is_a is_a
GS2 exists receiver
p1 l1
 s1 agent
Amity School of Engineering & Technology

Frame Representation
A frame is a record like structure which consists of a collection
of attributes and its values to describe an entity in the world.
Slots Filters
Frames are the AI data structure which divides knowledge into
substructures by representing stereotypes situations. It consists of a
collection of slots and slot values. These slots may be of any type Title Artificial Intelligence

and sizes. Slots have names and values which are called facets.
A frame is also known as slot-filter knowledge representation in
Genre Computer Science
artificial intelligence.
Frames – semantic net with properties
• Frame: a knowledge representation technique which attempts to Author Peter Norvig

organize concepts into a form which exploits interrelationships and


common beliefs Edition Third Edition

• A frame is similar to a record data structure or database record: Year 1996

Page 1152
Amity School of Engineering & Technology

Frame Representation(cont..)
• A frame is an artificial intelligence data structure used to divide knowledge into
substructures by representing "stereotyped situations." Frames are the primary data
structure used in artificial intelligence frame language.
• Frames are also an extensive part of knowledge representation and reasoning schemes.
Frames were originally derived from semantic networks and are therefore part of structure
based knowledge representations.
• According to Russell and Norvig's "Artificial Intelligence, A Modern Approach,"
structural representations assemble "...facts about particular object and event types and
arrange the types into a large taxonomic hierarchy analogous to a biological taxonomy.“
The frame contains information on how to use the frame, what to expect next, and what to do
when these expectations are not met. Some information in the frame is generally unchanged
while other information, stored in "terminals,” usually change. Different frames may share
the same terminals.
Amity School of Engineering & Technology

Frame
Three components of a frame
Representation(cont..)
•frame name
•attributes (slots)
•values (fillers: list of values, range,
string, etc.)
Each piece of information about a particular frame is held in a slot. The information can
contain:
•Facts or Data
 Values (called facets)
•Procedures (also called procedural attachments)
 IF-NEEDED : deferred evaluation
 IF-ADDED : updates linked information
•Default Values
 For Data
 For Procedures
Other Frames or Subframe
Amity School of Engineering & Technology

Frame Representation(cont..)
• Frames provide a convenient structure for representing objects that are typical to a
stereotypical situations.
• Frame is a type of schema used in many AI applications including vision and 
natural language processing.
• The situations to represent may be visual scenes, structure of complex physical objects, etc.
Frames are also useful for representing commonsense knowledge.
• As frames allow nodes to have structures they can be regarded as three-dimensional
representations of knowledge.
• A frame is similar to a record structure and corresponding to the fields and values are slots
and slot fillers. Basically it is a group of slots and fillers that defines a stereotypical object.
• A single frame is not much useful. Frame systems usually have collection of frames
connected to each other. Value of an attribute of one frame may be another frame.
Amity School of Engineering & Technology
Amity School of Engineering & Technology

Frame Representation(cont..)
A frame for a book is given below.
Slots Fillers
publisher Thomson
title Expert Systems
author Giarratano
edition Third
year 1998
pages 600

The above example is simple one but most of the frames are
complex. Moreover with filler slots and inheritance provided by
frames powerful knowledge representation systems can be built.
Frames can represent either generic or frame. Following is the
example for generic frame.
Amity School of Engineering & Technology

Example Mammal
subclass: Animal
warm_blooded: yes

Elephant
subclass: Mammal
* colour: grey
* size: large

Clyde
instance: Elephant
color: pink
owner: Fred
Amity School of Engineering & Technology

Components of a Frame Entity


Name - correspond to a node in a semantic net
Attributes or slots filled with particular values
E.G. in the frame for Clyde, instance is the name of a
slot, and elephant is the value of the slot.

• Names of slots correspond to the links in


semantic nets
•Values of slots correspond to nodes.
Hence each slot can be another frame.
Amity School of Engineering & Technology
Size:
Example instance: Slot
single_valued: yes
range: Size-set

Owner:
instance: Slot
single_valued: no
range: Person

Fred:
instance: Person
occupation: Elephant-
breeder
Amity School of Engineering & Technology

Class and instance frames

• (frame) instance: representing”


lowest-level” object; a single object
or entity
• (frame) class: describes different
frames (either instances or classes)
• every instance has an “is-a” link,
pointing to its class
• possibly more than one “is-a”
Amity School of Engineering & Technology

Inheritance Frame
Amity School of Engineering & Technology

Advantages of Frames
• Makes programming easier by grouping related knowledge
• Easily understood by non-developers
• Expressive power
• Easy to set up slots for new properties and relations
• Easy to include default information and detect missing values
Amity School of Engineering & Technology

Disadvantages of Frames
• No standards (slot-filler values)
• More of a general methodology than a specific representation:
• Frame for a class-room will be different for a professor and for a
maintenance worker
• No associated reasoning/inference mechanisms
Amity School of Engineering & Technology
Procedure Vs Declarative Knowledge
Procedure Knowledge Declarative Knowledge
•The procedural knowledge technique •Declarative knowledge is to
gives the complete satisfaction what know about something.
data is needed and how to get it. •It includes concepts, facts, and
• Hence procedural knowledge objects.
specifies what to do when. •It is also called descriptive
•Procedural knowledge represented in knowledge and expressed in
program in many ways. declarative sentences.
• The procedural knowledge •It is simpler than procedural
technique gives the complete language.
satisfaction what data is needed and
how to get it.
Amity School of Engineering & Technology

Procedure Vs Declarative Knowledge


Amity School of Engineering & Technology

Procedure Vs Declarative Knowledge


Amity School of Engineering & Technology

Procedure Vs Declarative Knowledge


Amity School of Engineering & Technology

Reasoning
• Reasoning is the ability to assess things rationally by applying logic based on new or existing
information when making a decision or solving a problem.
• Reasoning allows you to weigh the benefits and disadvantages of two or more courses of action
before choosing the one with the most benefit or the one that suits your needs.
• Following types of reasoning :
1. Deductive reasoning
2. Inductive reasoning
3. Analogical reasoning
4. Abductive reasoning
5. Cause-and-effect reasoning
6. Critical thinking
7. De-compositional reasoning
Amity School of Engineering & Technology

Forwards vs Backwards Reasoning


•Whether you use forward or backwards reasoning to solve a problem depends on the properties
of your rule set and initial facts.

•Sometimes, if you have some particular goal (to test some hypothesis), then backward chaining
will be much more efficient.

•However, sometimes backward chaining can be very wasteful - there may be many possible ways
of trying to prove something, and you may have to try almost all of them before you find one that
works.
•Forward chaining may be better if you have lots of things you want to prove when you have a
small set of initial facts.

• Backward chaining may be better if you are trying to prove a single fact, given a large set of
initial facts.
Amity School of Engineering & Technology

Forwards vs Backwards Reasoning(Cont..)


• A search procedure must find a path between initial and goal states. There are two directions in
which a search process could proceed.
(1) Reason forward from the initial states:
• Being form the root of the search tree. General the next level of the tree by finding all the rules
whose left sides match the root node, and use their right sides to generate the siblings. Repeat the
process until a configuration that matches the goal state is generated.
(2) Reason forward from the goal state(s):
• Begin building a search tree starting with the goal configuration(s) at the root. Generate the next
level of the tree by finding all the rules whose right sides match with the root node. Use the left
sides of the rules to generate the new nodes. Continue until a node that matches the start state is
generated.
• Selection of forward reasoning or backward reasoning depends on which direction offers less
branching factor and justifies its reasoning process to the user. Most of the search techniques can be
used to search either forward or backward.
Amity School of Engineering & Technology
Forwards vs Backwards Reasoning(Cont..)
Amity School of Engineering & Technology

Consider the Example


i. Marcus was a man. Man(marcus)
ii. Marcus was a Pompeian. Pompeian(marcus)
iii. All Pompeians were Romans. ∀ x: Pompeian (x)
→ Roman(x)
iv. Caesar was a ruler. Ruler(caesar)
v. All Romans were either loyal to Caesar or hated him.
∀ x: Roman(x) → LoyalTo(x,Caesar) V Hate(x,Caesar)
vi. Everyone is loyal to someone. ∀ x,Ǝy: LoyalTo(x,y)
vii. People only try to assassinate rulers they aren't loyal to.
∀ x, ∀ y: Person(x) ɅRuler(y) ɅTryAssassinate(x,y)
→¬LoyalTo(x,y)
viii. Marcus tried to assassinate Caesar.
TryAssassinate(Marcus, Caesar)
ix. All men are people. ∀ x: Men(x) → People(x)
Amity School of Engineering & Technology
Deductive vs Inductive reasoning
Amity School of Engineering & Technology

You might also like