0% found this document useful (0 votes)
433 views176 pages

AI Slides 2025

The document outlines a course on Artificial Intelligence, covering modules on introduction, knowledge representation, learning, and advanced topics, with a total of 30 lecture hours. It discusses the foundations of AI, its history, capabilities, and various techniques such as search algorithms and heuristic methods. Additionally, it highlights the distinction between weak and strong AI, and the importance of problem-solving in AI development.

Uploaded by

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

AI Slides 2025

The document outlines a course on Artificial Intelligence, covering modules on introduction, knowledge representation, learning, and advanced topics, with a total of 30 lecture hours. It discusses the foundations of AI, its history, capabilities, and various techniques such as search algorithms and heuristic methods. Additionally, it highlights the distinction between weak and strong AI, and the importance of problem-solving in AI development.

Uploaded by

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

Artificial Intelligence

1
Course Content
Module 1. Introduction to Artificial Intelligence (Lecture 10 hours)
Module 1: Overview, Turing Test, Intelligent Agents, Problem solving: solving
problems by searching, Uninformed Search - Depth First Search, Breadth First
Search, DFID, Heuristic Search- Generate and test, Best First Search, Beam
Search, A* , Problem Reduction Search- AND/OR graphs, AO*, Constraint
satisfaction, Means-end analysis, Stochastic search methods- simulated
annealing, Particle Swarm Optimization, Game Playing- Minmax algorithm, alpha
beta pruning

Module 2. Knowledge Representations (Lecture 10 hours)

Module 3. Learning (Lecture 10 hours)

Module 4. Advanced Topics (Lecture 10 hours)


Class Time-Table

Tuesday - 12:00 - 13:00

Thursday - 10:00 - 11:00

Friday - 11:00 - 12:00

Total - 3 Lectures per week


Outline
1. Introduction
2. Problems and Search
3. Knowledge Representation
4. Advanced Topics

4
References
• A Modern Approach Artificial Intelligence
Russell, Norvig. Second Ed, Pearson Education.

• Artificial Intelligence (1991)


Elaine Rich & Kevin Knight, Second Ed, Tata McGraw Hill

5
Introduction
• What is AI?

• The foundations of AI

• A brief history of AI

• The state of the art

• Introductory problems

6
What is Artificial Intelligence (AI)?
• Intelligence: “ability to learn, understand and think” (Oxford dictionary)
• AI is the study of how to make computers make things which at the moment
people do better. (Already Implemented)
• AI : Simulation of human intelligence processes by machines specially computer
• Examples: Speech recognition, Smell, Face, Object, Intuition, Inference,
Learning new skills, Decision making, Abstract thinking
• John McCarthy coined the term Artificial Intelligence in 1956, known as father of
AI, also created LISP

7
Capabilities of AI
● Problem-solving
● Learning from experience
● Understanding natural language
● Recognizing images, speech, or patterns
● Making decisions autonomously
Examples of AI in Real Life
● Virtual assistants like Siri or Alexa
● Recommendation systems in Netflix and YouTube
● Self-driving cars
● Chatbots and customer service automation
● Medical diagnosis systems
● And What Not
Dimensions of AI

Thinking humanly Thinking rationally

Acting humanly Acting rationally

11
Dimensions of AI

Thinking humanly Thinking rationally


(Model Human Cognition) (Formalize the Inference Process)
Creating human thought process Replicate rational thought process

Acting humanly Acting rationally


(Doing the Right Thing) (Exhibit Human Behavior)
Turing Test

12
Thinking Humanly: Cognitive Modelling
● Cognitive modeling is an area of computer science that deals with simulating
human problem-solving and mental processing in a computerized model.

● Such a model can be used to simulate or predict human behavior or


performance on tasks similar to the ones modeled and improve
human-computer interaction.

13
Thinking Rationally: Laws of Thought
• Formalizing the inference process using logic

• Aristotle was one of the first to attempt to codify “right thinking”

• Formal logic provides a precise notation and rules for representing and
reasoning with all kinds of things in the world
○ Syllogism and pattern of arguments

• Idea of intelligent machine:


○ A machine that can perform logical inference

14
Thinking Humanly vs. Thinking Rationally

● Thinking Humanly: AI systems that simulate human thought


processes, often modeled after cognitive science or neuroscience.
○ Example: Cognitive AI systems like IBM Watson attempt to think
like a human by processing natural language and reasoning
logically.
● Thinking Rationally: AI that follows formal logic and reasoning to
make decisions that are logically correct, regardless of human-like
thought.
○ Example: Expert systems in medical diagnosis apply logical rules
to recommend treatments based on symptoms and medical data.
Acting Rationally
• Doing the right things
• Acting so as to achieve one’s goals, given one’s beliefs.

• Does not necessarily involve thinking (Bionic Reflexes)


○ Ex: Telling sorry on sneezing
○ Ex: Holding glasses with more pressure, if it is falling

16
Acting Humanly
• Exhibit human behavior
• Creating machines that perform functions that require intelligence, when same
tasks are performed by people
• Capabilities need to be incorporated in machine, so as to act like human
○ NLP
○ Robotics
○ Automated learning
○ Knowledge Representation
○ Machine Learning
○ Computer Vision

17
Acting Rationally vs. Acting Humanly
● Acting Humanly: AI systems that behave like humans, often
designed for natural interactions through speech, gestures, or facial
expressions.
○ Example: Chatbots like ChatGPT or virtual assistants like Siri engage in
conversations mimicking human communication.
● Acting Rationally: AI that acts to achieve the best possible outcome,
based on its goals and available data, even if it doesn't mimic human
behavior.
○ Example: Autonomous drones use AI to navigate efficiently and complete missions
like delivering packages without imitating human behavior.
Machines With True Intelligence
In 1950, Alan M. Turing published a landmark paper, in which he
speculated about the “Possibility of creating machine with true
intelligence”.

“Computing Machinery and Intelligence”


Intelligence is difficult to define, and devised Turing test

19
Turing Test or Imitation Game
• The first serious proposal in the philosophy of AI

Imitation Game
Human

Human Interrogator AI System


20
Turing Test…Cont….
• Turing (1950) "Computing machinery and intelligence":
• "Can machines think?" 🡪 "Can machines behave intelligently?"
• Operational test for intelligent behavior: the Imitation Game

• Predicted that by 2000, a machine might have a 30% chance of fooling a lay
person for 5 minutes
• Anticipated all major arguments against AI in following 50 years
• Suggested major components of AI: knowledge, reasoning, language
understanding, learning

21
The Foundations of AI
• Philosophy (423 BC − present):
− Logic, methods of reasoning.
− Mind as a physical system.
− Foundations of learning, language, and rationality.

• Mathematics (c.800 − present):


− Formal representation and proof.
− Algorithms, computation, decidability, tractability.
− Probability.

