Make your own free website on Tripod.com

VP-EXPERT PROJECT SOURCE CODE DETAILS

MY VP-EXPERT PROJECT WAS ON CAR CLINICAL DIAGNOSTIC

The following are the source code used with VP-EXPERT 2.1 student edition.

Sample screen output provided - can be viewed but no options to return

To this page is available, please use browser back button to return to this page

The names of the files:

Explains using hyper text and mouse function about references used for the project. This file receives data from About.txt

Diagnose for aircond related problems

Diagnose for battery related problems. It is not logical\practical in anyway.

Diagnose for engine related problems

Coming soon

Execute this as the driver file for the project.

Diagnose for brakes, tyres and clutch related problems

Contains the text details for the About program

  [HOME] [VPEXPERT MAIN]

 

File name : About.txt

[TOP OF PAGE]

*ABOUT

 

 

This Project information

>> MEMBERS information sheet

>> PURPOSE of this project

>> REFERENCE materials

 

*MEMBERS

 

GROUP PROJECT

 

Project Leader PARK SEUNG JOON (HF970994)

Programming Leader NICHOLAS ADRIAN SUPPIAH (HF9709A5)

Knowledge Engineer 1 SAM LEE CHEAN (HF970956)

Knowledge Engineer 2 POH SOO LENG (HF970959)

Librarian POON CHEE YUEN (HF970942)

 

[ ABOUT ]

 

*PURPOSE

 

ASIA PACIFIC INSTITUTE OF INFORMATION TECHNOLOGY

 

HIGHER DIPLOMA IN COMPUTER SYSTEMS

ARTIFICIAL INTELLINGENCE

KNOWLEDGE BASED SYSTEMS

 

INTAKE : FULL TIME SEPTEMBER 1997

LECTURER : MR. VINCENT CHAN

DATE ASSIGNED : 24TH JUNE 1998

DATE DUE : 31ST JULY 1998

EXPERT SYSTEM DOMAIN - CAR DIAGNOSTIC.

[ ABOUT ]

 

*REFERENCE

Books

-Lyons, Patrick J., 1994, "Applying Expert System Technology

to Business", Intenational Thomson Publishing, USA

-Schultz, Mort, 1994, "What's Wrong with My Car?", Percetakan

Seasons Sdn Bhd, Kuala Lumpur

-Dologite, Dorothy G., 1993, "Developing Knowledge-based

Systems Using VP-Expert", Macmillan Publishing Co., USA

-Prerau, D.S., 1990, "Developing and Managing Expert System:

Proven Techniques for Business and Industry", Addison-

Wesley, USA.

 

Internet

-FAQ, Commercial Expert System Shells

http://www.edm.hull.ac.uk/material/57353/es_faq6.htm

-Intelligent Systems Research

http://fas.sfu.ca/1/ensc/research/groups/intelligent/

-search engine : infoseek

http://www.infoseek.com/

-search engine : Alta Vista

http://altavista.digital.com/

 

VPexpert software is a copyright of

-Wordtech Systems Inc, PO Box 1747, Concord,

CA 94520 USA, phone 510-689-1200, or fax 510-689-1263.

 

[ ABOUT ]

File name : About.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1] [2]

 

!NAME OF EXPERT SYSTEM: INFO ABOUT THIS PROJECT

!THE FILE NAME IS : ABOUT.KBS

! LAST UPDATE ON 7 JULY 1998

ENDOFF;

RUNTIME;

BKCOLOR = 1;

EXECUTE; !ACTIVATE THIS LINE ONLY WHEN THE PROG IS COMPLETE

ACTIONS

GMODE 16

EXIT = NO

MOUSEON

! GCLS

TOPIC = ABOUT !SETS VALUE OF FIRST HYPERTEXT HYPERWORD

LOADFACTS CHINFO

WHILETRUE EXIT = NO THEN END

CHAIN MAIN;

! TMODE;

RUNTIME;

HYPERTEXT TOPIC: 8,5,72,20,ABOUT,14,15;

LBUTTON EXIT: 30,4, 0, 7, RETURN_TO_MAIN_MENU;

 

WHENEVER 1

IF EXIT = YES

THEN RESET TOPIC;

 

WHENEVER MOUSEAVAILABLE

IF MOUSEAVAILABLE = YES

THEN MOUSEON;

 

File name : Air-cond.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1]

!NAME OF EXPERT SYSTEM: THE AIR-COND

!THE FILE NAME IS : AIRCOND.KBS

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

!****************************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

PRINTOFF

COLOR = 15

FIND PRTCTRL

FIND SOLUTION

LOADFACTS A:\CHINFO

DISPLAY " "

DISPLAY " "

DISPLAY "**************************************************************"

DISPLAY "BASED ON THE ANSWER YOU HAVE GIVEN, WE RECOMMEND :

 

