mac389
mac389

Reputation: 3133

Separating Knowledge Base from Predicates, get "undefined procedure"

Why isn't father/2 recognized and why can't I load a file that calls father/2?

theogony.pl

father(kronos, zeus).
father(zeus, ares).

mythos.pl

consult('theogony.pl').

%% --
%% X is an ancestor of Y
%% --

ancestor(X,Y) :-
    father(X,Y).

ancestor(X,Y) :-
    ancestor(X,Z),
    ancestor(Z,Y).

swipl

?- consult('mythos.pl'). 
   false.
?- consult('theogony.pl').
   true.
?- father(X,zeus).
   ERROR: Unknown procedure: father/2 (DWIM could not correct goal)

Upvotes: 0

Views: 65

Answers (0)

Related Questions