22
The Foundations of AI
• Psychology (1879 − present):
− Adaptation.
− Phenomena of perception and motor control.
− Experimental techniques.

• Linguistics (1957 − present):


− Knowledge representation.
− Grammar.

23
A Brief History of AI
• The gestation of AI (1943 − 1956):
− 1943: McCulloch & Pitts: Boolean circuit model of brain.
− 1950: Turing’s “Computing Machinery and Intelligence”.
− 1956: McCarthy’s name “Artificial Intelligence” adopted.

• Early enthusiasm, great expectations (1952 − 1969):


− Early successful AI programs: Samuel’s checkers,
Newell & Simon’s Logic Theorist, Gelernter’s Geometry
Theorem Prover.
− Robinson’s complete algorithm for logical reasoning.

24
A Brief History of AI
• A dose of reality (1966 − 1974):
− AI discovered computational complexity.
− Neural network research almost disappeared after
Minsky & Papert’s book in 1969.

• Knowledge-based systems (1969 − 1979):


− 1969: DENDRAL by Buchanan et al..
− 1976: MYCIN by Shortliffle.
− 1979: PROSPECTOR by Duda et al..

25
A Brief History of AI
• AI becomes an industry (1980 − 1988):
− Expert systems industry booms.
− 1981: Japan’s 10-year Fifth Generation project.

• The return of NNs and novel AI (1986 − present):


− Mid 80’s: Back-propagation learning algorithm reinvented.
− Expert systems industry busts.
− 1988: Resurgence of probability.
− 1988: Novel AI (ALife, GAs, Soft Computing, …).
− 1995: Agents everywhere.
− 2003: Human-level AI back on the agenda.

26
The Term Artificial Intelligence
John McCarthy is one of the founding fathers of AI, together with Marvin
Minsky, Allen Newell, and Herbert A. Simon
Weak Vs. Strong AI
● Weak AI: Building machines that act intelligently (without worrying,
actually intelligent)
● Strong AI: To develop a person
● The ultimate goal of AI is to build a person or more humbly an animal
● The goal of work in AI is to build machines that perform tasks normally
requiring human intelligence (Nilsson, Nils J.)
What is Involved(⅓)
● Interaction with the real world
○ Perceive, understand and act
● Reasoning and Planning
○ Modelling the external world
○ Planning and decision making
○ Deals with the unexpected problems and uncertainties
● Learning and adaptation
What is Involved(⅔)
● Philosophy
○ Logic, methods of reasoning, mind as physical system
● Mathematics
○ Formal representation and Proof theory
● Statistics and Probability
○ Modelling uncertainty, learning from data
● Economics
○ Utility, decision theory
What is Involved(3/3)
Neuroscience
Psychology/Cognitive Science
Computer Engineering
Control theory
Linguistics
Task Domains of AI
• Mundane Tasks:
– Perception
• Vision
• Speech
– Natural Languages
• Understanding
• Generation
• Translation
– Common sense reasoning
– Robot Control
• Formal Tasks
– Games : chess, checkers etc
– Mathematics: Geometry, logic,Proving properties of programs
• Expert Tasks:
– Engineering ( Design, Fault finding, Manufacturing planning)
– Scientific Analysis
– Medical Diagnosis
– Financial Analysis 32
AI Technique
• Intelligence requires Knowledge
• Knowledge posesses less desirable properties such as:
– Voluminous
– Hard to characterize accurately
– Constantly changing
– Differs from data that can be used
• AI technique is a method that exploits knowledge that should be represented in
such a way that:
– Knowledge captures generalization
– It can be understood by people who must provide it
– It can be easily modified to correct errors.
– It can be used in variety of situations

33
SEARCH
PROBLEMS
● To solve the problem of building a system you should take the following steps:
■ Define the problem accurately including detailed specifications and what constitutes a
suitable solution.
■ Scrutinize the problem carefully, for some features may have a central effect on the
chosen method of solution.
■ Segregate and represent the background knowledge needed in the solution of the
problem.
■ Choose the best solving techniques for the problem to solve a solution.

● Problem solving is a process of generating solutions from observed data.


○ a ‘problem’ is characterized by a set of goals,
○ a set of objects, and
○ a set of operations.
Problem Space and Search
A ‘problem space’ is an abstract space.
● A problem space encompasses all valid states that can be generated by the
application of any combination of operators on any combination of objects.
● The problem space may contain one or more solutions. A solution is a combination
of operations and objects that achieve the goals.

A ‘search’ refers to the search for a solution in a problem space.


● Search proceeds with different types of ‘search control strategies’.
● The depth-first search and breadth-first search are the two common search
strategies
DEFINING PROBLEM AS A STATE SPACE SEARCH

● A problem solving task can be formulated as a search in state space.


● A state space represents a problem in terms of states and operators that
change states.
● A state space consists of:
○ A representation of the states the system can be in. For example, in a
board game, the board represents the current state of the game.
○ A set of operators that can change one state into another state. In a board
game, the operators are the legal moves from any given state.
● Often the operators are represented as programs that change a state
representation to represent the new state.
○ An initial state.
○ A set of final states; some of these may be desirable, others undesirable.
This set is often represented implicitly by a program that detects terminal
states.
● Ex: 8-puzzle Game, chess
Formal Description of a Problem
● State Space: Define a state space that contains all possible
configurations of the relevant objects
● Initial State: One or more state, from where the problem solving can
start
● Goal State: One or more state, acceptable as solution to the problem
● Operators: Set of rules that describe actions (operators) available
Playing 8-puzzle
2 8 3 1 2 3

1 4 8 4

7 6 5 7 6 5

S: Initial state G: Goal state

Operators: Left, Right, Up, Down


Uninformed Search
● Blind search
● Use no information about the likely direction of the goal nodes
● Some arbitrary scheme is used
○ Breadth first search
○ Depth first search
○ Depth limited
○ Depth first iterative deepening
○ Uniform cost
○ bidirectional
Depth First Search

● Stack
● Expand deepest unexpanded node
● Last In First Out
● Put successors at front A

B C

D E F G
Properties
Complete: No, fails in infinite-depth space
Time: O(bm), m= maximum depth
Space: O(bm)
Optimal: No,may find a non-optimal goal first
Breadth First Search

● Expand shallowest unexpanded node


● Queque
● FIFO: New successor go at the end
● complete- always find solution in search space A
● optimal possible
B C

D E F G
Properties

● Complete: always reach goal, if no. of nodes are finite


● Time: O(bd), where b = no. of nodes, and d = maximum degree of a
node
● Space: O(bd)
● Optimal: Yes
Depth Limited Search