{#SOLUTION}~"

PRINTOFF

FIND RETURN_MAIN

;

 

! EXECUTE; MAKE THIS LINE ONLY WHEN PROG IS DONE

 

! DECISION TABLE - SOLUTION

RULE 1-PRINTER

IF PRINTER = YES

THEN PRTCTRL = ON

DISPLAY " PLEASE TURN ON YOUR PRINTER. PRESS ANY KEY TO CONTINUE.~"

DISPLAY ""

PRINTON

EJECT;

 

! --[PRINTER STATEMENT BLOCK]--

ASK PRINTER:"DO YOU WISH TO PRINT OUT THE STATEMENTS & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

RULE 1-1

IF AIR-POWER = NO AND FUSE_OK = YES

THEN SOLUTION = REPLACE_AIR-COND_FUSE

BECAUSE "TO DETERMINE IF THERE IS ELECTRICAL SUPPLY.";

RULE 1-2

IF AIR-POWER = NO AND FUSE_OK = NO

THEN SOLUTION = CHECK_IGNITION_SYSTEM

BECAUSE "TO DETERMINE IF THERE IS ELECTRICAL SUPPLY.";

 

ASK AIR-POWER:

"IS THERE AIR COND POWER WHEN SWITCHED ON?";

CHOICES AIR-POWER: YES,NO;

 

ASK FUSE_OK: "OPEN THE FUSE BOX. LOOK FOR THE AIR-CONDITION FUSE.

IS THE FUSE BROKEN ?";

CHOICES FUSE_OK: YES, NO;

 

RULE 2-1A

IF AIR-POWER = YES AND COOLING = NOT_COOLING_AT_ALL

THEN HEAT = NONE

BECAUSE "THE AIR CONDITION IS NOT ABLE TO COOL MEANS

THAT THERE IS A BREAK IN THE SYSTEM OR THERE

IS A FAULTY HARDWARE.";

 

RULE 2-1B

IF AIR-POWER = YES AND COOLING = COOLING_INSUFFECIENTLY

THEN HEAT = MID

BECAUSE "THE AIR CONDITION IS NOT ABLE TO COOL MEANS

THAT THERE IS A BREAK IN THE SYSTEM OR THERE

IS A FAULTY HARDWARE.";

 

 

RULE 2-1C

IF AIR-POWER = YES AND COOLING = NEITHER AND AIR_CONTROL_OK = NO

THEN SOLUTION = REPLACE_THERMAL_CONTROL_PANEL

BECAUSE "THE CONTROL PANEL MUST HAVE BE ABLE TO

ACTIVATE THE TEMPERATURE.";

 

RULE 2-2A

IF HEAT = NONE

AND COMPRESSOR_BELT = YES

THEN SOLUTION = REPLACE_COMPRESSOR_BELT

BECAUSE "THE COMPRESSOR BELT RUNS THE COOLING SYSTEM

TO MOVE THE COOLING FLUID.";

 

RULE 2-2B

IF HEAT = NONE

AND COMPRESSOR_BELT_LOOSE = YES

THEN SOLUTION = TIGHTEN_COMPRESSOR_BELT

BECAUSE "THE COMPRESSOR BELT RUNS THE COOLING SYSTEM

TO MOVE THE COOLING FLUID.";

 

RULE 2-2C

IF HEAT = NONE OR HEAT = MID

AND COMPRESSOR_BELT_SURFACE = YES

THEN SOLUTION = REPLACE_COMPRESSOR_BELT

BECAUSE "THE COMPRESSOR BELT RUNS THE COOLING SYSTEM

TO MOVE THE COOLING FLUID.";

 

RULE 2-3

IF HEAT = MID AND HOSE_DAMAGE = YES

THEN SOLUTION = REPLACE_AIR_COND_HOSE;

 

RULE 2-4

IF HEAT = MID AND HOSE_CONNECTION = NO

THEN SOLUTION = TIGHTEN_THE_HOSE_CONNECTIONS

BECAUSE "THIS WILL DETERMINE INTEGRITY OF THE COOLING SYSTEM.";

 

RULE 2-5

IF HEAT = MID AND CONDENSER_CLEAN = NO

OR CLOGG_DUCT = YES

THEN SOLUTION = BRUSH_AWAY_DEBRIS

BECAUSE "THIS WILL DETERMINE WHETHER THERE CAN

BE AIR TO COOL THE SYSTEM INTEGRITY OF THE COOLING SYSTEM.";

 

RULE 2-6

IF HEAT = HIGH AND CONDENSER_LEAK = YES

THEN SOLUTION = CHANGE_THE_CONDENSER;

 

RULE 2-7A

IF HEAT = NONE AND FAN = NO AND FAN_FUSE_OK = YES

THEN SOLUTION = CHANGE_FAN_FUSE;

 

RULE 2-7B

IF HEAT = NONE AND FAN = NO AND FAN_FUSE_OK = NO

THEN SOLUTION = REPLACE_INTERIOR_AIR-COND_FAN;

 

RULE 2-8A

IF HEAT = NONE AND SIGHT_GLASS = CLEAR

THEN SOLUTION = REFILL_REFRIGERANT;

 

RULE 2-8B

IF HEAT = MID AND SIGHT_GLASS = BUBBLY

THEN SOLUTION = REFILL_REFRIGERANT;

 

RULE 2-9

IF HEAT = MID OR HEAT = NONE

AND COMPRESSOR_OK = NO

THEN SOLUTION = REPLACE_COMPRESSOR_UNIT

ELSE SOLUTION = CONSULT_MECHANIC;

 

ASK COOLING:

"CLOSE CAR DOORS AND WINDOWS. LEAVE THE AIR-CONDITION SWITCHED ON

FOR ABOUT 5 MINUTES. HOW IS THE TEMPERATURE INSIDE THE CAR FINALLY ?";

CHOICES COOLING: NOT_COOLING_AT_ALL, COOLING_INSUFFECIENTLY, NEITHER;

 

ASK AIR_CONTROL_OK: "TEST THE THERMOSTAT CONTROL. IS IT WORKING ?";

CHOICES AIR_CONTROL_OK : YES, NO;

 

ASK COMPRESSOR_BELT_SURFACE: "CHECK COMPRESSOR BELT, INCLUDING UNDERSIDE.

IS IT GLAZED OR CRACKED ?";

CHOICES COMPRESSOR_BELT_SURFACE: YES, NO;

 

ASK COMPRESSOR_BELT_LOOSE:

"PRESS THE COMPRESSOR BELT. CAN IT BE MOVED OR SEEMS VERY LOOSE ?";

CHOICES COMPRESSOR_BELT_LOOSE: YES, NO;

 

ASK COMPRESSOR_BELT: "CHECK COMPRESSOR BELT, IS IT MISSING OR BROKEN ?";

CHOICES COMPRESSOR_BELT: YES, NO;

 

ASK HOSE_DAMAGE: "INSPECT THE AIR-COND HOSE FOR LEAKS BY FINDING OILY AREAS,

CUTS OR DAMAGE ON THE HOSE. IS THERE ANY LEAK ? ";

CHOICES HOSE_DAMAGE: YES, NO;

 

ASK HOSE_CONNECTION: "INSPECT THE AIR-CONDITION HOSE CONNECTION. ARE THEY TIGHT ? ";

CHOICES HOSE_CONNECTION: YES, NO;

 

ASK CONDENSER_CLEAN: "INSPECT THE CONDENSER, INCLUDING ITS FINS. IS IT CLEAN ? ";

CHOICES CONDENSER_CLEAN: YES, NO;

 

ASK CLOGG_DUCT: "TRACE THE AIR-COND OUTLET DUCT, LOOK FOR ANYTHING PRESSING

ON THE DUCT OR IS STUCK (E.G. DIRT). IS IT CLOGGED ?";

CHOICES CLOGG_DUCT: YES, NO;

 

ASK CONDENSER_LEAK: "INSPECT THE CONDENSER FINS CLOSELY. IS THERE ANY SIGNS OF OILY SUBSTANCE ? ";

CHOICES CONDENSER_LEAK: YES, NO;

 

ASK FAN:

"WHILE THE AIR-COND IS RUNNING, INSPECT THE INTERIOR (AIR-COND) FAN.

IS IT TURNING PROPERLY ?";

CHOICES FAN: YES, NO;

 

ASK FAN_FUSE_OK:

"THERE IS USUALLY A FUSE FOR THE INTERIOR FAN MOTOR, IS THE FUSE BROKEN

OR MATBE THERE IS NO FUSE ?";

CHOICES FAN_FUSE_OK: YES, NO;

 

ASK SIGHT_GLASS: "WHILE THE AIR-COND IS STILL RUNNING,

INSPECT THE RECEIVER DRYER GLASS. WHAT DOYOU SEE ?";

CHOICES SIGHT_GLASS: CLEAR, BUBBLY;

 

ASK COMPRESSOR_OK:

"WHILE THE AIR-COND AND ENGINE IS RUNNING.

CHECK THE COMPRESSOR PULLEY, DOES IT TURN

AND GENERATE THE DESIRED VOLTAGE ?";

CHOICES COMPRESSOR_OK: YES, NO;

 

! RULE TO DISPLAY INFORMATION

RULE DISPLAY1

IF SET_PRINTER <> UNKNOWN

THEN DISPLAY_RESULT = PART1

CLS DISPLAY

"THE RESULT TO THIS PROBLEM IS {#SOLUTION}

PRESS ANY KEY TO CONTINUE ~" CLS DISPLAY"

THIS IS BECAUSE ....

PRESS ANY KEY TO CONTINUE ~" CLS DISPLAY"

THIS IS .....";

! SEE PG 69 OF LYONS

 

RULE RETURN1

IF TASK_MAIN = CONSULT_AIRCON

THEN RETURN_MAIN = YES

CHAIN MAIN

ELSE RETURN_ESTA = NO;

 File name : Battery.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1]

