0% found this document useful (0 votes)
11 views

AI Unit 2 with assignment 2

Knowledge representation and reasoning (KR, KRR) in AI focuses on how agents think and utilize knowledge to solve real-world problems. It encompasses various types of knowledge such as declarative, procedural, and meta-knowledge, and addresses issues like local optima in algorithms like hill climbing. The document also discusses the importance of logical frameworks, instance representation, and symbolic reasoning in AI.

Uploaded by

Harpreet Kaur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

AI Unit 2 with assignment 2

Knowledge representation and reasoning (KR, KRR) in AI focuses on how agents think and utilize knowledge to solve real-world problems. It encompasses various types of knowledge such as declarative, procedural, and meta-knowledge, and addresses issues like local optima in algorithms like hill climbing. The document also discusses the importance of logical frameworks, instance representation, and symbolic reasoning in AI.

Uploaded by

Harpreet Kaur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

KNOWLEDGE REPRESENTATION

UNIT 2
• Humans are best at understanding, reasoning, and interpreting
knowledge.
• Human knows things, which is knowledge and as per their
knowledge they perform various actions in the real world.
• Knowledge representation and reasoning (KR, KRR) is the part of Artificial
intelligence which concerned with AI agents thinking and how thinking contributes to
intelligent behavior of agents.
• 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.
• It is also a way which describes how we can represent knowledge in artificial
intelligence. Knowledge representation is not just storing data into some database,
but it also enables an intelligent machine to learn from that knowledge and
experiences so that it can behave intelligently like a human.
WHAT TO REPRESENT
• Object: All the facts about objects in our world domain. E.g., Guitars contains strings,
trumpets are brass instruments.
• Events: Events are the actions which occur in our world.
• Performance: It describe behavior which involves knowledge about how to do things.
• Meta-knowledge: It is knowledge about what we know.
• Facts: Facts are the truths about the real world and what we represent.
• Knowledge-Base: The central component of the knowledge-based agents is the
knowledge base. It is represented as KB. The Knowledgebase is a group of the
Sentences (Here, sentences are used as a technical term and not identical with the
English language).
1. Declarative Knowledge:
• Declarative knowledge is to know about something.
• It includes concepts, facts, and objects.
• It is also called descriptive knowledge and expressed in declarativesentences.
• 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.
3. 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.
ISSUES IN KNOWLEDGE REPRESENTATION
The fundamental goal of knowledge Representation is to facilitate inference
(conclusions) from knowledge.
• The issues that arise while using KR techniques are many. Some of these are
Important Attributed:
• Any attribute of objects so basic that they occur in almost every problem
domain
Relationship among attributes:
• Any important relationship that exists among object attributed,The attributes
we use to describe objects
Choosing Granularity(The level of detail at which data is stored ):
• At what level of detail should the knowledge be represented
Set of objects:
• How should sets of objects be represented
Finding Right structure:
• Given a large amount of knowledge stored in a database, how can relevant parts
are accessed when they are needed
HILL CLMBING ALGORITHM
Hill climbing is a heuristic search algorithm used to solve optimization problems. It is often
employed in problems where the goal is to maximize or minimize an objective function.
• how the hill climbing algorithm is applied in AI:
• Initialize: Start with an initial solution. This could be a randomly generated solution or a
predefined one.
• Evaluate: Evaluate the current solution by calculating the value of the objective function.
• Generate neighbors: Generate neighboring solutions by making small changes
(mutations) to the current solution. These changes can include adding or removing
elements, modifying values, or other operations depending on the problem.
• Select the best neighbor: Among the generated neighbors, select the one that
optimizes (minimizes or maximizes) the objective function the most.
• Update: If the best neighbor improves the current solution, move to that neighbor and
update the current solution to be the best neighbor. Otherwise, stop the algorithm.
• Repeat: Repeat steps 2-5 until a stopping criterion is met, such as reaching a
maximum number of iterations or no significant improvement in the objective function
value.
LIMITATIONS
• Local Optima: One of the main limitations of hill climbing is that it tends to get stuck in local
optima. If the search space is rugged or contains multiple peaks, the algorithm may converge to
a suboptimal solution without exploring other potentially better solutions.
• Plateaus: In plateau regions of the search space where the objective function remains constant
over a large area, hill climbing can struggle to make progress. It may get stuck moving back
and forth between neighboring solutions without making significant improvements.
• Greedy Approach: Hill climbing is a greedy algorithm, meaning it only considers immediate
improvements in the objective function without considering the long-term consequences. This can
lead to suboptimal solutions, especially in problems where a series of non-optimal moves are
required to reach the global optimum.
• Initial Solution Dependency: The performance of hill climbing can be highly dependent on the
initial solution. If the initial solution is far from the global optimum, the algorithm may fail to
find the best solution, even if it exists within the search space.
• Limited Exploration: Hill climbing focuses on exploring solutions that are close to the current
solution. This limited exploration can prevent the algorithm from discovering diverse regions of
the search space that may contain better solutions.
• No Memory: Hill climbing does not have memory of past moves or solutions. This means that it
can repeat the same or similar moves, even if they do not lead to improvements, wasting
computational resources.
• Constraint Handling: Hill climbing does not handle constraints well. If the search space contains
constraints, such as boundary limits or logical constraints, hill climbing may violate these
constraints while searching for solutions.
• Slow Convergence: In some cases, hill climbing can converge slowly to an optimal solution,
especially in high-dimensional search spaces where the number of possible solutions is large.
MAPPING

• Mapping in knowledge representation in AI is a two-way link between facts


and representations. This link is called a representation mapping. A forward
representation mapping maps facts to representations, while a backward
representation mapping goes the other way,
• Knowledge maps provide a visual representation of thoughts or ideas that can
be challenging to communicate. This makes it easier for teams to share
information so that they can spend more time focusing on solutions
FRAME PROBLEM

Frames are data structures used in artificial intelligence to organize knowledge into
categories. A frame contains slots that describe aspects of the category, with default
values that can be overridden.
A problem known as the frame problem within artificial intelligence concerns the
application of knowledge about the past to draw inferences (guess or opinion that's
formed because of known facts or evidence ) about the future.
In artificial intelligence (AI), inference is the process of using logical rules to analyze
new information.
The Frame problem can lead to several issues that can impact the effectiveness of an AI
system. Some of these problems are:
• The Qualification Problem: The inability to produce accurate truths about the present
environment is the Representational Problem
• The Inferential Problem: Difficulty with examining the methods by which the world is
judged is the Inferential Problem
• The Ramification Problem: This problem explains how behavior might lead to changes in
the surroundings.
• The Predictive Problem: The Predictive Problem deals with the benefits of predictions.
That is, it is uncertain if a given prediction will cause a positive change in the environment.
If the change will not be positive, "either the laws or description of the given situation must
be imperfect
PREDICATE LOGIC

• Predicate logic in AI is mainly used as a foundational framework for


representation of knowledge and reasoning. First-order
logic(Predicate logic) is another way of knowledge representation in
artificial intelligence and is sufficiently expressive to represent the
natural language statements in a concise way
• develops information about the objects in a more easy way and can
also express the relationship between those objects.
• In predicate logic, we have the following components:
• Variables: Symbols (often denoted by lowercase letters) that represent objects or elements in
a domain.
• Constants: Specific objects in the domain (e.g., individuals, numbers).
• Predicates: Expressions that assert properties or relations between objects. Predicates can be
unary (apply to one object) or n-ary (apply to n objects).
• Quantifiers: Symbols that indicate the extent of the variables in a statement. The two main
quantifiers are the existential quantifier (∃, "there exists") and the universal quantifier (∀,
"for all").
• Connectives: Logical operators such as ∧ (conjunction), ∨ (disjunction), → (implication), and ¬
(negation) that combine statements.
• Functions: Symbols that represent operations on objects, returning another object as a result.
• Predicate logic allows us to formalize statements such as "For all x, if x is a
human, then x is mortal" as ∀x (Human(x) → Mortal(x)), where
Human(x) and Mortal(x) are predicates representing the properties of being
human and mortal, respectively.
• Predicate logic is more expressive than propositional logic because it allows us to
quantify over objects and make statements about classes of objects. It is widely used
in various fields, including artificial intelligence
CONVERTING A LOGICAL STATEMENT INTO
CONJUNCTIVE NORMAL FORM (CNF) AND DRAWING A
RESOLUTION TREE
• Convert to Negation Normal Form (NNF): Start by converting the logical
statement to Negation Normal Form (NNF), which eliminates all negations
inside the statement.
• Convert to CNF:
• Use the distributive law to move disjunctions (∨) inside conjunctions (∧).
• Use De Morgan's laws to eliminate negations.
• Ensure that the statement is in CNF, where each clause is a conjunction of literals, and the
whole statement is a disjunction of these clauses.
Draw Resolution Tree:
• Represent each clause in the CNF as a node in the resolution tree.
• Use resolution inference rules to derive new clauses until either the empty
clause (representing a contradiction) is derived or no further resolutions are
possible.
EXAMPLE
• Logical statement: (A ∧ B) → (C ∨ ¬D)
• Convert to NNF:
• Apply implication elimination: ¬(A ∧ B) ∨ (C ∨ ¬D)
• Apply De Morgan's laws: (¬A ∨ ¬B) ∨ (C ∨ ¬D)

• Convert to CNF:
• Distribute disjunctions: (¬A ∨ ¬B ∨ C) ∨ (¬A ∨ ¬B ∨ ¬D)

• Draw Resolution Tree:


• Start with initial clauses: (¬A ∨ ¬B ∨ C) and (¬A ∨ ¬B ∨ ¬D)
• Apply resolution rule to derive new clauses:
• Resolve on ¬A: (¬B ∨ C) and (¬B ∨ ¬D)
• Resolve on ¬B: (C) and (¬D)
• No further resolutions are possible, so the tree is complete.
FACTS IN LOGIC

logic serves as "the compass steering the ship of AI development". It provides a


robust framework to define rules, constraints, and relationships within a system.
This structured approach is necessary, especially in scenarios where clear
decision paths are vital.
INSTANCE

In artificial intelligence (AI), an instance is a specific example or case used to


train machine learning models. This could be a particular set of input data
along with its corresponding output or classification.

Two attributes isa and instance play an important role in many aspects
of knowledge representation. The reason for this is that they support property
inheritance. isa-- used to show class inclusion, e.g.isa(mega_star,rich). instance--
used to show class membership, e.g.instance(prince,mega_star).
• Class inclusion refers to the ability to classify objects into two or more
categories simultaneously. For example, the ability to recognise that large
categories such as 'cars' includes smaller sub-categories such as 'blue cars' or
'red cars' or different manufacturers.
• the term "class membership" refers to the categorization or labeling of an
instance, object, or data point as belonging to a specific class or category
within a predefined set of classes. Classes represent the outcomes or
categories that an algorithm tries to predict or classify instances into, based
on the features or attributes of those instances. Class membership is crucial in
classification problems, where the goal is to accurately assign instances to one
of several classes based on their attributes.
• Representing instances and "is-a" relationships effectively allows AI systems to
model the real world more accurately, perform logical reasoning, and infer
new knowledge based on the hierarchical structure of information.
Instance Representation
• An instance represents a specific example or occurrence of a concept or
class. It is an individual entity characterized by properties and values that
distinguish it from other instances. In AI, instances are represented in various
ways depending on the context and the data model being used
"Is-A" Relationship Representation
• The "is-a" relationship is a fundamental hierarchical relationship that
represents inheritance or subclassing in knowledge representation. It signifies
that an entity (the subclass or instance) is a specific type of another entity (the
superclass or category). This relationship is crucial for organizing knowledge in
a hierarchy, allowing for inheritance of properties and facilitating reasoning
about categories and instances.
RESOLUTION
• resolution is a fundamental rule of inference that allows for
deriving conclusions from a set of logical sentences. It is
primarily used in propositional logic and first-order logic.
Resolution plays a crucial role in theorem proving, automated
deduction systems, and certain algorithms in AI that require
logical reasoning capabilities.
• resolution is a powerful method in AI for deriving conclusions
from logical statements, with broad applications across
different domains of AI, from theorem proving to natural
Uses of Resolution in AI
• Resolution is widely used in AI for various purposes:
• Automated Theorem Proving: It's a core technique in software that aims to prove or
disprove logical statements automatically.
• Knowledge Representation and Reasoning: Resolution helps in inferring new knowledge
from existing facts and rules within a knowledge base.
• Logic Programming: Languages like Prolog rely on resolution as their primary mechanism
for query processing and solving logical queries.
• Natural Language Processing (NLP): Resolution can be involved in understanding and
generating natural language by applying logical inference to natural language statements.
PROCEDURAL KNOWLEDGE

• Procedural or imperative knowledge clarifies how to perform a certain task.


It lays down the steps to perform. Thus, the procedural knowledge provides
the essential control information required to implement the knowledge.
Declarative Knowledge?
• Declarative or functional knowledge clarifies what to do to perform a certain task.
It lays down the function to perform. Thus, in the declarative knowledge, only the
knowledge is provided but not the control information to implement the knowledge.
Thus, in order to use the declarative knowledge, we have to add the declarative
knowledge with a program which provides the control information.

MATCHING

• Matching is the process of comparing two or more structures to discover their


likenesses or differences. The structures may represent a wide range of
objects including physical entities, words or phrases in some language,
complete classes of things, general concepts, relations between complex
entities, and the like. The representations will be given in one or more of the
formalisms like FOPL, networks, or some other scheme, and matching will
involve comparing the component parts of such structures.
• Matching is used in a variety of programs for different reasons. It may serve
to control the sequence of operations, to identify or classify objects, to
determine the best of a number of different alternatives, or to retrieve items
from a database. It is an essential operation such diverse programs as speech
recognition, natural language understanding, vision, learning, automated
reasoning, planning, automatic programming, and expert systems, as well as
many others.
CONTROL KNOWLEDGE

