0% found this document useful (0 votes)
28 views

BSCS-413 (AI) Lab Sheet # 3 Class: BSCS: Object: To Test A Simple Disease Diagnosis System - A Case Study

This document describes a lab sheet assignment to modify a simple disease diagnosis system to include a loop. The original Prolog code takes a patient name as input and asks a series of yes/no questions to diagnose either the flu or a headache. The modification required is to [1] add a predicate called 'again/0' that asks "Do you want to continue? (Y/N)" after each diagnosis and [2] include a loop so that the code will repeat based on the user's response.

Uploaded by

Simra Javed
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

BSCS-413 (AI) Lab Sheet # 3 Class: BSCS: Object: To Test A Simple Disease Diagnosis System - A Case Study

This document describes a lab sheet assignment to modify a simple disease diagnosis system to include a loop. The original Prolog code takes a patient name as input and asks a series of yes/no questions to diagnose either the flu or a headache. The modification required is to [1] add a predicate called 'again/0' that asks "Do you want to continue? (Y/N)" after each diagnosis and [2] include a loop so that the code will repeat based on the user's response.

Uploaded by

Simra Javed
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

BSCS-413 (AI)

OBJECT:

Lab Sheet # 3

Class: BSCS

TO TEST A SIMPLE DISEASE DIAGNOSIS SYSTEM A CASE STUDY

go :write(What is the name of Patient?), read(Patient),nl, hypo(Patient, Disease), write(Patient),write( probably has ),write(Disease),nl. go:write(Sorry I am unable to diagnose the Disease.),nl. hypo(Patient,flu):sym(Patient,fever), sym(Patient,cough). hypo(Patient,headche):sym(Patient,bodypain). sym(Patient,fever):write( Does ),write(Patient),write( has fever (y/n)?), res(R), R=y. sym(Patient,cough):write(Does ),write(Patient),write( has cough (y/n)?), res(R), R=y. sym(Patient,bodypain):write(Does ),write(Patient),write( has bodypain (y/n)?), res(R), R=y. res(R):read(R),nl. Goal: Apply a loop in the above given code so that it will ask, Do you want to continue? (Y/ N) And than act accordingly. Hint: make a predicate again/0 for doing above task.

You might also like