!NAME OF EXPERT SYSTEM: THE BATTERY

!THE FILE NAME IS : BATTERY.KBS

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

!****************************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

PRINTOFF

COLOR = 15

FIND PRTCTRL

FIND RECO

LOADFACTS A:\CHINFO

DISPLAY " "

DISPLAY " "

DISPLAY "**************************************************************"

DISPLAY "BASED ON THE ANSWER YOU HAVE GIVEN, WE RECOMMEND"

DISPLAY ""

 

!:{#RECO}"

FIND SOLUTION

DISPLAY "~"

PRINTOFF

FIND RETURN_MAIN;

 

! --[PRINTER RULES BLOCK]--

RULE 0-PRINTER

IF PRINTER = YES

THEN PRTCTRL = ON

DISPLAY "PLEASE TURN ON YOUR PRINTER. PRESS ANY KEY TO CONTINUE~"

PRINTON;

 

! --[PRINTER STATEMENT BLOCK]--

ASK PRINTER:"DO YOU WISH TO PRINT OUT THE STATEMENTS & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

! --[RULES BLOCK]--

 

RULE 1-1

IF RECO = NO_REPAIR

THEN SOLUTION = OTHER_RELATED_CAR

DISPLAY "SINCE NOTHING TO BE DONE WITH BATTERY PROBLEM"

DISPLAY "I RECOMMEND THAT YOU TRY OTHER CAR SOLUTIONS";

RULE 1-2

IF RECO = PUSH

THEN SOLUTION = UNCHARGEABLE_BATTERY

DISPLAY "TRY OUT PUSH STARTING";

 

RULE 1-3

IF RECO = BATTERY_FILL

THEN SOLUTION = BATTERY_FLUID

DISPLAY "BATTERY FLUID SHOULD REFILL AT THE MAXIMUM LEVEL";

 

RULE 1-4

IF RECO = BATTERY_CORRODED

THEN SOLUTION = BATTERY_CORRODED

DISPLAY "WASH YOUR BATTERY TERMINALS";

 

RULE 1-5

IF RECO = BATTERY_LOOSE_CONNECTION

THEN SOLUTION = LOOSE_CONNECTION

DISPLAY "TIGHTEN THE CLAMP BOLTS BUT DO NOT OVERTIGHT AND REPLACE FIRMLY.";

 

!RULE 1-6

! IF RECO = BATTERY_STARTER_BAD

! THEN SOLUTION = STARTER

! DISPLAY "STARTER IS BAD ,TRY TO REPLACE A NEW ONE.";

!

RULE 1-7

IF RECO = BATTERY_EXCHANGE

THEN SOLUTION = BATTERY_UNCHARGEABLE

DISPLAY "CHANGE THE BATTERY";

 

! -----------------------------------------------------------------------

RULE 2-2

IF ENGINE = YES

THEN RECO = NO_REPAIR

BECAUSE "CAR STARTING IS VERY RELATED TO ENGINE AND BATTERY COMPONENT";

RULE 3-1

IF !ENGINE = YES AND

AUTO_MANUAL = MANUAL

THEN RECO = PUSH

BECAUSE "I NEED TO SEE WHETHER YOUR CAR CAN TRY OUT PUSH STARTING";

 

RULE 4-1

IF !ENGINE = YES AND

BATTERY_CONDITION = BETWEEN OR

BATTERY_CONDITION = MINIMUM

THEN

RECO = BATTERY_FILL

BECAUSE "FLUID LEVEL NOT TO MAXIMUM WILL CAUSE YOUR ENGINE TO RESPOND SLUGGISH";

 

RULE 5-1

IF !ENGINE = YES AND

BATTERY_CONNECT = CORRODED

THEN RECO = BATTERY_CORRODED

BECAUSE "CORRODED TERMINAL MAY CAUSE YOUR BATTERY TRANSMISSION CORRUPTED";

 

RULE 5-2

IF !ENGINE = YES AND

BATTERY_CONNECT = LOOSE_CONNECTION

THEN RECO = BATTERY_LOOSE_CONNECTION;

 

!ULE 6-1

! IF !ENGINE = YES AND

! BATTERY_STARTER = YES

! THEN RECO = BATTERY_STARTER_BAD

! BECAUSE "THE STARTER IS ONE OF THE IMPORTANT COMPONENT TO START YOUR ENGINE";

 

 

RULE 7-1

IF !ENGINE = YES AND

BATTERY_CHARGE = NO

THEN BATTERY_CHARGE_2ANSWER = YES

BECAUSE "THE BEST SOLUTION IS CHANGE YOUR BATTERY WITH NEW ON";

 

RULE 7-11

IF !ENGINE = YES AND

BATTERY_CHARGE = NO AND

BATTERY_CHARGE_2ANSWER = YES

THEN RECO = NO_REPAIR;

 

 

RULE 7-2

IF BATTERY_CHARGE = YES

THEN RECO = BATTERY_EXCHANGE;

 

! --[STATEMENTS BLOCK]--

 

ASK PRINTER:"DO YOU WANT TO PRINT OUT THE STATEMENT & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

ASK ENGINE: "CAN YOU START YOUR ENGINE(THE ENGINE TURNING SLOWLY BUT WON'T START)?";

CHOICES ENGINE :YES , NO;

 

ASK AUTO_MANUAL:"WHAT TRANSMISSION TYPE IS YOUR VEHICLE ?";

CHOICES AUTO_MANUAL : AUTO , MANUAL;

 

ASK BATTERY_CONDITION :"HOW FULL IS YOUR BATTERY FLUID(IT IS DEPENDING THE REMARK LEVEL)";

CHOICES BATTERY_CONDITION :MAXIMUM , BETWEEN , MINIMUM ;

 

ASK BATTERY_CONNECT:"CHECK YOUR BATTERY THAT IS MEET THIS PROBLEM OR NOT";

CHOICES BATTERY_CONNECT :CORRODED ,LOOSE_CONNECTION ,NONE_OF_THIS;

 

ASK BATTERY_CHARGE :"DO YOU HAVE A SPARE BATTERY";

CHOICES BATTERY_CHARGE : YES , NO;

 

! --[RETURN TO MAIN ONLY IF IT WAS CHAINED FROM MAIN]--

RULE RETURN_MAIN

IF TASK_MAIN = CONSULT_BATTERY

THEN RETURN_MAIN = YES

RESET ALL

PRINTOFF

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES

CHAIN MAIN

ELSE RETURN_MAIN = NO

PRINTOFF;

 

! --[END OF PROGRAM]--

!***************************************************************************

 File name : Engine.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1]

 

