diagnosed (battery_water) if engine_turns_over(false) and battery_charged(true) and battery_connections(true) and battery_water(false).
diagnosed (battery_charged) if engine_turns_over(false) and battery_charged(false) and battery_connections(true) and battery_water(true).
diagnosed (fuse) if engine_turns_over(false) and battery_charged(true) and relay(false).
diagnosed (spark_plugs) if engine_turns_over(true) and spark(false).
diagnosed (fuel) if engine_turns_over(true}' and ' spark(true) .
/* Start with goal: diagnosed(X) */■
WERSJA 2
AUTOMOTIVE DIAGNOSTIC SYSTEM (WITH SIMPLE INPUT AND OUTPUT)
Type RUN in response to the GOAL prompt at runtime --------------------------------------------------*/
predicates ■ run
diagnosed (symbol) check (symbol)
response (char) clauses
run: -
write("AUTOMOBILE DIAGNOSTIC SYSTEM" ), nl diagnosed(_),!,nl. ■
run: -
write ("\nUnable to determinate what your problem i s \ n " ) .
diagnosed (starter_motor) not (check(engine_turns__over)), check(electrical_power), check(relay},
not(check(starter_motor)),
write("Replace starter motor."),nl,.
diagnosed (battery_connections) not (check (engine._turns_over) ) , not(check(electricał_power)), not(check(battery_connections)) , write("Tighten battery connections."),nl.
diagnosed (battery_water) not (check (engine_turns__over) ) , not(check(electrical_power)), check (battery_connect ions )., . •
write("Fili battery with. water."),nl.
diagnosed (battery_charged) not(check(engine_turns_over))> not(check(electrical_power)), check(battery_connections), check(battery_water), not(check(battery_charged))/
write("Battery is not charged. Try jumping it to start"),nl,
77