Professional Documents
Culture Documents
Manoj Mishra
Asst. Prof.
CSE Dept.
UCER, Prayagraj
What is AI ?
• Perception or Sensing
– Sensors and perception mechanisms
– Preprocessing and data acquisition
• Decision Making
– Decision-making process
– Action selection strategies
– Deliberation and reasoning
• Action Execution
– Actuators and effectors
– Motor control and execution of actions
Knowledge Representation
hate(Marcus, Caesar)
↑(5, substitution)
Roman(Marcus) ˄ ¬loyalto(Marcus, Caesar)
↑(3, substitution)
Pompeian(Marcus) ˄ ¬loyalto(Marcus, Caesar)
↑(2)
UNIT-3
KNOWLEDGE
REPRESENTATION
•It is responsible for representing information about the real world so that
a computer can understand and can utilize this knowledge to solve the
complex real world problems such as diagnosis a medical condition or
communicating with humans in natural language.
Object: All the facts about objects in our world domain. E.g., Guitars
contains strings, trumpets are brass instruments.
Declarative Knowledge:
•Declarative knowledge is to know about something.
•It includes concepts, facts, and objects.
•It is also called descriptive knowledge and expressed in declarative
sentences.
•It is simpler than procedural language.
2. 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.
4. Heuristic knowledge:
•Heuristic knowledge is representing knowledge of some experts in a filed
or subject.
•Heuristic knowledge is rules of thumb based on previous experiences,
awareness of approaches, and which are good to work but not guaranteed.
5. 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.
Approaches to knowledge representation:
•In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
•All classes should be arranged in a generalized form or a hierarchal manner. 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.
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.
man(Marcus)
∀x = man (x) ----------> mortal (x)s
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.
1. Representational Accuracy:
KR system should have the ability to represent all kind of required
knowledge.
2. Inferential Adequacy:
KR system should have ability to manipulate the representational
structures to produce new knowledge corresponding to existing
structure.
3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the
most productive directions by storing appropriate guides.
There are mainly four ways of knowledge representation which are given as
follows:
Logical Representation
Semantic Network Representation
Frame Representation
Production Rules
Fig: Knowledge representation Technique
Logical Representation
•Logical representation is a language with some concrete rules which
deals with propositions and has no ambiguity in representation.
•Logical representation means drawing a conclusion based on various
conditions.
•This representation lays down some important communication rules.
•It consists of precisely defined syntax and semantics which supports the
sound inference.
•Each sentence can be translated into logics using syntax and semantics.
Syntax:
•Syntaxes are the rules which decide how we can construct legal
sentences in the logic.
•It determines which symbol we can use in knowledge representation.
•How to write those symbols.
Semantics:
•Semantics are the rules by which we can interpret the sentence in the
logic.
•Semantic also involves assigning a meaning to each sentence.
Statements:
•Jerry is a cat.
•Jerry is a mammal
•Jerry is owned by Priya.
•Jerry is brown colored.
•All Mammals are animal.
In the above diagram, we have represented the different type of
knowledge in the form of nodes and arcs. Each object is
connected with another object by some relation.
Drawbacks in Semantic representation:
.
Advantages of Semantic network:
•Semantic networks are a natural representation of knowledge.
•Semantic networks convey meaning in a transparent manner.
•These networks are simple and easily understandable
Frame Representation
Frames are derived from semantic networks and later evolved into
our modern-day classes and objects. A single frame is not much
useful. Frames system consist of a collection of frames which are
connected. In the frame, knowledge about an object or event can
be stored together in the knowledge base. The frame is a type of
technology which is widely used in various applications including
Natural language processing and machine visions.
Advantages of frame representation:
•The frame knowledge representation makes the programming
easier by grouping the related data.
•The frame representation is comparably flexible and used by
many applications in AI.
•It is very easy to add slots for new attribute and relations.
•It is easy to include default data and to search for missing
values.
•Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
•In frame system inference mechanism is not be easily
processed.
•Inference mechanism cannot be smoothly proceeded by frame
representation.
•Frame representation has a much generalized approach.
Production Rules
•In production rules agent checks for the condition and if the
condition exists then production rule fires and corresponding
action is carried out.
• The condition part of the rule determines which rule may be
applied to a problem. And the action part carries out the
associated problem-solving steps.
•This complete process is called a recognize-act cycle.
First-order logic is also known as Predicate logic or First-order predicate logic (FOI).
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, wumpus, ......
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 &
Semantics
What is 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.
•Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a unifier such that, Ψ1𝜎 = Ψ2𝜎, then it can be
expressed as UNIFY(Ψ1, Ψ2).
•Example: Find the MGU 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.
•Substitution θ = {John/x} is a unifier for these atoms and applying this substitution,
and both expressions will be identical.
•The UNIFY algorithm is used for unification, which takes two atomic sentences and
returns a unifier for those sentences (If any exist).
•Unification is a key component of all first-order inference algorithms.
•It returns fail if the expressions do not match with each other.
•The substitution variables are called Most General Unifier or MGU.
•E.g. 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.
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].
Forward Chaining:
Forward chaining is a data-driven approach to reasoning and inference.
It starts with the available facts and uses rules and knowledge to
derive new conclusions until a desired goal or conclusion is reached.
Key Steps in Forward-Chaining:
Initialization: Start with an initial set of facts or data.
Rule Application: Apply rules and knowledge to derive new facts or
conclusions.
Conflict Resolution: If multiple rules can be applied, resolve conflicts
by selecting the most appropriate rule.
Update Knowledge Base: Add newly derived facts to the knowledge
base.
Repeat: Continue this process until the goal is achieved or no further
rules can be applied.
Example of Forward Chaining
In this case, forward chaining leads to the conclusion that the patient
should rest and drink fluids as a treatment for the viral infection.
Backward Chaining
2- Events
Events represent occurrences or happenings within a domain. In a financial
ontology, events might include "stock market crashes" or "economic recessions."
Events are usually related to the objects and concepts in the ontology.
3. Mental Events and Mental Objects
In some knowledge representations, mental events and mental objects are
included to account for cognitive and psychological aspects. Mental events can
include "thoughts" or "perceptions," while mental objects may be "beliefs" or
"emotions."
4. Reasoning Systems for Categories
Ontological engineering also involves the development of reasoning systems that
can manipulate and make inferences about categories within the ontology. These
reasoning systems rely on formal logic, rule-based reasoning, or probabilistic
methods to perform tasks such as classification, deduction, and query answering.
Default Information: