38
What is AI ????????????? The AI problems (eg.Chess etc.) The underlying assumption What is AI technique ? - Intelligence requires knowledge Knowledge properties:- .. It is voluminous .. It is hard to characterize accurately .. It is constantly changing .. Organized way & usage -differ AI Technique representation knowledge captures generalization To be Understood by people who provide it Easily to be modified to correct errors To be useful in great many situations To be useful under narrow range of possibilities that must be considered Tic- tac – toe To play Tic-Tac-toe (magic square ) Complexity

artficial intelligence

Embed Size (px)

Citation preview

Page 1: artficial intelligence

What is AI ?????????????

 •   The AI problems (eg.Chess etc.)

•   The underlying assumption

•   What is AI technique ?

- Intelligence requires knowledge

Knowledge properties:-

.. It is voluminous

.. It is hard to characterize accurately

.. It is constantly changing

.. Organized way & usage -differ

 AI Technique representation

•   knowledge captures generalization

•   To be Understood by people who provide it

•   Easily to be modified to correct errors

•   To be useful in great many situations

•   To be useful under narrow range of possibilities that must be considered

Tic- tac – toe

•   To play Tic-Tac-toe

•   (magic square )

•   Complexity

•   Generalized usage

•   Clarity of their knowledge

•   Extensibility of their approach

Page 2: artficial intelligence

Programs

•   Board

•   Nine element vector representing the board positions such that no number is to be repeated

•   Row sum = column sum = diagonal sum

•   Algorithm

•   Comments

Knowledge representation

Facts….> internal ……………..Reasoning

Representation.. programs

 

English ……………………………….english

Understanding………………..generation

 

English

Representation

Mapping between facts & representations

·       Knowledge level

·       Symbol level

 English : spot is a dog

 Logic : dog(spot)

 For every x : dog(x) ..> hastail(x)

 Then hastail(spot)

Page 3: artficial intelligence

Representation of Facts

Initial …..desired real …..final

Facts reasoning facts

! ^

* ! ! *

V !

Forward Backward

representation representation

mapping mapping

operation

of programs

Internal ….………………..> Internal

Representation representation

Of initial of final

Facts facts

 

Approaches to knowledge representation

·       Representation adequacy

·       Inferential adequacy

·       Inferential efficiency

·       Acquisitional efficiency

Page 4: artficial intelligence

Knowledge

1.Inheritable

2.          inferential

3.          Procedural

Simple relational knowledge

Player ht wt bats/throws

Hank 6-0 180 right/right

Wille 5-10 176 right/left

Babe 6-2 215 left/left

Wilman 6-3 205 left/right

 

Representing sets of objects

 

Eg. Set of SUN’s planets on which people live is { earth}

 

{ x : sun-planet(x) ^ human-inhabited(x) }

 Finding the Right Structures as Needed

 ·    How to perform an initial selection of the most appropriate structures ?

 ·    How to fill in appropriate details from the current situation ?

 ·    How to find a better structure?

 ·    What to do if none is available ?

 ·    When to create and remember a new structure ?

 

Page 5: artficial intelligence

The Frame problem

Similarity net……

 Chair->Table->Desk->Sideboard

Chair -> Table :: too big, no back

Table-> desk :: drawers

Desk-> sideboard :: no knee room

 

Using predicate logic

Simple facts in prepositional logic

It is raining

RAINING

It is sunny

SUNNY

It is windy

WINDY

If it is raining , then it is not sunny

RAINING NOT SUNNY

Eg. Socrates is a man

Plato is a man

Then represent as follows :-

MAN(SOCRATES)

MAN(PLATO)

 

Page 6: artficial intelligence

Some Facts

1.Marcus was a man.

2.                      Marcus was Pompeian.

3.                      All Pompeians were Romans.

4.                      Caesar was a ruler.

5.                      All Romans were either loyal to Caesar or hated him.

6.                      Everyone is loyal to someone.

7.                      People only to try assassinate rulers they are not loyal to.

8.                      Marcus tried to assassinate Caesar .

 

Now write the Predicate logic :-

 

1.            man(Marcus)

2.          Pompeian(Marcus)

3.          for all x such that Pompeian(x) -> Roman(x)

4.          ruler(Caser)

5.          for all x such that Roman(x)

->loyalto(x,Caesar) or hate(x,Caesar)

6.          for all x, there exists y such that loyalto(x,y)

7.          for all x such that for all y person(x) and ruler(y) and tryassassinate(x,y) ->not loyalto(x,y)

8.          tryassassinate(Marcus,Casear)

 

Page 7: artficial intelligence

Conclusion:-

Was Marcus loyal to Caesar ?

From 7 & 8 we prove that Marcus was not royal to Caesar.

Notroyal(marcus,Caesar)

Symbolic Reasoning under uncertainty

 

Introduction to Nonmonotonic Reasoning

·    To reason with incomplete information

 ·    At any time , a statement is believed to be true, believed to be false, or not believed to be either

 Whereas in Statistical reasoning, the representation allows some kind of numerical measure of certainty ( rather than simple true or false )

 Eg. Consider a case :

 1.That Abbott did not commit the crime

2.          That Babbitt did not

3.          That Abbott or Babbitt or Cabot did

4.          That Cabot did not

 

Properties of conventional reasoning system

 ·    It is complete with respect to the domain of interest

·    It is consistent

·    The facts can be added when they are available

Page 8: artficial intelligence

 

If these properties are missing then conventional logic based reasoning systems will not work.

 

·    At that time Nonmonotonic reasoning systems are designed to solve the problems.

Logics for Nonmonotonic reasoning

 1.Define the set of possible words for the given facts

2.                      Provide a way that we believe in some models rather than others

3.                      Provide the basis for the practical implementation of this kind of reasoning

4.                      Correspond to our intuitions about how this kind of reasoning works

 

To use nonmonotonic reasoning, Default reasoning is necessary

 Default reasoning :

 To draw conclusions based on what most likely to be true

 Nonmonotonic Logic(NML)

 Consider the formula

For all x,y : Related(x,y) and

M Getalong(x,y) -> WillDefend(x,y)

This means that

 For all x,y , if x and y are related and if x gets along with y with everything else that is believed , then conclude that x will defend y

Here M is called modal operator

 

In the original formulation of NML , the semantics of the modal operator M which is self-referential , were unclear.

Page 9: artficial intelligence

 Default Logic(DL)

 Reiter’s Default logic has the inference rule has

A : B

C

This means that

“ if A is provable and it is consistent to assume B then conclude C “

 Abduction

 Standard logic performs deduction

Given two axioms,

For all x, : A(x) -> B(x)

A( C )

 Then we can conclude B(C) using deduction.

 What about reverse ?

 For example

Suppose the axiom as

For all x : Measles(x)->Spots(x)

 This means that Measles implies having spots.

 Supposing we notice spots, we conclude Measles on the reverse.

But that conclusion is not licensed by the standard rule of logic and it may be wrong too many a times.

But it may be a best Guess !

This specific form is called abductive reasoning.

Inheritance

Page 10: artficial intelligence

 One common use of nonmonotonic reasoning is as a basis for inheriting attribute values from a prototype description of a class to the individual entities that belong to the class.

 Minimalist reasoning

 Methods for saying very specific and highly useful class of things that are generally true.

 Closed world assumption (CWA)

 A simple kind of minimalist reasoning is suggested by CWA

 Eg. A(Joe) or B(Joe)

This is a single statement

 The resulting extended knowledge base is

 A(Joe) or B(joe)

 Not A(Joe)

 Not B(joe)

 Is inconsistent.

 Again consider

 Single(John)

Single(Mary)

 The CWA will yield

Not single(jane)

 Now consider the predicate married in place of single.

Not Married(John)

Not Married(Mary)

The CWA will yield

Not Married(Jane)

Implementation issues

Page 11: artficial intelligence

In real systems follow the points:-

1.How to derive exactly those nonmonotonic conclusions that are relevant to solve the problems.

2.          How to increment our knowledge base as problem progresses.

3.          In nonmonotonic reasoning systems, more than one interpretation is possible . How to manage these ?

4.          These theories are not computationally effective and so none is effective.

 

Augmenting a problem solver

1.Reason forward from what is known

2.                      Reason backward to find out whether some expression P is true.

Truth maintenance systems

Justification based truth maintenance systems

Logic based truth maintenance systems

Statistical reasoning

Probability

·    Tossing a coin and getting head or tail

·    P(H)= 1/2 P(T)=1/2

·    Rolling a die

·    P(any No.to occur)=1/6

·    P(Hi / E) = Probability that hypothesis Hi is true given evidence E

·    P(E / Hi) = the probability that we will observe evidence E given that hypothesis Hi is true

Page 12: artficial intelligence

·    P(Hi) = the a priori probability that hypothesis Hi is true in the absence of any specific evidence.

·    K= No of possible hypothesis

·    Then Baye’s theorem states that

·    P(Hi / E) = P(E/Hi) . P(Hi)

·    ----------------

·    sum(P(E/Hi).P(Hi))

·    PROSPECTOR is AI system to locate any mineral from the earth using the above theorem (1979 Duda et.al.)

 

Example : Ball problems

There are two boxes A & B

A has 4 Red balls 3 White balls

B has 5 Red balls 4 White balls

Q1. What is P(A/R) ?

Q2. What is P(A/W) ?

Q3. What is P(B/R) ?

Q4. What is P(B/W) ?

nextQ.A red ball from A is put in B

Q1. What is P(A/R) ?

Q2. What is P(A/W) ?

Q3. What is P(B/R) ?

Q4. What is P(B/W) ?

nextQ.A white ball of A is put in B

Q1. What is P(A/R) ?

Page 13: artficial intelligence

Q2. What is P(A/W) ?

Q3. What is P(B/R) ?

Q4. What is P(B/W) ?

Similarly reverse problem can be thought of.

Q.There are two boxes A & B

A has 5 Red balls 3 White balls

B has 3 Red balls 5 White balls

A ball of A is put in B

Then What is P(A/R) ?

What is P(A/W) ?

After transferring the ball,

It can be either R or W.

Mutually exclusive case.

What is P(B/R) ?

What is P(B/W) ?

Thus, Baye’s theorem helps this type of problem-solving as a statistical reasoning.

Applied intelligent system in oil & gas industry

 

Case study

There are 5 wild cat areas of oil & gas as follows:-

Area 1 : 3 gas and 2 oil wells

Area 2 : 1 gas and 2 oil wells

Page 14: artficial intelligence

Area 3 : 4 gas and 2 oil wells

Area 4 : 2 gas and 4 oil wells

Area 5 : 5 gas and 3 oil wells

Apply Baye’s theorem and discuss

The following :-

P(G) ? P(O) ?

P(G OR O) ?

P(G AND O) ?

Certainty Factors & Rule-based systems

MYCIN system

It is a kind of rule based expert system.

- performs the task normally done by human expert 1

- It represents most of its diagnostic knowledge as a set of rules.

A typical rule

If 1. the strain of the organism is gram-positive and

2.the morphology of the organism is coccus and

3. the growth confirmation of the organism is clumps,

then there is suggestive evidence that the identity of the organism is staphylococcus.

This is the form in which the rules are stated to the user.

 

Uncertain Rules

Now combine uncertain rules and apply the properties :-

1. Since the order in which evidence is collected is arbitrary, the combining functions should be commutative and associative.

Page 15: artficial intelligence

2. Until certainty is reached , additional combining evidence should increase MB and (similarly for disconfirming evidence and MD) where MB means a measure of belief ( between 0 and 1) and MD is a measure of disbelief (between 0 and 1)

3. If uncertain influences are chained together then the result should be less certain than either of the inferences alone.

Game playing

Games provide good domain to explore machine intelligence :

1.            Providing a structured task in which it is easy to measure success or failure

2.          They need not large amount of knowledge.

The first is true but not the second !

Why ?

Consider chess game. An average player needs minimum of 50 moves ! so in order to complete the game we have to examine 100 to the power of 35, if average branching factor is 35 !

Thus huge amount of knowledge is necessary.

The MINIMAX search

One ply-search

A

B C D

8 3 -2

Apply Minimum ply

Then A(-2)

Apply maximum ply

Then A(8)

 

Two ply search

Page 16: artficial intelligence

 

A

B C D

E F G H I J K

9 -6 0 0 -2 -4 -3

APPLY MINIMIZING AND MAXIMIZING AND GET THE BACK-UP VALUES

Apply Minimizing ply ,

We find that

B(-6) , C(-2), D(-4)

Then apply Maximizing ply,

We get A(-2)

 

Application :

In the case of profit center concept, maximizing ply and in the case of expenses, minimizing ply are applied as applied intelligent systems.

 

This is called Minimax Search Procedure.

 

·    This procedure is very simple

·    Performance is improved significantly with a few refinements.

How ?

Consider the example :

Alpha Cutoff

Page 17: artficial intelligence

A Maximize

B C

D E F G Minimize

3 5 -5

Answer

A(>3) Maximize

B(3) C(< -5)

D E F G Minimize

3 5 -5

 

Similarly when we apply Minimizing ply, then maximizing ply, then minimizing ply, and then maximizing ply, it is called Alpha and Beta Cutoffs.

There are other varieties of modifications to minimax procedure to improve its performance.

Class work :

Create some example for Alpha and Beta procedure .

Natural language processing

Language – for communication about the world.

Language processing – two taks

1.             Processing written text, using lexical , syntactic and semantic knowledge of the language

2.          Processing spoken language, using all the information needed + additional knowledge to handle any confusions that arise in speech.

Page 18: artficial intelligence

Problem

 Some dogs are outside =>

1.Some dogs are on the lawn

2.Three dogs are on the lawn

3.Rover, Tripp, Spot are on the lawn.

 

I called Lynda to ask her to the movies. She said she would love to go. =>

1. She was home when I called.

2. She answered the phone.

3. I actually asked her.

Good side

1. Language allows speakers to be as vague or as precise as they like.

2. It also allows speakers to leave out things they believe their hearers already know.

 

Problem

The same expression means different things in different context.

1. Where’s the water ?(In chemistry lab, it must be pure)

2. Where’s the water ? (when you are thirsty ,it must be potable)

3. Where’s the water ? (dealing with a leaky roof )

Good side

Language lets us communicate about an infinite world using a finite number of symbols.

The problem (lot of ways of saying)

Mary was born on Oct.11.

Page 19: artficial intelligence

Mary’s birthday falls on Oct.11.

Good side:

when you know a lot ,facts imply each other.

Thus language is used as agents who know a lot.

 

Steps in the process

 

1. Morphological Analysis

- Individual words are analysed into components.

- Punctuations are separated from words.

 

‘print’,’file’ can all function more than one syntactic category.

2. Syntactic Analysis

Linear sequences of words are transformed into structures that show how the words relate to each other.

Some word sequences may be rejected if they violate the rules of the language grammer.

Eg. “Boy the go to store”

3. Semantic Analysis

The structure created by the syntactic analyzer are assigned meanings. In other words, a mapping is made between syntactic structures and objects in the task domain. If no such mapping is possible then such structures will be rejected.

Eg. “colorless green ideas sleep furiously” will be rejected.

A knowledge base fragment

User068

Instance: user

Page 20: artficial intelligence

Login-name: susan-black

F1

Instance: File-struct

Name: stuff

Extension: .init

Owner: user073

In-director: /wsmith/

 

4. Discourse Integration

The meaning of individual sentence may depend on the sentences that precede it and may influence the meaning of sentences that follow . For eg. ‘it’,

‘John wanted it ‘

5. Pragmatic Analysis

The structure representing what was said is reinterpreted to find out what was actually meant.

Eg. ‘ Do you know what time is ?’ is reinterpreted as a request to be told time.

Representing the indended meaning

Meaning

Instance: commanding

Agent: user068

Performer: this-system

Object: p27

Instance: printing

Agent: this-system

Object: F1

Page 21: artficial intelligence

Expert Systems (ES)

Expert system is a prototype computerized system to behave like an expert in a particular filed of specialization, like medical, oil & gas industry etc.

Example :

1. MYCIN is an expert system in medical field.

2. PROSPECTOR is an expert system in Oil & Gas industry.

Expert system is classified as

ES = KA + KB + IA + PD

WHERE

ES :: Expert system

KA :: Knowledge Acquisition

KB :: Knowledge Base

IA :: Inferential Analysis

PD :: Prototype Development

 

Discuss : Medical system under above classification.

Merits of Expert System :

·    Acts like an expert when real expert in a particular filed of specialization is not available.

·    Time saving.

·    Cost – effective.

·    Most Modern.

·    Faster solution provider.

·    No need of appointment of real expert.

·    Multiple solutions are possible.

Page 22: artficial intelligence

·    Multiple consultations are possible.

·    Case – study oriented.

·    Easy to use.

 

Demerits

 

·    Successful 25-30 % only world wide.

·    Real Experts do not offer their expertise knowledge to develop the system for fear of loosing importance personally.

·    If not updated periodically, wrong conclusions are possible.

