CSC413 LECTURE NOTE
CSC413 LECTURE NOTE
For instance, we do a task, make mistakes, and learn from them (at least the wise ones do!).
Artificial intelligence (AI) is designed to solve problems make mistakes and learn from them to
improve itself. Likewise, an AI or Artificial Intelligence is supposed to work on a problem, make
some mistakes in solving the problem and learn from the problems in a self-correcting manner as a
part of its self-improvement.
The concept of artificial intelligence is not as modern as we believe. This goes back as far as 1950,
when Alan Turing developed the Turing test. The Turing Test is a method of investigation in
artificial intelligence (AI) that determines whether or not a computer can think like a person. If a
machine can engage in a conversation with a human without being detected as a machine, it has
demonstrated human intelligence.
The first chatbot computer programme, at its most basic, a chatbot is a computer programme that
simulates and processes human interaction (whether written or spoken), allowing humans to
communicate with digital gadgets as if they were speaking with a real person. It was named
ELIZA, which was developed in the 1960s.
IBM Deep Blue, a chess computer developed in 1977, defeated a world chess champion in two of
six games, one of which the champion won and the other three were drawn. Deep Blue was a
Page 1 of 32
chess-playing expert system that ran on a specially designed IBM supercomputer. It was the first
computer to win a game and a match against a reigning world champion using standard time
restrictions.
Siri, Apple's digital assistant, was announced in 2011. Siri enables users to make calls, send texts,
use apps, and do tasks just by speaking. And Siri is the most personal intelligent helper. It is an
easy way to make calls, send texts, use apps, and get things done with just your voice. And Siri is
the most private intelligent assistant.
Elon Musk and a few others created OpenAI in December 2015. OpenAI is a U.S. based artificial
intelligence research organization, researching artificial intelligence with the goal of developing
"safe and beneficial" artificial general
The GOALS of AI: The two vital goals of Artificial Intelligence are
COMPONENTS OF AI
AI has four main components
1. Expert systems:
2. Heuristic problem solving
3. Natural Language Processing
4. Vision
While Expert system handles the situation as an expert and gives performance. It is an
application-specific systems that rely on obtaining the knowledge of human experts in an area and
programming that knowledge into a system. Examples are
(A) DIAGNOSTIC SYSTEMS- MYCIN system for diagnosing bacterial infections of the
blood and suggesting treatments. Intellipath pathology diagnosis system (AMA
approved). Pathfinder medical diagnosis system, which suggests tests and makes
diagnoses. Whirlpool customer assistance center.
(C) CLASSIFICATION SYSTEMS- Put information into one of a fixed set of categories
using several sources of information. E.g., financial decision-making systems.
Heuristic problem solving is meant to evaluate small range of solutions, may involve some
guesswork to find near optimal solution.
Page 2 of 32
Natural language processing provides communication between human and machine in natural
language.
Vision is the ability to recognize shapes and features etc. automatically. For instance, Face
recognition programs in use by banks, government, etc. The ALVINN system from CMU
autonomously drove a van from Washington, D.C. to San Diego.
Application of AI:
AI algorithms have attracted close attention of researchers and have also been applied
successfully to solve problems in engineering. Nevertheless, for large and complex
problems, AI algorithms consume considerable computation time due to stochastic feature
of the search approaches
1) Business, financial strategies
2) Engineering: check design, offer suggestions to create new product, expert
systems for all engineering problems
3) Manufacturing: assembly, inspection and maintenance
4) Medicine: monitoring, diagnosing
5) Education: in teaching
6) Fraud detection
7) Object identification
8) Information retrieval
9) Space shuttle scheduling
Building AI Systems:
Artificial Intelligence is built from three cardinal points. (Perception, Reasoning and Action)
1) Perception
Intelligent biological systems are physically embodied in the expert system (world) and
experience the world through their sensors (senses). For an autonomous vehicle, input
might be images from a camera and range information from a rangefinder. For a medical
diagnosis system, perception is the set of symptoms and test results that have been obtained
and input to the system manually.
2) Reasoning
Inference, decision-making, classification from what is sensed and what the internal
"model" is of the world. Might be a neural network, logical deduction system, Hidden
Markov Model induction, heuristic searching a problem space, Bayes Network inference,
genetic algorithms, etc. Includes areas of knowledge representation, problem solving,
decision theory, planning, game theory, machine learning, uncertainty reasoning, etc.
3) Action
Biological systems interact within their environment by actuation, speech, etc. All behavior
is centered around actions in the world. Examples include controlling the steering of a Mars
Page 3 of 32
rover or autonomous vehicle or suggesting tests and making diagnoses for a medical
diagnosis system. Includes areas of robot actuation, natural language generation, and
speech synthesis.
EXPERT SYSTEM –
An expert system is a machine system in which useful human knowledge is added in
machine memory in order to give intelligent advice and offer explanations and justifications of its
decisions or demand. Expert systems rely on a large database of well-defined specialized
knowledge about a particular area. Construction of such programs is referred to as Knowledge
Engineering. All such AI programs that achieve expert-level competence in solving problems in
task areas by using knowledge about specific tasks are called knowledge-based Systems or expert
systems. These programs contain the knowledge used by human experts, in contrast to knowledge
gathered from textbooks. Because of these expert systems are like human experts e.g., doctors,
engineers, analysts, teachers, geologists etc. which encapsulate the skills of an expert and to
dispense advice to less knowledgeable users. This transfer of knowledge depends upon the task
and will take place gradually through many interactions between expert and the system.
These tasks cannot be done by all people and can only be performed by skilled specialists. Clearly
tasks of the first type are easy for humans to perform, and almost all are able to master them. The
second range of tasks requires skill development and/or intelligence and only some specialists can
perform them well. However, when we look at what computer systems have been able to achieve
to date, we see that their achievements include performing sophisticated tasks like medical
diagnosis, performing symbolic integration, proving theorems, and playing chess.
Agent:
An Agent is anything that can be viewed as perceiving its environment through
sensors and acting upon that environment through actuators. Actuators are the physical
tools used by agents.
A human agent has eyes, ears, and other organs for sensors and hands, legs,
mouth, and other body parts for actuators.
A robotic agent might have cameras and infrared range finders for sensors and
various motors for actuators.
A software agent receives keystrokes, file contents, and network packets as
sensory inputs and acts on the environment by displaying on the screen, writing
files, and sending network packets.
Page 4 of 32
Intelligent Agents
An “agent” is anything that can be viewed as perceiving its environment through
sensors and acting upon that environment through actuators.
Percept refers to the agent’s perceptual inputs at a given time instant.
An agent’s perceptual sequence is the complete history of everything the agent has
ever perceived.
In general, an agent’s choice of action at any given instant can depend on the entire
precept sequence observed to date, but not on anything it hasn’t perceived.
Agent function: It is a map from the precept sequence to an action.
Agents include humans, robots, softbots, thermostats, etc. The agent function maps from percept
histories to actions:
¿
f :P → A
It is advisable to design performance measures according to what one actually wants in the
environment, as opposed to how one believes that agent should behave.
Rationality
What is rational at any given time depends on (at least) four things:
(1) The performance measure
(2) The agent’s prior knowledge
(3) The actions the agents can perform
(4) The agent’s percept sequence to date.
Page 5 of 32
What is a rational agent: A rational agent should choose an action that is likely to maximize its
performance measure based on the data offered by the percept sequence and any built-in
information the agent knows. Percepts may not necessarily supply all relevant information.
An ideal rational agent is the one, which is capable of doing expected actions to maximize its
performance measure, on the basis of:
Its percept sequence
Its built-in knowledge base
Rationality of an agent depends on the following:
1. The performance measures, which determine the degree of success.
2. Agent’s Percept Sequence till now.
3. The agent’s prior knowledge about the environment.
4. The actions that the agent can carry out.
A rational agent always performs right action, where the right action means the action that
causes the agent to be most successful in the given percept sequence. The problem the agent solves
is characterized by Performance Measure, Environment, Actuators, and Sensors (PEAS).
An intelligent agent should not only gather information, but also learn. The agent’s initial
configuration could reflect some prior knowledge of the environment, but as the agent gains
experience, this may be modified and augmented (an extreme case is when the environment is
known a priori). Generally speaking, a rational agent should be autonomous, in the sense that it
learns what it can to compensate for partial or incorrect prior knowledge. After sufficient
experience of its environment, the behavior of a rational agent can become effectively independent
of its prior knowledge. Ideally, the incorporation of learning allows for the design of a single
rational agent that will succeed in a variety of different environments and for a variety of tasks (the
goal of AGI).
An artificial general intelligence (AGI) is a type of artificial intelligence (AI) that can perform as
well as or better than humans on a variety of cognitive issues. To design a rational agent, we need
to specify the task environment known as PEAS.
o Performance measure
o Environment
o Actuators
o Sensors
The task of designing an automated taxi involves: -
Agent- automated taxi
Performance measure- safety, destination, profits, legality, comfort, ...
Page 6 of 32
Environment- CUSTECH streets/freeways, traffic, pedestrians, weather, ...
Actuators- steering, accelerator, brake, horn, speaker/display, ...
Sensors- video, accelerometers, gauges, engine sensors, keyboard, GPS (global positioning
system), The Global Positioning System (GPS) is a U.S.-owned utility that provides users
with positioning, navigation, and timing (PNT) services. This system consists of three
segments: the space segment, the control segment, and the user segment.
Similarly, for a medical expert system,
Agent: Medical diagnosis system
Performance measure: Healthy patient, minimize costs, lawsuits
Environment: Patient, hospital, staff
Actuators: Screen display (questions, tests, diagnoses, treatments, referrals)
Sensors: Keyboard (entry of symptoms, findings, patient's answers)
Page 7 of 32
o Goal-based agents
They choose their actions in order to achieve goals. Goal-based approach is
more flexible than reflex agent since the knowledge supporting a decision is
explicitly modeled, thereby allowing for modifications.
Goal: It is the description of desirable situations.
o Utility-based agents
They choose actions based on a preference (utility) for each state.
Goals are inadequate when iff:
There are conflicting goals only some of which can be achieved.
Goals have some uncertainty of being achieved and one needs to
weigh likelihood of success against the importance of a goal.
All these can be turned into learning agents
Note: A softbot (software robot) is a programme that interacts with a software environment by
issuing commands and interpreting its responses or interpreting the environment’s feedback.
Turing Test
The success of an intelligent behavior of a system can be measured with Turing Test.
Two persons and a machine to be evaluated participate in the test. Out of the two persons, one
plays the role of the tester. Each of them sits in different rooms. The tester is unaware of who is
machine and who is a human. He interrogates the questions by typing and sending them to both
intelligences, to which he receives typed responses.
This test aims at fooling the tester. If the tester fails to determine machine’s response from the
human response, then the machine is said to be intelligent.
Page 8 of 32
Environment types/Properties
The environment has multifold properties:
Discrete / Continuous: If there are a limited number of distinct, clearly defined,
states of the environment, the environment is discrete (For example, chess);
otherwise, it is continuous (For example, driving).
Observable / Partially Observable: If it is possible to determine the complete
state of the environment at each time point from the percepts it is observable;
otherwise, it is only partially observable.
Static / Dynamic: If the environment does not change while an agent is acting, then
it is static; otherwise, it is dynamic.
Single agent / Multiple agents: The environment may contain other agents which
may be of the same or different kind as that of the agent.
Accessible vs. inaccessible: If the agent’s sensory apparatus can have access to the
complete state of the environment, then the environment is accessible to that agent.
Deterministic vs. Non-deterministic: If the next state of the environment is
completely determined by the current state and the actions of the agent, then the
environment is deterministic; otherwise, it is non-deterministic.
Episodic vs. Non-episodic: In an episodic environment, each episode consists of
the agent perceiving and then acting. The quality of its action depends just on the
episode itself. Subsequent episodes do not depend on the actions in the previous
episodes. Episodic environments are much simpler because the agent does not need
to think ahead
Quiz 001
What is the difference between expert system and intelligent agent?
AI involves the use of methods based on the intelligent behavior of humans to solve complex
problems. Experts systems are computer programs designed to solve complex decision problems
Page 9 of 32
ALGORITHMS
What are algorithms?
An algorithm is a well-defined finite set of rules that specifies a sequential series of
elementary operations to be applied to some data called the input, producing after a finite amount
of time some data called the output. An algorithm solves some computational problem. Algorithms
(along with data structures) are the fundamental “building blocks” from which programs are
constructed. Only by fully understanding them is it possible to write very effective programs.
Therefore, algorithms are the ideas behind computer programs. To be interesting, an algorithm has
to solve a general, specified problem. An algorithmic problem is specified by describing the set of
instances it must work on, and what desired properties the output must have.
Definition of Algorithm
o An algorithm is a set of rules for carrying out calculation either by hand or on a
machine.
o An algorithm is a sequence of computational steps that transform the input into the
output.
o An algorithm is a sequence of operations performed on data that have to be
organized in the data structures.
o A finite set of instruction that specify a sequence of operations to be carried out in
order to solve a specific problem or class of problems is called an algorithm.
o An algorithm is an abstraction of a program to be executed on a physical machine
(model computation).
o An algorithm is defined as set of instructions to perform a specific task within finite
no. of steps.
o Algorithm is defined as a step by step procedure to perform a specific task within
finite number of steps.
o It can be defined as a sequence of definite and effective instructions, while
terminates with the production of correct output from the given input.
CHARACTERISTICS OF AN ALGORITHM
Every algorithm should have the following characteristics/features:
a) Input
An algorithm may have one or more inputs. The inputs are taken from a specified
set of subjects. The input pattern may be texts, images or any type of files.
b) Output
An algorithm may have one or more outputs. Output is basically a quantity which
has a specified relation with the input.
Page 10 of 32
c) Finiteness
An algorithm should terminate after a countable number of steps. In some cases the
repetition of steps may be larger in number. If a procedure is able to resolve in finite
number of execution of steps, then it is referred to be computational method.
d) Definiteness
Each step of an algorithm must be precisely defined. The action to be carried out
must be on ambiguously specified for each case. Due to the lack of
understandability, one may think that the step might be lacking definiteness.
Therefore, in such cases mathematically expressions are written, so that it resembles
the instruction of any computer language.
e) Effectiveness
An algorithm is generally expected to effective. Means the steps should be
sufficiently basic, so that it may be possible for a man to resolve them.
f) Precision
The steps are precisely stated.
g) Determination
The intermediate results of each step of execution are unique and are determined
only by input and output of the preceding steps.
h) Correctness
Output produced by the algorithm should correct.
i) Generality
Algorithm applies to set of standard inputs.
SEARCH ALGORITHMS
Searching is the universal technique of problem solving in AI. There are some single-player games
such as tile games, Sudoku, crossword, etc. The search algorithms help you to search for a
particular position in such games.
Search Terminology
Problem Space: It is the environment in which the search takes place. (A set of states and set of
operators to change those states)
Problem Instance: It is Initial state + Goal state
Problem Space Graph: It represents problem state. States are shown by nodes and operators are
shown by edges.
Depth of a problem: Length of a shortest path or shortest sequence of operators from Initial State
to goal state.
Space Complexity: The maximum number of nodes that are stored in memory.
Time Complexity: The maximum number of nodes that are created.
Page 11 of 32
Admissibility: A property of an algorithm to always find an optimal solution.
Branching Factor: The average number of child nodes in the problem space graph.
Depth: Length of the shortest path from initial state to goal state.
1 2
3 4 5 6
Page 12 of 32
Uniform Cost Search- Sorting is done in increasing cost of the path to a node. It always
expands the least cost node. It is identical to Breadth First search if each transition has the same
cost. It explores paths in the increasing order of cost.
Heuristic Searches
A heuristic search is a type of search procedure used to solve problems. It entails utilizing
previously existing information to reduce the quantity of searching required for an ideal result. In
this fashion the search “wanders” around the state-space graph, but again it will inevitably end up
in a local minimum or local maximum from which there is no escape. Algorithms that either give
nearly the right answer or provide a solution not for all instances of the problem are called
heuristic algorithms. This group includes a plentiful spectrum of methods based on traditional
techniques as well as specific ones. Some notable examples of this search technique are: -
Hill Climbing Algorithm
We will assume we are trying to maximize a function. That is, we are trying to find a point
in the search space that is better than all the others. And by "better" we mean that the evaluation is
higher. We might also say that the solution is of better quality than all the others. The idea behind
hill climbing is as follows.
1. Pick a random point in the search space.
2. Consider all the neighbors of the current state.
3. Choose the neighbor with the best quality and move to that state.
4. Repeat 2 thru 4 until all the neighboring states are of lower quality.
5. Return the current state as the solution state.
Simulated annealing algorithm- Uses an approach similar to hill-climbing, but
occasionally accepts solutions that are worse than the current. The probability of such acceptance
is decreasing with time.
Tabu search- Extends the idea to avoid local optima by using memory structures. The
problem of simulated annealing is that after ” jump” the algorithm can simply repeat its own track.
Tabu prohibits the repetition of moves that have been made recently.
Swarm intelligence was introduced in 1989. It is an artificial intelligence technique, based
on the study of collective behavior in decentralized, self-organized, systems. Two of the most
successful types of this approach are Ant Colony Optimization (ACO) and Particle Swarm
Optimization (PSO). In ACO artificial ants build solutions by moving on the problem graph and
changing it in such a way that future ants can build better solutions. PSO deals with problems in
which a best solution can be represented as a point or surface in an n-dimensional space. The main
advantage of swarm intelligence techniques is that they are impressively resistant to the local
optima problem.
Page 13 of 32
META-HEURISTIC ALGORITHMS
In computer science, meta-heuristic designates a computational method that optimizes a problem
by iteratively trying to improve a candidate solution with regard to a given measure of quality.
Meta-heuristics make few or no assumptions about the problem being optimized and can search
very large spaces of candidate solutions. However, meta-heuristics do not guarantee an optimal
solution is ever found. Many meta-heuristics implement some form of stochastic optimization.
Following are properties that characterize most meta-heuristics:
Meta-heuristics are strategies that guide the search process. The goal is to efficiently
explore the search space in order to find near–optimal solutions.
Techniques which constitute meta-heuristic algorithms range from simple local search
procedures to complex learning processes.
Meta-heuristic algorithms are approximate and usually non-deterministic.
Meta-heuristics are not problem - specific.
Page 14 of 32
Types of Search Algorithms in AI Techniques
Search algorithms are one of the essential elements of AI because they
are so important for information retrieval. These algorithms are made to
efficiently search through enormous volumes of data and present the
user with pertinent results. Examples are Breadth-First Search (BFS),
Genetic Algorithms, Depth-First search (DFS) etc.,
Page 15 of 32
AI search algorithm limitations
Performance problems with overly large or complex search spaces: When the search
space is too big or complicated, search algorithms may run into performance problems,
which might slow down retrieval or demand more computation.
Dependence on heuristics and input data quality: The effectiveness of the search results
is significantly influenced by the precision of the used heuristics and the input data quality.
The performance of search algorithms might be impacted by inaccurate or lacking data.
Non-guarantee of optimal solutions: In dynamic or incomplete search spaces, where the
best solution might not be recognizable within the current limitations, search algorithms
may not always guarantee finding the optimal solution.
Page 16 of 32
Problem understanding: Gaining an in-depth knowledge of the problem's needs will help
you choose an algorithm.
Algorithm selection: Select the best algorithm depending on the features of the problem
and variables like efficiency, accuracy, scalability, & cost.
Heuristic design: Create efficient heuristics to efficiently direct the search process towards
the intended outcome.
Techniques for performance optimization: Examine methods like parallel computing,
memory-efficient data structures, and pruning.
Evaluation and iteration: Constantly assess and enhance the performance of the algorithm
through feedback analysis and incremental advancements.
Think about trade-offs and restrictions: To improve the performance of the algorithm,
take into consideration constraints, resource limits, and user preferences.
Testing and validation: Use relevant datasets and real-world examples to thoroughly test
and validate the method.
Page 17 of 32
1. Completeness - A search algorithm is said to be complete if it guarantees to yield a
solution for any random input if at least one solution exists.
2. Optimality - A solution discovered for an algorithm is considered optimal if it is assumed
to be the best solution (lowest path cost) among all other solutions.
3. Time complexity - It measures how long an algorithm takes to complete its job.
4. Space Complexity - The maximum storage space required during the search, as
determined by the problem's complexity.
These characteristics often contrast the effectiveness of various search algorithms in artificial
intelligence.
1. Search - Searching solves a search issue in a given space step by step. Three major factors
can influence a search issue.
Search Space - A search space is a collection of potential solutions a system may have.
Start State - The jurisdiction where the agent starts the search.
Goal test - A function that examines the current state and returns whether or not the
goal state has been attained.
2. Search tree - A Search tree is a tree representation of a search issue. The node at the root
of the search tree corresponds to the initial condition.
3. Actions - It describes all the steps, activities, or operations accessible to the agent.
4. Transition model - It can be used to convey a description of what each action does.
5. Path Cost - It is a function that gives a cost to each path.
6. Solution - An action sequence connects the start node to the target node.
Optimal Solution - If a solution has the lowest cost among all solutions, it is said to be the optimal
answer.
Page 18 of 32
Expert Systems
ES are one of the prominent research domains of AI. It is introduced by the researchers at Stanford
University, Computer Science Department.
What are Expert Systems?
Various definitions of expert systems have been offered by several authors:
An expert system belongs to a field of artificial intelligence, and it is a computer program that
simulates the judgment and behavior of an individual that has expert knowledge and experience in
a particular field. It is a knowledge-based computer program that exhibits a degree of expertise in a
particular domain thereby solving problem or making decisions that is comparable to that of a
human expert.
It could also be referred to as an AI programs that achieve expert-level competence in solving
problems in task areas by bringing to bear a body of knowledge about specific tasks. It could be
referred to as knowledge-based or expert systems
A type of application program that makes decisions or solves problems in a particular field by
using knowledge and analytical rules defined by experts in the field.
Expert systems represent a branch of artificial intelligence, aiming to take the experience of
human specialists and to transfer to a computer system. Specialty knowledge is stored in the
computer, which by an execution system (inference engine) is reasoning and it derives specific
conclusions for the problem.
A computer program that uses knowledge and reasoning techniques to solve problems that
normally require the abilities of human experts. Software that applies human-like reasoning
involving rules and heuristics to solve a problem.
An Expert System (EPS) is a software system, which finds solutions on the basis of expert
knowledge or provides an evaluation of known problems. Examples are systems for the support of
medical diagnosis or for the analysis of scientific data.
The expert systems are the computer applications developed to solve complex problems in
a particular domain, at the level of extra-ordinary human intelligence and expertise.
Characteristics of Expert Systems
High performance
Understandable
Reliable
Highly responsive
Page 19 of 32
Capabilities of Expert Systems
The expert systems are capable of –
Advising
Instructing and assisting human in decision making
Demonstrating Deriving a solution
Diagnosing
Explaining
Interpreting input
Predicting results
Justifying the conclusion
Suggesting alternative options to a problem
They are incapable of –
Substituting human decision makers
Possessing human capabilities
Producing accurate output for inadequate knowledge base
Refining their own knowledge
Page 20 of 32
Components of Expert Systems / Architect of an Expert System
The components of ES include –
Knowledge Base
Interface Engine
User Interface
KNOWLEDGE
Let us see them one by one briefly BASE
INTERFACE
ENGINE
HUMAN KNOWLEDGE
EXPERT ENGINEER
USER
INTERFACE
USER
(May not necessarily be an Expert)
Knowledge Base
It contains domain-specific and high-quality knowledge. Knowledge is required to exhibit
intelligence. The success of any ES majorly depends upon the collection of highly accurate and
precise knowledge.
What is Knowledge?
The data is collection of facts. The information is organized as data and facts about
the task domain. Data, information, and past experience combined together are
termed as knowledge.
Components of Knowledge Base
The knowledge base of an ES is a store of both, factual and heuristic knowledge.
Factual Knowledge − It is the information widely accepted by the Knowledge
Engineers and scholars in the task domain.
Heuristic Knowledge − It is about practice, accurate judgement, one’s ability of
evaluation, and guessing.
Knowledge representation
It is the method used to organize and formalize the knowledge in the knowledge
base. It is in the form of IT-THEN-ELSE rules.
Knowledge Acquisition
Page 21 of 32
The success of any expert system majorly depends on the quality, completeness,
and accuracy of the information stored in the knowledge base. The knowledge base
is formed by readings from various experts, scholars, and the Knowledge
Engineers. The knowledge engineer is a person with the qualities of empathy, quick
learning, and case analyzing skills. He acquires information from subject expert by
recording, interviewing, and observing him at work, etc. He then categorizes and
organizes the information in a meaningful way, in the form of IF-THEN-ELSE
rules, to be used by interference machine. The knowledge engineer also monitors
the development of the ES.
Interface Engine
Use of efficient procedures and rules by the Interface Engine is essential in deducting a
correct, flawless solution. In case of knowledge-based ES, the Interface Engine acquires and
manipulates the knowledge from the knowledge base to arrive at a particular solution.
Forward Chaining
It is a strategy of an expert system to answer the question, “What can happen next?”
Here, the interface engine follows the chain of conditions and derivations and finally
deduces the outcome. It considers all the facts and rules as well as sorting them before
concluding to a solution. This strategy is followed for working on conclusion, result, or
effect. For instance, prediction of share market status as an effect of changes in interest
rates.
Page 22 of 32
Backward Chaining
With this strategy, an expert system finds out the answer to the question, “Why this happened?”
On the basis of what has already happened, the interface engine tries to find out which conditions
could have happened in the past for this result. This strategy is followed for finding out cause or
reason. For example, diagnosis of blood cancer in humans.
User Interface
User interface provides interaction between user of the ES and the ES itself. It is generally
Natural Language Processing so as to be used by the user who is well-versed in the task domain.
The user of the ES need not be necessarily an expert in Artificial Intelligence.
It explains how the ES has arrived at a particular recommendation. The explanation may
appear in the following forms –
Natural language displayed on screen.
Verbal narrations in natural language.
Listing of rule numbers displayed on the screen.
The user interface makes it easy to trace the credibility of the deductions.
Page 23 of 32
Expert System Shells
An Expert system shell is a software development environment. It contains the basic components
of expert systems. A shell is associated with a prescribed method for building applications by
configuring and instantiating these components.
An expert system shell in AI refers to the framework or software platform that provides the
infrastructure for building and running expert systems. It serves as a foundation for developing
customized expert systems by providing tools and functionalities to represent knowledge, make
inferences, and deliver intelligent advice.
There are several levels of ES technologies available. Expert systems technologies include -
Expert System Development Environment − The ES development environment includes hardware
and tools. They are –
o Workstations, minicomputers, mainframes.
o High level Symbolic Programming Languages such as LISt Programming LISP and
PROgrammation en LOGique PROLOG.
o Large databases.
Tools − They reduce the effort and cost involved in developing an expert system to large extent.
Powerful editors and debugging tools with multi-windows.
They provide rapid prototyping
Have Inbuilt definitions of model, knowledge representation, and inference design.
Shells − A shell is nothing but an expert system without knowledge base. A shell provides the
developers with knowledge acquisition, inference engine, user interface, and explanation facility.
For example, few shells are given below –
Java Expert System Shell JESS that provides fully developed Java API for creating an expert
system.
Vidwan, a shell developed at the National Centre for Software Technology, Mumbai in
1993. It enables knowledge encoding in the form of IF-THEN rules.
Maintain the ES
Keep the knowledge base up-to-date by regular review and update.
Cater for new interfaces with other information systems, as those systems
evolve.
o 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.
Page 26 of 32
o 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.
o 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:
The following are the kind of knowledge which needs to be represented in AI systems:
o Object: All the facts about objects in our world domain. E.g., Guitars contains strings,
trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o 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).
Types of knowledge
The Following are the various types of knowledge:
1.Declarative Knowledge:
Page 27 of 32
o It is also called descriptive knowledge and expressed in declarative sentences.
o It is simpler than procedural language.
2. Procedural Knowledge
3. Meta-knowledge:
4. Heuristic knowledge:
5. Structural knowledge:
Page 28 of 32
As we can see in below diagram, there is one decision maker which act by sensing the
environment and using knowledge. But if the knowledge part will not present then, it cannot
display intelligent behavior.
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behavior:
o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution
The above diagram is showing how an AI system can interact with the real world and what
components help it to show intelligence. AI system has Perception component by which it retrieves
information from its environment. It can be visual, audio or another form of sensory input. The
learning component is responsible for learning from data captured by Perception comportment. In
the complete cycle, the main components are knowledge representation and Reasoning. These two
components are involved in showing the intelligence in machine-like humans. These two
components are independent with each other but also coupled together. The planning and
execution depend on analysis of Knowledge representation and reasoning.
Page 29 of 32
Approaches to knowledge representation:
There are mainly four approaches to knowledge representation, which are given below:
o It is the simplest way of storing facts which uses the relational method, and each fact about
a set of the object is set out systematically in columns.
o This approach of knowledge representation is famous in database systems where the
relationship between different entities is represented.
o This approach has little opportunity for inference.
2. Inheritable knowledge:
o In the inheritable knowledge approach, all data must be stored into a hierarchy of classes.
o All classes should be arranged in a generalized form or a hierarchal manner.
o In this approach, we apply inheritance property.
o Elements inherit values from other members of a class.
o This approach contains inheritable knowledge which shows a relation between instance and
class, and it is called instance relation.
o Every individual frame can represent the collection of attributes and its value.
o In this approach, objects and values are represented in Boxed nodes.
o We use Arrows which point from objects to their values.
o Example:
Page 30 of 32
3. Inferential knowledge:
1. Marcus is a man
2. All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
o Procedural knowledge approach uses small programs and codes which describes how to do
specific things, and how to proceed.
o In this approach, one important rule is used which is If-Then rule.
Page 31 of 32
o In this knowledge, we can use various coding languages such as LISP
language and Prolog language.
o We can easily represent heuristic or domain-specific knowledge using this approach.
o But it is not necessary that we can represent all cases in this approach.
1. Representational Accuracy:
KR system should have the ability to represent all kind of required
knowledge.
2. Inferential Adequacy:
KR system should have ability to manipulate the representational
structures to produce new knowledge corresponding to existing
structure.
3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most
productive directions by storing appropriate guides.
4. Acquisitional efficiency- The ability to acquire the new knowledge
easily using automatic methods.
Page 32 of 32