Control knowledge is a declarative component of a module that's responsible


for several activities. These activities include: meta-reasoning, order in
evaluation of facts and rules, determination of which rules to use, and other
control tasks
meta-reasoning is reasoning about reasoning, which means making intelligent
decisions about how to think
SYMBOLIC REASONING UNDER UNCERTAINTY

• Symbolic reasoning under uncertainty in artificial intelligence (AI) is a


technique for solving problems with incomplete and uncertain models
• Symbolic reasoning under uncertainty in AI refers to the process of using symbolic logic,
which involves symbols representing various elements of a problem, to make decisions or
draw conclusions when there is uncertainty or incomplete information. This approach is
often used in areas such as expert systems, where rules and logic are used to make
decisions based on uncertain or incomplete information.
• In symbolic reasoning under uncertainty, techniques such as probabilistic logic or fuzzy
logic may be used to represent and reason with uncertain information. These techniques
allow AI systems to handle uncertainty in a structured and logical manner, enabling them
to make informed decisions even when complete information is not available.
REASONING:

• The reasoning is the mental process of deriving logical conclusion


and making predictions from available knowledge, facts, and
beliefs. Or we can say, "Reasoning is a way to infer facts from
existing data." It is a general process of thinking rationally, to find
valid conclusions.
NON-MONOTONIC REASONING

Monotonic means something that does not vary or


change.
Non-Monotonic means something which can vary
according to the situation or condition.
MONOTONIC REASONING

• Monotonic Reasoning is the process that does not change its direction or can say that
it moves in the one direction.
• Monotonic Reasoning will move in the same direction continuously means it will either
move in increasing order or decrease.
• But since Monotonic Reasoning depends on knowledge and facts, It will only increase
and will never decrease in this reasoning.
• Example:
• Sun rises in the East and sets in the West.
NON-MONOTONIC REASONING
• Non-monotonic Reasoning is the process that changes its direction or values as the
knowledge base increases.
• It is also known as NMR in Artificial Intelligence.
• Non-monotonic Reasoning will increase or decrease based on the condition.
• Since that Non-monotonic Reasoning depends on assumptions, It will change itself with
improving knowledge or facts.
• Example:
• Consider a bowl of water, If we put it on the stove and turn the flame on it will obviously boil hot and
as we will turn off the flame it will cool down gradually.
STATISTICAL REASONING

• Statistical reasoning in artificial intelligence (AI) involves using


statistical methods to analyze data, identify patterns, and make
predictions. AI systems use statistical reasoning to learn from data
and generalize knowledge
Statistical reasoning in AI typically involves the following steps:
• Data Collection: Gathering relevant data from various sources.
• Data Preprocessing: Cleaning, transforming, and preparing the data for analysis.
• Exploratory Data Analysis (EDA): Analyzing and visualizing the data to understand its
properties and relationships.
• Statistical Modeling: Building mathematical models that describe the relationships
within the data.
• Inference: Drawing conclusions or making predictions based on the statistical models
and the data.
• Evaluation: Assessing the performance of the models and the validity of the
conclusions.
• Statistical reasoning is essential in AI because it allows systems to learn from data, make
informed decisions, and deal with uncertainty and variability in real-world problems.
Some common applications include:
• Machine Learning: Statistical reasoning is at the core of machine learning algorithms. It
is used to train models on data, make predictions, and evaluate the performance of the
models.
• Natural Language Processing (NLP): In NLP, statistical reasoning is used for tasks such
as text classification, sentiment analysis, and machine translation. Statistical models help
in understanding the structure and meaning of language.
• Computer Vision: Statistical reasoning is used in computer vision for tasks such as object
detection, image classification, and image segmentation. Statistical models help in
recognizing patterns and objects in images.
• Healthcare: In healthcare, statistical reasoning is used for tasks such as disease diagnosis,
prognosis, and treatment planning. Statistical models help in analyzing medical data and
making informed decisions.
• Finance: In finance, statistical reasoning is used for tasks such as risk assessment, stock
price prediction, and fraud detection. Statistical models help in analyzing financial data
and making investment decisions.
• Marketing and Advertising: In marketing and advertising, statistical reasoning is used
for tasks such as customer segmentation, campaign optimization, and personalized
recommendations. Statistical models help in understanding customer behavior and
targeting the right audience.
ASSIGNMENT 2
1. Describe mapping in AI with some examples.
2. What are facts in logic.
3. Differentiate between procedural and declarative knowledge.
4. Elaborate control knowledge with some example.
5. Define statistical reasoning with the help of example.

You might also like