"Undefined procedure" error



Hello everybody.
I'm trying to write a simple automobile diagnosis expert system.
I want the user to enter the certainty of some facts about the car.
Then I want the program to print all the new conclusions it produces.
I'm using SWI Prolog and the code is like this:

min(X,Y,Min) :- X<Y,!,Min=X;Min=Y.
max(X,Y,Max) :- X>=Y,!,Max=X;Max=Y.

:- op(800, fx, if).
:- op(700, xfx, then).
:- op(300, xfy, or).
:- op(200, xfy, and).

if spark_plug_wrong and gasoline_motor
then spark_plug_gasoline_relation :0.8.
if spark_plug_gasoline_relation or points__gasoline_relation
then gasoline_fuel_sourced:0.8.
/* rules continue like this */

go :-
new_derived_certainity(P, A), !, write(P), write(' '), write(A), nl,
assert(certainity(P, A)), go.

new_derived_certainity(Concl, B) :-
if Cond then Concl : C, not certainity(Concl, X1), certainity(Cond,
X2).

certainty(Cond1 and Cond2, Cert) :-
certainty(Cond1, Cert1), certainty(Cond2, Cert2), min(Cert1, Cert2,
Cert).

certainty(Cond1 or Cond2, Cert) :-
certainty(Cond1, Cert1), certainty(Cond2, Cert2), max(Cert1, Cert2,
Cert).

certainty(P, Cert) :-
if Cond then P : C1, certainty(Cond, C2), Cert is C1 * C2.
---------------------------------------------------------------------------------------------------
I query this program like:
assert(certainity(spark_plug_wrong, 0.7)).
assert(certainity(gasoline_motor, 0.7)).
go.

But I get the following error:
"ERROR: go/0: Undefined procedure: new_derived_certainity/2"

Does anybody has an idea about what can be the source of the error?
Any recomendations would be greatly appreciated.
Regards.

.



Relevant Pages

  • Re: Driving through Europe
    ... On the ferry: Why on *earth* would you? ... but it will make your car illegal to use over there - foreign registered cars must be legal in their home country to be legal in any other EU country. ... current cert expires 31st October; car passes test 30th September; garage issues a new follow-on cert to start on 31st October. ...
    (uk.rec.driving)
  • Re: Driving through Europe
    ... ISTR you can get an MOT post-dated by up to a month if the car passes the ... follow-on cert to start on 31st October. ... With the computerised MOT certificate it may not be necessary to take an old ... for a service and MOT yesterday. ...
    (uk.rec.driving)