write("then check for loose or broken fan belt or defective regulatornl. diagnosdd (relay) not(check(engine_turns_over}) , check(electrical_power), not(check(relay)),
write("check ignition fuse, key switch, and starter motor relay."),nl.
diagnosed (spark_delivery_system) check(engine_turns_over), not(check(spark_delivery_system) ) ,
write("Check distributor, spark plugs, and related wiring. ") ,
diagnosed (fuel_system) check(engine_turns_over), check(spark_delivery_system),
write("Check gas gauge, fuel filter, and possibility of flooding."),nl.
check(battery_connections) :-
write("Are the battery connections good (y/n)?"),nl,
response(Reply},Reply='n'. check(electrical_power)
write("Are the headlights dim or do they fail to light when turned on (y/n)?"),nl,■ response(Reply),Reply='n'.
I
check(battery_water)
write("Is the battery water level good (y/n)?"),ni, response(Reply),Reply='y'.
check (engine__turns_over) .
write("Does the engine turns over normally without starting (y/n)?"), ni, 7""".)
response(Reply),Reply='y'.
check(spark_delivery_system):-write ("Are the spark pług and distributor-wires good (y/n)?"), nl,
response(Reply),Reply='y'. check (.starter_motor)
write("Does the starter motor fail ho turn, tura slowly or turn with an"),nl, write("abnormal grinding sound (y/n)?"),nl, response (Reply), Reply ='n
\
check(relay)
write("Can you hear the starter motor relay puli in (y/n)?"), nl,
response(Reply),Reply='y'. check (battery_charged)
write ("Is the battery fully. .charged (y/n) ?".) ,nl, response (Reply), Reply='y'. . ..
response (Reply)
readchar(Reply), write(replay),nl.
/*
AUTOMOTIVE DIAGNOSTIC SYSTEM (WITH DYNAMIC DATABASE) Type RUN in response to the GOAL prompt at runtime. -------------------.................. --------------*/
database
xpositive (symbol) xnegative (symbol)
predicates
run
diagnosed (symbol) check (symbol) positive (string,symbol)
79