Professional Documents
Culture Documents
AI Unit II - V Combined
AI Unit II - V Combined
On
Artificial intelligence
Artificial Intelligence
Assistant Professor,
Email: Sandeepgaikwad.mca@charusat.ac.in
Faculty of Computer Science and Applications,
Website: https://svgaikwad.com
CMPICA, CHARUSAT.
10/4/2021 Dr. Sandeep Gaikwad 1
2
Knowledge Based System
• Text
“knowledge (of about something) information, understanding and skills that you have gained
through learning or experience.”
Or
“The state of knowing about a particular fact or
Situation”
Or
The term "knowledge" can refer to a theoretical or
practical understanding of a subject
• Text is here
• A KBS is a computer program that uses artificial intelligence to solve problems within a
specialized domain that ordinarily requires human expertise.
• Typical tasks for expert systems involve classification, diagnosis, monitoring, design,
scheduling, and planning for specialized tasks.
• Knowledge-based system is a more general than the expert system.
• A system that draws upon the knowledge of human experts captured in a knowledge-base to
solve problems that normally require human expertise.
• Heuristic rather than algorithmic
• Heuristics in search vs. in KBS general vs. domain-specific
• Highly specific domain knowledge
• Knowledge is separated from how it is used
KBS = knowledge-base + inference engine
1. Knowledge base
2. Inference Engine
3. User interface
•The second part, the inference engine, allows new knowledge to be inferred. Most commonly, it
can take the form of IF-THEN rules
•Coupled with forward chaining or backward chaining approaches.
1. Perishable 1. Permanent
2. Difficult to transfer 2. Easy to transfer
3. Difficult to document 3. Easy to document
4. Unpredictable 4. Consistent
5. Expensive 5. Affordable
• Advantages:
• Increase available of expert knowledge
• Efficient and cost effective
• Consistency of answers
• Explanation of solution
• Deals with uncertainty
Limitations:
• Lack of common sense
• Inflexible, difficult to modify
• Restricted domain of expertise limited to KB - Not always reliable
• Dendral was a project in artificial intelligence (AI) of the 1960s, and the
computer software expert system that it produced.
• Its primary aim was to study hypothesis formation and discovery in
science. For that, a specific task in science was chosen: help organic
chemists in identifying unknown organic molecules, by analyzing their
mass spectra and using knowledge of chemistry.
• It was written in the Lisp programming language, which was considered
the language of AI because of its flexibility.
• The software program Dendral is considered the first expert system
because it automated the decision-making process and problem-solving
behavior of organic chemists.
• The project consisted of research on two main programs Heuristic Dendral
and Meta-Dendral
• MYCIN was an early backward chaining expert system that used artificial
intelligence to identify bacteria causing severe infections, such as bacteremia and
meningitis, and to recommend antibiotics, with the dosage adjusted for patient's body
weight — the name derived from the antibiotics themselves, as many antibiotics have
the suffix "-mycin".
• The Mycin system was also used for the diagnosis of blood clotting diseases.
MYCIN was developed over five or six years in the early 1970s at Stanford
University.
• It was written in Lisp as the doctoral dissertation of Edward Shortliffe under the
direction of Bruce G. Buchanan, Stanley N. Cohen and others.
• MYCIN operated using a fairly simple inference engine and a knowledge base of
~600 rules. It would query the physician running the program via a long series of
simple yes/no or textual questions
• 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.
1.Declarative
knowledge
5. Heuristics 2. Structural
knowledge knowledge
4. Meta 3. Procedural
knowledge knowledge
1. Declarative knowledge:
It is about concepts, facts and object express in a declarative sentences. Ex. Tea, Cricket
2. Structural knowledge
It is basic problem solving knowledge, that describe relationship between concepts and objects
Ex. Map reading
3. Procedural knowledge
This is responsible for knowing how to doing something and includes rules, strategy procedure etc.
Ex. Cooking
4. Meta knowledge
This define knowledge about other types of knowledge.
5. Heuristics knowledge
This one represent expert knowledge of the field or subject.
Ex. Doctor, Surgeon, Teacher,
Learning
Perception
Knowledge
Reasoning
representation
Planning
Planning
• The Perception component retrieves data or information from the environment. with the help of this
component, you can retrieve data from the environment, find out the source of noises and check if the AI was
damaged by anything. Also, it defines how to respond when any sense has been detected.
• Then, there is the Learning Component that learns from the captured data by the perception component.
• The goal is to build computers that can be taught instead of programming them.
• Learning focuses on the process of self-improvement. In order to learn new things, the system requires
knowledge acquisition, inference, acquisition of heuristics, faster searches, etc.
• The main component in the cycle is Knowledge Representation and Reasoning which shows the human-like
intelligence in the machines. Knowledge representation is all about understanding intelligence.
• Instead of trying to understand or build brains from the bottom up, its goal is to understand and build
intelligent behavior from the top-down and focus on what an agent needs to know in order to behave
intelligently.
• Also, it defines how automated reasoning procedures can make this knowledge available as needed.
• The Planning and Execution components depend on the analysis of knowledge representation and reasoning.
• Here, planning includes giving an initial state, finding their preconditions and effects, and a sequence of actions
to achieve a state in which a particular goal holds.
• Now once the planning is completed, the final stage is the execution of the
entire process.
• In the real world, knowledge plays a vital role in intelligence as well as creating artificial intelligence. It
demonstrates the intelligent behavior in AI agents or systems.
• It is possible for an agent or system to act accurately on some input only when it has the knowledge or
experience about the input.
1. Logical representation
1. Predicate logic
2. Propositional logic
2. Production Rules ( if.. Else)
3. Semantic Network representation
4. Frame representation
5. Script
• Logical representation is a language with some definite rules which deal with propositions and has
no ambiguity in representation. It represents a conclusion based on various conditions and lays
down some important communication rules.
• Also, 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 Semantics
•It decides how we can construct legal sentences in
logic. •Semantics are the rules by which we can interpret the
•It determines which symbol we can use in knowledge sentence in the logic.
representation. •It assigns a meaning to each sentence.
•Also, how to write those symbols.
Ex. I is going to college Wrong
I am going to college Right
Advantages:
Logical representation helps to perform logical reasoning.
This representation is the basis for the programming languages.
Disadvantages:
Logical representations have some restrictions and are challenging to work
with.
This technique may not be very natural, and inference may not be very
efficient.
In production rules, agent checks for the condition and if the condition exists then
production rule fires and corresponding action is carried out.
The condition part of the rule determines which rule may be applied to a problem.
Whereas, the action part carries out the associated problem-solving steps.
This complete process is called a recognize-act cycle.
Advantages:
The production rules are expressed in natural language.
The production rules are highly modular and can be easily removed or modified.
Disadvantages:
It does not exhibit any learning capabilities and does not store the result of the problem for future uses.
During the execution of the program, many rules may be active. Thus, rule-based production systems are
inefficient.
So, these were the important techniques for Knowledge Representation in AI. Now, let’s have a look at the
requirements for these representations.
Advantages:
Semantic networks are a natural representation of knowledge.
Also, it conveys meaning in a transparent manner.
These networks are simple and easy to understand.
Disadvantages:
Semantic networks take more computational time at runtime.
Also, these are inadequate as they do not have any equivalent quantifiers.
These networks are not intelligent and depend on the creator of the system.
• A frame is a record like structure that consists of a collection of attributes and values to
describe an entity in the world.
• These are the AI data structure that divides knowledge into substructures by representing
stereotypes situations.
• Basically, it consists of a collection of slots and slot values of any type and size. Slots have
names and values which are called facets.
• It includes Slots and fillers ( Objects and Attributes)
• Ex. Student ID card, Tickets
• Slots Filters
Game Cricket
Team India
Player Virat Kohli
Designation Captain
Example 2:
Sachin is a student, and his age is 20, he lives in city Anand,
and the country is India.
Advantages:
It makes the programming easier by grouping the related data.
Frame representation is easy to understand and visualize.
It is very easy to add slots for new attributes and relations.
Also, it is easy to include default data and search for missing values.
Disadvantages:
In frame system inference, the mechanism cannot be easily processed.
The inference mechanism cannot be smoothly proceeded by frame
representation.
It has a very generalized approach.
Inferential Efficiency: The ability to direct the inferential knowledge mechanism into the
most productive directions by storing appropriate guides.
Acquisitional efficiency: The ability to acquire new knowledge easily using automatic
methods.
It is the simplest way of storing facts which uses the relational method. Here, all the facts about a set of the
object are set out systematically in columns. Also, this approach of knowledge representation is famous in
database systems where the relationship between different entities is represented. Thus, there is little
opportunity for inference.
Example:
This is an example of representing simple relational knowledge.
Name Age Emp ID
John 25 100071
Amanda 23 100056
Sam 27 100042
The inferential knowledge approach represents knowledge in the form of formal logic. Thus,
it can be used to derive more facts. Also, it guarantees correctness.
Example:
Statement 1: John is a cricketer.
Statement 2: All cricketers are athletes.
Then it can be represented as;
Cricketer(John)
∀x = Cricketer (x) ———-> Athelete (x)s
•Procedural knowledge approach uses small programs and codes which describes how to do
specific things, and how to proceed.
•In this approach, one important rule is used which is If-Then rule.
•In this knowledge, we can use various coding languages such as LISP language and Prolog
language.
•We can easily represent heuristic or domain-specific knowledge using this approach.
•But it is not necessary that we can represent all cases in this approach.
Artificial intelligence
Artificial Intelligence
Assistant Professor,
Email: Sandeepgaikwad.mca@charusat.ac.in
Faculty of Computer Science and Applications,
Website: https://svgaikwad.com
CMPICA, CHARUSAT.
10/4/2021 Dr. Sandeep Gaikwad 46
Lecture
On
Artificial intelligence
Artificial Intelligence
Assistant Professor,
Email: Sandeepgaikwad.mca@charusat.ac.in
Faculty of Computer Science and Applications,
Website: https://svgaikwad.com
CMPICA, CHARUSAT.
10/4/2021 Dr. Sandeep Gaikwad 47
5
Expert System
• The data in the knowledge base is essentially added by humans who are
experts in a particular domain.
• However, the software is used by non-experts to gain information. It is used in
various areas of medical diagnosis, accounting, coding, gaming and more.
Forward Chaining
• With this strategy, an expert system is able to answer the question “What can happen
next?”
• 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.
• This strategy is followed while working on conclusion, result, or effect. For
• example, predicting how does the share market prediction of share market will react to
the changes in the interest rates.
• Forward chaining can be used in planning, monitoring, controlling, and interpreting
applications.
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.
Advantages
Den Disadvantages
• It can be used to draw multiple conclusions. • The process of forward chaining may be
• It provides a good basis for arriving at time-consuming.
conclusions. • It may take a lot of time to eliminate and
• It’s more flexible than backward chaining synchronize available data.
because it does not have a limitation on the
data derived from it. • Unlike backward chaining, the explanation
of facts or observations for this type of
chaining is not very clear.
• The former uses a goal-driven method that
arrives at conclusions efficiently.
Examples of expert systems include MYCIN and DENDRAL. MYCIN uses the backward chaining technique to
diagnose bacterial infections.
Forward chaining starts from known facts and applies inference Backward chaining starts from the goal and works backward through
1.
rule to extract more data unit it reaches to the goal. inference rules to find the required facts that support the goal.
Forward chaining is known as data-driven inference technique as Backward chaining is known as goal-driven technique as we start
3.
we reach to the goal using the available data. from the goal and divide into sub-goal to extract the facts.
• − They reduce the effort and cost involved in developing an expert system to
large extent.
• Powerful editors and debugging tools with multi-windows.
• − 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. Jess is a rule engine for the Java platform that was developed by Ernest
Friedman-Hill of Sandia National Labs.
• It is a superset of the CLIPS programming language.
• It was first written in late 1995.
• The language provides rule-based programming for the automation of an expert system, and
is frequently termed as an expert system shell.
• In recent years, intelligent agent systems have also developed, which depend on a similar
capability.
• Jess, an expert system shell and scripting language written entirely in Sun
Microsystem's Java language. Jess supports the development of rule-based
expert systems which can be tightly coupled to code written in the powerful,
portable Java language.
• Jess 6.1 is compatible with all versions of Java starting with Java 1.2. In
particular, this includes JDK 1.4 (or "Java 2" as it is now known.) Versions
numbered 4.x are compatible with JDK 1.0, and the 5.x versions work with
JDK 1.1.
• Addition of two no
• Merits of JESS
• Jess has many unique features including backwards chaining and working memory queries, and of course
Jess can directly
• manipulate and reason about Java objects.
• Jess is also a powerful Java scripting environment, from which you can create Java objects, call Java
methods, and implement
• Java interfaces without compiling any Java code.
• Jess is available at no cost for academic use and can be licensed for commercial use.
• Demerits of JESS
• JESS is three times slower than CLIPS because of Java but it totally depends on application type.
• It is a bit more complicated since the software has to be compiled before it can be started.
• explain an specific query in the form of why and how. It also has an
interactive text editor that enables knowledge engineer to update/create rules
in the knowledgebase.
• This software can be embedded in programs developed in other languages .
• The latest
• version of Vidwan is also compatible with UNIX operating 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.
• Vidwan
• An expert system shell - Vidwan has been developed at the National Centre for
Software Technology (NCST), Mumbai (India) in
• 1993. It's a web-based expert system shell that allows us to create rule-based expert
system. As it is a rule-based expert system shell, it
• enables us to encode domain knowledge in the form of IF-THEN rules . The
inference engine of this shell applies backward chaining inference mechanism to
manipulate the piece of information. The explanation component of the shell provides
facility to
• explain an specific query in the form of why and how. It also has an interactive text
editor that enables knowledge engineer to
• update/create rules in the knowledgebase. This software can be embedded in
programs developed in other languages [25]. The latest
• version of Vidwan is also compatible with UNIX operating system
10/4/2021 Dr. Sandeep Gaikwad 72
Advantages of Expert Systems
•
•
Artificial intelligence
Artificial Intelligence
Assistant Professor,
Email: Sandeepgaikwad.mca@charusat.ac.in
Faculty of Computer Science and Applications,
Website: https://svgaikwad.com
CMPICA, CHARUSAT.
10/5/2021 Dr. Sandeep Gaikwad 75