To avoid the infinite depth problem of DFS, we can decide to only search
until depth L.
What if, solution is deeper than L: Increase the L iteratively
Depth First Iterative Deepening
(DFID)
Properties
Complete: Yes
Time : O(bd)
Space: O(bd)
Optimal: Yes, if step cost=1, or increasing function of depth
Heuristic Search
● Heuristics : Greek word, means find or discover
● A study of methods and rules of discovery and invention
● Provides the ability to rank the children of a node
● Takes a state and returns a numeric value
● It is a function which defines how far a state is from goal
Generate and Test Search:

● Generate and Test Search is a heuristic search technique based on Depth


First Search with Backtracking which guarantees to find a solution if done
systematically and there exists a solution.

● In this technique, all the solutions are generated and tested for the best
solution.

● It ensures that the best solution is checked against all possible generated
solutions.
Algorithm :

1. Generate a possible solution. For example, generating a particular point in


the problem space or generating a path for a start state.
2. Test to see if this is a actual solution by comparing the chosen point or the
endpoint of the chosen path to the set of acceptable goal states
3. If a solution is found, quit. Otherwise go to Step 1
Properties of Good Generators:
The good generators need to have the following properties:

Complete: Good Generators need to be complete i.e. they should generate all the
possible solutions and cover all the possible states. In this way, we can guaranty our
algorithm to converge to the correct solution at some point in time.
Non Redundant: Good Generators should not yield a duplicate solution at any
point of time as it reduces the efficiency of algorithm thereby increasing the time of
search and making the time complexity exponential. In fact, it is often said that if
solutions appear several times in the depth-first search then it is better to modify the
procedure to traverse a graph rather than a tree.
Informed: Good Generators have the knowledge about the search space which they
maintain in the form of an array of knowledge. This can be used to search how far
the agent is from the goal, calculate the path cost and even find a way to reach the
goal.
Hill Climbing
● A simple optimization algorithm used in AI to find the best possible
solution for a given problem.
● a local search algorithm which continuously moves in the direction of
increasing elevation/value to find the peak of the mountain or best
solution to the problem.
● It terminates when it reaches a peak value where no neighbor has a
higher value
● Ex: Travelling Salesman Problem
● It is also called greedy local search as it only looks to its good
immediate neighbor state and not beyond that.
Features of Hill Climbing

Following are some main features of Hill Climbing Algorithm:

● Generate and Test variant: Hill Climbing is the variant of Generate


and Test method. The Generate and Test method produce feedback
which helps to decide which direction to move in the search space.
● Greedy approach: Hill-climbing algorithm search moves in the
direction which optimizes the cost.
● No backtracking: It does not backtrack the search space, as it does
not remember the previous states.
State-space Diagram for Hill Climbing
Hill Climbing

● On Y-axis we have taken the function which can be an objective


function or cost function, and state-space on the x-axis. If the function
on Y-axis is cost then, the goal of search is to find the global minimum
and local minimum.
● If the function of Y-axis is Objective function, then the goal of the
search is to find the global maximum and local maximum.
Hill Climbing
● Local Maximum: Local maximum is a state which is better than its
neighbor states, but there is also another state which is higher than it.

● Global Maximum: Global maximum is the best possible state of state


space landscape. It has the highest value of objective function.

● Current state: It is a state in a landscape diagram where an agent is


currently present.

● Flat local maximum: It is a flat space in the landscape where all the
neighbor states of current states have the same value.
Types of Hill Climbing Algorithm:

● Simple hill Climbing:


● Steepest-Ascent hill-climbing:
● Stochastic hill Climbing:
Simple Hill Climbing:
● Simple hill climbing is the simplest way to implement a hill climbing algorithm. It
only evaluates the neighbor node state at a time and selects the first one
which optimizes current cost and set it as a current state.

● It only checks it's one successor state, and if it finds better than the current
state, then move else be in the same state.

This algorithm has the following features:


● Less time consuming
● Less optimal solution and the solution is not guaranteed
Algorithm for Simple Hill Climbing:

Step 1: Evaluate the initial state, if it is goal state then return success and
Stop.
Step 2: Loop Until a solution is found or there is no new operator left to
apply.
Step 3: Select and apply an operator to the current state.
Step 4: Check new state:
If it is goal state, then return success and quit.
Else if it is better than the current state then assign new state as a current
state.
Else if not better than the current state, then return to step2.
Step 5: Exit.
Steepest-Ascent hill climbing:

● The steepest-Ascent algorithm is a variation of simple hill climbing algorithm.


This algorithm examines all the neighboring nodes of the current state and
selects one neighbor node which is closest to the goal state.
● This algorithm consumes more time as it searches for multiple neighbors
Algorithm for Steepest-Ascent hill climbing:
Step 1: Evaluate the initial state, if it is goal state then return success and stop,
else make current state as initial state.
Step 2: Loop until a solution is found or the current state does not change.
1) Let SUCC be a state such that any successor of the current state will be
better than it.
2) For each operator that applies to the current state:
A. Apply the new operator and generate a new state.
B. Evaluate the new state.
C. If it is goal state, then return it and quit, else compare it to the SUCC.
D. If it is better than SUCC, then set new state as SUCC.
E. If the SUCC is better than the current state, then set current state to
SUCC.
Step 5: Exit.
Stochastic hill climbing:
Stochastic hill climbing does not examine for all its neighbor before moving. Rather,
this search algorithm selects one neighbor node at random and decides whether to
choose it as a current state or examine another state.

Problems in Hill Climbing Algorithm:

1. Local Maximum: A local maximum is a peak state in the landscape which is


better than each of its neighboring states, but there is another state also present
which is higher than the local maximum.

Solution: Backtracking technique can be a solution of the local maximum in state space landscape. Create a
list of the promising path so that the algorithm can backtrack the search space and explore other paths as
well.
Plateau: A plateau is the flat area of the search space in which all the neighbor states
of the current state contains the same value, because of this algorithm does not find
any best direction to move. A hill-climbing search might be lost in the plateau area.

Solution: The solution for the plateau is to take big steps or very little steps while
searching, to solve the problem. Randomly select a state which is far away from the
current state so it is possible that the algorithm could find non-plateau region.
Ridges: A ridge is a special form of the local maximum. It has an area which is
higher than its surrounding areas, but itself has a slope, and cannot be reached in
a single move.

Solution: With the use of bidirectional search, or by moving in different directions,


we can improve this problem.
BEST FIRST SEARCH

● In Breadth First Search (BFS) and Depth First Search (DFS),


when we are at a node, we can consider any of the adjacent as
the next node. So both BFS and DFS blindly explore paths
without considering any cost function.
● The idea of Best First Search is to use an evaluation
function to decide which adjacent is most promising and
then explore.
● Best First Search falls under the category of Heuristic Search
or Informed Search.
BEST FIRST SEARCH
● Best First Search use an evaluation function to decide which among the
various available nodes is the most promising (or ‘BEST’) before
traversing to that node.
● It uses the concept of priority queue for storing the values of evaluation
function.
● To search the graph space, the best first search method uses two lists for
tracking the traversal.
○ An ‘Open’ list which keeps track of the current ‘immediate’ nodes
available for traversal and
○ A ‘CLOSED’ list that keeps track of the nodes already traversed.
ALGORITHM
1. Create 2 empty lists: OPEN and CLOSED

2. Start from the initial node (say N) and put it in the ‘ordered’ OPEN list

3. Repeat the next steps until GOAL node is reached

a. If OPEN list is empty, then EXIT the loop returning ‘False

b. Select the first/top node (say N) in the OPEN list and move it to the CLOSED list. Also

capture the information of the parent node

c. If N is a GOAL node, then move the node to the Closed list and exit the loop returning

‘True’. The solution can be found by backtracking the path

d. If N is not the GOAL node, expand node N to generate the ‘immediate’ next nodes linked to

node N and add all those to the OPEN list

e. Reorder the nodes in the OPEN list in ascending order according to an evaluation function

f(n)
Beam Search
● A heuristic search algorithm that examines a graph by extending the most
promising node in a limited set is known as beam search.
● The heuristic cost associated with the node is used to choose the best
nodes. The width of the beam search is denoted by W.
● Beam search is a heuristic search technique that always expands the W
number of the best nodes at each level. It progresses level by level and
moves downwards only from the best W nodes at each level.
● Beam Search constructs its search tree using breadth-first search. It
generates all the successors of the current level’s state at each level of the
tree. However, at each level, it only evaluates a W number of states. Other
nodes are not taken into account.
Beam Search cases
● When W = 1, the search becomes a hill-climbing search in which the best node
is always chosen from the successor nodes.
● No states are pruned if the beam width is unlimited, and the beam search is
identified as a breadth-first search.
● It takes care of space complexity
● The beamwidth bounds the amount of memory needed to complete the search,
but it comes at the cost of completeness and optimality (possibly that it will not
find the best solution).
Constraint Satisfaction Problems in Artificial Intelligence

1. We have seen so many techniques like Local search, Adversarial search to


solve different problems.
2. The objective of every problem-solving technique is one, i.e., to find a solution to
reach the goal.
3. Although, in adversarial search and local search, there were no constraints on
the agents while solving the problems and reaching to its solutions.
● Constraint satisfaction is a technique where a problem is solved when its
values satisfy certain constraints or rules of the problem.

● Such type of technique leads to a deeper understanding of the problem


structure as well as its complexity.

Constraint satisfaction depends on three components, namely:

X: It is a set of variables.
D: It is a set of domains where the variables reside. There is a specific domain for
each variable.
C: It is a set of constraints which are followed by the set of variables.
● In constraint satisfaction, domains are the spaces where the variables reside,
following the problem specific constraints.
● These are the three main elements of a constraint satisfaction technique. The
constraint value consists of a pair of {scope, rel}.
● The scope is a tuple of variables which participate in the constraint and rel is a
relation which includes a list of values which the variables can take to satisfy
the constraints of the problem.

Solving Constraint Satisfaction Problems
The requirements to solve a constraint satisfaction problem (CSP) is:
● A state-space
● The notion of the solution.

A state in state-space is defined by assigning values to some or all variables such


as
{X1=v1, X2=v2, and so on…}.
An assignment of values to a variable can be done in three ways:

● Consistent or Legal Assignment: An assignment which does not violate any


constraint or rule is called Consistent or legal assignment.
● Complete Assignment: An assignment where every variable is assigned with
a value, and the solution to the CSP remains consistent. Such assignment is
known as Complete assignment.
● Partial Assignment: An assignment which assigns values to some of the
variables only. Such type of assignments are called Partial assignments
Types of Domains in CSP

There are following two types of domains which are used by the variables :

● Discrete Domain: It is an infinite domain which can have one state for multiple variables. For example, a
start state can be allocated infinite times for each variable.
● Finite Domain: It is a finite domain which can have continuous states describing one domain for one
specific variable. It is also called a continuous domain.
Knowledge Representation

● 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.
● But how machines do all these things comes under knowledge
representation and reasoning.
● 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:

Following are the kind of knowledge which needs to be represented in AI


systems:

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).
Knowledge: Knowledge is awareness or familiarity gained by experiences of facts,
data, and situations. Following are the types of knowledge in artificial intelligence:
Types of knowledge

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 declarative
sentences.
● It is simpler than procedural language.
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.
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.
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.
Techniques of knowledge representation

There are mainly four ways of knowledge representation which are given as
follows:

● Logical Representation
● Semantic Network Representation
● Frame Representation
● Production Rules
1. 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.
Logical reasoning forms the basis for a huge domain of computer science and
mathematics. They help in establishing mathematical arguments, valid or invalid.

1. Propositional Logic :
● A proposition is basically a declarative sentence that has a truth value.
● Truth value can either be true or false, but it needs to be assigned any of the
two values and not be ambiguous.
● The purpose of using propositional logic is to analyze a statement, individually
or compositely.
For example :
The following statements :

If x is real, then x2 > 0


What is your name?
(a+b)2 = 100
This statement is false.
This statement is true

Are not propositions because they do not have a truth value. They are ambiguous.
But the following statements :

(a+b)2 = a2 + 2ab + b2
If x is real, then x2 >= 0
If x is real, then x2 < 0
The sun rises in the east.
The sun rises in the west.
Are all propositions because they have a specific truth value, true or false.

The branch of logic that deals with proposition is propositional logic.


Predicate Logic :
Predicates are properties, additional information to better express the subject of
the sentence. A quantified predicate is a proposition , that is, when you assign
values to a predicate with variables it can be made a proposition.

For example :
In P(x) : x>5, x is the subject or the variable and ‘>5’ is the predicate.

P(7) : 7>5 is a proposition where we are assigning values to the variable x, and it
has a truth value, i.e. True.

The set of values that the variables of the predicate can assume is called the
Universe or Domain of Discourse or Domain of Predicate.
Propositional logic is the logic that deals with a collection of declarative Predicate logic is an expression consisting of variables with a specified domain. It
statements which have a truth value, true or false. consists of objects, relations and functions between the objects.

It is the basic and most widely used logic. Also known as Boolean logic. It is an extension of propositional logic covering predicates and quantification.

A proposition has a specific truth value, either true or false. A predicate’s truth value depends on the variables’ value.

Predicate logic helps analyze the scope of the subject over the predicate. There are
Scope analysis is not done in propositional logic. three quantifiers : Universal Quantifier (∀) depicts for all, Existential Quantifier (∃)
depicting there exists some and Uniqueness Quantifier (∃!) depicting exactly one.

Propositions are combined with Logical Operators or Logical


Connectives like Negation(¬), Disjunction(∨), Conjunction(∧),
Predicate Logic adds by introducing quantifiers to the existing proposition.
Exclusive OR(⊕), Implication(⇒), Bi-Conditional or Double
Implication(⇔).

It is a more generalized representation. It is a more specialized representation.

It cannot deal with sets of entities. It can deal with set of entities with the help of quantifiers.
Predicate Logic

Predicate Logic deals with predicates, which are propositions, consist of variables.

Predicate Logic - Definition

A predicate is an expression of one or more variables determined on some specific


domain. A predicate with variables can be made a proposition by either authorizing
a value to the variable or by quantifying the variable.
Consider E(x, y) denote "x = y"
Consider X(a, b, c) denote "a + b + c = 0"
Consider M(x, y) denote "x is married to y."
Quantifier:
The variable of predicates is quantified by quantifiers. There are two types of
quantifier in predicate logic - Existential Quantifier and Universal Quantifier.

Existential Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∃x p(x) and read
as "There exists at least one value in the universe of variable x such that p(x) is true.
The quantifier ∃ is called the existential quantifier.

There are several ways to write a proposition, with an existential quantifier, i.e.,
(∃x∈A)p(x) or ∃x∈A such that p (x) or (∃x)p(x) or p(x) is true for
some x ∈A.
Universal Quantifier:

If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read
as "For every x∈U,p(x) is true." The quantifier ∀ is called the Universal
Quantifier.

There are several ways to write a proposition, with a universal quantifier.

∀x∈A,p(x) or p(x), ∀x ∈A Or ∀x,p(x) or p(x) is true for all x ∈A.


Negation of Quantified Propositions:

When we negate a quantified proposition, i.e., when a universally quantified


proposition is negated, we obtain an existentially quantified proposition,and when
an existentially quantified proposition is negated, we obtain a universally quantified
proposition.
The two rules for negation of quantified proposition are as follows. These are also
called DeMorgan's Law.

Example: Negate each of the following propositions:

1.∀x p(x)∧ ∃ y q(y)

Sol: ~.∀x p(x)∧ ∃ y q(y))


≅~∀ x p(x)∨∼∃yq (y) (∴∼(p∧q)=∼p∨∼q)
≅ ∃ x ~p(x)∨∀y∼q(y)
2 . (∃x∈U) (x+6=25)

~( ∃ x∈U) (x+6=25)
≅∀ x∈U~ (x+6)=25
≅(∀ x∈U) (x+6)≠25

3. ~( ∃ x p(x)∨∀ y q(y)

Sol: ~( ∃ x p(x)∨∀ y q(y))


≅~∃ x p(x)∧~∀ y q(y) (∴~(p∨q)= ∼p∧∼q)
≅ ∀ x ∼ p(x)∧∃y~q(y))
What is NLP?
● NLP stands for Natural Language Processing, which is a part of
Computer Science, Human language, and Artificial Intelligence.
● It is the technology that is used by machines to understand, analyse,
manipulate, and interpret human's languages.
● It helps developers to organize knowledge for performing tasks such
as translation, automatic summarization, Named Entity Recognition
(NER), speech recognition, relationship extraction, and topic
segmentation.
Advantages of NLP

● NLP helps users to ask questions about any subject and get a direct response within seconds.
● NLP offers exact answers to the question means it does not offer unnecessary and unwanted
information.
● NLP helps computers to communicate with humans in their languages.
● It is very time efficient.
● Most of the companies use NLP to improve the efficiency of documentation processes, accuracy of
documentation, and identify the information from large databases

Disadvantages of NLP
● A list of disadvantages of NLP is given below:
● NLP may not show context.
● NLP is unpredictable
● NLP may require more keystrokes.
● NLP is unable to adapt to the new domain, and it has a limited function that's why NLP is built for a
single and specific task only.
Components of NLP

There are the following two components of NLP:

1. Natural Language Understanding (NLU)

Natural Language Understanding (NLU) helps the machine to understand and analyse human
language by extracting the metadata from content such as concepts, entities, keywords,
emotion, relations, and semantic roles.

NLU mainly used in Business applications to understand the customer's problem in both
spoken and written language.
2. Natural Language Generation (NLG)

● Natural Language Generation (NLG) acts as a translator that converts the computerized data into
natural language representation. It mainly involves Text planning, Sentence planning, and Text
Realization.

NLU NLG

NLU is the process of reading and interpreting language. NLG is the process of writing or generating language.

It produces non-linguistic outputs from natural language It produces constructing natural language outputs from

inputs. non-linguistic inputs.


Applications of NLP

● Question Answering
● Spam Detection
Spam detection is used to detect unwanted e-mails getting to a user's inbox.
Sentiment Analysis
● Sentiment Analysis is also known as opinion mining. It is used on the web to analyse the
attitude, behaviour, and emotional state of the sender.
● This application is implemented through a combination of NLP (Natural Language Processing)
and statistics by assigning the values to the text (positive, negative, or natural), identify the
mood of the context (happy, sad, angry, etc.)
Machine Translation
Machine translation is used to translate text or speech from one natural language to another natural
language.

Spelling correction

Microsoft Corporation provides word processor software like MS-word, PowerPoint for the spelling
correction.

Speech Recognition

Speech recognition is used for converting spoken words into text. It is used in applications, such as
mobile, home automation, video recovery, dictating to Microsoft Word, voice biometrics, voice user
interface, and so on.

Chatbot

Implementing the Chatbot is one of the important applications of NLP. It is used by many companies
to provide the customer's chat services.
Information extraction

Information extraction is one of the most important applications of NLP. It is used for extracting
structured information from unstructured or semi-structured machine-readable documents.

Natural Language Understanding (NLU)

It converts a large set of text into more formal representations such as first-order logic
structures that are easier for the computer programs to manipulate notations of the natural
language processing.
Phases of NLP
There are the following five phases of NLP:
1. Lexical Analysis and Morphological

The first phase of NLP is the Lexical Analysis. This phase scans the source code as a stream
of characters and converts it into meaningful lexemes. It divides the whole text into
paragraphs, sentences, and words.

2. Syntactic Analysis (Parsing)

Syntactic Analysis is used to check grammar, word arrangements, and shows the relationship
among the words.

Example: Agra goes to the Poonam

In the real world, Agra goes to the Poonam, does not make any sense, so this sentence is
rejected by the Syntactic analyzer.
3. Semantic Analysis

Semantic analysis is concerned with the meaning representation. It mainly focuses on the
literal meaning of words, phrases, and sentences.

4. Discourse Integration

Discourse Integration depends upon the sentences that proceeds it and also invokes the
meaning of the sentences that follow it.

5. Pragmatic Analysis

Pragmatic is the fifth and last phase of NLP. It helps you to discover the intended effect by
applying a set of rules that characterize cooperative dialogues.
❖ Syntactic analysis or parsing or syntax analysis is the third phase of NLP.

❖ The purpose of this phase is to draw exact meaning, or you can say dictionary meaning from the text.

❖ Syntax analysis checks the text for meaningfulness comparing to the rules of formal grammar.

❖ For example, the sentence like “hot ice-cream” would be rejected by semantic analyzer.

❖ In this sense, syntactic analysis or parsing may be defined as the process of analyzing the strings of
symbols in natural language conforming to the rules of formal grammar.

❖ The origin of the word ‘parsing’ is from Latin word ‘pars’ which means ‘part’.
Concept of Parser

● It is used to implement the task of parsing. It may be defined as the software component
designed for taking input data (text) and giving structural representation of the input after
checking for correct syntax as per formal grammar.

● It also builds a data structure generally in the form of parse tree or abstract syntax tree or
other hierarchical structure.
The main roles of the parse include −

● To report any syntax error.


● To recover from commonly occurring error so that the processing of the
remainder of program can be continued.
● To create parse tree.
● To create symbol table.
● To produce intermediate representations (IR).

Types of Parsing
Derivation divides parsing into the followings two types −

● Top-down Parsing
● Bottom-up Parsing
Top-down Parsing

In this kind of parsing, the parser starts constructing the parse tree from the start symbol and
then tries to transform the start symbol to the input.

The most common form of top down parsing uses recursive procedure to process the input.
The main disadvantage of recursive descent parsing is backtracking.

Bottom-up Parsing

In this kind of parsing, the parser starts with the input symbol and tries to construct the parser
tree up to the start symbol.
Concept of Derivation

In order to get the input string, we need a sequence of production rules. Derivation is a set of
production rules. During parsing, we need to decide the non-terminal, which is to be replaced along
with deciding the production rule with the help of which the non-terminal will be replaced.

Types of Derivation

In this section, we will learn about the two types of derivations, which can be used to decide which
non-terminal to be replaced with production rule −
Left-most Derivation
In the left-most derivation, the sentential form of an input is scanned and replaced from the left to the
right. The sentential form in this case is called the left-sentential form.
Right-most Derivation
In the left-most derivation, the sentential form of an input is scanned and replaced from right to left.
The sentential form in this case is called the right-sentential form.
Semantic Analysis

● Semantic analysis is the process of finding the meaning from text.


● This analysis gives the power to computers to understand and interpret
sentences, paragraphs, or whole documents, by analyzing their grammatical
structure, and identifying the relationships between individual words of the
sentence in a particular context.
● Therefore, the goal of semantic analysis is to draw exact meaning or dictionary
meaning from the text. The work of a semantic analyzer is to check the text for
meaningfulness.
● Semantic analysis starts with lexical semantics, which studies individual words’
meanings (i.e., dictionary definitions).

● Semantic analysis then examines relationships between individual words and


analyzes the meaning of words that come together to form a sentence.

● This analysis provides a clear understanding of words in context. For example, it


provides context to understand the following sentences:

● “The boy ate the apple” defines an apple as a fruit.


● “The boy went to Apple” defines Apple as a brand or store.
● NLP cannot decipher ambiguous words, which are words that can have more
than one meaning in different contexts.
● Semantic analysis is key to contextualization that helps disambiguate language
data so text-based NLP applications can be more accurate.
Let us discuss some building blocks of the semantic system:

Entities: Any sentence is made of different entities that are related to each other. It
represents any individual category such as name, place, position, etc.

Concepts: It represents the general category of individual, such as person, city etc.

Relations: It represents the relation between different entities and concepts in a


sentence.

Predicates: It represents the verb structure of any sentence.


The following are some of the processes of Semantic Analysis:

Word Sense disambiguation:

● It is an automatic process of identifying the context of any word, in which it is


used in the sentence. In natural language, one word can have many
meanings.
● For eg- The word ‘light’ could be meant as not very dark or not very heavy.
● The computer has to understand the entire sentence and pick up the
meaning that fits the best. This is done by word sense disambiguation
Relationship Extraction:

● In a sentence, there are a few entities that are co-related to each other.
Relationship extraction is the process of extracting the semantic relationship
between these entities.

● In a sentence, “I am learning mathematics”, there are two entities, ‘I’ and


‘mathematics’ and the relation between them is understood by the word
‘learn’.
Discourse Integration:

The discourse integration step forms the story of the sentence. Every sentence
should have a relationship with its preceding and succeeding sentences. These
relationships are checked by Discourse Integration.

or

Discourse Integration depends upon the sentences that proceeds it and also invokes
the meaning of the sentences that follow it.
Pragmatic Analysis:

● Once all grammatical and syntactic checks are complete, the sentences are
now checked for their relevance in the real world.

● During Pragmatic Analysis, every sentence is revisited and evaluated once


again, this time checking them for their applicability in the real world using
general knowledge.
Learning:

Machine learning is a subfield of artificial intelligence, which is broadly defined


as the capability of a machine to imitate intelligent human behavior. Artificial
intelligence systems are used to perform complex tasks in a way that is similar
to how humans solve problems.
Rote learning

● It is the process of memorizing specific new items as they are


encountered. The basic idea is simple and easy to realize within a
computer program: Each time a new and useful piece of information is
encountered, it is stored away for future use.

● Rote learning technique can also be used in complex learning systems


provided sophisticated techniques are employed to use the stored
values faster and there is a generalization to keep the number of
stored information down to a manageable level.
Learning By Taking Advice:

● This is a simple form of learning. Suppose a programmer writes a set of


instructions to instruct the computer what to do, the programmer is a teacher and
the computer is a student.
● Once learned (i.e. programmed), the system will be in a position to do new
things.
● The advice may come from many sources: human experts, internet to name a
few. This type of learning requires more inference than rote learning.
● The knowledge must be transformed into an operational form before stored in the
knowledge base. Moreover the reliability of the source of knowledge should be
considered.
Learning in problem solving :

Learning by parameter adjustment:

● Start with some estimate of the correct weight settings. Modify the weight in
the program on the basis of accumulated experiences.

● Features that appear to be good predictors will have their weights increased
and bad ones will be decreased.
Learning with Macro-Operators:

Macro-operators can be used to group a whole series of actions into one. For
example:

● Making dinner can be described a lay the table, cook dinner, serve dinner.

● We could treat laying the table as on action even though it involves a


sequence of actions.
Learning from examples: Induction

● Inductive Learning, also known as Concept Learning, is how A.I. systems


attempt to use a generalized rule to carry out observations.

● Inductive Learning Algorithms (APIs) are used to generate a set of


classification rules. These generated rules are in the "If this, then that" format.
Explanation based Learning

● Explanation based learning has ability to learn from a single training instance.
Instead of taking more examples the explanation based learning is emphasized
to learn a single, specific example.

● For example, consider the Ludoo game. In a Ludoo game, there are generally
four colors of buttons. For a single color there are four different squares.
Suppose the colors are red, green, blue and yellow.

