Building Expert Systems in Prolog - Institute of Computer Science
Expert Systems & Prolog
-
Upload
fatih-karatana -
Category
Education
-
view
2.977 -
download
9
description
Transcript of Expert Systems & Prolog
THANK YOU ALLTHANK YOU ALL
EXPERT SYSTEMS &PROLOG
1
EXPERT SYSTEMSEXPERT SYSTEMS
OVERVIEW
An experts system is a system that
incorporates concepts derived from experts
in a field and uses their knowledge to
provide problem analysis through programs
available to clinical practitioners.
2
EXPERT SYSTEMSEXPERT SYSTEMS
IDEA OF EXPERT SYSTEMS
The most common form of expert system is
software made up of a set of rules that
analyze information.
3
EXPERT SYSTEMSEXPERT SYSTEMS
IDEA OF EXPERT SYSTEMS
SYSTEM
KNOWLEDGE BASE
KNOWLEDGE BASE
INPUTINPUT OUTPUT
FeedbackResult
4
EXPERT SYSTEMSEXPERT SYSTEMS
SOME PROMINENT EXPERT SYSTEMS
Dendral, analyses mass spectra
CADUCEUS, blood-borne infectious bacteria
R1/XCon, order processing
5
EXPERT SYSTEMSEXPERT SYSTEMS
SOME PROGRAMMING LANGUAGE
Prolog, programming language used in the development of expert systems
CLIPS, programming language used as Prolog to develop expert systems
Jess (Java Expert System Shell), A CLIPS engine implemented in Java used to develop expert systems.
6
EXPERT SYSTEMSEXPERT SYSTEMS
CHAINING
There are two main methods of reasoning
when using inference rules:
Forward Chaining
Backward Chaining
7
EXPERT SYSTEMSEXPERT SYSTEMS
FORWARD CHAINING
Forward chaining starts with the data
available and uses the inference rules to
conclude more data until a desired goal is
reached.
8
EXPERT SYSTEMSEXPERT SYSTEMS
FORWARD CHAINING
An inference engine using forward chaining
searches the inference rules until it finds one
in which the if-clause is known to be true. It
then concludes the then-clause and adds
this information to its data. It would continue
to do this until a goal is reached.
9
EXPERT SYSTEMSEXPERT SYSTEMS
FORWARD CHAINING
TRUETRUE
KNOWLEDGE BASE
IF IF THENTHEN
ADD KNOWLEDGE
CONCLUDED
10
EXPERT SYSTEMSEXPERT SYSTEMS
BACKWARD CHAINING
Backward chaining starts with a list of goals
and works backwards to see if there is data
which will allow to it to conclude ant of these
goals.
11
EXPERT SYSTEMSEXPERT SYSTEMS
BACKWARD CHAINING
An inference engine using backward
chaining would search the inference rules
until it finds one which has a then-clause
that matched a desired goal.
12
EXPERT SYSTEMSEXPERT SYSTEMS
BACKWARD CHAINING
Suppose a rule-based contains two rules:
1. If Fritz is green then Fritz is a frog.
2. If Fritz is a frog then Fritz hops.
13
EXPERT SYSTEMSEXPERT SYSTEMS
BACKWARD CHAINING
Frog is green.Frog hops.
Frog is green.Frog hops.
Knowledge
IFIF FRITZ is Green THENTHEN FRITZ is Frog
IFIFTH
EN
TH
EN
FRITZ is Frog
14
EXPERT SYSTEMSEXPERT SYSTEMS
END USER
Here is a dialog between end user and an
expert system:
15
EXPERT SYSTEMSEXPERT SYSTEMS
DIALOG:
Q. Do you know which restaurant you want to go to? A. No Q. Is there any kind of food you would particularly like? A. No Q. Do you like spicy food? A. No Q. Do you usually drink wine with meals? A. Yes Q. When you drink wine, is it French wine? A. Yes
16
EXPERT SYSTEMSEXPERT SYSTEMS
RESULT:
A. I am trying to determine the type of restaurant to
suggest. So far Chinese is not a likely choice. It is
possible that French is a likely choice. I know that if
the diner is a wine drinker, and the preferred wine is
French, then there is strong evidence that the
restaurant choice should include French.
17
PROLOGPROLOG
HISTORY
The name Prolog was chosen by Philippe Roussel as
an abbreviation for "PROgrammation en LOGique”
(French for programming in logic).
It was created around 1972 by Alain Colmerauerr with
Philippe Roussell, based on Robert Kowalski's
procedural interpretation of Horn clauses.
18
PROLOGPROLOG
DATA TYPES
Prolog's single data type is the term. Terms are either
atoms, numbers, variables or compound terms.
19
PROLOGPROLOG
Programming in Prolog
Prolog programs describe relations, defined by
means of clauses. Pure Prolog is restricted to Horn
clauses, a Turing-complete subset of first-order
predicate logic. There are two types of clauses: Facts
and rules.
20
PROLOGPROLOG
Programming in Prolog
An example of a fact is:
cat(tom).
which is equivalent to the rule:
cat(tom) :- true.
21
PROLOGPROLOG
EVALUATION
Execution of a Prolog program is initiated by the
user's posting of a single goal, called the query.
Logically, the Prolog engine tries to find a resolution
refutation of the negated query. The resolution
method used by Prolog is called SLD resolution. If the
negated query can be refuted, it follows the query.
22
PROLOGPROLOG
For example:sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).
parent_child(X, Y) :- father_child(X, Y).
parent_child(X, Y) :- mother_child(X, Y).
mother_child(trude, sally).
father_child(tom, sally).
father_child(tom, erica).
father_child(mike, tom).
This results in the following query being evaluated as true:
?- sibling(sally, erica). Yes
23
PROLOGPROLOG
Related languages Visual Prolog, also formerly known as PDC Prolog
and Turbo Prolog.
Datalog is actually a subset of Prolog.
In some ways Prolog is a subset of Planner. The ideas
in Planner were later further developed in the
Scientific Community Metaphor.
24
EXPERT SYSTEMSEXPERT SYSTEMS
ADVANTAGES
Provide consistent answers for repetitive decisions,
processes and tasks
Hold and maintain significant levels of information
Reduces creating entry barriers to competitors
Review transactions that human experts may
overlook
25
EXPERT SYSTEMSEXPERT SYSTEMS
DISADVANTAGES
The lack of human common sense needed in some decision
makings
Domain experts not always being able to explain their logic
and reasoning
The lack of flexibility and ability to adapt to changing
environments as questions are standard and cannot be
changed
Not being able to recognize when no answer is available
26