·    Due to multiple solutions, some times confusions are possible.

·    Awareness in the minds of people is lacking and thereby belief is not there much.

·    A lot of difficulty in Knowledge Acquisition.

·    Time consuming job – development of ES.

 

 

IMPORTANT:

Entering knowledge , maintaining the knowledge base consistency , ensuring knowledge base completeness are the key factors of success of expert systems.

MOLE (Eshelman 1988) is a knowledge acquisition system dealing with diagnosing diseases.

SALT (Marcus 1989) is a program to provide mechanism for extracting knowledge from an expert.

META-DENDRAL (Mitchell 1978) is the first program to use learning techniques to construct rules for an expert system automatically.

Conclusions:

Page 23: artficial intelligence

·    Expert systems offer their power in a domain specific knowledge rather than a single powerful technique

·    In successful systems, the needed knowledge is about a particular area and is well-defined.

 ·    An expert system is built normally with the aid of one or more experts.

 ·    Transfer of knowledge takes place gradually after many interactions.

 ·    The amount of knowledge is depending on a task.

 ·    The choice of control structure depends on specific characteristics of the system.

 ·    It is possible to extract non-domain specific parts from existing expert systems and use them to build a new expert system in new domains.

What is learning ?

Often AI – machines are blamed that they cannot be called intelligent until they are able to do new things and adapt to new situations rather than simply doing things as directed !

 

Knowledge Acquisition itself includes many different activities.

- Simple storing of computed information or rote learning , is the basic learning activity.

Rote learning

A

B C D

 

E F G H I J K

 

- Rote learning of this sort is very simple.

- It does not appear to involve any sophisticated problem solving capabilities .

Page 24: artficial intelligence

- ORGANISED storage information

- generalization

 

Learning by taking advice

A computer program might make use of the advice by adjusting its static evaluation function to include factor-based on the number of center squares attacked by its own pieces , in Chess.

Learning in problem solving

- Learning by parameter adjustment

- Learning with macro - operators

- Learning by Chunking : is a process similar to macro-operators

(memory & problem solving )

 

Learning from examples : Induction

- class discussions

Decision trees

- class discussions

Explanation based learning

- class discussions

Discovery

- class discussions

Formal Learning theory

- class discussions

Neural Nets

First efforts in machine learning – tried to mimic animal learning at a neural level !

Page 25: artficial intelligence

- This is quite different from symbolic manipulation methods

- Neural network models are based on computational “brain metaphor”

- A number of other learning techniques make use of metaphor based on evolution.

- Learning algorithms inspired by evolution are called genetic algorithms.

Learning in Neural Networks

Perceptrons

- An invention of Rosenblatt(1962), one of the earliest nueral network models.

- A perceptron models a neuron by taking weighted sum of its inputs and sending the output ‘1’ if the sum is greater than some adjustable threshold value or otherwise it send ‘0’.

Let the inputs be (x1,x2,……xn) and the weights be (w1,w2,…..wn)

Consider g(x) = sum(wi.xi)

o(x) = 1 if g(x) > 0

= 0 if g(x) < 0

Early notion of intelligent system built from Trainable perceptrons

A linearly separable pattern classification problem fig. 18.9 page 496.

Applications of neural networks

-        Pattern recognizers and associative memories

-        Pattern transformers

-        Dynamic inferencers

 

- Most of the people use the first category in industrial applications.

- Some are using the second category too.

 

Page 26: artficial intelligence

-        Third one is still in primitive stage.

Turbo prolog programming

It is a trade-mark of Borland international Inc.

- The name ‘prolog’ is taken from ‘programming in logic’

- Originally developed in 1972 by

Alain Colmerauer & P.Roussel,

University of Marseiles,France.

Starting Turbo prolog

c>PROLOG

Then the user-friendly editor appears as follows:-

 

Run Compile Edit Options Files Setup Quit

Editor

Line1 Col1 Indent Insert Work.pro

 

 

 

 

 

 

----Dialog-----

--------Message-----------------Trace----------

Page 27: artficial intelligence

 

 

Use first letter of Option or select with -> or <-

Create a Sample program

 

1.Select Edit mode & enter program

2.                      Enter text or corrections as necessary

3.                      Save the program to disk

4.                      Compile the program

5.                      Execute the program

 

Similar to Turbo pascal

 

SAMPLE TEST PROGRAM