● So maximum four members are possible for this game. Two members are
considered for one side (suppose green and red) and other two are considered
for another side (suppose blue and yellow).
● For any one opponent the other will play his game. A square sized small box
marked by symbols one to six is circulated among the four members.

● The number one is the lowest number and the number six is the highest for
which all the operations are done.

● Always anyone from the 1st side will try to attack any one member in the 2nd
side and vice versa.

● At any instance of play the players of one side can attack towards the players
of another side.
● Explanation based generalization (EBG) is an algorithm for explanation based
learning, described in Mitchell at al. (1986). It has two steps first, explain
method and secondly, generalize method.

● During the first step, the domain theory is used to prune away all the
unimportant aspects of training examples with respect to the goal concept.

● The second step is to generalize the explanation as far as possible while still
describing the goal concept.

● Consider the problem of learning the concept bucket. We want to generalize


from a single example of a bucket. At first collect the following informations.
● Explanation based generalization (EBG) is an algorithm for explanation based
learning, described in Mitchell at al. (1986).

● It has two steps first, explain method and secondly, generalize method.

● During the first step, the domain theory is used to prune away all the unimportant
aspects of training examples with respect to the goal concept.

● The second step is to generalize the explanation as far as possible while still
describing the goal concept.
What is an expert system?

● An expert system is a computer program that uses artificial intelligence (AI) technologies to
simulate the judgment and behavior of a human or an organization that has expertise and
experience in a particular field.

● Expert systems are usually intended to complement, not replace, human experts.

● The concept of expert systems was developed in the 1970s by computer scientist Edward
Feigenbaum, a computer science professor at Stanford University and founder of
Stanford's Knowledge Systems Laboratory.
Difference between AI and Expert System
Artificial Intelligence: AI manages more comprehensive issues of automating a system. This computerization
should be possible by utilizing any field such as image processing, cognitive science, neural systems,
machine learning, etc.
Expert System:

● An expert system is an AI software that uses knowledge stored in a knowledge base to solve
problems that would usually require a human expert thus preserving a human expert’s
knowledge in its knowledge base.
● They can advise users as well as provide explanations to them about how they reached a
particular conclusion or advice.
Artificial Intelligence Expert System

AI is the ability of a machine or a computer program to Expert systems represent the most successful
think, work, learn and react like humans. demonstration of the capabilities of AI.

AI involves the use of methods based on the intelligent Experts systems are computer programs designed to
behavior of humans to solve complex problems. solve complex decision problems.

Characteristics

● Facial Recognition
● Automate Simple and Repetitive Tasks
● Chatbots
● Natural language processing ● High Efficiency and Accuracy
● Imitation Of Human Cognition ● Highly responsive
● Understandable
● Deep Learning
● Reliability
● Cloud Computing
Components of AI:
Components of Expert System:
1. Natural Language Processing (NLP)
1. Inference engine
2. Knowledge representation
2. Knowledge base
3. Reasoning
3. User interface
4. Problem solving
4. Knowledge acquisition module
5. Machine learning

AI is the study is systems that act in a way to any Expert system represent the most successful
observer would appear to be intelligent. demonstration of the capabilities of AI

AI systems are used in a wide range of industries,


Expert systems provide expert advice and guidance
from healthcare to finance, automotive, data
in a wide variety of activities.
security, etc.
Categories of Problems that can be solved-
Categories of Problems that can be solved- ● Using classification and diagnosis object
● Look for trends, patterns, and is identified based on stated qualities. To
connections. exemplify, Medical condition diagnosis
● Look for inefficiencies. ● Monitoring entails comparing data to
● Result forecasting on the basis of recommended behavior on a regular
historical trends basis.
● Make informed decisions based on facts ● Prediction: For example, forecasting the
● Put plans into action. state of the stock market.
● Improve yourself by learning new things. ● Configuring a system according to
standards is known as design.
Applications- Applications-

● E-Commerce ● Hospitals
● Education ● Medical facilities
● Lifestyle ● Help desks management
● Navigation ● Loan analysis
● Robotics ● Warehouse optimization
● Human Resource ● Stock market trading
● Healthcare ● Airline scheduling & cargo schedules and
● Gaming and others others

Examples- Natural Language Processing (NLP) tools,


Proactive healthcare management, Automated financial
investing, Virtual travel booking agents, Self-driving cars, Examples- DENDRAL, MYCIN, and others.
Manufacturing robots, Conversational marketing bots,
and others.
Knowledge Base (Representing and Using Domain Knowledge):

● Expert system is built around a knowledge base module.

● Expert system contains a formal representation of the information provided by


the domain expert. This information may be in the form of problem-solving
rules, procedures, or data intrinsic to the domain.

● To incorporate these information into the system, it is necessary to make use


of one or more knowledge representation methods. Some of these methods
are described here.
Transferring knowledge from the human expert to a computer is often the
most difficult part of building an expert system.

The knowledge acquired from the human expert must be encoded in such
a way that it remains a faithful representation of what the expert knows,
and it can be manipulated by a computer.

Three common methods of knowledge representation evolved over the


years are IF-THEN rules, Semantic networks and Frames.
1. IF-THEN rules

Human experts usually tend to think along :

condition ⇒ action or Situation ⇒ conclusion

Rules "if-then" are predominant form of encoding knowledge in expert systems. These are
of the form :

If a1 , a2 , . . . . . , an

Then b1 , b2 , . . . . . , bn where

each ai is a condition or situation, and

each bi is an action or a conclusion.


2. Semantic Networks

In this scheme, knowledge is represented in terms of objects and relationships between


objects.

The objects are denoted as nodes of a graph. The relationship between two objects are
denoted as a link between the corresponding two nodes.

The most common form of semantic networks uses the links between nodes to represent
IS-A and HAS relationships between objects.
Example of Semantic Network

The Fig. below shows a car IS-A vehicle; a vehicle HAS wheels.

This kind of relationship establishes an inheritance hy hiera in the


network, with the objects lower down in the network inheriting properties
from the objects higher up.
3. Frames

In this technique, knowledge is decomposed into highly modular pieces called frames, which are
generalized record structures. Knowledge consist of concepts, situations, attributes of concepts,
relationships between concepts, and procedures to handle relationships as well as attribute values.

‡ Each concept may be represented as a separate frame.

‡ The attributes, the relationships between concepts, and the procedures are allotted to slots in a
frame.

‡ The contents of a slot may be of any data type - numbers, strings, functions or procedures and so
on.

‡ The frames may be linked to other frames, providing the same kind of inheritance as that provided
by a semantic network.

A frame-based representation is ideally suited for objected-oriented programming techniques. An


example of Frame-based representation of knowledge is shown in next slide.
Example : Frame-based Representation of Knowledge.

Two frames, their slots and the slots filled with data type are shown.
Expert System Shells

● Expert system shells are toolkits that can be used to develop expert systems.
They consist of some built expert system components with an empty
knowledge base. Hence, in most cases, the knowledge engineer is left with
only populating the knowledge base.

