negative (string,symbol)
clear__facts : ’?
remerr.ber (symbol, char) ■ ' : -
aks (string, symbol, char) ■ ' ' :r
clauses
run: -
write("AUTOMOBILE, DTAGNOSTIC SYSTEM"),nl, diagnosed(_),!,nl,clear_facts.
run: -
write ("\nUnable to determinate what your problem is \n"), clear_facts.
xpositive(Y),!.■
:- not(xnegative(Y)), ask(X,Y,Reply)
positive (_,Y) positive (X/Y)
Reply='y'.
negative (_,Y) xnegative(Y),!.
negative (X,Y) - not (Xpositive (Y) ) , aks(X,Y,Re
ply),Reply='n'.
write(X),nl, readchar(Reply),
remember(Y,Reply)
remember (Y,'y'):-asserta(xpositive(Y)).
asserta (xnegative(Y)).
celar_facts ' retract(xpositive(_)),fail.
clear_facts
°retract(xnegative(_}),fail. clear_facts
nl,nl,write("Please press the space bar to exit. ") , nl readchar(_) .
diagnosed (starter_motor) not(check(engine_turns_over)), check(eleętrical_power), check(relay),
not(check(starter_motor) ) ,
write("Replace starter motornl.
diagnosed (battery_connections) not(check(engine_turns_over)), not(check{electrical_power)), hot(check(battery_connections)), write{"Tighten battery connections."),nl.
diagnosed (battery_water) not(chek(engine_turns_over)), not(check(electrical_power)) , check(battery_connections), write("Fili battery with water."),nl.
diagnosed.(battery_charged) not(check(engine_turns„over)), not(check(electrical_power)), check(battery_connections) , chećk(battery_water), not(check(battery_charged)) ,
write("Battery is not charged. Try jumping it to start"},nl,
write("then check for loose or broken fan belt or defective regulatornl,
diagnosed (relay) :-not(check(engine_turns_over)) , check (electrical_power) ,