I have a Prolog file with the following structure:
% LIBRARY SECTION %
foo(X) :- bar(X);
baz(X).
% USER DATA SECTION %
% e.g. bar(charlie).
The user data of the file is intended to be allowed to extended by the user but by default contains nothing. However this causes the query foo(X).
to fails because bar/1
and baz/1
are not defined.
I have tried defining them with placeholder values (i.e. bar(none).
) but then GNU Prolog complains about discontiguous predicates when user data is added to the bottom of the file.
Is there another way to define a dummy/placeholder version of bar/1
and baz/1
so that foo(X).
does not fail and so that other lines containing bar
and baz
can be added to the bottom of the file?