● It is essentially a special-purpose tool that is built-in in line with the


requirements and standards of a particular domain or expert-knowledge area
applications.

● It may be defined as a software package that facilitates the building of


knowledge-based expert systems by providing a knowledge representation
scheme and an inference engine.
Expert System Shell Structure

The Expert System Shell refers to a software module containing an:

1. User interface (built-in)

2. Inference engine (built-in)

3. A structured skeleton of a knowledge base (in its empty state) with the suitable knowledge

representation facilities

Not only the above components but also some ES Shells provide facilities for database connectivity through

interpreter, web integration, and natural language processing (NLP) features.


The user interface is the portal available for both end-users (who use the expert system to get solutions) and

the knowledge engineer (who perform the knowledge engineering and modelling).

The knowledge base can be connected with an external database (like MySQL) since the knowledge base is

not optimal in storing extensive data. The knowledge base cannot directly access the database and these

access features are mediated through an interpreter.


Some ES Shells have inbuilt knowledge base editors which facilitate the Knowledge

Engineer to easily update and check the knowledge base. Knowledge Engineer collects the

expertise knowledge in a specific domain and models in populating the knowledge base.

Inference engine which is the most important part of an expert system access the

knowledge base and solves the problem by either backward chaining or forward chaining

of facts and rules in the knowledge base. In ES Shells, the inference engine is also a

built-in component that is usually programmed in ProLog.


Most ES shells are composed of another component called ‘Explanation System’

which provides the user with reasons and explanations to provide a certain

answer, by considering the ‘case specification data’ available.

In an expert system shell, the design of the user interface and other software

components are programmed by the software engineer. Therefore an expert

system is a collaborative design of 03 major parties: expert, knowledge engineer

and software engineer. (Depending on the size these parties may vary from

individuals to large teams)


Popular Expert System shells
Following are a few examples of expert systems available for developers to build expert

systems at various scales. Depending on the ES Shell there are various pros and cons

associated with each shell.

ES-Builder, CLIPS, JESS, PyKE


Neural Network:
Neural Networks are part of Machine Learning characterised by its use of a large number of interwoven
computations. The individual computations themselves are relatively straightforward, but it is the complexity
in the connections that give them their advanced analytic ability.
The Neuron

The building block of a neural network is the single neuron. The diagram below shows the structure of a neutron with

one input. The formula for the above equation will read x0 * w0 + x1 * w1 + x2 * w2 + b = y.
Layers
Neural networks organise neurons into layers. A layer in which every neuron is connected to every other
neuron in its next layer is called a dense layer.
S
3 4

C B
7
10 12 6

D E F
2 16

5
G
Expert Systems
● An expert system is a computer application that uses rules, approaches, and facts to
provide solutions to complex problems.
● Examples of expert systems include MYCIN and DENDRAL.
● MYCIN uses the backward chaining technique to diagnose bacterial infections.
● DENDRAL employs forward chaining to establish the structure of chemicals.
● There are three components in an expert system: user interface, inference engine, and
knowledge base.
● Backward and forward chaining stem from the inference engine component. This is a
component in which logical rules are applied to the knowledge base to get new
information or make a decision.
● The backward and forward chaining techniques are used by the inference engine as
strategies for proposing solutions or deducing information in the expert system.
Expert Systems
Expert System Shells

● Expert system shells are toolkits that can be used to develop expert systems.
They consist of some built expert system components with an empty
knowledge base. Hence, in most cases, the knowledge engineer is left with
only populating the knowledge base.

● It is essentially a special-purpose tool that is built-in in line with the


requirements and standards of a particular domain or expert-knowledge area
applications.

● It may be defined as a software package that facilitates the building of


knowledge-based expert systems by providing a knowledge representation
scheme and an inference engine.
Expert System Shell Structure

The Expert System Shell refers to a software module containing an:

1. User interface (built-in)

2. Inference engine (built-in)

3. A structured skeleton of a knowledge base (in its empty state) with the suitable knowledge

representation facilities

Not only the above components but also some ES Shells provide facilities for database connectivity through

interpreter, web integration, and natural language processing (NLP) features.


The user interface is the portal available for both end-users (who use the expert system to get solutions) and

the knowledge engineer (who perform the knowledge engineering and modelling).

The knowledge base can be connected with an external database (like MySQL) since the knowledge base is

not optimal in storing extensive data. The knowledge base cannot directly access the database and these

access features are mediated through an interpreter.


Forward Chaining
● Forward chaining is a method of reasoning in artificial intelligence in which inference rules
are applied to existing data to extract additional data until an endpoint (goal) is achieved.
● In this type of chaining, the inference engine starts by evaluating existing facts,
derivations, and conditions before deducing new information. An endpoint (goal) is
achieved through the manipulation of knowledge that exists in the knowledge base.
● Also called as data-driven approach
● Down-up process, as it moves from bottom to top
● A process of making conclusion based on known facts or data
● Commonly used in expert systems such as CLIPS, business, and production rule
systems.
● A DENDRAL expert system is a good example of how forward chaining is used in artificial
intelligence. DENDRAL is used in the prediction of the molecular structure of substances.
Forward Chaining
Backward Chaining
● Backward chaining is a concept in artificial intelligence that involves backtracking from the
endpoint or goal to steps that led to the endpoint. This type of chaining starts from the
goal and moves backward to comprehend the steps that were taken to attain this goal.
● The backtracking process can also enable a person establish logical steps that can be
used to find other important solutions.
● Goal driven process
● Can be used in debugging, diagnostics, and prescription applications.
● Up-down or top-bottom approach
● The MYCIN expert system is a real life example of how backward chaining works. This is
a system that’s used in the diagnosis of bacterial infections. It also recommends suitable
treatments for this type of infections.
Backward Chaining
Difference Between Forward Chaining and Backward Chaining
● When based on available data a decision is ● Backward chaining starts from the goal and
taken then the process is called as Forward works backward to determine what facts must
chaining. be asserted so that the goal can be achieved.
● Forward chaining is known as data-driven ● Backward chaining is known as goal-driven
technique because we reaches to the goal technique because we start from the goal and
using the available data. reaches the initial state in order to extract the
● It is a bottom-up approach. facts.
● It applies the Breadth-First Strategy. ● It is a top-down approach.
● Its goal is to get the conclusion. ● It applies the Depth-First Strategy.
● Slow as it has to use all the rules. ● Its goal is to get the possible facts or the
● It operates in forward direction i.e it works from required data.
initial state to final decision. ● Fast as it has to use only a few rules.
● It is used for the planning, monitoring, control, ● It operates in backward direction i.e it works
and interpretation application. from goal to reach initial state.
● It is used in automated inference engines,
theorem proofs, proof assistants and other
artificial intelligence applications.
Natural Language Processing
LOGIC

You might also like