1. 1
JIMMA UNIVERSITY
INSTITUTE OF TECHNOLOGY
SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
Artificial Intelligence
Vehicle Diagnosis system in AI
Name Id
Ramadan Hundessa………………RM0046/13-0
Submitted To:Instructor Habtamu Fanta (PhD)
Date:July/25/21
Jimma, Ethiopia
2. 2
Inference tree for Vehicle(Car) diagnosis system
When abnormal situation arises in the car, the KBS makes inferences by deciding which rules are
satisfied by facts stored in the working memory and executes the rule with highest priority and
propose proper correcting solution.
Facts in the Working memory:
1. The engine is getting gas.
2. The engine will turn over.
3. The problem is spark plugs.
Rules:
1.IF the engine is getting gas, AND the
engine will turn over, THEN the
problem is spark plugs.
2. IF the engine does not turn over,
AND the lights do not come on, THEN
the problem is battery or cables.
3. IF the engine does not turn over,
AND the lights do not come on, THEN the problem is the starter motor.
4. IF there is gas in the fuel tank, AND there is gas in the carburetor, THEN the engine is getting
gas.
Prototype of Vehicle(Car) Diagnosis system
3. 3
Prolog Program
% First Consult car.pl :
% To start it, give PROLOG the goal:
%solve(fix(X), CF).
rule((fix(Advice) :-
(bad_component(X),fix(X,
Advice))), 100).
% rules to infer bad component:
rule((bad_component(starter) :-
(bad_system(starter_system),lights(c
ome_on))),50).
rule((bad_component(battery) :-
(bad_system(starter_system),not(ligh
ts(come_on)))),90).
rule((bad_component(timing) :-
(bad_system(ignition_system),
not(tuned_recently))),80).
rule((bad_component(plugs) :-
(bad_system(ignition_system),plugs(
dirty))),90).
rule((bad_component(ignition_wires) :-
(bad_system(ignition_system),
not(plugs(dirty)),
tuned_recently)),80).
% Rules to infer system that failed.
rule((bad_system(starter_system) :-
(not(car_starts),
not(turns_over))),90).
rule((bad_system(ignition_system) :-
(not(car_starts),
turns_over,gas_in_carb)),80).
rule((bad_system(ignition_system) :-
(runs(rough),gas_in_carb)),80).
rule((bad_system(ignition_system) :-
(car_starts, runs(dies),gas_in_carb)),60).
% Rules to make reccommendation for
repairs.
rule(fix(starter, 'replace starter'),100).
rule(fix(battery, 'replace or recharge
battery'),100).
rule(fix(timing, 'get the timing
adjusted'),100).
rule(fix(plugs, 'replace spark plugs'),100).
rule(fix(ignition_wires, 'check ignition
wires'),100).
% askable descriptions
askable(car_starts).
askable(turns_over).
askable(lights(_)).
askable(runs(_)).
askable(gas_in_carb).
askable(tuned_recently).
askable(plugs(_)).