Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 39

Expert systems

by
Dr. Ayman Youssef
Researcher electronics research institute
Lectures revision
• What is Expert system?
• How Expert system fits in AI.
• Expert systems components.
• Problem domain Vs knowledge domain.
• Expert systems history.
• Expert systems advantages.
• Characteristics of Expert systems
• Elements of Expert system.
• Appropriate domains of expert systems
• Knowledge representation.
Lectures revision
• What is logic? Types of Knowledge.
• Epistemology.
• Types of knowledge.
• Pyramid of knowledge.
• Example on the pyramid of knowledge.
• Rules.
• Semantic nets.
• Semantic nets limitations.
• Attribute tables.
• Frame.
Lecture outline
• Trees.
• Binary trees.
• Graphs.
• Animal decision tree.
• Prolog lists
• Lists rules
Chapter 3
• This chapter about reasoning of knowledge.
• This chapter is an introduction to reasoning about knowledge.
• In particular we will look at an important type of reasoning in ex- pert systems in which
conclusions follow from facts by using rules. It is particularly important in expert systems
because making inferences is the fundamental method by which expert systems solve problems.
• The expert system should make a chain of inferences to come up with a solution just as a person
would, especially when faced with incomplete or missing information. A simple computer
program that uses an algorithm to solve a problem cannot supply an answer if all the
parameters needed are not given.
• However an expert system makes a best guess just like a human would when a problem needs
to be solved and the optimum solution cannot be determined. The idea is to come up with a
solution just as people come up with a (hopefully) good solution rather than none at all. While
the solution may only be 95% as efficient as the optimum solution, that's still better than no
solution.
Trees
• A hierarchical data structure consists of ;
Nodes : store information.
Branches : connect nodes.
The top node is the root. (highest hierarchy )
The bottom nodes are leaves. (lowest hierarchy).
Binary tress
• Each node, except the root has only one parent.
• Every node gives rise to a maximum of two nodes.
Binary tree
Graphs
• Graphs are called network or net.
• In graph there is no parent or child.
• There are different types of graphs
- Weighted graph
- Directed graph.
• Loops in graph is a link that comes back to the node itself.
Graphs types
1. A cycle (circuit graph)
Graph that have the same starting and end point.
2. Acyclic graph.(graph that has no cycles)
3. Connected graph (have links to all nodes)
4. Diagraph graphs with directed arrows.
5- lattice
Animals decision tree
Species of raspberries
Making decisions
• Trees/ lattices are used for classification decisions mainly.
• trees/lattices are useful for reasoning about knowledge.
Converting trees to rules
• Decision structures can be mechanically translated into production
rules. This can easily be done by a breadth-first search of the tree and
generating IF-THEN rules at every node. For example, the decision
tree of Figure 3.3 could be translated into rules as follows:
• IF QUESTION = "IS IT VERY BIG?" AND RESPONSE = "NO" THEN
QUESTION = "DOES IT SQUEAK?"
• IF QUESTION = "IS IT VERY BIG?" AND RESPONSE = "YES" THEN
QUESTION := "DOES IT HAVE A LONG NECK?"
Prolog revision
• Difference between facts and rules.
• Definition of family tree problem.
• Father rule, sister rule.
• Defining a rule using a rule.
• Recursive rule.
• Prolog syntax.
Today
• Prolog lists.
Prolog lists declaration
Lists in Prolog
Lists in Prolog
• member( b, [a,b,c] )
Lists in Prolog
• X is a member of L if either
(1) X is the head of L, or
(2) X is a member of the tail of L.

• member( X, [X I Tait] ).
• member( X, [Head I Taill ) :-
member( X, Tail).
Lists in Prolog
• conc( [X I L1], L2, [X I L3] ) :-
conc( L1, L2,L3).
Lists in Prolog
Prolog lists
• Member.
• Concatenation.
• Building member using concatenation rule.
• Adding an item in list.
• Delete from list.
• Insert into list.
Member rule in lists
member( X, [X I Tait] ).
member( X, [Head I Taill ) :-
member( X, Tail).
Concatenation rule
Concatenation results
Concatenation example
Using member rule to describe concatenation
• member( X, L) :.
conc( L1, [X I L2], L).
Adding an item into list
Deleting an item from a list
Delete an item from list definition
Deleting elements from list
Insert an item into list using delete rule
Finding length of a list
Sublist
Sublist
Sublist
Permutation of list
Permutation of list

You might also like