Run Compile Edit Options Files Setup Quit

Editor

Line1 Col1 Indent Insert Work.pro

/* SAMPLE TEST PROGRAM */

predicates

likes(symbol , symbol)

clauses

likes(frank,sue).

----Dialog-----

Page 28: artficial intelligence

likes(Harold,ruth).

 

 

 

--------Message---------

 

 

--------Trace----------

F1:Help F3:Search F4:Subst F5:Copy F6:Move F7:del F8:ExtEdit F9:ExtCopy F10:End

 

Starting to execute the program

To compile and execute the

program exit the editor using Esc

or F10. Then select the Run option

from the main menu.

 

If NO errors, then see the prompt

in dialog box as follows:-

 

If error, turbo prolog will return

to the ditor.

 

Then compile again till ‘No error’

Page 29: artficial intelligence

SAMPLE TEST PROGRAM

Run Compile Edit Options Files Setup Quit

Editor

Line1 Col1 Indent Insert Work.pro

/* SAMPLE TEST PROGRAM */

predicates

likes(symbol , symbol)

clauses

likes(frank,sue).

likes(Harold,ruth).

 

----Dialog-----

Goal :-

--------Message---------

 

 

--------Trace----------

F1:Help F3:Search F4:Subst F5:Copy F6:Move F7:del F8:ExtEdit F9:ExtCopy F10:End

Goal : likes(Harold,ruth)<-! (return key press )

Turbo Prolog will reply to you as

True

Goal : ( wait for next goal )

Expressing Facts

(English to (Turbo)T. Prolog)

The right speaker is dead (English)

Is(right_speaker,dead). (T.prolog)

Page 30: artficial intelligence

Fact Relation

has_a(bill, computer). has_a

is_a(collie,dog). is_a

likes(sue,chocolate). Likes

Predicates (examples)

employee(bill)

eligible(mary)

marital_status(joyce,married)

 

For example, you can express the fact that mary is married and is eligible for employment as

eligible(mary) and marital-status(mary,married).

Facts expressed as prolog clauses

English: Bill is an employee.

Prolog: employee(Bill).

English: Bob is married to Mary.

Prolog: married_to(Bob,Mary).

English:The speaker is defective.

Prolog: defective_speaker.

English: Tom is a student.

Prolog: student(Tom).

Relationship of clauses, predicates, relations and objects.

Page 31: artficial intelligence

Clauses

|

|__________________|

Facts Rules

|________________|

Predicates Periods(.)

|____________|

Relations Arguments

|

|_______________|

Objects Variables

Example : Not for medical use !

 

domains

disease,indication=symbol

predicates

symptom(disease,indication)

clauses

symptom(chicken_pox,high_fever). symptom(chicken_pox,chills). symptom(flu,chills). symptom(cold,mild_body_ache). symptom(flu,severe_body_ache). symptom(cold,runny_nose). symptom(flu,runny_nose). symptom(flu,moderate_cough).

Goal : symptom(cold,runny_nose) <-!

Response from prolog :

True

Page 32: artficial intelligence

Goal : symptom(cold,headache) <-!

Response from prolog :

False

Using rules to solve the problems

Here another example to use

rules to solve the problems,

using hypothesis- concepts

Example : Medical Diagnostic System

 

domains

disease,indication,name=symbol

predicates

hypothesis(name,disease)

symptom(disease,indication)

clauses

symptom(charlie,fever). symptom(charlie,rash). symptom(charlie,headache). symptom(charlie,runny_nose).

Hypotheis(patient,measles):-

symptom(charlie,fever), symptom(charlie,rash), symptom(charlie,headache), symptom(charlie,runny_nose),

symptom(charlie,cough).

Hypotheis(patient,german_measles):-

symptom(charlie,fever), symptom(charlie,rash), symptom(charlie,headache), symptom(charlie,runny_nose).

Hypotheis(patient,flu):-

Page 33: artficial intelligence

symptom(charlie,fever), symptom(charlie,headache), symptom(charlie,body_ache), symptom(charlie,runny_nose),

symptom(charlie,cough).

Hypotheis(patient,mumps):-

symptom(charlie,fever), symptom(charlie,swollen_glands).

Goal : hypothesis(patient,disease)

Prolog display as follows:-

Goal : hypothesis(patient,disease)

Patient=Charlie,disease=german_measles

 

-O-