!NAME OF EXPERT SYSTEM: THE ENGINE TROUBLE GUIDE

!THE FILE NAME IS : ENGINE.KBS

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

!****************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

PRINTOFF

COLOR = 15

FIND PRTCTRL

LOADFACTS A:\CHINFO

FIND SOLUTION

DISPLAY " "

DISPLAY " "

DISPLAY "**************************************************************"

DISPLAY "BASED ON THE ANSWER YOU HAVE GIVEN, WE RECOMMEND :

 

{#SOLUTION}

{#SOLUTION2}

~"

PRINTOFF

FIND RETURN_MAIN

;

 

! --[PRINTER RULES BLOCK]--

RULE 1-PRINTER

IF PRINTER = YES

THEN PRTCTRL = ON

DISPLAY "PLEASE TURN ON YOUR PRINTER. PRESS ANY KEY TO CONTINUE~"

PRINTON

EJECT;

 

! --[PRINTER STATEMENT BLOCK]--

ASK PRINTER:"DO YOU WISH TO PRINT OUT THE STATEMENTS & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

! --[RULES BLOCK]--

RULE BFIRE

IF BFIRE = YES

THEN RECO = ONE;

 

RULE CR_PER1

IF CR_PER = SLOW

THEN RECO = TWO;

 

RULE ACCELERATE

IF ACCELERATE = YES

THEN RECO = THREE;

 

RULE MPG

IF MPG = YES

THEN RECO = FOUR;

 

RULE RAIN1

IF SHAKE = SUDDEN AND RAIN = YES

THEN RECO = FIVE;

 

RULE RAIN2

IF SHAKE = SUDDEN AND RAIN = NO

THEN RECO = THREE;

 

!STATEMENTS BLOCK

 

ASK BFIRE : "DOES YOUR CAR BACKFIRE ?";

CHOICES BFIRE : YES,NO;

 

ASK CR_PER : "IS THE CAR ENGINE PERFORMANCE :... ";

CHOICES CR_PER : SLOW,NORMAL;

 

ASK ACCELERATE : "DOES THE CAR HAVE SUDDEN DROP IN RPM WHEN ACCELERATING?";

CHOICES ACCELERATE : YES,NO;

 

ASK MPG : "DOES THE CAR SEEM TO CONSUME MORE PETROL?";

CHOICES MPG : YES,NO;

 

ASK SHAKE : "DID ROUGH IDLE START SUDDENLY OR PROGRESSIVELY?";

CHOICES SHAKE : SUDDEN,PROGRESS;

 

ASK RAIN : "DID CONDITION HAPPEN AFTER RAIN ?";

CHOICES RAIN : YES, NO;

 

 

!END OF PROGRAM

!***************************************************************************

 

! *********************

 

RULE SOL1

IF RECO = ONE

THEN

SOLUTION = IT_IS_CAUSED_BY_A_FAULTY_SPARK

SOLUTION2 = PLUG_OR_A_BAD_CABLE_CONNECTION;

 

RULE SOL2

IF RECO = TWO

THEN

SOLUTION = CAUSED_BY_EITHER_DIRTY_AIR_FILTER

SOLUTION2 = OR_FAULTY_VALVE_ADJUSTMENT;

 

RULE SOL3

IF RECO = THREE

THEN

SOLUTION = SEND_CAR_TO_PROPER_MECHANIC

SOLUTION2 = FOR_SERVICING;

 

RULE SOL4

IF RECO = FOUR

THEN

SOLUTION = ADJUST_AIR_OR_FUEL_RATIO_LOCATED

SOLUTION2 = IN_CARBURETTOR;

 

RULE SOL5

IF RECO = FIVE

THEN SOLUTION = WET_AIR_FILTER

SOLUTION2 = DRY_FILTER_TO_REGAIN_SMOOTH_IDLE;

 

RULE SOL6

IF RECO = SIX

THEN SOLUTION = FAULTY_CARBURETTOR_OR_OVERHEATING

SOLUTION2 = NULL;

 

RULE SOL7

IF RECO = SEVEN

THEN SOLUTION = AIR_OR_FUEL_MIXTURE_NOT_IN_TUNE_OR

SOLUTION2 = WRONG_IDLE_SPEED;

 

! --[RETURN TO MAIN ONLY IF IT WAS CHAINED FROM MAIN]--

RULE RETURN_MAIN

IF TASK_MAIN = CONSULT_ENGINE

THEN RETURN_MAIN = YES

RESET ALL

PRINTOFF

CHAIN MAIN

ELSE RETURN_MAIN = NO

PRINTOFF;

 

! --[END OF PROGRAM]--

!***************************************************************************

 File name : Hard.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1]

!NAME OF EXPERT SYSTEM: THE HARD STARTING ENGINE

!THE FILE NAME IS : HARD.KBS

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

!****************************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

COLOR = 15

FIND PRTCTRL

LOADFACTS a:\CHINFO

FIND RECO

 

DISPLAY " "

DISPLAY " "

DISPLAY "**************************************************************"

DISPLAY "BASED ON THE ANSWER YOU HAVE GIVEN, WE RECOMMEND :

 

{#RECO}~"

FIND RETURN_MAIN;

 

! --[PRINTER RULES BLOCK]--

RULE 0-PRINTER

IF PRINTER = YES

THEN PRTCTRL = ON

DISPLAY "PLEASE TURN ON YOUR PRINTER. PRESS ANY KEY TO CONTINUE~"

PRINTON;

 

! --[PRINTER STATEMENT BLOCK]--

ASK PRINTER:"DO YOU WISH TO PRINT OUT THE STATEMENTS & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

! --[RULES BLOCK]--

RULE CR_1

IF CRANK = YES

AND CR_PROB = SLOWLY

THEN BATTERY_COND = NOK

BECAUSE "IT IS USUALLY DUE TO A WEAK BATTERY OR A BAD CABLE CONNECTION.";

 

RULE CR_2

IF CRANK = YES

AND CR_PROB = NORMALLY

THEN FUEL_CHECK = NOK;

 

RULE FUEL_1

IF FUEL_CHECK = NOK

AND FUEL_LEVEL = YES

THEN FUEL = OK

BECAUSE " IT MAY BE THE PROBLEM OF NON COMBUSTION IN THE COMBUSTION

CHAMBER. THIS MAY BE CAUSED BY NO FUEL OR NO SPARK.";

 

RULE FUEL_1.2

IF FUEL_CHECK = NOK

AND FUEL_LEVEL = NO

THEN FUEL = NOK;

 

RULE FUEL_2

IF FUEL = OK

AND SPARK_CHECK = NO

THEN RECO = CHANGE_THE_CARBURETOR;

 

RULE FUEL_2.1

IF FUEL = OK

AND SPARK_CHECK = YES

THEN RECO = CONNECT_WIRE_OR_REPLACE_SPARK_PLUG_LEAD;

 

RULE FUEL_3

IF FUEL = NOK

THEN RECO = FILL_THE_TANK;

 

RULE NCR_1

IF CRANK = NO

AND NOISE = MAKE_NOISE

THEN RECO = CANNOT_FIND_SOLUTION_SEND_TO_MECHANIC;

 

RULE NCR_2

IF CRANK = NO

AND NOISE = CLICKING_SOUND

THEN BATTERY_COND = NOK

BECAUSE "IT IS USUALLY DUE TO A WEAK BATTERY OR A BAD CONNECTION .";

 

RULE NCR_3

IF CRANK = NO

AND NOISE = NO_SOUND

THEN BATTERY_COND = OK;

 

RULE BATT_1

IF BATTERY_COND = NOK

AND BATTERY_CHECK = YES

THEN RECO = REPLACE_THE_STARTER;

 

RULE BATT_1.2

IF BATTERY_COND = NOK

AND BATTERY_CHECK = NO

THEN RECO = CLEAN_OR_TIGHTEN_OR_CHARGE_THE_BATTERY;

 

RULE BATT_2

IF BATTERY_COND = OK

AND LIGHT_CHECK = YES

THEN RECO = REPLACE_NEUTRAL_SAFETY_SWITCH;

 

RULE BATT_2.2

IF BATTERY_COND = OK

AND LIGHT_CHECK = NO

THEN RECO = CHECK_THE_BETTERY_CONDITION;

!******************************************************************************

!STATEMENTS BLOCK

 

ASK CRANK : "DOES YOUR ENGINE CRANK ?";

CHOICES CRANK : YES,NO;

 

ASK CR_PROB : " THE CAR CRANK :... ";

CHOICES CR_PROB : SLOWLY,NORMALLY;

 

ASK FUEL_LEVEL : "IS FUEL IN THE TANK?";

CHOICES FUEL_LEVEL : YES,NO;

 

ASK BATTERY_CHECK : "IS YOUR BATTERY CLEAN,TIGHT AND FULLY CHARGE?";

CHOICES BATTERY_CHECK : YES,NO;

 

ASK SPARK_CHECK : "ANY LEAD/WIRES DISCONNECTED FROM SPARK PLUG?";

CHOICES SPARK_CHECK : YES,NO;

 

ASK NOISE : "DOES YOUR CAR MAKE NOISE WHEN START?";

CHOICES NOISE : MAKE_NOISE,CLICKING_SOUND,NO_SOUND;

 

ASK LIGHT_CHECK : " IS THE HEADLIGHT ON?";

CHOICES LIGHT_CHECK : YES,NO;

 

! --[RETURN TO MAIN ONLY IF IT WAS CHAINED FROM MAIN]--

RULE RETURN_MAIN

IF TASK_MAIN = CONSULT_HARD

THEN RETURN_MAIN = YES

RESET ALL

PRINTOFF

CHAIN MAIN

ELSE RETURN_MAIN = NO

PRINTOFF;

 

! --[END OF PROGRAM]--

!***************************************************************************

 

 File name : Main.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1] [2]

 

!NAME OF EXPERT SYSTEM: THE MAIN MENU

!THE FILE NAME IS : MAIN.KBS

!LAST UPDATE ON 7 JULY 1998

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

! EXECUTE; !ACTIVATE THIS LINE ONLY WHEN THE PROG IS COMPLETE

!****************************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

COLOR = 15

!------------------------------

! INTRODUCTION

!------------------------------

TMODE

MOUSEOFF

RESET ALL

WOPEN 1, 4, 9, 13, 60, 6

ACTIVE 1

CLS

DISPLAY "

ASIA PACIFIC INSTITUTE OF INFORMATION TECHNOLOGY

*** HIGHER DIPLOMA IN COMPUTER SYSTEM ***

ARTIFICIAL INTELLIGENCE

GROUP PROGRAMMING PROJECT

USING FOR VP-EXPERT RELEASE 3.0

FOR

CAR DIAGNOSTICS

1998

"

MOUSEON

FIND CONTINUE

WCLOSE 1

TMODE

WOPEN 1, 4, 9, 13, 60, 6

ACTIVE 1

DISPLAY

"

 

 

THANK YOU FOR USING OUR PROGRAM

~"

WCLOSE 1;

! --[ END OF ACTIONS BLOCK]--

 

ASK RESPONSE: "DO YOU WISH TO PROCEED?";

CHOICES RESPONSE: YES, NO;

RULE SHOW_SAMPLE

IF RESPONSE = YES

THEN CONTINUE = YES

GMODE 16

CLS

MOUSEON

GLOCATE 8,2 ! FORMAT IS X,Y WHERE X= COL Y= ROW

GDISPLAY "ARTIFICIAL INTELLIGENCE PROJECT - A CAR DIAGNOSTIC PROGRAM"

GLOCATE 18,23

GDISPLAY "HIGHER DIPLOMA IN COMPUTER SYSTEMS"

GCOLOR 12

RECTANGLE 160,45,360,280

FILL 165,46,12

OPT1 = NO

OPT2 = NO

OPT3 = NO

OPT4 = NO

OPT5 = NO

OPT6 = NO

DONE = NO

ABOUT = NO

WHILETRUE DONE = NO THEN

END

ELSE CONTINUE = NO;

 

!.......WHENEVER RULES TO HANDLE MOUSE-DOWNS ........

WHENEVER OPT1

IF OPT1 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_BATTERY

SAVEFACTS CHINFO

!VALUES TO FILE CALLED CHINFO

CHAIN BATTERY

RESPONSE = NO

;

 

WHENEVER OPT2

IF OPT2 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_AIRCON

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

DISPLAY "SAVING CHAIN DONE !"

CHAIN AIRCON

RESPONSE = NO

;

 

WHENEVER OPT3

IF OPT3 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_ENGINE

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

CHAIN ENGINE

RESPONSE = NO

;

WHENEVER OPT4

IF OPT4 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_HARD

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

CHAIN HARD

RESPONSE = NO

;

WHENEVER OPT5

IF OPT5 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_HEAT

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

CHAIN HEAT

RESPONSE = NO

;

 

WHENEVER OPT6

IF OPT6 = YES

THEN

TMODE

COLOR = 15

TASK_MAIN = CONSULT_OTHERS

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

CHAIN OTHERS

RESPONSE = NO

;

 

WHENEVER ABOUT

IF ABOUT = YES

THEN

TASK_MAIN = CONSULT_ABOUT

SAVEFACTS CHINFO !TEMPORARY SAVE TEXT VARIABLE NAMES AND

!VALUES TO FILE CALLED CHINFO

GCLS

CHAIN ABOUT

RESPONSE = NO

;

 

PLURAL: CONTINUE, TASK_MAIN;

 

!.........LABEL BUTTONS TO ALLOW EASY ACCESS TO A SPECIFIC HOTREGION.......

 

LBUTTON OPT1: 25, 5, 9, 10, ____BATTERY_____;

LBUTTON OPT2: 25, 7, 9, 10, AIR-CONDITIONING;

LBUTTON OPT3: 25, 9, 9, 10, ____ENGINE______;

LBUTTON OPT4: 25, 11, 9, 10, _HARD_STARTING__;

LBUTTON OPT5: 25, 13, 9, 10, __OVERHEATING___;

LBUTTON OPT6: 25, 15, 9, 10, ____OTHERS______;

LBUTTON DONE: 25, 17, 0, 7, ______QUIT______;

LBUTTON ABOUT: 25, 19, 0, 7, _____ABOUT______;

 

! --[END OF PROGRAM]--

!***************************************************************************

 File name : Others.kbs

[TOP OF PAGE]

SAMPLE SCREEN [1]

!NAME OF EXPERT SYSTEM: THE BRAKES, TYRE AND CLUTCH

!THE FILE NAME IS : OTHERS.KBS

ENDOFF;

RUNTIME;

BKCOLOR = 1;

 

!***************************************************************************

! --[ACTIONS BLOCK]--

ACTIONS

PRINTOFF

COLOR = 15

RESET ALL

FIND PRTCTRL

FIND SOLUTION

LOADFACTS CHINFO

DISPLAY " "

DISPLAY " "

DISPLAY "**************************************************************"

DISPLAY "BASED ON THE ANSWER YOU HAVE GIVEN, WE RECOMMEND :

 

{#SOLUTION}~"

FIND RETURN_MAIN;

 

! EXECUTE; MAKE THIS LINE ONLY WHEN PROG IS DONE

! --[PRINTER RULES BLOCK]--

RULE 0-PRINTER

IF PRINTER = YES

THEN PRTCTRL = ON

DISPLAY "PLEASE TURN ON YOUR PRINTER. PRESS ANY KEY TO CONTINUE~"

PRINTON;

 

! --[PRINTER STATEMENT BLOCK]--

ASK PRINTER:"DO YOU WISH TO PRINT OUT THE STATEMENTS & RECOMMENDATIONS?";

CHOICES PRINTER :YES ,NO;

 

! --[RULES BLOCK]--

RULE 1-1

IF CAR_HANDLING = GOOD AND CLUTCH_PRESSURE = NO

THEN SOLUTION = REPLACE_CLUTCH_LINE;

 

RULE 1-2

IF CAR_HANDLING = GOOD AND CLUTCH_PRESSURE = YES

THEN TX_CLUTCH = YES;

 

RULE 1-3

IF CAR_HANDLING = BAD AND BRAKING_OK = NO

THEN BRAKE_PROBLEM = YES;

 

RULE 1-4

IF CAR_HANDLING = BAD AND BRAKING_OK = YES

THEN TYRE_PROBLEM = YES;

 

! --[STATEMENTS BLOCK]--

 

ASK CAR_HANDLING :

"WHILE DRIVING AT AROUND 60 KPH, HOW IS THE CAR HANDLING ?";

CHOICES CAR_HANDLING : GOOD, BAD

BECAUSE

"THIS WILL DECIDE WHEATER THE PROBLEM LIES IN THE BRAKES

AND TYRES PROBLEM OR IN THE TRANSMISSION PROBLEM.";

 

ASK CLUTCH_PRESSURE :

"PRESS THE CLUTCH, IS THERE PRESSURE ?";

CHOICES CLUTCH_PRESSURE : YES, NO

BECAUSE

"HAVING NO PRESSURE ON THE CLUTCH, IS A SURE INDICATION

THAT THE PROBLEM LIES IN THE CLUTCH";

 

ASK BRAKING_OK : "ARE THERE ANY PROBLEMS WHEN BRAKING ?";

CHOICES BRAKING_OK : YES, NO

BECAUSE "THIS WILL DECIDE IF THE PROBLEM LIES IN THE

BRAKES SYSTEM OR NOT.";

 

RULE 2-1

IF TX_CLUTCH = YES AND GEAR_CHANGE = NO AND OLD_GEAR = YES

THEN SOLUTION = CHANGE_CLUTCH

BECAUSE

"AS TIME PASSES, WEAR AND TEAR WILL TAKE PLACE, EVEN BETWEEN

METAL. THIS WILL CAUSE THE TRANSMISSION HARDWARE TO LOSE

ITS SHAPE.";

 

RULE 2-2

IF TX_CLUTCH = YES AND PEDAL_SMOOTH = NO AND OLD_TX_FLUID = YES

THEN SOLUTION = CHANGE_TRANSMISSION_FLUID

BECAUSE

"THERE MAY BE FOREIGN PARTICLES OR THE TRANSMISSION FLUID

MAY HAVE LOST ITS PROPERTY, ESPECIALLY IF IT IS OF

VERY LOW QUALITY.";

 

ASK GEAR_CHANGE : "WHILE DRIVING, DOES IT HAVE SMOOTH GEAR CHANGE ?";

CHOICES GEAR_CHANGE : YES, NO;

 

ASK OLD_GEAR :

"IS THE GEAR BOX MORE THAN 10 YEARS OLD ?";

CHOICES OLD_GEAR : YES, NO;

 

ASK PEDAL_SMOOTH :

"WHEN DRIVING, PRESS THE CLUTCH, IS IT SMOOTH AND ENGAGES ALL THE WAY ?";

CHOICES PEDAL_SMOOTH : YES, NO;

 

ASK OLD_TX_FLUID :

"HAS IT BEEN MORE THAN 2 YEARS SINCE THE TRANSMISSION FLUID WAS CHANGED ?";

CHOICES OLD_TX_FLUID : YES, NO;

 

! --[RULES BLOCK]--

 

RULE 3-1

IF BRAKE_PROBLEM = YES AND BRAKE_FLUID = NO

THEN SOLUTION = FILL_BRAKE_FLUID_TO_MAX

"As time passes, the brake fluid may have leaked out

in small quantities.

Evaporation of the brake fluid when brakes is applied

can drop the fluid level too, as time passes.";

 

RULE 3-2

IF BRAKE_PROBLEM = YES AND OLD_BRAKE_FLUID = YES

THEN SOLUTION = CHANGE_BRAKE_FLUID

BECAUSE

"There is a possibility that the brake fluid property may have

changed or foreign particles (such as dirt) might have entered

the system";

 

RULE 3-3

IF BRAKE_PROBLEM = YES AND LOW_BRAKE_PRESS = YES AND BRAKE_LINE = YES

THEN SOLUTION = FIX_THE_BRAKE_LINE

BECAUSE

"1) THE BRAKE LINE IS OLD AND WORN OUT OR SOME

FOREIGN OBJECT HAS DAMAGED THE LINE

2) THE CONNECTION TO THE BRAKE PUMP IS LOOSE OR

MAYBE DAMAGED";

 

RULE 3-4

IF BRAKE_PROBLEM = YES AND BRAKE_SOUND = YES

THEN SOLUTION = CHANGE_BRAKE_PAD_OR_SHOE

BECAUSE

"A SCREECHING SOUND NEAR THE TYRE WHEN BRAKING,

CAN CAUSE A WORN OUT BRAKE PAD OR SHOE WHICH IS BARE METAL

TO SLIP TRYING TO CATCH THE TYRE";

 

! --[STATEMENT BLOCK]--

 

ASK BRAKE_FLUID : "CHECK THE BRAKE FLUID LEVEL. IS IT AT MAX ?";

CHOICES BRAKE_FLUID : YES, NO;

 

ASK OLD_BRAKE_FLUID :

"HAS IT BEEN MORE THAN 1 YEAR SINCE BRAKE FLUID WAS LAST CHANGED ?";

CHOICES OLD_BRAKE_FLUID : YES, NO;

 

ASK LOW_BRAKE_PRESS :

"PRESS THE BRAKE PEDAL, IS THE PRESSURE LOW ?";

CHOICES LOW_BRAKE_PRESS : YES, NO;

 

ASK BRAKE_LINE :

"CHECK THE BRAKE LINE, ESPECIALLY AT THE JOINTS. IS THERE ANY LEAKS ?";

CHOICES BRAKE_LINE : YES, NO;

 

ASK BRAKE_SOUND :

"WHILE DRIVING, PRESS THE BRAKES, IS THERE A SQUEKY SOUND ?";

CHOICES BRAKE_SOUND : YES, NO;

 

! --[RULES BLOCK]--

 

RULE 4-1

IF TYRE_PROBLEM = YES AND TYRE_PRESSURE = NO

THEN SOLUTION = FILL_TYRE_AIR_TO_RECOMMENDED_PRESSURE

BECAUSE

"LOW TYRE PRESSURE MAKES THE TYRE IN CONTACT WITH THE

ROAD SURFACE WITH MORE RESISTANCE, MAKING STEERING HEAVY.";

 

RULE 4-2

IF TYRE_PROBLEM = YES AND TYRE_THREAD = YES

THEN SOLUTION = CHANGE_THE_BOLD_TYRE

BECAUSE

"TYRE WITH LITTLE OR NO MORE THREAD CAN CAUSE

DIFFICULTY IN STEERING AND BRAKING";

 

RULE 4-3

IF TYRE_PROBLEM = YES AND TYRE_WOBBLY = YES

THEN SOLUTION = BALANCE_THE_TYRES_OR_CHANGE_TYRE

BECAUSE

"TYRE PROBABLY HIT SOMETHING HARD CAUSING IT TO BE

OUT OF SHAPE OR IT IS OVER FILLED WITH AIR.";

 

RULE 4-4

IF TYRE_PROBLEM = YES AND TYRE_STRAIGHT = NO

THEN SOLUTION = ADJUST_THE_TYRE_ALIGNMENT

ELSE SOLUTION = CONSULT_A_MECHANIC;

 

! --[STATEMENTS BLOCK]--

 

ASK TYRE_PRESSURE :

"USE A PRESSURE GAUGE TO CHECK THE TYRE, IS THERE ENOUGH AIR ?";

CHOICES TYRE_PRESSURE : YES, NO;

 

ASK TYRE_THREAD :

"INSPECT THE TYRE THREAD, IS IT BOLD ?";

CHOICES TYRE_THREAD : YES, NO;

 

ASK TYRE_WOBBLY :

"WHILE DRIVING, DOES THE TYRE WOBBLE ?";

CHOICES TYRE_WOBBLY : YES, NO;

 

ASK TYRE_STRAIGHT :

"WHILE DRIVING SLOWLY, LEAVE THE STEERING, DOES THE CAR GO IN

A STRAIGHT LINE ?";

CHOICES TYRE_STRAIGHT : YES, NO;

 

! --[RETURN TO MAIN ONLY IF IT WAS CHAINED FROM MAIN]--

RULE RETURN_MAIN

IF TASK_MAIN = CONSULT_OTHERS

THEN RETURN_MAIN = YES

RESET ALL

PRINTOFF

CHAIN MAIN

ELSE RETURN_MAIN = NO

PRINTOFF;

 

! --[END OF PROGRAM]--

!***************************************************************************

 

 [HOME] [VPEXPERT MAIN] [TOP OF PAGE]