wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Simple AI Symptom Diagnosis Using LISP – Rule-Based Expert System

profile
Sejal Jethwa
Jul 16, 2025
1 Like
0 Discussions
2 Reads

(defun diagnosis ()

(format t "%Welcome to AI Symptom Checker!%")

(format t "Please enter your symptoms (e.g., fever, cough, headache).~%")

(format t "Type 'exit' to quit.~%")


(loop

(format t "~%Your Symptoms: ")

(force-output) ;; Force flush to display prompt before input

(let* ((input (read-line))

(symptoms (string-downcase input))) ;; Normalize input to lowercase

(cond

((string= symptoms "exit")

(format t "Goodbye! Take care.~%")

(return))

((and (search "fever" symptoms)

(search "cough" symptoms)

(search "body pain" symptoms))

(format t "Diagnosis: You may have the flu.~%"))


((and (search "fever" symptoms)

(search "headache" symptoms))

(format t "Diagnosis: You may have a viral fever.~%"))


((and (search "cough" symptoms)

(search "sore throat" symptoms))

(format t "Diagnosis: You may have a common cold.~%"))


((and (search "sneezing" symptoms)

(search "itchy eyes" symptoms))

(format t "Diagnosis: You may have an allergy.~%"))

((search "headache" symptoms)

(format t "Diagnosis: You might be dehydrated or stressed.~%"))


((search "fever" symptoms)

(format t "Diagnosis: You may be experiencing a mild fever or infection.~%"))


((search "cough" symptoms)

(format t "Diagnosis: You might have a throat infection or irritation.~%"))


(t

(format t "Diagnosis: Symptoms unclear. Please consult a doctor.~%"))))))


(diagnosis)


Comments ()


Sign in

Read Next

Broken Authentication Attacks

Blog banner

Deadlock

Blog banner

How to Encrypt and Decrypt Using GNU PGP

Blog banner

Evolution of Operating system

Blog banner

Little Habits, Big Impact: Daily Preschool Routines That Shape the Future

Blog banner

Data Science & AI

Blog banner

Virtual memory

Blog banner

E-Cash (Electronic Cash)

Blog banner

Sage business cloud accounting

Blog banner

Teamwork

Blog banner

Pandas Matrix Applications

Blog banner

What's Better : Supervised or Unsupervised Learning

Blog banner

Benefits of Yoga

Blog banner

CYBER FORENCIS: PAST, PRESENT AND FUTURE.

Blog banner

JUSTICE FOR EVERY “BEZUBAAN ANIMAL”

Blog banner

INTERNET

Blog banner

What is service level Agreement?

Blog banner

OPERATING SYSTEM

Blog banner

The Importance of Eating on Time: How Meal Timing Affects Your Health

Blog banner

Deadlocks in Operating Systems

Blog banner

Rock, Paper, Scissors Game in Common Lisp

Blog banner

Southern Turkey Earthquake: Causes and Consequences of a Tragic Natural Disaster

Blog banner

A Weekend at Oak Tree Hotel: The Best Hotel Experience in Arcadia, Florida

Blog banner

Google

Blog banner

semaphores in os

Blog banner

Drawing tips for a beginner

Blog banner

Deadlock in operating system

Blog banner

The Difference Between Plaque and Tartar Explained Simply

Blog banner

Virtual memory in os

Blog banner

Disk scheduling

Blog banner

Buffers in Operating Systems

Blog banner

Operating system

Blog banner

Vikrant’s first blog

Blog banner

Technological Advancement

Blog banner

5 Common Faults In Construction Tenders

Blog banner

Spyware

Blog banner

Analysis of Digital Evidence In Identity Theft Investigations

Blog banner

Virtual machine

Blog banner

PYTHON

Blog banner

Virtual Machine

Blog banner

VIRTUAL MACHINE

Blog banner

AOL Mail

Blog banner